@pixerate/editor 0.119.0 → 0.120.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 (41) hide show
  1. package/dist/animation-editor/index.cjs +54 -54
  2. package/dist/animation-editor/index.d.cts +3 -3
  3. package/dist/animation-editor/index.d.ts +3 -3
  4. package/dist/animation-editor/index.js +2 -2
  5. package/dist/{chunk-KZLQY4CD.js → chunk-BOWUU4LJ.js} +2 -2
  6. package/dist/{chunk-KGNUFO4T.cjs → chunk-DFLJHLKA.cjs} +36 -36
  7. package/dist/{chunk-KGNUFO4T.cjs.map → chunk-DFLJHLKA.cjs.map} +1 -1
  8. package/dist/{chunk-4S2AXNQF.cjs → chunk-HTAFDTNR.cjs} +82 -82
  9. package/dist/{chunk-4S2AXNQF.cjs.map → chunk-HTAFDTNR.cjs.map} +1 -1
  10. package/dist/{chunk-LI3KTY7K.cjs → chunk-VYW7JBTM.cjs} +72 -5
  11. package/dist/chunk-VYW7JBTM.cjs.map +1 -0
  12. package/dist/{chunk-TDQDMBUR.js → chunk-WAI6ATHC.js} +2 -2
  13. package/dist/{chunk-CSHEI3YT.js → chunk-WORWH5K5.js} +71 -4
  14. package/dist/chunk-WORWH5K5.js.map +1 -0
  15. package/dist/{export-Ds8Ccw0K.d.ts → export-D2D8hb_u.d.ts} +1 -1
  16. package/dist/{export-B_jO2PrH.d.cts → export-fP2hZYjm.d.cts} +1 -1
  17. package/dist/image-editor/index.cjs +579 -579
  18. package/dist/image-editor/index.d.cts +3 -3
  19. package/dist/image-editor/index.d.ts +3 -3
  20. package/dist/image-editor/index.js +2 -2
  21. package/dist/paint-editor/index.cjs +7 -7
  22. package/dist/paint-editor/index.d.cts +2 -2
  23. package/dist/paint-editor/index.d.ts +2 -2
  24. package/dist/paint-editor/index.js +2 -2
  25. package/dist/{svg-hK0WQc7-.d.cts → svg-S9zzvqaZ.d.cts} +1 -1
  26. package/dist/{svg-CTxrB5xO.d.ts → svg-leZpRsJB.d.ts} +1 -1
  27. package/dist/{types-TrSSh_RB.d.ts → types-BgwxFWvn.d.ts} +23 -9
  28. package/dist/{types-Dq-8qgoo.d.cts → types-DdRTDnza.d.cts} +23 -9
  29. package/dist/vector/index.cjs +874 -872
  30. package/dist/vector/index.cjs.map +1 -1
  31. package/dist/vector/index.d.cts +12 -5
  32. package/dist/vector/index.d.ts +12 -5
  33. package/dist/vector/index.js +7 -5
  34. package/dist/vector/index.js.map +1 -1
  35. package/package.json +1 -1
  36. package/skills/pixerate-vector/SKILL.md +1 -1
  37. package/skills/pixerate-vector/references/commands.md +1 -0
  38. package/dist/chunk-CSHEI3YT.js.map +0 -1
  39. package/dist/chunk-LI3KTY7K.cjs.map +0 -1
  40. /package/dist/{chunk-KZLQY4CD.js.map → chunk-BOWUU4LJ.js.map} +0 -0
  41. /package/dist/{chunk-TDQDMBUR.js.map → chunk-WAI6ATHC.js.map} +0 -0
@@ -358,7 +358,7 @@ var _chunk2OJACTPRcjs = require('../chunk-2OJACTPR.cjs');
358
358
 
359
359
 
360
360
 
361
- var _chunk4S2AXNQFcjs = require('../chunk-4S2AXNQF.cjs');
361
+ var _chunkHTAFDTNRcjs = require('../chunk-HTAFDTNR.cjs');
362
362
 
363
363
 
364
364
  var _chunkD6FH2YAXcjs = require('../chunk-D6FH2YAX.cjs');
@@ -727,7 +727,7 @@ var _chunk643B2HKCcjs = require('../chunk-643B2HKC.cjs');
727
727
 
728
728
 
729
729
 
730
- var _chunkLI3KTY7Kcjs = require('../chunk-LI3KTY7K.cjs');
730
+ var _chunkVYW7JBTMcjs = require('../chunk-VYW7JBTM.cjs');
731
731
  require('../chunk-XGD3FSNC.cjs');
732
732
  require('../chunk-MR3Z4OQI.cjs');
733
733
  require('../chunk-A6PHCAGX.cjs');
@@ -835,7 +835,7 @@ function quickMaskPixels(mask, style = {}) {
835
835
 
836
836
  // src/image-editor/layers/render.ts
837
837
  function isQuarterTurn(rotate) {
838
- return _chunk4S2AXNQFcjs.normalizeAngle.call(void 0, rotate) % 90 === 0;
838
+ return _chunkHTAFDTNRcjs.normalizeAngle.call(void 0, rotate) % 90 === 0;
839
839
  }
840
840
  function isIntegerRect(r) {
841
841
  return Number.isInteger(r.x) && Number.isInteger(r.y) && Number.isInteger(r.width) && Number.isInteger(r.height);
@@ -843,7 +843,7 @@ function isIntegerRect(r) {
843
843
  function baseProjection(region, transform, baseW, baseH) {
844
844
  return {
845
845
  region,
846
- angle: _chunk4S2AXNQFcjs.normalizeAngle.call(void 0, transform.rotate),
846
+ angle: _chunkHTAFDTNRcjs.normalizeAngle.call(void 0, transform.rotate),
847
847
  flipH: transform.flipH,
848
848
  flipV: transform.flipV,
849
849
  scale: 1,
@@ -852,14 +852,14 @@ function baseProjection(region, transform, baseW, baseH) {
852
852
  };
853
853
  }
854
854
  function projectQuarterTurn(src, srcRect, region, transform) {
855
- const rotated = _chunk4S2AXNQFcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
855
+ const rotated = _chunkHTAFDTNRcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
856
856
  const w = Math.max(1, Math.round(rotated.width));
857
857
  const h = Math.max(1, Math.round(rotated.height));
858
858
  const out = new Uint8ClampedArray(w * h * 4);
859
859
  const p = baseProjection(region, transform, w, h);
860
- const o = _chunk4S2AXNQFcjs.unprojectCanvasPoint.call(void 0, { x: 0.5, y: 0.5 }, p);
861
- const ox = _chunk4S2AXNQFcjs.unprojectCanvasPoint.call(void 0, { x: 1.5, y: 0.5 }, p);
862
- const oy = _chunk4S2AXNQFcjs.unprojectCanvasPoint.call(void 0, { x: 0.5, y: 1.5 }, p);
860
+ const o = _chunkHTAFDTNRcjs.unprojectCanvasPoint.call(void 0, { x: 0.5, y: 0.5 }, p);
861
+ const ox = _chunkHTAFDTNRcjs.unprojectCanvasPoint.call(void 0, { x: 1.5, y: 0.5 }, p);
862
+ const oy = _chunkHTAFDTNRcjs.unprojectCanvasPoint.call(void 0, { x: 0.5, y: 1.5 }, p);
863
863
  const ux = Math.round(ox.x - o.x);
864
864
  const vx = Math.round(ox.y - o.y);
865
865
  const uy = Math.round(oy.x - o.x);
@@ -888,23 +888,23 @@ function applyOutputStage(img, opacity, legacyOutputBlur) {
888
888
  const d = img.data;
889
889
  for (let i = 3; i < d.length; i += 4) d[i] = d[i] * opacity;
890
890
  }
891
- if (legacyOutputBlur && legacyOutputBlur > 0) _chunk4S2AXNQFcjs.applyBoxBlur.call(void 0, img, Math.min(Math.round(legacyOutputBlur), 40));
891
+ if (legacyOutputBlur && legacyOutputBlur > 0) _chunkHTAFDTNRcjs.applyBoxBlur.call(void 0, img, Math.min(Math.round(legacyOutputBlur), 40));
892
892
  }
893
893
  function needsLegacyBase(input) {
894
894
  const { stack, region, canvas, transform } = input;
895
- if (!_chunk4S2AXNQFcjs.isLegacyShape.call(void 0, stack)) return false;
895
+ if (!_chunkHTAFDTNRcjs.isLegacyShape.call(void 0, stack)) return false;
896
896
  const bg = stack.layers[0];
897
897
  if (!isQuarterTurn(transform.rotate) || !isIntegerRect(region)) return true;
898
898
  if (_optionalChain([bg, 'access', _2 => _2.mask, 'optionalAccess', _3 => _3.source, 'optionalAccess', _4 => _4.enabled]) && bg.mask.source.maskSource) return true;
899
899
  if (stack.outputOpacity < 1) return true;
900
- const blur = _chunk4S2AXNQFcjs.blurFilter.call(void 0, bg);
900
+ const blur = _chunkHTAFDTNRcjs.blurFilter.call(void 0, bg);
901
901
  if (blur && blur.enabled && blur.radius > 0) {
902
902
  const full = region.x === 0 && region.y === 0 && region.width === canvas.width && region.height === canvas.height;
903
- const angle = _chunk4S2AXNQFcjs.normalizeAngle.call(void 0, transform.rotate);
903
+ const angle = _chunkHTAFDTNRcjs.normalizeAngle.call(void 0, transform.rotate);
904
904
  if (!full || angle === 90 || angle === 270) return true;
905
905
  }
906
906
  if ((_nullishCoalesce(stack.legacyOutputBlur, () => ( 0))) > 0 && !input.sourceOpaque) return true;
907
- if (_chunk4S2AXNQFcjs.hasResampledLegacyMask.call(void 0, stack.layers, canvas.width, canvas.height)) return true;
907
+ if (_chunkHTAFDTNRcjs.hasResampledLegacyMask.call(void 0, stack.layers, canvas.width, canvas.height)) return true;
908
908
  return false;
909
909
  }
910
910
  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;
@@ -936,7 +936,7 @@ function coveringRect(region) {
936
936
  const y = Math.floor(region.y);
937
937
  return { x, y, width: Math.ceil(region.x + region.width) - x, height: Math.ceil(region.y + region.height) - y };
938
938
  }
939
- function renderLayeredBase(stack, region, transform, sources, compositor = new (0, _chunk4S2AXNQFcjs.LayerCompositor)()) {
939
+ function renderLayeredBase(stack, region, transform, sources, compositor = new (0, _chunkHTAFDTNRcjs.LayerCompositor)()) {
940
940
  if (!isQuarterTurn(transform.rotate) || !isIntegerRect(region)) {
941
941
  throw new Error("renderLayeredBase needs an integer region and a quarter-turn rotation.");
942
942
  }
@@ -1070,8 +1070,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1070
1070
  * The viewport's compositor. It only ever composites the viewport's stack, so its tile cache can
1071
1071
  * trust dirty rectangles; exports use `exportCompositor`.
1072
1072
  */
1073
- __init8() {this.compositor = new (0, _chunk4S2AXNQFcjs.LayerCompositor)()}
1074
- __init9() {this.exportCompositor = new (0, _chunk4S2AXNQFcjs.LayerCompositor)({ maxCacheBytes: 64 * 1024 * 1024 })}
1073
+ __init8() {this.compositor = new (0, _chunkHTAFDTNRcjs.LayerCompositor)()}
1074
+ __init9() {this.exportCompositor = new (0, _chunkHTAFDTNRcjs.LayerCompositor)({ maxCacheBytes: 64 * 1024 * 1024 })}
1075
1075
  /** How the host resolves layer pixels (set by the controller). */
1076
1076
 
1077
1077
  /**
@@ -1148,9 +1148,9 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1148
1148
  return;
1149
1149
  }
1150
1150
  const isActivelyCropping = Boolean(options.showCropOverlay || state.activeTool === "crop");
1151
- const projection = _chunk4S2AXNQFcjs.getViewportProjection.call(void 0, geoState, vpWidth, vpHeight, isActivelyCropping);
1151
+ const projection = _chunkHTAFDTNRcjs.getViewportProjection.call(void 0, geoState, vpWidth, vpHeight, isActivelyCropping);
1152
1152
  const { region } = projection;
1153
- const rotated = _chunk4S2AXNQFcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
1153
+ const rotated = _chunkHTAFDTNRcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
1154
1154
  const route = this.chooseRoute(state, region, naturalWidth, naturalHeight);
1155
1155
  let overlay = annotations;
1156
1156
  if (route === "legacy") {
@@ -1160,8 +1160,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1160
1160
  `${naturalWidth}x${naturalHeight}`,
1161
1161
  `${region.x},${region.y},${region.width},${region.height}`,
1162
1162
  `${projection.angle},${transform.flipH},${transform.flipV}`,
1163
- `${adjustments.brightness},${adjustments.contrast},${adjustments.saturation},${adjustments.exposure},${adjustments.temperature},${_nullishCoalesce(adjustments.tint, () => ( 0))},${adjustments.blur},${adjustments.opacity},p${_chunk4S2AXNQFcjs.normalizeProcessVersion.call(void 0, adjustments.process)}`,
1164
- _chunk4S2AXNQFcjs.adjustmentLayersKey.call(void 0, adjustments.layers),
1163
+ `${adjustments.brightness},${adjustments.contrast},${adjustments.saturation},${adjustments.exposure},${adjustments.temperature},${_nullishCoalesce(adjustments.tint, () => ( 0))},${adjustments.blur},${adjustments.opacity},p${_chunkHTAFDTNRcjs.normalizeProcessVersion.call(void 0, adjustments.process)}`,
1164
+ _chunkHTAFDTNRcjs.adjustmentLayersKey.call(void 0, adjustments.layers),
1165
1165
  `${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}`,
1166
1166
  `d${this.displayKey}`
1167
1167
  ].join("|");
@@ -1195,7 +1195,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1195
1195
  }
1196
1196
  if (overlay.length > 0 || options.draftAnnotation) {
1197
1197
  ctx.save();
1198
- _chunk4S2AXNQFcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
1198
+ _chunkHTAFDTNRcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
1199
1199
  ctx.beginPath();
1200
1200
  ctx.rect(region.x, region.y, region.width, region.height);
1201
1201
  ctx.clip();
@@ -1218,7 +1218,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1218
1218
  if (_optionalChain([state, 'access', _15 => _15.selection, 'optionalAccess', _16 => _16.bounds]) && display !== "none" || _optionalChain([options, 'access', _17 => _17.draftSelectionPath, 'optionalAccess', _18 => _18.length])) {
1219
1219
  ctx.save();
1220
1220
  try {
1221
- _chunk4S2AXNQFcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
1221
+ _chunkHTAFDTNRcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
1222
1222
  ctx.beginPath();
1223
1223
  ctx.rect(region.x, region.y, region.width, region.height);
1224
1224
  ctx.clip();
@@ -1233,7 +1233,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1233
1233
  const b = options.brushCursor;
1234
1234
  ctx.save();
1235
1235
  try {
1236
- _chunk4S2AXNQFcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
1236
+ _chunkHTAFDTNRcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
1237
1237
  const px2 = 1 / (projection.scale || 1);
1238
1238
  ctx.beginPath();
1239
1239
  ctx.arc(b.x, b.y, Math.max(px2, b.diameter / 2), 0, Math.PI * 2);
@@ -1251,7 +1251,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1251
1251
  const t = options.textEdit;
1252
1252
  ctx.save();
1253
1253
  try {
1254
- const scr = (p) => _chunk4S2AXNQFcjs.projectImagePoint.call(void 0, p, projection);
1254
+ const scr = (p) => _chunkHTAFDTNRcjs.projectImagePoint.call(void 0, p, projection);
1255
1255
  const poly = (pts) => {
1256
1256
  ctx.beginPath();
1257
1257
  pts.map(scr).forEach((p, i) => i ? ctx.lineTo(p.x, p.y) : ctx.moveTo(p.x, p.y));
@@ -1290,7 +1290,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1290
1290
  const t = options.freeTransform;
1291
1291
  ctx.save();
1292
1292
  try {
1293
- const scr = (p) => _chunk4S2AXNQFcjs.projectImagePoint.call(void 0, p, projection);
1293
+ const scr = (p) => _chunkHTAFDTNRcjs.projectImagePoint.call(void 0, p, projection);
1294
1294
  ctx.beginPath();
1295
1295
  if (t.warp) {
1296
1296
  for (const c of t.warp.curves) {
@@ -1348,7 +1348,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1348
1348
  }
1349
1349
  if (isActivelyCropping) {
1350
1350
  const activeCrop = options.draftCrop !== void 0 && options.draftCrop !== null ? options.draftCrop : _nullishCoalesce(crop, () => ( { x: 0, y: 0, width: naturalWidth, height: naturalHeight }));
1351
- this.drawCropOverlay(ctx, _chunk4S2AXNQFcjs.getViewportMetrics.call(void 0, geoState, vpWidth, vpHeight, true, activeCrop));
1351
+ this.drawCropOverlay(ctx, _chunkHTAFDTNRcjs.getViewportMetrics.call(void 0, geoState, vpWidth, vpHeight, true, activeCrop));
1352
1352
  }
1353
1353
  }
1354
1354
  /**
@@ -1357,7 +1357,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1357
1357
  */
1358
1358
  async renderBaseImage(img, naturalWidth, naturalHeight, region, transform, state, onPixels) {
1359
1359
  const { adjustments, depthMask } = state;
1360
- const rotated = _chunk4S2AXNQFcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
1360
+ const rotated = _chunkHTAFDTNRcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
1361
1361
  const baseW = Math.max(1, Math.round(rotated.width));
1362
1362
  const baseH = Math.max(1, Math.round(rotated.height));
1363
1363
  const baseCanvas = this.createCanvas(baseW, baseH);
@@ -1365,7 +1365,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1365
1365
  if (!baseCtx) return baseCanvas;
1366
1366
  const projection = getBaseProjection(region, transform, baseW, baseH);
1367
1367
  baseCtx.save();
1368
- _chunk4S2AXNQFcjs.applyImageProjectionToContext.call(void 0, baseCtx, projection);
1368
+ _chunkHTAFDTNRcjs.applyImageProjectionToContext.call(void 0, baseCtx, projection);
1369
1369
  baseCtx.drawImage(
1370
1370
  img,
1371
1371
  region.x,
@@ -1380,8 +1380,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1380
1380
  baseCtx.restore();
1381
1381
  const imageData = baseCtx.getImageData(0, 0, baseW, baseH);
1382
1382
  if (imageData) {
1383
- const layerMasks = _chunk4S2AXNQFcjs.buildLayerMaskPlanes.call(void 0, adjustments.layers, naturalWidth, naturalHeight, projection, baseW, baseH);
1384
- _chunk4S2AXNQFcjs.applyAdjustments.call(void 0, imageData, adjustments, layerMasks ? { layerMasks } : {});
1383
+ const layerMasks = _chunkHTAFDTNRcjs.buildLayerMaskPlanes.call(void 0, adjustments.layers, naturalWidth, naturalHeight, projection, baseW, baseH);
1384
+ _chunkHTAFDTNRcjs.applyAdjustments.call(void 0, imageData, adjustments, layerMasks ? { layerMasks } : {});
1385
1385
  if (depthMask.enabled && depthMask.maskSource) {
1386
1386
  try {
1387
1387
  const maskImg = await this.imageCache.get(depthMask.maskSource);
@@ -1392,7 +1392,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1392
1392
  const maskCtx = maskCanvas.getContext("2d");
1393
1393
  if (maskCtx) {
1394
1394
  maskCtx.save();
1395
- _chunk4S2AXNQFcjs.applyImageProjectionToContext.call(void 0, maskCtx, projection);
1395
+ _chunkHTAFDTNRcjs.applyImageProjectionToContext.call(void 0, maskCtx, projection);
1396
1396
  maskCtx.drawImage(
1397
1397
  maskImg,
1398
1398
  region.x * sx,
@@ -1407,7 +1407,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1407
1407
  maskCtx.restore();
1408
1408
  const maskData = maskCtx.getImageData(0, 0, baseW, baseH);
1409
1409
  if (maskData) {
1410
- _chunk4S2AXNQFcjs.applyDepthMask.call(void 0, imageData, maskData, depthMask);
1410
+ _chunkHTAFDTNRcjs.applyDepthMask.call(void 0, imageData, maskData, depthMask);
1411
1411
  }
1412
1412
  }
1413
1413
  } catch (e7) {
@@ -1426,7 +1426,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1426
1426
  else if (this.baseRoute === "layers") route = "layers";
1427
1427
  else {
1428
1428
  const stack = { layers: state.layers, outputOpacity: _nullishCoalesce(state.outputOpacity, () => ( 1)), legacyOutputBlur: state.legacyOutputBlur };
1429
- const shaped = this.baseRoute === "legacy" && _chunk4S2AXNQFcjs.isLegacyShape.call(void 0, stack);
1429
+ const shaped = this.baseRoute === "legacy" && _chunkHTAFDTNRcjs.isLegacyShape.call(void 0, stack);
1430
1430
  route = shaped || needsLegacyBase({
1431
1431
  stack,
1432
1432
  region,
@@ -1561,17 +1561,17 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1561
1561
  if (!comp) return null;
1562
1562
  const opacity = _nullishCoalesce(state.outputOpacity, () => ( 1));
1563
1563
  const blur = _nullishCoalesce(state.legacyOutputBlur, () => ( 0));
1564
- const rotated = _chunk4S2AXNQFcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
1564
+ const rotated = _chunkHTAFDTNRcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
1565
1565
  const baseW = Math.max(1, Math.round(rotated.width));
1566
1566
  const baseH = Math.max(1, Math.round(rotated.height));
1567
- const key = `${this.displayKey}:${comp.version}|${region.x},${region.y},${region.width},${region.height}|${_chunk4S2AXNQFcjs.normalizeAngle.call(void 0, transform.rotate)},${transform.flipH},${transform.flipV}|${opacity}|${blur}`;
1567
+ const key = `${this.displayKey}:${comp.version}|${region.x},${region.y},${region.width},${region.height}|${_chunkHTAFDTNRcjs.normalizeAngle.call(void 0, transform.rotate)},${transform.flipH},${transform.flipV}|${opacity}|${blur}`;
1568
1568
  if (this.cachedPostCanvas && this.cachedPostKey === key) return { canvas: this.cachedPostCanvas, histogram: this.cachedPostHistogram };
1569
1569
  const canvas = this.cachedPostCanvas && this.cachedPostCanvas.width === baseW && this.cachedPostCanvas.height === baseH ? this.cachedPostCanvas : this.createCanvas(baseW, baseH);
1570
1570
  const ctx = canvas.getContext("2d");
1571
1571
  if (!ctx) return null;
1572
1572
  ctx.clearRect(0, 0, baseW, baseH);
1573
1573
  ctx.save();
1574
- _chunk4S2AXNQFcjs.applyImageProjectionToContext.call(void 0, ctx, baseProjection(region, transform, baseW, baseH));
1574
+ _chunkHTAFDTNRcjs.applyImageProjectionToContext.call(void 0, ctx, baseProjection(region, transform, baseW, baseH));
1575
1575
  ctx.beginPath();
1576
1576
  ctx.rect(region.x, region.y, region.width, region.height);
1577
1577
  ctx.clip();
@@ -1843,7 +1843,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1843
1843
  ctx.strokeStyle = "#3b82f6";
1844
1844
  ctx.lineWidth = 1.5;
1845
1845
  ctx.setLineDash([4, 4]);
1846
- const bounds = _chunk4S2AXNQFcjs.getAnnotationBounds.call(void 0, ann);
1846
+ const bounds = _chunkHTAFDTNRcjs.getAnnotationBounds.call(void 0, ann);
1847
1847
  const pad = 4;
1848
1848
  ctx.strokeRect(bounds.x - pad, bounds.y - pad, bounds.width + pad * 2, bounds.height + pad * 2);
1849
1849
  ctx.fillStyle = "#ffffff";
@@ -1864,7 +1864,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1864
1864
  }
1865
1865
  /** @deprecated Use the standalone `getAnnotationBounds` from the geometry module. */
1866
1866
  getAnnotationBounds(ann) {
1867
- return _chunk4S2AXNQFcjs.getAnnotationBounds.call(void 0, ann);
1867
+ return _chunkHTAFDTNRcjs.getAnnotationBounds.call(void 0, ann);
1868
1868
  }
1869
1869
  /**
1870
1870
  * Draws a rule-of-thirds crop grid overlay. All rectangles come from
@@ -1946,8 +1946,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1946
1946
  }
1947
1947
  const { width: naturalWidth, height: naturalHeight } = getSourceSize(img);
1948
1948
  const { crop, transform, annotations } = state;
1949
- const region = crop ? _chunk4S2AXNQFcjs.clampCropToImage.call(void 0, crop, naturalWidth, naturalHeight) : { x: 0, y: 0, width: naturalWidth, height: naturalHeight };
1950
- const rotated = _chunk4S2AXNQFcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
1949
+ const region = crop ? _chunkHTAFDTNRcjs.clampCropToImage.call(void 0, crop, naturalWidth, naturalHeight) : { x: 0, y: 0, width: naturalWidth, height: naturalHeight };
1950
+ const rotated = _chunkHTAFDTNRcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
1951
1951
  const baseW = Math.max(1, Math.round(rotated.width));
1952
1952
  const baseH = Math.max(1, Math.round(rotated.height));
1953
1953
  const exportW = options.width || baseW;
@@ -1976,7 +1976,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1976
1976
  const bctx = baseCanvas.getContext("2d");
1977
1977
  if (bctx) {
1978
1978
  bctx.save();
1979
- _chunk4S2AXNQFcjs.applyImageProjectionToContext.call(void 0, bctx, baseProjection(region, transform, baseW, baseH));
1979
+ _chunkHTAFDTNRcjs.applyImageProjectionToContext.call(void 0, bctx, baseProjection(region, transform, baseW, baseH));
1980
1980
  bctx.beginPath();
1981
1981
  bctx.rect(region.x, region.y, region.width, region.height);
1982
1982
  bctx.clip();
@@ -1989,7 +1989,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1989
1989
  if (options.includeAnnotations !== false && overlay.length > 0) {
1990
1990
  ctx.save();
1991
1991
  ctx.scale(exportW / baseW, exportH / baseH);
1992
- _chunk4S2AXNQFcjs.applyImageProjectionToContext.call(void 0, ctx, getBaseProjection(region, transform, baseW, baseH));
1992
+ _chunkHTAFDTNRcjs.applyImageProjectionToContext.call(void 0, ctx, getBaseProjection(region, transform, baseW, baseH));
1993
1993
  for (const ann of overlay) {
1994
1994
  await this.drawAnnotation(ctx, ann);
1995
1995
  }
@@ -2079,7 +2079,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
2079
2079
  case "rect":
2080
2080
  case "image":
2081
2081
  case "text": {
2082
- const b = _chunk4S2AXNQFcjs.getAnnotationBounds.call(void 0, ann);
2082
+ const b = _chunkHTAFDTNRcjs.getAnnotationBounds.call(void 0, ann);
2083
2083
  ctx.fillRect(b.x, b.y, b.width, b.height);
2084
2084
  break;
2085
2085
  }
@@ -2099,7 +2099,7 @@ function getSourceSize(img, fallbackW = 800, fallbackH = 600) {
2099
2099
  function getBaseProjection(region, transform, baseW, baseH) {
2100
2100
  return {
2101
2101
  region,
2102
- angle: _chunk4S2AXNQFcjs.normalizeAngle.call(void 0, transform.rotate),
2102
+ angle: _chunkHTAFDTNRcjs.normalizeAngle.call(void 0, transform.rotate),
2103
2103
  flipH: transform.flipH,
2104
2104
  flipV: transform.flipV,
2105
2105
  scale: 1,
@@ -2203,8 +2203,8 @@ function polygonCoverage(points, width, height, antiAlias = true) {
2203
2203
  }
2204
2204
  function toMask(width, height, coverage) {
2205
2205
  const out = new Uint8Array(coverage.length);
2206
- for (let i = 0; i < out.length; i++) out[i] = _chunk4S2AXNQFcjs.coverageToByte.call(void 0, coverage[i]);
2207
- return _chunk4S2AXNQFcjs.createSelectionMask.call(void 0, width, height, out);
2206
+ for (let i = 0; i < out.length; i++) out[i] = _chunkHTAFDTNRcjs.coverageToByte.call(void 0, coverage[i]);
2207
+ return _chunkHTAFDTNRcjs.createSelectionMask.call(void 0, width, height, out);
2208
2208
  }
2209
2209
  function polygonSelection(width, height, points, options = {}) {
2210
2210
  return toMask(width, height, polygonCoverage(points, width, height, _nullishCoalesce(options.antiAlias, () => ( true))));
@@ -2331,7 +2331,7 @@ function magicWand(pixels, seed, options = {}) {
2331
2331
  const { width: w, height: h } = pixels;
2332
2332
  const sx = Math.floor(seed.x);
2333
2333
  const sy = Math.floor(seed.y);
2334
- if (!(sx >= 0 && sy >= 0 && sx < w && sy < h)) return _chunk4S2AXNQFcjs.createSelectionMask.call(void 0, w, h);
2334
+ if (!(sx >= 0 && sy >= 0 && sx < w && sy < h)) return _chunkHTAFDTNRcjs.createSelectionMask.call(void 0, w, h);
2335
2335
  const similar = similarity(pixels, sy * w + sx, _nullishCoalesce(options.tolerance, () => ( 32)), _nullishCoalesce(options.distance, () => ( "rgb")));
2336
2336
  const marks = new Uint8Array(n);
2337
2337
  let bx0 = w;
@@ -2379,9 +2379,9 @@ function magicWand(pixels, seed, options = {}) {
2379
2379
  }
2380
2380
  }
2381
2381
  }
2382
- if (bx1 < 0) return _chunk4S2AXNQFcjs.createSelectionMask.call(void 0, w, h);
2383
- if (!(_nullishCoalesce(options.antiAlias, () => ( true)))) return _chunk4S2AXNQFcjs.createSelectionMask.call(void 0, w, h, marks);
2384
- return _chunk4S2AXNQFcjs.createSelectionMask.call(void 0,
2382
+ if (bx1 < 0) return _chunkHTAFDTNRcjs.createSelectionMask.call(void 0, w, h);
2383
+ if (!(_nullishCoalesce(options.antiAlias, () => ( true)))) return _chunkHTAFDTNRcjs.createSelectionMask.call(void 0, w, h, marks);
2384
+ return _chunkHTAFDTNRcjs.createSelectionMask.call(void 0,
2385
2385
  w,
2386
2386
  h,
2387
2387
  antialiasMarks(marks, w, h, Math.max(0, bx0 - 1), Math.max(0, by0 - 1), Math.min(w, bx1 + 2), Math.min(h, by1 + 2))
@@ -2403,7 +2403,7 @@ function colorRange(pixels, samples, options = {}) {
2403
2403
  const parsed = samples.map((s) => ({ c: sampleColor(s.color), at: s.at }));
2404
2404
  const radius = options.localized !== void 0 ? Math.max(1, options.localized) : void 0;
2405
2405
  const out = new Uint8Array(n);
2406
- if (!parsed.length) return _chunk4S2AXNQFcjs.createSelectionMask.call(void 0, w, h, out);
2406
+ if (!parsed.length) return _chunkHTAFDTNRcjs.createSelectionMask.call(void 0, w, h, out);
2407
2407
  for (let i = 0; i < n; i++) {
2408
2408
  const p = i * 4;
2409
2409
  if (data[p + 3] <= 0) continue;
@@ -2419,9 +2419,9 @@ function colorRange(pixels, samples, options = {}) {
2419
2419
  }
2420
2420
  if (k > best) best = k;
2421
2421
  }
2422
- out[i] = _chunk4S2AXNQFcjs.coverageToByte.call(void 0, best);
2422
+ out[i] = _chunkHTAFDTNRcjs.coverageToByte.call(void 0, best);
2423
2423
  }
2424
- return _chunk4S2AXNQFcjs.createSelectionMask.call(void 0, w, h, out);
2424
+ return _chunkHTAFDTNRcjs.createSelectionMask.call(void 0, w, h, out);
2425
2425
  }
2426
2426
  var TONE_RANGE_PRESETS = {
2427
2427
  shadows: [0, 65],
@@ -2439,9 +2439,9 @@ function toneRange(pixels, range, falloff = 20) {
2439
2439
  if (d[p + 3] <= 0) continue;
2440
2440
  const l = Math.min(255, Math.max(0, 0.299 * d[p] + 0.587 * d[p + 1] + 0.114 * d[p + 2]));
2441
2441
  const outside = l < lo ? lo - l : l > hi ? l - hi : 0;
2442
- out[i] = _chunk4S2AXNQFcjs.coverageToByte.call(void 0, 1 - outside / ramp);
2442
+ out[i] = _chunkHTAFDTNRcjs.coverageToByte.call(void 0, 1 - outside / ramp);
2443
2443
  }
2444
- return _chunk4S2AXNQFcjs.createSelectionMask.call(void 0, pixels.width, pixels.height, out);
2444
+ return _chunkHTAFDTNRcjs.createSelectionMask.call(void 0, pixels.width, pixels.height, out);
2445
2445
  }
2446
2446
  function hueRange(pixels, center) {
2447
2447
  const n = checkPixels(pixels);
@@ -2464,9 +2464,9 @@ function hueRange(pixels, center) {
2464
2464
  hue *= 60;
2465
2465
  let dh = ((hue - center) % 360 + 360) % 360;
2466
2466
  dh = Math.min(dh, 360 - dh);
2467
- out[i] = _chunk4S2AXNQFcjs.coverageToByte.call(void 0, Math.min(1, Math.max(0, 1 - dh / 60)) * chroma * (2 - mx));
2467
+ out[i] = _chunkHTAFDTNRcjs.coverageToByte.call(void 0, Math.min(1, Math.max(0, 1 - dh / 60)) * chroma * (2 - mx));
2468
2468
  }
2469
- return _chunk4S2AXNQFcjs.createSelectionMask.call(void 0, pixels.width, pixels.height, out);
2469
+ return _chunkHTAFDTNRcjs.createSelectionMask.call(void 0, pixels.width, pixels.height, out);
2470
2470
  }
2471
2471
 
2472
2472
  // src/image-editor/selection/refine.ts
@@ -2600,9 +2600,9 @@ function edgeWidth(guide, w, h, r) {
2600
2600
  g[yy * w + xx] = Math.sqrt(gx * gx + gy * gy);
2601
2601
  }
2602
2602
  }
2603
- const gm = _chunk4S2AXNQFcjs.greyMorphology.call(void 0, g, w, h, r, true);
2604
- const hi = _chunk4S2AXNQFcjs.greyMorphology.call(void 0, y, w, h, r, true);
2605
- const lo = _chunk4S2AXNQFcjs.greyMorphology.call(void 0, y, w, h, r, false);
2603
+ const gm = _chunkHTAFDTNRcjs.greyMorphology.call(void 0, g, w, h, r, true);
2604
+ const hi = _chunkHTAFDTNRcjs.greyMorphology.call(void 0, y, w, h, r, true);
2605
+ const lo = _chunkHTAFDTNRcjs.greyMorphology.call(void 0, y, w, h, r, false);
2606
2606
  const out = new Float32Array(n);
2607
2607
  for (let i = 0; i < n; i++) out[i] = (hi[i] - lo[i]) / Math.max(gm[i], 1e-4);
2608
2608
  return out;
@@ -2626,7 +2626,7 @@ function refineCoverage(guide, m, w, h, params = {}) {
2626
2626
  }
2627
2627
  }
2628
2628
  if (any) {
2629
- const dist = _chunk4S2AXNQFcjs.distanceTransform.call(void 0, boundary, w, h);
2629
+ const dist = _chunkHTAFDTNRcjs.distanceTransform.call(void 0, boundary, w, h);
2630
2630
  const r = gfRadius(p);
2631
2631
  const q = guidedFilterColor(guide, m, w, h, r);
2632
2632
  const widths = p.smartRadius ? edgeWidth(guide, w, h, r) : null;
@@ -2652,7 +2652,7 @@ function refineCoverage(guide, m, w, h, params = {}) {
2652
2652
  for (let i = 0; i < a.length; i++) a[i] = Math.min(1, Math.max(0, (a[i] - 0.5) * gain + 0.5));
2653
2653
  }
2654
2654
  const amount = shiftAmount(p);
2655
- if (Math.abs(amount) >= 1e-4) a = _chunk4S2AXNQFcjs.shiftCoverage.call(void 0, a, w, h, amount);
2655
+ if (Math.abs(amount) >= 1e-4) a = _chunkHTAFDTNRcjs.shiftCoverage.call(void 0, a, w, h, amount);
2656
2656
  return a;
2657
2657
  }
2658
2658
  function guidePlanes(pixels, win) {
@@ -2696,15 +2696,15 @@ function refineSelection(pixels, mask, params = {}) {
2696
2696
  const out = new Uint8Array(mask.width * mask.height);
2697
2697
  for (let y = 0; y < wh; y++) {
2698
2698
  const dst = (y0 + y) * mask.width + x0;
2699
- for (let x = 0; x < ww; x++) out[dst + x] = _chunk4S2AXNQFcjs.coverageToByte.call(void 0, refined[y * ww + x]);
2699
+ for (let x = 0; x < ww; x++) out[dst + x] = _chunkHTAFDTNRcjs.coverageToByte.call(void 0, refined[y * ww + x]);
2700
2700
  }
2701
- return _chunk4S2AXNQFcjs.createSelectionMask.call(void 0, mask.width, mask.height, out);
2701
+ return _chunkHTAFDTNRcjs.createSelectionMask.call(void 0, mask.width, mask.height, out);
2702
2702
  }
2703
2703
 
2704
2704
  // src/image-editor/free-transform.ts
2705
2705
  var FREE_TRANSFORM_CONTENTS = ["auto", "layer", "selection", "selection-copy", "selection-outline"];
2706
2706
  var fail = (message) => {
2707
- throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)(message);
2707
+ throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)(message);
2708
2708
  };
2709
2709
  var T = (x, y) => [1, 0, x, 0, 1, y, 0, 0, 1];
2710
2710
  function previewStep(scale) {
@@ -2813,7 +2813,7 @@ var FreeTransformSession = (_class4 = class {
2813
2813
  } else {
2814
2814
  const id = _nullishCoalesce(init.layerId, () => ( host.activeLayerId()));
2815
2815
  if (!id) fail("No layer given and none is active; pass layerId (see list_layers).");
2816
- const layer = _chunk4S2AXNQFcjs.requireLayer.call(void 0, layers, id).layer;
2816
+ const layer = _chunkHTAFDTNRcjs.requireLayer.call(void 0, layers, id).layer;
2817
2817
  this.layerId = layer.id;
2818
2818
  const mask = layer.mask && !layer.mask.source ? layer.mask : void 0;
2819
2819
  const channel = _nullishCoalesce(init.channel, () => ( (layer.id === host.activeLayerId() ? host.activeTarget() : "pixels")));
@@ -2824,20 +2824,20 @@ var FreeTransformSession = (_class4 = class {
2824
2824
  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.`);
2825
2825
  if (!layer.visible && content !== "selection-copy") fail(`Layer "${layer.name || id}" is hidden; show it before you transform it.`);
2826
2826
  if (content !== "selection-copy") {
2827
- _chunk4S2AXNQFcjs.requireUnlocked.call(void 0, layer, "position", "transform it");
2828
- if (!maskAlone) _chunk4S2AXNQFcjs.requireUnlocked.call(void 0, layer, "pixels", "transform it");
2827
+ _chunkHTAFDTNRcjs.requireUnlocked.call(void 0, layer, "position", "transform it");
2828
+ if (!maskAlone) _chunkHTAFDTNRcjs.requireUnlocked.call(void 0, layer, "pixels", "transform it");
2829
2829
  }
2830
2830
  const o = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
2831
2831
  const pixels = layer.type === "pixel" ? host.pixelsOf(layer) : null;
2832
2832
  if (layer.type === "smart" && !maskAlone) {
2833
2833
  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).`);
2834
- if (!_chunk4S2AXNQFcjs.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.`);
2834
+ if (!_chunkHTAFDTNRcjs.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.`);
2835
2835
  this.smart = layer;
2836
2836
  this.smartObject = true;
2837
- this.startGeometry = _chunk4S2AXNQFcjs.placementGeometry.call(void 0, layer);
2837
+ this.startGeometry = _chunkHTAFDTNRcjs.placementGeometry.call(void 0, layer);
2838
2838
  if (init.interpolation === void 0 && layer.placement.interpolation) this.interp = layer.placement.interpolation;
2839
2839
  this.startInterp = this.interp;
2840
- this.box = _chunk4S2AXNQFcjs.contentsBox.call(void 0, layer.contents);
2840
+ this.box = _chunkHTAFDTNRcjs.contentsBox.call(void 0, layer.contents);
2841
2841
  this.moves = mask && linked ? ["pixels", "mask"] : ["pixels"];
2842
2842
  this.geometryValue = this.startGeometry;
2843
2843
  this.shown = this.startLayers;
@@ -2845,8 +2845,8 @@ var FreeTransformSession = (_class4 = class {
2845
2845
  }
2846
2846
  if (layer.type === "type" && !maskAlone) {
2847
2847
  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).`);
2848
- const frame = _chunk4S2AXNQFcjs.typeFrame.call(void 0, layer, host.textEnv().shaper);
2849
- const m = _chunk4S2AXNQFcjs.textMatrix.call(void 0, layer);
2848
+ const frame = _chunkHTAFDTNRcjs.typeFrame.call(void 0, layer, host.textEnv().shaper);
2849
+ const m = _chunkHTAFDTNRcjs.textMatrix.call(void 0, layer);
2850
2850
  const at = (x, y) => ({ x: m[0] * x + m[2] * y + m[4], y: m[1] * x + m[3] * y + m[5] });
2851
2851
  this.typeTarget = layer;
2852
2852
  this.typeLayer = true;
@@ -2865,7 +2865,7 @@ var FreeTransformSession = (_class4 = class {
2865
2865
  }
2866
2866
  if (layer.type === "shape" && !maskAlone) {
2867
2867
  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).`);
2868
- const g = _chunk4S2AXNQFcjs.shapeGeometryBounds.call(void 0, layer);
2868
+ const g = _chunkHTAFDTNRcjs.shapeGeometryBounds.call(void 0, layer);
2869
2869
  if (!g) fail(`Shape layer "${layer.name || id}" has no path to transform.`);
2870
2870
  const w = Math.max(g.width, 1);
2871
2871
  const h = Math.max(g.height, 1);
@@ -2913,7 +2913,7 @@ var FreeTransformSession = (_class4 = class {
2913
2913
  if (box) {
2914
2914
  const copy = {
2915
2915
  type: "pixel",
2916
- id: _chunk4S2AXNQFcjs.newLayerId.call(void 0, ),
2916
+ id: _chunkHTAFDTNRcjs.newLayerId.call(void 0, ),
2917
2917
  name: `${layer.name || "Layer"} copy`,
2918
2918
  visible: true,
2919
2919
  opacity: 1,
@@ -2937,7 +2937,7 @@ var FreeTransformSession = (_class4 = class {
2937
2937
  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).");
2938
2938
  this.box = box;
2939
2939
  this.moves = moves;
2940
- this.startGeometry = _chunk4S2AXNQFcjs.identityTransform.call(void 0, box);
2940
+ this.startGeometry = _chunkHTAFDTNRcjs.identityTransform.call(void 0, box);
2941
2941
  this.startInterp = this.interp;
2942
2942
  this.geometryValue = this.startGeometry;
2943
2943
  this.shown = this.startLayers;
@@ -3015,8 +3015,8 @@ var FreeTransformSession = (_class4 = class {
3015
3015
  warp: changes.warp === void 0 ? _nullishCoalesce(this.geometryValue.warp, () => ( null)) : changes.warp
3016
3016
  };
3017
3017
  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.");
3018
- if (!_chunk4S2AXNQFcjs.transformMap.call(void 0, next)) fail("These corners fold the frame over itself or through the horizon; keep the quad convex.");
3019
- if (this.typeTarget && (_chunk4S2AXNQFcjs.hasWarp.call(void 0, next) || !_chunk4S2AXNQFcjs.matrixFromCorners.call(void 0, next.box, next.corners))) {
3018
+ if (!_chunkHTAFDTNRcjs.transformMap.call(void 0, next)) fail("These corners fold the frame over itself or through the horizon; keep the quad convex.");
3019
+ if (this.typeTarget && (_chunkHTAFDTNRcjs.hasWarp.call(void 0, next) || !_chunkHTAFDTNRcjs.matrixFromCorners.call(void 0, next.box, next.corners))) {
3020
3020
  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.");
3021
3021
  }
3022
3022
  this.geometryValue = next;
@@ -3028,10 +3028,10 @@ var FreeTransformSession = (_class4 = class {
3028
3028
  if (this.smart) return { layers: this.resampleSmart(final, preview), selection: this.startSelection };
3029
3029
  if (this.typeTarget) return { layers: this.resampleType(), selection: this.startSelection };
3030
3030
  const g = this.geometryValue;
3031
- const identity = _chunk4S2AXNQFcjs.isIdentityTransform.call(void 0, g);
3032
- const warp = _chunk4S2AXNQFcjs.hasWarp.call(void 0, g);
3033
- const h = warp ? null : _chunk4S2AXNQFcjs.geometryHomography.call(void 0, g);
3034
- const f = warp ? _chunk4S2AXNQFcjs.transformMap.call(void 0, g) : null;
3031
+ const identity = _chunkHTAFDTNRcjs.isIdentityTransform.call(void 0, g);
3032
+ const warp = _chunkHTAFDTNRcjs.hasWarp.call(void 0, g);
3033
+ const h = warp ? null : _chunkHTAFDTNRcjs.geometryHomography.call(void 0, g);
3034
+ const f = warp ? _chunkHTAFDTNRcjs.transformMap.call(void 0, g) : null;
3035
3035
  const step = final ? 1 : previewStep(preview.scale);
3036
3036
  const interpolation = final ? this.interp : this.interp === "nearest" ? "nearest" : "bilinear";
3037
3037
  let layers = this.startLayers;
@@ -3075,7 +3075,7 @@ var FreeTransformSession = (_class4 = class {
3075
3075
  if (part.what === "selection") {
3076
3076
  const { width, height } = this.host.canvas();
3077
3077
  const data = new Uint8Array(_chunk7ISPWEJAcjs.readRegion.call(void 0, result, { x: 0, y: 0, width, height }).buffer);
3078
- const next = _chunk4S2AXNQFcjs.createSelectionMask.call(void 0, width, height, data);
3078
+ const next = _chunkHTAFDTNRcjs.createSelectionMask.call(void 0, width, height, data);
3079
3079
  selection = next.bounds ? next : null;
3080
3080
  } else if (part.what === "pixels") {
3081
3081
  layers = _chunkWMRIG4XQcjs.mapLayer.call(void 0, layers, targetId, (l) => {
@@ -3097,14 +3097,14 @@ var FreeTransformSession = (_class4 = class {
3097
3097
  resampleShape(final, preview, warpMap, h) {
3098
3098
  const layer = this.shape;
3099
3099
  let components = layer.components;
3100
- if (!_chunk4S2AXNQFcjs.isIdentityTransform.call(void 0, this.geometryValue)) {
3100
+ if (!_chunkHTAFDTNRcjs.isIdentityTransform.call(void 0, this.geometryValue)) {
3101
3101
  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;
3102
3102
  const map = _nullishCoalesce(warpMap, () => ( ((p) => h ? _chunkEJVDBITDcjs.applyHomography.call(void 0, h, p) : p)));
3103
- components = _chunk4S2AXNQFcjs.transformShapeComponents.call(void 0, layer.components, (p) => _nullishCoalesce(map(p), () => ( p)), affine);
3103
+ components = _chunkHTAFDTNRcjs.transformShapeComponents.call(void 0, layer.components, (p) => _nullishCoalesce(map(p), () => ( p)), affine);
3104
3104
  }
3105
3105
  const moved = { ...layer, components };
3106
3106
  delete moved.annotation;
3107
- const surface = _chunk4S2AXNQFcjs.renderShape.call(void 0, moved, this.host.shapeEnv(), final ? {} : { clip: preview.clip });
3107
+ const surface = _chunkHTAFDTNRcjs.renderShape.call(void 0, moved, this.host.shapeEnv(), final ? {} : { clip: preview.clip });
3108
3108
  return _chunkWMRIG4XQcjs.mapLayer.call(void 0, this.startLayers, layer.id, () => ({ ...moved, surface }));
3109
3109
  }
3110
3110
  /**
@@ -3114,13 +3114,13 @@ var FreeTransformSession = (_class4 = class {
3114
3114
  resampleType() {
3115
3115
  const layer = this.typeTarget;
3116
3116
  const g = this.geometryValue;
3117
- if (_chunk4S2AXNQFcjs.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.");
3118
- const m = _chunk4S2AXNQFcjs.matrixFromCorners.call(void 0, g.box, g.corners);
3117
+ if (_chunkHTAFDTNRcjs.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.");
3118
+ const m = _chunkHTAFDTNRcjs.matrixFromCorners.call(void 0, g.box, g.corners);
3119
3119
  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.");
3120
3120
  const next = { ...layer, transform: m };
3121
3121
  delete next.annotation;
3122
- let layers = _chunkWMRIG4XQcjs.mapLayer.call(void 0, this.startLayers, layer.id, () => _chunk4S2AXNQFcjs.rerenderText.call(void 0, next, this.host.textEnv()));
3123
- const change = _chunkEJVDBITDcjs.multiplyHomographies.call(void 0, _chunkEJVDBITDcjs.homographyFromAffine.call(void 0, _chunkLI3KTY7Kcjs.invertMatrix.call(void 0, _chunk4S2AXNQFcjs.textMatrix.call(void 0, layer))), _chunkEJVDBITDcjs.homographyFromAffine.call(void 0, m));
3122
+ let layers = _chunkWMRIG4XQcjs.mapLayer.call(void 0, this.startLayers, layer.id, () => _chunkHTAFDTNRcjs.rerenderText.call(void 0, next, this.host.textEnv()));
3123
+ const change = _chunkEJVDBITDcjs.multiplyHomographies.call(void 0, _chunkEJVDBITDcjs.homographyFromAffine.call(void 0, _chunkVYW7JBTMcjs.invertMatrix.call(void 0, _chunkHTAFDTNRcjs.textMatrix.call(void 0, layer))), _chunkEJVDBITDcjs.homographyFromAffine.call(void 0, m));
3124
3124
  for (const part of this.parts) {
3125
3125
  if (part.what !== "mask") continue;
3126
3126
  const surface = _chunkWMRIG4XQcjs.transformSurface.call(void 0, part.moving, change, { interpolation: this.interp === "nearest" ? "nearest" : "bilinear" });
@@ -3136,12 +3136,12 @@ var FreeTransformSession = (_class4 = class {
3136
3136
  const canvas = this.host.canvas();
3137
3137
  try {
3138
3138
  if (final) {
3139
- const res = _chunk4S2AXNQFcjs.setSmartPlacement.call(void 0, this.startLayers, layer.id, placement, canvas);
3139
+ const res = _chunkHTAFDTNRcjs.setSmartPlacement.call(void 0, this.startLayers, layer.id, placement, canvas);
3140
3140
  this.smartMasksMoved = res.masksMoved;
3141
3141
  return res.layers;
3142
3142
  }
3143
3143
  const step = previewStep(preview.scale);
3144
- const surface = _chunk4S2AXNQFcjs.renderSmartObject.call(void 0, { ...layer, placement }, canvas, { step, clip: preview.clip, skipFilters: true, reduced: this.smartReduced });
3144
+ const surface = _chunkHTAFDTNRcjs.renderSmartObject.call(void 0, { ...layer, placement }, canvas, { step, clip: preview.clip, skipFilters: true, reduced: this.smartReduced });
3145
3145
  return _chunkWMRIG4XQcjs.mapLayer.call(void 0, this.startLayers, layer.id, (l) => ({ ...l, placement, surface }));
3146
3146
  } catch (e) {
3147
3147
  if (e instanceof _chunkWMRIG4XQcjs.TransformTooLargeError) fail(e.message);
@@ -3151,10 +3151,10 @@ var FreeTransformSession = (_class4 = class {
3151
3151
  /** Whether the geometry (or the interpolation of a smart object) differs from where it started. */
3152
3152
  isChanged() {
3153
3153
  const g = this.geometryValue;
3154
- if (!this.smart && !this.typeTarget) return !_chunk4S2AXNQFcjs.isIdentityTransform.call(void 0, g);
3154
+ if (!this.smart && !this.typeTarget) return !_chunkHTAFDTNRcjs.isIdentityTransform.call(void 0, g);
3155
3155
  const a = this.startGeometry;
3156
3156
  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);
3157
- const warp = (w, box) => w && _chunk4S2AXNQFcjs.hasWarp.call(void 0, { box, corners: a.corners, warp: w }) ? JSON.stringify(w) : "";
3157
+ const warp = (w, box) => w && _chunkHTAFDTNRcjs.hasWarp.call(void 0, { box, corners: a.corners, warp: w }) ? JSON.stringify(w) : "";
3158
3158
  return !same || warp(g.warp, g.box) !== warp(a.warp, a.box) || this.interp !== this.startInterp;
3159
3159
  }
3160
3160
  render(preview) {
@@ -3377,7 +3377,7 @@ function convertSurfaceColors(surface, t) {
3377
3377
  }
3378
3378
 
3379
3379
  // src/image-editor/controller.ts
3380
- var IMAGE_EDITOR_SCHEMA_VERSION = _chunk4S2AXNQFcjs.LAYERED_SCHEMA_VERSION;
3380
+ var IMAGE_EDITOR_SCHEMA_VERSION = _chunkHTAFDTNRcjs.LAYERED_SCHEMA_VERSION;
3381
3381
  var RETOUCH_TOOLS = ["clone", "heal", "spot-heal", "smudge", "dodge", "burn", "sponge"];
3382
3382
  var isRetouchTool = (tool) => RETOUCH_TOOLS.includes(tool);
3383
3383
  var STROKE_TOOLS = ["brush", "eraser", "mixer", ...RETOUCH_TOOLS];
@@ -3571,7 +3571,7 @@ var PaintStrokeSession = (_class5 = class {
3571
3571
  for (const t of _chunk7ISPWEJAcjs.tilesInRect.call(void 0, { x: r.x - this.apply.offset.x, y: r.y - this.apply.offset.y, width: r.width, height: r.height })) {
3572
3572
  const key = _chunk7ISPWEJAcjs.tileKey.call(void 0, t.tx, t.ty);
3573
3573
  const cur = regions.get(key);
3574
- regions.set(key, { tx: t.tx, ty: t.ty, r: cur ? _chunk4S2AXNQFcjs.unionRect.call(void 0, cur.r, r) : r });
3574
+ regions.set(key, { tx: t.tx, ty: t.ty, r: cur ? _chunkHTAFDTNRcjs.unionRect.call(void 0, cur.r, r) : r });
3575
3575
  }
3576
3576
  }
3577
3577
  for (const [key, { tx, ty, r }] of regions) {
@@ -3603,7 +3603,7 @@ var PaintStrokeSession = (_class5 = class {
3603
3603
  }
3604
3604
  /** Finishes the stroke (one undo step) and returns what changed. */
3605
3605
  end() {
3606
- if (this.closed) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("This stroke has already ended.");
3606
+ if (this.closed) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("This stroke has already ended.");
3607
3607
  const last = _nullishCoalesce(this.last, () => ( void 0));
3608
3608
  const rects = this.mixer ? this.mixer.finish(last) : this.stroke.finish(last);
3609
3609
  _optionalChain([this, 'access', _109 => _109.flushView, 'optionalCall', _110 => _110()]);
@@ -3727,20 +3727,20 @@ function sameTile(a, b) {
3727
3727
  for (let i = 0; i < a.data.length; i++) if (a.data[i] !== b.data[i]) return false;
3728
3728
  return true;
3729
3729
  }
3730
- var DEFAULT_ADJUSTMENTS = _chunk4S2AXNQFcjs.DEFAULT_ADJUSTMENTS_VALUES;
3730
+ var DEFAULT_ADJUSTMENTS = _chunkHTAFDTNRcjs.DEFAULT_ADJUSTMENTS_VALUES;
3731
3731
  function normalizeStoredAdjustments(stored) {
3732
3732
  if (!stored) return { ...DEFAULT_ADJUSTMENTS };
3733
3733
  const out = {
3734
3734
  ...DEFAULT_ADJUSTMENTS,
3735
3735
  ...stored,
3736
- process: _chunk4S2AXNQFcjs.normalizeProcessVersion.call(void 0, stored.process)
3736
+ process: _chunkHTAFDTNRcjs.normalizeProcessVersion.call(void 0, stored.process)
3737
3737
  };
3738
- const layers = _chunk4S2AXNQFcjs.normalizeAdjustmentLayers.call(void 0, stored.layers);
3738
+ const layers = _chunkHTAFDTNRcjs.normalizeAdjustmentLayers.call(void 0, stored.layers);
3739
3739
  if (layers.length) out.layers = layers;
3740
3740
  else delete out.layers;
3741
3741
  return out;
3742
3742
  }
3743
- var isLayered = (data) => Boolean(data && data.version === _chunk4S2AXNQFcjs.LAYERED_SCHEMA_VERSION && Array.isArray(data.layers));
3743
+ var isLayered = (data) => Boolean(data && data.version === _chunkHTAFDTNRcjs.LAYERED_SCHEMA_VERSION && Array.isArray(data.layers));
3744
3744
  function migrateSerializedImageEditorState(data) {
3745
3745
  if (isLayered(data)) {
3746
3746
  const out = {
@@ -3772,10 +3772,10 @@ function migrateSerializedImageEditorState(data) {
3772
3772
  function migrateToLayeredState(data, size) {
3773
3773
  const clean = migrateSerializedImageEditorState(data);
3774
3774
  if (isLayered(clean)) return clean;
3775
- const stack = _chunk4S2AXNQFcjs.layersFromLegacy.call(void 0, clean, Math.round(size.width), Math.round(size.height));
3776
- const { layers, assets } = _chunk4S2AXNQFcjs.serializeLayers.call(void 0, stack.layers);
3775
+ const stack = _chunkHTAFDTNRcjs.layersFromLegacy.call(void 0, clean, Math.round(size.width), Math.round(size.height));
3776
+ const { layers, assets } = _chunkHTAFDTNRcjs.serializeLayers.call(void 0, stack.layers);
3777
3777
  const out = {
3778
- version: _chunk4S2AXNQFcjs.LAYERED_SCHEMA_VERSION,
3778
+ version: _chunkHTAFDTNRcjs.LAYERED_SCHEMA_VERSION,
3779
3779
  width: Math.round(size.width),
3780
3780
  height: Math.round(size.height),
3781
3781
  layers,
@@ -3789,8 +3789,8 @@ function migrateToLayeredState(data, size) {
3789
3789
  if (clean.selection) out.selection = clean.selection;
3790
3790
  return out;
3791
3791
  }
3792
- var DEFAULT_TRANSFORM = _chunk4S2AXNQFcjs.DEFAULT_TRANSFORM_VALUES;
3793
- var DEFAULT_DEPTH_MASK = _chunk4S2AXNQFcjs.DEFAULT_DEPTH_MASK_VALUES;
3792
+ var DEFAULT_TRANSFORM = _chunkHTAFDTNRcjs.DEFAULT_TRANSFORM_VALUES;
3793
+ var DEFAULT_DEPTH_MASK = _chunkHTAFDTNRcjs.DEFAULT_DEPTH_MASK_VALUES;
3794
3794
  var DEVELOP_KEYS = ["brightness", "contrast", "saturation", "exposure", "temperature", "tint"];
3795
3795
  var ImageEditorController = (_class6 = class {
3796
3796
 
@@ -3813,7 +3813,7 @@ var ImageEditorController = (_class6 = class {
3813
3813
  __init56() {this.sourceSurfaces = /* @__PURE__ */ new WeakMap()}
3814
3814
  __init57() {this.viewKey = []}
3815
3815
  /** For `compositePixels` and mask evaluation (the renderer keeps its own for the viewport). */
3816
- __init58() {this.compositor = new (0, _chunk4S2AXNQFcjs.LayerCompositor)()}
3816
+ __init58() {this.compositor = new (0, _chunkHTAFDTNRcjs.LayerCompositor)()}
3817
3817
  constructor(options = {}) {;_class6.prototype.__init48.call(this);_class6.prototype.__init49.call(this);_class6.prototype.__init50.call(this);_class6.prototype.__init51.call(this);_class6.prototype.__init52.call(this);_class6.prototype.__init53.call(this);_class6.prototype.__init54.call(this);_class6.prototype.__init55.call(this);_class6.prototype.__init56.call(this);_class6.prototype.__init57.call(this);_class6.prototype.__init58.call(this);_class6.prototype.__init59.call(this);_class6.prototype.__init60.call(this);_class6.prototype.__init61.call(this);_class6.prototype.__init62.call(this);_class6.prototype.__init63.call(this);_class6.prototype.__init64.call(this);_class6.prototype.__init65.call(this);_class6.prototype.__init66.call(this);_class6.prototype.__init67.call(this);_class6.prototype.__init68.call(this);_class6.prototype.__init69.call(this);_class6.prototype.__init70.call(this);
3818
3818
  this.maxHistoryDepth = _nullishCoalesce(options.maxHistoryDepth, () => ( 50));
3819
3819
  if (options.textShaper !== void 0) this.textShaperValue = options.textShaper;
@@ -3863,7 +3863,7 @@ var ImageEditorController = (_class6 = class {
3863
3863
  this.applyStored(_nullishCoalesce(options.initialState, () => ( {})));
3864
3864
  if (_optionalChain([options, 'access', _126 => _126.initialState, 'optionalAccess', _127 => _127.selection])) {
3865
3865
  try {
3866
- this.state.selection = normalizeSelection(_chunk4S2AXNQFcjs.deserializeSelection.call(void 0, options.initialState.selection));
3866
+ this.state.selection = normalizeSelection(_chunkHTAFDTNRcjs.deserializeSelection.call(void 0, options.initialState.selection));
3867
3867
  } catch (e14) {
3868
3868
  }
3869
3869
  }
@@ -3969,7 +3969,7 @@ var ImageEditorController = (_class6 = class {
3969
3969
  if (key.length === this.viewKey.length && key.every((v, i) => v === this.viewKey[i])) return;
3970
3970
  this.viewKey = key;
3971
3971
  const { width, height } = this.naturalSize;
3972
- const view = _chunk4S2AXNQFcjs.legacyView.call(void 0, this.stack(), width, height, s.activeLayerId);
3972
+ const view = _chunkHTAFDTNRcjs.legacyView.call(void 0, this.stack(), width, height, s.activeLayerId);
3973
3973
  s.adjustments = view.adjustments;
3974
3974
  s.depthMask = view.depthMask;
3975
3975
  s.annotations = view.annotations;
@@ -4123,7 +4123,7 @@ var ImageEditorController = (_class6 = class {
4123
4123
  applyCropPreset(ratio) {
4124
4124
  this.recordHistory();
4125
4125
  const { width, height } = this.state.imageDimensions;
4126
- if (ratio && _chunk4S2AXNQFcjs.isQuarterTurnSwapped.call(void 0, this.state.transform)) {
4126
+ if (ratio && _chunkHTAFDTNRcjs.isQuarterTurnSwapped.call(void 0, this.state.transform)) {
4127
4127
  ratio = 1 / ratio;
4128
4128
  }
4129
4129
  if (!ratio) {
@@ -4205,7 +4205,7 @@ var ImageEditorController = (_class6 = class {
4205
4205
  */
4206
4206
  getLayerPixels(id) {
4207
4207
  const layer = this.getLayer(id);
4208
- if (!layer || !_chunk4S2AXNQFcjs.hasSurface.call(void 0, layer)) return null;
4208
+ if (!layer || !_chunkHTAFDTNRcjs.hasSurface.call(void 0, layer)) return null;
4209
4209
  const surface = this.surfaceOf(layer);
4210
4210
  const b = _chunk7ISPWEJAcjs.contentBounds.call(void 0, surface);
4211
4211
  if (!b) return null;
@@ -4218,7 +4218,7 @@ var ImageEditorController = (_class6 = class {
4218
4218
  */
4219
4219
  getLayerBounds(id) {
4220
4220
  const layer = this.getLayer(id);
4221
- if (!layer || !_chunk4S2AXNQFcjs.hasSurface.call(void 0, layer)) return null;
4221
+ if (!layer || !_chunkHTAFDTNRcjs.hasSurface.call(void 0, layer)) return null;
4222
4222
  const surface = this.surfaceOf(layer);
4223
4223
  let b = this.boundsCache.get(surface);
4224
4224
  if (b === void 0) {
@@ -4233,9 +4233,9 @@ var ImageEditorController = (_class6 = class {
4233
4233
  */
4234
4234
  getLayerDataURL(id) {
4235
4235
  const layer = this.getLayer(id);
4236
- if (!layer || !_chunk4S2AXNQFcjs.hasSurface.call(void 0, layer)) return null;
4236
+ if (!layer || !_chunkHTAFDTNRcjs.hasSurface.call(void 0, layer)) return null;
4237
4237
  const surface = this.surfaceOf(layer);
4238
- const enc = _chunk4S2AXNQFcjs.encodeSurface.call(void 0, surface);
4238
+ const enc = _chunkHTAFDTNRcjs.encodeSurface.call(void 0, surface);
4239
4239
  return enc ? enc.url : null;
4240
4240
  }
4241
4241
  /**
@@ -4377,19 +4377,19 @@ var ImageEditorController = (_class6 = class {
4377
4377
  if (init.pixels) {
4378
4378
  const px2 = init.pixels;
4379
4379
  if (!(px2.width > 0 && px2.height > 0) || px2.data.length < px2.width * px2.height * 4) {
4380
- throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("pixels must be RGBA with width \xD7 height \xD7 4 bytes.");
4380
+ throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("pixels must be RGBA with width \xD7 height \xD7 4 bytes.");
4381
4381
  }
4382
4382
  surface = _chunk7ISPWEJAcjs.surfaceFromPixels.call(void 0, px2, 4);
4383
4383
  } else if (init.color !== void 0) {
4384
4384
  const c = parseColor(init.color);
4385
4385
  surface = _chunk7ISPWEJAcjs.solidSurface.call(void 0, 4, { x: 0, y: 0, width, height }, _chunk7ISPWEJAcjs.packRgba.call(void 0, c[0], c[1], c[2], c[3]));
4386
4386
  }
4387
- const blend = _chunk4S2AXNQFcjs.parseBlend.call(void 0, init.blend);
4388
- if (init.opacity !== void 0 && !(init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("opacity must be from 0 to 1.");
4387
+ const blend = _chunkHTAFDTNRcjs.parseBlend.call(void 0, init.blend);
4388
+ if (init.opacity !== void 0 && !(init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("opacity must be from 0 to 1.");
4389
4389
  const ids = new Set(_chunkWMRIG4XQcjs.flattenLayers.call(void 0, this.state.layers).map((l) => l.id));
4390
4390
  const layer = {
4391
4391
  type: "pixel",
4392
- id: init.id && !ids.has(init.id) ? init.id : _chunk4S2AXNQFcjs.newLayerId.call(void 0, ),
4392
+ id: init.id && !ids.has(init.id) ? init.id : _chunkHTAFDTNRcjs.newLayerId.call(void 0, ),
4393
4393
  name: _optionalChain([init, 'access', _141 => _141.name, 'optionalAccess', _142 => _142.trim, 'call', _143 => _143()]) || this.nextLayerName(),
4394
4394
  visible: _nullishCoalesce(init.visible, () => ( true)),
4395
4395
  opacity: _nullishCoalesce(init.opacity, () => ( 1)),
@@ -4398,7 +4398,7 @@ var ImageEditorController = (_class6 = class {
4398
4398
  offset: { x: Math.round(_nullishCoalesce(init.x, () => ( 0))), y: Math.round(_nullishCoalesce(init.y, () => ( 0))) }
4399
4399
  };
4400
4400
  if (init.fillOpacity !== void 0 && init.fillOpacity !== 1) layer.fillOpacity = init.fillOpacity;
4401
- const next = _chunk4S2AXNQFcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
4401
+ const next = _chunkHTAFDTNRcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
4402
4402
  this.commitLayers(next, () => {
4403
4403
  this.state.activeLayerId = layer.id;
4404
4404
  this.state.activeTarget = "pixels";
@@ -4438,12 +4438,12 @@ var ImageEditorController = (_class6 = class {
4438
4438
  try {
4439
4439
  img = await this.renderer.imageCache.get(src);
4440
4440
  } catch (e20) {
4441
- throw new (0, _chunk4S2AXNQFcjs.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.");
4441
+ throw new (0, _chunkHTAFDTNRcjs.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.");
4442
4442
  }
4443
4443
  const w = img.naturalWidth || img.width;
4444
4444
  const h = img.naturalHeight || img.height;
4445
4445
  const ctx = this.renderer.createCanvas(w, h).getContext("2d");
4446
- if (!ctx || typeof ctx.getImageData !== "function") throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("Decoding this image needs a canvas; pass a PNG instead.");
4446
+ if (!ctx || typeof ctx.getImageData !== "function") throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("Decoding this image needs a canvas; pass a PNG instead.");
4447
4447
  ctx.drawImage(img, 0, 0, w, h);
4448
4448
  const data = ctx.getImageData(0, 0, w, h);
4449
4449
  return { width: w, height: h, data: data.data };
@@ -4456,7 +4456,7 @@ var ImageEditorController = (_class6 = class {
4456
4456
  }
4457
4457
  /** Duplicates a layer (with its children) directly above it, as one undo step. Returns the copy's id. */
4458
4458
  duplicateLayer(id, name) {
4459
- const res = _chunk4S2AXNQFcjs.duplicateLayer.call(void 0, this.state.layers, id, name);
4459
+ const res = _chunkHTAFDTNRcjs.duplicateLayer.call(void 0, this.state.layers, id, name);
4460
4460
  this.commitLayers(res.layers, () => {
4461
4461
  this.state.activeLayerId = res.id;
4462
4462
  });
@@ -4464,16 +4464,16 @@ var ImageEditorController = (_class6 = class {
4464
4464
  }
4465
4465
  /** Deletes a layer (refused when locked), as one undo step. */
4466
4466
  removeLayer(id) {
4467
- const next = _chunk4S2AXNQFcjs.removeLayer.call(void 0, this.state.layers, id);
4467
+ const next = _chunkHTAFDTNRcjs.removeLayer.call(void 0, this.state.layers, id);
4468
4468
  this.commitLayers(next, () => {
4469
- if (this.state.selectedAnnotationId && !_chunkWMRIG4XQcjs.flattenLayers.call(void 0, next).some((l) => _optionalChain([_chunk4S2AXNQFcjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _145 => _145.id]) === this.state.selectedAnnotationId)) {
4469
+ if (this.state.selectedAnnotationId && !_chunkWMRIG4XQcjs.flattenLayers.call(void 0, next).some((l) => _optionalChain([_chunkHTAFDTNRcjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _145 => _145.id]) === this.state.selectedAnnotationId)) {
4470
4470
  this.state.selectedAnnotationId = null;
4471
4471
  }
4472
4472
  });
4473
4473
  }
4474
4474
  /** Moves a layer above / below another, or into a group, as one undo step. Returns its new parent and index. */
4475
4475
  moveLayer(id, placement) {
4476
- const next = _chunk4S2AXNQFcjs.moveLayer.call(void 0, this.state.layers, id, placement);
4476
+ const next = _chunkHTAFDTNRcjs.moveLayer.call(void 0, this.state.layers, id, placement);
4477
4477
  const loc = _chunkWMRIG4XQcjs.findLayer.call(void 0, next, id);
4478
4478
  if (next === this.state.layers) return { parentId: _nullishCoalesce(_optionalChain([loc, 'access', _146 => _146.parent, 'optionalAccess', _147 => _147.id]), () => ( null)), index: loc.index };
4479
4479
  this.commitLayers(next);
@@ -4484,23 +4484,23 @@ var ImageEditorController = (_class6 = class {
4484
4484
  * one undo step (`commitToHistory = false` for the moves of a slider drag). Returns the layer.
4485
4485
  */
4486
4486
  setLayerProperties(id, props, commitToHistory = true) {
4487
- const next = _chunk4S2AXNQFcjs.setLayerProperties.call(void 0, this.state.layers, id, props);
4487
+ const next = _chunkHTAFDTNRcjs.setLayerProperties.call(void 0, this.state.layers, id, props);
4488
4488
  this.commitLayers(next, void 0, commitToHistory);
4489
4489
  return _chunkWMRIG4XQcjs.findLayer.call(void 0, next, id).layer;
4490
4490
  }
4491
4491
  /** Adds an empty pass-through group above the active layer (or at `placement`) and makes it active. Returns its id. */
4492
4492
  addGroup(init = {}) {
4493
- const blend = init.blend === void 0 ? "pass-through" : _chunk4S2AXNQFcjs.parseBlend.call(void 0, init.blend, true);
4493
+ const blend = init.blend === void 0 ? "pass-through" : _chunkHTAFDTNRcjs.parseBlend.call(void 0, init.blend, true);
4494
4494
  const group = {
4495
4495
  type: "group",
4496
- id: _chunk4S2AXNQFcjs.newLayerId.call(void 0, "group"),
4496
+ id: _chunkHTAFDTNRcjs.newLayerId.call(void 0, "group"),
4497
4497
  name: _optionalChain([init, 'access', _150 => _150.name, 'optionalAccess', _151 => _151.trim, 'call', _152 => _152()]) || "Group",
4498
4498
  visible: true,
4499
4499
  opacity: 1,
4500
4500
  blend,
4501
4501
  children: []
4502
4502
  };
4503
- const next = _chunk4S2AXNQFcjs.placeLayer.call(void 0, this.state.layers, group, this.newLayerPlacement(init));
4503
+ const next = _chunkHTAFDTNRcjs.placeLayer.call(void 0, this.state.layers, group, this.newLayerPlacement(init));
4504
4504
  this.commitLayers(next, () => {
4505
4505
  this.state.activeLayerId = group.id;
4506
4506
  this.state.activeTarget = "pixels";
@@ -4509,7 +4509,7 @@ var ImageEditorController = (_class6 = class {
4509
4509
  }
4510
4510
  /** Puts sibling layers into a new group (one undo step). Returns the group id. */
4511
4511
  groupLayers(ids, name) {
4512
- const res = _chunk4S2AXNQFcjs.groupLayers.call(void 0, this.state.layers, ids, name);
4512
+ const res = _chunkHTAFDTNRcjs.groupLayers.call(void 0, this.state.layers, ids, name);
4513
4513
  this.commitLayers(res.layers, () => {
4514
4514
  this.state.activeLayerId = res.id;
4515
4515
  });
@@ -4517,7 +4517,7 @@ var ImageEditorController = (_class6 = class {
4517
4517
  }
4518
4518
  /** Replaces a group by its children (one undo step). Returns the child ids, bottom to top. */
4519
4519
  ungroupLayer(id) {
4520
- const res = _chunk4S2AXNQFcjs.ungroupLayer.call(void 0, this.state.layers, id);
4520
+ const res = _chunkHTAFDTNRcjs.ungroupLayer.call(void 0, this.state.layers, id);
4521
4521
  this.commitLayers(res.layers);
4522
4522
  return res.ids;
4523
4523
  }
@@ -4526,38 +4526,38 @@ var ImageEditorController = (_class6 = class {
4526
4526
  * (`commitToHistory = false` for the moves of a drag). Returns the offset and document bounds.
4527
4527
  */
4528
4528
  offsetLayer(id, move, commitToHistory = true) {
4529
- const layer = _chunk4S2AXNQFcjs.requireLayer.call(void 0, this.state.layers, id).layer;
4529
+ const layer = _chunkHTAFDTNRcjs.requireLayer.call(void 0, this.state.layers, id).layer;
4530
4530
  if (layer.type === "smart") {
4531
4531
  const tl = layer.placement.corners[0];
4532
4532
  const dx = move.x !== void 0 ? move.x - tl.x : _nullishCoalesce(move.dx, () => ( 0));
4533
4533
  const dy = move.y !== void 0 ? move.y - tl.y : _nullishCoalesce(move.dy, () => ( 0));
4534
- if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("x and y must be numbers.");
4535
- this.commitLayers(_chunk4S2AXNQFcjs.offsetSmartObject.call(void 0, this.state.layers, id, dx, dy, this.canvasSize), void 0, commitToHistory);
4534
+ if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("x and y must be numbers.");
4535
+ this.commitLayers(_chunkHTAFDTNRcjs.offsetSmartObject.call(void 0, this.state.layers, id, dx, dy, this.canvasSize), void 0, commitToHistory);
4536
4536
  const moved = _chunkWMRIG4XQcjs.findLayer.call(void 0, this.state.layers, id).layer;
4537
4537
  return { offset: { x: Math.round(moved.placement.corners[0].x), y: Math.round(moved.placement.corners[0].y) }, bounds: this.getLayerBounds(id) };
4538
4538
  }
4539
4539
  if (layer.type === "shape") {
4540
- const g = _nullishCoalesce(_chunk4S2AXNQFcjs.shapeGeometryBounds.call(void 0, layer), () => ( { x: 0, y: 0 }));
4540
+ const g = _nullishCoalesce(_chunkHTAFDTNRcjs.shapeGeometryBounds.call(void 0, layer), () => ( { x: 0, y: 0 }));
4541
4541
  const dx = move.x !== void 0 ? move.x - g.x : _nullishCoalesce(move.dx, () => ( 0));
4542
4542
  const dy = move.y !== void 0 ? move.y - g.y : _nullishCoalesce(move.dy, () => ( 0));
4543
- if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("x and y must be numbers.");
4544
- _chunk4S2AXNQFcjs.requireUnlocked.call(void 0, layer, "position", "move it");
4545
- let moved = _chunk4S2AXNQFcjs.offsetShape.call(void 0, layer, dx, dy, this.shapeEnv());
4543
+ if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("x and y must be numbers.");
4544
+ _chunkHTAFDTNRcjs.requireUnlocked.call(void 0, layer, "position", "move it");
4545
+ let moved = _chunkHTAFDTNRcjs.offsetShape.call(void 0, layer, dx, dy, this.shapeEnv());
4546
4546
  const mask = layer.mask;
4547
4547
  if (mask && mask.linked !== false && !mask.source && (Math.round(dx) || Math.round(dy))) moved = { ...moved, mask: { ...mask, surface: _chunk7ISPWEJAcjs.translateSurface.call(void 0, mask.surface, Math.round(dx), Math.round(dy)) } };
4548
4548
  this.commitLayers(_chunkWMRIG4XQcjs.mapLayer.call(void 0, this.state.layers, id, () => moved), void 0, commitToHistory);
4549
- const b = _nullishCoalesce(_chunk4S2AXNQFcjs.shapeGeometryBounds.call(void 0, moved), () => ( { x: 0, y: 0 }));
4549
+ const b = _nullishCoalesce(_chunkHTAFDTNRcjs.shapeGeometryBounds.call(void 0, moved), () => ( { x: 0, y: 0 }));
4550
4550
  return { offset: { x: Math.round(b.x), y: Math.round(b.y) }, bounds: this.getLayerBounds(id) };
4551
4551
  }
4552
4552
  if (layer.type === "type") {
4553
4553
  const m = _nullishCoalesce(layer.transform, () => ( [1, 0, 0, 1, 0, 0]));
4554
4554
  const dx = move.x !== void 0 ? move.x - m[4] : _nullishCoalesce(move.dx, () => ( 0));
4555
4555
  const dy = move.y !== void 0 ? move.y - m[5] : _nullishCoalesce(move.dy, () => ( 0));
4556
- if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("x and y must be numbers.");
4557
- _chunk4S2AXNQFcjs.requireUnlocked.call(void 0, layer, "position", "move it");
4556
+ if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("x and y must be numbers.");
4557
+ _chunkHTAFDTNRcjs.requireUnlocked.call(void 0, layer, "position", "move it");
4558
4558
  const mx = Math.round(dx);
4559
4559
  const my = Math.round(dy);
4560
- let moved = { ..._chunk4S2AXNQFcjs.transformTypeLayer.call(void 0, layer, [1, 0, 0, 1, mx, my]), surface: _chunk7ISPWEJAcjs.translateSurface.call(void 0, layer.surface, mx, my) };
4560
+ let moved = { ..._chunkHTAFDTNRcjs.transformTypeLayer.call(void 0, layer, [1, 0, 0, 1, mx, my]), surface: _chunk7ISPWEJAcjs.translateSurface.call(void 0, layer.surface, mx, my) };
4561
4561
  const mask = layer.mask;
4562
4562
  if (mask && mask.linked !== false && !mask.source && (mx || my)) moved = { ...moved, mask: { ...mask, surface: _chunk7ISPWEJAcjs.translateSurface.call(void 0, mask.surface, mx, my) } };
4563
4563
  this.commitLayers(_chunkWMRIG4XQcjs.mapLayer.call(void 0, this.state.layers, id, () => moved), void 0, commitToHistory);
@@ -4567,7 +4567,7 @@ var ImageEditorController = (_class6 = class {
4567
4567
  const current = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
4568
4568
  const x = _nullishCoalesce(move.x, () => ( current.x + (_nullishCoalesce(move.dx, () => ( 0)))));
4569
4569
  const y = _nullishCoalesce(move.y, () => ( current.y + (_nullishCoalesce(move.dy, () => ( 0)))));
4570
- const next = _chunk4S2AXNQFcjs.offsetLayer.call(void 0, this.state.layers, id, { x, y });
4570
+ const next = _chunkHTAFDTNRcjs.offsetLayer.call(void 0, this.state.layers, id, { x, y });
4571
4571
  this.commitLayers(next, void 0, commitToHistory);
4572
4572
  return { offset: { x: Math.round(x), y: Math.round(y) }, bounds: this.getLayerBounds(id) };
4573
4573
  }
@@ -4577,11 +4577,11 @@ var ImageEditorController = (_class6 = class {
4577
4577
  * target when the layer is active.
4578
4578
  */
4579
4579
  addLayerMask(id, from = "reveal-all", props = {}) {
4580
- const layer = _chunk4S2AXNQFcjs.requireLayer.call(void 0, this.state.layers, id).layer;
4580
+ const layer = _chunkHTAFDTNRcjs.requireLayer.call(void 0, this.state.layers, id).layer;
4581
4581
  let mask;
4582
4582
  if (from === "selection") {
4583
4583
  const sel = this.state.selection;
4584
- if (!_optionalChain([sel, 'optionalAccess', _153 => _153.bounds])) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
4584
+ if (!_optionalChain([sel, 'optionalAccess', _153 => _153.bounds])) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
4585
4585
  mask = this.maskFromSelection(sel, props);
4586
4586
  if (layer.type === "pixel" && (layer.offset.x || layer.offset.y)) {
4587
4587
  mask = { ...mask, surface: _chunk7ISPWEJAcjs.translateSurface.call(void 0, mask.surface, -layer.offset.x, -layer.offset.y) };
@@ -4590,7 +4590,7 @@ var ImageEditorController = (_class6 = class {
4590
4590
  const v = from === "reveal-all" ? 255 : 0;
4591
4591
  mask = withMaskProps({ surface: _chunk7ISPWEJAcjs.emptySurface.call(void 0, 1, v), defaultValue: v }, props);
4592
4592
  }
4593
- const next = _chunk4S2AXNQFcjs.setLayerMask.call(void 0, this.state.layers, id, mask);
4593
+ const next = _chunkHTAFDTNRcjs.setLayerMask.call(void 0, this.state.layers, id, mask);
4594
4594
  this.commitLayers(next, () => {
4595
4595
  if (this.state.activeLayerId === id) this.state.activeTarget = "mask";
4596
4596
  });
@@ -4598,18 +4598,18 @@ var ImageEditorController = (_class6 = class {
4598
4598
  }
4599
4599
  /** Removes a layer's mask (one undo step). */
4600
4600
  removeLayerMask(id) {
4601
- const layer = _chunk4S2AXNQFcjs.requireLayer.call(void 0, this.state.layers, id).layer;
4602
- if (!layer.mask) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask.`);
4603
- this.commitLayers(_chunk4S2AXNQFcjs.setLayerMask.call(void 0, this.state.layers, id, null), () => {
4601
+ const layer = _chunkHTAFDTNRcjs.requireLayer.call(void 0, this.state.layers, id).layer;
4602
+ if (!layer.mask) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask.`);
4603
+ this.commitLayers(_chunkHTAFDTNRcjs.setLayerMask.call(void 0, this.state.layers, id, null), () => {
4604
4604
  if (this.state.activeLayerId === id) this.state.activeTarget = "pixels";
4605
4605
  });
4606
4606
  }
4607
4607
  /** Changes any layer mask's density, feather, enabled or linked flag (pixels kept). Returns the mask. */
4608
4608
  setLayerMaskProps(id, props, commitToHistory = true) {
4609
- const layer = _chunk4S2AXNQFcjs.requireLayer.call(void 0, this.state.layers, id).layer;
4610
- if (!layer.mask) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask; add one with add_layer_mask.`);
4609
+ const layer = _chunkHTAFDTNRcjs.requireLayer.call(void 0, this.state.layers, id).layer;
4610
+ if (!layer.mask) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask; add one with add_layer_mask.`);
4611
4611
  const mask = withMaskProps(layer.mask, props);
4612
- this.commitLayers(_chunk4S2AXNQFcjs.setLayerMask.call(void 0, this.state.layers, id, mask), void 0, commitToHistory);
4612
+ this.commitLayers(_chunkHTAFDTNRcjs.setLayerMask.call(void 0, this.state.layers, id, mask), void 0, commitToHistory);
4613
4613
  return mask;
4614
4614
  }
4615
4615
  /**
@@ -4617,11 +4617,11 @@ var ImageEditorController = (_class6 = class {
4617
4617
  * the depth map) and removes the mask, as one undo step.
4618
4618
  */
4619
4619
  async applyLayerMask(id) {
4620
- const loc = _chunk4S2AXNQFcjs.requireLayer.call(void 0, this.state.layers, id);
4620
+ const loc = _chunkHTAFDTNRcjs.requireLayer.call(void 0, this.state.layers, id);
4621
4621
  const layer = loc.layer;
4622
- if (layer.type !== "pixel") throw new (0, _chunk4S2AXNQFcjs.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.`);
4623
- if (!layer.mask) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask.`);
4624
- _chunk4S2AXNQFcjs.requireUnlocked.call(void 0, layer, "pixels", "apply its mask");
4622
+ if (layer.type !== "pixel") throw new (0, _chunkHTAFDTNRcjs.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.`);
4623
+ if (!layer.mask) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask.`);
4624
+ _chunkHTAFDTNRcjs.requireUnlocked.call(void 0, layer, "pixels", "apply its mask");
4625
4625
  const { width, height } = this.naturalSize;
4626
4626
  await this.renderer.prepareLayerAssets([layer], width, height);
4627
4627
  const sources = this.renderer.compositorSources(width, height);
@@ -4654,13 +4654,13 @@ var ImageEditorController = (_class6 = class {
4654
4654
  */
4655
4655
  layerViaCopy(options = {}) {
4656
4656
  const id = _nullishCoalesce(options.layerId, () => ( this.state.activeLayerId));
4657
- if (!id) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("No layer given and none is active; pass layerId (see list_layers).");
4658
- const loc = _chunk4S2AXNQFcjs.requireLayer.call(void 0, this.state.layers, id);
4657
+ if (!id) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("No layer given and none is active; pass layerId (see list_layers).");
4658
+ const loc = _chunkHTAFDTNRcjs.requireLayer.call(void 0, this.state.layers, id);
4659
4659
  const layer = loc.layer;
4660
- if (layer.type !== "pixel") throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)(`Layer via copy needs a pixel layer; "${id}" is a ${layer.type} layer.`);
4660
+ if (layer.type !== "pixel") throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)(`Layer via copy needs a pixel layer; "${id}" is a ${layer.type} layer.`);
4661
4661
  const sel = this.state.selection;
4662
- if (!_optionalChain([sel, 'optionalAccess', _154 => _154.bounds])) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("Nothing is selected; select the pixels to copy first.");
4663
- if (options.cut) _chunk4S2AXNQFcjs.requireUnlocked.call(void 0, layer, "pixels", "cut from it");
4662
+ if (!_optionalChain([sel, 'optionalAccess', _154 => _154.bounds])) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("Nothing is selected; select the pixels to copy first.");
4663
+ if (options.cut) _chunkHTAFDTNRcjs.requireUnlocked.call(void 0, layer, "pixels", "cut from it");
4664
4664
  const surface = this.surfaceOf(layer);
4665
4665
  const sb = sel.bounds;
4666
4666
  const src = { x: sb.x - layer.offset.x, y: sb.y - layer.offset.y, width: sb.width, height: sb.height };
@@ -4676,7 +4676,7 @@ var ImageEditorController = (_class6 = class {
4676
4676
  }
4677
4677
  const copy = {
4678
4678
  type: "pixel",
4679
- id: _chunk4S2AXNQFcjs.newLayerId.call(void 0, ),
4679
+ id: _chunkHTAFDTNRcjs.newLayerId.call(void 0, ),
4680
4680
  name: _optionalChain([options, 'access', _155 => _155.name, 'optionalAccess', _156 => _156.trim, 'call', _157 => _157()]) || `${layer.name || "Layer"} ${options.cut ? "cut" : "copy"}`,
4681
4681
  visible: true,
4682
4682
  opacity: 1,
@@ -4749,7 +4749,7 @@ var ImageEditorController = (_class6 = class {
4749
4749
  * Refused while another transform is open.
4750
4750
  */
4751
4751
  beginFreeTransform(init = {}) {
4752
- if (this.getFreeTransform()) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("A Free Transform is already open; commit or cancel it first.");
4752
+ if (this.getFreeTransform()) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("A Free Transform is already open; commit or cancel it first.");
4753
4753
  const session = new FreeTransformSession(this.transformHost(), init);
4754
4754
  this.openTransform = session;
4755
4755
  this.notify();
@@ -4763,26 +4763,26 @@ var ImageEditorController = (_class6 = class {
4763
4763
  */
4764
4764
  transformLayer(spec) {
4765
4765
  const given = [spec.matrix, spec.corners, spec.params].filter((v) => v !== void 0).length;
4766
- if (given > 1) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("Give only one of matrix, corners and params.");
4767
- if (!given && spec.warp === void 0) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("Give matrix, corners or params (or a warp).");
4766
+ if (given > 1) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("Give only one of matrix, corners and params.");
4767
+ if (!given && spec.warp === void 0) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("Give matrix, corners or params (or a warp).");
4768
4768
  if (spec.matrix && !(Array.isArray(spec.matrix) && spec.matrix.length === 6 && spec.matrix.every(Number.isFinite))) {
4769
- throw new (0, _chunk4S2AXNQFcjs.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).");
4769
+ throw new (0, _chunkHTAFDTNRcjs.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).");
4770
4770
  }
4771
4771
  if (spec.matrix) {
4772
4772
  const [a, b, c, d] = spec.matrix;
4773
- if (Math.abs(a * d - b * c) < 1e-9) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("matrix is singular (it collapses the layer to a line); its determinant a\xB7d \u2212 b\xB7c must not be 0.");
4773
+ if (Math.abs(a * d - b * c) < 1e-9) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("matrix is singular (it collapses the layer to a line); its determinant a\xB7d \u2212 b\xB7c must not be 0.");
4774
4774
  }
4775
4775
  const session = this.beginFreeTransform(spec);
4776
4776
  try {
4777
4777
  const g = session.startGeometry;
4778
- const corners = spec.matrix ? g.corners.map((p) => _chunkLI3KTY7Kcjs.applyMatrix.call(void 0, spec.matrix, p)) : spec.corners ? spec.corners : spec.params ? _chunk4S2AXNQFcjs.applyParams.call(void 0, g, spec.params) : g.corners;
4778
+ const corners = spec.matrix ? g.corners.map((p) => _chunkVYW7JBTMcjs.applyMatrix.call(void 0, spec.matrix, p)) : spec.corners ? spec.corners : spec.params ? _chunkHTAFDTNRcjs.applyParams.call(void 0, g, spec.params) : g.corners;
4779
4779
  let warp = spec.warp === void 0 ? _nullishCoalesce(g.warp, () => ( null)) : null;
4780
4780
  if (spec.warp) {
4781
4781
  if ("style" in spec.warp) {
4782
- if (!_chunkLI3KTY7Kcjs.WARP_STYLES.includes(spec.warp.style)) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)(`Unknown warp style "${String(spec.warp.style)}". Styles: ${_chunkLI3KTY7Kcjs.WARP_STYLES.join(", ")}.`);
4783
- warp = _chunk4S2AXNQFcjs.presetWarp.call(void 0, session.box, spec.warp);
4782
+ if (!_chunkVYW7JBTMcjs.WARP_STYLES.includes(spec.warp.style)) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)(`Unknown warp style "${String(spec.warp.style)}". Styles: ${_chunkVYW7JBTMcjs.WARP_STYLES.join(", ")}.`);
4783
+ warp = _chunkHTAFDTNRcjs.presetWarp.call(void 0, session.box, spec.warp);
4784
4784
  } else {
4785
- if (!_chunk4S2AXNQFcjs.isValidWarp.call(void 0, spec.warp)) throw new (0, _chunk4S2AXNQFcjs.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.");
4785
+ if (!_chunkHTAFDTNRcjs.isValidWarp.call(void 0, spec.warp)) throw new (0, _chunkHTAFDTNRcjs.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.");
4786
4786
  warp = spec.warp;
4787
4787
  }
4788
4788
  }
@@ -4795,10 +4795,10 @@ var ImageEditorController = (_class6 = class {
4795
4795
  }
4796
4796
  /** Flips the layer (or its selected pixels, or the outline) about the frame's centre, exactly (one undo step). */
4797
4797
  flipLayer(axis, init = {}) {
4798
- if (axis !== "horizontal" && axis !== "vertical") throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)(`axis must be horizontal or vertical, got "${String(axis)}".`);
4798
+ if (axis !== "horizontal" && axis !== "vertical") throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)(`axis must be horizontal or vertical, got "${String(axis)}".`);
4799
4799
  const session = this.beginFreeTransform({ interpolation: "nearest", ...init });
4800
4800
  try {
4801
- session.update({ corners: _chunk4S2AXNQFcjs.flipCorners.call(void 0, session.startGeometry, axis) }, false);
4801
+ session.update({ corners: _chunkHTAFDTNRcjs.flipCorners.call(void 0, session.startGeometry, axis) }, false);
4802
4802
  return session.commit();
4803
4803
  } catch (e) {
4804
4804
  session.cancel();
@@ -4810,16 +4810,16 @@ var ImageEditorController = (_class6 = class {
4810
4810
  * centre, snapped so pixels land on whole pixels: exact, no resampling (one undo step).
4811
4811
  */
4812
4812
  rotateLayer90(turn, init = {}) {
4813
- if (turn !== 90 && turn !== -90 && turn !== 180) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)(`turn must be 90, -90 or 180, got ${String(turn)}.`);
4813
+ if (turn !== 90 && turn !== -90 && turn !== 180) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)(`turn must be 90, -90 or 180, got ${String(turn)}.`);
4814
4814
  const session = this.beginFreeTransform({ interpolation: "nearest", ...init });
4815
4815
  try {
4816
- const b = session.smartObject || session.typeLayer ? _nullishCoalesce(_chunk4S2AXNQFcjs.transformedBox.call(void 0, session.startGeometry), () => ( session.box)) : session.box;
4816
+ const b = session.smartObject || session.typeLayer ? _nullishCoalesce(_chunkHTAFDTNRcjs.transformedBox.call(void 0, session.startGeometry), () => ( session.box)) : session.box;
4817
4817
  const cx = b.x + b.width / 2;
4818
4818
  const cy = b.y + b.height / 2;
4819
4819
  const ox = turn === 180 ? 0 : Math.round(cx - b.height / 2) - (cx - b.height / 2);
4820
4820
  const oy = turn === 180 ? 0 : Math.round(cy - b.width / 2) - (cy - b.width / 2);
4821
4821
  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];
4822
- session.update({ corners: session.startGeometry.corners.map((p) => _chunkLI3KTY7Kcjs.applyMatrix.call(void 0, m, p)) }, false);
4822
+ session.update({ corners: session.startGeometry.corners.map((p) => _chunkVYW7JBTMcjs.applyMatrix.call(void 0, m, p)) }, false);
4823
4823
  return session.commit();
4824
4824
  } catch (e) {
4825
4825
  session.cancel();
@@ -4828,20 +4828,20 @@ var ImageEditorController = (_class6 = class {
4828
4828
  }
4829
4829
  /** Adds a `develop` or `blur` filter to a pixel layer (one undo step). Returns the layer's filters. */
4830
4830
  addLayerFilter(id, filter) {
4831
- const f = _chunk4S2AXNQFcjs.normalizeFilter.call(void 0, filter);
4832
- const next = _chunk4S2AXNQFcjs.addLayerFilter.call(void 0, this.state.layers, id, f);
4831
+ const f = _chunkHTAFDTNRcjs.normalizeFilter.call(void 0, filter);
4832
+ const next = _chunkHTAFDTNRcjs.addLayerFilter.call(void 0, this.state.layers, id, f);
4833
4833
  this.commitLayers(next);
4834
4834
  return _nullishCoalesce(_chunkWMRIG4XQcjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
4835
4835
  }
4836
4836
  /** Changes one filter (one undo step, or none with `commitToHistory = false` during a drag). Returns the filters. */
4837
4837
  updateLayerFilter(id, filterId, changes, commitToHistory = true) {
4838
- const next = _chunk4S2AXNQFcjs.updateLayerFilter.call(void 0, this.state.layers, id, filterId, changes);
4838
+ const next = _chunkHTAFDTNRcjs.updateLayerFilter.call(void 0, this.state.layers, id, filterId, changes);
4839
4839
  this.commitLayers(next, void 0, commitToHistory);
4840
4840
  return _nullishCoalesce(_chunkWMRIG4XQcjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
4841
4841
  }
4842
4842
  /** Removes one filter (one undo step). Returns the remaining filters. */
4843
4843
  removeLayerFilter(id, filterId) {
4844
- const next = _chunk4S2AXNQFcjs.removeLayerFilter.call(void 0, this.state.layers, id, filterId);
4844
+ const next = _chunkHTAFDTNRcjs.removeLayerFilter.call(void 0, this.state.layers, id, filterId);
4845
4845
  this.commitLayers(next);
4846
4846
  return _nullishCoalesce(_chunkWMRIG4XQcjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
4847
4847
  }
@@ -4857,8 +4857,8 @@ var ImageEditorController = (_class6 = class {
4857
4857
  */
4858
4858
  convertToSmartObject(ids, options = {}) {
4859
4859
  const list = _optionalChain([ids, 'optionalAccess', _163 => _163.length]) ? ids : this.state.activeLayerId ? [this.state.activeLayerId] : [];
4860
- if (!list.length) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("No layers given and none is active; pass layerIds (see list_layers).");
4861
- const res = _chunk4S2AXNQFcjs.convertToSmartObject.call(void 0, this.state.layers, list, this.canvasSize, { surfaceOf: (l) => this.surfaceOf(l), name: options.name });
4860
+ if (!list.length) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("No layers given and none is active; pass layerIds (see list_layers).");
4861
+ const res = _chunkHTAFDTNRcjs.convertToSmartObject.call(void 0, this.state.layers, list, this.canvasSize, { surfaceOf: (l) => this.surfaceOf(l), name: options.name });
4862
4862
  this.commitLayers(res.layers, () => {
4863
4863
  this.state.activeLayerId = res.layer.id;
4864
4864
  this.state.activeTarget = "pixels";
@@ -4867,7 +4867,7 @@ var ImageEditorController = (_class6 = class {
4867
4867
  }
4868
4868
  /** Layer › Smart Objects › Rasterize (one undo step): the smart object becomes a pixel layer holding what it renders. */
4869
4869
  rasterizeSmartObject(id) {
4870
- const res = _chunk4S2AXNQFcjs.rasterizeSmartObject.call(void 0, this.state.layers, id);
4870
+ const res = _chunkHTAFDTNRcjs.rasterizeSmartObject.call(void 0, this.state.layers, id);
4871
4871
  this.commitLayers(res.layers, () => {
4872
4872
  if (this.state.activeLayerId === id && this.state.activeTarget === "filter-mask") this.state.activeTarget = "pixels";
4873
4873
  });
@@ -4875,10 +4875,10 @@ var ImageEditorController = (_class6 = class {
4875
4875
  }
4876
4876
  /** A smart object's contents, placement and smart filters as plain data (see `SmartObjectInfo`). */
4877
4877
  getSmartObject(id) {
4878
- const layer = _chunk4S2AXNQFcjs.requireSmartObject.call(void 0, this.state.layers, id);
4878
+ const layer = _chunkHTAFDTNRcjs.requireSmartObject.call(void 0, this.state.layers, id);
4879
4879
  const c = layer.contents;
4880
- const g = _chunk4S2AXNQFcjs.placementGeometry.call(void 0, layer);
4881
- const readout = _chunk4S2AXNQFcjs.describeTransform.call(void 0, g);
4880
+ const g = _chunkHTAFDTNRcjs.placementGeometry.call(void 0, layer);
4881
+ const readout = _chunkHTAFDTNRcjs.describeTransform.call(void 0, g);
4882
4882
  const stack = layer.smartFilters;
4883
4883
  return {
4884
4884
  layerId: layer.id,
@@ -4888,10 +4888,10 @@ var ImageEditorController = (_class6 = class {
4888
4888
  kind: c.kind,
4889
4889
  width: c.width,
4890
4890
  height: c.height,
4891
- decoded: _chunk4S2AXNQFcjs.isContentsDecoded.call(void 0, c),
4891
+ decoded: _chunkHTAFDTNRcjs.isContentsDecoded.call(void 0, c),
4892
4892
  fileType: _nullishCoalesce(_optionalChain([c, 'access', _164 => _164.file, 'optionalAccess', _165 => _165.type]), () => ( null)),
4893
4893
  linkedPath: _nullishCoalesce(_optionalChain([c, 'access', _166 => _166.linked, 'optionalAccess', _167 => _167.path]), () => ( null)),
4894
- instances: _chunk4S2AXNQFcjs.instancesOf.call(void 0, this.state.layers, c.id),
4894
+ instances: _chunkHTAFDTNRcjs.instancesOf.call(void 0, this.state.layers, c.id),
4895
4895
  layerCount: c.document ? _chunkWMRIG4XQcjs.flattenLayers.call(void 0, c.document.layers).length : 0
4896
4896
  },
4897
4897
  placement: {
@@ -4903,8 +4903,8 @@ var ImageEditorController = (_class6 = class {
4903
4903
  scaleY: readout.scaleY,
4904
4904
  rotate: readout.rotate,
4905
4905
  skewX: readout.skewX,
4906
- center: _chunk4S2AXNQFcjs.anchorPoint.call(void 0, g, "center"),
4907
- bounds: _chunk4S2AXNQFcjs.transformedBox.call(void 0, g)
4906
+ center: _chunkHTAFDTNRcjs.anchorPoint.call(void 0, g, "center"),
4907
+ bounds: _chunkHTAFDTNRcjs.transformedBox.call(void 0, g)
4908
4908
  },
4909
4909
  smartFilters: {
4910
4910
  enabled: _nullishCoalesce(_optionalChain([stack, 'optionalAccess', _168 => _168.enabled]), () => ( true)),
@@ -4921,7 +4921,7 @@ var ImageEditorController = (_class6 = class {
4921
4921
  * change. Returns the new placement summary.
4922
4922
  */
4923
4923
  setSmartObjectPlacement(id, placement, commitToHistory = true) {
4924
- const res = _chunk4S2AXNQFcjs.setSmartPlacement.call(void 0, this.state.layers, id, placement, this.canvasSize);
4924
+ const res = _chunkHTAFDTNRcjs.setSmartPlacement.call(void 0, this.state.layers, id, placement, this.canvasSize);
4925
4925
  this.commitLayers(res.layers, void 0, commitToHistory);
4926
4926
  return { ...this.getSmartObject(id).placement, masksMoved: res.masksMoved };
4927
4927
  }
@@ -4934,23 +4934,23 @@ var ImageEditorController = (_class6 = class {
4934
4934
  * nothing is relative to the current transform.
4935
4935
  */
4936
4936
  setSmartObjectTransform(id, spec) {
4937
- const layer = _chunk4S2AXNQFcjs.requireSmartObject.call(void 0, this.state.layers, id);
4938
- const g = _chunk4S2AXNQFcjs.placementGeometry.call(void 0, layer);
4937
+ const layer = _chunkHTAFDTNRcjs.requireSmartObject.call(void 0, this.state.layers, id);
4938
+ const g = _chunkHTAFDTNRcjs.placementGeometry.call(void 0, layer);
4939
4939
  const numeric = ["scaleX", "scaleY", "rotate", "skewX", "skewY", "x", "y"].filter((k) => spec[k] !== void 0);
4940
4940
  const ways = [spec.corners !== void 0, spec.matrix !== void 0, numeric.length > 0].filter(Boolean).length;
4941
- if (ways > 1) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("Give the transform only one way: corners, matrix, or the numbers (scaleX, scaleY, rotate, skewX, skewY, x, y).");
4941
+ if (ways > 1) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("Give the transform only one way: corners, matrix, or the numbers (scaleX, scaleY, rotate, skewX, skewY, x, y).");
4942
4942
  let corners = g.corners;
4943
4943
  if (spec.corners) corners = spec.corners;
4944
4944
  else if (spec.matrix) {
4945
- if (!(Array.isArray(spec.matrix) && spec.matrix.length === 6 && spec.matrix.every(Number.isFinite))) throw new (0, _chunk4S2AXNQFcjs.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).");
4945
+ if (!(Array.isArray(spec.matrix) && spec.matrix.length === 6 && spec.matrix.every(Number.isFinite))) throw new (0, _chunkHTAFDTNRcjs.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).");
4946
4946
  const [a, b, c, d] = spec.matrix;
4947
- if (Math.abs(a * d - b * c) < 1e-9) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("matrix is singular (it collapses the contents to a line); a\xB7d \u2212 b\xB7c must not be 0.");
4948
- corners = _chunk4S2AXNQFcjs.cornersFromMatrix.call(void 0, g.box, spec.matrix);
4947
+ if (Math.abs(a * d - b * c) < 1e-9) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("matrix is singular (it collapses the contents to a line); a\xB7d \u2212 b\xB7c must not be 0.");
4948
+ corners = _chunkHTAFDTNRcjs.cornersFromMatrix.call(void 0, g.box, spec.matrix);
4949
4949
  } else if (numeric.length) {
4950
- if (spec.scaleX === 0 || spec.scaleY === 0) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("scaleX and scaleY must not be 0 (that collapses the contents to a line).");
4951
- for (const k of numeric) if (!Number.isFinite(spec[k])) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)(`${k} must be a finite number.`);
4952
- const now = _chunk4S2AXNQFcjs.describeTransform.call(void 0, g);
4953
- const centre = _chunk4S2AXNQFcjs.anchorPoint.call(void 0, g, "center");
4950
+ if (spec.scaleX === 0 || spec.scaleY === 0) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("scaleX and scaleY must not be 0 (that collapses the contents to a line).");
4951
+ for (const k of numeric) if (!Number.isFinite(spec[k])) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)(`${k} must be a finite number.`);
4952
+ const now = _chunkHTAFDTNRcjs.describeTransform.call(void 0, g);
4953
+ const centre = _chunkHTAFDTNRcjs.anchorPoint.call(void 0, g, "center");
4954
4954
  const params = {
4955
4955
  scaleX: _nullishCoalesce(spec.scaleX, () => ( (now.affine ? now.scaleX : 100))),
4956
4956
  scaleY: _nullishCoalesce(spec.scaleY, () => ( (now.affine ? now.scaleY : 100))),
@@ -4958,20 +4958,20 @@ var ImageEditorController = (_class6 = class {
4958
4958
  skewX: _nullishCoalesce(spec.skewX, () => ( (now.affine ? now.skewX : 0))),
4959
4959
  skewY: _nullishCoalesce(spec.skewY, () => ( 0))
4960
4960
  };
4961
- const m = _chunk4S2AXNQFcjs.matrixFromParams.call(void 0, g.box, { ...params, reference: "center" });
4961
+ const m = _chunkHTAFDTNRcjs.matrixFromParams.call(void 0, g.box, { ...params, reference: "center" });
4962
4962
  const cx = g.box.width / 2;
4963
4963
  const cy = g.box.height / 2;
4964
4964
  const to = { x: _nullishCoalesce(spec.x, () => ( centre.x)), y: _nullishCoalesce(spec.y, () => ( centre.y)) };
4965
- corners = _chunk4S2AXNQFcjs.cornersFromMatrix.call(void 0, g.box, _chunkLI3KTY7Kcjs.multiplyMatrices.call(void 0, m, _chunkLI3KTY7Kcjs.translateMatrix.call(void 0, to.x - cx, to.y - cy)));
4965
+ corners = _chunkHTAFDTNRcjs.cornersFromMatrix.call(void 0, g.box, _chunkVYW7JBTMcjs.multiplyMatrices.call(void 0, m, _chunkVYW7JBTMcjs.translateMatrix.call(void 0, to.x - cx, to.y - cy)));
4966
4966
  }
4967
4967
  let warp = _nullishCoalesce(layer.placement.warp, () => ( null));
4968
4968
  if (spec.warp === null) warp = null;
4969
4969
  else if (spec.warp) {
4970
4970
  if ("style" in spec.warp) {
4971
- if (!_chunkLI3KTY7Kcjs.WARP_STYLES.includes(spec.warp.style)) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)(`Unknown warp style "${String(spec.warp.style)}". Styles: ${_chunkLI3KTY7Kcjs.WARP_STYLES.join(", ")}.`);
4972
- warp = _chunk4S2AXNQFcjs.presetWarp.call(void 0, g.box, spec.warp);
4971
+ if (!_chunkVYW7JBTMcjs.WARP_STYLES.includes(spec.warp.style)) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)(`Unknown warp style "${String(spec.warp.style)}". Styles: ${_chunkVYW7JBTMcjs.WARP_STYLES.join(", ")}.`);
4972
+ warp = _chunkHTAFDTNRcjs.presetWarp.call(void 0, g.box, spec.warp);
4973
4973
  } else {
4974
- if (!_chunk4S2AXNQFcjs.isValidWarp.call(void 0, spec.warp)) throw new (0, _chunk4S2AXNQFcjs.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.");
4974
+ if (!_chunkHTAFDTNRcjs.isValidWarp.call(void 0, spec.warp)) throw new (0, _chunkHTAFDTNRcjs.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.");
4975
4975
  warp = spec.warp;
4976
4976
  }
4977
4977
  }
@@ -4985,16 +4985,16 @@ var ImageEditorController = (_class6 = class {
4985
4985
  * the layers that changed.
4986
4986
  */
4987
4987
  replaceSmartObjectContents(id, source) {
4988
- const layer = _chunk4S2AXNQFcjs.requireSmartObject.call(void 0, this.state.layers, id);
4988
+ const layer = _chunkHTAFDTNRcjs.requireSmartObject.call(void 0, this.state.layers, id);
4989
4989
  let contents;
4990
4990
  if ("contents" in source) contents = source.contents;
4991
- else if ("pixels" in source) contents = _chunk4S2AXNQFcjs.rasterContents.call(void 0, source.pixels, _nullishCoalesce(source.name, () => ( layer.contents.name.replace(/\.\w+$/, ".png"))));
4991
+ else if ("pixels" in source) contents = _chunkHTAFDTNRcjs.rasterContents.call(void 0, source.pixels, _nullishCoalesce(source.name, () => ( layer.contents.name.replace(/\.\w+$/, ".png"))));
4992
4992
  else {
4993
- const psd = _chunk4S2AXNQFcjs.importPsd.call(void 0, source.psd, { newId: () => _chunk4S2AXNQFcjs.newLayerId.call(void 0, ) });
4994
- contents = _chunk4S2AXNQFcjs.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`)));
4993
+ const psd = _chunkHTAFDTNRcjs.importPsd.call(void 0, source.psd, { newId: () => _chunkHTAFDTNRcjs.newLayerId.call(void 0, ) });
4994
+ contents = _chunkHTAFDTNRcjs.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`)));
4995
4995
  contents.file = { bytes: source.psd.slice(), type: psd.info.psb ? "psb" : "psd" };
4996
4996
  }
4997
- const res = _chunk4S2AXNQFcjs.replaceContents.call(void 0, this.state.layers, layer.contents.id, contents, this.canvasSize);
4997
+ const res = _chunkHTAFDTNRcjs.replaceContents.call(void 0, this.state.layers, layer.contents.id, contents, this.canvasSize);
4998
4998
  this.commitLayers(res.layers);
4999
4999
  return { contentsId: layer.contents.id, width: contents.width, height: contents.height, layerIds: res.ids };
5000
5000
  }
@@ -5009,16 +5009,16 @@ var ImageEditorController = (_class6 = class {
5009
5009
  * and bytes.
5010
5010
  */
5011
5011
  exportSmartObjectContents(id) {
5012
- const layer = _chunk4S2AXNQFcjs.requireSmartObject.call(void 0, this.state.layers, id);
5012
+ const layer = _chunkHTAFDTNRcjs.requireSmartObject.call(void 0, this.state.layers, id);
5013
5013
  const c = layer.contents;
5014
5014
  const base = c.name.replace(/\.\w+$/, "") || "Contents";
5015
5015
  if (c.file) {
5016
- const mime = { psd: "image/vnd.adobe.photoshop", psb: "image/vnd.adobe.photoshop", pdf: "application/pdf", ..._chunk4S2AXNQFcjs.BROWSER_IMAGE_TYPES };
5016
+ const mime = { psd: "image/vnd.adobe.photoshop", psb: "image/vnd.adobe.photoshop", pdf: "application/pdf", ..._chunkHTAFDTNRcjs.BROWSER_IMAGE_TYPES };
5017
5017
  const ext = c.file.type.toLowerCase();
5018
5018
  return { name: /\.\w+$/.test(c.name) ? c.name : `${base}.${ext}`, mimeType: _nullishCoalesce(mime[ext], () => ( "application/octet-stream")), bytes: c.file.bytes };
5019
5019
  }
5020
- if (!_chunk4S2AXNQFcjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)(`The contents of "${layer.name || id}" are not available here.`);
5021
- const f = _chunk4S2AXNQFcjs.smartContentsFile.call(void 0, c);
5020
+ if (!_chunkHTAFDTNRcjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)(`The contents of "${layer.name || id}" are not available here.`);
5021
+ const f = _chunkHTAFDTNRcjs.smartContentsFile.call(void 0, c);
5022
5022
  return { name: f.name, mimeType: f.name.endsWith(".png") ? "image/png" : "image/vnd.adobe.photoshop", bytes: f.bytes };
5023
5023
  }
5024
5024
  /**
@@ -5027,7 +5027,7 @@ var ImageEditorController = (_class6 = class {
5027
5027
  * undo step. Returns the copy's id.
5028
5028
  */
5029
5029
  copySmartObject(id, linked = false, name) {
5030
- const res = _chunk4S2AXNQFcjs.copySmartObject.call(void 0, this.state.layers, id, linked, name);
5030
+ const res = _chunkHTAFDTNRcjs.copySmartObject.call(void 0, this.state.layers, id, linked, name);
5031
5031
  this.commitLayers(res.layers, () => {
5032
5032
  this.state.activeLayerId = res.layer.id;
5033
5033
  this.state.activeTarget = "pixels";
@@ -5036,31 +5036,31 @@ var ImageEditorController = (_class6 = class {
5036
5036
  }
5037
5037
  /** Adds a smart filter (`develop` or `blur`, with `blend` and `opacity`) at `index` (default the top), as one undo step. */
5038
5038
  addSmartFilter(id, filter, index) {
5039
- const res = _chunk4S2AXNQFcjs.addSmartFilter.call(void 0, this.state.layers, id, _chunk4S2AXNQFcjs.normalizeSmartFilter.call(void 0, filter), this.canvasSize, index);
5039
+ const res = _chunkHTAFDTNRcjs.addSmartFilter.call(void 0, this.state.layers, id, _chunkHTAFDTNRcjs.normalizeSmartFilter.call(void 0, filter), this.canvasSize, index);
5040
5040
  this.commitLayers(res.layers);
5041
5041
  return res.filter;
5042
5042
  }
5043
5043
  /** Changes one smart filter (one undo step, or none with `commitToHistory = false` during a drag). */
5044
5044
  updateSmartFilter(id, filterId, changes, commitToHistory = true) {
5045
- const res = _chunk4S2AXNQFcjs.updateSmartFilter.call(void 0, this.state.layers, id, filterId, changes, this.canvasSize);
5045
+ const res = _chunkHTAFDTNRcjs.updateSmartFilter.call(void 0, this.state.layers, id, filterId, changes, this.canvasSize);
5046
5046
  this.commitLayers(res.layers, void 0, commitToHistory);
5047
5047
  return res.filter;
5048
5048
  }
5049
5049
  /** Removes one smart filter (one undo step). Returns the remaining filters. */
5050
5050
  removeSmartFilter(id, filterId) {
5051
- const res = _chunk4S2AXNQFcjs.removeSmartFilter.call(void 0, this.state.layers, id, filterId, this.canvasSize);
5051
+ const res = _chunkHTAFDTNRcjs.removeSmartFilter.call(void 0, this.state.layers, id, filterId, this.canvasSize);
5052
5052
  this.commitLayers(res.layers);
5053
5053
  return _nullishCoalesce(_optionalChain([res, 'access', _171 => _171.layer, 'access', _172 => _172.smartFilters, 'optionalAccess', _173 => _173.filters]), () => ( []));
5054
5054
  }
5055
5055
  /** Moves one smart filter to `index` (0 = bottom, applied first), as one undo step. Returns the filters. */
5056
5056
  moveSmartFilter(id, filterId, index) {
5057
- const res = _chunk4S2AXNQFcjs.moveSmartFilter.call(void 0, this.state.layers, id, filterId, index, this.canvasSize);
5057
+ const res = _chunkHTAFDTNRcjs.moveSmartFilter.call(void 0, this.state.layers, id, filterId, index, this.canvasSize);
5058
5058
  this.commitLayers(res.layers);
5059
5059
  return _nullishCoalesce(_optionalChain([res, 'access', _174 => _174.layer, 'access', _175 => _175.smartFilters, 'optionalAccess', _176 => _176.filters]), () => ( []));
5060
5060
  }
5061
5061
  /** Turns a smart object's whole filter stack on or off (one undo step). */
5062
5062
  setSmartFiltersEnabled(id, enabled) {
5063
- const res = _chunk4S2AXNQFcjs.setSmartFiltersEnabled.call(void 0, this.state.layers, id, enabled, this.canvasSize);
5063
+ const res = _chunkHTAFDTNRcjs.setSmartFiltersEnabled.call(void 0, this.state.layers, id, enabled, this.canvasSize);
5064
5064
  this.commitLayers(res.layers);
5065
5065
  return _nullishCoalesce(_optionalChain([res, 'access', _177 => _177.layer, 'access', _178 => _178.smartFilters, 'optionalAccess', _179 => _179.enabled]), () => ( true));
5066
5066
  }
@@ -5070,21 +5070,21 @@ var ImageEditorController = (_class6 = class {
5070
5070
  * Painting it targets channel `filter-mask`. Returns the mask, or `null` when removed.
5071
5071
  */
5072
5072
  setSmartFilterMask(id, from, props = {}, commitToHistory = true) {
5073
- const layer = _chunk4S2AXNQFcjs.requireSmartObject.call(void 0, this.state.layers, id);
5073
+ const layer = _chunkHTAFDTNRcjs.requireSmartObject.call(void 0, this.state.layers, id);
5074
5074
  let mask;
5075
5075
  if (from === "none") mask = null;
5076
5076
  else if (from === "keep") {
5077
- if (!_optionalChain([layer, 'access', _180 => _180.smartFilters, 'optionalAccess', _181 => _181.mask])) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)(`Smart object "${layer.name || id}" has no filter mask; add one with from reveal-all, hide-all or selection.`);
5077
+ if (!_optionalChain([layer, 'access', _180 => _180.smartFilters, 'optionalAccess', _181 => _181.mask])) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)(`Smart object "${layer.name || id}" has no filter mask; add one with from reveal-all, hide-all or selection.`);
5078
5078
  mask = withMaskProps(layer.smartFilters.mask, props);
5079
5079
  } else if (from === "selection") {
5080
5080
  const sel = this.state.selection;
5081
- if (!_optionalChain([sel, 'optionalAccess', _182 => _182.bounds])) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
5081
+ if (!_optionalChain([sel, 'optionalAccess', _182 => _182.bounds])) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
5082
5082
  mask = this.maskFromSelection(sel, props);
5083
5083
  } else {
5084
5084
  const v = from === "reveal-all" ? 255 : 0;
5085
5085
  mask = withMaskProps({ surface: _chunk7ISPWEJAcjs.emptySurface.call(void 0, 1, v), defaultValue: v }, props);
5086
5086
  }
5087
- const res = _chunk4S2AXNQFcjs.setSmartFilterMask.call(void 0, this.state.layers, id, mask, this.canvasSize);
5087
+ const res = _chunkHTAFDTNRcjs.setSmartFilterMask.call(void 0, this.state.layers, id, mask, this.canvasSize);
5088
5088
  this.commitLayers(res.layers, () => {
5089
5089
  if (this.state.activeLayerId !== id) return;
5090
5090
  if (mask && from !== "keep") this.state.activeTarget = "filter-mask";
@@ -5100,14 +5100,14 @@ var ImageEditorController = (_class6 = class {
5100
5100
  async prepareSmartObjects() {
5101
5101
  const pending = /* @__PURE__ */ new Map();
5102
5102
  for (const l of _chunkWMRIG4XQcjs.flattenLayers.call(void 0, this.state.layers)) {
5103
- if (l.type === "smart" && !_chunk4S2AXNQFcjs.isContentsDecoded.call(void 0, l.contents) && l.contents.file && _chunk4S2AXNQFcjs.BROWSER_IMAGE_TYPES[l.contents.file.type]) pending.set(l.contents.id, l.contents);
5103
+ if (l.type === "smart" && !_chunkHTAFDTNRcjs.isContentsDecoded.call(void 0, l.contents) && l.contents.file && _chunkHTAFDTNRcjs.BROWSER_IMAGE_TYPES[l.contents.file.type]) pending.set(l.contents.id, l.contents);
5104
5104
  }
5105
5105
  const left = [];
5106
5106
  for (const [cid, c] of pending) {
5107
5107
  try {
5108
- const url = `data:${_chunk4S2AXNQFcjs.BROWSER_IMAGE_TYPES[c.file.type]};base64,${_chunkEJVDBITDcjs.bytesToBase64.call(void 0, c.file.bytes)}`;
5108
+ const url = `data:${_chunkHTAFDTNRcjs.BROWSER_IMAGE_TYPES[c.file.type]};base64,${_chunkEJVDBITDcjs.bytesToBase64.call(void 0, c.file.bytes)}`;
5109
5109
  const px2 = await this.decodeImage(url);
5110
- const decoded = { ...c, kind: "raster", raster: _chunk4S2AXNQFcjs.rasterContents.call(void 0, px2, c.name, cid).raster, width: px2.width, height: px2.height };
5110
+ const decoded = { ...c, kind: "raster", raster: _chunkHTAFDTNRcjs.rasterContents.call(void 0, px2, c.name, cid).raster, width: px2.width, height: px2.height };
5111
5111
  const swap = (layers) => {
5112
5112
  let out = layers;
5113
5113
  for (const l of _chunkWMRIG4XQcjs.flattenLayers.call(void 0, layers)) if (l.type === "smart" && l.contents.id === cid) out = _chunkWMRIG4XQcjs.mapLayer.call(void 0, out, l.id, (x) => ({ ...x, contents: decoded }));
@@ -5135,10 +5135,10 @@ var ImageEditorController = (_class6 = class {
5135
5135
  * Contents can nest. Returns the contents' size and layer ids.
5136
5136
  */
5137
5137
  editSmartObjectContents(id) {
5138
- if (this.getFreeTransform()) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("A Free Transform is open; commit or cancel it first.");
5139
- const layer = _chunk4S2AXNQFcjs.requireSmartObject.call(void 0, this.state.layers, id);
5138
+ if (this.getFreeTransform()) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("A Free Transform is open; commit or cancel it first.");
5139
+ const layer = _chunkHTAFDTNRcjs.requireSmartObject.call(void 0, this.state.layers, id);
5140
5140
  const c = layer.contents;
5141
- if (!_chunk4S2AXNQFcjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)(`The contents of "${layer.name || id}" are a ${_nullishCoalesce(_optionalChain([c, 'access', _186 => _186.file, 'optionalAccess', _187 => _187.type]), () => ( "file"))} that could not be decoded here; run prepareSmartObjects() in a browser first.`);
5141
+ if (!_chunkHTAFDTNRcjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)(`The contents of "${layer.name || id}" are a ${_nullishCoalesce(_optionalChain([c, 'access', _186 => _186.file, 'optionalAccess', _187 => _187.type]), () => ( "file"))} that could not be decoded here; run prepareSmartObjects() in a browser first.`);
5142
5142
  const saved = {
5143
5143
  state: { ...this.state },
5144
5144
  undo: this.undoStack,
@@ -5149,7 +5149,7 @@ var ImageEditorController = (_class6 = class {
5149
5149
  samplePixelsOverride: this.samplePixelsOverride,
5150
5150
  psdResolution: this.psdResolution
5151
5151
  };
5152
- const layers = c.kind === "document" ? c.document.layers : [{ type: "pixel", id: _chunk4S2AXNQFcjs.newLayerId.call(void 0, ), name: "Layer 0", visible: true, opacity: 1, blend: "normal", surface: c.raster, offset: { x: 0, y: 0 } }];
5152
+ const layers = c.kind === "document" ? c.document.layers : [{ type: "pixel", id: _chunkHTAFDTNRcjs.newLayerId.call(void 0, ), name: "Layer 0", visible: true, opacity: 1, blend: "normal", surface: c.raster, offset: { x: 0, y: 0 } }];
5153
5153
  this.contentsStack.push({ layerId: layer.id, contentsId: c.id, name: layer.name || c.name, saved });
5154
5154
  const s = this.state;
5155
5155
  this.state = {
@@ -5157,7 +5157,7 @@ var ImageEditorController = (_class6 = class {
5157
5157
  sourceUrl: null,
5158
5158
  imageDimensions: { width: c.width, height: c.height },
5159
5159
  crop: null,
5160
- transform: { ..._chunk4S2AXNQFcjs.DEFAULT_TRANSFORM_VALUES },
5160
+ transform: { ..._chunkHTAFDTNRcjs.DEFAULT_TRANSFORM_VALUES },
5161
5161
  layers,
5162
5162
  activeLayerId: layers.length ? layers[layers.length - 1].id : null,
5163
5163
  activeTarget: "pixels",
@@ -5190,7 +5190,7 @@ var ImageEditorController = (_class6 = class {
5190
5190
  */
5191
5191
  closeSmartObjectContents(save = true) {
5192
5192
  const top = this.contentsStack.pop();
5193
- if (!top) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("No smart object contents are open; open them with edit_smart_object_contents.");
5193
+ if (!top) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("No smart object contents are open; open them with edit_smart_object_contents.");
5194
5194
  if (_optionalChain([this, 'access', _193 => _193.openTransform, 'optionalAccess', _194 => _194.isOpen])) this.openTransform.cancel();
5195
5195
  this.openTransform = null;
5196
5196
  const edited = this.state;
@@ -5204,10 +5204,10 @@ var ImageEditorController = (_class6 = class {
5204
5204
  const plain3 = _optionalChain([only, 'optionalAccess', _197 => _197.type]) === "pixel" && only.visible && only.opacity === 1 && only.blend === "normal" && !only.mask && !only.effects && !_optionalChain([only, 'access', _198 => _198.filters, 'optionalAccess', _199 => _199.length]) && !only.clipped && (_nullishCoalesce(only.fillOpacity, () => ( 1))) === 1 && only.source !== "document";
5205
5205
  if (_optionalChain([old, 'optionalAccess', _200 => _200.kind]) === "raster" && plain3) {
5206
5206
  const px2 = _chunk7ISPWEJAcjs.readRegion.call(void 0, only.surface, { x: -only.offset.x, y: -only.offset.y, width, height });
5207
- next = _chunk4S2AXNQFcjs.rasterContents.call(void 0, { width, height, data: px2 }, old.name, old.id);
5207
+ next = _chunkHTAFDTNRcjs.rasterContents.call(void 0, { width, height, data: px2 }, old.name, old.id);
5208
5208
  } else {
5209
5209
  const doc = { layers: edited.layers, globalLight: edited.globalLight, patterns: edited.patterns };
5210
- next = _chunk4S2AXNQFcjs.documentContents.call(void 0, doc, width, height, _optionalChain([old, 'optionalAccess', _201 => _201.kind]) === "document" ? old.name : `${(_nullishCoalesce(_optionalChain([old, 'optionalAccess', _202 => _202.name]), () => ( "Contents"))).replace(/\.\w+$/, "")}.psb`, top.contentsId);
5210
+ next = _chunkHTAFDTNRcjs.documentContents.call(void 0, doc, width, height, _optionalChain([old, 'optionalAccess', _201 => _201.kind]) === "document" ? old.name : `${(_nullishCoalesce(_optionalChain([old, 'optionalAccess', _202 => _202.name]), () => ( "Contents"))).replace(/\.\w+$/, "")}.psb`, top.contentsId);
5211
5211
  }
5212
5212
  }
5213
5213
  const saved = top.saved;
@@ -5226,7 +5226,7 @@ var ImageEditorController = (_class6 = class {
5226
5226
  this.notify();
5227
5227
  return { layerId: top.layerId, changed: false, layerIds: [] };
5228
5228
  }
5229
- const res = _chunk4S2AXNQFcjs.replaceContents.call(void 0, this.state.layers, top.contentsId, next, this.canvasSize);
5229
+ const res = _chunkHTAFDTNRcjs.replaceContents.call(void 0, this.state.layers, top.contentsId, next, this.canvasSize);
5230
5230
  this.commitLayers(res.layers);
5231
5231
  return { layerId: top.layerId, changed: true, layerIds: res.ids };
5232
5232
  }
@@ -5241,35 +5241,35 @@ var ImageEditorController = (_class6 = class {
5241
5241
  // --- Layer effects ---
5242
5242
  /** A layer's effects (an empty, enabled list when it has none). */
5243
5243
  getLayerEffects(id) {
5244
- return _chunk4S2AXNQFcjs.layerEffectsOf.call(void 0, _chunk4S2AXNQFcjs.requireLayer.call(void 0, this.state.layers, id).layer);
5244
+ return _chunkHTAFDTNRcjs.layerEffectsOf.call(void 0, _chunkHTAFDTNRcjs.requireLayer.call(void 0, this.state.layers, id).layer);
5245
5245
  }
5246
5246
  /**
5247
5247
  * Adds an effect of `kind` with Photoshop's defaults and `params` applied (one undo step), at
5248
5248
  * `index` in the layer's effect list (default the end). Returns the new effect and the effects.
5249
5249
  */
5250
5250
  addLayerEffect(id, kind, params = {}, index) {
5251
- const res = _chunk4S2AXNQFcjs.addLayerEffect.call(void 0, this.state.layers, id, kind, params, index);
5251
+ const res = _chunkHTAFDTNRcjs.addLayerEffect.call(void 0, this.state.layers, id, kind, params, index);
5252
5252
  this.commitLayers(res.layers);
5253
5253
  return { effect: res.effect, effects: this.getLayerEffects(id) };
5254
5254
  }
5255
5255
  /** Changes one effect (one undo step, or none with `commitToHistory = false` during a drag). Returns the effects. */
5256
5256
  updateLayerEffect(id, effectId, changes, commitToHistory = true) {
5257
- this.commitLayers(_chunk4S2AXNQFcjs.updateLayerEffect.call(void 0, this.state.layers, id, effectId, changes), void 0, commitToHistory);
5257
+ this.commitLayers(_chunkHTAFDTNRcjs.updateLayerEffect.call(void 0, this.state.layers, id, effectId, changes), void 0, commitToHistory);
5258
5258
  return this.getLayerEffects(id);
5259
5259
  }
5260
5260
  /** Removes one effect (one undo step). Returns the remaining effects. */
5261
5261
  removeLayerEffect(id, effectId) {
5262
- this.commitLayers(_chunk4S2AXNQFcjs.removeLayerEffect.call(void 0, this.state.layers, id, effectId));
5262
+ this.commitLayers(_chunkHTAFDTNRcjs.removeLayerEffect.call(void 0, this.state.layers, id, effectId));
5263
5263
  return this.getLayerEffects(id);
5264
5264
  }
5265
5265
  /** Turns a layer's effects on or off as a whole and, when given, sets Scale Effects (one undo step). */
5266
5266
  setLayerEffectsEnabled(id, enabled, scale, commitToHistory = true) {
5267
- this.commitLayers(_chunk4S2AXNQFcjs.setLayerEffectsEnabled.call(void 0, this.state.layers, id, enabled, scale), void 0, commitToHistory);
5267
+ this.commitLayers(_chunkHTAFDTNRcjs.setLayerEffectsEnabled.call(void 0, this.state.layers, id, enabled, scale), void 0, commitToHistory);
5268
5268
  return this.getLayerEffects(id);
5269
5269
  }
5270
5270
  /** Replaces a layer's effects (one undo step; `null` removes them). Returns the effects. */
5271
5271
  setLayerEffects(id, effects, commitToHistory = true) {
5272
- this.commitLayers(_chunk4S2AXNQFcjs.setLayerEffects.call(void 0, this.state.layers, id, effects), void 0, commitToHistory);
5272
+ this.commitLayers(_chunkHTAFDTNRcjs.setLayerEffects.call(void 0, this.state.layers, id, effects), void 0, commitToHistory);
5273
5273
  return this.getLayerEffects(id);
5274
5274
  }
5275
5275
  __init67() {this.patternIds = /* @__PURE__ */ new WeakMap()}
@@ -5295,8 +5295,8 @@ var ImageEditorController = (_class6 = class {
5295
5295
  /** Sets the global light (one undo step). `angle` -360..360°, `altitude` 0..90°. Returns it. */
5296
5296
  setGlobalLight(light, commitToHistory = true) {
5297
5297
  const next = { ...this.getGlobalLight(), ...light };
5298
- if (!(Number.isFinite(next.angle) && next.angle >= -360 && next.angle <= 360)) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)(`angle must be from -360 to 360 degrees, got ${next.angle}.`);
5299
- if (!(Number.isFinite(next.altitude) && next.altitude >= 0 && next.altitude <= 90)) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)(`altitude must be from 0 to 90 degrees, got ${next.altitude}.`);
5298
+ if (!(Number.isFinite(next.angle) && next.angle >= -360 && next.angle <= 360)) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)(`angle must be from -360 to 360 degrees, got ${next.angle}.`);
5299
+ if (!(Number.isFinite(next.altitude) && next.altitude >= 0 && next.altitude <= 90)) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)(`altitude must be from 0 to 90 degrees, got ${next.altitude}.`);
5300
5300
  if (commitToHistory) this.recordHistory();
5301
5301
  if (next.angle === _chunkWMRIG4XQcjs.DEFAULT_GLOBAL_LIGHT.angle && next.altitude === _chunkWMRIG4XQcjs.DEFAULT_GLOBAL_LIGHT.altitude) delete this.state.globalLight;
5302
5302
  else this.state.globalLight = next;
@@ -5307,16 +5307,16 @@ var ImageEditorController = (_class6 = class {
5307
5307
  async compositeToSurface(layers, rect) {
5308
5308
  const { width, height } = this.naturalSize;
5309
5309
  if (_chunkWMRIG4XQcjs.flattenLayers.call(void 0, layers).some((l) => l.type === "annotation" && l.visible) && !this.renderer.canRasterize()) {
5310
- throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("Merging annotation layers needs a canvas (a browser); hide or delete them first, or merge in the browser.");
5310
+ throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("Merging annotation layers needs a canvas (a browser); hide or delete them first, or merge in the browser.");
5311
5311
  }
5312
5312
  await this.renderer.prepareLayerAssets(layers, width, height);
5313
5313
  const sources = this.renderer.compositorSources(width, height);
5314
5314
  const depth = this.bitDepth;
5315
5315
  if (depth !== 8) {
5316
- const samples = _chunkWMRIG4XQcjs.workingToSamples.call(void 0, _chunk4S2AXNQFcjs.compositeDeep.call(void 0, layers, rect, sources, depth), depth);
5316
+ const samples = _chunkWMRIG4XQcjs.workingToSamples.call(void 0, _chunkHTAFDTNRcjs.compositeDeep.call(void 0, layers, rect, sources, depth), depth);
5317
5317
  return _chunk7ISPWEJAcjs.surfaceFromDeepPixels.call(void 0, { width: rect.width, height: rect.height, data: samples }, 4, rect.x, rect.y);
5318
5318
  }
5319
- const data = new (0, _chunk4S2AXNQFcjs.LayerCompositor)().composite(layers, rect, sources);
5319
+ const data = new (0, _chunkHTAFDTNRcjs.LayerCompositor)().composite(layers, rect, sources);
5320
5320
  return _chunk7ISPWEJAcjs.surfaceFromPixels.call(void 0, { width: rect.width, height: rect.height, data }, 4, rect.x, rect.y);
5321
5321
  }
5322
5322
  /**
@@ -5329,22 +5329,22 @@ var ImageEditorController = (_class6 = class {
5329
5329
  const r = _nullishCoalesce(rect, () => ( { x: 0, y: 0, width, height }));
5330
5330
  const depth = this.bitDepth;
5331
5331
  if (depth === 8) return { width: r.width, height: r.height, depth: 16, data: _chunk7ISPWEJAcjs.to16From8.call(void 0, this.compositePixels(r).data) };
5332
- const data = _chunkWMRIG4XQcjs.workingToSamples.call(void 0, _chunk4S2AXNQFcjs.compositeDeep.call(void 0, this.state.layers, r, this.compositorSources(), depth), depth);
5332
+ const data = _chunkWMRIG4XQcjs.workingToSamples.call(void 0, _chunkHTAFDTNRcjs.compositeDeep.call(void 0, this.state.layers, r, this.compositorSources(), depth), depth);
5333
5333
  return { width: r.width, height: r.height, depth, data };
5334
5334
  }
5335
5335
  /** Document bounds a layer can paint into (pixel content, annotations, or the canvas for the rest). */
5336
5336
  paintBounds(layer) {
5337
5337
  const { width, height } = this.naturalSize;
5338
5338
  const canvas = { x: 0, y: 0, width, height };
5339
- if (_chunk4S2AXNQFcjs.hasSurface.call(void 0, layer)) return _nullishCoalesce(this.getLayerBounds(layer.id), () => ( { x: 0, y: 0, width: 0, height: 0 }));
5339
+ if (_chunkHTAFDTNRcjs.hasSurface.call(void 0, layer)) return _nullishCoalesce(this.getLayerBounds(layer.id), () => ( { x: 0, y: 0, width: 0, height: 0 }));
5340
5340
  if (layer.type === "annotation") {
5341
- const b = _chunk4S2AXNQFcjs.getAnnotationBounds.call(void 0, layer.annotation);
5341
+ const b = _chunkHTAFDTNRcjs.getAnnotationBounds.call(void 0, layer.annotation);
5342
5342
  const pad = 4 + ("strokeWidth" in layer.annotation ? layer.annotation.strokeWidth : 0);
5343
5343
  return coveringRect({ x: b.x - pad, y: b.y - pad, width: b.width + 2 * pad, height: b.height + 2 * pad });
5344
5344
  }
5345
5345
  if (layer.type === "group") {
5346
5346
  let r = null;
5347
- for (const c of layer.children) r = _chunk4S2AXNQFcjs.unionRect.call(void 0, r, this.paintBounds(c));
5347
+ for (const c of layer.children) r = _chunkHTAFDTNRcjs.unionRect.call(void 0, r, this.paintBounds(c));
5348
5348
  return _nullishCoalesce(r, () => ( canvas));
5349
5349
  }
5350
5350
  return canvas;
@@ -5355,16 +5355,16 @@ var ImageEditorController = (_class6 = class {
5355
5355
  * Returns the merged id.
5356
5356
  */
5357
5357
  async mergeDown(id) {
5358
- const loc = _chunk4S2AXNQFcjs.requireLayer.call(void 0, this.state.layers, id);
5358
+ const loc = _chunkHTAFDTNRcjs.requireLayer.call(void 0, this.state.layers, id);
5359
5359
  const upper = loc.layer;
5360
5360
  const siblings = loc.parent ? loc.parent.children : this.state.layers;
5361
5361
  const lower = siblings[loc.index - 1];
5362
- if (!lower) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)(`Layer "${upper.name || id}" is the bottom of its group; there is nothing below to merge into.`);
5363
- if (lower.type !== "pixel") throw new (0, _chunk4S2AXNQFcjs.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.`);
5364
- if (!upper.visible) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)(`Layer "${upper.name || id}" is hidden; show it or delete it instead of merging.`);
5365
- _chunk4S2AXNQFcjs.requireUnlocked.call(void 0, upper, "all", "merge it");
5366
- _chunk4S2AXNQFcjs.requireUnlocked.call(void 0, lower, "pixels", "merge into it");
5367
- let rect = _nullishCoalesce(_chunk4S2AXNQFcjs.unionRect.call(void 0, this.paintBounds(lower), upper.type === "adjustment" ? null : this.paintBounds(upper)), () => ( { x: 0, y: 0, width: 1, height: 1 }));
5362
+ if (!lower) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)(`Layer "${upper.name || id}" is the bottom of its group; there is nothing below to merge into.`);
5363
+ if (lower.type !== "pixel") throw new (0, _chunkHTAFDTNRcjs.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.`);
5364
+ if (!upper.visible) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)(`Layer "${upper.name || id}" is hidden; show it or delete it instead of merging.`);
5365
+ _chunkHTAFDTNRcjs.requireUnlocked.call(void 0, upper, "all", "merge it");
5366
+ _chunkHTAFDTNRcjs.requireUnlocked.call(void 0, lower, "pixels", "merge into it");
5367
+ let rect = _nullishCoalesce(_chunkHTAFDTNRcjs.unionRect.call(void 0, this.paintBounds(lower), upper.type === "adjustment" ? null : this.paintBounds(upper)), () => ( { x: 0, y: 0, width: 1, height: 1 }));
5368
5368
  const reach = Math.max(_chunkWMRIG4XQcjs.effectsMargin.call(void 0, lower.effects), upper.type === "adjustment" ? 0 : _chunkWMRIG4XQcjs.effectsMargin.call(void 0, upper.effects));
5369
5369
  if (reach) rect = { x: rect.x - reach, y: rect.y - reach, width: rect.width + 2 * reach, height: rect.height + 2 * reach };
5370
5370
  const base = { ...lower, blend: "normal", opacity: 1 };
@@ -5390,12 +5390,12 @@ var ImageEditorController = (_class6 = class {
5390
5390
  */
5391
5391
  async mergeVisible() {
5392
5392
  const visible = this.state.layers.filter((l) => l.visible);
5393
- if (!visible.length) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("No layer is visible.");
5393
+ if (!visible.length) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("No layer is visible.");
5394
5394
  const { width, height } = this.naturalSize;
5395
5395
  const surface = await this.compositeToSurface(visible, { x: 0, y: 0, width, height });
5396
5396
  const merged = {
5397
5397
  type: "pixel",
5398
- id: _chunk4S2AXNQFcjs.newLayerId.call(void 0, ),
5398
+ id: _chunkHTAFDTNRcjs.newLayerId.call(void 0, ),
5399
5399
  name: "Merged",
5400
5400
  visible: true,
5401
5401
  opacity: 1,
@@ -5419,8 +5419,8 @@ var ImageEditorController = (_class6 = class {
5419
5419
  const surface = await this.compositeToSurface(this.state.layers, { x: 0, y: 0, width, height });
5420
5420
  const bg = {
5421
5421
  type: "pixel",
5422
- id: _chunk4S2AXNQFcjs.BACKGROUND_LAYER_ID,
5423
- name: _chunk4S2AXNQFcjs.BACKGROUND_LAYER_NAME,
5422
+ id: _chunkHTAFDTNRcjs.BACKGROUND_LAYER_ID,
5423
+ name: _chunkHTAFDTNRcjs.BACKGROUND_LAYER_NAME,
5424
5424
  visible: true,
5425
5425
  opacity: 1,
5426
5426
  blend: "normal",
@@ -5447,7 +5447,7 @@ var ImageEditorController = (_class6 = class {
5447
5447
  const k = Math.min(1, side / Math.max(width, height));
5448
5448
  const tw = Math.max(1, Math.round(width * k));
5449
5449
  const th = Math.max(1, Math.round(height * k));
5450
- const surface = options.mask ? layer.mask && !layer.mask.source ? layer.mask.surface : null : _chunk4S2AXNQFcjs.hasSurface.call(void 0, layer) ? this.surfaceOf(layer) : null;
5450
+ const surface = options.mask ? layer.mask && !layer.mask.source ? layer.mask.surface : null : _chunkHTAFDTNRcjs.hasSurface.call(void 0, layer) ? this.surfaceOf(layer) : null;
5451
5451
  if (!surface) return null;
5452
5452
  const ox = layer.type === "pixel" ? layer.offset.x : 0;
5453
5453
  const oy = layer.type === "pixel" ? layer.offset.y : 0;
@@ -5533,7 +5533,7 @@ var ImageEditorController = (_class6 = class {
5533
5533
  * pixels. The next stroke fixes the offset from its first point. View state, no undo.
5534
5534
  */
5535
5535
  setCloneSource(point) {
5536
- if (point && (!Number.isFinite(point.x) || !Number.isFinite(point.y))) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("The clone source needs finite x and y (document pixels).");
5536
+ if (point && (!Number.isFinite(point.x) || !Number.isFinite(point.y))) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("The clone source needs finite x and y (document pixels).");
5537
5537
  const source = point ? { x: Math.round(point.x), y: Math.round(point.y), offset: null } : null;
5538
5538
  this.state.paint = { ...this.state.paint, cloneSource: source };
5539
5539
  this.notify();
@@ -5551,27 +5551,27 @@ var ImageEditorController = (_class6 = class {
5551
5551
  /** Resolves and validates what a stroke, fill or clear paints into. */
5552
5552
  paintTarget(layerId, channel, action) {
5553
5553
  const id = _nullishCoalesce(layerId, () => ( this.state.activeLayerId));
5554
- if (!id) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)(`No layer given and none is active; pass layerId (see list_layers) to ${action}.`);
5555
- const layer = _chunk4S2AXNQFcjs.requireLayer.call(void 0, this.state.layers, id).layer;
5554
+ if (!id) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)(`No layer given and none is active; pass layerId (see list_layers) to ${action}.`);
5555
+ const layer = _chunkHTAFDTNRcjs.requireLayer.call(void 0, this.state.layers, id).layer;
5556
5556
  const ch = _nullishCoalesce(channel, () => ( (id === this.state.activeLayerId ? this.state.activeTarget : "pixels")));
5557
5557
  if (ch === "mask") {
5558
- if (!layer.mask) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask to ${action}; add one with add_layer_mask, or target pixels.`);
5559
- if (layer.mask.source) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)(`Layer "${layer.name || id}" has a depth mask, which is generated, not painted.`);
5560
- _chunk4S2AXNQFcjs.requireUnlocked.call(void 0, layer, "all", action);
5558
+ if (!layer.mask) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask to ${action}; add one with add_layer_mask, or target pixels.`);
5559
+ if (layer.mask.source) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)(`Layer "${layer.name || id}" has a depth mask, which is generated, not painted.`);
5560
+ _chunkHTAFDTNRcjs.requireUnlocked.call(void 0, layer, "all", action);
5561
5561
  } else if (ch === "filter-mask") {
5562
5562
  if (layer.type !== "smart" || !_optionalChain([layer, 'access', _210 => _210.smartFilters, 'optionalAccess', _211 => _211.mask])) {
5563
- throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)(`Layer "${layer.name || id}" has no smart filter mask to ${action}; add one with set_smart_filter_mask, or target pixels or mask.`);
5563
+ throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)(`Layer "${layer.name || id}" has no smart filter mask to ${action}; add one with set_smart_filter_mask, or target pixels or mask.`);
5564
5564
  }
5565
- if (!_chunk4S2AXNQFcjs.isContentsDecoded.call(void 0, layer.contents)) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)(`The contents of "${layer.name || id}" are not decoded here, so its filter mask cannot be painted; run prepareSmartObjects() first.`);
5566
- _chunk4S2AXNQFcjs.requireUnlocked.call(void 0, layer, "all", action);
5565
+ if (!_chunkHTAFDTNRcjs.isContentsDecoded.call(void 0, layer.contents)) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)(`The contents of "${layer.name || id}" are not decoded here, so its filter mask cannot be painted; run prepareSmartObjects() first.`);
5566
+ _chunkHTAFDTNRcjs.requireUnlocked.call(void 0, layer, "all", action);
5567
5567
  } else {
5568
- if (layer.type === "smart") throw new (0, _chunk4S2AXNQFcjs.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.`);
5569
- if (layer.type === "shape") throw new (0, _chunk4S2AXNQFcjs.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).`);
5570
- if (layer.type === "type") throw new (0, _chunk4S2AXNQFcjs.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).`);
5571
- if (layer.type !== "pixel") throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)(`Layer "${layer.name || id}" is a ${layer.type} layer; ${action} on a pixel layer, or on this layer's mask (channel mask).`);
5572
- _chunk4S2AXNQFcjs.requireUnlocked.call(void 0, layer, "pixels", action);
5568
+ if (layer.type === "smart") throw new (0, _chunkHTAFDTNRcjs.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.`);
5569
+ if (layer.type === "shape") throw new (0, _chunkHTAFDTNRcjs.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).`);
5570
+ if (layer.type === "type") throw new (0, _chunkHTAFDTNRcjs.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).`);
5571
+ if (layer.type !== "pixel") throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)(`Layer "${layer.name || id}" is a ${layer.type} layer; ${action} on a pixel layer, or on this layer's mask (channel mask).`);
5572
+ _chunkHTAFDTNRcjs.requireUnlocked.call(void 0, layer, "pixels", action);
5573
5573
  }
5574
- if (!layer.visible) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)(`Layer "${layer.name || id}" is hidden; show it before you ${action}.`);
5574
+ if (!layer.visible) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)(`Layer "${layer.name || id}" is hidden; show it before you ${action}.`);
5575
5575
  const offset = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
5576
5576
  const surface = ch === "mask" ? layer.mask.surface : ch === "filter-mask" ? layer.smartFilters.mask.surface : this.surfaceOf(layer);
5577
5577
  const lockTransparency = ch === "pixels" && Boolean(_optionalChain([layer, 'access', _212 => _212.locks, 'optionalAccess', _213 => _213.transparency]));
@@ -5580,7 +5580,7 @@ var ImageEditorController = (_class6 = class {
5580
5580
  /** The layer with its pixels (or mask) replaced by `surface`. */
5581
5581
  withSurface(layer, channel, surface) {
5582
5582
  if (channel === "mask") return { ...layer, mask: { ...layer.mask, surface } };
5583
- if (channel === "filter-mask") return _chunk4S2AXNQFcjs.withFilterMaskSurface.call(void 0, layer, surface, this.canvasSize);
5583
+ if (channel === "filter-mask") return _chunkHTAFDTNRcjs.withFilterMaskSurface.call(void 0, layer, surface, this.canvasSize);
5584
5584
  const next = { ...layer, surface };
5585
5585
  delete next.source;
5586
5586
  return next;
@@ -5593,10 +5593,10 @@ var ImageEditorController = (_class6 = class {
5593
5593
  */
5594
5594
  beginStroke(init = {}) {
5595
5595
  const tool = _nullishCoalesce(init.tool, () => ( "brush"));
5596
- if (!STROKE_TOOLS.includes(tool)) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)(`Unknown paint tool "${String(tool)}"; use one of ${STROKE_TOOLS.join(", ")}.`);
5596
+ if (!STROKE_TOOLS.includes(tool)) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)(`Unknown paint tool "${String(tool)}"; use one of ${STROKE_TOOLS.join(", ")}.`);
5597
5597
  const target = this.paintTarget(init.layerId, init.channel, tool === "eraser" ? "erase" : isRetouchTool(tool) ? "retouch" : "paint");
5598
5598
  if (tool === "mixer" && target.channel !== "pixels") {
5599
- throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("The Mixer Brush paints colour on pixels, not on masks; target pixels (channel pixels), or paint the mask with the brush.");
5599
+ throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("The Mixer Brush paints colour on pixels, not on masks; target pixels (channel pixels), or paint the mask with the brush.");
5600
5600
  }
5601
5601
  const brush = _chunkL3PXFMOFcjs.normalizeBrush.call(void 0, { ...this.state.paint.brush, ..._nullishCoalesce(init.brush, () => ( {})) });
5602
5602
  const color = parseColor(_nullishCoalesce(init.color, () => ( this.state.paint.foreground)));
@@ -5624,7 +5624,7 @@ var ImageEditorController = (_class6 = class {
5624
5624
  retouchStroke(tool, init, brush, target, apply) {
5625
5625
  const settings = _chunkTS5IEUW6cjs.normalizeRetouch.call(void 0, _nullishCoalesce(init.retouch, () => ( {})), this.state.paint.retouch);
5626
5626
  const mask = target.channel !== "pixels";
5627
- if (tool === "sponge" && mask) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("The Sponge changes saturation, and a mask has none; target pixels (channel pixels), or use dodge or burn on the mask.");
5627
+ if (tool === "sponge" && mask) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("The Sponge changes saturation, and a mask has none; target pixels (channel pixels), or use dodge or burn on the mask.");
5628
5628
  if (tool === "smudge") return { kind: "dabs", create: (pixels) => new (0, _chunkTS5IEUW6cjs.RetouchDabStroke)(brush, pixels, _chunkTS5IEUW6cjs.smudgeEffect.call(void 0, brush, settings.strength)) };
5629
5629
  if (tool === "sponge") return { kind: "dabs", create: (pixels) => new (0, _chunkTS5IEUW6cjs.RetouchDabStroke)(brush, pixels, _chunkTS5IEUW6cjs.spongeEffect.call(void 0, brush, settings.spongeMode === "saturate", settings.vibrance)) };
5630
5630
  const retouchApply = {
@@ -5677,7 +5677,7 @@ var ImageEditorController = (_class6 = class {
5677
5677
  }
5678
5678
  if (init.source) this.setCloneSource(init.source);
5679
5679
  const cs = this.state.paint.cloneSource;
5680
- if (!cs) throw new (0, _chunk4S2AXNQFcjs.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 }.`);
5680
+ if (!cs) throw new (0, _chunkHTAFDTNRcjs.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 }.`);
5681
5681
  let offset = { x: 0, y: 0 };
5682
5682
  let first = { x: 0, y: 0 };
5683
5683
  const paint = () => ({ kind: "source", source, dx: offset.x, dy: offset.y });
@@ -5712,7 +5712,7 @@ var ImageEditorController = (_class6 = class {
5712
5712
  const sources = this.compositorSources();
5713
5713
  if (depth) {
5714
5714
  return new (0, _chunkTS5IEUW6cjs.TilePixelSource)((tx, ty) => {
5715
- const w = _chunk4S2AXNQFcjs.compositeDeep.call(void 0, layers, { x: tx * _chunk7ISPWEJAcjs.TILE, y: ty * _chunk7ISPWEJAcjs.TILE, width: _chunk7ISPWEJAcjs.TILE, height: _chunk7ISPWEJAcjs.TILE }, sources, depth);
5715
+ const w = _chunkHTAFDTNRcjs.compositeDeep.call(void 0, layers, { x: tx * _chunk7ISPWEJAcjs.TILE, y: ty * _chunk7ISPWEJAcjs.TILE, width: _chunk7ISPWEJAcjs.TILE, height: _chunk7ISPWEJAcjs.TILE }, sources, depth);
5716
5716
  for (let i = 0; i < w.length; i += 4) {
5717
5717
  if (depth === 32) for (let c = 0; c < 3; c++) w[i + c] = _chunk7ISPWEJAcjs.srgbEncode.call(void 0, w[i + c]);
5718
5718
  for (let c = 0; c < 4; c++) w[i + c] *= 255;
@@ -5720,7 +5720,7 @@ var ImageEditorController = (_class6 = class {
5720
5720
  return w;
5721
5721
  }, 4);
5722
5722
  }
5723
- const compositor = new (0, _chunk4S2AXNQFcjs.LayerCompositor)();
5723
+ const compositor = new (0, _chunkHTAFDTNRcjs.LayerCompositor)();
5724
5724
  return new (0, _chunkTS5IEUW6cjs.TilePixelSource)((tx, ty) => compositor.tile(layers, tx, ty, sources), 4);
5725
5725
  }
5726
5726
  /** A Mixer Brush stroke's start: the settings, and the load (refilled when asked or set to). */
@@ -5770,9 +5770,9 @@ var ImageEditorController = (_class6 = class {
5770
5770
  * document bounds and the number of dabs.
5771
5771
  */
5772
5772
  paintStroke(init) {
5773
- if (!Array.isArray(init.points) || !init.points.length) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("points must hold at least one { x, y } point.");
5773
+ if (!Array.isArray(init.points) || !init.points.length) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("points must hold at least one { x, y } point.");
5774
5774
  for (const p of init.points) {
5775
- if (!Number.isFinite(_optionalChain([p, 'optionalAccess', _221 => _221.x])) || !Number.isFinite(_optionalChain([p, 'optionalAccess', _222 => _222.y]))) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("Every point needs finite x and y (document pixels).");
5775
+ if (!Number.isFinite(_optionalChain([p, 'optionalAccess', _221 => _221.x])) || !Number.isFinite(_optionalChain([p, 'optionalAccess', _222 => _222.y]))) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("Every point needs finite x and y (document pixels).");
5776
5776
  }
5777
5777
  const session = this.beginStroke(init);
5778
5778
  session.push(init.points);
@@ -5798,8 +5798,8 @@ var ImageEditorController = (_class6 = class {
5798
5798
  const target = this.paintTarget(options.layerId, options.channel, mode === "paint" ? "fill" : "clear");
5799
5799
  const { width, height } = this.naturalSize;
5800
5800
  const opacity = _nullishCoalesce(options.opacity, () => ( 1));
5801
- if (!(opacity >= 0 && opacity <= 1)) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("opacity must be from 0 to 1.");
5802
- const blend = _nullishCoalesce(_chunk4S2AXNQFcjs.parseBlend.call(void 0, options.blend), () => ( "normal"));
5801
+ if (!(opacity >= 0 && opacity <= 1)) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("opacity must be from 0 to 1.");
5802
+ const blend = _nullishCoalesce(_chunkHTAFDTNRcjs.parseBlend.call(void 0, options.blend), () => ( "normal"));
5803
5803
  const sel = options.useSelection !== false && _optionalChain([this, 'access', _223 => _223.state, 'access', _224 => _224.selection, 'optionalAccess', _225 => _225.bounds]) ? this.state.selection : null;
5804
5804
  const region = _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _226 => _226.bounds]), () => ( { x: 0, y: 0, width, height }));
5805
5805
  const coverage = new (0, _chunkL3PXFMOFcjs.CoverageMap)();
@@ -5835,7 +5835,7 @@ var ImageEditorController = (_class6 = class {
5835
5835
  // --- Adjustments ---
5836
5836
  /** The pixel layer the base sliders edit: the active pixel layer, else the Background. */
5837
5837
  developLayer() {
5838
- return _chunk4S2AXNQFcjs.developTarget.call(void 0, this.state.layers, this.state.activeLayerId);
5838
+ return _chunkHTAFDTNRcjs.developTarget.call(void 0, this.state.layers, this.state.activeLayerId);
5839
5839
  }
5840
5840
  /**
5841
5841
  * Sets base adjustment values as one undo step (unless `commitToHistory` is false). The base
@@ -5861,7 +5861,7 @@ var ImageEditorController = (_class6 = class {
5861
5861
  this.state.outputOpacity = Math.min(1, Math.max(0, partial.opacity));
5862
5862
  }
5863
5863
  if ("layers" in partial) {
5864
- layers = this.replaceAdjustmentNodes(layers, _chunk4S2AXNQFcjs.normalizeAdjustmentLayers.call(void 0, partial.layers));
5864
+ layers = this.replaceAdjustmentNodes(layers, _chunkHTAFDTNRcjs.normalizeAdjustmentLayers.call(void 0, partial.layers));
5865
5865
  }
5866
5866
  this.state.layers = layers;
5867
5867
  this.notify();
@@ -5869,7 +5869,7 @@ var ImageEditorController = (_class6 = class {
5869
5869
  /** True when the adjustments use an older rendering process than {@link LATEST_PROCESS_VERSION}. */
5870
5870
  get isProcessOutdated() {
5871
5871
  this.syncViews();
5872
- return _chunk4S2AXNQFcjs.normalizeProcessVersion.call(void 0, this.state.adjustments.process) < _chunk4S2AXNQFcjs.LATEST_PROCESS_VERSION;
5872
+ return _chunkHTAFDTNRcjs.normalizeProcessVersion.call(void 0, this.state.adjustments.process) < _chunkHTAFDTNRcjs.LATEST_PROCESS_VERSION;
5873
5873
  }
5874
5874
  /**
5875
5875
  * Update to Current Process: re-interprets the current adjustment values with the latest
@@ -5877,7 +5877,7 @@ var ImageEditorController = (_class6 = class {
5877
5877
  */
5878
5878
  upgradeProcess() {
5879
5879
  if (!this.isProcessOutdated) return false;
5880
- this.setAdjustments({ process: _chunk4S2AXNQFcjs.LATEST_PROCESS_VERSION });
5880
+ this.setAdjustments({ process: _chunkHTAFDTNRcjs.LATEST_PROCESS_VERSION });
5881
5881
  return true;
5882
5882
  }
5883
5883
  /** Resets the base sliders (latest process). Adjustment layers are kept; see `clearAdjustmentLayers`. */
@@ -5888,7 +5888,7 @@ var ImageEditorController = (_class6 = class {
5888
5888
  this.state.layers = _chunkWMRIG4XQcjs.mapLayer.call(void 0,
5889
5889
  this.state.layers,
5890
5890
  target.id,
5891
- (l) => withBlur(withDevelop(l, { ...DEFAULT_ADJUSTMENTS, process: _chunk4S2AXNQFcjs.LATEST_PROCESS_VERSION }), 0)
5891
+ (l) => withBlur(withDevelop(l, { ...DEFAULT_ADJUSTMENTS, process: _chunkHTAFDTNRcjs.LATEST_PROCESS_VERSION }), 0)
5892
5892
  );
5893
5893
  }
5894
5894
  delete this.state.legacyOutputBlur;
@@ -5952,7 +5952,7 @@ var ImageEditorController = (_class6 = class {
5952
5952
  const existing = new Set(this.adjustmentNodes(out).map((n) => n.id));
5953
5953
  for (const l of next) {
5954
5954
  if (existing.has(l.id)) continue;
5955
- out = this.placeLayer(out, _chunk4S2AXNQFcjs.adjustmentNodeFromLegacy.call(void 0, l, width, height), { adjustmentIndex: Infinity });
5955
+ out = this.placeLayer(out, _chunkHTAFDTNRcjs.adjustmentNodeFromLegacy.call(void 0, l, width, height), { adjustmentIndex: Infinity });
5956
5956
  }
5957
5957
  const order = next.map((l) => l.id);
5958
5958
  for (let to = 0; to < order.length; to++) out = this.moveAdjustmentNode(out, order[to], to);
@@ -5967,7 +5967,7 @@ var ImageEditorController = (_class6 = class {
5967
5967
  addAdjustmentLayer(init, index) {
5968
5968
  const spec = typeof init === "string" ? { kind: init } : init;
5969
5969
  const ids = new Set(_chunkWMRIG4XQcjs.flattenLayers.call(void 0, this.state.layers).map((l) => l.id));
5970
- const layer = _chunk4S2AXNQFcjs.createAdjustmentLayer.call(void 0, spec.kind, {
5970
+ const layer = _chunkHTAFDTNRcjs.createAdjustmentLayer.call(void 0, spec.kind, {
5971
5971
  id: spec.id && !ids.has(spec.id) ? spec.id : void 0,
5972
5972
  name: spec.name,
5973
5973
  params: spec.params,
@@ -5976,10 +5976,10 @@ var ImageEditorController = (_class6 = class {
5976
5976
  blend: spec.blend,
5977
5977
  mask: _nullishCoalesce(spec.mask, () => ( void 0))
5978
5978
  });
5979
- while (ids.has(layer.id)) layer.id = _chunk4S2AXNQFcjs.newLayerId.call(void 0, "adj");
5979
+ while (ids.has(layer.id)) layer.id = _chunkHTAFDTNRcjs.newLayerId.call(void 0, "adj");
5980
5980
  const { width, height } = this.naturalSize;
5981
5981
  this.recordHistory();
5982
- const node = _chunk4S2AXNQFcjs.adjustmentNodeFromLegacy.call(void 0, layer, width, height);
5982
+ const node = _chunkHTAFDTNRcjs.adjustmentNodeFromLegacy.call(void 0, layer, width, height);
5983
5983
  const positioned = Boolean(spec.aboveId || spec.parentId);
5984
5984
  this.state.layers = this.placeLayer(this.state.layers, node, {
5985
5985
  aboveId: spec.aboveId,
@@ -5999,7 +5999,7 @@ var ImageEditorController = (_class6 = class {
5999
5999
  if (!loc || loc.layer.type !== "adjustment") return false;
6000
6000
  const { width, height } = this.naturalSize;
6001
6001
  const node = loc.layer;
6002
- const merged = _chunk4S2AXNQFcjs.normalizeAdjustmentLayer.call(void 0, {
6002
+ const merged = _chunkHTAFDTNRcjs.normalizeAdjustmentLayer.call(void 0, {
6003
6003
  id: node.id,
6004
6004
  kind: node.kind,
6005
6005
  enabled: _nullishCoalesce(update.enabled, () => ( node.visible)),
@@ -6019,7 +6019,7 @@ var ImageEditorController = (_class6 = class {
6019
6019
  params: merged.params
6020
6020
  };
6021
6021
  if (update.mask !== void 0) {
6022
- const mask = update.mask ? _chunk4S2AXNQFcjs.rasterMaskFromLegacy.call(void 0, update.mask, width, height) : null;
6022
+ const mask = update.mask ? _chunkHTAFDTNRcjs.rasterMaskFromLegacy.call(void 0, update.mask, width, height) : null;
6023
6023
  if (mask) next.mask = mask;
6024
6024
  else delete next.mask;
6025
6025
  }
@@ -6106,8 +6106,8 @@ var ImageEditorController = (_class6 = class {
6106
6106
  const { width, height } = this.naturalSize;
6107
6107
  let next = null;
6108
6108
  if (mask) {
6109
- const sized = mask.width === width && mask.height === height ? mask : _chunk4S2AXNQFcjs.resizeSelection.call(void 0, mask, width, height);
6110
- next = _chunk4S2AXNQFcjs.combineSelections.call(void 0, this.state.selection, sized, mode);
6109
+ const sized = mask.width === width && mask.height === height ? mask : _chunkHTAFDTNRcjs.resizeSelection.call(void 0, mask, width, height);
6110
+ next = _chunkHTAFDTNRcjs.combineSelections.call(void 0, this.state.selection, sized, mode);
6111
6111
  } else if (mode !== "replace") {
6112
6112
  return false;
6113
6113
  }
@@ -6121,7 +6121,7 @@ var ImageEditorController = (_class6 = class {
6121
6121
  /** Select › All. */
6122
6122
  selectAll() {
6123
6123
  const { width, height } = this.naturalSize;
6124
- return this.setSelection(_chunk4S2AXNQFcjs.fullSelection.call(void 0, width, height));
6124
+ return this.setSelection(_chunkHTAFDTNRcjs.fullSelection.call(void 0, width, height));
6125
6125
  }
6126
6126
  /** Select › Deselect. */
6127
6127
  deselect() {
@@ -6130,11 +6130,11 @@ var ImageEditorController = (_class6 = class {
6130
6130
  /** Select › Inverse (with nothing selected, selects everything). */
6131
6131
  invertSelection() {
6132
6132
  const { width, height } = this.naturalSize;
6133
- const current = _nullishCoalesce(this.state.selection, () => ( _chunk4S2AXNQFcjs.createSelectionMask.call(void 0, width, height)));
6134
- return this.setSelection(_chunk4S2AXNQFcjs.invertSelection.call(void 0, current));
6133
+ const current = _nullishCoalesce(this.state.selection, () => ( _chunkHTAFDTNRcjs.createSelectionMask.call(void 0, width, height)));
6134
+ return this.setSelection(_chunkHTAFDTNRcjs.invertSelection.call(void 0, current));
6135
6135
  }
6136
6136
  shapeCommand(mask, options) {
6137
- const shaped = options.feather && options.feather > 0 ? _chunk4S2AXNQFcjs.modifySelection.call(void 0, mask, "feather", options.feather) : mask;
6137
+ const shaped = options.feather && options.feather > 0 ? _chunkHTAFDTNRcjs.modifySelection.call(void 0, mask, "feather", options.feather) : mask;
6138
6138
  return this.setSelection(shaped, _nullishCoalesce(options.mode, () => ( "replace")));
6139
6139
  }
6140
6140
  /** Rectangular marquee in natural image pixels. */
@@ -6188,11 +6188,11 @@ var ImageEditorController = (_class6 = class {
6188
6188
  if (!this.samplePixelsOverride && !options.pixels) this.samplePixels = null;
6189
6189
  return null;
6190
6190
  }
6191
- const legacy = _chunk4S2AXNQFcjs.legacyView.call(void 0, this.stack(), width, height, null).exact;
6191
+ const legacy = _chunkHTAFDTNRcjs.legacyView.call(void 0, this.stack(), width, height, null).exact;
6192
6192
  if (options.sample === "active-layer") {
6193
6193
  const layer = this.getActiveLayer();
6194
6194
  if (!layer || layer.type !== "pixel") {
6195
- throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("Sampling the active layer needs an active pixel layer; select one, or sample the composite.");
6195
+ throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("Sampling the active layer needs an active pixel layer; select one, or sample the composite.");
6196
6196
  }
6197
6197
  const surface = layer.source === "document" && options.pixels ? _chunk7ISPWEJAcjs.surfaceFromPixels.call(void 0, options.pixels, 4) : this.surfaceOf(layer);
6198
6198
  return { width, height, data: _chunk7ISPWEJAcjs.readRegion.call(void 0, surface, { x: -layer.offset.x, y: -layer.offset.y, width, height }) };
@@ -6201,7 +6201,7 @@ var ImageEditorController = (_class6 = class {
6201
6201
  this.syncViews();
6202
6202
  if (legacy && !options.pixels) {
6203
6203
  const copy = { width: base.width, height: base.height, data: new Uint8ClampedArray(base.data) };
6204
- _chunk4S2AXNQFcjs.applyAdjustments.call(void 0, copy, _chunk4S2AXNQFcjs.legacyView.call(void 0, this.stack(), width, height, null).adjustments);
6204
+ _chunkHTAFDTNRcjs.applyAdjustments.call(void 0, copy, _chunkHTAFDTNRcjs.legacyView.call(void 0, this.stack(), width, height, null).adjustments);
6205
6205
  return copy;
6206
6206
  }
6207
6207
  const pixels = options.pixels;
@@ -6213,7 +6213,7 @@ var ImageEditorController = (_class6 = class {
6213
6213
  };
6214
6214
  const stack = withoutAnnotations(this.state.layers);
6215
6215
  const layers = options.sampleMerged ? stack : pixelsOnly(stack);
6216
- const data = new (0, _chunk4S2AXNQFcjs.LayerCompositor)().composite(layers, { x: 0, y: 0, width, height }, sources);
6216
+ const data = new (0, _chunkHTAFDTNRcjs.LayerCompositor)().composite(layers, { x: 0, y: 0, width, height }, sources);
6217
6217
  return { width, height, data };
6218
6218
  }
6219
6219
  async requirePixels(options) {
@@ -6240,7 +6240,7 @@ var ImageEditorController = (_class6 = class {
6240
6240
  modifySelection(op, radius) {
6241
6241
  const sel = this.state.selection;
6242
6242
  if (!_optionalChain([sel, 'optionalAccess', _240 => _240.bounds])) return false;
6243
- return this.setSelection(_chunk4S2AXNQFcjs.modifySelection.call(void 0, sel, op, radius));
6243
+ return this.setSelection(_chunkHTAFDTNRcjs.modifySelection.call(void 0, sel, op, radius));
6244
6244
  }
6245
6245
  /**
6246
6246
  * Refine Edge: snaps the selection (e.g. a coarse AI mask loaded with `loadSelectionFromImage`)
@@ -6271,7 +6271,7 @@ var ImageEditorController = (_class6 = class {
6271
6271
  } else {
6272
6272
  pixels = source;
6273
6273
  }
6274
- this.setSelection(_chunk4S2AXNQFcjs.selectionFromPixels.call(void 0, pixels, options), _nullishCoalesce(options.mode, () => ( "replace")));
6274
+ this.setSelection(_chunkHTAFDTNRcjs.selectionFromPixels.call(void 0, pixels, options), _nullishCoalesce(options.mode, () => ( "replace")));
6275
6275
  return this.getSelection();
6276
6276
  }
6277
6277
  /** Quick Mask view (tints the unselected area). View state: no undo step. */
@@ -6283,7 +6283,7 @@ var ImageEditorController = (_class6 = class {
6283
6283
  // --- Layer masks ---
6284
6284
  maskFromSelection(sel, props = {}) {
6285
6285
  const { width, height } = this.naturalSize;
6286
- const sized = sel.width === width && sel.height === height ? sel : _chunk4S2AXNQFcjs.resizeSelection.call(void 0, sel, width, height);
6286
+ const sized = sel.width === width && sel.height === height ? sel : _chunkHTAFDTNRcjs.resizeSelection.call(void 0, sel, width, height);
6287
6287
  const mask = { surface: _chunk7ISPWEJAcjs.surfaceFromPixels.call(void 0, { width, height, data: sized.data }, 1, 0, 0, 0), defaultValue: 0 };
6288
6288
  return withMaskProps(mask, props);
6289
6289
  }
@@ -6329,7 +6329,7 @@ var ImageEditorController = (_class6 = class {
6329
6329
  const ox = layer.type === "pixel" ? layer.offset.x : 0;
6330
6330
  const oy = layer.type === "pixel" ? layer.offset.y : 0;
6331
6331
  const data = _chunk7ISPWEJAcjs.readRegion.call(void 0, layer.mask.surface, { x: -ox, y: -oy, width, height });
6332
- const sel = _chunk4S2AXNQFcjs.createSelectionMask.call(void 0, width, height, new Uint8Array(data.buffer, data.byteOffset, data.length));
6332
+ const sel = _chunkHTAFDTNRcjs.createSelectionMask.call(void 0, width, height, new Uint8Array(data.buffer, data.byteOffset, data.length));
6333
6333
  return this.setSelection(sel, mode);
6334
6334
  }
6335
6335
  // --- Histogram ---
@@ -6359,9 +6359,9 @@ var ImageEditorController = (_class6 = class {
6359
6359
  merged.depthRange = [...merged.depthRange];
6360
6360
  this.state.layers = _chunkWMRIG4XQcjs.mapLayer.call(void 0, this.state.layers, target.id, (l) => {
6361
6361
  const next = { ...l };
6362
- if (_chunk4S2AXNQFcjs.isDefaultDepthMask.call(void 0, merged)) {
6362
+ if (_chunkHTAFDTNRcjs.isDefaultDepthMask.call(void 0, merged)) {
6363
6363
  if (_optionalChain([next, 'access', _246 => _246.mask, 'optionalAccess', _247 => _247.source])) delete next.mask;
6364
- } else next.mask = _chunk4S2AXNQFcjs.depthRasterMask.call(void 0, merged);
6364
+ } else next.mask = _chunkHTAFDTNRcjs.depthRasterMask.call(void 0, merged);
6365
6365
  return next;
6366
6366
  });
6367
6367
  }
@@ -6382,7 +6382,7 @@ var ImageEditorController = (_class6 = class {
6382
6382
  // --- Annotations & Layers ---
6383
6383
  /** The layer showing annotation `id`: an annotation layer, or a shape layer migrated from it. */
6384
6384
  annotationLayer(id) {
6385
- return _chunkWMRIG4XQcjs.flattenLayers.call(void 0, this.state.layers).find((l) => (l.type === "annotation" || l.type === "shape" || l.type === "type") && _optionalChain([_chunk4S2AXNQFcjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _250 => _250.id]) === id);
6385
+ return _chunkWMRIG4XQcjs.flattenLayers.call(void 0, this.state.layers).find((l) => (l.type === "annotation" || l.type === "shape" || l.type === "type") && _optionalChain([_chunkHTAFDTNRcjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _250 => _250.id]) === id);
6386
6386
  }
6387
6387
  /** What migrating an annotation needs: the canvas size, patterns and the text shaper. */
6388
6388
  annotationEnv() {
@@ -6398,7 +6398,7 @@ var ImageEditorController = (_class6 = class {
6398
6398
  this.recordHistory();
6399
6399
  const id = `ann_${Date.now()}_${Math.random().toString(36).slice(2, 7)}`;
6400
6400
  const fullAnnotation = { ...annotation, id };
6401
- const layer = _chunk4S2AXNQFcjs.annotationLayerFor.call(void 0, fullAnnotation, this.annotationEnv());
6401
+ const layer = _chunkHTAFDTNRcjs.annotationLayerFor.call(void 0, fullAnnotation, this.annotationEnv());
6402
6402
  const loc = placement.aboveId ? _chunkWMRIG4XQcjs.findLayer.call(void 0, this.state.layers, placement.aboveId) : null;
6403
6403
  this.state.layers = loc ? _chunkWMRIG4XQcjs.insertLayer.call(void 0, this.state.layers, layer, _nullishCoalesce(_optionalChain([loc, 'access', _251 => _251.parent, 'optionalAccess', _252 => _252.id]), () => ( null)), loc.index + 1) : _chunkWMRIG4XQcjs.insertLayer.call(void 0, this.state.layers, layer, null);
6404
6404
  this.state.selectedAnnotationId = id;
@@ -6410,17 +6410,17 @@ var ImageEditorController = (_class6 = class {
6410
6410
  this.recordHistory();
6411
6411
  }
6412
6412
  const layer = this.annotationLayer(id);
6413
- const current = layer ? _chunk4S2AXNQFcjs.annotationOfLayer.call(void 0, layer) : null;
6413
+ const current = layer ? _chunkHTAFDTNRcjs.annotationOfLayer.call(void 0, layer) : null;
6414
6414
  if (layer && current) {
6415
6415
  const annotation = { ...current, ...partial, id };
6416
- const name = layer.name === _chunk4S2AXNQFcjs.annotationLayerName.call(void 0, current) ? _chunk4S2AXNQFcjs.annotationLayerName.call(void 0, annotation) : layer.name;
6416
+ const name = layer.name === _chunkHTAFDTNRcjs.annotationLayerName.call(void 0, current) ? _chunkHTAFDTNRcjs.annotationLayerName.call(void 0, annotation) : layer.name;
6417
6417
  this.state.layers = _chunkWMRIG4XQcjs.mapLayer.call(void 0, this.state.layers, layer.id, () => this.layerForAnnotation(layer, annotation, name));
6418
6418
  }
6419
6419
  this.notify();
6420
6420
  }
6421
6421
  /** `layer` (an annotation, or a shape or type layer migrated from one) showing `annotation` instead, keeping its other properties. */
6422
6422
  layerForAnnotation(layer, annotation, name) {
6423
- const fresh = _chunk4S2AXNQFcjs.annotationLayerFor.call(void 0, annotation, this.annotationEnv());
6423
+ const fresh = _chunkHTAFDTNRcjs.annotationLayerFor.call(void 0, annotation, this.annotationEnv());
6424
6424
  const keep = { id: layer.id, visible: layer.visible, opacity: layer.opacity };
6425
6425
  for (const k of ["clipped", "mask", "locks", "effects"]) if (layer[k] !== void 0) keep[k] = layer[k];
6426
6426
  if (fresh.type !== "annotation" && layer.type !== "annotation" && layer.fillOpacity !== void 0) keep.fillOpacity = layer.fillOpacity;
@@ -6688,8 +6688,8 @@ var ImageEditorController = (_class6 = class {
6688
6688
  return;
6689
6689
  }
6690
6690
  const target = this.developLayer();
6691
- if (!target) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("There is no pixel layer to mask.");
6692
- _chunk4S2AXNQFcjs.requireUnlocked.call(void 0, target, "all", "mask it");
6691
+ if (!target) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("There is no pixel layer to mask.");
6692
+ _chunkHTAFDTNRcjs.requireUnlocked.call(void 0, target, "all", "mask it");
6693
6693
  const { width, height } = this.naturalSize;
6694
6694
  let px2 = await this.decodeImage(newDataUrl);
6695
6695
  if (px2.width !== width || px2.height !== height) px2 = resizePixels(px2, width, height);
@@ -6697,14 +6697,14 @@ var ImageEditorController = (_class6 = class {
6697
6697
  for (let p = 0; p < alpha.length; p++) alpha[p] = px2.data[p * 4 + 3];
6698
6698
  let surface = _chunk7ISPWEJAcjs.surfaceFromPixels.call(void 0, { width, height, data: alpha }, 1, 0, 0, 0);
6699
6699
  if (target.offset.x || target.offset.y) surface = _chunk7ISPWEJAcjs.translateSurface.call(void 0, surface, -target.offset.x, -target.offset.y);
6700
- this.commitLayers(_chunk4S2AXNQFcjs.setLayerMask.call(void 0, this.state.layers, target.id, { surface, defaultValue: 0 }));
6700
+ this.commitLayers(_chunkHTAFDTNRcjs.setLayerMask.call(void 0, this.state.layers, target.id, { surface, defaultValue: 0 }));
6701
6701
  return target.id;
6702
6702
  }
6703
6703
  // --- Type layers ---
6704
6704
 
6705
6705
  /** The shaper that lays out and draws type layers (`null` when there is none here). */
6706
6706
  getTextShaper() {
6707
- if (this.textShaperValue === void 0) this.textShaperValue = _chunkLI3KTY7Kcjs.createCanvasTextShaper.call(void 0, { createCanvas: (w, h) => this.renderer.createCanvas(w, h) });
6707
+ if (this.textShaperValue === void 0) this.textShaperValue = _chunkVYW7JBTMcjs.createCanvasTextShaper.call(void 0, { createCanvas: (w, h) => this.renderer.createCanvas(w, h) });
6708
6708
  return this.textShaperValue;
6709
6709
  }
6710
6710
  /** Sets the text shaper (fonts) type layers lay out and draw with; existing layers redraw on their next edit. */
@@ -6721,7 +6721,7 @@ var ImageEditorController = (_class6 = class {
6721
6721
  return _nullishCoalesce(_optionalChain([this, 'access', _257 => _257.getTextShaper, 'call', _258 => _258(), 'optionalAccess', _259 => _259.families, 'optionalCall', _260 => _260()]), () => ( ["sans-serif", "serif", "monospace"]));
6722
6722
  }
6723
6723
  typeInfo(id) {
6724
- const layer = _chunk4S2AXNQFcjs.requireTypeLayer.call(void 0, this.state.layers, id);
6724
+ const layer = _chunkHTAFDTNRcjs.requireTypeLayer.call(void 0, this.state.layers, id);
6725
6725
  const ranges = (runs) => {
6726
6726
  let at = 0;
6727
6727
  return runs.map((r) => {
@@ -6734,7 +6734,7 @@ var ImageEditorController = (_class6 = class {
6734
6734
  let lines = [];
6735
6735
  let missing = _nullishCoalesce(layer.missingFonts, () => ( []));
6736
6736
  if (shaper) {
6737
- const layout = _chunkLI3KTY7Kcjs.layoutText.call(void 0, layer, shaper);
6737
+ const layout = _chunkVYW7JBTMcjs.layoutText.call(void 0, layer, shaper);
6738
6738
  const r = (n) => Math.round(n * 1e3) / 1e3;
6739
6739
  lines = layout.lines.map((l) => ({ start: l.start, end: l.end, baseline: r(l.baseline), width: r(l.width) }));
6740
6740
  if (layer.rendering === "stored") missing = layout.missingFonts;
@@ -6764,25 +6764,25 @@ var ImageEditorController = (_class6 = class {
6764
6764
  * text wrapped in `box`. Refused without a text shaper. Returns its id.
6765
6765
  */
6766
6766
  addTextLayer(init) {
6767
- const text = _chunk4S2AXNQFcjs.normalizeText.call(void 0, init.text);
6768
- if (!Number.isFinite(init.x) || !Number.isFinite(init.y)) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("x and y must be numbers (document pixels).");
6769
- const style = _chunk4S2AXNQFcjs.patchTextStyle.call(void 0, { ..._chunkLI3KTY7Kcjs.DEFAULT_TEXT_STYLE, color: this.state.paint.foreground }, _nullishCoalesce(init.style, () => ( {})));
6770
- const paragraph = _chunk4S2AXNQFcjs.patchParagraphStyle.call(void 0, {}, _nullishCoalesce(init.paragraph, () => ( {})));
6767
+ const text = _chunkHTAFDTNRcjs.normalizeText.call(void 0, init.text);
6768
+ if (!Number.isFinite(init.x) || !Number.isFinite(init.y)) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("x and y must be numbers (document pixels).");
6769
+ const style = _chunkHTAFDTNRcjs.patchTextStyle.call(void 0, { ..._chunkVYW7JBTMcjs.DEFAULT_TEXT_STYLE, color: this.state.paint.foreground }, _nullishCoalesce(init.style, () => ( {})));
6770
+ const paragraph = _chunkHTAFDTNRcjs.patchParagraphStyle.call(void 0, {}, _nullishCoalesce(init.paragraph, () => ( {})));
6771
6771
  let frame = { kind: "point" };
6772
6772
  if (init.box) {
6773
6773
  const { width, height } = init.box;
6774
- if (!(Number.isFinite(width) && width >= 1 && Number.isFinite(height) && height >= 1)) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("box.width and box.height must be at least 1 pixel.");
6774
+ if (!(Number.isFinite(width) && width >= 1 && Number.isFinite(height) && height >= 1)) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("box.width and box.height must be at least 1 pixel.");
6775
6775
  frame = { kind: "box", width, height };
6776
6776
  }
6777
- if (init.rotation !== void 0 && !Number.isFinite(init.rotation)) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("rotation must be a number of degrees.");
6778
- if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("opacity must be between 0 and 1.");
6779
- if (init.blend !== void 0 && !_chunk7ISPWEJAcjs.isBlendMode.call(void 0, init.blend)) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)(`Unknown blend mode "${String(init.blend)}".`);
6777
+ if (init.rotation !== void 0 && !Number.isFinite(init.rotation)) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("rotation must be a number of degrees.");
6778
+ if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("opacity must be between 0 and 1.");
6779
+ if (init.blend !== void 0 && !_chunk7ISPWEJAcjs.isBlendMode.call(void 0, init.blend)) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)(`Unknown blend mode "${String(init.blend)}".`);
6780
6780
  const t = [1, 0, 0, 1, init.x, init.y];
6781
- const transform = init.rotation ? _chunkLI3KTY7Kcjs.multiplyMatrices.call(void 0, t, _chunkLI3KTY7Kcjs.rotateMatrix.call(void 0, init.rotation, { x: init.x, y: init.y })) : t;
6782
- const layer = _chunk4S2AXNQFcjs.createTypeLayer.call(void 0, { text, runs: [{ length: text.length, style }], paragraphs: [{ length: text.length, style: paragraph }], frame, transform, name: _nullishCoalesce(init.name, () => ( _chunk4S2AXNQFcjs.typeLayerName.call(void 0, text))) }, this.textEnv());
6781
+ const transform = init.rotation ? _chunkVYW7JBTMcjs.multiplyMatrices.call(void 0, t, _chunkVYW7JBTMcjs.rotateMatrix.call(void 0, init.rotation, { x: init.x, y: init.y })) : t;
6782
+ const layer = _chunkHTAFDTNRcjs.createTypeLayer.call(void 0, { text, runs: [{ length: text.length, style }], paragraphs: [{ length: text.length, style: paragraph }], frame, transform, name: _nullishCoalesce(init.name, () => ( _chunkHTAFDTNRcjs.typeLayerName.call(void 0, text))) }, this.textEnv());
6783
6783
  if (init.opacity !== void 0) layer.opacity = init.opacity;
6784
6784
  if (init.blend !== void 0) layer.blend = init.blend;
6785
- const next = _chunk4S2AXNQFcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
6785
+ const next = _chunkHTAFDTNRcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
6786
6786
  this.commitLayers(next, () => {
6787
6787
  this.state.activeLayerId = layer.id;
6788
6788
  this.state.activeTarget = "pixels";
@@ -6794,28 +6794,28 @@ var ImageEditorController = (_class6 = class {
6794
6794
  * `start`. One undo step unless `commitToHistory` is false (typing). Returns the layer.
6795
6795
  */
6796
6796
  setText(id, text, range = {}, commitToHistory = true) {
6797
- const layer = _chunk4S2AXNQFcjs.requireTypeLayer.call(void 0, this.state.layers, id);
6798
- const insert = _chunk4S2AXNQFcjs.normalizeText.call(void 0, text);
6799
- const [start, end] = _chunk4S2AXNQFcjs.textRange.call(void 0, layer.text, range.start, range.end);
6800
- const { layers } = _chunk4S2AXNQFcjs.updateTypeLayer.call(void 0, this.state.layers, id, (l) => _chunk4S2AXNQFcjs.replaceTextRange.call(void 0, l, start, end, insert), this.textEnv(), "edit its text");
6797
+ const layer = _chunkHTAFDTNRcjs.requireTypeLayer.call(void 0, this.state.layers, id);
6798
+ const insert = _chunkHTAFDTNRcjs.normalizeText.call(void 0, text);
6799
+ const [start, end] = _chunkHTAFDTNRcjs.textRange.call(void 0, layer.text, range.start, range.end);
6800
+ const { layers } = _chunkHTAFDTNRcjs.updateTypeLayer.call(void 0, this.state.layers, id, (l) => _chunkHTAFDTNRcjs.replaceTextRange.call(void 0, l, start, end, insert), this.textEnv(), "edit its text");
6801
6801
  this.commitLayers(layers, void 0, commitToHistory);
6802
6802
  return this.typeInfo(id);
6803
6803
  }
6804
6804
  /** Sets character style fields over [start, end) (default all), one undo step. Returns the layer. */
6805
6805
  setTextStyle(id, style, range = {}, commitToHistory = true) {
6806
- const layer = _chunk4S2AXNQFcjs.requireTypeLayer.call(void 0, this.state.layers, id);
6807
- const [start, end] = _chunk4S2AXNQFcjs.textRange.call(void 0, layer.text, range.start, range.end);
6808
- if (!Object.keys(style).length) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("Give at least one style field to set.");
6809
- _chunk4S2AXNQFcjs.patchTextStyle.call(void 0, _chunkLI3KTY7Kcjs.DEFAULT_TEXT_STYLE, style);
6810
- const { layers } = _chunk4S2AXNQFcjs.updateTypeLayer.call(void 0,
6806
+ const layer = _chunkHTAFDTNRcjs.requireTypeLayer.call(void 0, this.state.layers, id);
6807
+ const [start, end] = _chunkHTAFDTNRcjs.textRange.call(void 0, layer.text, range.start, range.end);
6808
+ if (!Object.keys(style).length) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("Give at least one style field to set.");
6809
+ _chunkHTAFDTNRcjs.patchTextStyle.call(void 0, _chunkVYW7JBTMcjs.DEFAULT_TEXT_STYLE, style);
6810
+ const { layers } = _chunkHTAFDTNRcjs.updateTypeLayer.call(void 0,
6811
6811
  this.state.layers,
6812
6812
  id,
6813
6813
  (l) => {
6814
6814
  if (start === end) {
6815
- if (l.text.length) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("The range is empty; give start < end (or leave both out for the whole text).");
6816
- return { runs: [{ length: 0, style: _chunk4S2AXNQFcjs.patchTextStyle.call(void 0, _chunkLI3KTY7Kcjs.styleAt.call(void 0, l.runs, 0, _chunkLI3KTY7Kcjs.DEFAULT_TEXT_STYLE), style) }] };
6815
+ if (l.text.length) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("The range is empty; give start < end (or leave both out for the whole text).");
6816
+ return { runs: [{ length: 0, style: _chunkHTAFDTNRcjs.patchTextStyle.call(void 0, _chunkVYW7JBTMcjs.styleAt.call(void 0, l.runs, 0, _chunkVYW7JBTMcjs.DEFAULT_TEXT_STYLE), style) }] };
6817
6817
  }
6818
- return { runs: _chunkLI3KTY7Kcjs.restyleRange.call(void 0, l.runs, start, end, (s) => _chunk4S2AXNQFcjs.patchTextStyle.call(void 0, s, style)) };
6818
+ return { runs: _chunkVYW7JBTMcjs.restyleRange.call(void 0, l.runs, start, end, (s) => _chunkHTAFDTNRcjs.patchTextStyle.call(void 0, s, style)) };
6819
6819
  },
6820
6820
  this.textEnv(),
6821
6821
  "restyle its text"
@@ -6825,11 +6825,11 @@ var ImageEditorController = (_class6 = class {
6825
6825
  }
6826
6826
  /** Sets paragraph style fields on every paragraph that [start, end) touches (default all), one undo step. */
6827
6827
  setParagraphStyle(id, style, range = {}, commitToHistory = true) {
6828
- const layer = _chunk4S2AXNQFcjs.requireTypeLayer.call(void 0, this.state.layers, id);
6829
- const [start, end] = _chunk4S2AXNQFcjs.textRange.call(void 0, layer.text, range.start, range.end);
6830
- if (!Object.keys(style).length) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("Give at least one paragraph field to set.");
6831
- _chunk4S2AXNQFcjs.patchParagraphStyle.call(void 0, {}, style);
6832
- const { layers } = _chunk4S2AXNQFcjs.updateTypeLayer.call(void 0,
6828
+ const layer = _chunkHTAFDTNRcjs.requireTypeLayer.call(void 0, this.state.layers, id);
6829
+ const [start, end] = _chunkHTAFDTNRcjs.textRange.call(void 0, layer.text, range.start, range.end);
6830
+ if (!Object.keys(style).length) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("Give at least one paragraph field to set.");
6831
+ _chunkHTAFDTNRcjs.patchParagraphStyle.call(void 0, {}, style);
6832
+ const { layers } = _chunkHTAFDTNRcjs.updateTypeLayer.call(void 0,
6833
6833
  this.state.layers,
6834
6834
  id,
6835
6835
  (l) => {
@@ -6838,7 +6838,7 @@ var ImageEditorController = (_class6 = class {
6838
6838
  const a = at;
6839
6839
  at += p.length;
6840
6840
  const touches = a < end && at > start || start === end && start >= a && (start < at || at === l.text.length);
6841
- return touches || !l.text.length ? { length: p.length, style: _chunk4S2AXNQFcjs.patchParagraphStyle.call(void 0, p.style, style) } : p;
6841
+ return touches || !l.text.length ? { length: p.length, style: _chunkHTAFDTNRcjs.patchParagraphStyle.call(void 0, p.style, style) } : p;
6842
6842
  });
6843
6843
  return { paragraphs };
6844
6844
  },
@@ -6854,21 +6854,21 @@ var ImageEditorController = (_class6 = class {
6854
6854
  * paragraph. Also resizes a box. One undo step.
6855
6855
  */
6856
6856
  setTextFrame(id, frame, commitToHistory = true) {
6857
- const layer = _chunk4S2AXNQFcjs.requireTypeLayer.call(void 0, this.state.layers, id);
6858
- if (frame.kind === "box" && !(Number.isFinite(frame.width) && frame.width >= 1 && Number.isFinite(frame.height) && frame.height >= 1)) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("width and height must be at least 1 pixel.");
6859
- if (frame.kind !== "box" && frame.kind !== "point") throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("kind must be point or box.");
6857
+ const layer = _chunkHTAFDTNRcjs.requireTypeLayer.call(void 0, this.state.layers, id);
6858
+ if (frame.kind === "box" && !(Number.isFinite(frame.width) && frame.width >= 1 && Number.isFinite(frame.height) && frame.height >= 1)) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("width and height must be at least 1 pixel.");
6859
+ if (frame.kind !== "box" && frame.kind !== "point") throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("kind must be point or box.");
6860
6860
  const shaper = this.getTextShaper();
6861
- const { layers } = _chunk4S2AXNQFcjs.updateTypeLayer.call(void 0,
6861
+ const { layers } = _chunkHTAFDTNRcjs.updateTypeLayer.call(void 0,
6862
6862
  this.state.layers,
6863
6863
  id,
6864
6864
  (l) => {
6865
6865
  if (frame.kind === "box" && l.frame.kind === "box") return { frame: { kind: "box", width: frame.width, height: frame.height } };
6866
- if (!shaper) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("Changing between point and paragraph text needs a text shaper to measure the text.");
6867
- const lines = _chunkLI3KTY7Kcjs.layoutText.call(void 0, l, shaper).lines;
6866
+ if (!shaper) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("Changing between point and paragraph text needs a text shaper to measure the text.");
6867
+ const lines = _chunkVYW7JBTMcjs.layoutText.call(void 0, l, shaper).lines;
6868
6868
  const first = lines[0];
6869
6869
  const dx = frame.kind === "box" ? first ? first.x : 0 : 0;
6870
6870
  const dy = frame.kind === "box" ? first ? first.baseline - first.ascent : 0 : first ? first.baseline : 0;
6871
- const m = _chunk4S2AXNQFcjs.textMatrix.call(void 0, l);
6871
+ const m = _chunkHTAFDTNRcjs.textMatrix.call(void 0, l);
6872
6872
  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]];
6873
6873
  const nextFrame = frame.kind === "box" ? { kind: "box", width: frame.width, height: frame.height } : { kind: "point" };
6874
6874
  return { frame: nextFrame, transform: shifted };
@@ -6885,21 +6885,21 @@ var ImageEditorController = (_class6 = class {
6885
6885
  * `warnings` says when other colours were dropped. One undo step.
6886
6886
  */
6887
6887
  convertTextToShape(id) {
6888
- const layer = _chunk4S2AXNQFcjs.requireTypeLayer.call(void 0, this.state.layers, id);
6889
- _chunk4S2AXNQFcjs.requireUnlocked.call(void 0, layer, "all", "convert it");
6888
+ const layer = _chunkHTAFDTNRcjs.requireTypeLayer.call(void 0, this.state.layers, id);
6889
+ _chunkHTAFDTNRcjs.requireUnlocked.call(void 0, layer, "all", "convert it");
6890
6890
  const shaper = this.getTextShaper();
6891
- if (!shaper) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("Convert to Shape needs a text shaper that gives glyph outlines; none is set here.");
6892
- const parts = _chunk4S2AXNQFcjs.textOutlines.call(void 0, layer, shaper);
6893
- const subpaths = parts.flatMap((p) => _chunkLI3KTY7Kcjs.bezierToSubpaths.call(void 0, p.path));
6894
- if (!subpaths.length) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("The text draws nothing (it is empty or only spaces), so there is no shape to make.");
6891
+ if (!shaper) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("Convert to Shape needs a text shaper that gives glyph outlines; none is set here.");
6892
+ const parts = _chunkHTAFDTNRcjs.textOutlines.call(void 0, layer, shaper);
6893
+ const subpaths = parts.flatMap((p) => _chunkVYW7JBTMcjs.bezierToSubpaths.call(void 0, p.path));
6894
+ if (!subpaths.length) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("The text draws nothing (it is empty or only spaces), so there is no shape to make.");
6895
6895
  const warnings = [];
6896
6896
  const colors = new Set(layer.runs.filter((r) => r.length > 0).map((r) => `${r.style.color}/${_nullishCoalesce(r.style.opacity, () => ( 1))}`));
6897
6897
  if (colors.size > 1) warnings.push("The text had several colours; the shape takes the first one.");
6898
- const missing = _chunkLI3KTY7Kcjs.layoutText.call(void 0, layer, shaper).missingFonts;
6898
+ const missing = _chunkVYW7JBTMcjs.layoutText.call(void 0, layer, shaper).missingFonts;
6899
6899
  if (missing.length) warnings.push(`Missing fonts were drawn with a fallback: ${missing.join(", ")}.`);
6900
- const first = _nullishCoalesce(_optionalChain([layer, 'access', _261 => _261.runs, 'access', _262 => _262.find, 'call', _263 => _263((r) => r.length > 0), 'optionalAccess', _264 => _264.style]), () => ( _chunkLI3KTY7Kcjs.DEFAULT_TEXT_STYLE));
6900
+ const first = _nullishCoalesce(_optionalChain([layer, 'access', _261 => _261.runs, 'access', _262 => _262.find, 'call', _263 => _263((r) => r.length > 0), 'optionalAccess', _264 => _264.style]), () => ( _chunkVYW7JBTMcjs.DEFAULT_TEXT_STYLE));
6901
6901
  const fill = first.opacity !== void 0 && first.opacity !== 1 ? { type: "color", color: first.color, opacity: first.opacity } : { type: "color", color: first.color };
6902
- const shape = _chunk4S2AXNQFcjs.createShapeLayer.call(void 0, { components: [{ op: "combine", subpaths }], fill, stroke: null, name: layer.name }, this.shapeEnv(), layer.id);
6902
+ const shape = _chunkHTAFDTNRcjs.createShapeLayer.call(void 0, { components: [{ op: "combine", subpaths }], fill, stroke: null, name: layer.name }, this.shapeEnv(), layer.id);
6903
6903
  const keep = { visible: layer.visible, opacity: layer.opacity, blend: layer.blend };
6904
6904
  for (const k of ["clipped", "mask", "locks", "effects", "fillOpacity"]) if (layer[k] !== void 0) keep[k] = layer[k];
6905
6905
  this.commitLayers(_chunkWMRIG4XQcjs.mapLayer.call(void 0, this.state.layers, id, () => ({ ...shape, ...keep })));
@@ -6907,23 +6907,23 @@ var ImageEditorController = (_class6 = class {
6907
6907
  }
6908
6908
  /** The layout of a type layer (lines, characters, bounds in text space), or `null` without a shaper. */
6909
6909
  getTextLayout(id) {
6910
- const layer = _chunk4S2AXNQFcjs.requireTypeLayer.call(void 0, this.state.layers, id);
6910
+ const layer = _chunkHTAFDTNRcjs.requireTypeLayer.call(void 0, this.state.layers, id);
6911
6911
  const shaper = this.getTextShaper();
6912
- return shaper ? _chunkLI3KTY7Kcjs.layoutText.call(void 0, layer, shaper) : null;
6912
+ return shaper ? _chunkVYW7JBTMcjs.layoutText.call(void 0, layer, shaper) : null;
6913
6913
  }
6914
6914
  /** The text index nearest a document point (for clicks on a type layer). */
6915
6915
  textIndexAt(id, point) {
6916
- const layer = _chunk4S2AXNQFcjs.requireTypeLayer.call(void 0, this.state.layers, id);
6916
+ const layer = _chunkHTAFDTNRcjs.requireTypeLayer.call(void 0, this.state.layers, id);
6917
6917
  const layout = this.getTextLayout(id);
6918
- return layout ? _chunkLI3KTY7Kcjs.textIndexAt.call(void 0, layout, _chunk4S2AXNQFcjs.toTextSpace.call(void 0, layer, point)) : layer.text.length;
6918
+ return layout ? _chunkVYW7JBTMcjs.textIndexAt.call(void 0, layout, _chunkHTAFDTNRcjs.toTextSpace.call(void 0, layer, point)) : layer.text.length;
6919
6919
  }
6920
6920
  /** The caret at text index `index` as a document-space segment (top to bottom), for drawing it. */
6921
6921
  textCaret(id, index) {
6922
- const layer = _chunk4S2AXNQFcjs.requireTypeLayer.call(void 0, this.state.layers, id);
6922
+ const layer = _chunkHTAFDTNRcjs.requireTypeLayer.call(void 0, this.state.layers, id);
6923
6923
  const layout = this.getTextLayout(id);
6924
6924
  if (!layout) return null;
6925
- const c = _chunkLI3KTY7Kcjs.caretAt.call(void 0, layout, Math.max(0, Math.min(layer.text.length, index)));
6926
- const m = _chunk4S2AXNQFcjs.textMatrix.call(void 0, layer);
6925
+ const c = _chunkVYW7JBTMcjs.caretAt.call(void 0, layout, Math.max(0, Math.min(layer.text.length, index)));
6926
+ const m = _chunkHTAFDTNRcjs.textMatrix.call(void 0, layer);
6927
6927
  const at = (x, y) => ({ x: m[0] * x + m[2] * y + m[4], y: m[1] * x + m[3] * y + m[5] });
6928
6928
  return { top: at(c.x, c.top), bottom: at(c.x, c.bottom), line: c.line };
6929
6929
  }
@@ -6934,14 +6934,14 @@ var ImageEditorController = (_class6 = class {
6934
6934
  }
6935
6935
  /** One component from tool or UI input (validated). */
6936
6936
  componentFrom(spec, path) {
6937
- const op = _chunk4S2AXNQFcjs.requireOperation.call(void 0, spec.op, `${path}op`);
6938
- if (spec.shape !== void 0 && spec.subpaths !== void 0) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)(`Give ${path}shape or ${path}subpaths, not both.`);
6939
- if (spec.shape !== void 0) return _chunk4S2AXNQFcjs.liveComponent.call(void 0, _chunk4S2AXNQFcjs.normalizeLiveShape.call(void 0, spec.shape, `${path}shape`), op);
6940
- if (spec.subpaths !== void 0) return { op, subpaths: _chunk4S2AXNQFcjs.normalizeSubpaths.call(void 0, spec.subpaths, `${path}subpaths`) };
6941
- throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)(`${path}shape (a live shape: { kind: rect | ellipse | polygon | star | line, \u2026 }) or ${path}subpaths (anchors or SVG path data) is required.`);
6937
+ const op = _chunkHTAFDTNRcjs.requireOperation.call(void 0, spec.op, `${path}op`);
6938
+ if (spec.shape !== void 0 && spec.subpaths !== void 0) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)(`Give ${path}shape or ${path}subpaths, not both.`);
6939
+ if (spec.shape !== void 0) return _chunkHTAFDTNRcjs.liveComponent.call(void 0, _chunkHTAFDTNRcjs.normalizeLiveShape.call(void 0, spec.shape, `${path}shape`), op);
6940
+ if (spec.subpaths !== void 0) return { op, subpaths: _chunkHTAFDTNRcjs.normalizeSubpaths.call(void 0, spec.subpaths, `${path}subpaths`) };
6941
+ throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)(`${path}shape (a live shape: { kind: rect | ellipse | polygon | star | line, \u2026 }) or ${path}subpaths (anchors or SVG path data) is required.`);
6942
6942
  }
6943
6943
  shapeInfo(id) {
6944
- const layer = _chunk4S2AXNQFcjs.requireShapeLayer.call(void 0, this.state.layers, id);
6944
+ const layer = _chunkHTAFDTNRcjs.requireShapeLayer.call(void 0, this.state.layers, id);
6945
6945
  const r = (n) => Math.round(n * 1e3) / 1e3;
6946
6946
  const box = (b) => b ? { x: r(b.x), y: r(b.y), width: r(b.width), height: r(b.height) } : null;
6947
6947
  const info = {
@@ -6951,13 +6951,13 @@ var ImageEditorController = (_class6 = class {
6951
6951
  index,
6952
6952
  op: c.op,
6953
6953
  live: c.live ? JSON.parse(JSON.stringify(c.live)) : null,
6954
- subpaths: _chunkLI3KTY7Kcjs.roundSubpaths.call(void 0, c.subpaths),
6955
- bounds: box(_chunk4S2AXNQFcjs.shapeGeometryBounds.call(void 0, { components: [c] }))
6954
+ subpaths: _chunkVYW7JBTMcjs.roundSubpaths.call(void 0, c.subpaths),
6955
+ bounds: box(_chunkHTAFDTNRcjs.shapeGeometryBounds.call(void 0, { components: [c] }))
6956
6956
  })),
6957
6957
  fillRule: _nullishCoalesce(layer.fillRule, () => ( "nonzero")),
6958
6958
  fill: layer.fill ? JSON.parse(JSON.stringify(layer.fill)) : null,
6959
6959
  stroke: layer.stroke ? JSON.parse(JSON.stringify(layer.stroke)) : null,
6960
- geometryBounds: box(_chunk4S2AXNQFcjs.shapeGeometryBounds.call(void 0, layer)),
6960
+ geometryBounds: box(_chunkHTAFDTNRcjs.shapeGeometryBounds.call(void 0, layer)),
6961
6961
  bounds: this.getLayerBounds(id)
6962
6962
  };
6963
6963
  if (layer.annotation) info.annotationId = layer.annotation.id;
@@ -6974,17 +6974,17 @@ var ImageEditorController = (_class6 = class {
6974
6974
  */
6975
6975
  addShapeLayer(init) {
6976
6976
  const specs = _optionalChain([init, 'access', _269 => _269.components, 'optionalAccess', _270 => _270.length]) ? init.components : [init];
6977
- if (_optionalChain([init, 'access', _271 => _271.components, 'optionalAccess', _272 => _272.length]) && (init.shape !== void 0 || init.subpaths !== void 0)) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("Give components, or shape / subpaths, not both.");
6977
+ if (_optionalChain([init, 'access', _271 => _271.components, 'optionalAccess', _272 => _272.length]) && (init.shape !== void 0 || init.subpaths !== void 0)) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("Give components, or shape / subpaths, not both.");
6978
6978
  const components = specs.map((c, i) => this.componentFrom(c, _optionalChain([init, 'access', _273 => _273.components, 'optionalAccess', _274 => _274.length]) ? `components[${i}].` : ""));
6979
- const stroke = init.stroke ? _chunk4S2AXNQFcjs.normalizeShapeStroke.call(void 0, init.stroke, "stroke") : null;
6979
+ const stroke = init.stroke ? _chunkHTAFDTNRcjs.normalizeShapeStroke.call(void 0, init.stroke, "stroke") : null;
6980
6980
  const openOnly = components.every((c) => !c.live && c.subpaths.every((sp) => !sp.closed));
6981
- const fill = init.fill === void 0 ? stroke && openOnly ? null : _chunk4S2AXNQFcjs.normalizeShapePaint.call(void 0, this.state.paint.foreground, "fill") : init.fill === null ? null : _chunk4S2AXNQFcjs.normalizeShapePaint.call(void 0, init.fill, "fill");
6982
- if (!fill && !stroke) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("A shape with neither fill nor stroke draws nothing; give fill or stroke.");
6983
- if (init.fillRule !== void 0 && init.fillRule !== "nonzero" && init.fillRule !== "evenodd") throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("fillRule must be nonzero or evenodd.");
6984
- if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("opacity must be between 0 and 1.");
6985
- if (init.blend !== void 0 && !_chunk7ISPWEJAcjs.isBlendMode.call(void 0, init.blend)) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)(`Unknown blend mode "${String(init.blend)}".`);
6986
- const layer = _chunk4S2AXNQFcjs.createShapeLayer.call(void 0, { components, fill, stroke, fillRule: init.fillRule, name: init.name, opacity: init.opacity, blend: init.blend }, this.shapeEnv());
6987
- const next = _chunk4S2AXNQFcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
6981
+ const fill = init.fill === void 0 ? stroke && openOnly ? null : _chunkHTAFDTNRcjs.normalizeShapePaint.call(void 0, this.state.paint.foreground, "fill") : init.fill === null ? null : _chunkHTAFDTNRcjs.normalizeShapePaint.call(void 0, init.fill, "fill");
6982
+ if (!fill && !stroke) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("A shape with neither fill nor stroke draws nothing; give fill or stroke.");
6983
+ if (init.fillRule !== void 0 && init.fillRule !== "nonzero" && init.fillRule !== "evenodd") throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("fillRule must be nonzero or evenodd.");
6984
+ if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("opacity must be between 0 and 1.");
6985
+ if (init.blend !== void 0 && !_chunk7ISPWEJAcjs.isBlendMode.call(void 0, init.blend)) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)(`Unknown blend mode "${String(init.blend)}".`);
6986
+ const layer = _chunkHTAFDTNRcjs.createShapeLayer.call(void 0, { components, fill, stroke, fillRule: init.fillRule, name: init.name, opacity: init.opacity, blend: init.blend }, this.shapeEnv());
6987
+ const next = _chunkHTAFDTNRcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
6988
6988
  this.commitLayers(next, () => {
6989
6989
  this.state.activeLayerId = layer.id;
6990
6990
  this.state.activeTarget = "pixels";
@@ -6997,18 +6997,18 @@ var ImageEditorController = (_class6 = class {
6997
6997
  * only those settings of the current stroke. Returns the shape.
6998
6998
  */
6999
6999
  setShapeStyle(id, changes, commitToHistory = true) {
7000
- const layer = _chunk4S2AXNQFcjs.requireShapeLayer.call(void 0, this.state.layers, id);
7001
- const fill = changes.fill === void 0 ? layer.fill : changes.fill === null ? null : _chunk4S2AXNQFcjs.normalizeShapePaint.call(void 0, changes.fill, "fill");
7002
- const stroke = changes.stroke === void 0 ? layer.stroke : changes.stroke === null ? null : _chunk4S2AXNQFcjs.normalizeShapeStroke.call(void 0, changes.stroke, "stroke", layer.stroke);
7003
- if (changes.fillRule !== void 0 && changes.fillRule !== "nonzero" && changes.fillRule !== "evenodd") throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("fillRule must be nonzero or evenodd.");
7000
+ const layer = _chunkHTAFDTNRcjs.requireShapeLayer.call(void 0, this.state.layers, id);
7001
+ const fill = changes.fill === void 0 ? layer.fill : changes.fill === null ? null : _chunkHTAFDTNRcjs.normalizeShapePaint.call(void 0, changes.fill, "fill");
7002
+ const stroke = changes.stroke === void 0 ? layer.stroke : changes.stroke === null ? null : _chunkHTAFDTNRcjs.normalizeShapeStroke.call(void 0, changes.stroke, "stroke", layer.stroke);
7003
+ if (changes.fillRule !== void 0 && changes.fillRule !== "nonzero" && changes.fillRule !== "evenodd") throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("fillRule must be nonzero or evenodd.");
7004
7004
  const fillRule = _nullishCoalesce(_nullishCoalesce(changes.fillRule, () => ( layer.fillRule)), () => ( "nonzero"));
7005
- const { layers } = _chunk4S2AXNQFcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ fill, stroke, fillRule: fillRule === "nonzero" ? void 0 : fillRule }), this.shapeEnv(), "restyle it");
7005
+ const { layers } = _chunkHTAFDTNRcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ fill, stroke, fillRule: fillRule === "nonzero" ? void 0 : fillRule }), this.shapeEnv(), "restyle it");
7006
7006
  this.commitLayers(layers, void 0, commitToHistory);
7007
7007
  return this.shapeInfo(id);
7008
7008
  }
7009
7009
  componentIndex(layer, index) {
7010
7010
  if (!Number.isInteger(index) || index < 0 || index >= layer.components.length) {
7011
- throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)(`componentIndex must be 0..${layer.components.length - 1} (get_shape_layer lists the components), got ${String(index)}.`);
7011
+ throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)(`componentIndex must be 0..${layer.components.length - 1} (get_shape_layer lists the components), got ${String(index)}.`);
7012
7012
  }
7013
7013
  return index;
7014
7014
  }
@@ -7018,36 +7018,36 @@ var ImageEditorController = (_class6 = class {
7018
7018
  * the live shape) or its operation. Returns the shape.
7019
7019
  */
7020
7020
  setShapeComponent(id, index, change, commitToHistory = true) {
7021
- const layer = _chunk4S2AXNQFcjs.requireShapeLayer.call(void 0, this.state.layers, id);
7021
+ const layer = _chunkHTAFDTNRcjs.requireShapeLayer.call(void 0, this.state.layers, id);
7022
7022
  const i = this.componentIndex(layer, index);
7023
7023
  const current = layer.components[i];
7024
7024
  let shape = change.shape;
7025
7025
  if (shape && current.live && shape.kind === void 0) shape = { ...current.live, ...shape };
7026
7026
  else if (shape && current.live && shape.kind === current.live.kind) shape = { ...current.live, ...shape };
7027
- const next = shape !== void 0 || change.subpaths !== void 0 ? this.componentFrom({ ...change, shape, op: _nullishCoalesce(change.op, () => ( current.op)) }, "") : { ...current, op: _chunk4S2AXNQFcjs.requireOperation.call(void 0, change.op) };
7027
+ const next = shape !== void 0 || change.subpaths !== void 0 ? this.componentFrom({ ...change, shape, op: _nullishCoalesce(change.op, () => ( current.op)) }, "") : { ...current, op: _chunkHTAFDTNRcjs.requireOperation.call(void 0, change.op) };
7028
7028
  const components = layer.components.map((c, k) => k === i ? next : c);
7029
- const { layers } = _chunk4S2AXNQFcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
7029
+ const { layers } = _chunkHTAFDTNRcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
7030
7030
  this.commitLayers(layers, void 0, commitToHistory);
7031
7031
  return this.shapeInfo(id);
7032
7032
  }
7033
7033
  /** Adds a component to a shape (path operations), on top unless `index` is given (one undo step). Returns the shape. */
7034
7034
  addShapeComponent(id, spec, index) {
7035
- const layer = _chunk4S2AXNQFcjs.requireShapeLayer.call(void 0, this.state.layers, id);
7035
+ const layer = _chunkHTAFDTNRcjs.requireShapeLayer.call(void 0, this.state.layers, id);
7036
7036
  const c = this.componentFrom(spec, "");
7037
7037
  const at = index === void 0 ? layer.components.length : index;
7038
- if (!Number.isInteger(at) || at < 0 || at > layer.components.length) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)(`index must be 0..${layer.components.length}, got ${String(index)}.`);
7038
+ if (!Number.isInteger(at) || at < 0 || at > layer.components.length) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)(`index must be 0..${layer.components.length}, got ${String(index)}.`);
7039
7039
  const components = [...layer.components.slice(0, at), c, ...layer.components.slice(at)];
7040
- const { layers } = _chunk4S2AXNQFcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
7040
+ const { layers } = _chunkHTAFDTNRcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
7041
7041
  this.commitLayers(layers);
7042
7042
  return this.shapeInfo(id);
7043
7043
  }
7044
7044
  /** Removes one component of a shape (one undo step); the last one cannot go (delete the layer instead). Returns the shape. */
7045
7045
  removeShapeComponent(id, index) {
7046
- const layer = _chunk4S2AXNQFcjs.requireShapeLayer.call(void 0, this.state.layers, id);
7046
+ const layer = _chunkHTAFDTNRcjs.requireShapeLayer.call(void 0, this.state.layers, id);
7047
7047
  const i = this.componentIndex(layer, index);
7048
- if (layer.components.length === 1) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("This is the shape's only component; delete the layer instead (delete_layer).");
7048
+ if (layer.components.length === 1) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("This is the shape's only component; delete the layer instead (delete_layer).");
7049
7049
  const components = layer.components.filter((_, k) => k !== i);
7050
- const { layers } = _chunk4S2AXNQFcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
7050
+ const { layers } = _chunkHTAFDTNRcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
7051
7051
  this.commitLayers(layers);
7052
7052
  return this.shapeInfo(id);
7053
7053
  }
@@ -7056,10 +7056,10 @@ var ImageEditorController = (_class6 = class {
7056
7056
  * shapes become paths), as one undo step. Returns the shape.
7057
7057
  */
7058
7058
  mergeShapeComponents(id) {
7059
- const layer = _chunk4S2AXNQFcjs.requireShapeLayer.call(void 0, this.state.layers, id);
7060
- if (layer.components.length < 2) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("The shape has one component; there is nothing to merge.");
7061
- const components = _chunk4S2AXNQFcjs.mergeShapeComponents.call(void 0, layer.components, layer.fillRule);
7062
- const { layers } = _chunk4S2AXNQFcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components, fillRule: void 0 }), this.shapeEnv(), "edit its path");
7059
+ const layer = _chunkHTAFDTNRcjs.requireShapeLayer.call(void 0, this.state.layers, id);
7060
+ if (layer.components.length < 2) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("The shape has one component; there is nothing to merge.");
7061
+ const components = _chunkHTAFDTNRcjs.mergeShapeComponents.call(void 0, layer.components, layer.fillRule);
7062
+ const { layers } = _chunkHTAFDTNRcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components, fillRule: void 0 }), this.shapeEnv(), "edit its path");
7063
7063
  this.commitLayers(layers);
7064
7064
  return this.shapeInfo(id);
7065
7065
  }
@@ -7069,8 +7069,8 @@ var ImageEditorController = (_class6 = class {
7069
7069
  * step. Returns the layer id.
7070
7070
  */
7071
7071
  async rasterizeLayer(id) {
7072
- const layer = _chunk4S2AXNQFcjs.requireLayer.call(void 0, this.state.layers, id).layer;
7073
- _chunk4S2AXNQFcjs.requireUnlocked.call(void 0, layer, "all", "rasterize it");
7072
+ const layer = _chunkHTAFDTNRcjs.requireLayer.call(void 0, this.state.layers, id).layer;
7073
+ _chunkHTAFDTNRcjs.requireUnlocked.call(void 0, layer, "all", "rasterize it");
7074
7074
  const { width, height } = this.naturalSize;
7075
7075
  const canvas = { x: 0, y: 0, width, height };
7076
7076
  let next;
@@ -7086,8 +7086,8 @@ var ImageEditorController = (_class6 = class {
7086
7086
  if (layer.locks) next.locks = layer.locks;
7087
7087
  if (this.state.selectedAnnotationId === layer.annotation.id) this.state.selectedAnnotationId = null;
7088
7088
  } else if (layer.type === "pixel") {
7089
- if (!_optionalChain([layer, 'access', _275 => _275.filters, 'optionalAccess', _276 => _276.length])) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)(`Layer "${layer.name || id}" is already pixels with no filters to bake.`);
7090
- _chunk4S2AXNQFcjs.requireUnlocked.call(void 0, layer, "pixels", "rasterize it");
7089
+ if (!_optionalChain([layer, 'access', _275 => _275.filters, 'optionalAccess', _276 => _276.length])) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)(`Layer "${layer.name || id}" is already pixels with no filters to bake.`);
7090
+ _chunkHTAFDTNRcjs.requireUnlocked.call(void 0, layer, "pixels", "rasterize it");
7091
7091
  const spatial = layer.filters.some((f) => f.enabled && f.kind === "blur");
7092
7092
  const content = { ...layer, visible: true, opacity: 1, blend: "normal" };
7093
7093
  delete content.mask;
@@ -7104,10 +7104,10 @@ var ImageEditorController = (_class6 = class {
7104
7104
  } else if (layer.type === "smart") {
7105
7105
  return this.rasterizeSmartObject(id);
7106
7106
  } else if (layer.type === "shape" || layer.type === "type") {
7107
- next = layer.type === "shape" ? _chunk4S2AXNQFcjs.shapeAsPixelLayer.call(void 0, layer) : _chunk4S2AXNQFcjs.typeAsPixelLayer.call(void 0, layer);
7107
+ next = layer.type === "shape" ? _chunkHTAFDTNRcjs.shapeAsPixelLayer.call(void 0, layer) : _chunkHTAFDTNRcjs.typeAsPixelLayer.call(void 0, layer);
7108
7108
  if (this.state.selectedAnnotationId && this.state.selectedAnnotationId === _optionalChain([layer, 'access', _277 => _277.annotation, 'optionalAccess', _278 => _278.id])) this.state.selectedAnnotationId = null;
7109
7109
  } else {
7110
- throw new (0, _chunk4S2AXNQFcjs.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.`);
7110
+ throw new (0, _chunkHTAFDTNRcjs.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.`);
7111
7111
  }
7112
7112
  this.commitLayers(_chunkWMRIG4XQcjs.mapLayer.call(void 0, this.state.layers, id, () => next));
7113
7113
  return id;
@@ -7132,7 +7132,7 @@ var ImageEditorController = (_class6 = class {
7132
7132
  setColorMode(mode, options = {}) {
7133
7133
  let next;
7134
7134
  if (mode === "rgb") {
7135
- if (options.profile !== void 0) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("An RGB document takes no CMYK profile; use assign_profile for its working space.");
7135
+ if (options.profile !== void 0) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("An RGB document takes no CMYK profile; use assign_profile for its working space.");
7136
7136
  next = null;
7137
7137
  } else if (mode === "lab") next = { mode: "lab" };
7138
7138
  else if (mode === "cmyk") {
@@ -7140,14 +7140,14 @@ var ImageEditorController = (_class6 = class {
7140
7140
  try {
7141
7141
  doc = documentProfile(_nullishCoalesce(options.profile, () => ( "coated-cmyk")));
7142
7142
  } catch (e) {
7143
- throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
7143
+ throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
7144
7144
  }
7145
7145
  const cs = resolveProfile(doc).colorSpace;
7146
- if (cs !== "cmyk") throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)(`CMYK mode needs a CMYK profile; "${doc.name}" is ${cs.toUpperCase()}.`);
7146
+ if (cs !== "cmyk") throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)(`CMYK mode needs a CMYK profile; "${doc.name}" is ${cs.toUpperCase()}.`);
7147
7147
  const intent = _nullishCoalesce(options.intent, () => ( "relative"));
7148
- if (!_chunkG5NMLUVFcjs.INTENTS.includes(intent)) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkG5NMLUVFcjs.INTENTS.join(", ")}.`);
7148
+ if (!_chunkG5NMLUVFcjs.INTENTS.includes(intent)) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkG5NMLUVFcjs.INTENTS.join(", ")}.`);
7149
7149
  next = { mode: "cmyk", profile: doc, intent };
7150
- } else throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)(`Unknown colour mode "${String(mode)}"; use rgb, cmyk or lab.`);
7150
+ } else throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)(`Unknown colour mode "${String(mode)}"; use rgb, cmyk or lab.`);
7151
7151
  this.recordHistory();
7152
7152
  if (next) this.state.colorMode = next;
7153
7153
  else delete this.state.colorMode;
@@ -7160,10 +7160,10 @@ var ImageEditorController = (_class6 = class {
7160
7160
  try {
7161
7161
  doc = documentProfile(profile);
7162
7162
  } catch (e) {
7163
- throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
7163
+ throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
7164
7164
  }
7165
7165
  const cs = resolveProfile(doc).colorSpace;
7166
- if (cs !== "rgb") throw new (0, _chunk4S2AXNQFcjs.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.`);
7166
+ if (cs !== "rgb") throw new (0, _chunkHTAFDTNRcjs.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.`);
7167
7167
  return doc;
7168
7168
  }
7169
7169
  /**
@@ -7189,7 +7189,7 @@ var ImageEditorController = (_class6 = class {
7189
7189
  convertToProfile(profile, options = {}) {
7190
7190
  const doc = this.rgbProfileArg(profile, "Convert to Profile");
7191
7191
  const intent = _nullishCoalesce(options.intent, () => ( "relative"));
7192
- if (!_chunkG5NMLUVFcjs.INTENTS.includes(intent)) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkG5NMLUVFcjs.INTENTS.join(", ")}.`);
7192
+ if (!_chunkG5NMLUVFcjs.INTENTS.includes(intent)) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkG5NMLUVFcjs.INTENTS.join(", ")}.`);
7193
7193
  const t = _chunkG5NMLUVFcjs.Transform.create(resolveProfile(this.state.colorProfile), resolveProfile(doc), { intent, bpc: _nullishCoalesce(options.bpc, () => ( true)) });
7194
7194
  const converted = [];
7195
7195
  const unconverted = [];
@@ -7227,12 +7227,12 @@ var ImageEditorController = (_class6 = class {
7227
7227
  try {
7228
7228
  doc = documentProfile(setup.profile);
7229
7229
  } catch (e) {
7230
- throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
7230
+ throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
7231
7231
  }
7232
7232
  const intent = _nullishCoalesce(setup.intent, () => ( DEFAULT_PROOF.intent));
7233
- if (!_chunkG5NMLUVFcjs.INTENTS.includes(intent)) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkG5NMLUVFcjs.INTENTS.join(", ")}.`);
7233
+ if (!_chunkG5NMLUVFcjs.INTENTS.includes(intent)) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkG5NMLUVFcjs.INTENTS.join(", ")}.`);
7234
7234
  const next = { ...DEFAULT_PROOF, ...setup, intent, profile: doc };
7235
- if (!_chunkG5NMLUVFcjs.canBeDestination.call(void 0, resolveProfile(doc))) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)(`"${doc.name}" describes a source only, so colours cannot be proofed through it.`);
7235
+ if (!_chunkG5NMLUVFcjs.canBeDestination.call(void 0, resolveProfile(doc))) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)(`"${doc.name}" describes a source only, so colours cannot be proofed through it.`);
7236
7236
  this.state.proofSetup = next;
7237
7237
  this.notify();
7238
7238
  return next;
@@ -7249,14 +7249,14 @@ var ImageEditorController = (_class6 = class {
7249
7249
  src = options.from !== void 0 ? resolveProfile(documentProfile(options.from)) : resolveProfile(this.state.colorProfile);
7250
7250
  dst = resolveProfile(documentProfile(to));
7251
7251
  } catch (e) {
7252
- throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
7252
+ throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
7253
7253
  }
7254
- if (src.colorSpace !== "rgb") throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("Colours are given as #rrggbb, so the source profile must be RGB.");
7254
+ if (src.colorSpace !== "rgb") throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("Colours are given as #rrggbb, so the source profile must be RGB.");
7255
7255
  const t = _chunkG5NMLUVFcjs.Transform.create(src, dst, { intent: _nullishCoalesce(options.intent, () => ( "relative")), bpc: _nullishCoalesce(options.bpc, () => ( true)) });
7256
7256
  const toLab = _chunkG5NMLUVFcjs.Transform.create(src, _chunkG5NMLUVFcjs.builtinProfile.call(void 0, "lab-d50"), { intent: "relative", bpc: false });
7257
7257
  return colors.map((input) => {
7258
7258
  const m = /^#?([0-9a-f]{6})$/i.exec(input.trim());
7259
- if (!m) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)(`Invalid colour "${input}"; use #rrggbb.`);
7259
+ if (!m) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)(`Invalid colour "${input}"; use #rrggbb.`);
7260
7260
  const n = parseInt(m[1], 16);
7261
7261
  const rgb = [(n >> 16 & 255) / 255, (n >> 8 & 255) / 255, (n & 255) / 255];
7262
7262
  const out = new Float32Array(16);
@@ -7282,7 +7282,7 @@ var ImageEditorController = (_class6 = class {
7282
7282
  * the ids of the layers whose pixels changed.
7283
7283
  */
7284
7284
  setBitDepth(depth) {
7285
- if (!_chunk7ISPWEJAcjs.isBitDepth.call(void 0, depth)) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)(`Bit depth must be 8, 16 or 32, not ${String(depth)}.`);
7285
+ if (!_chunk7ISPWEJAcjs.isBitDepth.call(void 0, depth)) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)(`Bit depth must be 8, 16 or 32, not ${String(depth)}.`);
7286
7286
  const changed = [];
7287
7287
  const withMask = (l) => {
7288
7288
  const m = l.mask;
@@ -7330,7 +7330,7 @@ var ImageEditorController = (_class6 = class {
7330
7330
  * Throws `PsdError` for files that cannot be read at all.
7331
7331
  */
7332
7332
  loadPsd(bytes) {
7333
- const result = _chunk4S2AXNQFcjs.importPsd.call(void 0, bytes, { newId: () => _chunk4S2AXNQFcjs.newLayerId.call(void 0, ) });
7333
+ const result = _chunkHTAFDTNRcjs.importPsd.call(void 0, bytes, { newId: () => _chunkHTAFDTNRcjs.newLayerId.call(void 0, ) });
7334
7334
  this.abandonContents();
7335
7335
  this.recordHistory();
7336
7336
  const s = this.state;
@@ -7340,7 +7340,7 @@ var ImageEditorController = (_class6 = class {
7340
7340
  if (!this.samplePixelsOverride) this.samplePixels = null;
7341
7341
  s.layers = this.checkPsdFonts(result);
7342
7342
  s.crop = null;
7343
- s.transform = { ..._chunk4S2AXNQFcjs.DEFAULT_TRANSFORM_VALUES };
7343
+ s.transform = { ..._chunkHTAFDTNRcjs.DEFAULT_TRANSFORM_VALUES };
7344
7344
  s.outputOpacity = 1;
7345
7345
  delete s.legacyOutputBlur;
7346
7346
  s.selection = null;
@@ -7391,7 +7391,7 @@ var ImageEditorController = (_class6 = class {
7391
7391
  let layers = result.layers;
7392
7392
  const missing = /* @__PURE__ */ new Map();
7393
7393
  for (const l of types) {
7394
- const fonts = shaper ? _chunkLI3KTY7Kcjs.layoutText.call(void 0, l, shaper).missingFonts : [...new Set(l.runs.map((r) => r.style.fontFamily))];
7394
+ const fonts = shaper ? _chunkVYW7JBTMcjs.layoutText.call(void 0, l, shaper).missingFonts : [...new Set(l.runs.map((r) => r.style.fontFamily))];
7395
7395
  if (!fonts.length) continue;
7396
7396
  layers = _chunkWMRIG4XQcjs.mapLayer.call(void 0, layers, l.id, () => ({ ...l, missingFonts: fonts }));
7397
7397
  for (const f of fonts) missing.set(f, [..._nullishCoalesce(missing.get(f), () => ( [])), l.name]);
@@ -7419,7 +7419,7 @@ var ImageEditorController = (_class6 = class {
7419
7419
  const canRasterize = this.renderer.canRasterize();
7420
7420
  await this.renderer.prepareLayerAssets(this.state.layers, width, height);
7421
7421
  const sources = this.renderer.compositorSources(width, height);
7422
- const compositor = new (0, _chunk4S2AXNQFcjs.LayerCompositor)();
7422
+ const compositor = new (0, _chunkHTAFDTNRcjs.LayerCompositor)();
7423
7423
  const bakeMask = (layer) => {
7424
7424
  const mask = layer.mask;
7425
7425
  if (!_optionalChain([mask, 'optionalAccess', _289 => _289.source])) return mask;
@@ -7501,7 +7501,7 @@ var ImageEditorController = (_class6 = class {
7501
7501
  out.surface = this.surfaceOf(layer);
7502
7502
  delete out.source;
7503
7503
  }
7504
- const active = _nullishCoalesce(_optionalChain([layer, 'access', _293 => _293.filters, 'optionalAccess', _294 => _294.filter, 'call', _295 => _295(_chunk4S2AXNQFcjs.isActiveFilter)]), () => ( []));
7504
+ const active = _nullishCoalesce(_optionalChain([layer, 'access', _293 => _293.filters, 'optionalAccess', _294 => _294.filter, 'call', _295 => _295(_chunkHTAFDTNRcjs.isActiveFilter)]), () => ( []));
7505
7505
  if (active.length) {
7506
7506
  add2("Layer filters (develop, blur) were baked into the pixels", layer.name);
7507
7507
  const content = { ...out, visible: true, opacity: 1, blend: "normal" };
@@ -7534,8 +7534,8 @@ var ImageEditorController = (_class6 = class {
7534
7534
  const color = this.psdColorOptions(warnings);
7535
7535
  if (color.colorMode && this.bitDepth !== 8) warnings.push(`${color.colorMode.toUpperCase()} files are written at 8 bits per channel; the ${this.bitDepth}-bit samples were rounded.`);
7536
7536
  const depth = color.colorMode ? 8 : this.bitDepth;
7537
- const mergedDeep = depth === 8 ? void 0 : _chunkWMRIG4XQcjs.workingToSamples.call(void 0, _chunk4S2AXNQFcjs.compositeDeep.call(void 0, prepared, canvas, sources, depth), depth);
7538
- const result = _chunk4S2AXNQFcjs.exportPsd.call(void 0, { width, height, layers: prepared, merged, mergedDeep, resolution: this.psdResolution, patterns: this.state.patterns, globalLight: this.state.globalLight, depth, ...color });
7537
+ const mergedDeep = depth === 8 ? void 0 : _chunkWMRIG4XQcjs.workingToSamples.call(void 0, _chunkHTAFDTNRcjs.compositeDeep.call(void 0, prepared, canvas, sources, depth), depth);
7538
+ const result = _chunkHTAFDTNRcjs.exportPsd.call(void 0, { width, height, layers: prepared, merged, mergedDeep, resolution: this.psdResolution, patterns: this.state.patterns, globalLight: this.state.globalLight, depth, ...color });
7539
7539
  warnings.push(...result.warnings);
7540
7540
  return { bytes: result.bytes, warnings, psb: result.psb, width, height };
7541
7541
  }
@@ -7551,13 +7551,13 @@ var ImageEditorController = (_class6 = class {
7551
7551
  if (!this.samplePixelsOverride) this.samplePixels = null;
7552
7552
  if (this.state.selection && (sx !== 1 || sy !== 1)) {
7553
7553
  this.state.selection = normalizeSelection(
7554
- _chunk4S2AXNQFcjs.resizeSelection.call(void 0, this.state.selection, Math.round(next.dimensions.width), Math.round(next.dimensions.height))
7554
+ _chunkHTAFDTNRcjs.resizeSelection.call(void 0, this.state.selection, Math.round(next.dimensions.width), Math.round(next.dimensions.height))
7555
7555
  );
7556
7556
  }
7557
7557
  let layers = this.state.layers;
7558
7558
  if (sx !== 1 || sy !== 1) {
7559
7559
  if (this.state.crop) {
7560
- this.state.crop = _chunk4S2AXNQFcjs.clampCropToImage.call(void 0,
7560
+ this.state.crop = _chunkHTAFDTNRcjs.clampCropToImage.call(void 0,
7561
7561
  {
7562
7562
  x: Math.round(this.state.crop.x * sx),
7563
7563
  y: Math.round(this.state.crop.y * sy),
@@ -7576,17 +7576,17 @@ var ImageEditorController = (_class6 = class {
7576
7576
  } else if (l.type === "shape") {
7577
7577
  const a = l.annotation;
7578
7578
  const scaled = a ? scaleAnnotation(a, sx, sy) : null;
7579
- const fromAnnotation = scaled ? _chunk4S2AXNQFcjs.shapeFromAnnotation.call(void 0, scaled) : null;
7579
+ const fromAnnotation = scaled ? _chunkHTAFDTNRcjs.shapeFromAnnotation.call(void 0, scaled) : null;
7580
7580
  const m = [sx, 0, 0, sy, 0, 0];
7581
- const components = _nullishCoalesce(_optionalChain([fromAnnotation, 'optionalAccess', _303 => _303.components]), () => ( _chunk4S2AXNQFcjs.transformShapeComponents.call(void 0, l.components, (p) => ({ x: p.x * sx, y: p.y * sy }), m)));
7581
+ const components = _nullishCoalesce(_optionalChain([fromAnnotation, 'optionalAccess', _303 => _303.components]), () => ( _chunkHTAFDTNRcjs.transformShapeComponents.call(void 0, l.components, (p) => ({ x: p.x * sx, y: p.y * sy }), m)));
7582
7582
  const moved = { ...l, components, ...fromAnnotation ? { fill: fromAnnotation.fill, stroke: fromAnnotation.stroke } : {} };
7583
7583
  if (scaled && fromAnnotation) moved.annotation = scaled;
7584
7584
  else delete moved.annotation;
7585
- layers = _chunkWMRIG4XQcjs.mapLayer.call(void 0, layers, l.id, () => _chunk4S2AXNQFcjs.rerenderShape.call(void 0, moved, env));
7585
+ layers = _chunkWMRIG4XQcjs.mapLayer.call(void 0, layers, l.id, () => _chunkHTAFDTNRcjs.rerenderShape.call(void 0, moved, env));
7586
7586
  }
7587
7587
  }
7588
7588
  }
7589
- const bg = _chunk4S2AXNQFcjs.developTarget.call(void 0, layers, null);
7589
+ const bg = _chunkHTAFDTNRcjs.developTarget.call(void 0, layers, null);
7590
7590
  if (bg && bg.source !== "document") layers = _chunkWMRIG4XQcjs.mapLayer.call(void 0, layers, bg.id, () => ({ ...bg, source: "document" }));
7591
7591
  if (clearAnnotations) {
7592
7592
  for (const l of _chunkWMRIG4XQcjs.flattenLayers.call(void 0, layers)) if (l.type === "annotation" || (l.type === "shape" || l.type === "type") && l.annotation) layers = _chunkWMRIG4XQcjs.mapLayer.call(void 0, layers, l.id, () => null);
@@ -7607,7 +7607,7 @@ var ImageEditorController = (_class6 = class {
7607
7607
  let out;
7608
7608
  try {
7609
7609
  out = this.serializeState();
7610
- if (_optionalChain([this, 'access', _307 => _307.state, 'access', _308 => _308.selection, 'optionalAccess', _309 => _309.bounds])) out.selection = _chunk4S2AXNQFcjs.serializeSelection.call(void 0, this.state.selection);
7610
+ if (_optionalChain([this, 'access', _307 => _307.state, 'access', _308 => _308.selection, 'optionalAccess', _309 => _309.bounds])) out.selection = _chunkHTAFDTNRcjs.serializeSelection.call(void 0, this.state.selection);
7611
7611
  } finally {
7612
7612
  if (root) {
7613
7613
  this.state = current;
@@ -7615,8 +7615,8 @@ var ImageEditorController = (_class6 = class {
7615
7615
  this.viewKey = [];
7616
7616
  }
7617
7617
  }
7618
- if (!options || out.version !== _chunk4S2AXNQFcjs.LAYERED_SCHEMA_VERSION) return options ? Promise.resolve(out) : out;
7619
- return _chunk4S2AXNQFcjs.serializeLayersExternal.call(void 0, this.rootLayers(), options.store).then(({ layers, assets, smartContents }) => smartContents ? { ...out, layers, assets, smartContents } : { ...out, layers, assets });
7618
+ if (!options || out.version !== _chunkHTAFDTNRcjs.LAYERED_SCHEMA_VERSION) return options ? Promise.resolve(out) : out;
7619
+ return _chunkHTAFDTNRcjs.serializeLayersExternal.call(void 0, this.rootLayers(), options.store).then(({ layers, assets, smartContents }) => smartContents ? { ...out, layers, assets, smartContents } : { ...out, layers, assets });
7620
7620
  }
7621
7621
  /**
7622
7622
  * Loads a stored state whose v3 assets may live in an asset store (references other than data
@@ -7624,12 +7624,12 @@ var ImageEditorController = (_class6 = class {
7624
7624
  * out and listed in `lastLoadProblems`.
7625
7625
  */
7626
7626
  async loadJSONAsync(data, options = {}) {
7627
- if (data.version !== _chunk4S2AXNQFcjs.LAYERED_SCHEMA_VERSION || !data.assets) {
7627
+ if (data.version !== _chunkHTAFDTNRcjs.LAYERED_SCHEMA_VERSION || !data.assets) {
7628
7628
  this.loadJSON(data);
7629
7629
  return;
7630
7630
  }
7631
7631
  const problems = [];
7632
- const assets = await _chunk4S2AXNQFcjs.resolveExternalAssets.call(void 0, data.assets, options.store, problems);
7632
+ const assets = await _chunkHTAFDTNRcjs.resolveExternalAssets.call(void 0, data.assets, options.store, problems);
7633
7633
  this.loadJSON({ ...data, assets });
7634
7634
  this.lastLoadProblems = [...problems, ...this.lastLoadProblems];
7635
7635
  }
@@ -7641,7 +7641,7 @@ var ImageEditorController = (_class6 = class {
7641
7641
  let selection = null;
7642
7642
  if (data.selection) {
7643
7643
  try {
7644
- selection = normalizeSelection(_chunk4S2AXNQFcjs.deserializeSelection.call(void 0, data.selection));
7644
+ selection = normalizeSelection(_chunkHTAFDTNRcjs.deserializeSelection.call(void 0, data.selection));
7645
7645
  } catch (e25) {
7646
7646
  selection = null;
7647
7647
  }
@@ -7659,8 +7659,8 @@ var ImageEditorController = (_class6 = class {
7659
7659
  if (isLayered(data)) {
7660
7660
  const problems = [];
7661
7661
  const canvas = typeof data.width === "number" && data.width > 0 && typeof data.height === "number" && data.height > 0 ? { width: data.width, height: data.height } : this.naturalSize;
7662
- const storedPatterns = _chunk4S2AXNQFcjs.deserializePatterns.call(void 0, data.patterns, []);
7663
- s.layers = _chunk4S2AXNQFcjs.deserializeLayers.call(void 0, data.layers, {
7662
+ const storedPatterns = _chunkHTAFDTNRcjs.deserializePatterns.call(void 0, data.patterns, []);
7663
+ s.layers = _chunkHTAFDTNRcjs.deserializeLayers.call(void 0, data.layers, {
7664
7664
  assets: _nullishCoalesce(data.assets, () => ( {})),
7665
7665
  problems,
7666
7666
  smartContents: Array.isArray(data.smartContents) ? data.smartContents : [],
@@ -7678,7 +7678,7 @@ var ImageEditorController = (_class6 = class {
7678
7678
  const light = data.globalLight;
7679
7679
  if (light && Number.isFinite(light.angle) && Number.isFinite(light.altitude)) s.globalLight = { angle: light.angle, altitude: Math.min(90, Math.max(0, light.altitude)) };
7680
7680
  else delete s.globalLight;
7681
- const patterns = _chunk4S2AXNQFcjs.deserializePatterns.call(void 0, data.patterns, problems);
7681
+ const patterns = _chunkHTAFDTNRcjs.deserializePatterns.call(void 0, data.patterns, problems);
7682
7682
  if (patterns.length) s.patterns = patterns;
7683
7683
  else delete s.patterns;
7684
7684
  if (data.bitDepth === 16 || data.bitDepth === 32) s.bitDepth = data.bitDepth;
@@ -7694,7 +7694,7 @@ var ImageEditorController = (_class6 = class {
7694
7694
  }
7695
7695
  } else {
7696
7696
  const { width, height } = this.naturalSize;
7697
- const stack = _chunk4S2AXNQFcjs.layersFromLegacy.call(void 0, data, width, height);
7697
+ const stack = _chunkHTAFDTNRcjs.layersFromLegacy.call(void 0, data, width, height);
7698
7698
  s.layers = stack.layers;
7699
7699
  s.outputOpacity = stack.outputOpacity;
7700
7700
  if (stack.legacyOutputBlur !== void 0) s.legacyOutputBlur = stack.legacyOutputBlur;
@@ -7715,7 +7715,7 @@ var ImageEditorController = (_class6 = class {
7715
7715
  }
7716
7716
  serializeState() {
7717
7717
  const { width, height } = this.naturalSize;
7718
- const view = _chunk4S2AXNQFcjs.legacyView.call(void 0, this.stack(), width, height, null);
7718
+ const view = _chunkHTAFDTNRcjs.legacyView.call(void 0, this.stack(), width, height, null);
7719
7719
  if (view.exact && !this.state.globalLight && !_optionalChain([this, 'access', _310 => _310.state, 'access', _311 => _311.patterns, 'optionalAccess', _312 => _312.length]) && this.bitDepth === 8 && !this.state.colorProfile && !this.state.colorMode) {
7720
7720
  return {
7721
7721
  // States without adjustment layers keep schema 1, so they round-trip unchanged.
@@ -7730,9 +7730,9 @@ var ImageEditorController = (_class6 = class {
7730
7730
  annotations: JSON.parse(JSON.stringify(view.annotations))
7731
7731
  };
7732
7732
  }
7733
- const { layers, assets, smartContents } = _chunk4S2AXNQFcjs.serializeLayers.call(void 0, this.state.layers);
7733
+ const { layers, assets, smartContents } = _chunkHTAFDTNRcjs.serializeLayers.call(void 0, this.state.layers);
7734
7734
  const out = {
7735
- version: _chunk4S2AXNQFcjs.LAYERED_SCHEMA_VERSION,
7735
+ version: _chunkHTAFDTNRcjs.LAYERED_SCHEMA_VERSION,
7736
7736
  width,
7737
7737
  height,
7738
7738
  layers,
@@ -7744,7 +7744,7 @@ var ImageEditorController = (_class6 = class {
7744
7744
  };
7745
7745
  if (this.state.legacyOutputBlur !== void 0) out.legacyOutputBlur = this.state.legacyOutputBlur;
7746
7746
  if (this.state.globalLight) out.globalLight = { ...this.state.globalLight };
7747
- if (_optionalChain([this, 'access', _316 => _316.state, 'access', _317 => _317.patterns, 'optionalAccess', _318 => _318.length])) out.patterns = _chunk4S2AXNQFcjs.serializePatterns.call(void 0, this.state.patterns);
7747
+ if (_optionalChain([this, 'access', _316 => _316.state, 'access', _317 => _317.patterns, 'optionalAccess', _318 => _318.length])) out.patterns = _chunkHTAFDTNRcjs.serializePatterns.call(void 0, this.state.patterns);
7748
7748
  if (smartContents) out.smartContents = smartContents;
7749
7749
  if (this.state.bitDepth === 16 || this.state.bitDepth === 32) out.bitDepth = this.state.bitDepth;
7750
7750
  if (this.state.colorProfile) out.colorProfile = serializeColorProfile(this.state.colorProfile);
@@ -7756,7 +7756,7 @@ function serializeAdjustments(adjustments) {
7756
7756
  const out = { ...adjustments };
7757
7757
  if (_optionalChain([out, 'access', _319 => _319.layers, 'optionalAccess', _320 => _320.length])) out.layers = JSON.parse(JSON.stringify(out.layers));
7758
7758
  else delete out.layers;
7759
- if (_chunk4S2AXNQFcjs.normalizeProcessVersion.call(void 0, out.process) === _chunk4S2AXNQFcjs.LEGACY_PROCESS_VERSION) {
7759
+ if (_chunkHTAFDTNRcjs.normalizeProcessVersion.call(void 0, out.process) === _chunkHTAFDTNRcjs.LEGACY_PROCESS_VERSION) {
7760
7760
  delete out.process;
7761
7761
  if (!out.tint) delete out.tint;
7762
7762
  }
@@ -7767,7 +7767,7 @@ function withDevelop(layer, partial) {
7767
7767
  let i = filters.findIndex((f) => f.kind === "develop");
7768
7768
  if (i === -1) {
7769
7769
  filters.unshift({
7770
- id: layer.source === "document" ? _chunk4S2AXNQFcjs.DEVELOP_FILTER_ID : _chunk4S2AXNQFcjs.newLayerId.call(void 0, "flt"),
7770
+ id: layer.source === "document" ? _chunkHTAFDTNRcjs.DEVELOP_FILTER_ID : _chunkHTAFDTNRcjs.newLayerId.call(void 0, "flt"),
7771
7771
  kind: "develop",
7772
7772
  enabled: true,
7773
7773
  brightness: 0,
@@ -7776,7 +7776,7 @@ function withDevelop(layer, partial) {
7776
7776
  exposure: 0,
7777
7777
  temperature: 0,
7778
7778
  tint: 0,
7779
- process: _chunk4S2AXNQFcjs.LATEST_PROCESS_VERSION
7779
+ process: _chunkHTAFDTNRcjs.LATEST_PROCESS_VERSION
7780
7780
  });
7781
7781
  i = 0;
7782
7782
  }
@@ -7785,7 +7785,7 @@ function withDevelop(layer, partial) {
7785
7785
  const v = partial[k];
7786
7786
  if (typeof v === "number" && Number.isFinite(v)) next[k] = v;
7787
7787
  }
7788
- if ("process" in partial) next.process = _chunk4S2AXNQFcjs.normalizeProcessVersion.call(void 0, partial.process);
7788
+ if ("process" in partial) next.process = _chunkHTAFDTNRcjs.normalizeProcessVersion.call(void 0, partial.process);
7789
7789
  filters[i] = next;
7790
7790
  return { ...layer, filters };
7791
7791
  }
@@ -7794,7 +7794,7 @@ function withBlur(layer, radius) {
7794
7794
  const filters = (_nullishCoalesce(layer.filters, () => ( []))).filter((f) => f.kind !== "blur");
7795
7795
  if (radius > 0) {
7796
7796
  filters.push({
7797
- id: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _324 => _324.id]), () => ( (layer.source === "document" ? _chunk4S2AXNQFcjs.BLUR_FILTER_ID : _chunk4S2AXNQFcjs.newLayerId.call(void 0, "flt")))),
7797
+ id: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _324 => _324.id]), () => ( (layer.source === "document" ? _chunkHTAFDTNRcjs.BLUR_FILTER_ID : _chunkHTAFDTNRcjs.newLayerId.call(void 0, "flt")))),
7798
7798
  kind: "blur",
7799
7799
  enabled: true,
7800
7800
  radius
@@ -7818,7 +7818,7 @@ function mergeAdjustmentNode(node, update, width, height) {
7818
7818
  if (!update.mask) delete next.mask;
7819
7819
  else {
7820
7820
  const current = node.mask && !node.mask.source ? node.mask : null;
7821
- const memo = current ? _chunk4S2AXNQFcjs.legacyMaskOf.call(void 0, current, width, height) : null;
7821
+ const memo = current ? _chunkHTAFDTNRcjs.legacyMaskOf.call(void 0, current, width, height) : null;
7822
7822
  if (current && memo && memo.width === update.mask.width && memo.height === update.mask.height && memo.rle === update.mask.rle) {
7823
7823
  next.mask = withMaskProps(current, {
7824
7824
  density: _nullishCoalesce(update.mask.density, () => ( 1)),
@@ -7826,7 +7826,7 @@ function mergeAdjustmentNode(node, update, width, height) {
7826
7826
  enabled: update.mask.enabled !== false
7827
7827
  });
7828
7828
  } else {
7829
- const m = _chunk4S2AXNQFcjs.rasterMaskFromLegacy.call(void 0, update.mask, width, height);
7829
+ const m = _chunkHTAFDTNRcjs.rasterMaskFromLegacy.call(void 0, update.mask, width, height);
7830
7830
  if (m) next.mask = m;
7831
7831
  else delete next.mask;
7832
7832
  }
@@ -7865,7 +7865,7 @@ function resizeLegacyMasks(layers, from, to) {
7865
7865
  for (const l of _chunkWMRIG4XQcjs.flattenLayers.call(void 0, layers)) {
7866
7866
  if (l.type !== "adjustment" || !l.mask || l.mask.source) continue;
7867
7867
  const old = l.mask;
7868
- const mask = _chunk4S2AXNQFcjs.rasterMaskFromLegacy.call(void 0, _chunk4S2AXNQFcjs.legacyMaskOf.call(void 0, old, fw, fh), tw, th);
7868
+ const mask = _chunkHTAFDTNRcjs.rasterMaskFromLegacy.call(void 0, _chunkHTAFDTNRcjs.legacyMaskOf.call(void 0, old, fw, fh), tw, th);
7869
7869
  if (!mask) continue;
7870
7870
  out = _chunkWMRIG4XQcjs.mapLayer.call(void 0, out, l.id, (n) => ({ ...n, mask: { ...mask, density: old.density, feather: old.feather, enabled: old.enabled } }));
7871
7871
  }
@@ -7961,12 +7961,12 @@ function withoutAnnotations(layers) {
7961
7961
  function parseColor(value) {
7962
7962
  if (Array.isArray(value)) {
7963
7963
  if (value.length < 3 || value.length > 4 || !value.every((v) => typeof v === "number" && v >= 0 && v <= 255)) {
7964
- throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("A colour array is [r, g, b] or [r, g, b, a] with values 0..255.");
7964
+ throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("A colour array is [r, g, b] or [r, g, b, a] with values 0..255.");
7965
7965
  }
7966
7966
  return [Math.round(value[0]), Math.round(value[1]), Math.round(value[2]), Math.round(_nullishCoalesce(value[3], () => ( 255)))];
7967
7967
  }
7968
7968
  const m = /^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i.exec(String(value).trim());
7969
- if (!m) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)(`Invalid colour "${value}"; use #rrggbb or #rrggbbaa.`);
7969
+ if (!m) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)(`Invalid colour "${value}"; use #rrggbb or #rrggbbaa.`);
7970
7970
  let hex = m[1];
7971
7971
  if (hex.length === 3) hex = hex.split("").map((c) => c + c).join("");
7972
7972
  const n = (i) => parseInt(hex.slice(i, i + 2), 16);
@@ -8116,7 +8116,7 @@ function loadImageEditorDocument(input) {
8116
8116
  // Optional: only present when something was selected when saving.
8117
8117
  selection: {
8118
8118
  parse: (value) => {
8119
- const mask = _chunk4S2AXNQFcjs.deserializeSelection.call(void 0, value);
8119
+ const mask = _chunkHTAFDTNRcjs.deserializeSelection.call(void 0, value);
8120
8120
  const v = value;
8121
8121
  return { width: mask.width, height: mask.height, rle: v.rle };
8122
8122
  },
@@ -8204,7 +8204,7 @@ function loadLayeredDocument(doc) {
8204
8204
  },
8205
8205
  selection: {
8206
8206
  parse: (value) => {
8207
- const mask = _chunk4S2AXNQFcjs.deserializeSelection.call(void 0, value);
8207
+ const mask = _chunkHTAFDTNRcjs.deserializeSelection.call(void 0, value);
8208
8208
  const v = value;
8209
8209
  return { width: mask.width, height: mask.height, rle: v.rle };
8210
8210
  },
@@ -8598,14 +8598,14 @@ function describeSelection(mask) {
8598
8598
  // src/image-editor/selection-tools.ts
8599
8599
  var modeSchema = {
8600
8600
  type: "string",
8601
- enum: [..._chunk4S2AXNQFcjs.SELECTION_MODES],
8601
+ enum: [..._chunkHTAFDTNRcjs.SELECTION_MODES],
8602
8602
  description: "How the result combines with the current selection (default replace)."
8603
8603
  };
8604
8604
  var num = (v, d) => typeof v === "number" && Number.isFinite(v) ? v : d;
8605
8605
  function summary(controller) {
8606
8606
  const sel = controller.getSelection();
8607
8607
  const { width, height } = controller.getState().imageDimensions;
8608
- const area = _chunk4S2AXNQFcjs.selectionArea.call(void 0, sel);
8608
+ const area = _chunkHTAFDTNRcjs.selectionArea.call(void 0, sel);
8609
8609
  return {
8610
8610
  empty: !sel,
8611
8611
  bounds: _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _336 => _336.bounds]), () => ( null)),
@@ -8651,7 +8651,7 @@ function createImageSelectionTools(controller) {
8651
8651
  },
8652
8652
  annotations: writeAnnotations("Select a region", true),
8653
8653
  handler: ({ shape, x, y, width, height, mode, feather }) => {
8654
- const opts = { mode: _chunk4S2AXNQFcjs.parseSelectionMode.call(void 0, mode), feather: num(feather, 0) };
8654
+ const opts = { mode: _chunkHTAFDTNRcjs.parseSelectionMode.call(void 0, mode), feather: num(feather, 0) };
8655
8655
  switch (shape) {
8656
8656
  case "all":
8657
8657
  controller.selectAll();
@@ -8704,7 +8704,7 @@ function createImageSelectionTools(controller) {
8704
8704
  annotations: writeAnnotations("Select by colour", true),
8705
8705
  handler: async ({ x, y, color, tolerance, contiguous, fuzziness, sampleMerged, sample, mode }) => {
8706
8706
  const common = {
8707
- mode: _chunk4S2AXNQFcjs.parseSelectionMode.call(void 0, mode),
8707
+ mode: _chunkHTAFDTNRcjs.parseSelectionMode.call(void 0, mode),
8708
8708
  sampleMerged: sampleMerged === true,
8709
8709
  sample: _nullishCoalesce(sample, () => ( "composite"))
8710
8710
  };
@@ -8725,7 +8725,7 @@ function createImageSelectionTools(controller) {
8725
8725
  inputSchema: {
8726
8726
  type: "object",
8727
8727
  properties: {
8728
- op: { type: "string", enum: [..._chunk4S2AXNQFcjs.SELECTION_MODIFY_OPS], description: "How to modify the selection." },
8728
+ op: { type: "string", enum: [..._chunkHTAFDTNRcjs.SELECTION_MODIFY_OPS], description: "How to modify the selection." },
8729
8729
  radius: { type: "number", minimum: 0, maximum: 500, description: "Radius in pixels." }
8730
8730
  },
8731
8731
  required: ["op", "radius"],
@@ -8733,7 +8733,7 @@ function createImageSelectionTools(controller) {
8733
8733
  },
8734
8734
  annotations: writeAnnotations("Modify the selection"),
8735
8735
  handler: ({ op, radius }) => {
8736
- if (!_chunk4S2AXNQFcjs.SELECTION_MODIFY_OPS.includes(op)) throw new Error(`Unknown op "${String(op)}".`);
8736
+ if (!_chunkHTAFDTNRcjs.SELECTION_MODIFY_OPS.includes(op)) throw new Error(`Unknown op "${String(op)}".`);
8737
8737
  if (!controller.getSelection()) throw new Error("Nothing is selected.");
8738
8738
  controller.modifySelection(op, Math.min(500, Math.max(0, num(radius, 0))));
8739
8739
  return summary(controller);
@@ -8777,7 +8777,7 @@ function createImageSelectionTools(controller) {
8777
8777
  type: "object",
8778
8778
  properties: {
8779
8779
  layerId: { type: "string", description: "Existing adjustment layer to mask." },
8780
- kind: { type: "string", enum: _chunk4S2AXNQFcjs.ADJUSTMENT_KINDS.map((k) => k.kind), description: "Kind of a new layer to add and mask (instead of layerId)." },
8780
+ kind: { type: "string", enum: _chunkHTAFDTNRcjs.ADJUSTMENT_KINDS.map((k) => k.kind), description: "Kind of a new layer to add and mask (instead of layerId)." },
8781
8781
  params: { type: "object", description: "Parameters for the new layer (see list_controls)." },
8782
8782
  density: { type: "number", minimum: 0, maximum: 1, description: "Mask density 0-1." },
8783
8783
  feather: { type: "number", minimum: 0, maximum: 1e3, description: "Mask feather in pixels." }
@@ -8797,11 +8797,11 @@ function createImageSelectionTools(controller) {
8797
8797
  if (!controller.getAdjustmentLayer(layerId)) throw new Error(`No adjustment layer "${layerId}".`);
8798
8798
  controller.applySelectionAsLayerMask(layerId, props);
8799
8799
  id = layerId;
8800
- } else if (_chunk4S2AXNQFcjs.isAdjustmentKind.call(void 0, kind)) {
8800
+ } else if (_chunkHTAFDTNRcjs.isAdjustmentKind.call(void 0, kind)) {
8801
8801
  id = controller.addAdjustmentLayer({
8802
8802
  kind,
8803
8803
  params,
8804
- mask: _chunk4S2AXNQFcjs.layerMaskFromSelection.call(void 0, sel, props)
8804
+ mask: _chunkHTAFDTNRcjs.layerMaskFromSelection.call(void 0, sel, props)
8805
8805
  });
8806
8806
  } else {
8807
8807
  throw new Error("Pass layerId (an existing layer) or kind (a new adjustment layer).");
@@ -8938,11 +8938,11 @@ function createImageEditTools(controller) {
8938
8938
  const geometry2 = () => {
8939
8939
  const s = controller.getState();
8940
8940
  const region = _nullishCoalesce(s.crop, () => ( { x: 0, y: 0, ...s.imageDimensions }));
8941
- const out = _chunk4S2AXNQFcjs.getRotatedSize.call(void 0, region.width, region.height, s.transform);
8941
+ const out = _chunkHTAFDTNRcjs.getRotatedSize.call(void 0, region.width, region.height, s.transform);
8942
8942
  return {
8943
8943
  image: { ...s.imageDimensions },
8944
8944
  crop: s.crop ? { ...s.crop } : null,
8945
- rotation: _chunk4S2AXNQFcjs.normalizeAngle.call(void 0, s.transform.rotate),
8945
+ rotation: _chunkHTAFDTNRcjs.normalizeAngle.call(void 0, s.transform.rotate),
8946
8946
  flipH: s.transform.flipH,
8947
8947
  flipV: s.transform.flipV,
8948
8948
  output: { width: Math.round(out.width), height: Math.round(out.height) }
@@ -9177,7 +9177,7 @@ function describeLayer(layer, activeId, boundsOf) {
9177
9177
  const out = {
9178
9178
  id: layer.id,
9179
9179
  type: layer.type,
9180
- name: layer.name || (layer.type === "adjustment" ? _chunk4S2AXNQFcjs.adjustmentKindLabel.call(void 0, layer.kind) : ""),
9180
+ name: layer.name || (layer.type === "adjustment" ? _chunkHTAFDTNRcjs.adjustmentKindLabel.call(void 0, layer.kind) : ""),
9181
9181
  visible: layer.visible,
9182
9182
  opacity: round3(layer.opacity),
9183
9183
  blend: layer.blend,
@@ -9266,8 +9266,8 @@ function createImageLayerTools(controller) {
9266
9266
  };
9267
9267
  };
9268
9268
  const exists = (id, what = "layerId") => {
9269
- if (typeof id !== "string" || !id) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)(`${what} is required (a layer id from list_layers).`);
9270
- _chunk4S2AXNQFcjs.requireLayer.call(void 0, controller.getLayers(), id);
9269
+ if (typeof id !== "string" || !id) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)(`${what} is required (a layer id from list_layers).`);
9270
+ _chunkHTAFDTNRcjs.requireLayer.call(void 0, controller.getLayers(), id);
9271
9271
  return id;
9272
9272
  };
9273
9273
  const listLayers = {
@@ -9303,7 +9303,7 @@ function createImageLayerTools(controller) {
9303
9303
  handler: ({ layerId, target }) => {
9304
9304
  const id = exists(layerId);
9305
9305
  const layer = controller.getLayer(id);
9306
- if (target === "mask" && !layer.mask) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask; add one with add_layer_mask.`);
9306
+ if (target === "mask" && !layer.mask) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask; add one with add_layer_mask.`);
9307
9307
  controller.setActiveLayer(id, _nullishCoalesce(target, () => ( "pixels")));
9308
9308
  return { layer: describe(id), activeTarget: controller.getState().activeTarget };
9309
9309
  }
@@ -9328,7 +9328,7 @@ function createImageLayerTools(controller) {
9328
9328
  },
9329
9329
  annotations: { title: "Add a pixel layer", ...WRITE2 },
9330
9330
  handler: async (args) => {
9331
- if (args.color !== void 0 && args.image !== void 0) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("Give color or image, not both.");
9331
+ if (args.color !== void 0 && args.image !== void 0) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("Give color or image, not both.");
9332
9332
  for (const k of ["aboveId", "belowId", "parentId"]) if (args[k] !== void 0) exists(args[k], k);
9333
9333
  const init = {
9334
9334
  name: args.name,
@@ -9418,7 +9418,7 @@ function createImageLayerTools(controller) {
9418
9418
  const id = exists(args.layerId);
9419
9419
  const props = {};
9420
9420
  for (const k of ["name", "visible", "opacity", "fillOpacity", "blend", "clipped", "locks", "collapsed"]) if (args[k] !== void 0) props[k] = args[k];
9421
- if (!Object.keys(props).length) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("Give at least one property to change.");
9421
+ if (!Object.keys(props).length) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("Give at least one property to change.");
9422
9422
  controller.setLayerProperties(id, props);
9423
9423
  return { layer: describe(id) };
9424
9424
  }
@@ -9512,8 +9512,8 @@ function createImageLayerTools(controller) {
9512
9512
  annotations: { title: "Move a layer's pixels", ...WRITE2 },
9513
9513
  handler: ({ layerId, x, y, dx, dy }) => {
9514
9514
  const id = exists(layerId);
9515
- if ([x, y, dx, dy].every((v) => v === void 0)) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("Give x and y, or dx and dy.");
9516
- if ((x !== void 0 || y !== void 0) && (dx !== void 0 || dy !== void 0)) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("Give x / y or dx / dy, not both.");
9515
+ if ([x, y, dx, dy].every((v) => v === void 0)) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("Give x and y, or dx and dy.");
9516
+ if ((x !== void 0 || y !== void 0) && (dx !== void 0 || dy !== void 0)) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("Give x / y or dx / dy, not both.");
9517
9517
  return { layerId: id, ...controller.offsetLayer(id, { x, y, dx, dy }) };
9518
9518
  }
9519
9519
  };
@@ -9585,7 +9585,7 @@ function createImageLayerTools(controller) {
9585
9585
  annotations: { title: "Set layer mask properties", ...WRITE_IDEMPOTENT2 },
9586
9586
  handler: ({ layerId, density, feather, enabled, linked }) => {
9587
9587
  const id = exists(layerId);
9588
- if ([density, feather, enabled, linked].every((v) => v === void 0)) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("Give density, feather, enabled or linked.");
9588
+ if ([density, feather, enabled, linked].every((v) => v === void 0)) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("Give density, feather, enabled or linked.");
9589
9589
  const mask = controller.setLayerMaskProps(id, {
9590
9590
  density,
9591
9591
  feather,
@@ -9668,7 +9668,7 @@ function createImageLayerTools(controller) {
9668
9668
  handler: (args) => {
9669
9669
  const id = exists(args.layerId);
9670
9670
  const changes = filterValues(args);
9671
- if (!Object.keys(changes).length) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("Give at least one value to change.");
9671
+ if (!Object.keys(changes).length) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("Give at least one value to change.");
9672
9672
  return { layerId: id, filters: controller.updateLayerFilter(id, args.filterId, changes) };
9673
9673
  }
9674
9674
  };
@@ -9932,8 +9932,8 @@ function describeLayerEffects(effects) {
9932
9932
  }
9933
9933
  function createImageEffectTools(controller) {
9934
9934
  const layerArg = (id) => {
9935
- if (typeof id !== "string" || !id) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("layerId is required (a layer id from list_layers).");
9936
- _chunk4S2AXNQFcjs.requireLayer.call(void 0, controller.getLayers(), id);
9935
+ if (typeof id !== "string" || !id) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("layerId is required (a layer id from list_layers).");
9936
+ _chunkHTAFDTNRcjs.requireLayer.call(void 0, controller.getLayers(), id);
9937
9937
  return id;
9938
9938
  };
9939
9939
  const result = (layerId, extra = {}) => ({ layerId, ...extra, ...describeLayerEffects(controller.getLayerEffects(layerId)) });
@@ -9964,7 +9964,7 @@ function createImageEffectTools(controller) {
9964
9964
  annotations: { title: "Add a layer effect", ...WRITE3 },
9965
9965
  handler: ({ layerId, kind, settings, index }) => {
9966
9966
  const id = layerArg(layerId);
9967
- if (!_chunkWMRIG4XQcjs.isLayerEffectKind.call(void 0, kind)) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)(`kind must be one of ${_chunkWMRIG4XQcjs.LAYER_EFFECT_KINDS.join(", ")}.`);
9967
+ if (!_chunkWMRIG4XQcjs.isLayerEffectKind.call(void 0, kind)) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)(`kind must be one of ${_chunkWMRIG4XQcjs.LAYER_EFFECT_KINDS.join(", ")}.`);
9968
9968
  const { effect } = controller.addLayerEffect(id, kind, _nullishCoalesce(settings, () => ( {})), index);
9969
9969
  return result(id, { effectId: effect.id });
9970
9970
  }
@@ -9984,7 +9984,7 @@ function createImageEffectTools(controller) {
9984
9984
  handler: ({ layerId, effectId, settings }) => {
9985
9985
  const id = layerArg(layerId);
9986
9986
  const changes = _nullishCoalesce(settings, () => ( {}));
9987
- if (!Object.keys(changes).length) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("Give at least one setting to change.");
9987
+ if (!Object.keys(changes).length) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("Give at least one setting to change.");
9988
9988
  controller.updateLayerEffect(id, effectId, changes);
9989
9989
  return result(id);
9990
9990
  }
@@ -10036,7 +10036,7 @@ function createImageEffectTools(controller) {
10036
10036
  },
10037
10037
  annotations: { title: "Set the global light", ...WRITE_IDEMPOTENT3 },
10038
10038
  handler: ({ angle, altitude }) => {
10039
- if (angle === void 0 && altitude === void 0) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("Give angle, altitude or both.");
10039
+ if (angle === void 0 && altitude === void 0) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("Give angle, altitude or both.");
10040
10040
  const next = {};
10041
10041
  if (angle !== void 0) next.angle = angle;
10042
10042
  if (altitude !== void 0) next.altitude = altitude;
@@ -10221,7 +10221,7 @@ var PaintGesture = (_class7 = class {
10221
10221
  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.`);
10222
10222
  if (_optionalChain([layer, 'access', _350 => _350.locks, 'optionalAccess', _351 => _351.all]) || _optionalChain([layer, 'access', _352 => _352.locks, 'optionalAccess', _353 => _353.position])) throw new Error(`Layer "${layer.name}" has its position locked.`);
10223
10223
  const origin = layer.type === "pixel" ? { ...layer.offset } : layer.type === "smart" ? { ...layer.placement.corners[0] } : (() => {
10224
- const b = _chunk4S2AXNQFcjs.shapeGeometryBounds.call(void 0, layer);
10224
+ const b = _chunkHTAFDTNRcjs.shapeGeometryBounds.call(void 0, layer);
10225
10225
  return b ? { x: b.x, y: b.y } : { x: 0, y: 0 };
10226
10226
  })();
10227
10227
  this.move = { id: layer.id, start: { x: sample.x, y: sample.y }, origin, moved: false };
@@ -10374,7 +10374,7 @@ function createImagePaintTools(controller) {
10374
10374
  annotations: { title: "Paint a brush stroke", ...WRITE4 },
10375
10375
  handler: (args) => {
10376
10376
  const tool = args.tool;
10377
- if (args.mixer !== void 0 && tool !== "mixer") throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)('mixer settings apply to the Mixer Brush only; pass tool "mixer", or drop mixer.');
10377
+ if (args.mixer !== void 0 && tool !== "mixer") throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)('mixer settings apply to the Mixer Brush only; pass tool "mixer", or drop mixer.');
10378
10378
  const result = controller.paintStroke({
10379
10379
  tool,
10380
10380
  points: args.points,
@@ -10481,7 +10481,7 @@ function profileArg(v) {
10481
10481
  try {
10482
10482
  return _chunkEJVDBITDcjs.base64ToBytes.call(void 0, s.slice(4));
10483
10483
  } catch (e27) {
10484
- throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("The icc: value is not valid base64.");
10484
+ throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("The icc: value is not valid base64.");
10485
10485
  }
10486
10486
  }
10487
10487
  return s;
@@ -10546,10 +10546,10 @@ function createImageColorTools(controller) {
10546
10546
  annotations: { title: "Set up soft proofing", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
10547
10547
  handler: (args) => {
10548
10548
  if (args.off === true) {
10549
- if (args.profile !== void 0) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("Give either off true or a profile, not both.");
10549
+ if (args.profile !== void 0) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("Give either off true or a profile, not both.");
10550
10550
  return controller.setProofSetup(null);
10551
10551
  }
10552
- if (args.profile === void 0) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("Pass the profile to proof with (e.g. coated-cmyk), or off true.");
10552
+ if (args.profile === void 0) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("Pass the profile to proof with (e.g. coated-cmyk), or off true.");
10553
10553
  const s = controller.setProofSetup({
10554
10554
  profile: profileArg(args.profile),
10555
10555
  ...args.intent !== void 0 ? { intent: args.intent } : {},
@@ -10601,7 +10601,7 @@ function createImageColorTools(controller) {
10601
10601
  },
10602
10602
  annotations: { title: "Set the colour mode", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
10603
10603
  handler: (args) => {
10604
- if (args.mode !== "cmyk" && (args.profile !== void 0 || args.intent !== void 0)) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("profile and intent apply to CMYK mode only.");
10604
+ if (args.mode !== "cmyk" && (args.profile !== void 0 || args.intent !== void 0)) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("profile and intent apply to CMYK mode only.");
10605
10605
  return controller.setColorMode(args.mode, {
10606
10606
  ...args.profile !== void 0 ? { profile: profileArg(args.profile) } : {},
10607
10607
  ...args.intent !== void 0 ? { intent: args.intent } : {}
@@ -10666,7 +10666,7 @@ function checkSource(controller, source) {
10666
10666
  const p = source;
10667
10667
  const { width, height } = controller.getState().imageDimensions;
10668
10668
  if (!(p.x >= 0 && p.y >= 0 && p.x < width && p.y < height)) {
10669
- throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)(`source (${p.x}, ${p.y}) is outside the ${width} \xD7 ${height} canvas; pick a point on the image to sample.`);
10669
+ throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)(`source (${p.x}, ${p.y}) is outside the ${width} \xD7 ${height} canvas; pick a point on the image to sample.`);
10670
10670
  }
10671
10671
  return p;
10672
10672
  }
@@ -10860,10 +10860,10 @@ function createImageRetouchTools(controller) {
10860
10860
  annotations: { title: "Set the clone source", ...WRITE5, idempotentHint: true },
10861
10861
  handler: (args) => {
10862
10862
  if (args.clear === true) {
10863
- if (args.x !== void 0 || args.y !== void 0) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("Give either clear true or x and y, not both.");
10863
+ if (args.x !== void 0 || args.y !== void 0) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("Give either clear true or x and y, not both.");
10864
10864
  return controller.setCloneSource(null);
10865
10865
  }
10866
- if (typeof args.x !== "number" || typeof args.y !== "number") throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("Pass x and y (document pixels) for the source point, or clear true to remove it.");
10866
+ if (typeof args.x !== "number" || typeof args.y !== "number") throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("Pass x and y (document pixels) for the source point, or clear true to remove it.");
10867
10867
  return controller.setCloneSource(checkSource(controller, { x: args.x, y: args.y }));
10868
10868
  }
10869
10869
  };
@@ -10884,11 +10884,11 @@ var DATA = {
10884
10884
  description: "The PSD or PSB file as base64 (a `data:` URL prefix is accepted)."
10885
10885
  };
10886
10886
  function psdBytesFromBase64(data) {
10887
- if (typeof data !== "string" || !data.trim()) throw new (0, _chunk4S2AXNQFcjs.PsdError)("data is required: the PSD file as base64.");
10887
+ if (typeof data !== "string" || !data.trim()) throw new (0, _chunkHTAFDTNRcjs.PsdError)("data is required: the PSD file as base64.");
10888
10888
  const body = data.trim().replace(/^data:[^,]*;base64,/i, "");
10889
- if (!/^[A-Za-z0-9+/=_\s-]+$/.test(body)) throw new (0, _chunk4S2AXNQFcjs.PsdError)("data is not base64; send the PSD file bytes base64-encoded.");
10889
+ if (!/^[A-Za-z0-9+/=_\s-]+$/.test(body)) throw new (0, _chunkHTAFDTNRcjs.PsdError)("data is not base64; send the PSD file bytes base64-encoded.");
10890
10890
  const bytes = _chunkEJVDBITDcjs.base64ToBytes.call(void 0, body);
10891
- if (bytes.length < 26) throw new (0, _chunk4S2AXNQFcjs.PsdError)(`data decodes to ${bytes.length} bytes, too short for a PSD (at least 26).`);
10891
+ if (bytes.length < 26) throw new (0, _chunkHTAFDTNRcjs.PsdError)(`data decodes to ${bytes.length} bytes, too short for a PSD (at least 26).`);
10892
10892
  return bytes;
10893
10893
  }
10894
10894
  function createImagePsdTools(controller) {
@@ -10899,7 +10899,7 @@ function createImagePsdTools(controller) {
10899
10899
  inputSchema: { type: "object", properties: { data: DATA }, required: ["data"], additionalProperties: false },
10900
10900
  annotations: { title: "Inspect a PSD", ...READ7 },
10901
10901
  handler: ({ data }) => {
10902
- const res = _chunk4S2AXNQFcjs.importPsd.call(void 0, psdBytesFromBase64(data), { skipPixels: true });
10902
+ const res = _chunkHTAFDTNRcjs.importPsd.call(void 0, psdBytesFromBase64(data), { skipPixels: true });
10903
10903
  return {
10904
10904
  width: res.width,
10905
10905
  height: res.height,
@@ -10986,7 +10986,7 @@ var GEOMETRY = {
10986
10986
  dy: { type: "number", description: "Move down after scaling and rotating, in document pixels (default 0)." },
10987
10987
  reference: {
10988
10988
  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}.",
10989
- anyOf: [{ type: "string", enum: _chunk4S2AXNQFcjs.TRANSFORM_ANCHORS }, POINT]
10989
+ anyOf: [{ type: "string", enum: _chunkHTAFDTNRcjs.TRANSFORM_ANCHORS }, POINT]
10990
10990
  },
10991
10991
  matrix: {
10992
10992
  type: "array",
@@ -11007,14 +11007,14 @@ var NUMERIC = ["scaleX", "scaleY", "rotate", "skewX", "skewY", "dx", "dy", "refe
11007
11007
  function geometryFrom(args) {
11008
11008
  const numeric = NUMERIC.filter((k) => args[k] !== void 0);
11009
11009
  const ways = [numeric.length > 0, args.matrix !== void 0, args.corners !== void 0].filter(Boolean).length;
11010
- if (ways === 0) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("Give the transform one way: numeric fields (scaleX, scaleY, rotate, skewX, skewY, dx, dy, reference), matrix, or corners.");
11011
- if (ways > 1) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("Give the transform only one way: numeric fields, matrix or corners, not a mix.");
11010
+ if (ways === 0) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("Give the transform one way: numeric fields (scaleX, scaleY, rotate, skewX, skewY, dx, dy, reference), matrix, or corners.");
11011
+ if (ways > 1) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("Give the transform only one way: numeric fields, matrix or corners, not a mix.");
11012
11012
  if (args.matrix !== void 0) return { matrix: args.matrix };
11013
11013
  if (args.corners !== void 0) return { corners: args.corners };
11014
11014
  const params = {};
11015
11015
  for (const k of NUMERIC) if (args[k] !== void 0) params[k] = args[k];
11016
- if (params.scaleX === 0 || params.scaleY === 0) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("scaleX and scaleY must not be 0 (that collapses the layer to a line).");
11017
- if (typeof params.reference === "string" && !_chunk4S2AXNQFcjs.isTransformAnchor.call(void 0, params.reference)) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)(`Unknown reference "${params.reference}". Use ${_chunk4S2AXNQFcjs.TRANSFORM_ANCHORS.join(", ")} or {x, y}.`);
11016
+ if (params.scaleX === 0 || params.scaleY === 0) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("scaleX and scaleY must not be 0 (that collapses the layer to a line).");
11017
+ if (typeof params.reference === "string" && !_chunkHTAFDTNRcjs.isTransformAnchor.call(void 0, params.reference)) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)(`Unknown reference "${params.reference}". Use ${_chunkHTAFDTNRcjs.TRANSFORM_ANCHORS.join(", ")} or {x, y}.`);
11018
11018
  return { params };
11019
11019
  }
11020
11020
  function targetFrom(args) {
@@ -11063,15 +11063,15 @@ function createImageTransformTools(controller) {
11063
11063
  moved: [...s.moves],
11064
11064
  frame: { ...s.box },
11065
11065
  corners: s.startGeometry.corners.map(roundPoint),
11066
- center: roundPoint(_chunk4S2AXNQFcjs.anchorPoint.call(void 0, s.startGeometry, "center"))
11066
+ center: roundPoint(_chunkHTAFDTNRcjs.anchorPoint.call(void 0, s.startGeometry, "center"))
11067
11067
  };
11068
11068
  if (s.smartObject) out.smartObject = true;
11069
11069
  s.cancel();
11070
11070
  if (args.meshColumns !== void 0) {
11071
11071
  const cols = args.meshColumns;
11072
11072
  const rows = _nullishCoalesce(args.meshRows, () => ( cols));
11073
- const mesh = _chunkLI3KTY7Kcjs.identityWarpMesh.call(void 0, s.box, cols, rows);
11074
- out.mesh = { columns: cols, rows, pointsPerRow: _chunkLI3KTY7Kcjs.warpMeshColumns.call(void 0, mesh), pointRows: _chunkLI3KTY7Kcjs.warpMeshRows.call(void 0, mesh), points: mesh.points.map(roundPoint) };
11073
+ const mesh = _chunkVYW7JBTMcjs.identityWarpMesh.call(void 0, s.box, cols, rows);
11074
+ out.mesh = { columns: cols, rows, pointsPerRow: _chunkVYW7JBTMcjs.warpMeshColumns.call(void 0, mesh), pointRows: _chunkVYW7JBTMcjs.warpMeshRows.call(void 0, mesh), points: mesh.points.map(roundPoint) };
11075
11075
  }
11076
11076
  return out;
11077
11077
  }
@@ -11096,7 +11096,7 @@ function createImageTransformTools(controller) {
11096
11096
  type: "object",
11097
11097
  properties: {
11098
11098
  ...TARGET3,
11099
- style: { type: "string", enum: _chunkLI3KTY7Kcjs.WARP_STYLES, description: "Preset warp (Photoshop\u2019s menu): arc, arcLower, arcUpper, arch, bulge, shellLower, shellUpper, flag, wave, fish, rise, fisheye, inflate, squeeze, twist." },
11099
+ style: { type: "string", enum: _chunkVYW7JBTMcjs.WARP_STYLES, description: "Preset warp (Photoshop\u2019s menu): arc, arcLower, arcUpper, arch, bulge, shellLower, shellUpper, flag, wave, fish, rise, fisheye, inflate, squeeze, twist." },
11100
11100
  bend: { type: "number", minimum: -100, maximum: 100, description: "Preset bend in percent, \u2212100..100 (default 50)." },
11101
11101
  horizontal: { type: "number", minimum: -100, maximum: 100, description: "Preset horizontal distortion in percent, \u2212100..100 (default 0)." },
11102
11102
  vertical: { type: "number", minimum: -100, maximum: 100, description: "Preset vertical distortion in percent, \u2212100..100 (default 0)." },
@@ -11118,11 +11118,11 @@ function createImageTransformTools(controller) {
11118
11118
  annotations: { title: "Warp a layer", ...WRITE6 },
11119
11119
  handler: (args) => {
11120
11120
  const hasPreset = ["style", "bend", "horizontal", "vertical", "orientation"].some((k) => args[k] !== void 0);
11121
- if (hasPreset && args.mesh !== void 0) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("Give a preset (style, bend, horizontal, vertical, orientation) or a mesh, not both.");
11122
- if (!hasPreset && args.mesh === void 0) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("Give a preset style or a mesh.");
11121
+ if (hasPreset && args.mesh !== void 0) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("Give a preset (style, bend, horizontal, vertical, orientation) or a mesh, not both.");
11122
+ if (!hasPreset && args.mesh === void 0) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("Give a preset style or a mesh.");
11123
11123
  let warp;
11124
11124
  if (hasPreset) {
11125
- if (args.style === void 0) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)(`style is required with a preset. Styles: ${_chunkLI3KTY7Kcjs.WARP_STYLES.join(", ")}.`);
11125
+ if (args.style === void 0) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)(`style is required with a preset. Styles: ${_chunkVYW7JBTMcjs.WARP_STYLES.join(", ")}.`);
11126
11126
  warp = {
11127
11127
  style: args.style,
11128
11128
  bend: _nullishCoalesce(args.bend, () => ( 50)),
@@ -11133,7 +11133,7 @@ function createImageTransformTools(controller) {
11133
11133
  } else {
11134
11134
  const m = args.mesh;
11135
11135
  const want = (3 * m.columns + 1) * (3 * m.rows + 1);
11136
- if (m.points.length !== want) throw new (0, _chunk4S2AXNQFcjs.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}.`);
11136
+ if (m.points.length !== want) throw new (0, _chunkHTAFDTNRcjs.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}.`);
11137
11137
  const knots = (n) => Array.from({ length: n + 1 }, (_, i) => i / n);
11138
11138
  warp = { us: knots(m.columns), vs: knots(m.rows), points: m.points.map((p) => ({ x: p.x, y: p.y })) };
11139
11139
  }
@@ -11228,13 +11228,13 @@ function settingsFrom(args) {
11228
11228
  return out;
11229
11229
  }
11230
11230
  function imageArg(image) {
11231
- if (typeof image !== "string" || !image.trim()) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("image is required: a PNG as a data URL or base64 (other formats need a browser).");
11231
+ if (typeof image !== "string" || !image.trim()) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("image is required: a PNG as a data URL or base64 (other formats need a browser).");
11232
11232
  return image.trim();
11233
11233
  }
11234
11234
  function createImageSmartObjectTools(controller) {
11235
11235
  const smartId = (id) => {
11236
- if (typeof id !== "string" || !id) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("layerId is required (a smart object id from list_layers).");
11237
- _chunk4S2AXNQFcjs.requireSmartObject.call(void 0, controller.getLayers(), id);
11236
+ if (typeof id !== "string" || !id) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("layerId is required (a smart object id from list_layers).");
11237
+ _chunkHTAFDTNRcjs.requireSmartObject.call(void 0, controller.getLayers(), id);
11238
11238
  return id;
11239
11239
  };
11240
11240
  const info = (id) => {
@@ -11271,7 +11271,7 @@ function createImageSmartObjectTools(controller) {
11271
11271
  },
11272
11272
  annotations: { title: "Convert to Smart Object", ...WRITE7 },
11273
11273
  handler: ({ layerIds, name }) => {
11274
- for (const id2 of _nullishCoalesce(layerIds, () => ( []))) _chunk4S2AXNQFcjs.requireLayer.call(void 0, controller.getLayers(), id2);
11274
+ for (const id2 of _nullishCoalesce(layerIds, () => ( []))) _chunkHTAFDTNRcjs.requireLayer.call(void 0, controller.getLayers(), id2);
11275
11275
  const id = controller.convertToSmartObject(layerIds, { name });
11276
11276
  return { layer: layerSummary(id), smartObject: info(id) };
11277
11277
  }
@@ -11308,7 +11308,7 @@ function createImageSmartObjectTools(controller) {
11308
11308
  {
11309
11309
  type: "object",
11310
11310
  properties: {
11311
- style: { type: "string", enum: _chunkLI3KTY7Kcjs.WARP_STYLES, description: "Preset (Photoshop\u2019s menu)." },
11311
+ style: { type: "string", enum: _chunkVYW7JBTMcjs.WARP_STYLES, description: "Preset (Photoshop\u2019s menu)." },
11312
11312
  bend: { type: "number", minimum: -100, maximum: 100, description: "Bend in percent (default 50)." },
11313
11313
  horizontal: { type: "number", minimum: -100, maximum: 100, description: "Horizontal distortion in percent (default 0)." },
11314
11314
  vertical: { type: "number", minimum: -100, maximum: 100, description: "Vertical distortion in percent (default 0)." },
@@ -11344,12 +11344,12 @@ function createImageSmartObjectTools(controller) {
11344
11344
  else if (w) {
11345
11345
  const m = w;
11346
11346
  const want = (3 * m.columns + 1) * (3 * m.rows + 1);
11347
- if (m.points.length !== want) throw new (0, _chunk4S2AXNQFcjs.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}.`);
11347
+ if (m.points.length !== want) throw new (0, _chunkHTAFDTNRcjs.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}.`);
11348
11348
  const knots = (n) => Array.from({ length: n + 1 }, (_, i) => i / n);
11349
11349
  warp = { us: knots(m.columns), vs: knots(m.rows), points: m.points.map((p) => ({ x: p.x, y: p.y })) };
11350
11350
  }
11351
11351
  const keys = ["corners", "matrix", "scaleX", "scaleY", "rotate", "skewX", "skewY", "x", "y", "warp", "interpolation"];
11352
- if (!keys.some((k) => args[k] !== void 0)) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)(`Give something to set: ${keys.join(", ")}.`);
11352
+ if (!keys.some((k) => args[k] !== void 0)) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)(`Give something to set: ${keys.join(", ")}.`);
11353
11353
  const res = controller.setSmartObjectTransform(id, {
11354
11354
  corners: args.corners,
11355
11355
  matrix: args.matrix,
@@ -11474,7 +11474,7 @@ function createImageSmartObjectTools(controller) {
11474
11474
  handler: (args) => {
11475
11475
  const id = smartId(args.layerId);
11476
11476
  const changes = settingsFrom(args);
11477
- if (!Object.keys(changes).length) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("Give at least one value to change.");
11477
+ if (!Object.keys(changes).length) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("Give at least one value to change.");
11478
11478
  const filter = controller.updateSmartFilter(id, args.filterId, changes);
11479
11479
  return { layerId: id, filter, smartFilters: info(id).smartFilters };
11480
11480
  }
@@ -11795,8 +11795,8 @@ function geometry(args) {
11795
11795
  }
11796
11796
  function createImageShapeTools(controller) {
11797
11797
  const shapeId = (id) => {
11798
- if (typeof id !== "string" || !id) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("layerId is required (a shape layer id from list_layers).");
11799
- _chunk4S2AXNQFcjs.requireShapeLayer.call(void 0, controller.getLayers(), id);
11798
+ if (typeof id !== "string" || !id) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("layerId is required (a shape layer id from list_layers).");
11799
+ _chunkHTAFDTNRcjs.requireShapeLayer.call(void 0, controller.getLayers(), id);
11800
11800
  return id;
11801
11801
  };
11802
11802
  const layerSummary = (id) => {
@@ -11871,7 +11871,7 @@ function createImageShapeTools(controller) {
11871
11871
  annotations: { title: "Restyle a shape", ...WRITE_IDEMPOTENT5 },
11872
11872
  handler: ({ layerId, fill, stroke, fillRule }) => {
11873
11873
  const id = shapeId(layerId);
11874
- if (fill === void 0 && stroke === void 0 && fillRule === void 0) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("Give fill, stroke or fillRule to change.");
11874
+ if (fill === void 0 && stroke === void 0 && fillRule === void 0) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("Give fill, stroke or fillRule to change.");
11875
11875
  return controller.setShapeStyle(id, { fill, stroke, fillRule });
11876
11876
  }
11877
11877
  };
@@ -11920,7 +11920,7 @@ function createImageShapeTools(controller) {
11920
11920
  handler: ({ layerId, componentIndex, ...rest }) => {
11921
11921
  const id = shapeId(layerId);
11922
11922
  const change = geometry(rest);
11923
- if (change.shape === void 0 && change.subpaths === void 0 && change.op === void 0) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("Give shape, subpaths or op to change.");
11923
+ if (change.shape === void 0 && change.subpaths === void 0 && change.op === void 0) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("Give shape, subpaths or op to change.");
11924
11924
  return controller.setShapeComponent(id, componentIndex, change);
11925
11925
  }
11926
11926
  };
@@ -11994,8 +11994,8 @@ function pick2(args, keys) {
11994
11994
  }
11995
11995
  function createImageTypeTools(controller) {
11996
11996
  const typeId = (id) => {
11997
- if (typeof id !== "string" || !id) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("layerId is required (a type layer id from list_layers).");
11998
- _chunk4S2AXNQFcjs.requireTypeLayer.call(void 0, controller.getLayers(), id);
11997
+ if (typeof id !== "string" || !id) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("layerId is required (a type layer id from list_layers).");
11998
+ _chunkHTAFDTNRcjs.requireTypeLayer.call(void 0, controller.getLayers(), id);
11999
11999
  return id;
12000
12000
  };
12001
12001
  const layerSummary = (id) => {
@@ -12075,7 +12075,7 @@ function createImageTypeTools(controller) {
12075
12075
  annotations: { title: "Style a range of text", ...WRITE_IDEMPOTENT6 },
12076
12076
  handler: (args) => {
12077
12077
  const style = pick2(args, Object.keys(STYLE));
12078
- if (!Object.keys(style).length) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)(`Give at least one style field: ${Object.keys(STYLE).join(", ")}.`);
12078
+ if (!Object.keys(style).length) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)(`Give at least one style field: ${Object.keys(STYLE).join(", ")}.`);
12079
12079
  return controller.setTextStyle(typeId(args.layerId), style, range(args));
12080
12080
  }
12081
12081
  };
@@ -12087,7 +12087,7 @@ function createImageTypeTools(controller) {
12087
12087
  annotations: { title: "Style paragraphs", ...WRITE_IDEMPOTENT6 },
12088
12088
  handler: (args) => {
12089
12089
  const style = pick2(args, Object.keys(PARAGRAPH));
12090
- if (!Object.keys(style).length) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)(`Give at least one paragraph field: ${Object.keys(PARAGRAPH).join(", ")}.`);
12090
+ if (!Object.keys(style).length) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)(`Give at least one paragraph field: ${Object.keys(PARAGRAPH).join(", ")}.`);
12091
12091
  return controller.setParagraphStyle(typeId(args.layerId), style, range(args));
12092
12092
  }
12093
12093
  };
@@ -12109,7 +12109,7 @@ function createImageTypeTools(controller) {
12109
12109
  annotations: { title: "Point or paragraph text", ...WRITE_IDEMPOTENT6 },
12110
12110
  handler: ({ layerId, kind, width, height }) => {
12111
12111
  const id = typeId(layerId);
12112
- if (kind === "box" && (width === void 0 || height === void 0)) throw new (0, _chunk4S2AXNQFcjs.LayerOperationError)("kind box needs width and height in pixels.");
12112
+ if (kind === "box" && (width === void 0 || height === void 0)) throw new (0, _chunkHTAFDTNRcjs.LayerOperationError)("kind box needs width and height in pixels.");
12113
12113
  return controller.setTextFrame(id, kind === "box" ? { kind: "box", width, height } : { kind: "point" });
12114
12114
  }
12115
12115
  };
@@ -12131,7 +12131,7 @@ function createImageTypeTools(controller) {
12131
12131
  var LAYER_PATH = /^layers\.([^.]+)\.(.+)$/;
12132
12132
  function adjustmentsSummary(adjustments) {
12133
12133
  return {
12134
- process: _chunk4S2AXNQFcjs.normalizeProcessVersion.call(void 0, adjustments.process),
12134
+ process: _chunkHTAFDTNRcjs.normalizeProcessVersion.call(void 0, adjustments.process),
12135
12135
  values: readAdjustmentControls(adjustments),
12136
12136
  layers: (_nullishCoalesce(adjustments.layers, () => ( []))).map((l) => JSON.parse(JSON.stringify(l)))
12137
12137
  };
@@ -12174,7 +12174,7 @@ function createImageEditorToolProvider(controller, options = {}) {
12174
12174
  default: def,
12175
12175
  ...requiresProcess ? { requiresProcess } : {}
12176
12176
  })),
12177
- layerKinds: _chunk4S2AXNQFcjs.ADJUSTMENT_KINDS.map(({ kind, label }) => ({
12177
+ layerKinds: _chunkHTAFDTNRcjs.ADJUSTMENT_KINDS.map(({ kind, label }) => ({
12178
12178
  kind,
12179
12179
  label,
12180
12180
  controls: [...ADJUSTMENT_LAYER_CONTROLS[kind], ADJUSTMENT_LAYER_OPACITY_CONTROL].map(({ id, label: l, min, max, step, default: def }) => ({
@@ -12260,7 +12260,7 @@ function createImageEditorToolProvider(controller, options = {}) {
12260
12260
  const result = { applied, clamped };
12261
12261
  if (typeof label === "string" && label) result.label = label;
12262
12262
  const notes = [];
12263
- if ("tint" in applied && _chunk4S2AXNQFcjs.normalizeProcessVersion.call(void 0, controller.getState().adjustments.process) < 2) {
12263
+ if ("tint" in applied && _chunkHTAFDTNRcjs.normalizeProcessVersion.call(void 0, controller.getState().adjustments.process) < 2) {
12264
12264
  notes.push("Tint has no effect on process 1 edits.");
12265
12265
  }
12266
12266
  if (notes.length) result.notes = notes;
@@ -12270,11 +12270,11 @@ function createImageEditorToolProvider(controller, options = {}) {
12270
12270
  const addLayer = {
12271
12271
  name: "add_adjustment_layer",
12272
12272
  title: "Add an adjustment layer",
12273
- description: "Adds a non-destructive adjustment layer on top of the stack (one undoable step) and returns it. Kinds: " + _chunk4S2AXNQFcjs.ADJUSTMENT_KINDS.map((k) => k.kind).join(", ") + ". Omitted params are neutral.",
12273
+ description: "Adds a non-destructive adjustment layer on top of the stack (one undoable step) and returns it. Kinds: " + _chunkHTAFDTNRcjs.ADJUSTMENT_KINDS.map((k) => k.kind).join(", ") + ". Omitted params are neutral.",
12274
12274
  inputSchema: {
12275
12275
  type: "object",
12276
12276
  properties: {
12277
- kind: { type: "string", enum: _chunk4S2AXNQFcjs.ADJUSTMENT_KINDS.map((k) => k.kind), description: "Adjustment kind." },
12277
+ kind: { type: "string", enum: _chunkHTAFDTNRcjs.ADJUSTMENT_KINDS.map((k) => k.kind), description: "Adjustment kind." },
12278
12278
  params: { type: "object", description: "Initial parameters (see list_controls); merged with neutral defaults." },
12279
12279
  opacity: { type: "number", minimum: 0, maximum: 1, description: "Layer opacity 0-1 (default 1)." },
12280
12280
  blend: { type: "string", enum: _chunk7ISPWEJAcjs.BLEND_MODES.map((m) => m.id), description: "Blend mode (default normal)." },
@@ -12293,7 +12293,7 @@ function createImageEditorToolProvider(controller, options = {}) {
12293
12293
  openWorldHint: false
12294
12294
  },
12295
12295
  handler: ({ kind, params, opacity, blend, name, aboveId, parentId }) => {
12296
- if (!_chunk4S2AXNQFcjs.isAdjustmentKind.call(void 0, kind)) throw new Error(`Unknown adjustment kind "${kind}".`);
12296
+ if (!_chunkHTAFDTNRcjs.isAdjustmentKind.call(void 0, kind)) throw new Error(`Unknown adjustment kind "${kind}".`);
12297
12297
  if (blend !== void 0 && !_chunk7ISPWEJAcjs.isBlendMode.call(void 0, blend)) throw new Error(`Unknown blend mode "${blend}".`);
12298
12298
  if (aboveId !== void 0 && parentId !== void 0) throw new Error("Give aboveId or parentId, not both.");
12299
12299
  for (const ref of [aboveId, parentId]) {
@@ -12387,7 +12387,7 @@ function boxToCurvePoint(x, y, width, height) {
12387
12387
  return { input: clampLevel(x / (width || 1) * 255), output: clampLevel((height - y) / (height || 1) * 255) };
12388
12388
  }
12389
12389
  function curveSvgPath(points, width, height, samples = 64) {
12390
- const lut = _chunk4S2AXNQFcjs.curveLutFromLevels.call(void 0, points);
12390
+ const lut = _chunkHTAFDTNRcjs.curveLutFromLevels.call(void 0, points);
12391
12391
  const n = lut.length - 1;
12392
12392
  let d = "";
12393
12393
  for (let i = 0; i <= samples; i++) {
@@ -12897,7 +12897,7 @@ var TextEditSession = (_class10 = class {
12897
12897
  else {
12898
12898
  const layout = this.layout();
12899
12899
  if (layout && layout.lines.length) {
12900
- const c = _chunkLI3KTY7Kcjs.caretAt.call(void 0, layout, f);
12900
+ const c = _chunkVYW7JBTMcjs.caretAt.call(void 0, layout, f);
12901
12901
  const line = layout.lines[c.line];
12902
12902
  if (to === "home") f = line.start;
12903
12903
  else if (to === "end") {
@@ -12992,7 +12992,7 @@ var TextEditSession = (_class10 = class {
12992
12992
  styleHere() {
12993
12993
  const layer = this.layer;
12994
12994
  const at = this.start > 0 && this.start === this.end ? this.start - 1 : this.start;
12995
- return _chunkLI3KTY7Kcjs.styleAt.call(void 0, layer.runs, at, _chunkLI3KTY7Kcjs.DEFAULT_TEXT_STYLE);
12995
+ return _chunkVYW7JBTMcjs.styleAt.call(void 0, layer.runs, at, _chunkVYW7JBTMcjs.DEFAULT_TEXT_STYLE);
12996
12996
  }
12997
12997
  info() {
12998
12998
  return this.controller.getTextLayer(this.layerId);
@@ -13001,8 +13001,8 @@ var TextEditSession = (_class10 = class {
13001
13001
  overlay() {
13002
13002
  const layer = this.layer;
13003
13003
  const layout = this.layout();
13004
- const m = _chunk4S2AXNQFcjs.textMatrix.call(void 0, layer);
13005
- const at = (x, y) => _chunkLI3KTY7Kcjs.applyMatrix.call(void 0, m, { x, y });
13004
+ const m = _chunkHTAFDTNRcjs.textMatrix.call(void 0, layer);
13005
+ const at = (x, y) => _chunkVYW7JBTMcjs.applyMatrix.call(void 0, m, { x, y });
13006
13006
  let frame = null;
13007
13007
  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)];
13008
13008
  else if (layout) {
@@ -13022,7 +13022,7 @@ var TextEditSession = (_class10 = class {
13022
13022
  selection.push([at(x0, top), at(x1, top), at(x1, bottom), at(x0, bottom)]);
13023
13023
  }
13024
13024
  }
13025
- const c = _chunkLI3KTY7Kcjs.caretAt.call(void 0, layout, this.focus);
13025
+ const c = _chunkVYW7JBTMcjs.caretAt.call(void 0, layout, this.focus);
13026
13026
  return { caret: [at(c.x, c.top), at(c.x, c.bottom)], selection, frame };
13027
13027
  }
13028
13028
  /** Ends editing: an empty layer made for this session is deleted (as Photoshop does). Returns whether the layer remains. */
@@ -13037,7 +13037,7 @@ var TextEditSession = (_class10 = class {
13037
13037
  }
13038
13038
  if (this.layer.name === "Text" && this.changed) {
13039
13039
  try {
13040
- this.controller.setLayerProperties(this.layerId, { name: _chunk4S2AXNQFcjs.typeLayerName.call(void 0, this.text) }, false);
13040
+ this.controller.setLayerProperties(this.layerId, { name: _chunkHTAFDTNRcjs.typeLayerName.call(void 0, this.text) }, false);
13041
13041
  } catch (e29) {
13042
13042
  }
13043
13043
  }
@@ -13048,8 +13048,8 @@ function typeLayerAt(controller, p, slop = 4) {
13048
13048
  const layers = [...flattenTypeLayers(controller.getLayers())].reverse();
13049
13049
  for (const l of layers) {
13050
13050
  if (!l.visible) continue;
13051
- const inv = invert(_chunk4S2AXNQFcjs.textMatrix.call(void 0, l));
13052
- const q = _chunkLI3KTY7Kcjs.applyMatrix.call(void 0, inv, p);
13051
+ const inv = invert(_chunkHTAFDTNRcjs.textMatrix.call(void 0, l));
13052
+ const q = _chunkVYW7JBTMcjs.applyMatrix.call(void 0, inv, p);
13053
13053
  let b = null;
13054
13054
  if (l.frame.kind === "box") b = { x: 0, y: 0, width: l.frame.width, height: l.frame.height };
13055
13055
  else {
@@ -13159,7 +13159,7 @@ function layerPanelRows(layers, activeId) {
13159
13159
  }
13160
13160
  function layerLabel(layer) {
13161
13161
  if (layer.name) return layer.name;
13162
- if (layer.type === "adjustment") return _chunk4S2AXNQFcjs.adjustmentKindLabel.call(void 0, layer.kind);
13162
+ if (layer.type === "adjustment") return _chunkHTAFDTNRcjs.adjustmentKindLabel.call(void 0, layer.kind);
13163
13163
  return layer.type === "group" ? "Group" : "Layer";
13164
13164
  }
13165
13165
  function layerBadge(layer) {
@@ -13631,7 +13631,7 @@ var FREE_TRANSFORM_MODE_OPTIONS = [
13631
13631
  ];
13632
13632
  var WARP_STYLE_OPTIONS = [
13633
13633
  { id: "custom", label: "Custom" },
13634
- ..._chunkLI3KTY7Kcjs.WARP_STYLES.map((id) => ({ id, label: _chunkLI3KTY7Kcjs.WARP_STYLE_LABELS[id] }))
13634
+ ..._chunkVYW7JBTMcjs.WARP_STYLES.map((id) => ({ id, label: _chunkVYW7JBTMcjs.WARP_STYLE_LABELS[id] }))
13635
13635
  ];
13636
13636
  var WARP_GRID_OPTIONS = [
13637
13637
  { id: "1x1", label: "Default", columns: 1, rows: 1 },
@@ -13767,7 +13767,7 @@ var FreeTransformTool = (_class12 = class {
13767
13767
  setMode(mode) {
13768
13768
  this.modeValue = mode;
13769
13769
  const s = this.session;
13770
- if (mode === "warp" && s && !this.mesh) this.mesh = _chunkLI3KTY7Kcjs.identityWarpMesh.call(void 0, s.box, this.warpSettings.columns, this.warpSettings.rows);
13770
+ if (mode === "warp" && s && !this.mesh) this.mesh = _chunkVYW7JBTMcjs.identityWarpMesh.call(void 0, s.box, this.warpSettings.columns, this.warpSettings.rows);
13771
13771
  this.changed();
13772
13772
  }
13773
13773
  /** The Warp options bar's settings. */
@@ -13789,13 +13789,13 @@ var FreeTransformTool = (_class12 = class {
13789
13789
  this.modeValue = "warp";
13790
13790
  const next = { ...this.warpSettings, ...changes };
13791
13791
  this.warpSettings = next;
13792
- let mesh = _nullishCoalesce(this.mesh, () => ( _chunkLI3KTY7Kcjs.identityWarpMesh.call(void 0, s.box, next.columns, next.rows)));
13792
+ let mesh = _nullishCoalesce(this.mesh, () => ( _chunkVYW7JBTMcjs.identityWarpMesh.call(void 0, s.box, next.columns, next.rows)));
13793
13793
  if (next.style !== "custom" && ("style" in changes || "bend" in changes || "horizontal" in changes || "vertical" in changes || "orientation" in changes)) {
13794
13794
  const preset = { style: next.style, bend: next.bend, horizontal: next.horizontal, vertical: next.vertical, orientation: next.orientation };
13795
- mesh = _nullishCoalesce(_chunkLI3KTY7Kcjs.warpPresetMesh.call(void 0, preset, s.box), () => ( _chunkLI3KTY7Kcjs.identityWarpMesh.call(void 0, s.box)));
13796
- mesh = _chunkLI3KTY7Kcjs.resizeWarpMesh.call(void 0, mesh, next.columns, next.rows);
13795
+ mesh = _nullishCoalesce(_chunkVYW7JBTMcjs.warpPresetMesh.call(void 0, preset, s.box), () => ( _chunkVYW7JBTMcjs.identityWarpMesh.call(void 0, s.box)));
13796
+ mesh = _chunkVYW7JBTMcjs.resizeWarpMesh.call(void 0, mesh, next.columns, next.rows);
13797
13797
  }
13798
- if ("columns" in changes || "rows" in changes) mesh = _chunkLI3KTY7Kcjs.resizeWarpMesh.call(void 0, mesh, next.columns, next.rows);
13798
+ if ("columns" in changes || "rows" in changes) mesh = _chunkVYW7JBTMcjs.resizeWarpMesh.call(void 0, mesh, next.columns, next.rows);
13799
13799
  this.mesh = mesh;
13800
13800
  this.changed();
13801
13801
  this.preview();
@@ -13842,11 +13842,11 @@ var FreeTransformTool = (_class12 = class {
13842
13842
  const m = this.mesh;
13843
13843
  const at = (p) => _nullishCoalesce(_chunkEJVDBITDcjs.applyHomography.call(void 0, h, p), () => ( p));
13844
13844
  const pts = m.points.map(at);
13845
- const edit = _chunkLI3KTY7Kcjs.warpMeshEditPoints.call(void 0, m);
13845
+ const edit = _chunkVYW7JBTMcjs.warpMeshEditPoints.call(void 0, m);
13846
13846
  out.handles = [];
13847
- out.outline = _chunkLI3KTY7Kcjs.warpMeshGridCurves.call(void 0, { ...m, points: pts }).length ? this.meshOutline(pts, m) : out.outline;
13847
+ out.outline = _chunkVYW7JBTMcjs.warpMeshGridCurves.call(void 0, { ...m, points: pts }).length ? this.meshOutline(pts, m) : out.outline;
13848
13848
  out.warp = {
13849
- curves: _chunkLI3KTY7Kcjs.warpMeshGridCurves.call(void 0, { ...m, points: pts }),
13849
+ curves: _chunkVYW7JBTMcjs.warpMeshGridCurves.call(void 0, { ...m, points: pts }),
13850
13850
  anchors: edit.anchors.map((i) => pts[i]),
13851
13851
  handles: edit.handles.map((e) => ({ point: pts[e.index], anchor: pts[e.anchor] }))
13852
13852
  };
@@ -13870,7 +13870,7 @@ var FreeTransformTool = (_class12 = class {
13870
13870
  if (!o) return null;
13871
13871
  if (this.modeValue === "warp" && this.mesh) {
13872
13872
  const h = this.homography();
13873
- const edit = _chunkLI3KTY7Kcjs.warpMeshEditPoints.call(void 0, this.mesh);
13873
+ const edit = _chunkVYW7JBTMcjs.warpMeshEditPoints.call(void 0, this.mesh);
13874
13874
  let best2 = -1;
13875
13875
  let bestD2 = tolerance;
13876
13876
  for (const i of [...edit.anchors, ...edit.handles.map((e) => e.index)]) {
@@ -13915,7 +13915,7 @@ var FreeTransformTool = (_class12 = class {
13915
13915
  if (this.modeValue === "warp" && this.mesh && handle === "inside") {
13916
13916
  const q = this.toFrame(p, this.corners);
13917
13917
  if (q) {
13918
- const r = _chunkLI3KTY7Kcjs.warpMeshParamAt.call(void 0, this.mesh, q);
13918
+ const r = _chunkVYW7JBTMcjs.warpMeshParamAt.call(void 0, this.mesh, q);
13919
13919
  st = { s: r.s, t: r.t };
13920
13920
  }
13921
13921
  }
@@ -13948,8 +13948,8 @@ var FreeTransformTool = (_class12 = class {
13948
13948
  if (!a || !b) return;
13949
13949
  const delta = { x: b.x - a.x, y: b.y - a.y };
13950
13950
  const i = meshIndex(d.handle);
13951
- if (i >= 0) this.mesh = _chunkLI3KTY7Kcjs.dragWarpMeshPoint.call(void 0, d.mesh, i, delta);
13952
- else if (d.handle === "inside" && d.st) this.mesh = _chunkLI3KTY7Kcjs.pullWarpMesh.call(void 0, d.mesh, d.st.s, d.st.t, delta);
13951
+ if (i >= 0) this.mesh = _chunkVYW7JBTMcjs.dragWarpMeshPoint.call(void 0, d.mesh, i, delta);
13952
+ else if (d.handle === "inside" && d.st) this.mesh = _chunkVYW7JBTMcjs.pullWarpMesh.call(void 0, d.mesh, d.st.s, d.st.t, delta);
13953
13953
  else return;
13954
13954
  this.warpSettings = { ...this.warpSettings, style: "custom" };
13955
13955
  this.changed();
@@ -14073,7 +14073,7 @@ var FreeTransformTool = (_class12 = class {
14073
14073
  bar() {
14074
14074
  const s = this.session;
14075
14075
  if (!s || !this.corners) return null;
14076
- const read = _chunk4S2AXNQFcjs.describeTransform.call(void 0, { box: s.box, corners: this.corners }, this.refBox);
14076
+ const read = _chunkHTAFDTNRcjs.describeTransform.call(void 0, { box: s.box, corners: this.corners }, this.refBox);
14077
14077
  return {
14078
14078
  affine: read.affine,
14079
14079
  x: _nullishCoalesce(this.typed.x, () => ( read.x)),
@@ -14098,7 +14098,7 @@ var FreeTransformTool = (_class12 = class {
14098
14098
  this.changed();
14099
14099
  return;
14100
14100
  }
14101
- const m = _chunk4S2AXNQFcjs.matrixFromParams.call(void 0, s.box, {
14101
+ const m = _chunkHTAFDTNRcjs.matrixFromParams.call(void 0, s.box, {
14102
14102
  scaleX: next.scaleX,
14103
14103
  scaleY: next.scaleY,
14104
14104
  rotate: next.rotate,
@@ -14108,7 +14108,7 @@ var FreeTransformTool = (_class12 = class {
14108
14108
  dx: next.x - this.refBox.x,
14109
14109
  dy: next.y - this.refBox.y
14110
14110
  });
14111
- this.setCorners(_chunk4S2AXNQFcjs.cornersFromMatrix.call(void 0, s.box, m));
14111
+ this.setCorners(_chunkHTAFDTNRcjs.cornersFromMatrix.call(void 0, s.box, m));
14112
14112
  this.typed = { scaleX: next.scaleX, scaleY: next.scaleY, rotate: next.rotate, skewX: next.skewX, skewY: next.skewY, x: next.x, y: next.y };
14113
14113
  this.changed();
14114
14114
  }
@@ -15031,5 +15031,5 @@ var FreeTransformTool = (_class12 = class {
15031
15031
 
15032
15032
 
15033
15033
 
15034
- exports.ADJUSTMENT_KEYS = _chunk4S2AXNQFcjs.ADJUSTMENT_KEYS; exports.ADJUSTMENT_KINDS = _chunk4S2AXNQFcjs.ADJUSTMENT_KINDS; exports.ADJUSTMENT_LAYER_CONTROLS = ADJUSTMENT_LAYER_CONTROLS; exports.ADJUSTMENT_LAYER_OPACITY_CONTROL = ADJUSTMENT_LAYER_OPACITY_CONTROL; exports.ADJUSTMENT_LUT_SIZE = _chunk4S2AXNQFcjs.ADJUSTMENT_LUT_SIZE; exports.AS_SHOT_KELVIN = _chunk4S2AXNQFcjs.AS_SHOT_KELVIN; exports.BACKGROUND_LAYER_ID = _chunk4S2AXNQFcjs.BACKGROUND_LAYER_ID; exports.BACKGROUND_LAYER_NAME = _chunk4S2AXNQFcjs.BACKGROUND_LAYER_NAME; exports.BIT_DEPTHS = _chunk7ISPWEJAcjs.BIT_DEPTHS; exports.BIT_DEPTH_OPTIONS = BIT_DEPTH_OPTIONS; exports.BLEND_MODES = _chunk7ISPWEJAcjs.BLEND_MODES; exports.BLUR_FILTER_ID = _chunk4S2AXNQFcjs.BLUR_FILTER_ID; exports.BODY_SCATTER = _chunkL3PXFMOFcjs.BODY_SCATTER; exports.BRUSH_OPTION_CONTROLS = BRUSH_OPTION_CONTROLS; exports.BUILTIN_PROFILES = _chunkG5NMLUVFcjs.BUILTIN_PROFILES; exports.COLOR_MODE_OPTIONS = COLOR_MODE_OPTIONS; exports.CoverageMap = _chunkL3PXFMOFcjs.CoverageMap; exports.D50 = _chunk4S2AXNQFcjs.D50; exports.D65 = _chunk4S2AXNQFcjs.D65; exports.DEFAULT_ADJUSTMENTS = DEFAULT_ADJUSTMENTS; exports.DEFAULT_AUTO_LEADING = _chunkLI3KTY7Kcjs.DEFAULT_AUTO_LEADING; exports.DEFAULT_BLENDER = _chunkL3PXFMOFcjs.DEFAULT_BLENDER; exports.DEFAULT_BRUSH = _chunkL3PXFMOFcjs.DEFAULT_BRUSH; exports.DEFAULT_DEPTH_MASK = DEFAULT_DEPTH_MASK; exports.DEFAULT_FLOW = _chunkL3PXFMOFcjs.DEFAULT_FLOW; exports.DEFAULT_GLOBAL_LIGHT = _chunkWMRIG4XQcjs.DEFAULT_GLOBAL_LIGHT; exports.DEFAULT_MITER_LIMIT = _chunk4S2AXNQFcjs.DEFAULT_MITER_LIMIT; exports.DEFAULT_MIXER = _chunkL3PXFMOFcjs.DEFAULT_MIXER; exports.DEFAULT_PROOF = DEFAULT_PROOF; exports.DEFAULT_REFINE_EDGE_PARAMS = DEFAULT_REFINE_EDGE_PARAMS; exports.DEFAULT_RETOUCH = _chunkTS5IEUW6cjs.DEFAULT_RETOUCH; exports.DEFAULT_SELECTION_TOOL_OPTIONS = DEFAULT_SELECTION_TOOL_OPTIONS; exports.DEFAULT_SHAPE_TOOL_OPTIONS = DEFAULT_SHAPE_TOOL_OPTIONS; exports.DEFAULT_SMUDGE = _chunkL3PXFMOFcjs.DEFAULT_SMUDGE; exports.DEFAULT_TEXT_STYLE = _chunkLI3KTY7Kcjs.DEFAULT_TEXT_STYLE; exports.DEFAULT_TRANSFORM = DEFAULT_TRANSFORM; exports.DEFAULT_TYPE_TOOL_OPTIONS = DEFAULT_TYPE_TOOL_OPTIONS; exports.DEFAULT_WET_PAPER = _chunkL3PXFMOFcjs.DEFAULT_WET_PAPER; exports.DEFAULT_WET_PARAMS = _chunkL3PXFMOFcjs.DEFAULT_WET_PARAMS; exports.DEPTH_MASK_CONTROLS = DEPTH_MASK_CONTROLS; exports.DEVELOP_FILTER_ID = _chunk4S2AXNQFcjs.DEVELOP_FILTER_ID; exports.DIRECT_GAUSSIAN_MAX_SIGMA = _chunkWMRIG4XQcjs.DIRECT_GAUSSIAN_MAX_SIGMA; exports.DRY_EPS = _chunkL3PXFMOFcjs.DRY_EPS; exports.DabWalker = _chunkL3PXFMOFcjs.DabWalker; exports.EMPTY_DISTANCE = _chunk4S2AXNQFcjs.EMPTY_DISTANCE; exports.EMPTY_MIXER_LOAD = _chunkL3PXFMOFcjs.EMPTY_MIXER_LOAD; exports.EX = _chunkL3PXFMOFcjs.EX; exports.EY = _chunkL3PXFMOFcjs.EY; exports.FLAG_ALIVE = _chunkL3PXFMOFcjs.FLAG_ALIVE; exports.FLAG_BOTTOM = _chunkL3PXFMOFcjs.FLAG_BOTTOM; exports.FLAG_LEFT = _chunkL3PXFMOFcjs.FLAG_LEFT; exports.FLAG_RIGHT = _chunkL3PXFMOFcjs.FLAG_RIGHT; exports.FLAG_TOP = _chunkL3PXFMOFcjs.FLAG_TOP; exports.FLAG_WET = _chunkL3PXFMOFcjs.FLAG_WET; exports.FLAT = _chunkL3PXFMOFcjs.FLAT; exports.FREE_INTERVAL = _chunkL3PXFMOFcjs.FREE_INTERVAL; exports.FREE_TRANSFORM_CONTENTS = FREE_TRANSFORM_CONTENTS; exports.FREE_TRANSFORM_FIELDS = FREE_TRANSFORM_FIELDS; exports.FREE_TRANSFORM_MODES = _chunk4S2AXNQFcjs.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 = _chunkL3PXFMOFcjs.HIDE; exports.HISTOGRAM_BINS = HISTOGRAM_BINS; exports.HUE_RANGE_LABELS = _chunk4S2AXNQFcjs.HUE_RANGE_LABELS; exports.IDENTITY_MATRIX3 = _chunk4S2AXNQFcjs.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_FILTER_PRESETS = IMAGE_FILTER_PRESETS; exports.INTENTS = _chunkG5NMLUVFcjs.INTENTS; exports.INTENT_OPTIONS = INTENT_OPTIONS; exports.INTERPOLATIONS = _chunkWMRIG4XQcjs.INTERPOLATIONS; exports.ImageEditorController = ImageEditorController; exports.ImageEditorRenderer = ImageEditorRenderer; exports.LATEST_PROCESS_VERSION = _chunk4S2AXNQFcjs.LATEST_PROCESS_VERSION; exports.LAYERED_SCHEMA_VERSION = _chunk4S2AXNQFcjs.LAYERED_SCHEMA_VERSION; exports.LAYER_EFFECT_KINDS = _chunkWMRIG4XQcjs.LAYER_EFFECT_KINDS; exports.LAYER_EFFECT_MENU = LAYER_EFFECT_MENU; exports.LEGACY_PROCESS_VERSION = _chunk4S2AXNQFcjs.LEGACY_PROCESS_VERSION; exports.LIVE_SHAPE_KINDS = _chunk4S2AXNQFcjs.LIVE_SHAPE_KINDS; exports.LUMA_709 = _chunk4S2AXNQFcjs.LUMA_709; exports.LayerCompositor = _chunk4S2AXNQFcjs.LayerCompositor; exports.LayerEffectError = _chunkWMRIG4XQcjs.LayerEffectError; exports.LayerOperationError = _chunk4S2AXNQFcjs.LayerOperationError; exports.MAX_BATCH = _chunkL3PXFMOFcjs.MAX_BATCH; exports.MAX_BRUSH_SIZE = _chunkL3PXFMOFcjs.MAX_BRUSH_SIZE; exports.MAX_EFFECT_REACH = _chunkWMRIG4XQcjs.MAX_EFFECT_REACH; exports.MAX_KELVIN = _chunk4S2AXNQFcjs.MAX_KELVIN; exports.MAX_TILT_ACCEL = _chunkL3PXFMOFcjs.MAX_TILT_ACCEL; exports.MAX_TRANSFORM_PIXELS = _chunkWMRIG4XQcjs.MAX_TRANSFORM_PIXELS; exports.MAX_WET_LANES = _chunkL3PXFMOFcjs.MAX_WET_LANES; exports.MAX_WET_SLOTS = _chunkL3PXFMOFcjs.MAX_WET_SLOTS; exports.MIN_KELVIN = _chunk4S2AXNQFcjs.MIN_KELVIN; exports.MIRED_PER_TEMPERATURE_UNIT = _chunk4S2AXNQFcjs.MIRED_PER_TEMPERATURE_UNIT; exports.MIXER_DRAIN = _chunkL3PXFMOFcjs.MIXER_DRAIN; exports.MIXER_MIXING_OPTIONS = MIXER_MIXING_OPTIONS; exports.MIXER_OPTION_CONTROLS = MIXER_OPTION_CONTROLS; exports.MIXER_PICKUP_RATE = _chunkL3PXFMOFcjs.MIXER_PICKUP_RATE; exports.MIXING_MODELS = _chunkL3PXFMOFcjs.MIXING_MODELS; exports.MixerStroke = _chunkL3PXFMOFcjs.MixerStroke; exports.OPP = _chunkL3PXFMOFcjs.OPP; exports.PAINTERLY_BLEND_MODES = _chunk7ISPWEJAcjs.PAINTERLY_BLEND_MODES; exports.PAINT_TOOLS = PAINT_TOOLS; exports.PAPER_CAPACITY = _chunkL3PXFMOFcjs.PAPER_CAPACITY; exports.PARAGRAPH_STYLE_FIELDS = _chunk4S2AXNQFcjs.PARAGRAPH_STYLE_FIELDS; exports.PARAM = _chunkL3PXFMOFcjs.PARAM; exports.PARAM_FLOATS = _chunkL3PXFMOFcjs.PARAM_FLOATS; exports.PATTERN_BLOCK_KEYS = _chunk4S2AXNQFcjs.PATTERN_BLOCK_KEYS; exports.PIGMENT_BANDS = _chunk7ISPWEJAcjs.PIGMENT_BANDS; exports.PIGMENT_CHANNELS = _chunkL3PXFMOFcjs.PIGMENT_CHANNELS; exports.PIGMENT_LAMBDA_MIN = _chunk7ISPWEJAcjs.PIGMENT_LAMBDA_MIN; exports.PIGMENT_LAMBDA_STEP = _chunk7ISPWEJAcjs.PIGMENT_LAMBDA_STEP; exports.PIGMENT_UNIT = _chunkL3PXFMOFcjs.PIGMENT_UNIT; exports.PIGMENT_WAVELENGTHS = _chunk7ISPWEJAcjs.PIGMENT_WAVELENGTHS; exports.PLANE = _chunkL3PXFMOFcjs.PLANE; exports.PLANE_BYTES = _chunkL3PXFMOFcjs.PLANE_BYTES; exports.PROOF_PROFILE_OPTIONS = PROOF_PROFILE_OPTIONS; exports.PSD_BLEND_KEYS = _chunk4S2AXNQFcjs.PSD_BLEND_KEYS; exports.PSD_FILE_ACCEPT = PSD_FILE_ACCEPT; exports.P_D0 = _chunkL3PXFMOFcjs.P_D0; exports.P_EDGE = _chunkL3PXFMOFcjs.P_EDGE; exports.P_FX = _chunkL3PXFMOFcjs.P_FX; exports.P_FY = _chunkL3PXFMOFcjs.P_FY; exports.P_H = _chunkL3PXFMOFcjs.P_H; exports.P_P0 = _chunkL3PXFMOFcjs.P_P0; exports.P_RHO = _chunkL3PXFMOFcjs.P_RHO; exports.P_SW = _chunkL3PXFMOFcjs.P_SW; exports.P_UX = _chunkL3PXFMOFcjs.P_UX; exports.P_UY = _chunkL3PXFMOFcjs.P_UY; exports.PaintExchange = _chunkL3PXFMOFcjs.PaintExchange; exports.PaintGesture = PaintGesture; exports.PaintStrokeSession = PaintStrokeSession; exports.PatternPlacement = _chunkWMRIG4XQcjs.PatternPlacement; exports.PatternTile = _chunkWMRIG4XQcjs.PatternTile; exports.PsdError = _chunk4S2AXNQFcjs.PsdError; exports.REFINE_EDGE_CONTROLS = REFINE_EDGE_CONTROLS; exports.RETOUCH_CHOICES = RETOUCH_CHOICES; exports.RETOUCH_OPTION_CONTROLS = RETOUCH_OPTION_CONTROLS; exports.RETOUCH_SAMPLES = _chunkTS5IEUW6cjs.RETOUCH_SAMPLES; exports.RETOUCH_TOGGLES = RETOUCH_TOGGLES; exports.RETOUCH_TOOLS = RETOUCH_TOOLS; exports.RegionPixelSource = _chunkTS5IEUW6cjs.RegionPixelSource; exports.RetouchDabStroke = _chunkTS5IEUW6cjs.RetouchDabStroke; exports.SELECTION_MODES = _chunk4S2AXNQFcjs.SELECTION_MODES; exports.SELECTION_MODE_LABELS = SELECTION_MODE_LABELS; exports.SELECTION_MODIFY_OPS = _chunk4S2AXNQFcjs.SELECTION_MODIFY_OPS; exports.SELECTION_TOOLS = SELECTION_TOOLS; exports.SET_PLANES = _chunkL3PXFMOFcjs.SET_PLANES; exports.SHADOW_AMBIENT = _chunk7ISPWEJAcjs.SHADOW_AMBIENT; exports.SHAPE_KIND_LABELS = SHAPE_KIND_LABELS; exports.SHAPE_OPERATIONS = _chunk4S2AXNQFcjs.SHAPE_OPERATIONS; exports.SHAPE_RENDER_MARGIN = _chunk4S2AXNQFcjs.SHAPE_RENDER_MARGIN; exports.SLOT_BYTES = _chunkL3PXFMOFcjs.SLOT_BYTES; exports.SLOT_PLANES = _chunkL3PXFMOFcjs.SLOT_PLANES; exports.SLOT_SIDE = _chunkL3PXFMOFcjs.SLOT_SIDE; exports.SMART_RENDER_MARGIN = _chunk4S2AXNQFcjs.SMART_RENDER_MARGIN; exports.SPOT_HEAL_TYPES = _chunkTS5IEUW6cjs.SPOT_HEAL_TYPES; exports.SRGB_TO_LINEAR = _chunkL3PXFMOFcjs.SRGB_TO_LINEAR; exports.STRIP = _chunkL3PXFMOFcjs.STRIP; exports.SUPPORTED_ADJUSTMENT_KEYS = _chunk4S2AXNQFcjs.SUPPORTED_ADJUSTMENT_KEYS; exports.SelectionGesture = SelectionGesture; exports.ShapeDrawGesture = ShapeDrawGesture; exports.SmudgeTip = _chunkL3PXFMOFcjs.SmudgeTip; exports.StrokeCoverage = _chunkL3PXFMOFcjs.StrokeCoverage; exports.SurfaceDraft = _chunk7ISPWEJAcjs.SurfaceDraft; exports.TEXT_ALIGNS = _chunk4S2AXNQFcjs.TEXT_ALIGNS; exports.TEXT_RENDER_MARGIN = _chunk4S2AXNQFcjs.TEXT_RENDER_MARGIN; exports.TEXT_STYLE_FIELDS = _chunk4S2AXNQFcjs.TEXT_STYLE_FIELDS; exports.TILE = _chunk7ISPWEJAcjs.TILE; exports.TILE_SHIFT = _chunk7ISPWEJAcjs.TILE_SHIFT; exports.TINT_SCALE = _chunk4S2AXNQFcjs.TINT_SCALE; exports.TONE_LUT_SIZE = _chunk4S2AXNQFcjs.TONE_LUT_SIZE; exports.TONE_RANGES = _chunkTS5IEUW6cjs.TONE_RANGES; exports.TONE_RANGE_PRESETS = TONE_RANGE_PRESETS; exports.TRANSFORM_ANCHORS = _chunk4S2AXNQFcjs.TRANSFORM_ANCHORS; exports.TextEditSession = TextEditSession; exports.TileMedium = _chunkL3PXFMOFcjs.TileMedium; exports.TilePixelSource = _chunkTS5IEUW6cjs.TilePixelSource; exports.TiledSurface = _chunk7ISPWEJAcjs.TiledSurface; exports.TransformTooLargeError = _chunkWMRIG4XQcjs.TransformTooLargeError; exports.TypeToolGesture = TypeToolGesture; exports.U_MAX = _chunkL3PXFMOFcjs.U_MAX; exports.VIBRANCE_GREY = _chunk4S2AXNQFcjs.VIBRANCE_GREY; exports.W9 = _chunkL3PXFMOFcjs.W9; exports.WARP_GRID_OPTIONS = WARP_GRID_OPTIONS; exports.WARP_STYLES = _chunkLI3KTY7Kcjs.WARP_STYLES; exports.WARP_STYLE_LABELS = _chunkLI3KTY7Kcjs.WARP_STYLE_LABELS; exports.WARP_STYLE_OPTIONS = WARP_STYLE_OPTIONS; exports.WET_FLOW_KINDS = _chunkL3PXFMOFcjs.WET_FLOW_KINDS; exports.WET_PARAM_KEYS = _chunkL3PXFMOFcjs.WET_PARAM_KEYS; exports.WET_TILE = _chunkL3PXFMOFcjs.WET_TILE; exports.WORKING_SPACE_OPTIONS = WORKING_SPACE_OPTIONS; exports.WetMedium = _chunkL3PXFMOFcjs.WetMedium; exports.WetWorkerPool = _chunkL3PXFMOFcjs.WetWorkerPool; exports.WetWorld = _chunkL3PXFMOFcjs.WetWorld; exports.WetWorldError = _chunkL3PXFMOFcjs.WetWorldError; exports.XYZ_D50_TO_SRGB = _chunk4S2AXNQFcjs.XYZ_D50_TO_SRGB; exports.ZlibError = _chunk643B2HKCcjs.ZlibError; exports.activeAdjustmentLayers = _chunk4S2AXNQFcjs.activeAdjustmentLayers; exports.activeSmartFilters = _chunk4S2AXNQFcjs.activeSmartFilters; exports.addLayerEffect = _chunk4S2AXNQFcjs.addLayerEffect; exports.addLayerFilter = _chunk4S2AXNQFcjs.addLayerFilter; exports.addSmartFilter = _chunk4S2AXNQFcjs.addSmartFilter; exports.addToHistogram = addToHistogram; exports.adjustmentKindLabel = _chunk4S2AXNQFcjs.adjustmentKindLabel; exports.adjustmentLayersKey = _chunk4S2AXNQFcjs.adjustmentLayersKey; exports.adjustmentNodeAsLayer = _chunk4S2AXNQFcjs.adjustmentNodeAsLayer; exports.adjustmentNodeFromLegacy = _chunk4S2AXNQFcjs.adjustmentNodeFromLegacy; exports.adler32 = _chunk643B2HKCcjs.adler32; exports.anchorPoint = _chunk4S2AXNQFcjs.anchorPoint; exports.annotationBlend = _chunk4S2AXNQFcjs.annotationBlend; exports.annotationLayerFor = _chunk4S2AXNQFcjs.annotationLayerFor; exports.annotationLayerName = _chunk4S2AXNQFcjs.annotationLayerName; exports.annotationOfLayer = _chunk4S2AXNQFcjs.annotationOfLayer; exports.annotationOfShape = _chunk4S2AXNQFcjs.annotationOfShape; exports.annotationOfType = _chunk4S2AXNQFcjs.annotationOfType; exports.applyAdjustmentLayers = _chunk4S2AXNQFcjs.applyAdjustmentLayers; exports.applyAdjustmentLayersFloat = _chunk4S2AXNQFcjs.applyAdjustmentLayersFloat; exports.applyAdjustments = _chunk4S2AXNQFcjs.applyAdjustments; exports.applyBoxBlur = _chunk4S2AXNQFcjs.applyBoxBlur; exports.applyDepthMask = _chunk4S2AXNQFcjs.applyDepthMask; exports.applyHomography = _chunkEJVDBITDcjs.applyHomography; exports.applyImageProjectionToContext = _chunk4S2AXNQFcjs.applyImageProjectionToContext; exports.applyLegacyAdjustments = _chunk4S2AXNQFcjs.applyLegacyAdjustments; exports.applyMatrix3 = _chunk4S2AXNQFcjs.applyMatrix3; exports.applyOutputStage = applyOutputStage; exports.applyParams = _chunk4S2AXNQFcjs.applyParams; exports.applyProcess2Adjustments = _chunk4S2AXNQFcjs.applyProcess2Adjustments; exports.applyRegionBlur = applyRegionBlur; exports.applyRegionMosaic = applyRegionMosaic; exports.applyRetouchToTile = _chunkTS5IEUW6cjs.applyRetouchToTile; exports.applyShapeOptions = applyShapeOptions; exports.applySmartFilters = _chunk4S2AXNQFcjs.applySmartFilters; exports.applyStrokeToDeepTile = _chunkL3PXFMOFcjs.applyStrokeToDeepTile; exports.applyStrokeToTile = _chunkL3PXFMOFcjs.applyStrokeToTile; exports.applyToneToDeepTile = _chunkTS5IEUW6cjs.applyToneToDeepTile; exports.backgroundLayer = _chunk4S2AXNQFcjs.backgroundLayer; exports.base64ToBytes = _chunkEJVDBITDcjs.base64ToBytes; exports.baseProjection = baseProjection; exports.bestOffset = _chunkTS5IEUW6cjs.bestOffset; exports.blackWhiteGray = _chunk4S2AXNQFcjs.blackWhiteGray; exports.blendChannel = _chunk7ISPWEJAcjs.blendChannel; exports.blendImageData = _chunk7ISPWEJAcjs.blendImageData; exports.blendLum = _chunk7ISPWEJAcjs.blendLum; exports.blendPixel = _chunk7ISPWEJAcjs.blendPixel; exports.blendRadius = _chunkL3PXFMOFcjs.blendRadius; exports.blendRgb = _chunk7ISPWEJAcjs.blendRgb; exports.blendTile = _chunkWMRIG4XQcjs.blendTile; exports.blenderDab = _chunkL3PXFMOFcjs.blenderDab; exports.blurFilter = _chunk4S2AXNQFcjs.blurFilter; exports.borderCoverage = _chunk4S2AXNQFcjs.borderCoverage; exports.boxMean = boxMean; exports.boxPointOf = _chunk4S2AXNQFcjs.boxPointOf; exports.boxQuad = _chunkEJVDBITDcjs.boxQuad; exports.boxToCurvePoint = boxToCurvePoint; exports.bradfordAdaptation = _chunk4S2AXNQFcjs.bradfordAdaptation; exports.buildLayerMaskPlanes = _chunk4S2AXNQFcjs.buildLayerMaskPlanes; exports.buildToneLut = _chunk4S2AXNQFcjs.buildToneLut; exports.builtinPattern = _chunkWMRIG4XQcjs.builtinPattern; exports.builtinPatternIds = _chunkWMRIG4XQcjs.builtinPatternIds; exports.bytesToBase64 = _chunkEJVDBITDcjs.bytesToBase64; exports.calculateCropDrag = _chunk4S2AXNQFcjs.calculateCropDrag; exports.canShareMemory = _chunkL3PXFMOFcjs.canShareMemory; exports.canvasCompositeOperation = _chunk7ISPWEJAcjs.canvasCompositeOperation; exports.canvasToImagePoint = _chunk4S2AXNQFcjs.canvasToImagePoint; exports.caretAt = _chunkLI3KTY7Kcjs.caretAt; exports.changedTiles = _chunkWMRIG4XQcjs.changedTiles; exports.clampControlValue = clampControlValue; exports.clampCropToImage = _chunk4S2AXNQFcjs.clampCropToImage; exports.cleanMixer = _chunkL3PXFMOFcjs.cleanMixer; exports.cloneSourceLabel = cloneSourceLabel; exports.collectTiles = _chunk7ISPWEJAcjs.collectTiles; exports.colorBalanceChannel = _chunk4S2AXNQFcjs.colorBalanceChannel; exports.colorModePlanes = colorModePlanes; exports.colorPanelView = colorPanelView; exports.colorRange = colorRange; exports.combineSelections = _chunk4S2AXNQFcjs.combineSelections; exports.compileAdjustmentLayer = _chunk4S2AXNQFcjs.compileAdjustmentLayer; exports.componentPath = _chunk4S2AXNQFcjs.componentPath; exports.compositeDeep = _chunk4S2AXNQFcjs.compositeDeep; exports.compositeSurfaceOver = _chunkWMRIG4XQcjs.compositeSurfaceOver; exports.computeHistogram = computeHistogram; exports.computeSelectionBounds = _chunk4S2AXNQFcjs.computeSelectionBounds; exports.contentBounds = _chunk7ISPWEJAcjs.contentBounds; exports.contentsBox = _chunk4S2AXNQFcjs.contentsBox; exports.contentsSurface = _chunk4S2AXNQFcjs.contentsSurface; exports.contractCoverage = _chunk4S2AXNQFcjs.contractCoverage; exports.controlPosition = controlPosition; exports.controlTrackBackground = controlTrackBackground; exports.convertHex = convertHex; exports.convertSurfaceColors = convertSurfaceColors; exports.convertSurfaceDepth = _chunk7ISPWEJAcjs.convertSurfaceDepth; exports.convertToSmartObject = _chunk4S2AXNQFcjs.convertToSmartObject; exports.copySmartObject = _chunk4S2AXNQFcjs.copySmartObject; exports.cornersFromMatrix = _chunk4S2AXNQFcjs.cornersFromMatrix; exports.coverageTileCoord = _chunkL3PXFMOFcjs.coverageTileCoord; exports.coverageToByte = _chunk4S2AXNQFcjs.coverageToByte; exports.coveringRect = coveringRect; exports.createAdjustmentLayer = _chunk4S2AXNQFcjs.createAdjustmentLayer; exports.createBlenderScratch = _chunkL3PXFMOFcjs.createBlenderScratch; exports.createCanvasTextShaper = _chunkLI3KTY7Kcjs.createCanvasTextShaper; exports.createImageCaptureSurface = createImageCaptureSurface; exports.createImageColorTools = createImageColorTools; exports.createImageEditTools = createImageEditTools; exports.createImageEditorToolProvider = createImageEditorToolProvider; exports.createImageEffectTools = createImageEffectTools; 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 = _chunkLI3KTY7Kcjs.createMetricTextShaper; exports.createOutlineTextShaper = _chunkLI3KTY7Kcjs.createOutlineTextShaper; exports.createPigment = _chunk7ISPWEJAcjs.createPigment; exports.createPigmentTools = _chunkL3PXFMOFcjs.createPigmentTools; exports.createSelectionMask = _chunk4S2AXNQFcjs.createSelectionMask; exports.createShapeLayer = _chunk4S2AXNQFcjs.createShapeLayer; exports.createTypeLayer = _chunk4S2AXNQFcjs.createTypeLayer; exports.cssFont = _chunkLI3KTY7Kcjs.cssFont; exports.cssFontFamily = _chunkLI3KTY7Kcjs.cssFontFamily; exports.curveLut = _chunkWMRIG4XQcjs.curveLut; exports.curveLutFromLevels = _chunk4S2AXNQFcjs.curveLutFromLevels; exports.curvePointToBox = curvePointToBox; exports.curveSvgPath = curveSvgPath; exports.dabCoverage = _chunkL3PXFMOFcjs.dabCoverage; exports.dabRect = _chunkL3PXFMOFcjs.dabRect; exports.decodeDeepSurface = _chunk4S2AXNQFcjs.decodeDeepSurface; exports.decodeLayerChannel = _chunk4S2AXNQFcjs.decodeLayerChannel; exports.decodeLayerMask = _chunk4S2AXNQFcjs.decodeLayerMask; exports.decodeMergedImage = _chunk4S2AXNQFcjs.decodeMergedImage; exports.decodePlanes = _chunk4S2AXNQFcjs.decodePlanes; exports.decodePng = _chunkEJVDBITDcjs.decodePng; exports.decodePngDataUrl = _chunk4S2AXNQFcjs.decodePngDataUrl; exports.decodeSelectionRle = _chunk4S2AXNQFcjs.decodeSelectionRle; exports.deepBytes = _chunk7ISPWEJAcjs.deepBytes; exports.deepTile = _chunk7ISPWEJAcjs.deepTile; exports.defaultAdjustmentParams = _chunk4S2AXNQFcjs.defaultAdjustmentParams; exports.defaultEffectGradient = _chunkWMRIG4XQcjs.defaultEffectGradient; exports.defaultLayerEffect = _chunkWMRIG4XQcjs.defaultLayerEffect; exports.defaultShapeName = _chunk4S2AXNQFcjs.defaultShapeName; exports.deflate = _chunk643B2HKCcjs.deflate; exports.deflateRaw = _chunk643B2HKCcjs.deflateRaw; exports.depthMaskAlpha = _chunk4S2AXNQFcjs.depthMaskAlpha; exports.depthOf = _chunk7ISPWEJAcjs.depthOf; exports.depthRasterMask = _chunk4S2AXNQFcjs.depthRasterMask; exports.describeLayer = describeLayer; exports.describeLayerEffects = describeLayerEffects; exports.describeSelection = describeSelection; exports.describeTransform = _chunk4S2AXNQFcjs.describeTransform; exports.deserializeColorMode = deserializeColorMode; exports.deserializeColorProfile = deserializeColorProfile; exports.deserializeEffects = _chunk4S2AXNQFcjs.deserializeEffects; exports.deserializeLayer = _chunk4S2AXNQFcjs.deserializeLayer; exports.deserializeLayers = _chunk4S2AXNQFcjs.deserializeLayers; exports.deserializePatterns = _chunk4S2AXNQFcjs.deserializePatterns; exports.deserializeSelection = _chunk4S2AXNQFcjs.deserializeSelection; exports.developFilter = _chunk4S2AXNQFcjs.developFilter; exports.developFromAdjustments = _chunk4S2AXNQFcjs.developFromAdjustments; exports.developTarget = _chunk4S2AXNQFcjs.developTarget; exports.dexp = _chunkL3PXFMOFcjs.dexp; exports.dilateMask = _chunkTS5IEUW6cjs.dilateMask; exports.displayTransform = displayTransform; exports.distanceTransform = _chunk4S2AXNQFcjs.distanceTransform; exports.dlog = _chunkL3PXFMOFcjs.dlog; exports.documentContents = _chunk4S2AXNQFcjs.documentContents; exports.documentProfile = documentProfile; exports.dodgeBurn = _chunkTS5IEUW6cjs.dodgeBurn; exports.dodgeBurnCurve = _chunkTS5IEUW6cjs.dodgeBurnCurve; exports.downloadPsd = downloadPsd; exports.dpow = _chunkL3PXFMOFcjs.dpow; exports.dragWarpMeshPoint = _chunkLI3KTY7Kcjs.dragWarpMeshPoint; exports.dropPlacement = dropPlacement; exports.dropZone = dropZone; exports.dsincos = _chunkL3PXFMOFcjs.dsincos; exports.duplicateLayer = _chunk4S2AXNQFcjs.duplicateLayer; exports.edgeBits = _chunkL3PXFMOFcjs.edgeBits; exports.edgeWidth = edgeWidth; exports.effectColorHex = _chunkWMRIG4XQcjs.effectColorHex; exports.effectControlChange = effectControlChange; exports.effectReach = _chunkWMRIG4XQcjs.effectReach; exports.effectiveProof = effectiveProof; exports.effectsFingerprint = _chunkWMRIG4XQcjs.effectsFingerprint; exports.effectsMargin = _chunkWMRIG4XQcjs.effectsMargin; exports.effectsScale = _chunkWMRIG4XQcjs.effectsScale; exports.ellipsePoints = ellipsePoints; exports.ellipseSelection = ellipseSelection; exports.emptyHistogram = emptyHistogram; exports.emptySurface = _chunk7ISPWEJAcjs.emptySurface; exports.encodeDeepSurface = _chunk4S2AXNQFcjs.encodeDeepSurface; exports.encodePng = _chunkEJVDBITDcjs.encodePng; exports.encodeRle = _chunk4S2AXNQFcjs.encodeRle; exports.encodeSelectionRle = _chunk4S2AXNQFcjs.encodeSelectionRle; exports.encodeSurface = _chunk4S2AXNQFcjs.encodeSurface; exports.evalWarpMesh = _chunkLI3KTY7Kcjs.evalWarpMesh; exports.evaluateAdjustmentLayers = _chunk4S2AXNQFcjs.evaluateAdjustmentLayers; exports.exchangeRates = _chunkL3PXFMOFcjs.exchangeRates; exports.expNeg = _chunkL3PXFMOFcjs.expNeg; exports.expandCoverage = _chunk4S2AXNQFcjs.expandCoverage; exports.exportPsd = _chunk4S2AXNQFcjs.exportPsd; exports.extractNormalizedLayerItems = extractNormalizedLayerItems; exports.featherCoverage = _chunk4S2AXNQFcjs.featherCoverage; exports.fillRect = _chunk7ISPWEJAcjs.fillRect; exports.filmPixel = _chunkL3PXFMOFcjs.filmPixel; exports.filmReflectance = _chunkL3PXFMOFcjs.filmReflectance; exports.filterMaskCoverage = _chunk4S2AXNQFcjs.filterMaskCoverage; exports.findAdjustmentControl = findAdjustmentControl; exports.findLayer = _chunkWMRIG4XQcjs.findLayer; exports.findLayerControl = findLayerControl; exports.finishTile = _chunk7ISPWEJAcjs.finishTile; exports.fitParagraphRuns = _chunkLI3KTY7Kcjs.fitParagraphRuns; exports.fitRuns = _chunkLI3KTY7Kcjs.fitRuns; exports.flattenLayers = _chunkWMRIG4XQcjs.flattenLayers; exports.flattenPath = _chunk4S2AXNQFcjs.flattenPath; exports.flipCorners = _chunk4S2AXNQFcjs.flipCorners; exports.flowField = _chunkL3PXFMOFcjs.flowField; exports.fontOf = _chunkLI3KTY7Kcjs.fontOf; exports.formatControlValue = formatControlValue; exports.fullSelection = _chunk4S2AXNQFcjs.fullSelection; exports.gaussianBlur = _chunkWMRIG4XQcjs.gaussianBlur; exports.geometryHomography = _chunk4S2AXNQFcjs.geometryHomography; exports.getAnnotationBounds = _chunk4S2AXNQFcjs.getAnnotationBounds; exports.getControlPath = getControlPath; exports.getCropCursor = _chunk4S2AXNQFcjs.getCropCursor; exports.getRotatedSize = _chunk4S2AXNQFcjs.getRotatedSize; exports.getViewportMetrics = _chunk4S2AXNQFcjs.getViewportMetrics; exports.getViewportProjection = _chunk4S2AXNQFcjs.getViewportProjection; exports.globalImageCache = globalImageCache; exports.greyMorphology = _chunk4S2AXNQFcjs.greyMorphology; exports.groupLayers = _chunk4S2AXNQFcjs.groupLayers; exports.guidePlanes = guidePlanes; exports.guidedFilterColor = guidedFilterColor; exports.handlePaintShortcut = handlePaintShortcut; exports.hasActiveEffects = _chunkWMRIG4XQcjs.hasActiveEffects; exports.hasResampledLegacyMask = _chunk4S2AXNQFcjs.hasResampledLegacyMask; exports.hasSurface = _chunk4S2AXNQFcjs.hasSurface; exports.hasWarp = _chunk4S2AXNQFcjs.hasWarp; exports.hashMaskContent = _chunk4S2AXNQFcjs.hashMaskContent; exports.hashNoise = _chunkWMRIG4XQcjs.hashNoise; exports.healPixels = _chunkTS5IEUW6cjs.healPixels; exports.hexToRgb = _chunk4S2AXNQFcjs.hexToRgb; exports.histogramPath = histogramPath; exports.hitTestAnnotation = _chunk4S2AXNQFcjs.hitTestAnnotation; exports.hitTestCrop = _chunk4S2AXNQFcjs.hitTestCrop; exports.hitTestCurvePoint = hitTestCurvePoint; exports.homographyFromAffine = _chunkEJVDBITDcjs.homographyFromAffine; exports.homographyFromPoints = _chunkEJVDBITDcjs.homographyFromPoints; exports.hslToRgb = _chunk4S2AXNQFcjs.hslToRgb; exports.hueRange = hueRange; exports.hueRangeTables = _chunk4S2AXNQFcjs.hueRangeTables; exports.hueRangeWeight = _chunk4S2AXNQFcjs.hueRangeWeight; exports.hueSaturation = _chunk4S2AXNQFcjs.hueSaturation; exports.identityCurve = _chunk4S2AXNQFcjs.identityCurve; exports.identityLevels = _chunk4S2AXNQFcjs.identityLevels; exports.identityTransform = _chunk4S2AXNQFcjs.identityTransform; exports.identityWarpMesh = _chunkLI3KTY7Kcjs.identityWarpMesh; exports.imageEditorStateMigrations = imageEditorStateMigrations; exports.imageToCanvasPoint = _chunk4S2AXNQFcjs.imageToCanvasPoint; exports.importPsd = _chunk4S2AXNQFcjs.importPsd; exports.inflate = _chunk643B2HKCcjs.inflate; exports.inflateRaw = _chunk643B2HKCcjs.inflateRaw; exports.insertCurvePoint = insertCurvePoint; exports.insertLayer = _chunkWMRIG4XQcjs.insertLayer; exports.instancesOf = _chunk4S2AXNQFcjs.instancesOf; exports.invertHomography = _chunkEJVDBITDcjs.invertHomography; exports.invertMatrix3 = _chunk4S2AXNQFcjs.invertMatrix3; exports.invertSelection = _chunk4S2AXNQFcjs.invertSelection; exports.isActiveFilter = _chunk4S2AXNQFcjs.isActiveFilter; exports.isAdjustmentKind = _chunk4S2AXNQFcjs.isAdjustmentKind; exports.isBitDepth = _chunk7ISPWEJAcjs.isBitDepth; exports.isBlendMode = _chunk7ISPWEJAcjs.isBlendMode; exports.isContentsDecoded = _chunk4S2AXNQFcjs.isContentsDecoded; exports.isDefaultDepthMask = _chunk4S2AXNQFcjs.isDefaultDepthMask; exports.isIdentityTransform = _chunk4S2AXNQFcjs.isIdentityTransform; exports.isInterpolation = _chunkWMRIG4XQcjs.isInterpolation; exports.isLayerEffectKind = _chunkWMRIG4XQcjs.isLayerEffectKind; exports.isLayerLocked = _chunkWMRIG4XQcjs.isLayerLocked; exports.isLegacyShape = _chunk4S2AXNQFcjs.isLegacyShape; exports.isPaintTool = isPaintTool; exports.isPainterlyBlendMode = _chunk7ISPWEJAcjs.isPainterlyBlendMode; exports.isPng = _chunkEJVDBITDcjs.isPng; exports.isQuarterTurn = isQuarterTurn; exports.isQuarterTurnSwapped = _chunk4S2AXNQFcjs.isQuarterTurnSwapped; exports.isRenderedLayer = _chunk4S2AXNQFcjs.isRenderedLayer; exports.isRetouchPaintTool = isRetouchPaintTool; exports.isRetouchTool = isRetouchTool; exports.isSelectionEmpty = _chunk4S2AXNQFcjs.isSelectionEmpty; exports.isSelectionMode = _chunk4S2AXNQFcjs.isSelectionMode; exports.isSeparableBlendMode = _chunk7ISPWEJAcjs.isSeparableBlendMode; exports.isSpatialFilter = _chunk4S2AXNQFcjs.isSpatialFilter; exports.isSrgb = isSrgb; exports.isTransformAnchor = _chunk4S2AXNQFcjs.isTransformAnchor; exports.isValidWarp = _chunk4S2AXNQFcjs.isValidWarp; exports.keepDeepSamples = _chunk7ISPWEJAcjs.keepDeepSamples; exports.kelvinToTemperature = _chunk4S2AXNQFcjs.kelvinToTemperature; exports.keysWeight = _chunkWMRIG4XQcjs.keysWeight; exports.latticeViscosity = _chunkL3PXFMOFcjs.latticeViscosity; exports.layerBadge = layerBadge; exports.layerEffectControls = layerEffectControls; exports.layerEffectFields = _chunkWMRIG4XQcjs.layerEffectFields; exports.layerEffectLabel = _chunkWMRIG4XQcjs.layerEffectLabel; exports.layerEffectsBadge = layerEffectsBadge; exports.layerEffectsOf = _chunk4S2AXNQFcjs.layerEffectsOf; exports.layerEffectsPanel = layerEffectsPanel; exports.layerHasThumbnail = layerHasThumbnail; exports.layerLabel = layerLabel; exports.layerMaskCoverage = _chunk4S2AXNQFcjs.layerMaskCoverage; exports.layerMaskFromSelection = _chunk4S2AXNQFcjs.layerMaskFromSelection; exports.layerMaskKey = _chunk4S2AXNQFcjs.layerMaskKey; exports.layerMenu = layerMenu; exports.layerName = _chunk4S2AXNQFcjs.layerName; exports.layerPanelRows = layerPanelRows; exports.layerTree = _chunk4S2AXNQFcjs.layerTree; exports.layerTypeLabel = _chunk4S2AXNQFcjs.layerTypeLabel; exports.layerWarning = layerWarning; exports.layersFromLegacy = _chunk4S2AXNQFcjs.layersFromLegacy; exports.layoutText = _chunkLI3KTY7Kcjs.layoutText; exports.legacyAdjustmentLayer = _chunk4S2AXNQFcjs.legacyAdjustmentLayer; exports.legacyMaskOf = _chunk4S2AXNQFcjs.legacyMaskOf; exports.legacyView = _chunk4S2AXNQFcjs.legacyView; exports.lerpPigment = _chunk7ISPWEJAcjs.lerpPigment; exports.lerpPigmentInto = _chunk7ISPWEJAcjs.lerpPigmentInto; exports.levelsValue = _chunk4S2AXNQFcjs.levelsValue; exports.linearSrgbToXy = _chunk4S2AXNQFcjs.linearSrgbToXy; exports.linearToSrgb = _chunk4S2AXNQFcjs.linearToSrgb; exports.linearToSrgb8 = _chunkL3PXFMOFcjs.linearToSrgb8; exports.liveComponent = _chunk4S2AXNQFcjs.liveComponent; exports.liveShapeForDrag = liveShapeForDrag; exports.liveShapeSubpaths = _chunk4S2AXNQFcjs.liveShapeSubpaths; exports.loadImageEditorDocument = loadImageEditorDocument; exports.loadMixer = _chunkL3PXFMOFcjs.loadMixer; exports.loadOpenTypeFont = _chunk2OJACTPRcjs.loadOpenTypeFont; exports.loadWetKernel = _chunkL3PXFMOFcjs.loadWetKernel; exports.luma = _chunkTS5IEUW6cjs.luma; exports.magicWand = magicWand; exports.mapCropHandle = _chunk4S2AXNQFcjs.mapCropHandle; exports.mapLayer = _chunkWMRIG4XQcjs.mapLayer; exports.mapSubpaths = _chunk4S2AXNQFcjs.mapSubpaths; exports.maskBounds = _chunkTS5IEUW6cjs.maskBounds; exports.maskSummary = maskSummary; exports.matrixFromCorners = _chunk4S2AXNQFcjs.matrixFromCorners; exports.matrixFromParams = _chunk4S2AXNQFcjs.matrixFromParams; exports.membraneFill = _chunkTS5IEUW6cjs.membraneFill; exports.mergeLayerEffect = _chunkWMRIG4XQcjs.mergeLayerEffect; exports.mergeShapeComponents = _chunk4S2AXNQFcjs.mergeShapeComponents; exports.migrateSerializedImageEditorState = migrateSerializedImageEditorState; exports.migrateToLayeredState = migrateToLayeredState; exports.mixPigment8 = _chunk7ISPWEJAcjs.mixPigment8; exports.mixPigmentRgb = _chunk7ISPWEJAcjs.mixPigmentRgb; exports.mixPigments = _chunk7ISPWEJAcjs.mixPigments; exports.mixerLoadResult = mixerLoadResult; exports.mixerRates = _chunkL3PXFMOFcjs.mixerRates; exports.modifySelection = _chunk4S2AXNQFcjs.modifySelection; exports.moveCurvePoint = moveCurvePoint; exports.moveLayer = _chunk4S2AXNQFcjs.moveLayer; exports.moveSmartFilter = _chunk4S2AXNQFcjs.moveSmartFilter; exports.mulMatrix3 = _chunk4S2AXNQFcjs.mulMatrix3; exports.needsLegacyBase = needsLegacyBase; exports.neutralHueRange = _chunk4S2AXNQFcjs.neutralHueRange; exports.newContentsId = _chunk4S2AXNQFcjs.newContentsId; exports.newEffectId = _chunkWMRIG4XQcjs.newEffectId; exports.newLayerId = _chunk4S2AXNQFcjs.newLayerId; exports.normalizeAdjustmentLayer = _chunk4S2AXNQFcjs.normalizeAdjustmentLayer; exports.normalizeAdjustmentLayers = _chunk4S2AXNQFcjs.normalizeAdjustmentLayers; exports.normalizeAngle = _chunk4S2AXNQFcjs.normalizeAngle; exports.normalizeBlendMode = _chunk7ISPWEJAcjs.normalizeBlendMode; exports.normalizeBlender = _chunkL3PXFMOFcjs.normalizeBlender; exports.normalizeBrush = _chunkL3PXFMOFcjs.normalizeBrush; exports.normalizeFilter = _chunk4S2AXNQFcjs.normalizeFilter; exports.normalizeFlow = _chunkL3PXFMOFcjs.normalizeFlow; exports.normalizeLayerEffects = _chunkWMRIG4XQcjs.normalizeLayerEffects; exports.normalizeLayerMask = _chunk4S2AXNQFcjs.normalizeLayerMask; exports.normalizeLiveShape = _chunk4S2AXNQFcjs.normalizeLiveShape; exports.normalizeMixer = _chunkL3PXFMOFcjs.normalizeMixer; exports.normalizePlacement = _chunk4S2AXNQFcjs.normalizePlacement; exports.normalizeProcessVersion = _chunk4S2AXNQFcjs.normalizeProcessVersion; exports.normalizeRect = normalizeRect; exports.normalizeRefineEdgeParams = normalizeRefineEdgeParams; exports.normalizeRetouch = _chunkTS5IEUW6cjs.normalizeRetouch; exports.normalizeShapePaint = _chunk4S2AXNQFcjs.normalizeShapePaint; exports.normalizeShapeStroke = _chunk4S2AXNQFcjs.normalizeShapeStroke; exports.normalizeSmartFilter = _chunk4S2AXNQFcjs.normalizeSmartFilter; exports.normalizeSmudge = _chunkL3PXFMOFcjs.normalizeSmudge; exports.normalizeStoredAdjustments = normalizeStoredAdjustments; exports.normalizeSubpaths = _chunk4S2AXNQFcjs.normalizeSubpaths; exports.normalizeText = _chunk4S2AXNQFcjs.normalizeText; exports.normalizeTilt = _chunkL3PXFMOFcjs.normalizeTilt; exports.normalizeWetParams = _chunkL3PXFMOFcjs.normalizeWetParams; exports.offsetLayer = _chunk4S2AXNQFcjs.offsetLayer; exports.offsetShape = _chunk4S2AXNQFcjs.offsetShape; exports.offsetSmartObject = _chunk4S2AXNQFcjs.offsetSmartObject; exports.openPsdFile = openPsdFile; exports.packRgba = _chunk7ISPWEJAcjs.packRgba; exports.packWetParams = _chunkL3PXFMOFcjs.packWetParams; exports.paintPathStroke = _chunkTS5IEUW6cjs.paintPathStroke; exports.paragraphRanges = _chunkLI3KTY7Kcjs.paragraphRanges; exports.parseAdjustmentBlock = _chunk4S2AXNQFcjs.parseAdjustmentBlock; exports.parseBlend = _chunk4S2AXNQFcjs.parseBlend; exports.parseColor = parseColor; exports.parseCssColor = _chunk4S2AXNQFcjs.parseCssColor; exports.parseDataUrl = _chunkEJVDBITDcjs.parseDataUrl; exports.parseEffectColor = _chunkWMRIG4XQcjs.parseEffectColor; exports.parseLfx2 = _chunk4S2AXNQFcjs.parseLfx2; exports.parseLrfx = _chunk4S2AXNQFcjs.parseLrfx; exports.parseOpenTypeFont = _chunk2OJACTPRcjs.parseOpenTypeFont; exports.parsePatternBlock = _chunk4S2AXNQFcjs.parsePatternBlock; exports.parseSelectionMode = _chunk4S2AXNQFcjs.parseSelectionMode; exports.parseVersionedDescriptor = _chunk4S2AXNQFcjs.parseVersionedDescriptor; exports.patchParagraphStyle = _chunk4S2AXNQFcjs.patchParagraphStyle; exports.patchTextStyle = _chunk4S2AXNQFcjs.patchTextStyle; exports.pathStrokeCoverage = _chunkTS5IEUW6cjs.pathStrokeCoverage; exports.pathStrokeDabs = _chunkTS5IEUW6cjs.pathStrokeDabs; exports.perDabStrength = _chunkTS5IEUW6cjs.perDabStrength; exports.photoFilterMatrix = _chunk4S2AXNQFcjs.photoFilterMatrix; exports.pigment8 = _chunk7ISPWEJAcjs.pigment8; exports.pigmentColor = _chunkL3PXFMOFcjs.pigmentColor; exports.pigmentOf = _chunkL3PXFMOFcjs.pigmentOf; exports.pixelLayerBounds = _chunk4S2AXNQFcjs.pixelLayerBounds; exports.pixelLayers = _chunk4S2AXNQFcjs.pixelLayers; exports.pixelPigment = _chunkL3PXFMOFcjs.pixelPigment; exports.placeContents = _chunk4S2AXNQFcjs.placeContents; exports.placeLayer = _chunk4S2AXNQFcjs.placeLayer; exports.placementAt = _chunk4S2AXNQFcjs.placementAt; exports.placementBounds = _chunk4S2AXNQFcjs.placementBounds; exports.placementGeometry = _chunk4S2AXNQFcjs.placementGeometry; exports.pngDataUrl = _chunkEJVDBITDcjs.pngDataUrl; exports.pointerPressure = pointerPressure; exports.polygonCoverage = polygonCoverage; exports.polygonSelection = polygonSelection; exports.posterizeValue = _chunk4S2AXNQFcjs.posterizeValue; exports.presetWarp = _chunk4S2AXNQFcjs.presetWarp; exports.previewStep = previewStep; exports.profileBytes = profileBytes; exports.projectImagePoint = _chunk4S2AXNQFcjs.projectImagePoint; exports.projectImageRect = _chunk4S2AXNQFcjs.projectImageRect; exports.projectMaskCoverage = _chunk4S2AXNQFcjs.projectMaskCoverage; exports.projectQuarterTurn = projectQuarterTurn; exports.proxyOf = _chunk7ISPWEJAcjs.proxyOf; exports.psdBytesFromBase64 = psdBytesFromBase64; exports.psdFileName = psdFileName; exports.psdPatternToEffectPattern = _chunk4S2AXNQFcjs.psdPatternToEffectPattern; exports.psdToLayers = _chunk4S2AXNQFcjs.psdToLayers; exports.pullWarpMesh = _chunkLI3KTY7Kcjs.pullWarpMesh; exports.put255 = _chunkL3PXFMOFcjs.put255; exports.quickMaskPixels = quickMaskPixels; exports.rangeLightness = _chunk4S2AXNQFcjs.rangeLightness; exports.rasterContents = _chunk4S2AXNQFcjs.rasterContents; exports.rasterMaskFromLegacy = _chunk4S2AXNQFcjs.rasterMaskFromLegacy; exports.rasterizeCoverage = _chunk4S2AXNQFcjs.rasterizeCoverage; exports.rasterizeDab = _chunkL3PXFMOFcjs.rasterizeDab; exports.rasterizeSmartObject = _chunk4S2AXNQFcjs.rasterizeSmartObject; exports.readAdjustmentControls = readAdjustmentControls; exports.readDeepRegion = _chunk7ISPWEJAcjs.readDeepRegion; exports.readPixel = _chunk7ISPWEJAcjs.readPixel; exports.readPsd = _chunk4S2AXNQFcjs.readPsd; exports.readRegion = _chunk7ISPWEJAcjs.readRegion; exports.readSourceRegion = _chunkTS5IEUW6cjs.readSourceRegion; exports.rectSelection = rectSelection; exports.rectToQuad = _chunkEJVDBITDcjs.rectToQuad; exports.reduceSurface = _chunkWMRIG4XQcjs.reduceSurface; exports.referencePoint = _chunk4S2AXNQFcjs.referencePoint; exports.refineCoverage = refineCoverage; exports.refineEdgeHalo = refineEdgeHalo; exports.refineSelection = refineSelection; exports.reflectanceToRgb = _chunk7ISPWEJAcjs.reflectanceToRgb; exports.removeAlpha = _chunk4S2AXNQFcjs.removeAlpha; exports.removeCurvePoint = removeCurvePoint; exports.removeLayer = _chunk4S2AXNQFcjs.removeLayer; exports.removeLayerEffect = _chunk4S2AXNQFcjs.removeLayerEffect; exports.removeLayerFilter = _chunk4S2AXNQFcjs.removeLayerFilter; exports.removeSmartFilter = _chunk4S2AXNQFcjs.removeSmartFilter; exports.renderLayerEffects = _chunkWMRIG4XQcjs.renderLayerEffects; exports.renderLayeredBase = renderLayeredBase; exports.renderShape = _chunk4S2AXNQFcjs.renderShape; exports.renderShapeRect = _chunk4S2AXNQFcjs.renderShapeRect; exports.renderSmartObject = _chunk4S2AXNQFcjs.renderSmartObject; exports.renderText = _chunk4S2AXNQFcjs.renderText; exports.replaceContents = _chunk4S2AXNQFcjs.replaceContents; exports.replaceTextRange = _chunk4S2AXNQFcjs.replaceTextRange; exports.requireLayer = _chunk4S2AXNQFcjs.requireLayer; exports.requireOperation = _chunk4S2AXNQFcjs.requireOperation; exports.requireShapeLayer = _chunk4S2AXNQFcjs.requireShapeLayer; exports.requireSmartObject = _chunk4S2AXNQFcjs.requireSmartObject; exports.requireTypeLayer = _chunk4S2AXNQFcjs.requireTypeLayer; exports.requireUnlocked = _chunk4S2AXNQFcjs.requireUnlocked; exports.rerender = _chunk4S2AXNQFcjs.rerender; exports.rerenderShape = _chunk4S2AXNQFcjs.rerenderShape; exports.rerenderText = _chunk4S2AXNQFcjs.rerenderText; exports.resizePixels = resizePixels; exports.resizeSelection = _chunk4S2AXNQFcjs.resizeSelection; exports.resizeWarpMesh = _chunkLI3KTY7Kcjs.resizeWarpMesh; exports.resolveExternalAssets = _chunk4S2AXNQFcjs.resolveExternalAssets; exports.resolveMosaicRegionBounds = resolveMosaicRegionBounds; exports.resolveProfile = resolveProfile; exports.restyleRange = _chunkLI3KTY7Kcjs.restyleRange; exports.rgbToGray = _chunk4S2AXNQFcjs.rgbToGray; exports.rgbToHsl = _chunk4S2AXNQFcjs.rgbToHsl; exports.rgbToReflectance = _chunk7ISPWEJAcjs.rgbToReflectance; exports.rgbUnitToHex = rgbUnitToHex; exports.rgbaViewOfGrey = _chunkTS5IEUW6cjs.rgbaViewOfGrey; exports.runLayerFilters = _chunk4S2AXNQFcjs.runLayerFilters; exports.runLayerMenuAction = runLayerMenuAction; exports.sampleLut = _chunk4S2AXNQFcjs.sampleLut; exports.sampleToneLut = _chunk4S2AXNQFcjs.sampleToneLut; exports.saturationOf = _chunkTS5IEUW6cjs.saturationOf; exports.scaleLayerEffect = _chunkWMRIG4XQcjs.scaleLayerEffect; exports.seamlessClone = _chunkTS5IEUW6cjs.seamlessClone; exports.selectionArea = _chunk4S2AXNQFcjs.selectionArea; exports.selectionFromCoverage = _chunk4S2AXNQFcjs.selectionFromCoverage; exports.selectionFromPixels = _chunk4S2AXNQFcjs.selectionFromPixels; exports.selectionModeFromModifiers = selectionModeFromModifiers; exports.selectionOutline = selectionOutline; exports.selectionToCoverage = _chunk4S2AXNQFcjs.selectionToCoverage; exports.selectionToPixels = _chunk4S2AXNQFcjs.selectionToPixels; exports.selectionValueAt = _chunk4S2AXNQFcjs.selectionValueAt; exports.serializeColorMode = serializeColorMode; exports.serializeColorProfile = serializeColorProfile; exports.serializeContents = _chunk4S2AXNQFcjs.serializeContents; exports.serializeEffects = _chunk4S2AXNQFcjs.serializeEffects; exports.serializeLayer = _chunk4S2AXNQFcjs.serializeLayer; exports.serializeLayers = _chunk4S2AXNQFcjs.serializeLayers; exports.serializeLayersExternal = _chunk4S2AXNQFcjs.serializeLayersExternal; exports.serializePatterns = _chunk4S2AXNQFcjs.serializePatterns; exports.serializeSelection = _chunk4S2AXNQFcjs.serializeSelection; exports.setControlPath = setControlPath; exports.setLayerEffects = _chunk4S2AXNQFcjs.setLayerEffects; exports.setLayerEffectsEnabled = _chunk4S2AXNQFcjs.setLayerEffectsEnabled; exports.setLayerMask = _chunk4S2AXNQFcjs.setLayerMask; exports.setLayerProperties = _chunk4S2AXNQFcjs.setLayerProperties; exports.setLum = _chunk7ISPWEJAcjs.setLum; exports.setPigmentColor = _chunk7ISPWEJAcjs.setPigmentColor; exports.setRetouchChoice = setRetouchChoice; exports.setSmartFilterMask = _chunk4S2AXNQFcjs.setSmartFilterMask; exports.setSmartFiltersEnabled = _chunk4S2AXNQFcjs.setSmartFiltersEnabled; exports.setSmartPlacement = _chunk4S2AXNQFcjs.setSmartPlacement; exports.shadeTile = _chunkL3PXFMOFcjs.shadeTile; exports.shapeAsPixelLayer = _chunk4S2AXNQFcjs.shapeAsPixelLayer; exports.shapeFromAnnotation = _chunk4S2AXNQFcjs.shapeFromAnnotation; exports.shapeGeometryBounds = _chunk4S2AXNQFcjs.shapeGeometryBounds; exports.shapeLayers = _chunk4S2AXNQFcjs.shapeLayers; exports.shapeOutline = _chunk4S2AXNQFcjs.shapeOutline; exports.shapeRenderClip = _chunk4S2AXNQFcjs.shapeRenderClip; exports.shiftCoverage = _chunk4S2AXNQFcjs.shiftCoverage; exports.smartFilterRows = smartFilterRows; exports.smartObjectLayers = _chunk4S2AXNQFcjs.smartObjectLayers; exports.smoothCoverage = _chunk4S2AXNQFcjs.smoothCoverage; exports.smoothPoints = _chunkL3PXFMOFcjs.smoothPoints; exports.smudgeEffect = _chunkTS5IEUW6cjs.smudgeEffect; exports.solidSurface = _chunk7ISPWEJAcjs.solidSurface; exports.solveMembrane = _chunkTS5IEUW6cjs.solveMembrane; exports.spliceRuns = _chunkLI3KTY7Kcjs.spliceRuns; exports.splitOverlayAnnotations = splitOverlayAnnotations; exports.sponge = _chunkTS5IEUW6cjs.sponge; exports.spongeEffect = _chunkTS5IEUW6cjs.spongeEffect; exports.spotHealPixels = _chunkTS5IEUW6cjs.spotHealPixels; exports.spotHealWindow = _chunkTS5IEUW6cjs.spotHealWindow; exports.srgb8ToLab = srgb8ToLab; exports.srgbByteToLinear = _chunkL3PXFMOFcjs.srgbByteToLinear; exports.srgbDecode = _chunk7ISPWEJAcjs.srgbDecode; exports.srgbEncode = _chunk7ISPWEJAcjs.srgbEncode; exports.srgbToLinear = _chunk4S2AXNQFcjs.srgbToLinear; exports.standardBlendMode = _chunk7ISPWEJAcjs.standardBlendMode; exports.stepSlotTs = _chunkL3PXFMOFcjs.stepSlotTs; exports.styleAt = _chunkLI3KTY7Kcjs.styleAt; exports.sumHistograms = sumHistograms; exports.surfaceBytes = _chunk7ISPWEJAcjs.surfaceBytes; exports.surfaceDepth = _chunk7ISPWEJAcjs.surfaceDepth; exports.surfaceFromDeepPixels = _chunk7ISPWEJAcjs.surfaceFromDeepPixels; exports.surfaceFromPixels = _chunk7ISPWEJAcjs.surfaceFromPixels; exports.surfacesEqual = _chunk7ISPWEJAcjs.surfacesEqual; exports.tempTintToXy = _chunk4S2AXNQFcjs.tempTintToXy; exports.temperatureToKelvin = _chunk4S2AXNQFcjs.temperatureToKelvin; exports.textIndexAt = _chunkLI3KTY7Kcjs.textIndexAt; exports.textMatrix = _chunk4S2AXNQFcjs.textMatrix; exports.textOutlines = _chunk4S2AXNQFcjs.textOutlines; exports.textRange = _chunk4S2AXNQFcjs.textRange; exports.tileCoord = _chunk7ISPWEJAcjs.tileCoord; exports.tileKey = _chunk7ISPWEJAcjs.tileKey; exports.tileRect = _chunk7ISPWEJAcjs.tileRect; exports.tileSamples = _chunk7ISPWEJAcjs.tileSamples; exports.tileSamples16 = _chunk7ISPWEJAcjs.tileSamples16; exports.tileSamples32 = _chunk7ISPWEJAcjs.tileSamples32; exports.tilesInRect = _chunk7ISPWEJAcjs.tilesInRect; exports.tipFalloff = _chunkL3PXFMOFcjs.tipFalloff; exports.tipReach = _chunkL3PXFMOFcjs.tipReach; exports.tipShape = _chunkL3PXFMOFcjs.tipShape; exports.to16From32 = _chunk7ISPWEJAcjs.to16From32; exports.to16From8 = _chunk7ISPWEJAcjs.to16From8; exports.to32From16 = _chunk7ISPWEJAcjs.to32From16; exports.to32From8 = _chunk7ISPWEJAcjs.to32From8; exports.to8From16 = _chunk7ISPWEJAcjs.to8From16; exports.to8From32 = _chunk7ISPWEJAcjs.to8From32; exports.toHex = toHex; exports.toTextSpace = _chunk4S2AXNQFcjs.toTextSpace; exports.toneCurve = _chunk4S2AXNQFcjs.toneCurve; exports.toneLuts = _chunk4S2AXNQFcjs.toneLuts; exports.toneOf = _chunkTS5IEUW6cjs.toneOf; exports.toneRange = toneRange; exports.transformHomography = _chunk4S2AXNQFcjs.transformHomography; exports.transformMap = _chunk4S2AXNQFcjs.transformMap; exports.transformShapeComponents = _chunk4S2AXNQFcjs.transformShapeComponents; exports.transformSurface = _chunkWMRIG4XQcjs.transformSurface; exports.transformTypeLayer = _chunk4S2AXNQFcjs.transformTypeLayer; exports.transformedBounds = _chunkWMRIG4XQcjs.transformedBounds; exports.transformedBox = _chunk4S2AXNQFcjs.transformedBox; exports.transformedPoint = _chunk4S2AXNQFcjs.transformedPoint; exports.translateSurface = _chunk7ISPWEJAcjs.translateSurface; exports.typeAsPixelLayer = _chunk4S2AXNQFcjs.typeAsPixelLayer; exports.typeFrame = _chunk4S2AXNQFcjs.typeFrame; exports.typeFromAnnotation = _chunk4S2AXNQFcjs.typeFromAnnotation; exports.typeLayerAt = typeLayerAt; exports.typeLayerName = _chunk4S2AXNQFcjs.typeLayerName; exports.ungroupLayer = _chunk4S2AXNQFcjs.ungroupLayer; exports.uniformTile = _chunk7ISPWEJAcjs.uniformTile; exports.unionRect = _chunk4S2AXNQFcjs.unionRect; exports.unprojectCanvasPoint = _chunk4S2AXNQFcjs.unprojectCanvasPoint; exports.updateLayerEffect = _chunk4S2AXNQFcjs.updateLayerEffect; exports.updateLayerFilter = _chunk4S2AXNQFcjs.updateLayerFilter; exports.updateLayerMaskProps = _chunk4S2AXNQFcjs.updateLayerMaskProps; exports.updateShapeLayer = _chunk4S2AXNQFcjs.updateShapeLayer; exports.updateSmartFilter = _chunk4S2AXNQFcjs.updateSmartFilter; exports.updateTypeLayer = _chunk4S2AXNQFcjs.updateTypeLayer; exports.uvToXy = _chunk4S2AXNQFcjs.uvToXy; exports.validateEffectGradient = _chunkWMRIG4XQcjs.validateEffectGradient; exports.validateLayerEffect = _chunkWMRIG4XQcjs.validateLayerEffect; exports.validateLayerEffects = _chunkWMRIG4XQcjs.validateLayerEffects; exports.versionedDescriptorBytes = _chunk4S2AXNQFcjs.versionedDescriptorBytes; exports.vibranceLinear = _chunk4S2AXNQFcjs.vibranceLinear; exports.vibrancePixel = _chunk4S2AXNQFcjs.vibrancePixel; exports.walkDabs = _chunkL3PXFMOFcjs.walkDabs; exports.warpMeshEditPoints = _chunkLI3KTY7Kcjs.warpMeshEditPoints; exports.warpMeshGridCurves = _chunkLI3KTY7Kcjs.warpMeshGridCurves; exports.warpMeshParamAt = _chunkLI3KTY7Kcjs.warpMeshParamAt; exports.warpPresetMesh = _chunkLI3KTY7Kcjs.warpPresetMesh; exports.warpSurface = _chunkWMRIG4XQcjs.warpSurface; exports.wbMatrix = _chunk4S2AXNQFcjs.wbMatrix; exports.wetSimdSupported = _chunkL3PXFMOFcjs.wetSimdSupported; exports.wetSupport = _chunkL3PXFMOFcjs.wetSupport; exports.whiteBalanceFromSample = _chunk4S2AXNQFcjs.whiteBalanceFromSample; exports.whiteBalanceMatrix = _chunk4S2AXNQFcjs.whiteBalanceMatrix; exports.withFilterMaskSurface = _chunk4S2AXNQFcjs.withFilterMaskSurface; exports.withNewIds = _chunk4S2AXNQFcjs.withNewIds; exports.writeAdjustmentBlock = _chunk4S2AXNQFcjs.writeAdjustmentBlock; exports.writeDeepRegion = _chunk7ISPWEJAcjs.writeDeepRegion; exports.writeLfx2 = _chunk4S2AXNQFcjs.writeLfx2; exports.writePatternBlock = _chunk4S2AXNQFcjs.writePatternBlock; exports.writePsd = _chunk4S2AXNQFcjs.writePsd; exports.writeRegion = _chunk7ISPWEJAcjs.writeRegion; exports.xyToTempTint = _chunk4S2AXNQFcjs.xyToTempTint; exports.xyToUv = _chunk4S2AXNQFcjs.xyToUv;
15034
+ exports.ADJUSTMENT_KEYS = _chunkHTAFDTNRcjs.ADJUSTMENT_KEYS; exports.ADJUSTMENT_KINDS = _chunkHTAFDTNRcjs.ADJUSTMENT_KINDS; exports.ADJUSTMENT_LAYER_CONTROLS = ADJUSTMENT_LAYER_CONTROLS; exports.ADJUSTMENT_LAYER_OPACITY_CONTROL = ADJUSTMENT_LAYER_OPACITY_CONTROL; exports.ADJUSTMENT_LUT_SIZE = _chunkHTAFDTNRcjs.ADJUSTMENT_LUT_SIZE; exports.AS_SHOT_KELVIN = _chunkHTAFDTNRcjs.AS_SHOT_KELVIN; exports.BACKGROUND_LAYER_ID = _chunkHTAFDTNRcjs.BACKGROUND_LAYER_ID; exports.BACKGROUND_LAYER_NAME = _chunkHTAFDTNRcjs.BACKGROUND_LAYER_NAME; exports.BIT_DEPTHS = _chunk7ISPWEJAcjs.BIT_DEPTHS; exports.BIT_DEPTH_OPTIONS = BIT_DEPTH_OPTIONS; exports.BLEND_MODES = _chunk7ISPWEJAcjs.BLEND_MODES; exports.BLUR_FILTER_ID = _chunkHTAFDTNRcjs.BLUR_FILTER_ID; exports.BODY_SCATTER = _chunkL3PXFMOFcjs.BODY_SCATTER; exports.BRUSH_OPTION_CONTROLS = BRUSH_OPTION_CONTROLS; exports.BUILTIN_PROFILES = _chunkG5NMLUVFcjs.BUILTIN_PROFILES; exports.COLOR_MODE_OPTIONS = COLOR_MODE_OPTIONS; exports.CoverageMap = _chunkL3PXFMOFcjs.CoverageMap; exports.D50 = _chunkHTAFDTNRcjs.D50; exports.D65 = _chunkHTAFDTNRcjs.D65; exports.DEFAULT_ADJUSTMENTS = DEFAULT_ADJUSTMENTS; exports.DEFAULT_AUTO_LEADING = _chunkVYW7JBTMcjs.DEFAULT_AUTO_LEADING; exports.DEFAULT_BLENDER = _chunkL3PXFMOFcjs.DEFAULT_BLENDER; exports.DEFAULT_BRUSH = _chunkL3PXFMOFcjs.DEFAULT_BRUSH; exports.DEFAULT_DEPTH_MASK = DEFAULT_DEPTH_MASK; exports.DEFAULT_FLOW = _chunkL3PXFMOFcjs.DEFAULT_FLOW; exports.DEFAULT_GLOBAL_LIGHT = _chunkWMRIG4XQcjs.DEFAULT_GLOBAL_LIGHT; exports.DEFAULT_MITER_LIMIT = _chunkHTAFDTNRcjs.DEFAULT_MITER_LIMIT; exports.DEFAULT_MIXER = _chunkL3PXFMOFcjs.DEFAULT_MIXER; exports.DEFAULT_PROOF = DEFAULT_PROOF; exports.DEFAULT_REFINE_EDGE_PARAMS = DEFAULT_REFINE_EDGE_PARAMS; exports.DEFAULT_RETOUCH = _chunkTS5IEUW6cjs.DEFAULT_RETOUCH; exports.DEFAULT_SELECTION_TOOL_OPTIONS = DEFAULT_SELECTION_TOOL_OPTIONS; exports.DEFAULT_SHAPE_TOOL_OPTIONS = DEFAULT_SHAPE_TOOL_OPTIONS; exports.DEFAULT_SMUDGE = _chunkL3PXFMOFcjs.DEFAULT_SMUDGE; exports.DEFAULT_TEXT_STYLE = _chunkVYW7JBTMcjs.DEFAULT_TEXT_STYLE; exports.DEFAULT_TRANSFORM = DEFAULT_TRANSFORM; exports.DEFAULT_TYPE_TOOL_OPTIONS = DEFAULT_TYPE_TOOL_OPTIONS; exports.DEFAULT_WET_PAPER = _chunkL3PXFMOFcjs.DEFAULT_WET_PAPER; exports.DEFAULT_WET_PARAMS = _chunkL3PXFMOFcjs.DEFAULT_WET_PARAMS; exports.DEPTH_MASK_CONTROLS = DEPTH_MASK_CONTROLS; exports.DEVELOP_FILTER_ID = _chunkHTAFDTNRcjs.DEVELOP_FILTER_ID; exports.DIRECT_GAUSSIAN_MAX_SIGMA = _chunkWMRIG4XQcjs.DIRECT_GAUSSIAN_MAX_SIGMA; exports.DRY_EPS = _chunkL3PXFMOFcjs.DRY_EPS; exports.DabWalker = _chunkL3PXFMOFcjs.DabWalker; exports.EMPTY_DISTANCE = _chunkHTAFDTNRcjs.EMPTY_DISTANCE; exports.EMPTY_MIXER_LOAD = _chunkL3PXFMOFcjs.EMPTY_MIXER_LOAD; exports.EX = _chunkL3PXFMOFcjs.EX; exports.EY = _chunkL3PXFMOFcjs.EY; exports.FLAG_ALIVE = _chunkL3PXFMOFcjs.FLAG_ALIVE; exports.FLAG_BOTTOM = _chunkL3PXFMOFcjs.FLAG_BOTTOM; exports.FLAG_LEFT = _chunkL3PXFMOFcjs.FLAG_LEFT; exports.FLAG_RIGHT = _chunkL3PXFMOFcjs.FLAG_RIGHT; exports.FLAG_TOP = _chunkL3PXFMOFcjs.FLAG_TOP; exports.FLAG_WET = _chunkL3PXFMOFcjs.FLAG_WET; exports.FLAT = _chunkL3PXFMOFcjs.FLAT; exports.FREE_INTERVAL = _chunkL3PXFMOFcjs.FREE_INTERVAL; exports.FREE_TRANSFORM_CONTENTS = FREE_TRANSFORM_CONTENTS; exports.FREE_TRANSFORM_FIELDS = FREE_TRANSFORM_FIELDS; exports.FREE_TRANSFORM_MODES = _chunkHTAFDTNRcjs.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 = _chunkL3PXFMOFcjs.HIDE; exports.HISTOGRAM_BINS = HISTOGRAM_BINS; exports.HUE_RANGE_LABELS = _chunkHTAFDTNRcjs.HUE_RANGE_LABELS; exports.IDENTITY_MATRIX3 = _chunkHTAFDTNRcjs.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_FILTER_PRESETS = IMAGE_FILTER_PRESETS; exports.INTENTS = _chunkG5NMLUVFcjs.INTENTS; exports.INTENT_OPTIONS = INTENT_OPTIONS; exports.INTERPOLATIONS = _chunkWMRIG4XQcjs.INTERPOLATIONS; exports.ImageEditorController = ImageEditorController; exports.ImageEditorRenderer = ImageEditorRenderer; exports.LATEST_PROCESS_VERSION = _chunkHTAFDTNRcjs.LATEST_PROCESS_VERSION; exports.LAYERED_SCHEMA_VERSION = _chunkHTAFDTNRcjs.LAYERED_SCHEMA_VERSION; exports.LAYER_EFFECT_KINDS = _chunkWMRIG4XQcjs.LAYER_EFFECT_KINDS; exports.LAYER_EFFECT_MENU = LAYER_EFFECT_MENU; exports.LEGACY_PROCESS_VERSION = _chunkHTAFDTNRcjs.LEGACY_PROCESS_VERSION; exports.LIVE_SHAPE_KINDS = _chunkHTAFDTNRcjs.LIVE_SHAPE_KINDS; exports.LUMA_709 = _chunkHTAFDTNRcjs.LUMA_709; exports.LayerCompositor = _chunkHTAFDTNRcjs.LayerCompositor; exports.LayerEffectError = _chunkWMRIG4XQcjs.LayerEffectError; exports.LayerOperationError = _chunkHTAFDTNRcjs.LayerOperationError; exports.MAX_BATCH = _chunkL3PXFMOFcjs.MAX_BATCH; exports.MAX_BRUSH_SIZE = _chunkL3PXFMOFcjs.MAX_BRUSH_SIZE; exports.MAX_EFFECT_REACH = _chunkWMRIG4XQcjs.MAX_EFFECT_REACH; exports.MAX_KELVIN = _chunkHTAFDTNRcjs.MAX_KELVIN; exports.MAX_TILT_ACCEL = _chunkL3PXFMOFcjs.MAX_TILT_ACCEL; exports.MAX_TRANSFORM_PIXELS = _chunkWMRIG4XQcjs.MAX_TRANSFORM_PIXELS; exports.MAX_WET_LANES = _chunkL3PXFMOFcjs.MAX_WET_LANES; exports.MAX_WET_SLOTS = _chunkL3PXFMOFcjs.MAX_WET_SLOTS; exports.MIN_KELVIN = _chunkHTAFDTNRcjs.MIN_KELVIN; exports.MIRED_PER_TEMPERATURE_UNIT = _chunkHTAFDTNRcjs.MIRED_PER_TEMPERATURE_UNIT; exports.MIXER_DRAIN = _chunkL3PXFMOFcjs.MIXER_DRAIN; exports.MIXER_MIXING_OPTIONS = MIXER_MIXING_OPTIONS; exports.MIXER_OPTION_CONTROLS = MIXER_OPTION_CONTROLS; exports.MIXER_PICKUP_RATE = _chunkL3PXFMOFcjs.MIXER_PICKUP_RATE; exports.MIXING_MODELS = _chunkL3PXFMOFcjs.MIXING_MODELS; exports.MixerStroke = _chunkL3PXFMOFcjs.MixerStroke; exports.OPP = _chunkL3PXFMOFcjs.OPP; exports.PAINTERLY_BLEND_MODES = _chunk7ISPWEJAcjs.PAINTERLY_BLEND_MODES; exports.PAINT_TOOLS = PAINT_TOOLS; exports.PAPER_CAPACITY = _chunkL3PXFMOFcjs.PAPER_CAPACITY; exports.PARAGRAPH_STYLE_FIELDS = _chunkHTAFDTNRcjs.PARAGRAPH_STYLE_FIELDS; exports.PARAM = _chunkL3PXFMOFcjs.PARAM; exports.PARAM_FLOATS = _chunkL3PXFMOFcjs.PARAM_FLOATS; exports.PATTERN_BLOCK_KEYS = _chunkHTAFDTNRcjs.PATTERN_BLOCK_KEYS; exports.PIGMENT_BANDS = _chunk7ISPWEJAcjs.PIGMENT_BANDS; exports.PIGMENT_CHANNELS = _chunkL3PXFMOFcjs.PIGMENT_CHANNELS; exports.PIGMENT_LAMBDA_MIN = _chunk7ISPWEJAcjs.PIGMENT_LAMBDA_MIN; exports.PIGMENT_LAMBDA_STEP = _chunk7ISPWEJAcjs.PIGMENT_LAMBDA_STEP; exports.PIGMENT_UNIT = _chunkL3PXFMOFcjs.PIGMENT_UNIT; exports.PIGMENT_WAVELENGTHS = _chunk7ISPWEJAcjs.PIGMENT_WAVELENGTHS; exports.PLANE = _chunkL3PXFMOFcjs.PLANE; exports.PLANE_BYTES = _chunkL3PXFMOFcjs.PLANE_BYTES; exports.PROOF_PROFILE_OPTIONS = PROOF_PROFILE_OPTIONS; exports.PSD_BLEND_KEYS = _chunkHTAFDTNRcjs.PSD_BLEND_KEYS; exports.PSD_FILE_ACCEPT = PSD_FILE_ACCEPT; exports.P_D0 = _chunkL3PXFMOFcjs.P_D0; exports.P_EDGE = _chunkL3PXFMOFcjs.P_EDGE; exports.P_FX = _chunkL3PXFMOFcjs.P_FX; exports.P_FY = _chunkL3PXFMOFcjs.P_FY; exports.P_H = _chunkL3PXFMOFcjs.P_H; exports.P_P0 = _chunkL3PXFMOFcjs.P_P0; exports.P_RHO = _chunkL3PXFMOFcjs.P_RHO; exports.P_SW = _chunkL3PXFMOFcjs.P_SW; exports.P_UX = _chunkL3PXFMOFcjs.P_UX; exports.P_UY = _chunkL3PXFMOFcjs.P_UY; exports.PaintExchange = _chunkL3PXFMOFcjs.PaintExchange; exports.PaintGesture = PaintGesture; exports.PaintStrokeSession = PaintStrokeSession; exports.PatternPlacement = _chunkWMRIG4XQcjs.PatternPlacement; exports.PatternTile = _chunkWMRIG4XQcjs.PatternTile; exports.PsdError = _chunkHTAFDTNRcjs.PsdError; exports.REFINE_EDGE_CONTROLS = REFINE_EDGE_CONTROLS; exports.RETOUCH_CHOICES = RETOUCH_CHOICES; exports.RETOUCH_OPTION_CONTROLS = RETOUCH_OPTION_CONTROLS; exports.RETOUCH_SAMPLES = _chunkTS5IEUW6cjs.RETOUCH_SAMPLES; exports.RETOUCH_TOGGLES = RETOUCH_TOGGLES; exports.RETOUCH_TOOLS = RETOUCH_TOOLS; exports.RegionPixelSource = _chunkTS5IEUW6cjs.RegionPixelSource; exports.RetouchDabStroke = _chunkTS5IEUW6cjs.RetouchDabStroke; exports.SELECTION_MODES = _chunkHTAFDTNRcjs.SELECTION_MODES; exports.SELECTION_MODE_LABELS = SELECTION_MODE_LABELS; exports.SELECTION_MODIFY_OPS = _chunkHTAFDTNRcjs.SELECTION_MODIFY_OPS; exports.SELECTION_TOOLS = SELECTION_TOOLS; exports.SET_PLANES = _chunkL3PXFMOFcjs.SET_PLANES; exports.SHADOW_AMBIENT = _chunk7ISPWEJAcjs.SHADOW_AMBIENT; exports.SHAPE_KIND_LABELS = SHAPE_KIND_LABELS; exports.SHAPE_OPERATIONS = _chunkHTAFDTNRcjs.SHAPE_OPERATIONS; exports.SHAPE_RENDER_MARGIN = _chunkHTAFDTNRcjs.SHAPE_RENDER_MARGIN; exports.SLOT_BYTES = _chunkL3PXFMOFcjs.SLOT_BYTES; exports.SLOT_PLANES = _chunkL3PXFMOFcjs.SLOT_PLANES; exports.SLOT_SIDE = _chunkL3PXFMOFcjs.SLOT_SIDE; exports.SMART_RENDER_MARGIN = _chunkHTAFDTNRcjs.SMART_RENDER_MARGIN; exports.SPOT_HEAL_TYPES = _chunkTS5IEUW6cjs.SPOT_HEAL_TYPES; exports.SRGB_TO_LINEAR = _chunkL3PXFMOFcjs.SRGB_TO_LINEAR; exports.STRIP = _chunkL3PXFMOFcjs.STRIP; exports.SUPPORTED_ADJUSTMENT_KEYS = _chunkHTAFDTNRcjs.SUPPORTED_ADJUSTMENT_KEYS; exports.SelectionGesture = SelectionGesture; exports.ShapeDrawGesture = ShapeDrawGesture; exports.SmudgeTip = _chunkL3PXFMOFcjs.SmudgeTip; exports.StrokeCoverage = _chunkL3PXFMOFcjs.StrokeCoverage; exports.SurfaceDraft = _chunk7ISPWEJAcjs.SurfaceDraft; exports.TEXT_ALIGNS = _chunkHTAFDTNRcjs.TEXT_ALIGNS; exports.TEXT_RENDER_MARGIN = _chunkHTAFDTNRcjs.TEXT_RENDER_MARGIN; exports.TEXT_STYLE_FIELDS = _chunkHTAFDTNRcjs.TEXT_STYLE_FIELDS; exports.TILE = _chunk7ISPWEJAcjs.TILE; exports.TILE_SHIFT = _chunk7ISPWEJAcjs.TILE_SHIFT; exports.TINT_SCALE = _chunkHTAFDTNRcjs.TINT_SCALE; exports.TONE_LUT_SIZE = _chunkHTAFDTNRcjs.TONE_LUT_SIZE; exports.TONE_RANGES = _chunkTS5IEUW6cjs.TONE_RANGES; exports.TONE_RANGE_PRESETS = TONE_RANGE_PRESETS; exports.TRANSFORM_ANCHORS = _chunkHTAFDTNRcjs.TRANSFORM_ANCHORS; exports.TextEditSession = TextEditSession; exports.TileMedium = _chunkL3PXFMOFcjs.TileMedium; exports.TilePixelSource = _chunkTS5IEUW6cjs.TilePixelSource; exports.TiledSurface = _chunk7ISPWEJAcjs.TiledSurface; exports.TransformTooLargeError = _chunkWMRIG4XQcjs.TransformTooLargeError; exports.TypeToolGesture = TypeToolGesture; exports.U_MAX = _chunkL3PXFMOFcjs.U_MAX; exports.VIBRANCE_GREY = _chunkHTAFDTNRcjs.VIBRANCE_GREY; exports.W9 = _chunkL3PXFMOFcjs.W9; exports.WARP_GRID_OPTIONS = WARP_GRID_OPTIONS; exports.WARP_STYLES = _chunkVYW7JBTMcjs.WARP_STYLES; exports.WARP_STYLE_LABELS = _chunkVYW7JBTMcjs.WARP_STYLE_LABELS; exports.WARP_STYLE_OPTIONS = WARP_STYLE_OPTIONS; exports.WET_FLOW_KINDS = _chunkL3PXFMOFcjs.WET_FLOW_KINDS; exports.WET_PARAM_KEYS = _chunkL3PXFMOFcjs.WET_PARAM_KEYS; exports.WET_TILE = _chunkL3PXFMOFcjs.WET_TILE; exports.WORKING_SPACE_OPTIONS = WORKING_SPACE_OPTIONS; exports.WetMedium = _chunkL3PXFMOFcjs.WetMedium; exports.WetWorkerPool = _chunkL3PXFMOFcjs.WetWorkerPool; exports.WetWorld = _chunkL3PXFMOFcjs.WetWorld; exports.WetWorldError = _chunkL3PXFMOFcjs.WetWorldError; exports.XYZ_D50_TO_SRGB = _chunkHTAFDTNRcjs.XYZ_D50_TO_SRGB; exports.ZlibError = _chunk643B2HKCcjs.ZlibError; exports.activeAdjustmentLayers = _chunkHTAFDTNRcjs.activeAdjustmentLayers; exports.activeSmartFilters = _chunkHTAFDTNRcjs.activeSmartFilters; exports.addLayerEffect = _chunkHTAFDTNRcjs.addLayerEffect; exports.addLayerFilter = _chunkHTAFDTNRcjs.addLayerFilter; exports.addSmartFilter = _chunkHTAFDTNRcjs.addSmartFilter; exports.addToHistogram = addToHistogram; exports.adjustmentKindLabel = _chunkHTAFDTNRcjs.adjustmentKindLabel; exports.adjustmentLayersKey = _chunkHTAFDTNRcjs.adjustmentLayersKey; exports.adjustmentNodeAsLayer = _chunkHTAFDTNRcjs.adjustmentNodeAsLayer; exports.adjustmentNodeFromLegacy = _chunkHTAFDTNRcjs.adjustmentNodeFromLegacy; exports.adler32 = _chunk643B2HKCcjs.adler32; exports.anchorPoint = _chunkHTAFDTNRcjs.anchorPoint; exports.annotationBlend = _chunkHTAFDTNRcjs.annotationBlend; exports.annotationLayerFor = _chunkHTAFDTNRcjs.annotationLayerFor; exports.annotationLayerName = _chunkHTAFDTNRcjs.annotationLayerName; exports.annotationOfLayer = _chunkHTAFDTNRcjs.annotationOfLayer; exports.annotationOfShape = _chunkHTAFDTNRcjs.annotationOfShape; exports.annotationOfType = _chunkHTAFDTNRcjs.annotationOfType; exports.applyAdjustmentLayers = _chunkHTAFDTNRcjs.applyAdjustmentLayers; exports.applyAdjustmentLayersFloat = _chunkHTAFDTNRcjs.applyAdjustmentLayersFloat; exports.applyAdjustments = _chunkHTAFDTNRcjs.applyAdjustments; exports.applyBoxBlur = _chunkHTAFDTNRcjs.applyBoxBlur; exports.applyDepthMask = _chunkHTAFDTNRcjs.applyDepthMask; exports.applyHomography = _chunkEJVDBITDcjs.applyHomography; exports.applyImageProjectionToContext = _chunkHTAFDTNRcjs.applyImageProjectionToContext; exports.applyLegacyAdjustments = _chunkHTAFDTNRcjs.applyLegacyAdjustments; exports.applyMatrix3 = _chunkHTAFDTNRcjs.applyMatrix3; exports.applyOutputStage = applyOutputStage; exports.applyParams = _chunkHTAFDTNRcjs.applyParams; exports.applyProcess2Adjustments = _chunkHTAFDTNRcjs.applyProcess2Adjustments; exports.applyRegionBlur = applyRegionBlur; exports.applyRegionMosaic = applyRegionMosaic; exports.applyRetouchToTile = _chunkTS5IEUW6cjs.applyRetouchToTile; exports.applyShapeOptions = applyShapeOptions; exports.applySmartFilters = _chunkHTAFDTNRcjs.applySmartFilters; exports.applyStrokeToDeepTile = _chunkL3PXFMOFcjs.applyStrokeToDeepTile; exports.applyStrokeToTile = _chunkL3PXFMOFcjs.applyStrokeToTile; exports.applyToneToDeepTile = _chunkTS5IEUW6cjs.applyToneToDeepTile; exports.backgroundLayer = _chunkHTAFDTNRcjs.backgroundLayer; exports.base64ToBytes = _chunkEJVDBITDcjs.base64ToBytes; exports.baseProjection = baseProjection; exports.bestOffset = _chunkTS5IEUW6cjs.bestOffset; exports.blackWhiteGray = _chunkHTAFDTNRcjs.blackWhiteGray; exports.blendChannel = _chunk7ISPWEJAcjs.blendChannel; exports.blendImageData = _chunk7ISPWEJAcjs.blendImageData; exports.blendLum = _chunk7ISPWEJAcjs.blendLum; exports.blendPixel = _chunk7ISPWEJAcjs.blendPixel; exports.blendRadius = _chunkL3PXFMOFcjs.blendRadius; exports.blendRgb = _chunk7ISPWEJAcjs.blendRgb; exports.blendTile = _chunkWMRIG4XQcjs.blendTile; exports.blenderDab = _chunkL3PXFMOFcjs.blenderDab; exports.blurFilter = _chunkHTAFDTNRcjs.blurFilter; exports.borderCoverage = _chunkHTAFDTNRcjs.borderCoverage; exports.boxMean = boxMean; exports.boxPointOf = _chunkHTAFDTNRcjs.boxPointOf; exports.boxQuad = _chunkEJVDBITDcjs.boxQuad; exports.boxToCurvePoint = boxToCurvePoint; exports.bradfordAdaptation = _chunkHTAFDTNRcjs.bradfordAdaptation; exports.buildLayerMaskPlanes = _chunkHTAFDTNRcjs.buildLayerMaskPlanes; exports.buildToneLut = _chunkHTAFDTNRcjs.buildToneLut; exports.builtinPattern = _chunkWMRIG4XQcjs.builtinPattern; exports.builtinPatternIds = _chunkWMRIG4XQcjs.builtinPatternIds; exports.bytesToBase64 = _chunkEJVDBITDcjs.bytesToBase64; exports.calculateCropDrag = _chunkHTAFDTNRcjs.calculateCropDrag; exports.canShareMemory = _chunkL3PXFMOFcjs.canShareMemory; exports.canvasCompositeOperation = _chunk7ISPWEJAcjs.canvasCompositeOperation; exports.canvasToImagePoint = _chunkHTAFDTNRcjs.canvasToImagePoint; exports.caretAt = _chunkVYW7JBTMcjs.caretAt; exports.changedTiles = _chunkWMRIG4XQcjs.changedTiles; exports.clampControlValue = clampControlValue; exports.clampCropToImage = _chunkHTAFDTNRcjs.clampCropToImage; exports.cleanMixer = _chunkL3PXFMOFcjs.cleanMixer; exports.cloneSourceLabel = cloneSourceLabel; exports.collectTiles = _chunk7ISPWEJAcjs.collectTiles; exports.colorBalanceChannel = _chunkHTAFDTNRcjs.colorBalanceChannel; exports.colorModePlanes = colorModePlanes; exports.colorPanelView = colorPanelView; exports.colorRange = colorRange; exports.combineSelections = _chunkHTAFDTNRcjs.combineSelections; exports.compileAdjustmentLayer = _chunkHTAFDTNRcjs.compileAdjustmentLayer; exports.componentPath = _chunkHTAFDTNRcjs.componentPath; exports.compositeDeep = _chunkHTAFDTNRcjs.compositeDeep; exports.compositeSurfaceOver = _chunkWMRIG4XQcjs.compositeSurfaceOver; exports.computeHistogram = computeHistogram; exports.computeSelectionBounds = _chunkHTAFDTNRcjs.computeSelectionBounds; exports.contentBounds = _chunk7ISPWEJAcjs.contentBounds; exports.contentsBox = _chunkHTAFDTNRcjs.contentsBox; exports.contentsSurface = _chunkHTAFDTNRcjs.contentsSurface; exports.contractCoverage = _chunkHTAFDTNRcjs.contractCoverage; exports.controlPosition = controlPosition; exports.controlTrackBackground = controlTrackBackground; exports.convertHex = convertHex; exports.convertSurfaceColors = convertSurfaceColors; exports.convertSurfaceDepth = _chunk7ISPWEJAcjs.convertSurfaceDepth; exports.convertToSmartObject = _chunkHTAFDTNRcjs.convertToSmartObject; exports.copySmartObject = _chunkHTAFDTNRcjs.copySmartObject; exports.cornersFromMatrix = _chunkHTAFDTNRcjs.cornersFromMatrix; exports.coverageTileCoord = _chunkL3PXFMOFcjs.coverageTileCoord; exports.coverageToByte = _chunkHTAFDTNRcjs.coverageToByte; exports.coveringRect = coveringRect; exports.createAdjustmentLayer = _chunkHTAFDTNRcjs.createAdjustmentLayer; exports.createBlenderScratch = _chunkL3PXFMOFcjs.createBlenderScratch; exports.createCanvasTextShaper = _chunkVYW7JBTMcjs.createCanvasTextShaper; exports.createImageCaptureSurface = createImageCaptureSurface; exports.createImageColorTools = createImageColorTools; exports.createImageEditTools = createImageEditTools; exports.createImageEditorToolProvider = createImageEditorToolProvider; exports.createImageEffectTools = createImageEffectTools; 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 = _chunkVYW7JBTMcjs.createMetricTextShaper; exports.createOutlineTextShaper = _chunkVYW7JBTMcjs.createOutlineTextShaper; exports.createPigment = _chunk7ISPWEJAcjs.createPigment; exports.createPigmentTools = _chunkL3PXFMOFcjs.createPigmentTools; exports.createSelectionMask = _chunkHTAFDTNRcjs.createSelectionMask; exports.createShapeLayer = _chunkHTAFDTNRcjs.createShapeLayer; exports.createTypeLayer = _chunkHTAFDTNRcjs.createTypeLayer; exports.cssFont = _chunkVYW7JBTMcjs.cssFont; exports.cssFontFamily = _chunkVYW7JBTMcjs.cssFontFamily; exports.curveLut = _chunkWMRIG4XQcjs.curveLut; exports.curveLutFromLevels = _chunkHTAFDTNRcjs.curveLutFromLevels; exports.curvePointToBox = curvePointToBox; exports.curveSvgPath = curveSvgPath; exports.dabCoverage = _chunkL3PXFMOFcjs.dabCoverage; exports.dabRect = _chunkL3PXFMOFcjs.dabRect; exports.decodeDeepSurface = _chunkHTAFDTNRcjs.decodeDeepSurface; exports.decodeLayerChannel = _chunkHTAFDTNRcjs.decodeLayerChannel; exports.decodeLayerMask = _chunkHTAFDTNRcjs.decodeLayerMask; exports.decodeMergedImage = _chunkHTAFDTNRcjs.decodeMergedImage; exports.decodePlanes = _chunkHTAFDTNRcjs.decodePlanes; exports.decodePng = _chunkEJVDBITDcjs.decodePng; exports.decodePngDataUrl = _chunkHTAFDTNRcjs.decodePngDataUrl; exports.decodeSelectionRle = _chunkHTAFDTNRcjs.decodeSelectionRle; exports.deepBytes = _chunk7ISPWEJAcjs.deepBytes; exports.deepTile = _chunk7ISPWEJAcjs.deepTile; exports.defaultAdjustmentParams = _chunkHTAFDTNRcjs.defaultAdjustmentParams; exports.defaultEffectGradient = _chunkWMRIG4XQcjs.defaultEffectGradient; exports.defaultLayerEffect = _chunkWMRIG4XQcjs.defaultLayerEffect; exports.defaultShapeName = _chunkHTAFDTNRcjs.defaultShapeName; exports.deflate = _chunk643B2HKCcjs.deflate; exports.deflateRaw = _chunk643B2HKCcjs.deflateRaw; exports.depthMaskAlpha = _chunkHTAFDTNRcjs.depthMaskAlpha; exports.depthOf = _chunk7ISPWEJAcjs.depthOf; exports.depthRasterMask = _chunkHTAFDTNRcjs.depthRasterMask; exports.describeLayer = describeLayer; exports.describeLayerEffects = describeLayerEffects; exports.describeSelection = describeSelection; exports.describeTransform = _chunkHTAFDTNRcjs.describeTransform; exports.deserializeColorMode = deserializeColorMode; exports.deserializeColorProfile = deserializeColorProfile; exports.deserializeEffects = _chunkHTAFDTNRcjs.deserializeEffects; exports.deserializeLayer = _chunkHTAFDTNRcjs.deserializeLayer; exports.deserializeLayers = _chunkHTAFDTNRcjs.deserializeLayers; exports.deserializePatterns = _chunkHTAFDTNRcjs.deserializePatterns; exports.deserializeSelection = _chunkHTAFDTNRcjs.deserializeSelection; exports.developFilter = _chunkHTAFDTNRcjs.developFilter; exports.developFromAdjustments = _chunkHTAFDTNRcjs.developFromAdjustments; exports.developTarget = _chunkHTAFDTNRcjs.developTarget; exports.dexp = _chunkL3PXFMOFcjs.dexp; exports.dilateMask = _chunkTS5IEUW6cjs.dilateMask; exports.displayTransform = displayTransform; exports.distanceTransform = _chunkHTAFDTNRcjs.distanceTransform; exports.dlog = _chunkL3PXFMOFcjs.dlog; exports.documentContents = _chunkHTAFDTNRcjs.documentContents; exports.documentProfile = documentProfile; exports.dodgeBurn = _chunkTS5IEUW6cjs.dodgeBurn; exports.dodgeBurnCurve = _chunkTS5IEUW6cjs.dodgeBurnCurve; exports.downloadPsd = downloadPsd; exports.dpow = _chunkL3PXFMOFcjs.dpow; exports.dragWarpMeshPoint = _chunkVYW7JBTMcjs.dragWarpMeshPoint; exports.dropPlacement = dropPlacement; exports.dropZone = dropZone; exports.dsincos = _chunkL3PXFMOFcjs.dsincos; exports.duplicateLayer = _chunkHTAFDTNRcjs.duplicateLayer; exports.edgeBits = _chunkL3PXFMOFcjs.edgeBits; exports.edgeWidth = edgeWidth; exports.effectColorHex = _chunkWMRIG4XQcjs.effectColorHex; exports.effectControlChange = effectControlChange; exports.effectReach = _chunkWMRIG4XQcjs.effectReach; exports.effectiveProof = effectiveProof; exports.effectsFingerprint = _chunkWMRIG4XQcjs.effectsFingerprint; exports.effectsMargin = _chunkWMRIG4XQcjs.effectsMargin; exports.effectsScale = _chunkWMRIG4XQcjs.effectsScale; exports.ellipsePoints = ellipsePoints; exports.ellipseSelection = ellipseSelection; exports.emptyHistogram = emptyHistogram; exports.emptySurface = _chunk7ISPWEJAcjs.emptySurface; exports.encodeDeepSurface = _chunkHTAFDTNRcjs.encodeDeepSurface; exports.encodePng = _chunkEJVDBITDcjs.encodePng; exports.encodeRle = _chunkHTAFDTNRcjs.encodeRle; exports.encodeSelectionRle = _chunkHTAFDTNRcjs.encodeSelectionRle; exports.encodeSurface = _chunkHTAFDTNRcjs.encodeSurface; exports.evalWarpMesh = _chunkVYW7JBTMcjs.evalWarpMesh; exports.evaluateAdjustmentLayers = _chunkHTAFDTNRcjs.evaluateAdjustmentLayers; exports.exchangeRates = _chunkL3PXFMOFcjs.exchangeRates; exports.expNeg = _chunkL3PXFMOFcjs.expNeg; exports.expandCoverage = _chunkHTAFDTNRcjs.expandCoverage; exports.exportPsd = _chunkHTAFDTNRcjs.exportPsd; exports.extractNormalizedLayerItems = extractNormalizedLayerItems; exports.featherCoverage = _chunkHTAFDTNRcjs.featherCoverage; exports.fillRect = _chunk7ISPWEJAcjs.fillRect; exports.filmPixel = _chunkL3PXFMOFcjs.filmPixel; exports.filmReflectance = _chunkL3PXFMOFcjs.filmReflectance; exports.filterMaskCoverage = _chunkHTAFDTNRcjs.filterMaskCoverage; exports.findAdjustmentControl = findAdjustmentControl; exports.findLayer = _chunkWMRIG4XQcjs.findLayer; exports.findLayerControl = findLayerControl; exports.finishTile = _chunk7ISPWEJAcjs.finishTile; exports.fitParagraphRuns = _chunkVYW7JBTMcjs.fitParagraphRuns; exports.fitRuns = _chunkVYW7JBTMcjs.fitRuns; exports.flattenLayers = _chunkWMRIG4XQcjs.flattenLayers; exports.flattenPath = _chunkHTAFDTNRcjs.flattenPath; exports.flipCorners = _chunkHTAFDTNRcjs.flipCorners; exports.flowField = _chunkL3PXFMOFcjs.flowField; exports.fontOf = _chunkVYW7JBTMcjs.fontOf; exports.formatControlValue = formatControlValue; exports.fullSelection = _chunkHTAFDTNRcjs.fullSelection; exports.gaussianBlur = _chunkWMRIG4XQcjs.gaussianBlur; exports.geometryHomography = _chunkHTAFDTNRcjs.geometryHomography; exports.getAnnotationBounds = _chunkHTAFDTNRcjs.getAnnotationBounds; exports.getControlPath = getControlPath; exports.getCropCursor = _chunkHTAFDTNRcjs.getCropCursor; exports.getRotatedSize = _chunkHTAFDTNRcjs.getRotatedSize; exports.getViewportMetrics = _chunkHTAFDTNRcjs.getViewportMetrics; exports.getViewportProjection = _chunkHTAFDTNRcjs.getViewportProjection; exports.globalImageCache = globalImageCache; exports.greyMorphology = _chunkHTAFDTNRcjs.greyMorphology; exports.groupLayers = _chunkHTAFDTNRcjs.groupLayers; exports.guidePlanes = guidePlanes; exports.guidedFilterColor = guidedFilterColor; exports.handlePaintShortcut = handlePaintShortcut; exports.hasActiveEffects = _chunkWMRIG4XQcjs.hasActiveEffects; exports.hasResampledLegacyMask = _chunkHTAFDTNRcjs.hasResampledLegacyMask; exports.hasSurface = _chunkHTAFDTNRcjs.hasSurface; exports.hasWarp = _chunkHTAFDTNRcjs.hasWarp; exports.hashMaskContent = _chunkHTAFDTNRcjs.hashMaskContent; exports.hashNoise = _chunkWMRIG4XQcjs.hashNoise; exports.healPixels = _chunkTS5IEUW6cjs.healPixels; exports.hexToRgb = _chunkHTAFDTNRcjs.hexToRgb; exports.histogramPath = histogramPath; exports.hitTestAnnotation = _chunkHTAFDTNRcjs.hitTestAnnotation; exports.hitTestCrop = _chunkHTAFDTNRcjs.hitTestCrop; exports.hitTestCurvePoint = hitTestCurvePoint; exports.homographyFromAffine = _chunkEJVDBITDcjs.homographyFromAffine; exports.homographyFromPoints = _chunkEJVDBITDcjs.homographyFromPoints; exports.hslToRgb = _chunkHTAFDTNRcjs.hslToRgb; exports.hueRange = hueRange; exports.hueRangeTables = _chunkHTAFDTNRcjs.hueRangeTables; exports.hueRangeWeight = _chunkHTAFDTNRcjs.hueRangeWeight; exports.hueSaturation = _chunkHTAFDTNRcjs.hueSaturation; exports.identityCurve = _chunkHTAFDTNRcjs.identityCurve; exports.identityLevels = _chunkHTAFDTNRcjs.identityLevels; exports.identityTransform = _chunkHTAFDTNRcjs.identityTransform; exports.identityWarpMesh = _chunkVYW7JBTMcjs.identityWarpMesh; exports.imageEditorStateMigrations = imageEditorStateMigrations; exports.imageToCanvasPoint = _chunkHTAFDTNRcjs.imageToCanvasPoint; exports.importPsd = _chunkHTAFDTNRcjs.importPsd; exports.inflate = _chunk643B2HKCcjs.inflate; exports.inflateRaw = _chunk643B2HKCcjs.inflateRaw; exports.insertCurvePoint = insertCurvePoint; exports.insertLayer = _chunkWMRIG4XQcjs.insertLayer; exports.instancesOf = _chunkHTAFDTNRcjs.instancesOf; exports.invertHomography = _chunkEJVDBITDcjs.invertHomography; exports.invertMatrix3 = _chunkHTAFDTNRcjs.invertMatrix3; exports.invertSelection = _chunkHTAFDTNRcjs.invertSelection; exports.isActiveFilter = _chunkHTAFDTNRcjs.isActiveFilter; exports.isAdjustmentKind = _chunkHTAFDTNRcjs.isAdjustmentKind; exports.isBitDepth = _chunk7ISPWEJAcjs.isBitDepth; exports.isBlendMode = _chunk7ISPWEJAcjs.isBlendMode; exports.isContentsDecoded = _chunkHTAFDTNRcjs.isContentsDecoded; exports.isDefaultDepthMask = _chunkHTAFDTNRcjs.isDefaultDepthMask; exports.isIdentityTransform = _chunkHTAFDTNRcjs.isIdentityTransform; exports.isInterpolation = _chunkWMRIG4XQcjs.isInterpolation; exports.isLayerEffectKind = _chunkWMRIG4XQcjs.isLayerEffectKind; exports.isLayerLocked = _chunkWMRIG4XQcjs.isLayerLocked; exports.isLegacyShape = _chunkHTAFDTNRcjs.isLegacyShape; exports.isPaintTool = isPaintTool; exports.isPainterlyBlendMode = _chunk7ISPWEJAcjs.isPainterlyBlendMode; exports.isPng = _chunkEJVDBITDcjs.isPng; exports.isQuarterTurn = isQuarterTurn; exports.isQuarterTurnSwapped = _chunkHTAFDTNRcjs.isQuarterTurnSwapped; exports.isRenderedLayer = _chunkHTAFDTNRcjs.isRenderedLayer; exports.isRetouchPaintTool = isRetouchPaintTool; exports.isRetouchTool = isRetouchTool; exports.isSelectionEmpty = _chunkHTAFDTNRcjs.isSelectionEmpty; exports.isSelectionMode = _chunkHTAFDTNRcjs.isSelectionMode; exports.isSeparableBlendMode = _chunk7ISPWEJAcjs.isSeparableBlendMode; exports.isSpatialFilter = _chunkHTAFDTNRcjs.isSpatialFilter; exports.isSrgb = isSrgb; exports.isTransformAnchor = _chunkHTAFDTNRcjs.isTransformAnchor; exports.isValidWarp = _chunkHTAFDTNRcjs.isValidWarp; exports.keepDeepSamples = _chunk7ISPWEJAcjs.keepDeepSamples; exports.kelvinToTemperature = _chunkHTAFDTNRcjs.kelvinToTemperature; exports.keysWeight = _chunkWMRIG4XQcjs.keysWeight; exports.latticeViscosity = _chunkL3PXFMOFcjs.latticeViscosity; exports.layerBadge = layerBadge; exports.layerEffectControls = layerEffectControls; exports.layerEffectFields = _chunkWMRIG4XQcjs.layerEffectFields; exports.layerEffectLabel = _chunkWMRIG4XQcjs.layerEffectLabel; exports.layerEffectsBadge = layerEffectsBadge; exports.layerEffectsOf = _chunkHTAFDTNRcjs.layerEffectsOf; exports.layerEffectsPanel = layerEffectsPanel; exports.layerHasThumbnail = layerHasThumbnail; exports.layerLabel = layerLabel; exports.layerMaskCoverage = _chunkHTAFDTNRcjs.layerMaskCoverage; exports.layerMaskFromSelection = _chunkHTAFDTNRcjs.layerMaskFromSelection; exports.layerMaskKey = _chunkHTAFDTNRcjs.layerMaskKey; exports.layerMenu = layerMenu; exports.layerName = _chunkHTAFDTNRcjs.layerName; exports.layerPanelRows = layerPanelRows; exports.layerTree = _chunkHTAFDTNRcjs.layerTree; exports.layerTypeLabel = _chunkHTAFDTNRcjs.layerTypeLabel; exports.layerWarning = layerWarning; exports.layersFromLegacy = _chunkHTAFDTNRcjs.layersFromLegacy; exports.layoutText = _chunkVYW7JBTMcjs.layoutText; exports.legacyAdjustmentLayer = _chunkHTAFDTNRcjs.legacyAdjustmentLayer; exports.legacyMaskOf = _chunkHTAFDTNRcjs.legacyMaskOf; exports.legacyView = _chunkHTAFDTNRcjs.legacyView; exports.lerpPigment = _chunk7ISPWEJAcjs.lerpPigment; exports.lerpPigmentInto = _chunk7ISPWEJAcjs.lerpPigmentInto; exports.levelsValue = _chunkHTAFDTNRcjs.levelsValue; exports.linearSrgbToXy = _chunkHTAFDTNRcjs.linearSrgbToXy; exports.linearToSrgb = _chunkHTAFDTNRcjs.linearToSrgb; exports.linearToSrgb8 = _chunkL3PXFMOFcjs.linearToSrgb8; exports.liveComponent = _chunkHTAFDTNRcjs.liveComponent; exports.liveShapeForDrag = liveShapeForDrag; exports.liveShapeSubpaths = _chunkHTAFDTNRcjs.liveShapeSubpaths; exports.loadImageEditorDocument = loadImageEditorDocument; exports.loadMixer = _chunkL3PXFMOFcjs.loadMixer; exports.loadOpenTypeFont = _chunk2OJACTPRcjs.loadOpenTypeFont; exports.loadWetKernel = _chunkL3PXFMOFcjs.loadWetKernel; exports.luma = _chunkTS5IEUW6cjs.luma; exports.magicWand = magicWand; exports.mapCropHandle = _chunkHTAFDTNRcjs.mapCropHandle; exports.mapLayer = _chunkWMRIG4XQcjs.mapLayer; exports.mapSubpaths = _chunkHTAFDTNRcjs.mapSubpaths; exports.maskBounds = _chunkTS5IEUW6cjs.maskBounds; exports.maskSummary = maskSummary; exports.matrixFromCorners = _chunkHTAFDTNRcjs.matrixFromCorners; exports.matrixFromParams = _chunkHTAFDTNRcjs.matrixFromParams; exports.membraneFill = _chunkTS5IEUW6cjs.membraneFill; exports.mergeLayerEffect = _chunkWMRIG4XQcjs.mergeLayerEffect; exports.mergeShapeComponents = _chunkHTAFDTNRcjs.mergeShapeComponents; exports.migrateSerializedImageEditorState = migrateSerializedImageEditorState; exports.migrateToLayeredState = migrateToLayeredState; exports.mixPigment8 = _chunk7ISPWEJAcjs.mixPigment8; exports.mixPigmentRgb = _chunk7ISPWEJAcjs.mixPigmentRgb; exports.mixPigments = _chunk7ISPWEJAcjs.mixPigments; exports.mixerLoadResult = mixerLoadResult; exports.mixerRates = _chunkL3PXFMOFcjs.mixerRates; exports.modifySelection = _chunkHTAFDTNRcjs.modifySelection; exports.moveCurvePoint = moveCurvePoint; exports.moveLayer = _chunkHTAFDTNRcjs.moveLayer; exports.moveSmartFilter = _chunkHTAFDTNRcjs.moveSmartFilter; exports.mulMatrix3 = _chunkHTAFDTNRcjs.mulMatrix3; exports.needsLegacyBase = needsLegacyBase; exports.neutralHueRange = _chunkHTAFDTNRcjs.neutralHueRange; exports.newContentsId = _chunkHTAFDTNRcjs.newContentsId; exports.newEffectId = _chunkWMRIG4XQcjs.newEffectId; exports.newLayerId = _chunkHTAFDTNRcjs.newLayerId; exports.normalizeAdjustmentLayer = _chunkHTAFDTNRcjs.normalizeAdjustmentLayer; exports.normalizeAdjustmentLayers = _chunkHTAFDTNRcjs.normalizeAdjustmentLayers; exports.normalizeAngle = _chunkHTAFDTNRcjs.normalizeAngle; exports.normalizeBlendMode = _chunk7ISPWEJAcjs.normalizeBlendMode; exports.normalizeBlender = _chunkL3PXFMOFcjs.normalizeBlender; exports.normalizeBrush = _chunkL3PXFMOFcjs.normalizeBrush; exports.normalizeFilter = _chunkHTAFDTNRcjs.normalizeFilter; exports.normalizeFlow = _chunkL3PXFMOFcjs.normalizeFlow; exports.normalizeLayerEffects = _chunkWMRIG4XQcjs.normalizeLayerEffects; exports.normalizeLayerMask = _chunkHTAFDTNRcjs.normalizeLayerMask; exports.normalizeLiveShape = _chunkHTAFDTNRcjs.normalizeLiveShape; exports.normalizeMixer = _chunkL3PXFMOFcjs.normalizeMixer; exports.normalizePlacement = _chunkHTAFDTNRcjs.normalizePlacement; exports.normalizeProcessVersion = _chunkHTAFDTNRcjs.normalizeProcessVersion; exports.normalizeRect = normalizeRect; exports.normalizeRefineEdgeParams = normalizeRefineEdgeParams; exports.normalizeRetouch = _chunkTS5IEUW6cjs.normalizeRetouch; exports.normalizeShapePaint = _chunkHTAFDTNRcjs.normalizeShapePaint; exports.normalizeShapeStroke = _chunkHTAFDTNRcjs.normalizeShapeStroke; exports.normalizeSmartFilter = _chunkHTAFDTNRcjs.normalizeSmartFilter; exports.normalizeSmudge = _chunkL3PXFMOFcjs.normalizeSmudge; exports.normalizeStoredAdjustments = normalizeStoredAdjustments; exports.normalizeSubpaths = _chunkHTAFDTNRcjs.normalizeSubpaths; exports.normalizeText = _chunkHTAFDTNRcjs.normalizeText; exports.normalizeTilt = _chunkL3PXFMOFcjs.normalizeTilt; exports.normalizeWetParams = _chunkL3PXFMOFcjs.normalizeWetParams; exports.offsetLayer = _chunkHTAFDTNRcjs.offsetLayer; exports.offsetShape = _chunkHTAFDTNRcjs.offsetShape; exports.offsetSmartObject = _chunkHTAFDTNRcjs.offsetSmartObject; exports.openPsdFile = openPsdFile; exports.packRgba = _chunk7ISPWEJAcjs.packRgba; exports.packWetParams = _chunkL3PXFMOFcjs.packWetParams; exports.paintPathStroke = _chunkTS5IEUW6cjs.paintPathStroke; exports.paragraphRanges = _chunkVYW7JBTMcjs.paragraphRanges; exports.parseAdjustmentBlock = _chunkHTAFDTNRcjs.parseAdjustmentBlock; exports.parseBlend = _chunkHTAFDTNRcjs.parseBlend; exports.parseColor = parseColor; exports.parseCssColor = _chunkHTAFDTNRcjs.parseCssColor; exports.parseDataUrl = _chunkEJVDBITDcjs.parseDataUrl; exports.parseEffectColor = _chunkWMRIG4XQcjs.parseEffectColor; exports.parseLfx2 = _chunkHTAFDTNRcjs.parseLfx2; exports.parseLrfx = _chunkHTAFDTNRcjs.parseLrfx; exports.parseOpenTypeFont = _chunk2OJACTPRcjs.parseOpenTypeFont; exports.parsePatternBlock = _chunkHTAFDTNRcjs.parsePatternBlock; exports.parseSelectionMode = _chunkHTAFDTNRcjs.parseSelectionMode; exports.parseVersionedDescriptor = _chunkHTAFDTNRcjs.parseVersionedDescriptor; exports.patchParagraphStyle = _chunkHTAFDTNRcjs.patchParagraphStyle; exports.patchTextStyle = _chunkHTAFDTNRcjs.patchTextStyle; exports.pathStrokeCoverage = _chunkTS5IEUW6cjs.pathStrokeCoverage; exports.pathStrokeDabs = _chunkTS5IEUW6cjs.pathStrokeDabs; exports.perDabStrength = _chunkTS5IEUW6cjs.perDabStrength; exports.photoFilterMatrix = _chunkHTAFDTNRcjs.photoFilterMatrix; exports.pigment8 = _chunk7ISPWEJAcjs.pigment8; exports.pigmentColor = _chunkL3PXFMOFcjs.pigmentColor; exports.pigmentOf = _chunkL3PXFMOFcjs.pigmentOf; exports.pixelLayerBounds = _chunkHTAFDTNRcjs.pixelLayerBounds; exports.pixelLayers = _chunkHTAFDTNRcjs.pixelLayers; exports.pixelPigment = _chunkL3PXFMOFcjs.pixelPigment; exports.placeContents = _chunkHTAFDTNRcjs.placeContents; exports.placeLayer = _chunkHTAFDTNRcjs.placeLayer; exports.placementAt = _chunkHTAFDTNRcjs.placementAt; exports.placementBounds = _chunkHTAFDTNRcjs.placementBounds; exports.placementGeometry = _chunkHTAFDTNRcjs.placementGeometry; exports.pngDataUrl = _chunkEJVDBITDcjs.pngDataUrl; exports.pointerPressure = pointerPressure; exports.polygonCoverage = polygonCoverage; exports.polygonSelection = polygonSelection; exports.posterizeValue = _chunkHTAFDTNRcjs.posterizeValue; exports.presetWarp = _chunkHTAFDTNRcjs.presetWarp; exports.previewStep = previewStep; exports.profileBytes = profileBytes; exports.projectImagePoint = _chunkHTAFDTNRcjs.projectImagePoint; exports.projectImageRect = _chunkHTAFDTNRcjs.projectImageRect; exports.projectMaskCoverage = _chunkHTAFDTNRcjs.projectMaskCoverage; exports.projectQuarterTurn = projectQuarterTurn; exports.proxyOf = _chunk7ISPWEJAcjs.proxyOf; exports.psdBytesFromBase64 = psdBytesFromBase64; exports.psdFileName = psdFileName; exports.psdPatternToEffectPattern = _chunkHTAFDTNRcjs.psdPatternToEffectPattern; exports.psdToLayers = _chunkHTAFDTNRcjs.psdToLayers; exports.pullWarpMesh = _chunkVYW7JBTMcjs.pullWarpMesh; exports.put255 = _chunkL3PXFMOFcjs.put255; exports.quickMaskPixels = quickMaskPixels; exports.rangeLightness = _chunkHTAFDTNRcjs.rangeLightness; exports.rasterContents = _chunkHTAFDTNRcjs.rasterContents; exports.rasterMaskFromLegacy = _chunkHTAFDTNRcjs.rasterMaskFromLegacy; exports.rasterizeCoverage = _chunkHTAFDTNRcjs.rasterizeCoverage; exports.rasterizeDab = _chunkL3PXFMOFcjs.rasterizeDab; exports.rasterizeSmartObject = _chunkHTAFDTNRcjs.rasterizeSmartObject; exports.readAdjustmentControls = readAdjustmentControls; exports.readDeepRegion = _chunk7ISPWEJAcjs.readDeepRegion; exports.readPixel = _chunk7ISPWEJAcjs.readPixel; exports.readPsd = _chunkHTAFDTNRcjs.readPsd; exports.readRegion = _chunk7ISPWEJAcjs.readRegion; exports.readSourceRegion = _chunkTS5IEUW6cjs.readSourceRegion; exports.rectSelection = rectSelection; exports.rectToQuad = _chunkEJVDBITDcjs.rectToQuad; exports.reduceSurface = _chunkWMRIG4XQcjs.reduceSurface; exports.referencePoint = _chunkHTAFDTNRcjs.referencePoint; exports.refineCoverage = refineCoverage; exports.refineEdgeHalo = refineEdgeHalo; exports.refineSelection = refineSelection; exports.reflectanceToRgb = _chunk7ISPWEJAcjs.reflectanceToRgb; exports.removeAlpha = _chunkHTAFDTNRcjs.removeAlpha; exports.removeCurvePoint = removeCurvePoint; exports.removeLayer = _chunkHTAFDTNRcjs.removeLayer; exports.removeLayerEffect = _chunkHTAFDTNRcjs.removeLayerEffect; exports.removeLayerFilter = _chunkHTAFDTNRcjs.removeLayerFilter; exports.removeSmartFilter = _chunkHTAFDTNRcjs.removeSmartFilter; exports.renderLayerEffects = _chunkWMRIG4XQcjs.renderLayerEffects; exports.renderLayeredBase = renderLayeredBase; exports.renderShape = _chunkHTAFDTNRcjs.renderShape; exports.renderShapeRect = _chunkHTAFDTNRcjs.renderShapeRect; exports.renderSmartObject = _chunkHTAFDTNRcjs.renderSmartObject; exports.renderText = _chunkHTAFDTNRcjs.renderText; exports.replaceContents = _chunkHTAFDTNRcjs.replaceContents; exports.replaceTextRange = _chunkHTAFDTNRcjs.replaceTextRange; exports.requireLayer = _chunkHTAFDTNRcjs.requireLayer; exports.requireOperation = _chunkHTAFDTNRcjs.requireOperation; exports.requireShapeLayer = _chunkHTAFDTNRcjs.requireShapeLayer; exports.requireSmartObject = _chunkHTAFDTNRcjs.requireSmartObject; exports.requireTypeLayer = _chunkHTAFDTNRcjs.requireTypeLayer; exports.requireUnlocked = _chunkHTAFDTNRcjs.requireUnlocked; exports.rerender = _chunkHTAFDTNRcjs.rerender; exports.rerenderShape = _chunkHTAFDTNRcjs.rerenderShape; exports.rerenderText = _chunkHTAFDTNRcjs.rerenderText; exports.resizePixels = resizePixels; exports.resizeSelection = _chunkHTAFDTNRcjs.resizeSelection; exports.resizeWarpMesh = _chunkVYW7JBTMcjs.resizeWarpMesh; exports.resolveExternalAssets = _chunkHTAFDTNRcjs.resolveExternalAssets; exports.resolveMosaicRegionBounds = resolveMosaicRegionBounds; exports.resolveProfile = resolveProfile; exports.restyleRange = _chunkVYW7JBTMcjs.restyleRange; exports.rgbToGray = _chunkHTAFDTNRcjs.rgbToGray; exports.rgbToHsl = _chunkHTAFDTNRcjs.rgbToHsl; exports.rgbToReflectance = _chunk7ISPWEJAcjs.rgbToReflectance; exports.rgbUnitToHex = rgbUnitToHex; exports.rgbaViewOfGrey = _chunkTS5IEUW6cjs.rgbaViewOfGrey; exports.runLayerFilters = _chunkHTAFDTNRcjs.runLayerFilters; exports.runLayerMenuAction = runLayerMenuAction; exports.sampleLut = _chunkHTAFDTNRcjs.sampleLut; exports.sampleToneLut = _chunkHTAFDTNRcjs.sampleToneLut; exports.saturationOf = _chunkTS5IEUW6cjs.saturationOf; exports.scaleLayerEffect = _chunkWMRIG4XQcjs.scaleLayerEffect; exports.seamlessClone = _chunkTS5IEUW6cjs.seamlessClone; exports.selectionArea = _chunkHTAFDTNRcjs.selectionArea; exports.selectionFromCoverage = _chunkHTAFDTNRcjs.selectionFromCoverage; exports.selectionFromPixels = _chunkHTAFDTNRcjs.selectionFromPixels; exports.selectionModeFromModifiers = selectionModeFromModifiers; exports.selectionOutline = selectionOutline; exports.selectionToCoverage = _chunkHTAFDTNRcjs.selectionToCoverage; exports.selectionToPixels = _chunkHTAFDTNRcjs.selectionToPixels; exports.selectionValueAt = _chunkHTAFDTNRcjs.selectionValueAt; exports.serializeColorMode = serializeColorMode; exports.serializeColorProfile = serializeColorProfile; exports.serializeContents = _chunkHTAFDTNRcjs.serializeContents; exports.serializeEffects = _chunkHTAFDTNRcjs.serializeEffects; exports.serializeLayer = _chunkHTAFDTNRcjs.serializeLayer; exports.serializeLayers = _chunkHTAFDTNRcjs.serializeLayers; exports.serializeLayersExternal = _chunkHTAFDTNRcjs.serializeLayersExternal; exports.serializePatterns = _chunkHTAFDTNRcjs.serializePatterns; exports.serializeSelection = _chunkHTAFDTNRcjs.serializeSelection; exports.setControlPath = setControlPath; exports.setLayerEffects = _chunkHTAFDTNRcjs.setLayerEffects; exports.setLayerEffectsEnabled = _chunkHTAFDTNRcjs.setLayerEffectsEnabled; exports.setLayerMask = _chunkHTAFDTNRcjs.setLayerMask; exports.setLayerProperties = _chunkHTAFDTNRcjs.setLayerProperties; exports.setLum = _chunk7ISPWEJAcjs.setLum; exports.setPigmentColor = _chunk7ISPWEJAcjs.setPigmentColor; exports.setRetouchChoice = setRetouchChoice; exports.setSmartFilterMask = _chunkHTAFDTNRcjs.setSmartFilterMask; exports.setSmartFiltersEnabled = _chunkHTAFDTNRcjs.setSmartFiltersEnabled; exports.setSmartPlacement = _chunkHTAFDTNRcjs.setSmartPlacement; exports.shadeTile = _chunkL3PXFMOFcjs.shadeTile; exports.shapeAsPixelLayer = _chunkHTAFDTNRcjs.shapeAsPixelLayer; exports.shapeFromAnnotation = _chunkHTAFDTNRcjs.shapeFromAnnotation; exports.shapeGeometryBounds = _chunkHTAFDTNRcjs.shapeGeometryBounds; exports.shapeLayers = _chunkHTAFDTNRcjs.shapeLayers; exports.shapeOutline = _chunkHTAFDTNRcjs.shapeOutline; exports.shapeRenderClip = _chunkHTAFDTNRcjs.shapeRenderClip; exports.shiftCoverage = _chunkHTAFDTNRcjs.shiftCoverage; exports.smartFilterRows = smartFilterRows; exports.smartObjectLayers = _chunkHTAFDTNRcjs.smartObjectLayers; exports.smoothCoverage = _chunkHTAFDTNRcjs.smoothCoverage; exports.smoothPoints = _chunkL3PXFMOFcjs.smoothPoints; exports.smudgeEffect = _chunkTS5IEUW6cjs.smudgeEffect; exports.solidSurface = _chunk7ISPWEJAcjs.solidSurface; exports.solveMembrane = _chunkTS5IEUW6cjs.solveMembrane; exports.spliceRuns = _chunkVYW7JBTMcjs.spliceRuns; exports.splitOverlayAnnotations = splitOverlayAnnotations; exports.sponge = _chunkTS5IEUW6cjs.sponge; exports.spongeEffect = _chunkTS5IEUW6cjs.spongeEffect; exports.spotHealPixels = _chunkTS5IEUW6cjs.spotHealPixels; exports.spotHealWindow = _chunkTS5IEUW6cjs.spotHealWindow; exports.srgb8ToLab = srgb8ToLab; exports.srgbByteToLinear = _chunkL3PXFMOFcjs.srgbByteToLinear; exports.srgbDecode = _chunk7ISPWEJAcjs.srgbDecode; exports.srgbEncode = _chunk7ISPWEJAcjs.srgbEncode; exports.srgbToLinear = _chunkHTAFDTNRcjs.srgbToLinear; exports.standardBlendMode = _chunk7ISPWEJAcjs.standardBlendMode; exports.stepSlotTs = _chunkL3PXFMOFcjs.stepSlotTs; exports.styleAt = _chunkVYW7JBTMcjs.styleAt; exports.sumHistograms = sumHistograms; exports.surfaceBytes = _chunk7ISPWEJAcjs.surfaceBytes; exports.surfaceDepth = _chunk7ISPWEJAcjs.surfaceDepth; exports.surfaceFromDeepPixels = _chunk7ISPWEJAcjs.surfaceFromDeepPixels; exports.surfaceFromPixels = _chunk7ISPWEJAcjs.surfaceFromPixels; exports.surfacesEqual = _chunk7ISPWEJAcjs.surfacesEqual; exports.tempTintToXy = _chunkHTAFDTNRcjs.tempTintToXy; exports.temperatureToKelvin = _chunkHTAFDTNRcjs.temperatureToKelvin; exports.textIndexAt = _chunkVYW7JBTMcjs.textIndexAt; exports.textMatrix = _chunkHTAFDTNRcjs.textMatrix; exports.textOutlines = _chunkHTAFDTNRcjs.textOutlines; exports.textRange = _chunkHTAFDTNRcjs.textRange; exports.tileCoord = _chunk7ISPWEJAcjs.tileCoord; exports.tileKey = _chunk7ISPWEJAcjs.tileKey; exports.tileRect = _chunk7ISPWEJAcjs.tileRect; exports.tileSamples = _chunk7ISPWEJAcjs.tileSamples; exports.tileSamples16 = _chunk7ISPWEJAcjs.tileSamples16; exports.tileSamples32 = _chunk7ISPWEJAcjs.tileSamples32; exports.tilesInRect = _chunk7ISPWEJAcjs.tilesInRect; exports.tipFalloff = _chunkL3PXFMOFcjs.tipFalloff; exports.tipReach = _chunkL3PXFMOFcjs.tipReach; exports.tipShape = _chunkL3PXFMOFcjs.tipShape; exports.to16From32 = _chunk7ISPWEJAcjs.to16From32; exports.to16From8 = _chunk7ISPWEJAcjs.to16From8; exports.to32From16 = _chunk7ISPWEJAcjs.to32From16; exports.to32From8 = _chunk7ISPWEJAcjs.to32From8; exports.to8From16 = _chunk7ISPWEJAcjs.to8From16; exports.to8From32 = _chunk7ISPWEJAcjs.to8From32; exports.toHex = toHex; exports.toTextSpace = _chunkHTAFDTNRcjs.toTextSpace; exports.toneCurve = _chunkHTAFDTNRcjs.toneCurve; exports.toneLuts = _chunkHTAFDTNRcjs.toneLuts; exports.toneOf = _chunkTS5IEUW6cjs.toneOf; exports.toneRange = toneRange; exports.transformHomography = _chunkHTAFDTNRcjs.transformHomography; exports.transformMap = _chunkHTAFDTNRcjs.transformMap; exports.transformShapeComponents = _chunkHTAFDTNRcjs.transformShapeComponents; exports.transformSurface = _chunkWMRIG4XQcjs.transformSurface; exports.transformTypeLayer = _chunkHTAFDTNRcjs.transformTypeLayer; exports.transformedBounds = _chunkWMRIG4XQcjs.transformedBounds; exports.transformedBox = _chunkHTAFDTNRcjs.transformedBox; exports.transformedPoint = _chunkHTAFDTNRcjs.transformedPoint; exports.translateSurface = _chunk7ISPWEJAcjs.translateSurface; exports.typeAsPixelLayer = _chunkHTAFDTNRcjs.typeAsPixelLayer; exports.typeFrame = _chunkHTAFDTNRcjs.typeFrame; exports.typeFromAnnotation = _chunkHTAFDTNRcjs.typeFromAnnotation; exports.typeLayerAt = typeLayerAt; exports.typeLayerName = _chunkHTAFDTNRcjs.typeLayerName; exports.ungroupLayer = _chunkHTAFDTNRcjs.ungroupLayer; exports.uniformTile = _chunk7ISPWEJAcjs.uniformTile; exports.unionRect = _chunkHTAFDTNRcjs.unionRect; exports.unprojectCanvasPoint = _chunkHTAFDTNRcjs.unprojectCanvasPoint; exports.updateLayerEffect = _chunkHTAFDTNRcjs.updateLayerEffect; exports.updateLayerFilter = _chunkHTAFDTNRcjs.updateLayerFilter; exports.updateLayerMaskProps = _chunkHTAFDTNRcjs.updateLayerMaskProps; exports.updateShapeLayer = _chunkHTAFDTNRcjs.updateShapeLayer; exports.updateSmartFilter = _chunkHTAFDTNRcjs.updateSmartFilter; exports.updateTypeLayer = _chunkHTAFDTNRcjs.updateTypeLayer; exports.uvToXy = _chunkHTAFDTNRcjs.uvToXy; exports.validateEffectGradient = _chunkWMRIG4XQcjs.validateEffectGradient; exports.validateLayerEffect = _chunkWMRIG4XQcjs.validateLayerEffect; exports.validateLayerEffects = _chunkWMRIG4XQcjs.validateLayerEffects; exports.versionedDescriptorBytes = _chunkHTAFDTNRcjs.versionedDescriptorBytes; exports.vibranceLinear = _chunkHTAFDTNRcjs.vibranceLinear; exports.vibrancePixel = _chunkHTAFDTNRcjs.vibrancePixel; exports.walkDabs = _chunkL3PXFMOFcjs.walkDabs; exports.warpMeshEditPoints = _chunkVYW7JBTMcjs.warpMeshEditPoints; exports.warpMeshGridCurves = _chunkVYW7JBTMcjs.warpMeshGridCurves; exports.warpMeshParamAt = _chunkVYW7JBTMcjs.warpMeshParamAt; exports.warpPresetMesh = _chunkVYW7JBTMcjs.warpPresetMesh; exports.warpSurface = _chunkWMRIG4XQcjs.warpSurface; exports.wbMatrix = _chunkHTAFDTNRcjs.wbMatrix; exports.wetSimdSupported = _chunkL3PXFMOFcjs.wetSimdSupported; exports.wetSupport = _chunkL3PXFMOFcjs.wetSupport; exports.whiteBalanceFromSample = _chunkHTAFDTNRcjs.whiteBalanceFromSample; exports.whiteBalanceMatrix = _chunkHTAFDTNRcjs.whiteBalanceMatrix; exports.withFilterMaskSurface = _chunkHTAFDTNRcjs.withFilterMaskSurface; exports.withNewIds = _chunkHTAFDTNRcjs.withNewIds; exports.writeAdjustmentBlock = _chunkHTAFDTNRcjs.writeAdjustmentBlock; exports.writeDeepRegion = _chunk7ISPWEJAcjs.writeDeepRegion; exports.writeLfx2 = _chunkHTAFDTNRcjs.writeLfx2; exports.writePatternBlock = _chunkHTAFDTNRcjs.writePatternBlock; exports.writePsd = _chunkHTAFDTNRcjs.writePsd; exports.writeRegion = _chunk7ISPWEJAcjs.writeRegion; exports.xyToTempTint = _chunkHTAFDTNRcjs.xyToTempTint; exports.xyToUv = _chunkHTAFDTNRcjs.xyToUv;
15035
15035
  //# sourceMappingURL=index.cjs.map