@pixerate/editor 0.211.0 → 0.213.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.
@@ -1,8 +1,10 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2; var _class3; var _class4; var _class5; var _class6; var _class7; var _class8; var _class9; var _class10; var _class11; var _class12; var _class13; var _class14; var _class15; var _class16; var _class17;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2; var _class3; var _class4; var _class5; var _class6; var _class7; var _class8; var _class9; var _class10; var _class11; var _class12; var _class13; var _class14; var _class15; var _class16; var _class17; var _class18;
2
2
 
3
3
 
4
4
 
5
- var _chunk3T5VCDIVcjs = require('../chunk-3T5VCDIV.cjs');
5
+
6
+
7
+ var _chunkLCCMOWR7cjs = require('../chunk-LCCMOWR7.cjs');
6
8
 
7
9
 
8
10
 
@@ -693,6 +695,15 @@ var _chunkBROJYMWUcjs = require('../chunk-BROJYMWU.cjs');
693
695
 
694
696
 
695
697
 
698
+
699
+
700
+
701
+
702
+
703
+
704
+
705
+
706
+
696
707
 
697
708
 
698
709
 
@@ -708,6 +719,8 @@ require('../chunk-ROVK6AXX.cjs');
708
719
  require('../chunk-CVFAAZXE.cjs');
709
720
 
710
721
 
722
+
723
+
711
724
  var _chunkGF2RBSDMcjs = require('../chunk-GF2RBSDM.cjs');
712
725
  require('../chunk-NM3G4VQT.cjs');
713
726
 
@@ -1175,10 +1188,10 @@ function emptyHistogram() {
1175
1188
  max: 0
1176
1189
  };
1177
1190
  }
1178
- function addToHistogram(h, data, stride, rect) {
1179
- for (let y = rect.y; y < rect.y + rect.height; y++) {
1180
- let i = (y * stride + rect.x) * 4;
1181
- for (let x = 0; x < rect.width; x++, i += 4) {
1191
+ function addToHistogram(h, data, stride, rect2) {
1192
+ for (let y = rect2.y; y < rect2.y + rect2.height; y++) {
1193
+ let i = (y * stride + rect2.x) * 4;
1194
+ for (let x = 0; x < rect2.width; x++, i += 4) {
1182
1195
  if (!(data[i + 3] > 0)) {
1183
1196
  h.transparent++;
1184
1197
  continue;
@@ -1639,6 +1652,63 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1639
1652
  }
1640
1653
  ctx.restore();
1641
1654
  }
1655
+ if (options.pathEdit) {
1656
+ const e = options.pathEdit;
1657
+ ctx.save();
1658
+ try {
1659
+ const scr = (p) => _chunkH65IBXFIcjs.projectImagePoint.call(void 0, p, projection);
1660
+ const trace2 = (c) => {
1661
+ const [a, b, d, f] = c.map(scr);
1662
+ ctx.moveTo(a.x, a.y);
1663
+ if (f) ctx.bezierCurveTo(b.x, b.y, d.x, d.y, f.x, f.y);
1664
+ else ctx.lineTo(b.x, b.y);
1665
+ };
1666
+ ctx.beginPath();
1667
+ e.curves.forEach(trace2);
1668
+ ctx.lineWidth = 1.5 * u;
1669
+ ctx.strokeStyle = OVERLAY_HANDLE_EDGE;
1670
+ ctx.stroke();
1671
+ if (e.preview) {
1672
+ ctx.beginPath();
1673
+ trace2(e.preview);
1674
+ ctx.setLineDash([4 * u, 3 * u]);
1675
+ ctx.stroke();
1676
+ ctx.setLineDash([]);
1677
+ }
1678
+ ctx.beginPath();
1679
+ for (const h of e.handles) {
1680
+ const a = scr(h.anchor);
1681
+ const q = scr(h.point);
1682
+ ctx.moveTo(a.x, a.y);
1683
+ ctx.lineTo(q.x, q.y);
1684
+ }
1685
+ ctx.lineWidth = 1 * u;
1686
+ ctx.stroke();
1687
+ for (const h of e.handles) {
1688
+ const q = scr(h.point);
1689
+ ctx.beginPath();
1690
+ ctx.arc(q.x, q.y, 3 * u, 0, Math.PI * 2);
1691
+ ctx.fillStyle = OVERLAY_HANDLE_EDGE;
1692
+ ctx.fill();
1693
+ }
1694
+ const size = 6 * u;
1695
+ ctx.lineWidth = 1 * u;
1696
+ for (const a of e.anchors) {
1697
+ const q = scr(a.point);
1698
+ ctx.fillStyle = a.selected ? OVERLAY_HANDLE_EDGE : "#ffffff";
1699
+ ctx.fillRect(q.x - size / 2, q.y - size / 2, size, size);
1700
+ ctx.strokeRect(q.x - size / 2, q.y - size / 2, size, size);
1701
+ }
1702
+ if (e.marquee) {
1703
+ const a = scr({ x: e.marquee.x, y: e.marquee.y });
1704
+ const b = scr({ x: e.marquee.x + e.marquee.width, y: e.marquee.y + e.marquee.height });
1705
+ ctx.setLineDash([4 * u, 3 * u]);
1706
+ ctx.strokeRect(Math.min(a.x, b.x), Math.min(a.y, b.y), Math.abs(b.x - a.x), Math.abs(b.y - a.y));
1707
+ }
1708
+ } catch (e11) {
1709
+ }
1710
+ ctx.restore();
1711
+ }
1642
1712
  if (isActivelyCropping) {
1643
1713
  const activeCrop = options.draftCrop !== void 0 && options.draftCrop !== null ? options.draftCrop : _nullishCoalesce(crop, () => ( { x: 0, y: 0, width: naturalWidth, height: naturalHeight }));
1644
1714
  this.drawCropOverlay(ctx, _chunkH65IBXFIcjs.getViewportMetrics.call(void 0, geoState, vpWidth, vpHeight, true, activeCrop), u);
@@ -1703,7 +1773,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1703
1773
  _chunkH65IBXFIcjs.applyDepthMask.call(void 0, imageData, maskData, depthMask);
1704
1774
  }
1705
1775
  }
1706
- } catch (e11) {
1776
+ } catch (e12) {
1707
1777
  }
1708
1778
  }
1709
1779
  _optionalChain([onPixels, 'optionalCall', _27 => _27(imageData)]);
@@ -1742,7 +1812,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1742
1812
  if (!source.enabled || !source.maskSource) return null;
1743
1813
  return _nullishCoalesce(this.depthMaps.get(`${source.maskSource}|${width}x${height}`), () => ( null));
1744
1814
  },
1745
- rasterizeAnnotation: (annotation, rect) => this.rasterizeAnnotation(annotation, rect),
1815
+ rasterizeAnnotation: (annotation, rect2) => this.rasterizeAnnotation(annotation, rect2),
1746
1816
  version: `${_nullishCoalesce(_optionalChain([host, 'optionalAccess', _33 => _33.version, 'call', _34 => _34()]), () => ( ""))}:${this.assetVersion}`,
1747
1817
  globalLight: _optionalChain([host, 'optionalAccess', _35 => _35.globalLight, 'optionalCall', _36 => _36()]),
1748
1818
  pattern: _optionalChain([host, 'optionalAccess', _37 => _37.pattern]) ? (id) => host.pattern(id) : void 0
@@ -1754,25 +1824,25 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1754
1824
  for (const l of _chunkUOGKSVRQcjs.flattenLayers.call(void 0, layers)) {
1755
1825
  const source = _optionalChain([l, 'access', _38 => _38.mask, 'optionalAccess', _39 => _39.source]);
1756
1826
  if (_optionalChain([source, 'optionalAccess', _40 => _40.enabled]) && source.maskSource) {
1757
- const key = `${source.maskSource}|${width}x${height}`;
1758
- if (this.depthMaps.has(key)) continue;
1827
+ const key2 = `${source.maskSource}|${width}x${height}`;
1828
+ if (this.depthMaps.has(key2)) continue;
1759
1829
  try {
1760
1830
  const maskImg = await this.imageCache.get(source.maskSource);
1761
1831
  const canvas = this.createCanvas(width, height);
1762
1832
  const mctx = canvas.getContext("2d");
1763
1833
  const data = mctx ? (mctx.drawImage(maskImg, 0, 0, width, height), _optionalChain([mctx, 'access', _41 => _41.getImageData, 'optionalCall', _42 => _42(0, 0, width, height)])) : null;
1764
1834
  if (data) {
1765
- this.depthMaps.set(key, { width, height, data: data.data });
1835
+ this.depthMaps.set(key2, { width, height, data: data.data });
1766
1836
  this.assetVersion++;
1767
1837
  }
1768
- } catch (e12) {
1838
+ } catch (e13) {
1769
1839
  }
1770
1840
  }
1771
1841
  if (l.type === "annotation" && l.annotation.type === "image" && !this.imageCache.peek(l.annotation.src)) {
1772
1842
  try {
1773
1843
  await this.imageCache.get(l.annotation.src);
1774
1844
  this.assetVersion++;
1775
- } catch (e13) {
1845
+ } catch (e14) {
1776
1846
  }
1777
1847
  }
1778
1848
  }
@@ -1783,34 +1853,34 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1783
1853
  return Boolean(ctx && typeof ctx.getImageData === "function");
1784
1854
  }
1785
1855
  /** One annotation drawn into a tile-sized RGBA buffer at `rect` (document space), or `null` without a canvas. */
1786
- rasterizeAnnotation(annotation, rect) {
1787
- if (!this.scratch) this.scratch = this.createCanvas(rect.width, rect.height);
1856
+ rasterizeAnnotation(annotation, rect2) {
1857
+ if (!this.scratch) this.scratch = this.createCanvas(rect2.width, rect2.height);
1788
1858
  const canvas = this.scratch;
1789
- if (canvas.width !== rect.width || canvas.height !== rect.height) {
1790
- canvas.width = rect.width;
1791
- canvas.height = rect.height;
1859
+ if (canvas.width !== rect2.width || canvas.height !== rect2.height) {
1860
+ canvas.width = rect2.width;
1861
+ canvas.height = rect2.height;
1792
1862
  }
1793
1863
  const ctx = canvas.getContext("2d");
1794
1864
  if (!ctx || typeof ctx.getImageData !== "function") return null;
1795
1865
  try {
1796
1866
  ctx.setTransform(1, 0, 0, 1, 0, 0);
1797
- ctx.clearRect(0, 0, rect.width, rect.height);
1798
- ctx.setTransform(1, 0, 0, 1, -rect.x, -rect.y);
1867
+ ctx.clearRect(0, 0, rect2.width, rect2.height);
1868
+ ctx.setTransform(1, 0, 0, 1, -rect2.x, -rect2.y);
1799
1869
  const img = annotation.type === "image" ? _nullishCoalesce(this.imageCache.peek(annotation.src), () => ( null)) : null;
1800
1870
  this.drawAnnotationShape(ctx, annotation, img);
1801
1871
  ctx.setTransform(1, 0, 0, 1, 0, 0);
1802
- return new Uint8ClampedArray(ctx.getImageData(0, 0, rect.width, rect.height).data);
1803
- } catch (e14) {
1872
+ return new Uint8ClampedArray(ctx.getImageData(0, 0, rect2.width, rect2.height).data);
1873
+ } catch (e15) {
1804
1874
  return null;
1805
1875
  }
1806
1876
  }
1807
- putTile(ctx, data, tx, ty, rect) {
1808
- const ox = tx * _chunk474IQG74cjs.TILE - rect.x;
1809
- const oy = ty * _chunk474IQG74cjs.TILE - rect.y;
1877
+ putTile(ctx, data, tx, ty, rect2) {
1878
+ const ox = tx * _chunk474IQG74cjs.TILE - rect2.x;
1879
+ const oy = ty * _chunk474IQG74cjs.TILE - rect2.y;
1810
1880
  const x0 = Math.max(0, -ox);
1811
1881
  const y0 = Math.max(0, -oy);
1812
- const x1 = Math.min(_chunk474IQG74cjs.TILE, rect.width - ox);
1813
- const y1 = Math.min(_chunk474IQG74cjs.TILE, rect.height - oy);
1882
+ const x1 = Math.min(_chunk474IQG74cjs.TILE, rect2.width - ox);
1883
+ const y1 = Math.min(_chunk474IQG74cjs.TILE, rect2.height - oy);
1814
1884
  if (x1 <= x0 || y1 <= y0) return;
1815
1885
  const img = ctx.createImageData(_chunk474IQG74cjs.TILE, _chunk474IQG74cjs.TILE);
1816
1886
  img.data.set(data);
@@ -1822,23 +1892,23 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1822
1892
  * uploading only the tiles that changed since the last render.
1823
1893
  */
1824
1894
  updateComposite(layers, region, width, height, options = {}) {
1825
- const rect = coveringRect(region);
1895
+ const rect2 = coveringRect(region);
1826
1896
  let comp = this.comp;
1827
1897
  let fresh = false;
1828
- if (!comp || comp.rect.x !== rect.x || comp.rect.y !== rect.y || comp.rect.width !== rect.width || comp.rect.height !== rect.height) {
1829
- const canvas = this.createCanvas(rect.width, rect.height);
1830
- comp = this.comp = new CompositeCanvas(canvas, rect);
1898
+ if (!comp || comp.rect.x !== rect2.x || comp.rect.y !== rect2.y || comp.rect.width !== rect2.width || comp.rect.height !== rect2.height) {
1899
+ const canvas = this.createCanvas(rect2.width, rect2.height);
1900
+ comp = this.comp = new CompositeCanvas(canvas, rect2);
1831
1901
  fresh = true;
1832
1902
  }
1833
1903
  const ctx = comp.canvas.getContext("2d");
1834
1904
  if (!ctx || typeof ctx.createImageData !== "function") return null;
1835
1905
  let changed = false;
1836
- this.compositor.compositeTiles(layers, rect, this.compositorSources(width, height), (tx, ty, data) => {
1837
- const key = _chunk474IQG74cjs.tileKey.call(void 0, tx, ty);
1838
- if (comp.tiles.get(key) === data) return;
1839
- comp.tiles.set(key, data);
1840
- comp.histograms.delete(key);
1841
- this.putTile(ctx, data, tx, ty, rect);
1906
+ this.compositor.compositeTiles(layers, rect2, this.compositorSources(width, height), (tx, ty, data) => {
1907
+ const key2 = _chunk474IQG74cjs.tileKey.call(void 0, tx, ty);
1908
+ if (comp.tiles.get(key2) === data) return;
1909
+ comp.tiles.set(key2, data);
1910
+ comp.histograms.delete(key2);
1911
+ this.putTile(ctx, data, tx, ty, rect2);
1842
1912
  changed = true;
1843
1913
  }, { checkpointLayerId: options.checkpointLayerId, dirty: fresh ? void 0 : options.dirty });
1844
1914
  if (changed) comp.version++;
@@ -1857,8 +1927,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1857
1927
  const rotated = _chunkH65IBXFIcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
1858
1928
  const baseW = Math.max(1, Math.round(rotated.width));
1859
1929
  const baseH = Math.max(1, Math.round(rotated.height));
1860
- const key = `${this.displayKey}:${comp.version}|${region.x},${region.y},${region.width},${region.height}|${_chunkH65IBXFIcjs.normalizeAngle.call(void 0, transform.rotate)},${transform.flipH},${transform.flipV}|${opacity}|${blur}`;
1861
- if (this.cachedPostCanvas && this.cachedPostKey === key) return { canvas: this.cachedPostCanvas, histogram: this.cachedPostHistogram };
1930
+ const key2 = `${this.displayKey}:${comp.version}|${region.x},${region.y},${region.width},${region.height}|${_chunkH65IBXFIcjs.normalizeAngle.call(void 0, transform.rotate)},${transform.flipH},${transform.flipV}|${opacity}|${blur}`;
1931
+ if (this.cachedPostCanvas && this.cachedPostKey === key2) return { canvas: this.cachedPostCanvas, histogram: this.cachedPostHistogram };
1862
1932
  const canvas = this.cachedPostCanvas && this.cachedPostCanvas.width === baseW && this.cachedPostCanvas.height === baseH ? this.cachedPostCanvas : this.createCanvas(baseW, baseH);
1863
1933
  const ctx = canvas.getContext("2d");
1864
1934
  if (!ctx) return null;
@@ -1872,7 +1942,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1872
1942
  ctx.restore();
1873
1943
  const histogram = this.applyPost(ctx, baseW, baseH, state);
1874
1944
  this.cachedPostCanvas = canvas;
1875
- this.cachedPostKey = key;
1945
+ this.cachedPostKey = key2;
1876
1946
  this.cachedPostHistogram = histogram;
1877
1947
  return { canvas, histogram };
1878
1948
  }
@@ -1908,11 +1978,11 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1908
1978
  /** A layer's mask as canvas-sized coverage for its mask view, kept while the mask is unchanged. */
1909
1979
  maskViewSelection(layer, width, height) {
1910
1980
  if (!layer.mask || layer.mask.source || width < 1 || height < 1) return null;
1911
- const key = `${width}x${height}:${layer.type === "pixel" ? `${layer.offset.x},${layer.offset.y}` : ""}`;
1981
+ const key2 = `${width}x${height}:${layer.type === "pixel" ? `${layer.offset.x},${layer.offset.y}` : ""}`;
1912
1982
  const cached = this.maskViewCache.get(layer.mask.surface);
1913
- if (_optionalChain([cached, 'optionalAccess', _49 => _49.key]) === key) return cached.mask;
1983
+ if (_optionalChain([cached, 'optionalAccess', _49 => _49.key]) === key2) return cached.mask;
1914
1984
  const mask = _chunkH65IBXFIcjs.layerMaskSelection.call(void 0, layer, width, height);
1915
- if (mask) this.maskViewCache.set(layer.mask.surface, { key, mask });
1985
+ if (mask) this.maskViewCache.set(layer.mask.surface, { key: key2, mask });
1916
1986
  return mask;
1917
1987
  }
1918
1988
  /** A mask alone in grey (white = revealed), opaque, drawn in natural image space. */
@@ -1931,16 +2001,16 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1931
2001
  }
1932
2002
  /** A channel's tint (colour, opacity, masked or selected area), drawn in natural image space. */
1933
2003
  drawMaskOverlay(ctx, mask, style) {
1934
- const key = `${_optionalChain([style, 'access', _50 => _50.color, 'optionalAccess', _51 => _51.join, 'call', _52 => _52(",")])}|${style.opacity}|${style.indicates}`;
2004
+ const key2 = `${_optionalChain([style, 'access', _50 => _50.color, 'optionalAccess', _51 => _51.join, 'call', _52 => _52(",")])}|${style.opacity}|${style.indicates}`;
1935
2005
  let cached = this.overlayCache.get(mask);
1936
- if (!cached || cached.key !== key) {
2006
+ if (!cached || cached.key !== key2) {
1937
2007
  const canvas = this.createCanvas(mask.width, mask.height);
1938
2008
  const mctx = canvas.getContext("2d");
1939
2009
  if (!mctx || typeof mctx.createImageData !== "function") return;
1940
2010
  const img = mctx.createImageData(mask.width, mask.height);
1941
2011
  img.data.set(quickMaskPixels(mask, style));
1942
2012
  mctx.putImageData(img, 0, 0);
1943
- cached = { key, canvas };
2013
+ cached = { key: key2, canvas };
1944
2014
  this.overlayCache.set(mask, cached);
1945
2015
  }
1946
2016
  ctx.drawImage(cached.canvas, 0, 0, mask.width, mask.height);
@@ -2001,11 +2071,11 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
2001
2071
  if (typeof ctx.setLineDash === "function") ctx.setLineDash([]);
2002
2072
  }
2003
2073
  getSourceId(img) {
2004
- const key = img;
2005
- let id = this.sourceIds.get(key);
2074
+ const key2 = img;
2075
+ let id = this.sourceIds.get(key2);
2006
2076
  if (id === void 0) {
2007
2077
  id = ++this.nextSourceId;
2008
- this.sourceIds.set(key, id);
2078
+ this.sourceIds.set(key2, id);
2009
2079
  }
2010
2080
  return id;
2011
2081
  }
@@ -2054,7 +2124,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
2054
2124
  _chunkOLNIPTB3cjs.blendImageData.call(void 0, backdrop, source, _chunkOLNIPTB3cjs.normalizeBlendMode.call(void 0, ann.blend));
2055
2125
  lctx.setTransform(1, 0, 0, 1, 0, 0);
2056
2126
  lctx.putImageData(backdrop, 0, 0);
2057
- } catch (e15) {
2127
+ } catch (e16) {
2058
2128
  return false;
2059
2129
  }
2060
2130
  ctx.save();
@@ -2070,7 +2140,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
2070
2140
  if (ann.type === "image") {
2071
2141
  try {
2072
2142
  img = await this.imageCache.get(ann.src);
2073
- } catch (e16) {
2143
+ } catch (e17) {
2074
2144
  }
2075
2145
  }
2076
2146
  this.drawAnnotationShape(ctx, ann, img);
@@ -2104,15 +2174,15 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
2104
2174
  break;
2105
2175
  }
2106
2176
  case "rect": {
2107
- const rect = ann;
2108
- ctx.strokeStyle = rect.strokeColor;
2109
- ctx.lineWidth = rect.strokeWidth;
2110
- if (rect.fillColor) {
2111
- ctx.fillStyle = rect.fillColor;
2112
- ctx.fillRect(rect.x, rect.y, rect.width, rect.height);
2177
+ const rect2 = ann;
2178
+ ctx.strokeStyle = rect2.strokeColor;
2179
+ ctx.lineWidth = rect2.strokeWidth;
2180
+ if (rect2.fillColor) {
2181
+ ctx.fillStyle = rect2.fillColor;
2182
+ ctx.fillRect(rect2.x, rect2.y, rect2.width, rect2.height);
2113
2183
  }
2114
- if (rect.strokeWidth > 0) {
2115
- ctx.strokeRect(rect.x, rect.y, rect.width, rect.height);
2184
+ if (rect2.strokeWidth > 0) {
2185
+ ctx.strokeRect(rect2.x, rect2.y, rect2.width, rect2.height);
2116
2186
  }
2117
2187
  break;
2118
2188
  }
@@ -2303,12 +2373,12 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
2303
2373
  const split = splitOverlayAnnotations(layers);
2304
2374
  overlay = split.overlay.map((l) => l.annotation);
2305
2375
  await this.prepareLayerAssets(split.composite, naturalWidth, naturalHeight);
2306
- const rect = coveringRect(region);
2307
- const comp = this.createCanvas(rect.width, rect.height);
2376
+ const rect2 = coveringRect(region);
2377
+ const comp = this.createCanvas(rect2.width, rect2.height);
2308
2378
  const cctx = comp.getContext("2d");
2309
2379
  if (cctx && typeof cctx.createImageData === "function") {
2310
- this.exportCompositor.compositeTiles(split.composite, rect, this.compositorSources(naturalWidth, naturalHeight), (tx, ty, data) => {
2311
- this.putTile(cctx, data, tx, ty, rect);
2380
+ this.exportCompositor.compositeTiles(split.composite, rect2, this.compositorSources(naturalWidth, naturalHeight), (tx, ty, data) => {
2381
+ this.putTile(cctx, data, tx, ty, rect2);
2312
2382
  });
2313
2383
  }
2314
2384
  baseCanvas = this.createCanvas(baseW, baseH);
@@ -2319,7 +2389,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
2319
2389
  bctx.beginPath();
2320
2390
  bctx.rect(region.x, region.y, region.width, region.height);
2321
2391
  bctx.clip();
2322
- bctx.drawImage(comp, rect.x, rect.y);
2392
+ bctx.drawImage(comp, rect2.x, rect2.y);
2323
2393
  bctx.restore();
2324
2394
  this.applyPost(bctx, baseW, baseH, state);
2325
2395
  }
@@ -2447,10 +2517,10 @@ function getBaseProjection(region, transform, baseW, baseH) {
2447
2517
  };
2448
2518
  }
2449
2519
  var CompositeCanvas = (_class3 = class {
2450
- constructor(canvas, rect) {;_class3.prototype.__init27.call(this);_class3.prototype.__init28.call(this);_class3.prototype.__init29.call(this);
2520
+ constructor(canvas, rect2) {;_class3.prototype.__init27.call(this);_class3.prototype.__init28.call(this);_class3.prototype.__init29.call(this);
2451
2521
  this.canvas = canvas;
2452
- this.rect = rect;
2453
- this.region = rect;
2522
+ this.rect = rect2;
2523
+ this.region = rect2;
2454
2524
  }
2455
2525
 
2456
2526
 
@@ -2463,18 +2533,18 @@ var CompositeCanvas = (_class3 = class {
2463
2533
  if (!this.tiles.size) return null;
2464
2534
  const r = coveringRect(this.region);
2465
2535
  const parts = [];
2466
- for (const [key, data] of this.tiles) {
2467
- let h = this.histograms.get(key);
2536
+ for (const [key2, data] of this.tiles) {
2537
+ let h = this.histograms.get(key2);
2468
2538
  if (!h) {
2469
- const tx = key % 65536 - 32768;
2470
- const ty = Math.floor(key / 65536) - 32768;
2539
+ const tx = key2 % 65536 - 32768;
2540
+ const ty = Math.floor(key2 / 65536) - 32768;
2471
2541
  const x0 = Math.max(r.x, tx * _chunk474IQG74cjs.TILE);
2472
2542
  const y0 = Math.max(r.y, ty * _chunk474IQG74cjs.TILE);
2473
2543
  const x1 = Math.min(r.x + r.width, tx * _chunk474IQG74cjs.TILE + _chunk474IQG74cjs.TILE);
2474
2544
  const y1 = Math.min(r.y + r.height, ty * _chunk474IQG74cjs.TILE + _chunk474IQG74cjs.TILE);
2475
2545
  h = emptyHistogram();
2476
2546
  if (x1 > x0 && y1 > y0) addToHistogram(h, data, _chunk474IQG74cjs.TILE, { x: x0 - tx * _chunk474IQG74cjs.TILE, y: y0 - ty * _chunk474IQG74cjs.TILE, width: x1 - x0, height: y1 - y0 });
2477
- this.histograms.set(key, h);
2547
+ this.histograms.set(key2, h);
2478
2548
  }
2479
2549
  parts.push(h);
2480
2550
  }
@@ -2513,7 +2583,7 @@ function selectionToSubpaths(mask, options = {}) {
2513
2583
  for (let x = 0; x < w; x++) field[y * w + x] = data[row + x] / 255;
2514
2584
  }
2515
2585
  const threshold = Math.min(254, Math.max(1, _nullishCoalesce(options.threshold, () => ( 128)))) / 255;
2516
- const subpaths = _chunk3T5VCDIVcjs.traceField.call(void 0, field, w, h, threshold, {
2586
+ const subpaths = _chunkLCCMOWR7cjs.traceField.call(void 0, field, w, h, threshold, {
2517
2587
  tolerance: Math.max(0.1, _nullishCoalesce(options.tolerance, () => ( 0.5))),
2518
2588
  cornerRoundness: _nullishCoalesce(options.cornerRoundness, () => ( 0.5)),
2519
2589
  minArea: _nullishCoalesce(options.minArea, () => ( 4)),
@@ -2547,12 +2617,12 @@ function pathToSelection(components, width, height, options = {}) {
2547
2617
  const rx1 = Math.min(width, Math.ceil(x1));
2548
2618
  const ry1 = Math.min(height, Math.ceil(y1));
2549
2619
  if (!(rx1 > rx0 && ry1 > ry0)) return _chunkQYLWG22Ncjs.createSelectionMask.call(void 0, width, height);
2550
- const rect = { x: rx0, y: ry0, width: rx1 - rx0, height: ry1 - ry0 };
2551
- const cov = _chunkH65IBXFIcjs.componentsCoverage.call(void 0, components, rect, _nullishCoalesce(options.fillRule, () => ( "nonzero")));
2620
+ const rect2 = { x: rx0, y: ry0, width: rx1 - rx0, height: ry1 - ry0 };
2621
+ const cov = _chunkH65IBXFIcjs.componentsCoverage.call(void 0, components, rect2, _nullishCoalesce(options.fillRule, () => ( "nonzero")));
2552
2622
  const hard = options.antiAlias === false;
2553
2623
  const bytes = new Uint8Array(cov.length);
2554
2624
  for (let i = 0; i < cov.length; i++) bytes[i] = hard ? cov[i] >= 0.5 ? 255 : 0 : _chunkQYLWG22Ncjs.coverageToByte.call(void 0, cov[i]);
2555
- const mask = _chunkQYLWG22Ncjs.selectionFromRegion.call(void 0, width, height, rect, bytes);
2625
+ const mask = _chunkQYLWG22Ncjs.selectionFromRegion.call(void 0, width, height, rect2, bytes);
2556
2626
  const feather = _nullishCoalesce(options.feather, () => ( 0));
2557
2627
  return feather > 0 && mask.bounds ? _chunkQYLWG22Ncjs.modifySelection.call(void 0, mask, "feather", feather) : mask;
2558
2628
  }
@@ -2591,11 +2661,11 @@ var EdgeMap = (_class4 = class {
2591
2661
  block(x, y) {
2592
2662
  const bx = Math.floor(x / BLOCK);
2593
2663
  const by = Math.floor(y / BLOCK);
2594
- const key = by * 65536 + bx;
2595
- let b = this.blocks.get(key);
2664
+ const key2 = by * 65536 + bx;
2665
+ let b = this.blocks.get(key2);
2596
2666
  if (!b) {
2597
2667
  b = this.computeBlock(bx * BLOCK, by * BLOCK);
2598
- this.blocks.set(key, b);
2668
+ this.blocks.set(key2, b);
2599
2669
  }
2600
2670
  return b;
2601
2671
  }
@@ -2689,7 +2759,7 @@ var Heap = (_class5 = class {constructor() { _class5.prototype.__init31.call(thi
2689
2759
  __init31() {this.ids = new Int32Array(256)}
2690
2760
  __init32() {this.keys = new Float64Array(256)}
2691
2761
  __init33() {this.size = 0}
2692
- push(id, key) {
2762
+ push(id, key2) {
2693
2763
  if (this.size === this.ids.length) {
2694
2764
  const ids = new Int32Array(this.size * 2);
2695
2765
  ids.set(this.ids);
@@ -2701,31 +2771,31 @@ var Heap = (_class5 = class {constructor() { _class5.prototype.__init31.call(thi
2701
2771
  let i = this.size++;
2702
2772
  while (i > 0) {
2703
2773
  const p = i - 1 >> 1;
2704
- if (this.keys[p] <= key) break;
2774
+ if (this.keys[p] <= key2) break;
2705
2775
  this.ids[i] = this.ids[p];
2706
2776
  this.keys[i] = this.keys[p];
2707
2777
  i = p;
2708
2778
  }
2709
2779
  this.ids[i] = id;
2710
- this.keys[i] = key;
2780
+ this.keys[i] = key2;
2711
2781
  }
2712
2782
  /** Removes the cheapest entry; read it from `topId` / `topKey` first. */
2713
2783
  pop() {
2714
2784
  const n = --this.size;
2715
2785
  const id = this.ids[n];
2716
- const key = this.keys[n];
2786
+ const key2 = this.keys[n];
2717
2787
  let i = 0;
2718
2788
  for (; ; ) {
2719
2789
  let c = 2 * i + 1;
2720
2790
  if (c >= n) break;
2721
2791
  if (c + 1 < n && this.keys[c + 1] < this.keys[c]) c++;
2722
- if (this.keys[c] >= key) break;
2792
+ if (this.keys[c] >= key2) break;
2723
2793
  this.ids[i] = this.ids[c];
2724
2794
  this.keys[i] = this.keys[c];
2725
2795
  i = c;
2726
2796
  }
2727
2797
  this.ids[i] = id;
2728
- this.keys[i] = key;
2798
+ this.keys[i] = key2;
2729
2799
  }
2730
2800
  get topId() {
2731
2801
  return this.ids[0];
@@ -3258,14 +3328,14 @@ var TextEditSession = (_class7 = class {
3258
3328
  if (!this.text.trim().length) {
3259
3329
  try {
3260
3330
  this.controller.removeLayer(this.layerId);
3261
- } catch (e17) {
3331
+ } catch (e18) {
3262
3332
  }
3263
3333
  return false;
3264
3334
  }
3265
3335
  if (this.layer.name === "Text" && this.changed) {
3266
3336
  try {
3267
3337
  this.controller.setLayerProperties(this.layerId, { name: _chunkH65IBXFIcjs.typeLayerName.call(void 0, this.text) }, false);
3268
- } catch (e18) {
3338
+ } catch (e19) {
3269
3339
  }
3270
3340
  }
3271
3341
  return true;
@@ -3885,29 +3955,29 @@ var ImageEffectsEngine = (_class9 = class {
3885
3955
  return this.pending.size > 0;
3886
3956
  }
3887
3957
  /** See `SmartEffectResolver`. */
3888
- resolve(filter, input, width, height, key) {
3889
- const hit = this.cache.get(key);
3958
+ resolve(filter, input, width, height, key2) {
3959
+ const hit = this.cache.get(key2);
3890
3960
  if (hit) {
3891
- this.cache.delete(key);
3892
- this.cache.set(key, hit);
3961
+ this.cache.delete(key2);
3962
+ this.cache.set(key2, hit);
3893
3963
  return { result: hit, pending: false };
3894
3964
  }
3895
- if (this.pending.has(key)) return { result: null, pending: true };
3965
+ if (this.pending.has(key2)) return { result: null, pending: true };
3896
3966
  const provider = this.slot.provider;
3897
- if (!provider || this.failures.has(key)) return { result: null, pending: false };
3967
+ if (!provider || this.failures.has(key2)) return { result: null, pending: false };
3898
3968
  const generation = this.generation;
3899
3969
  const source = { width, height, data: new Uint8ClampedArray(input) };
3900
3970
  const run = this.filter(provider, filter.effect, filter.values, source).then((out) => {
3901
3971
  if (generation !== this.generation) return;
3902
- this.cache.set(key, out);
3972
+ this.cache.set(key2, out);
3903
3973
  while (this.cache.size > this.maxEntries) this.cache.delete(this.cache.keys().next().value);
3904
3974
  }).catch((error) => {
3905
- if (generation === this.generation) this.failures.set(key, error instanceof Error ? error : new Error(String(error)));
3975
+ if (generation === this.generation) this.failures.set(key2, error instanceof Error ? error : new Error(String(error)));
3906
3976
  }).finally(() => {
3907
- if (this.pending.get(key) === run) this.pending.delete(key);
3977
+ if (this.pending.get(key2) === run) this.pending.delete(key2);
3908
3978
  if (generation === this.generation) this.notify();
3909
3979
  });
3910
- this.pending.set(key, run);
3980
+ this.pending.set(key2, run);
3911
3981
  return { result: null, pending: true };
3912
3982
  }
3913
3983
  /** A filter effect over `source`: its result, or (for an overlay) the effect drawn over it. */
@@ -3928,12 +3998,12 @@ var ImageEffectsEngine = (_class9 = class {
3928
3998
  return out.width === size.width && out.height === size.height ? out : _chunkA3A5TI6Rcjs.createEffectPixels.call(void 0, size.width, size.height);
3929
3999
  }
3930
4000
  /** Why the result for `key` failed, if it did. */
3931
- failure(key) {
3932
- return this.failures.get(key);
4001
+ failure(key2) {
4002
+ return this.failures.get(key2);
3933
4003
  }
3934
4004
  /** Every failure so far. */
3935
4005
  failuresList() {
3936
- return [...this.failures].map(([key, error]) => ({ key, error }));
4006
+ return [...this.failures].map(([key2, error]) => ({ key: key2, error }));
3937
4007
  }
3938
4008
  /** Resolves when nothing is rendering. */
3939
4009
  async idle() {
@@ -4556,10 +4626,10 @@ function resolveProfile(doc) {
4556
4626
  let p;
4557
4627
  if (doc.builtin) p = _chunkBROJYMWUcjs.builtinProfile.call(void 0, doc.builtin);
4558
4628
  else if (doc.icc) {
4559
- const key = _chunkOLNIPTB3cjs.bytesToBase64.call(void 0, doc.icc);
4560
- p = _nullishCoalesce(fromBytes.get(key), () => ( _chunkBROJYMWUcjs.parseProfile.call(void 0, doc.icc)));
4629
+ const key2 = _chunkOLNIPTB3cjs.bytesToBase64.call(void 0, doc.icc);
4630
+ p = _nullishCoalesce(fromBytes.get(key2), () => ( _chunkBROJYMWUcjs.parseProfile.call(void 0, doc.icc)));
4561
4631
  if (fromBytes.size > 32) fromBytes.clear();
4562
- fromBytes.set(key, p);
4632
+ fromBytes.set(key2, p);
4563
4633
  } else p = _chunkBROJYMWUcjs.srgbProfile.call(void 0, );
4564
4634
  resolved.set(doc, p);
4565
4635
  return p;
@@ -4582,7 +4652,7 @@ function isSrgb(doc) {
4582
4652
  if (!doc || doc.builtin === "srgb") return true;
4583
4653
  try {
4584
4654
  return _chunkBROJYMWUcjs.sameColors.call(void 0, resolveProfile(doc), _chunkBROJYMWUcjs.srgbProfile.call(void 0, ), _chunkBROJYMWUcjs.builtinProfile.call(void 0, "lab-d50"));
4585
- } catch (e19) {
4655
+ } catch (e20) {
4586
4656
  return false;
4587
4657
  }
4588
4658
  }
@@ -4649,12 +4719,12 @@ function convertHex(hex, from, to, intent = "relative", bpc = true) {
4649
4719
  return `#${c(out[0])}${c(out[1])}${c(out[2])}`;
4650
4720
  }
4651
4721
  function convertColorFields(value, convert) {
4652
- const walk = (v, key) => {
4653
- if (typeof v === "string") return /color$/i.test(key) && /^#[0-9a-f]{6}$/i.test(v) ? convert(v) : v;
4722
+ const walk = (v, key2) => {
4723
+ if (typeof v === "string") return /color$/i.test(key2) && /^#[0-9a-f]{6}$/i.test(v) ? convert(v) : v;
4654
4724
  if (Array.isArray(v)) {
4655
4725
  let changed = false;
4656
4726
  const out = v.map((x) => {
4657
- const y = walk(x, key);
4727
+ const y = walk(x, key2);
4658
4728
  if (y !== x) changed = true;
4659
4729
  return y;
4660
4730
  });
@@ -4676,7 +4746,7 @@ function convertSurfaceColors(surface, t) {
4676
4746
  if (surface.channels !== 4 || t.inputs !== 3 || t.outputs !== 3) return surface;
4677
4747
  const tiles = /* @__PURE__ */ new Map();
4678
4748
  const memo = /* @__PURE__ */ new Map();
4679
- for (const [key, tile] of surface.tiles) {
4749
+ for (const [key2, tile] of surface.tiles) {
4680
4750
  let next = memo.get(tile);
4681
4751
  if (next === void 0) {
4682
4752
  if (tile.deep instanceof Uint16Array) {
@@ -4699,7 +4769,7 @@ function convertSurfaceColors(surface, t) {
4699
4769
  }
4700
4770
  memo.set(tile, next);
4701
4771
  }
4702
- if (next) tiles.set(key, next);
4772
+ if (next) tiles.set(key2, next);
4703
4773
  }
4704
4774
  return new (0, _chunk474IQG74cjs.TiledSurface)(4, tiles, surface.defaultValue);
4705
4775
  }
@@ -4716,22 +4786,22 @@ function paintCoverageInto(base, coverage, apply, rects, depth = null) {
4716
4786
  const done = /* @__PURE__ */ new Set();
4717
4787
  for (const r of rects) {
4718
4788
  for (const t of _chunk474IQG74cjs.tilesInRect.call(void 0, { x: r.x - apply.offset.x, y: r.y - apply.offset.y, width: r.width, height: r.height })) {
4719
- const key = _chunk474IQG74cjs.tileKey.call(void 0, t.tx, t.ty);
4720
- if (done.has(key)) continue;
4721
- done.add(key);
4789
+ const key2 = _chunk474IQG74cjs.tileKey.call(void 0, t.tx, t.ty);
4790
+ if (done.has(key2)) continue;
4791
+ done.add(key2);
4722
4792
  if (depth) {
4723
4793
  const ch = base.channels;
4724
- const d = _chunkPQ3H2AANcjs.applyStrokeToDeepTile.call(void 0, coverage, _chunkOLNIPTB3cjs.tileSamples.call(void 0, base.tiles.get(key), ch, depth, base.defaultValue), t.tx, t.ty, apply, { channels: ch });
4794
+ const d = _chunkPQ3H2AANcjs.applyStrokeToDeepTile.call(void 0, coverage, _chunkOLNIPTB3cjs.tileSamples.call(void 0, base.tiles.get(key2), ch, depth, base.defaultValue), t.tx, t.ty, apply, { channels: ch });
4725
4795
  const tile2 = _chunkOLNIPTB3cjs.deepTile.call(void 0, d, ch, base.defaultValue);
4726
- if (tile2) tiles.set(key, tile2);
4727
- else tiles.delete(key);
4796
+ if (tile2) tiles.set(key2, tile2);
4797
+ else tiles.delete(key2);
4728
4798
  continue;
4729
4799
  }
4730
- const src = _nullishCoalesce(_optionalChain([base, 'access', _105 => _105.tiles, 'access', _106 => _106.get, 'call', _107 => _107(key), 'optionalAccess', _108 => _108.data]), () => ( defaultTile(base)));
4800
+ const src = _nullishCoalesce(_optionalChain([base, 'access', _105 => _105.tiles, 'access', _106 => _106.get, 'call', _107 => _107(key2), 'optionalAccess', _108 => _108.data]), () => ( defaultTile(base)));
4731
4801
  const data = _chunkPQ3H2AANcjs.applyStrokeToTile.call(void 0, coverage, src, base.channels, t.tx, t.ty, apply);
4732
4802
  const tile = _chunk474IQG74cjs.finishTile.call(void 0, data, base.channels, base.defaultValue);
4733
- if (tile) tiles.set(key, tile);
4734
- else tiles.delete(key);
4803
+ if (tile) tiles.set(key2, tile);
4804
+ else tiles.delete(key2);
4735
4805
  }
4736
4806
  }
4737
4807
  return new (0, _chunk474IQG74cjs.TiledSurface)(base.channels, tiles, base.defaultValue);
@@ -4802,19 +4872,19 @@ var PaintStrokeSession = (_class11 = class {
4802
4872
  __init69() {this.work = /* @__PURE__ */ new Map()}
4803
4873
  __init70() {this.workRead = /* @__PURE__ */ new Map()}
4804
4874
  /** The pre-stroke tile as a float working tile (cached; `null`: transparent). */
4805
- readWork(key) {
4806
- if (!this.workRead.has(key)) this.workRead.set(key, workTileOf(this.base.tiles.get(key)));
4807
- return this.workRead.get(key);
4875
+ readWork(key2) {
4876
+ if (!this.workRead.has(key2)) this.workRead.set(key2, workTileOf(this.base.tiles.get(key2)));
4877
+ return this.workRead.get(key2);
4808
4878
  }
4809
4879
  /** Clone, healing and the spot-heal trail at depth: `paint` through the coverage on the float working tile. */
4810
- retouchDeepTile(key, tx, ty, paint, options) {
4880
+ retouchDeepTile(key2, tx, ty, paint, options) {
4811
4881
  const r = this.retouch;
4812
- const read = this.readWork(key);
4882
+ const read = this.readWork(key2);
4813
4883
  const out = _chunkYF3YZZ6Gcjs.applyRetouchToTile.call(void 0, this.stroke.coverage, _nullishCoalesce(read, () => ( new Float32Array(_chunk474IQG74cjs.TILE * _chunk474IQG74cjs.TILE * 4))), 4, tx, ty, paint, r.apply, options);
4814
- this.work.set(key, out);
4815
- const d = deepOfWorkTile(out, this.deep, read, this.base.tiles.get(key));
4816
- this.liveDeep.set(key, d);
4817
- this.live.set(key, { data: _chunkOLNIPTB3cjs.proxyOf.call(void 0, d, 4), uniform: null, deep: d });
4884
+ this.work.set(key2, out);
4885
+ const d = deepOfWorkTile(out, this.deep, read, this.base.tiles.get(key2));
4886
+ this.liveDeep.set(key2, d);
4887
+ this.live.set(key2, { data: _chunkOLNIPTB3cjs.proxyOf.call(void 0, d, 4), uniform: null, deep: d });
4818
4888
  return d;
4819
4889
  }
4820
4890
  /** The new tile of a coverage stroke over the pre-stroke tile `src`. */
@@ -4828,23 +4898,23 @@ var PaintStrokeSession = (_class11 = class {
4828
4898
  const a = this.apply;
4829
4899
  const depth = this.dabDeep;
4830
4900
  if (depth) {
4831
- const read = (key) => this.readWork(key);
4901
+ const read = (key2) => this.readWork(key2);
4832
4902
  return {
4833
4903
  offset: a.offset,
4834
4904
  lockTransparency: a.lockTransparency,
4835
4905
  selection: a.selection,
4836
4906
  readTile: (tx, ty) => {
4837
- const key = _chunk474IQG74cjs.tileKey.call(void 0, tx, ty);
4838
- return _nullishCoalesce(this.work.get(key), () => ( read(key)));
4907
+ const key2 = _chunk474IQG74cjs.tileKey.call(void 0, tx, ty);
4908
+ return _nullishCoalesce(this.work.get(key2), () => ( read(key2)));
4839
4909
  },
4840
4910
  writeTile: (tx, ty) => {
4841
- const key = _chunk474IQG74cjs.tileKey.call(void 0, tx, ty);
4842
- if (!this.touched.has(key)) {
4843
- this.work.set(key, _nullishCoalesce(_optionalChain([read, 'call', _109 => _109(key), 'optionalAccess', _110 => _110.slice, 'call', _111 => _111()]), () => ( new Float32Array(_chunk474IQG74cjs.TILE * _chunk474IQG74cjs.TILE * 4))));
4844
- this.touched.add(key);
4911
+ const key2 = _chunk474IQG74cjs.tileKey.call(void 0, tx, ty);
4912
+ if (!this.touched.has(key2)) {
4913
+ this.work.set(key2, _nullishCoalesce(_optionalChain([read, 'call', _109 => _109(key2), 'optionalAccess', _110 => _110.slice, 'call', _111 => _111()]), () => ( new Float32Array(_chunk474IQG74cjs.TILE * _chunk474IQG74cjs.TILE * 4))));
4914
+ this.touched.add(key2);
4845
4915
  }
4846
- this.fresh.add(key);
4847
- return this.work.get(key);
4916
+ this.fresh.add(key2);
4917
+ return this.work.get(key2);
4848
4918
  }
4849
4919
  };
4850
4920
  }
@@ -4854,14 +4924,14 @@ var PaintStrokeSession = (_class11 = class {
4854
4924
  selection: a.selection,
4855
4925
  readTile: (tx, ty) => _nullishCoalesce(_optionalChain([this, 'access', _112 => _112.live, 'access', _113 => _113.get, 'call', _114 => _114(_chunk474IQG74cjs.tileKey.call(void 0, tx, ty)), 'optionalAccess', _115 => _115.data]), () => ( (this.base.defaultValue ? defaultTile(this.base) : null))),
4856
4926
  writeTile: (tx, ty) => {
4857
- const key = _chunk474IQG74cjs.tileKey.call(void 0, tx, ty);
4858
- if (!this.touched.has(key)) {
4859
- const src = _nullishCoalesce(_optionalChain([this, 'access', _116 => _116.base, 'access', _117 => _117.tiles, 'access', _118 => _118.get, 'call', _119 => _119(key), 'optionalAccess', _120 => _120.data]), () => ( defaultTile(this.base)));
4860
- this.live.set(key, { data: new Uint8ClampedArray(src), uniform: null });
4861
- this.touched.add(key);
4927
+ const key2 = _chunk474IQG74cjs.tileKey.call(void 0, tx, ty);
4928
+ if (!this.touched.has(key2)) {
4929
+ const src = _nullishCoalesce(_optionalChain([this, 'access', _116 => _116.base, 'access', _117 => _117.tiles, 'access', _118 => _118.get, 'call', _119 => _119(key2), 'optionalAccess', _120 => _120.data]), () => ( defaultTile(this.base)));
4930
+ this.live.set(key2, { data: new Uint8ClampedArray(src), uniform: null });
4931
+ this.touched.add(key2);
4862
4932
  }
4863
- this.fresh.add(key);
4864
- return this.live.get(key).data;
4933
+ this.fresh.add(key2);
4934
+ return this.live.get(key2).data;
4865
4935
  }
4866
4936
  };
4867
4937
  }
@@ -4885,12 +4955,12 @@ var PaintStrokeSession = (_class11 = class {
4885
4955
  const ch = this.base.channels;
4886
4956
  if (this.mixer) {
4887
4957
  if (this.dabDeep) {
4888
- for (const key of this.fresh) {
4889
- const d = deepOfWorkTile(this.work.get(key), this.dabDeep, _nullishCoalesce(this.workRead.get(key), () => ( null)), this.base.tiles.get(key));
4890
- this.liveDeep.set(key, d);
4891
- this.live.set(key, { data: _chunkOLNIPTB3cjs.proxyOf.call(void 0, d, 4), uniform: null, deep: d });
4958
+ for (const key2 of this.fresh) {
4959
+ const d = deepOfWorkTile(this.work.get(key2), this.dabDeep, _nullishCoalesce(this.workRead.get(key2), () => ( null)), this.base.tiles.get(key2));
4960
+ this.liveDeep.set(key2, d);
4961
+ this.live.set(key2, { data: _chunkOLNIPTB3cjs.proxyOf.call(void 0, d, 4), uniform: null, deep: d });
4892
4962
  }
4893
- } else for (const key of this.fresh) this.live.set(key, { data: this.live.get(key).data, uniform: null });
4963
+ } else for (const key2 of this.fresh) this.live.set(key2, { data: this.live.get(key2).data, uniform: null });
4894
4964
  this.fresh.clear();
4895
4965
  this.controller._strokeUpdate(this.target.id, this.target.channel, new (0, _chunk474IQG74cjs.TiledSurface)(ch, new Map(this.live), this.base.defaultValue), rects);
4896
4966
  return;
@@ -4899,35 +4969,35 @@ var PaintStrokeSession = (_class11 = class {
4899
4969
  const regions = /* @__PURE__ */ new Map();
4900
4970
  for (const r of rects) {
4901
4971
  for (const t of _chunk474IQG74cjs.tilesInRect.call(void 0, { x: r.x - this.apply.offset.x, y: r.y - this.apply.offset.y, width: r.width, height: r.height })) {
4902
- const key = _chunk474IQG74cjs.tileKey.call(void 0, t.tx, t.ty);
4903
- const cur = regions.get(key);
4904
- regions.set(key, { tx: t.tx, ty: t.ty, r: cur ? _chunkH65IBXFIcjs.unionRect.call(void 0, cur.r, r) : r });
4972
+ const key2 = _chunk474IQG74cjs.tileKey.call(void 0, t.tx, t.ty);
4973
+ const cur = regions.get(key2);
4974
+ regions.set(key2, { tx: t.tx, ty: t.ty, r: cur ? _chunkH65IBXFIcjs.unionRect.call(void 0, cur.r, r) : r });
4905
4975
  }
4906
4976
  }
4907
- for (const [key, { tx, ty, r }] of regions) {
4977
+ for (const [key2, { tx, ty, r }] of regions) {
4908
4978
  if (this.deep) {
4909
4979
  const rt = this.retouch;
4910
4980
  const paint = _optionalChain([rt, 'optionalAccess', _125 => _125.kind]) === "coverage" ? rt.paint() : null;
4911
4981
  if (paint && paint.kind !== "tone") {
4912
- const prevWork = this.touched.has(key) ? this.work.get(key) : void 0;
4913
- this.touched.add(key);
4914
- this.retouchDeepTile(key, tx, ty, paint, prevWork ? { into: prevWork, region: r } : {});
4982
+ const prevWork = this.touched.has(key2) ? this.work.get(key2) : void 0;
4983
+ this.touched.add(key2);
4984
+ this.retouchDeepTile(key2, tx, ty, paint, prevWork ? { into: prevWork, region: r } : {});
4915
4985
  continue;
4916
4986
  }
4917
- const src2 = _chunkOLNIPTB3cjs.tileSamples.call(void 0, this.base.tiles.get(key), ch, this.deep, this.base.defaultValue);
4918
- const prev2 = this.touched.has(key) ? this.liveDeep.get(key) : void 0;
4919
- this.touched.add(key);
4987
+ const src2 = _chunkOLNIPTB3cjs.tileSamples.call(void 0, this.base.tiles.get(key2), ch, this.deep, this.base.defaultValue);
4988
+ const prev2 = this.touched.has(key2) ? this.liveDeep.get(key2) : void 0;
4989
+ this.touched.add(key2);
4920
4990
  const opts = prev2 ? { into: prev2, region: r, channels: ch } : { channels: ch };
4921
4991
  const d = _optionalChain([rt, 'optionalAccess', _126 => _126.kind]) === "coverage" && _optionalChain([paint, 'optionalAccess', _127 => _127.kind]) === "tone" ? _chunkYF3YZZ6Gcjs.applyToneToDeepTile.call(void 0, stroke.coverage, src2, tx, ty, paint.tone, rt.apply, opts) : _chunkPQ3H2AANcjs.applyStrokeToDeepTile.call(void 0, stroke.coverage, src2, tx, ty, this.apply, opts);
4922
- this.liveDeep.set(key, d);
4923
- this.live.set(key, { data: _chunkOLNIPTB3cjs.proxyOf.call(void 0, d, ch), uniform: null, deep: d });
4992
+ this.liveDeep.set(key2, d);
4993
+ this.live.set(key2, { data: _chunkOLNIPTB3cjs.proxyOf.call(void 0, d, ch), uniform: null, deep: d });
4924
4994
  continue;
4925
4995
  }
4926
- const src = _nullishCoalesce(_optionalChain([this, 'access', _128 => _128.base, 'access', _129 => _129.tiles, 'access', _130 => _130.get, 'call', _131 => _131(key), 'optionalAccess', _132 => _132.data]), () => ( defaultTile(this.base)));
4927
- const prev = this.touched.has(key) ? _optionalChain([this, 'access', _133 => _133.live, 'access', _134 => _134.get, 'call', _135 => _135(key), 'optionalAccess', _136 => _136.data]) : void 0;
4928
- this.touched.add(key);
4996
+ const src = _nullishCoalesce(_optionalChain([this, 'access', _128 => _128.base, 'access', _129 => _129.tiles, 'access', _130 => _130.get, 'call', _131 => _131(key2), 'optionalAccess', _132 => _132.data]), () => ( defaultTile(this.base)));
4997
+ const prev = this.touched.has(key2) ? _optionalChain([this, 'access', _133 => _133.live, 'access', _134 => _134.get, 'call', _135 => _135(key2), 'optionalAccess', _136 => _136.data]) : void 0;
4998
+ this.touched.add(key2);
4929
4999
  const data = this.compositeTile(src, tx, ty, prev ? { into: prev, region: r } : {});
4930
- this.live.set(key, { data, uniform: null });
5000
+ this.live.set(key2, { data, uniform: null });
4931
5001
  }
4932
5002
  this.controller._strokeUpdate(this.target.id, this.target.channel, new (0, _chunk474IQG74cjs.TiledSurface)(ch, new Map(this.live), this.base.defaultValue), rects);
4933
5003
  }
@@ -4944,26 +5014,26 @@ var PaintStrokeSession = (_class11 = class {
4944
5014
  if (_optionalChain([r, 'optionalAccess', _139 => _139.kind]) === "coverage" && r.finalPaint) {
4945
5015
  const final = r.finalPaint(this.stroke.coverage);
4946
5016
  if (final) {
4947
- for (const key of this.touched) {
4948
- const { tx, ty } = _chunk474IQG74cjs.tileCoord.call(void 0, key);
5017
+ for (const key2 of this.touched) {
5018
+ const { tx, ty } = _chunk474IQG74cjs.tileCoord.call(void 0, key2);
4949
5019
  if (this.deep) {
4950
- this.retouchDeepTile(key, tx, ty, final, {});
5020
+ this.retouchDeepTile(key2, tx, ty, final, {});
4951
5021
  continue;
4952
5022
  }
4953
- const src = _nullishCoalesce(_optionalChain([this, 'access', _140 => _140.base, 'access', _141 => _141.tiles, 'access', _142 => _142.get, 'call', _143 => _143(key), 'optionalAccess', _144 => _144.data]), () => ( defaultTile(this.base)));
4954
- this.live.set(key, { data: this.compositeTile(src, tx, ty, {}, final), uniform: null });
5023
+ const src = _nullishCoalesce(_optionalChain([this, 'access', _140 => _140.base, 'access', _141 => _141.tiles, 'access', _142 => _142.get, 'call', _143 => _143(key2), 'optionalAccess', _144 => _144.data]), () => ( defaultTile(this.base)));
5024
+ this.live.set(key2, { data: this.compositeTile(src, tx, ty, {}, final), uniform: null });
4955
5025
  }
4956
5026
  }
4957
5027
  }
4958
5028
  const tiles = new Map(this.base.tiles);
4959
5029
  let changed = false;
4960
- for (const key of this.touched) {
4961
- const live = this.live.get(key);
4962
- const deep = this.liveDeep.get(key);
5030
+ for (const key2 of this.touched) {
5031
+ const live = this.live.get(key2);
5032
+ const deep = this.liveDeep.get(key2);
4963
5033
  const tile = deep ? _chunkOLNIPTB3cjs.deepTile.call(void 0, deep, ch, this.base.defaultValue) : _chunk474IQG74cjs.finishTile.call(void 0, live.data, ch, this.base.defaultValue);
4964
- const prev = this.base.tiles.get(key);
4965
- if (tile) tiles.set(key, tile);
4966
- else tiles.delete(key);
5034
+ const prev = this.base.tiles.get(key2);
5035
+ if (tile) tiles.set(key2, tile);
5036
+ else tiles.delete(key2);
4967
5037
  if (!sameTile(prev, tile)) changed = true;
4968
5038
  }
4969
5039
  const surface = changed ? new (0, _chunk474IQG74cjs.TiledSurface)(ch, tiles, this.base.defaultValue) : null;
@@ -4982,9 +5052,9 @@ var PaintStrokeSession = (_class11 = class {
4982
5052
  this.controller._strokeCommit(this.before, this.target.id, this.target.channel, null);
4983
5053
  }
4984
5054
  }, _class11);
4985
- function workRegionOf(surface, rect, depth) {
4986
- if (!depth) return Float32Array.from(_chunk474IQG74cjs.readRegion.call(void 0, surface, rect));
4987
- const d = _chunkOLNIPTB3cjs.readDeepRegion.call(void 0, surface, rect, depth);
5055
+ function workRegionOf(surface, rect2, depth) {
5056
+ if (!depth) return Float32Array.from(_chunk474IQG74cjs.readRegion.call(void 0, surface, rect2));
5057
+ const d = _chunkOLNIPTB3cjs.readDeepRegion.call(void 0, surface, rect2, depth);
4988
5058
  const out = new Float32Array(d.length);
4989
5059
  if (d instanceof Uint16Array) {
4990
5060
  for (let i = 0; i < d.length; i++) out[i] = d[i] / 257;
@@ -5221,7 +5291,7 @@ var ImageEditorController = (_class12 = class {
5221
5291
  if (_optionalChain([options, 'access', _154 => _154.initialState, 'optionalAccess', _155 => _155.selection])) {
5222
5292
  try {
5223
5293
  this.state.selection = normalizeSelection(_chunkQYLWG22Ncjs.deserializeSelection.call(void 0, options.initialState.selection));
5224
- } catch (e20) {
5294
+ } catch (e21) {
5225
5295
  }
5226
5296
  }
5227
5297
  if (_optionalChain([options, 'access', _156 => _156.initialState, 'optionalAccess', _157 => _157.channels])) {
@@ -5267,7 +5337,7 @@ var ImageEditorController = (_class12 = class {
5267
5337
  height: img.naturalHeight || img.height || 600
5268
5338
  }
5269
5339
  };
5270
- } catch (e21) {
5340
+ } catch (e22) {
5271
5341
  return { sourceUrl: src, element: null, dimensions: { ...this.state.imageDimensions } };
5272
5342
  }
5273
5343
  }
@@ -5341,7 +5411,7 @@ var ImageEditorController = (_class12 = class {
5341
5411
  try {
5342
5412
  const r = _chunkH65IBXFIcjs.rerender.call(void 0, l, canvas);
5343
5413
  if (all || !_chunkH65IBXFIcjs.isSmartSurfaceIncomplete.call(void 0, r.surface)) next2 = r;
5344
- } catch (e22) {
5414
+ } catch (e23) {
5345
5415
  }
5346
5416
  }
5347
5417
  if (next2 !== l) {
@@ -5664,16 +5734,16 @@ var ImageEditorController = (_class12 = class {
5664
5734
  this.displayFor = [s.colorProfile, s.proofSetup, s.colorMode];
5665
5735
  try {
5666
5736
  this.renderer.setDisplayTransform(displayTransform(s.colorProfile, effectiveProof(s.proofSetup, s.colorMode)));
5667
- } catch (e23) {
5737
+ } catch (e24) {
5668
5738
  this.renderer.setDisplayTransform(null);
5669
5739
  }
5670
5740
  }
5671
5741
  /** Recomputes the compatibility views (`adjustments`, `depthMask`, `annotations`) when the stack changed. */
5672
5742
  syncViews() {
5673
5743
  const s = this.state;
5674
- const key = [s.layers, s.outputOpacity, s.legacyOutputBlur, s.activeLayerId, s.imageDimensions.width, s.imageDimensions.height];
5675
- if (key.length === this.viewKey.length && key.every((v, i) => v === this.viewKey[i])) return;
5676
- this.viewKey = key;
5744
+ const key2 = [s.layers, s.outputOpacity, s.legacyOutputBlur, s.activeLayerId, s.imageDimensions.width, s.imageDimensions.height];
5745
+ if (key2.length === this.viewKey.length && key2.every((v, i) => v === this.viewKey[i])) return;
5746
+ this.viewKey = key2;
5677
5747
  const { width, height } = this.naturalSize;
5678
5748
  const view = _chunkH65IBXFIcjs.legacyView.call(void 0, this.stack(), width, height, s.activeLayerId);
5679
5749
  s.adjustments = view.adjustments;
@@ -6000,7 +6070,7 @@ var ImageEditorController = (_class12 = class {
6000
6070
  getLayerFrame(id) {
6001
6071
  const layer = this.getLayer(id);
6002
6072
  if (!layer) return null;
6003
- const rect = (b2) => [
6073
+ const rect2 = (b2) => [
6004
6074
  { x: b2.x, y: b2.y },
6005
6075
  { x: b2.x + b2.width, y: b2.y },
6006
6076
  { x: b2.x + b2.width, y: b2.y + b2.height },
@@ -6015,10 +6085,10 @@ var ImageEditorController = (_class12 = class {
6015
6085
  }
6016
6086
  if (layer.type === "shape") {
6017
6087
  const g = _chunkH65IBXFIcjs.shapeGeometryBounds.call(void 0, layer);
6018
- return g ? rect(g) : null;
6088
+ return g ? rect2(g) : null;
6019
6089
  }
6020
6090
  const b = this.getLayerBounds(id);
6021
- return b ? rect(b) : null;
6091
+ return b ? rect2(b) : null;
6022
6092
  }
6023
6093
  /**
6024
6094
  * Hit-tests the layer stack at `point` (in document space) and returns the id of the topmost
@@ -6099,9 +6169,9 @@ var ImageEditorController = (_class12 = class {
6099
6169
  * and are left out): `rect` (default: the canvas) as RGBA, straight alpha. Crop, rotation and
6100
6170
  * output opacity are not applied. With `layerIds`, only those layers are composited.
6101
6171
  */
6102
- compositePixels(rect, options = {}) {
6172
+ compositePixels(rect2, options = {}) {
6103
6173
  const { width, height } = this.naturalSize;
6104
- const r = _nullishCoalesce(rect, () => ( { x: 0, y: 0, width, height }));
6174
+ const r = _nullishCoalesce(rect2, () => ( { x: 0, y: 0, width, height }));
6105
6175
  let layers = this.state.layers;
6106
6176
  if (options.layerIds) {
6107
6177
  const keep = new Set(options.layerIds);
@@ -6125,12 +6195,12 @@ var ImageEditorController = (_class12 = class {
6125
6195
  __init94() {this.nextSourceId = 1}
6126
6196
  /** Changes whenever the Background's source pixels can have changed. */
6127
6197
  sourceVersion() {
6128
- const key = this.samplePixelsOverride ? this.samplePixels : _nullishCoalesce(this.imageElement, () => ( this.samplePixels));
6129
- if (!key) return "0";
6130
- let id = this.sourceIds.get(key);
6198
+ const key2 = this.samplePixelsOverride ? this.samplePixels : _nullishCoalesce(this.imageElement, () => ( this.samplePixels));
6199
+ if (!key2) return "0";
6200
+ let id = this.sourceIds.get(key2);
6131
6201
  if (!id) {
6132
6202
  id = this.nextSourceId++;
6133
- this.sourceIds.set(key, id);
6203
+ this.sourceIds.set(key2, id);
6134
6204
  }
6135
6205
  return String(id);
6136
6206
  }
@@ -6197,7 +6267,7 @@ var ImageEditorController = (_class12 = class {
6197
6267
  const data = ctx.getImageData(0, 0, width, height);
6198
6268
  if (!_optionalChain([data, 'optionalAccess', _208 => _208.data]) || data.data.length < width * height * 4) return null;
6199
6269
  return { width, height, data: data.data };
6200
- } catch (e24) {
6270
+ } catch (e25) {
6201
6271
  return null;
6202
6272
  }
6203
6273
  }
@@ -6278,7 +6348,7 @@ var ImageEditorController = (_class12 = class {
6278
6348
  try {
6279
6349
  const bytes = _chunkOLNIPTB3cjs.base64ToBytes.call(void 0, trimmed);
6280
6350
  if (_chunkOLNIPTB3cjs.isPng.call(void 0, bytes)) png = bytes;
6281
- } catch (e25) {
6351
+ } catch (e26) {
6282
6352
  png = null;
6283
6353
  }
6284
6354
  }
@@ -6286,14 +6356,14 @@ var ImageEditorController = (_class12 = class {
6286
6356
  try {
6287
6357
  const d = _chunkOLNIPTB3cjs.decodePng.call(void 0, png);
6288
6358
  return { width: d.width, height: d.height, data: d.data };
6289
- } catch (e26) {
6359
+ } catch (e27) {
6290
6360
  }
6291
6361
  }
6292
6362
  const src = png ? `data:image/png;base64,${_chunkOLNIPTB3cjs.bytesToBase64.call(void 0, png)}` : trimmed;
6293
6363
  let img;
6294
6364
  try {
6295
6365
  img = await this.renderer.imageCache.get(src);
6296
- } catch (e27) {
6366
+ } catch (e28) {
6297
6367
  throw new (0, _chunkH65IBXFIcjs.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.");
6298
6368
  }
6299
6369
  const w = img.naturalWidth || img.width;
@@ -6572,8 +6642,8 @@ var ImageEditorController = (_class12 = class {
6572
6642
  this.state.activePathId = id;
6573
6643
  this.notify();
6574
6644
  }
6575
- commitPaths(next, active) {
6576
- this.recordHistory();
6645
+ commitPaths(next, active, commitToHistory = true) {
6646
+ if (commitToHistory) this.recordHistory();
6577
6647
  if (next.length) this.state.paths = next;
6578
6648
  else delete this.state.paths;
6579
6649
  if (active !== void 0) this.state.activePathId = active;
@@ -6609,6 +6679,64 @@ var ImageEditorController = (_class12 = class {
6609
6679
  this.commitPaths(this.getPaths().map((p) => p.id === id ? path : p));
6610
6680
  return path;
6611
6681
  }
6682
+ /**
6683
+ * What the path tools (Path Selection, Direct Selection, Pen) edit: the active path in the Paths
6684
+ * panel, else the active layer when it is a shape, else the active layer's vector mask; null
6685
+ * when there is none of these (the Pen then starts a new Work Path).
6686
+ */
6687
+ pathEditTarget() {
6688
+ const id = this.state.activePathId;
6689
+ if (id && this.getPath(id)) return { kind: "path", id };
6690
+ const layer = this.getActiveLayer();
6691
+ if (!layer) return null;
6692
+ if (layer.type === "shape") return { kind: "shape", layerId: layer.id };
6693
+ if (layer.vectorMask) return { kind: "vector-mask", layerId: layer.id };
6694
+ return null;
6695
+ }
6696
+ /** The components a path tool target holds (document pixels). Throws for a target that is gone. */
6697
+ getPathEditComponents(target) {
6698
+ if (target.kind === "path") return this.requirePath(target.id).components;
6699
+ if (target.kind === "shape") return _chunkH65IBXFIcjs.requireShapeLayer.call(void 0, this.state.layers, target.layerId).components;
6700
+ return this.requireVectorMask(target.layerId).vm.components;
6701
+ }
6702
+ /**
6703
+ * Replaces a path tool target's components: one undo step, or none with `commitToHistory` false
6704
+ * (the later moves of a drag whose first move recorded one). A component that still has its
6705
+ * `live` shape is kept as given (drop `live` from one whose anchors changed); a shape layer keeps
6706
+ * at least one component.
6707
+ */
6708
+ setPathEditComponents(target, components, commitToHistory = true) {
6709
+ this.getPathEditComponents(target);
6710
+ const next = components.map(
6711
+ (c, i) => c.live ? { ...c } : this.componentFrom({ op: c.op, subpaths: c.subpaths.filter((sp) => sp.anchors.length) }, `components[${i}].`)
6712
+ );
6713
+ if (target.kind === "path") {
6714
+ this.commitPaths(this.getPaths().map((p) => p.id === target.id ? { ...p, components: next } : p), void 0, commitToHistory);
6715
+ } else if (target.kind === "shape") {
6716
+ if (!next.length) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("A shape needs at least one component; delete the layer instead (delete_layer).");
6717
+ const { layers } = _chunkH65IBXFIcjs.updateShapeLayer.call(void 0, this.state.layers, target.layerId, () => ({ components: next }), this.shapeEnv(), "edit its path");
6718
+ this.commitLayers(layers, void 0, commitToHistory);
6719
+ } else {
6720
+ const { vm } = this.requireVectorMask(target.layerId);
6721
+ this.commitLayers(_chunkUOGKSVRQcjs.mapLayer.call(void 0, this.state.layers, target.layerId, (l) => ({ ...l, vectorMask: { ...vm, components: next } })), void 0, commitToHistory);
6722
+ }
6723
+ }
6724
+ /**
6725
+ * The Pen with no path to add to: a new Work Path from `components` (replacing the last one,
6726
+ * unless it was saved), made the active path. One undo step. Returns the path.
6727
+ */
6728
+ startWorkPath(components) {
6729
+ const paths = this.getPaths();
6730
+ const old = paths.find((p) => p.work);
6731
+ const work = {
6732
+ id: _nullishCoalesce(_optionalChain([old, 'optionalAccess', _242 => _242.id]), () => ( newPathId())),
6733
+ name: WORK_PATH_NAME,
6734
+ components: components.map((c, i) => this.componentFrom({ op: c.op, subpaths: c.subpaths }, `components[${i}].`)),
6735
+ work: true
6736
+ };
6737
+ this.commitPaths(old ? paths.map((p) => p === old ? work : p) : [...paths, work], work.id);
6738
+ return work;
6739
+ }
6612
6740
  /** Renames a path; renaming the Work Path saves it (Photoshop's Save Path). One undo step. */
6613
6741
  renamePath(id, name) {
6614
6742
  const old = this.requirePath(id);
@@ -6622,7 +6750,7 @@ var ImageEditorController = (_class12 = class {
6622
6750
  /** Duplicates a path as a saved path. One undo step. */
6623
6751
  duplicatePath(id, name) {
6624
6752
  const old = this.requirePath(id);
6625
- const copy = { ...old, id: newPathId(), name: _optionalChain([name, 'optionalAccess', _242 => _242.trim, 'call', _243 => _243()]) || `${old.name} copy`, components: JSON.parse(JSON.stringify(old.components)) };
6753
+ const copy = { ...old, id: newPathId(), name: _optionalChain([name, 'optionalAccess', _243 => _243.trim, 'call', _244 => _244()]) || `${old.name} copy`, components: JSON.parse(JSON.stringify(old.components)) };
6626
6754
  delete copy.work;
6627
6755
  const paths = this.getPaths();
6628
6756
  this.commitPaths([...paths.filter((p) => !p.work), copy, ...paths.filter((p) => p.work)], copy.id);
@@ -6828,7 +6956,7 @@ var ImageEditorController = (_class12 = class {
6828
6956
  const layer = loc.layer;
6829
6957
  if (layer.type !== "pixel") throw new (0, _chunkH65IBXFIcjs.LayerOperationError)(`Layer via copy needs a pixel layer; "${id}" is a ${layer.type} layer.`);
6830
6958
  const sel = this.state.selection;
6831
- if (!_optionalChain([sel, 'optionalAccess', _244 => _244.bounds])) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("Nothing is selected; select the pixels to copy first.");
6959
+ if (!_optionalChain([sel, 'optionalAccess', _245 => _245.bounds])) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("Nothing is selected; select the pixels to copy first.");
6832
6960
  if (options.cut) _chunkH65IBXFIcjs.requireUnlocked.call(void 0, layer, "pixels", "cut from it");
6833
6961
  const surface = this.surfaceOf(layer);
6834
6962
  const sb = sel.bounds;
@@ -6846,14 +6974,14 @@ var ImageEditorController = (_class12 = class {
6846
6974
  const copy = {
6847
6975
  type: "pixel",
6848
6976
  id: _chunkH65IBXFIcjs.newLayerId.call(void 0, ),
6849
- name: _optionalChain([options, 'access', _245 => _245.name, 'optionalAccess', _246 => _246.trim, 'call', _247 => _247()]) || `${layer.name || "Layer"} ${options.cut ? "cut" : "copy"}`,
6977
+ name: _optionalChain([options, 'access', _246 => _246.name, 'optionalAccess', _247 => _247.trim, 'call', _248 => _248()]) || `${layer.name || "Layer"} ${options.cut ? "cut" : "copy"}`,
6850
6978
  visible: true,
6851
6979
  opacity: 1,
6852
6980
  blend: "normal",
6853
6981
  surface: _chunk474IQG74cjs.surfaceFromPixels.call(void 0, { width: src.width, height: src.height, data: px2 }, 4, src.x, src.y),
6854
6982
  offset: { ...layer.offset }
6855
6983
  };
6856
- let next = _chunkUOGKSVRQcjs.insertLayer.call(void 0, this.state.layers, copy, _nullishCoalesce(_optionalChain([loc, 'access', _248 => _248.parent, 'optionalAccess', _249 => _249.id]), () => ( null)), loc.index + 1);
6984
+ let next = _chunkUOGKSVRQcjs.insertLayer.call(void 0, this.state.layers, copy, _nullishCoalesce(_optionalChain([loc, 'access', _249 => _249.parent, 'optionalAccess', _250 => _250.id]), () => ( null)), loc.index + 1);
6857
6985
  if (kept) {
6858
6986
  const cutLayer = { ...layer, surface: _chunk474IQG74cjs.writeRegion.call(void 0, surface, src, kept) };
6859
6987
  delete cutLayer.source;
@@ -6877,7 +7005,7 @@ var ImageEditorController = (_class12 = class {
6877
7005
  layers: () => this.state.layers,
6878
7006
  activeLayerId: () => this.state.activeLayerId,
6879
7007
  activeTarget: () => this.state.activeTarget,
6880
- selection: () => _optionalChain([this, 'access', _250 => _250.state, 'access', _251 => _251.selection, 'optionalAccess', _252 => _252.bounds]) ? this.state.selection : null,
7008
+ selection: () => _optionalChain([this, 'access', _251 => _251.state, 'access', _252 => _252.selection, 'optionalAccess', _253 => _253.bounds]) ? this.state.selection : null,
6881
7009
  canvas: () => this.naturalSize,
6882
7010
  pixelsOf: (layer) => this.surfaceOf(layer),
6883
7011
  shapeEnv: () => this.shapeEnv(),
@@ -7025,7 +7153,7 @@ var ImageEditorController = (_class12 = class {
7025
7153
  * anything else nests as a layer document. Returns the smart object's id.
7026
7154
  */
7027
7155
  convertToSmartObject(ids, options = {}) {
7028
- const list = _optionalChain([ids, 'optionalAccess', _253 => _253.length]) ? ids : this.state.activeLayerId ? [this.state.activeLayerId] : [];
7156
+ const list = _optionalChain([ids, 'optionalAccess', _254 => _254.length]) ? ids : this.state.activeLayerId ? [this.state.activeLayerId] : [];
7029
7157
  if (!list.length) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("No layers given and none is active; pass layerIds (see list_layers).");
7030
7158
  const res = _chunkH65IBXFIcjs.convertToSmartObject.call(void 0, this.state.layers, list, this.canvasSize, { surfaceOf: (l) => this.surfaceOf(l), name: options.name });
7031
7159
  this.commitLayers(res.layers, () => {
@@ -7058,8 +7186,8 @@ var ImageEditorController = (_class12 = class {
7058
7186
  width: c.width,
7059
7187
  height: c.height,
7060
7188
  decoded: _chunkH65IBXFIcjs.isContentsDecoded.call(void 0, c),
7061
- fileType: _nullishCoalesce(_optionalChain([c, 'access', _254 => _254.file, 'optionalAccess', _255 => _255.type]), () => ( null)),
7062
- linkedPath: _nullishCoalesce(_optionalChain([c, 'access', _256 => _256.linked, 'optionalAccess', _257 => _257.path]), () => ( null)),
7189
+ fileType: _nullishCoalesce(_optionalChain([c, 'access', _255 => _255.file, 'optionalAccess', _256 => _256.type]), () => ( null)),
7190
+ linkedPath: _nullishCoalesce(_optionalChain([c, 'access', _257 => _257.linked, 'optionalAccess', _258 => _258.path]), () => ( null)),
7063
7191
  instances: _chunkH65IBXFIcjs.instancesOf.call(void 0, this.state.layers, c.id),
7064
7192
  layerCount: c.document ? _chunkUOGKSVRQcjs.flattenLayers.call(void 0, c.document.layers).length : 0
7065
7193
  },
@@ -7076,9 +7204,9 @@ var ImageEditorController = (_class12 = class {
7076
7204
  bounds: _chunkH65IBXFIcjs.transformedBox.call(void 0, g)
7077
7205
  },
7078
7206
  smartFilters: {
7079
- enabled: _nullishCoalesce(_optionalChain([stack, 'optionalAccess', _258 => _258.enabled]), () => ( true)),
7080
- filters: (_nullishCoalesce(_optionalChain([stack, 'optionalAccess', _259 => _259.filters]), () => ( []))).map((f) => f.kind === "psd" ? { id: f.id, kind: "psd", name: f.name, enabled: f.enabled, blend: f.blend, opacity: f.opacity } : { ...f }),
7081
- mask: _optionalChain([stack, 'optionalAccess', _260 => _260.mask]) ? { enabled: stack.mask.enabled !== false, linked: stack.mask.linked !== false, density: _nullishCoalesce(stack.mask.density, () => ( 1)), feather: _nullishCoalesce(stack.mask.feather, () => ( 0)), bounds: _chunk474IQG74cjs.contentBounds.call(void 0, stack.mask.surface), defaultValue: stack.mask.defaultValue } : null
7207
+ enabled: _nullishCoalesce(_optionalChain([stack, 'optionalAccess', _259 => _259.enabled]), () => ( true)),
7208
+ filters: (_nullishCoalesce(_optionalChain([stack, 'optionalAccess', _260 => _260.filters]), () => ( []))).map((f) => f.kind === "psd" ? { id: f.id, kind: "psd", name: f.name, enabled: f.enabled, blend: f.blend, opacity: f.opacity } : { ...f }),
7209
+ mask: _optionalChain([stack, 'optionalAccess', _261 => _261.mask]) ? { enabled: stack.mask.enabled !== false, linked: stack.mask.linked !== false, density: _nullishCoalesce(stack.mask.density, () => ( 1)), feather: _nullishCoalesce(stack.mask.feather, () => ( 0)), bounds: _chunk474IQG74cjs.contentBounds.call(void 0, stack.mask.surface), defaultValue: stack.mask.defaultValue } : null
7082
7210
  },
7083
7211
  bounds: this.getLayerBounds(id)
7084
7212
  };
@@ -7217,7 +7345,7 @@ var ImageEditorController = (_class12 = class {
7217
7345
  * it in the same undo step (Photoshop limits a filter to the selection). Returns whether it did.
7218
7346
  */
7219
7347
  maskFiltersWithSelection(id, useSelection) {
7220
- if (!useSelection || !_optionalChain([this, 'access', _261 => _261.state, 'access', _262 => _262.selection, 'optionalAccess', _263 => _263.bounds])) return false;
7348
+ if (!useSelection || !_optionalChain([this, 'access', _262 => _262.state, 'access', _263 => _263.selection, 'optionalAccess', _264 => _264.bounds])) return false;
7221
7349
  this.setSmartFilterMask(id, "selection", {}, false);
7222
7350
  return true;
7223
7351
  }
@@ -7231,19 +7359,19 @@ var ImageEditorController = (_class12 = class {
7231
7359
  removeSmartFilter(id, filterId) {
7232
7360
  const res = _chunkH65IBXFIcjs.removeSmartFilter.call(void 0, this.state.layers, id, filterId, this.canvasSize);
7233
7361
  this.commitLayers(res.layers);
7234
- return _nullishCoalesce(_optionalChain([res, 'access', _264 => _264.layer, 'access', _265 => _265.smartFilters, 'optionalAccess', _266 => _266.filters]), () => ( []));
7362
+ return _nullishCoalesce(_optionalChain([res, 'access', _265 => _265.layer, 'access', _266 => _266.smartFilters, 'optionalAccess', _267 => _267.filters]), () => ( []));
7235
7363
  }
7236
7364
  /** Moves one smart filter to `index` (0 = bottom, applied first), as one undo step. Returns the filters. */
7237
7365
  moveSmartFilter(id, filterId, index) {
7238
7366
  const res = _chunkH65IBXFIcjs.moveSmartFilter.call(void 0, this.state.layers, id, filterId, index, this.canvasSize);
7239
7367
  this.commitLayers(res.layers);
7240
- return _nullishCoalesce(_optionalChain([res, 'access', _267 => _267.layer, 'access', _268 => _268.smartFilters, 'optionalAccess', _269 => _269.filters]), () => ( []));
7368
+ return _nullishCoalesce(_optionalChain([res, 'access', _268 => _268.layer, 'access', _269 => _269.smartFilters, 'optionalAccess', _270 => _270.filters]), () => ( []));
7241
7369
  }
7242
7370
  /** Turns a smart object's whole filter stack on or off (one undo step). */
7243
7371
  setSmartFiltersEnabled(id, enabled) {
7244
7372
  const res = _chunkH65IBXFIcjs.setSmartFiltersEnabled.call(void 0, this.state.layers, id, enabled, this.canvasSize);
7245
7373
  this.commitLayers(res.layers);
7246
- return _nullishCoalesce(_optionalChain([res, 'access', _270 => _270.layer, 'access', _271 => _271.smartFilters, 'optionalAccess', _272 => _272.enabled]), () => ( true));
7374
+ return _nullishCoalesce(_optionalChain([res, 'access', _271 => _271.layer, 'access', _272 => _272.smartFilters, 'optionalAccess', _273 => _273.enabled]), () => ( true));
7247
7375
  }
7248
7376
  /**
7249
7377
  * Sets the smart filter mask (one undo step): `reveal-all`, `hide-all`, `selection` (the
@@ -7255,11 +7383,11 @@ var ImageEditorController = (_class12 = class {
7255
7383
  let mask;
7256
7384
  if (from === "none") mask = null;
7257
7385
  else if (from === "keep") {
7258
- if (!_optionalChain([layer, 'access', _273 => _273.smartFilters, 'optionalAccess', _274 => _274.mask])) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)(`Smart object "${layer.name || id}" has no filter mask; add one with from reveal-all, hide-all or selection.`);
7386
+ if (!_optionalChain([layer, 'access', _274 => _274.smartFilters, 'optionalAccess', _275 => _275.mask])) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)(`Smart object "${layer.name || id}" has no filter mask; add one with from reveal-all, hide-all or selection.`);
7259
7387
  mask = withMaskProps(layer.smartFilters.mask, props);
7260
7388
  } else if (from === "selection") {
7261
7389
  const sel = this.state.selection;
7262
- if (!_optionalChain([sel, 'optionalAccess', _275 => _275.bounds])) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
7390
+ if (!_optionalChain([sel, 'optionalAccess', _276 => _276.bounds])) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
7263
7391
  mask = this.maskFromSelection(sel, props);
7264
7392
  } else {
7265
7393
  const v = from === "reveal-all" ? 255 : 0;
@@ -7271,7 +7399,7 @@ var ImageEditorController = (_class12 = class {
7271
7399
  if (mask && from !== "keep") this.state.activeTarget = "filter-mask";
7272
7400
  else if (!mask && this.state.activeTarget === "filter-mask") this.state.activeTarget = "pixels";
7273
7401
  }, commitToHistory);
7274
- return _nullishCoalesce(_optionalChain([res, 'access', _276 => _276.layer, 'access', _277 => _277.smartFilters, 'optionalAccess', _278 => _278.mask]), () => ( null));
7402
+ return _nullishCoalesce(_optionalChain([res, 'access', _277 => _277.layer, 'access', _278 => _278.smartFilters, 'optionalAccess', _279 => _279.mask]), () => ( null));
7275
7403
  }
7276
7404
  /**
7277
7405
  * Decodes smart object contents that came as files the synchronous decoders cannot read (a JPEG
@@ -7296,7 +7424,7 @@ var ImageEditorController = (_class12 = class {
7296
7424
  };
7297
7425
  this.state.layers = swap(this.state.layers);
7298
7426
  for (const e of [...this.undoStack, ...this.redoStack]) e.layers = swap(e.layers);
7299
- } catch (e28) {
7427
+ } catch (e29) {
7300
7428
  left.push(cid);
7301
7429
  }
7302
7430
  }
@@ -7319,7 +7447,7 @@ var ImageEditorController = (_class12 = class {
7319
7447
  if (this.getFreeTransform()) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("A Free Transform is open; commit or cancel it first.");
7320
7448
  const layer = _chunkH65IBXFIcjs.requireSmartObject.call(void 0, this.state.layers, id);
7321
7449
  const c = layer.contents;
7322
- if (!_chunkH65IBXFIcjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)(`The contents of "${layer.name || id}" are a ${_nullishCoalesce(_optionalChain([c, 'access', _279 => _279.file, 'optionalAccess', _280 => _280.type]), () => ( "file"))} that could not be decoded here; run prepareSmartObjects() in a browser first.`);
7450
+ if (!_chunkH65IBXFIcjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)(`The contents of "${layer.name || id}" are a ${_nullishCoalesce(_optionalChain([c, 'access', _280 => _280.file, 'optionalAccess', _281 => _281.type]), () => ( "file"))} that could not be decoded here; run prepareSmartObjects() in a browser first.`);
7323
7451
  const saved = {
7324
7452
  state: { ...this.state },
7325
7453
  undo: this.undoStack,
@@ -7350,9 +7478,9 @@ var ImageEditorController = (_class12 = class {
7350
7478
  editingContents: this.getEditingContents()
7351
7479
  };
7352
7480
  delete this.state.legacyOutputBlur;
7353
- if (_optionalChain([c, 'access', _281 => _281.document, 'optionalAccess', _282 => _282.globalLight])) this.state.globalLight = c.document.globalLight;
7481
+ if (_optionalChain([c, 'access', _282 => _282.document, 'optionalAccess', _283 => _283.globalLight])) this.state.globalLight = c.document.globalLight;
7354
7482
  else delete this.state.globalLight;
7355
- if (_optionalChain([c, 'access', _283 => _283.document, 'optionalAccess', _284 => _284.patterns, 'optionalAccess', _285 => _285.length])) this.state.patterns = c.document.patterns;
7483
+ if (_optionalChain([c, 'access', _284 => _284.document, 'optionalAccess', _285 => _285.patterns, 'optionalAccess', _286 => _286.length])) this.state.patterns = c.document.patterns;
7356
7484
  else delete this.state.patterns;
7357
7485
  this.imageElement = null;
7358
7486
  this.samplePixels = null;
@@ -7372,23 +7500,23 @@ var ImageEditorController = (_class12 = class {
7372
7500
  closeSmartObjectContents(save = true) {
7373
7501
  const top = this.contentsStack.pop();
7374
7502
  if (!top) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("No smart object contents are open; open them with edit_smart_object_contents.");
7375
- if (_optionalChain([this, 'access', _286 => _286.openTransform, 'optionalAccess', _287 => _287.isOpen])) this.openTransform.cancel();
7503
+ if (_optionalChain([this, 'access', _287 => _287.openTransform, 'optionalAccess', _288 => _288.isOpen])) this.openTransform.cancel();
7376
7504
  this.openTransform = null;
7377
7505
  const edited = this.state;
7378
7506
  const changed = save && this.undoStack.length > 0;
7379
7507
  let next = null;
7380
7508
  if (changed) {
7381
- const layer = _optionalChain([_chunkUOGKSVRQcjs.findLayer.call(void 0, top.saved.state.layers, top.layerId), 'optionalAccess', _288 => _288.layer]);
7382
- const old = _optionalChain([layer, 'optionalAccess', _289 => _289.contents]);
7509
+ const layer = _optionalChain([_chunkUOGKSVRQcjs.findLayer.call(void 0, top.saved.state.layers, top.layerId), 'optionalAccess', _289 => _289.layer]);
7510
+ const old = _optionalChain([layer, 'optionalAccess', _290 => _290.contents]);
7383
7511
  const { width, height } = edited.imageDimensions;
7384
7512
  const only = edited.layers.length === 1 ? edited.layers[0] : null;
7385
- const plain3 = _optionalChain([only, 'optionalAccess', _290 => _290.type]) === "pixel" && only.visible && only.opacity === 1 && only.blend === "normal" && !only.mask && !only.effects && !_optionalChain([only, 'access', _291 => _291.filters, 'optionalAccess', _292 => _292.length]) && !only.clipped && (_nullishCoalesce(only.fillOpacity, () => ( 1))) === 1 && only.source !== "document";
7386
- if (_optionalChain([old, 'optionalAccess', _293 => _293.kind]) === "raster" && plain3) {
7513
+ const plain3 = _optionalChain([only, 'optionalAccess', _291 => _291.type]) === "pixel" && only.visible && only.opacity === 1 && only.blend === "normal" && !only.mask && !only.effects && !_optionalChain([only, 'access', _292 => _292.filters, 'optionalAccess', _293 => _293.length]) && !only.clipped && (_nullishCoalesce(only.fillOpacity, () => ( 1))) === 1 && only.source !== "document";
7514
+ if (_optionalChain([old, 'optionalAccess', _294 => _294.kind]) === "raster" && plain3) {
7387
7515
  const px2 = _chunk474IQG74cjs.readRegion.call(void 0, only.surface, { x: -only.offset.x, y: -only.offset.y, width, height });
7388
7516
  next = _chunkH65IBXFIcjs.rasterContents.call(void 0, { width, height, data: px2 }, old.name, old.id);
7389
7517
  } else {
7390
7518
  const doc = { layers: edited.layers, globalLight: edited.globalLight, patterns: edited.patterns };
7391
- next = _chunkH65IBXFIcjs.documentContents.call(void 0, doc, width, height, _optionalChain([old, 'optionalAccess', _294 => _294.kind]) === "document" ? old.name : `${(_nullishCoalesce(_optionalChain([old, 'optionalAccess', _295 => _295.name]), () => ( "Contents"))).replace(/\.\w+$/, "")}.psb`, top.contentsId);
7519
+ next = _chunkH65IBXFIcjs.documentContents.call(void 0, doc, width, height, _optionalChain([old, 'optionalAccess', _295 => _295.kind]) === "document" ? old.name : `${(_nullishCoalesce(_optionalChain([old, 'optionalAccess', _296 => _296.name]), () => ( "Contents"))).replace(/\.\w+$/, "")}.psb`, top.contentsId);
7392
7520
  }
7393
7521
  }
7394
7522
  const saved = top.saved;
@@ -7413,7 +7541,7 @@ var ImageEditorController = (_class12 = class {
7413
7541
  }
7414
7542
  /** The document's own layers (not the contents open for editing). */
7415
7543
  rootLayers() {
7416
- return _nullishCoalesce(_optionalChain([this, 'access', _296 => _296.contentsStack, 'access', _297 => _297[0], 'optionalAccess', _298 => _298.saved, 'access', _299 => _299.state, 'access', _300 => _300.layers]), () => ( this.state.layers));
7544
+ return _nullishCoalesce(_optionalChain([this, 'access', _297 => _297.contentsStack, 'access', _298 => _298[0], 'optionalAccess', _299 => _299.saved, 'access', _300 => _300.state, 'access', _301 => _301.layers]), () => ( this.state.layers));
7417
7545
  }
7418
7546
  /** Drops every open contents edit (loading another document). */
7419
7547
  abandonContents() {
@@ -7485,7 +7613,7 @@ var ImageEditorController = (_class12 = class {
7485
7613
  return this.getGlobalLight();
7486
7614
  }
7487
7615
  /** Composites `layers` (in isolation) over `rect` into a surface, loading depth maps first. */
7488
- async compositeToSurface(layers, rect) {
7616
+ async compositeToSurface(layers, rect2) {
7489
7617
  const { width, height } = this.naturalSize;
7490
7618
  if (_chunkUOGKSVRQcjs.flattenLayers.call(void 0, layers).some((l) => l.type === "annotation" && l.visible) && !this.renderer.canRasterize()) {
7491
7619
  throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("Merging annotation layers needs a canvas (a browser); hide or delete them first, or merge in the browser.");
@@ -7494,20 +7622,20 @@ var ImageEditorController = (_class12 = class {
7494
7622
  const sources = this.renderer.compositorSources(width, height);
7495
7623
  const depth = this.bitDepth;
7496
7624
  if (depth !== 8) {
7497
- const samples = _chunkUOGKSVRQcjs.workingToSamples.call(void 0, _chunkH65IBXFIcjs.compositeDeep.call(void 0, layers, rect, sources, depth), depth);
7498
- return _chunkOLNIPTB3cjs.surfaceFromDeepPixels.call(void 0, { width: rect.width, height: rect.height, data: samples }, 4, rect.x, rect.y);
7625
+ const samples = _chunkUOGKSVRQcjs.workingToSamples.call(void 0, _chunkH65IBXFIcjs.compositeDeep.call(void 0, layers, rect2, sources, depth), depth);
7626
+ return _chunkOLNIPTB3cjs.surfaceFromDeepPixels.call(void 0, { width: rect2.width, height: rect2.height, data: samples }, 4, rect2.x, rect2.y);
7499
7627
  }
7500
- const data = new (0, _chunkH65IBXFIcjs.LayerCompositor)().composite(layers, rect, sources);
7501
- return _chunk474IQG74cjs.surfaceFromPixels.call(void 0, { width: rect.width, height: rect.height, data }, 4, rect.x, rect.y);
7628
+ const data = new (0, _chunkH65IBXFIcjs.LayerCompositor)().composite(layers, rect2, sources);
7629
+ return _chunk474IQG74cjs.surfaceFromPixels.call(void 0, { width: rect2.width, height: rect2.height, data }, 4, rect2.x, rect2.y);
7502
7630
  }
7503
7631
  /**
7504
7632
  * The composite of the layer stack at the document's bit depth (as `compositePixels`, no
7505
7633
  * canvas): 16-bit sRGB samples, or 32-bit linear float, over `rect` (default the canvas). At 8
7506
7634
  * bits, the 8-bit composite widened to 16 bits.
7507
7635
  */
7508
- compositeDeepPixels(rect) {
7636
+ compositeDeepPixels(rect2) {
7509
7637
  const { width, height } = this.naturalSize;
7510
- const r = _nullishCoalesce(rect, () => ( { x: 0, y: 0, width, height }));
7638
+ const r = _nullishCoalesce(rect2, () => ( { x: 0, y: 0, width, height }));
7511
7639
  const depth = this.bitDepth;
7512
7640
  if (depth === 8) return { width: r.width, height: r.height, depth: 16, data: _chunkOLNIPTB3cjs.to16From8.call(void 0, this.compositePixels(r).data) };
7513
7641
  const data = _chunkUOGKSVRQcjs.workingToSamples.call(void 0, _chunkH65IBXFIcjs.compositeDeep.call(void 0, this.state.layers, r, this.compositorSources(), depth), depth);
@@ -7545,12 +7673,12 @@ var ImageEditorController = (_class12 = class {
7545
7673
  if (!upper.visible) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)(`Layer "${upper.name || id}" is hidden; show it or delete it instead of merging.`);
7546
7674
  _chunkH65IBXFIcjs.requireUnlocked.call(void 0, upper, "all", "merge it");
7547
7675
  _chunkH65IBXFIcjs.requireUnlocked.call(void 0, lower, "pixels", "merge into it");
7548
- let rect = _nullishCoalesce(_chunkH65IBXFIcjs.unionRect.call(void 0, this.paintBounds(lower), upper.type === "adjustment" ? null : this.paintBounds(upper)), () => ( { x: 0, y: 0, width: 1, height: 1 }));
7676
+ let rect2 = _nullishCoalesce(_chunkH65IBXFIcjs.unionRect.call(void 0, this.paintBounds(lower), upper.type === "adjustment" ? null : this.paintBounds(upper)), () => ( { x: 0, y: 0, width: 1, height: 1 }));
7549
7677
  const reach = Math.max(_chunkUOGKSVRQcjs.effectsMargin.call(void 0, lower.effects), upper.type === "adjustment" ? 0 : _chunkUOGKSVRQcjs.effectsMargin.call(void 0, upper.effects));
7550
- if (reach) rect = { x: rect.x - reach, y: rect.y - reach, width: rect.width + 2 * reach, height: rect.height + 2 * reach };
7678
+ if (reach) rect2 = { x: rect2.x - reach, y: rect2.y - reach, width: rect2.width + 2 * reach, height: rect2.height + 2 * reach };
7551
7679
  const base = { ...lower, blend: "normal", opacity: 1 };
7552
7680
  delete base.clipped;
7553
- const surface = await this.compositeToSurface([base, upper], rect);
7681
+ const surface = await this.compositeToSurface([base, upper], rect2);
7554
7682
  const merged = { ...lower, surface, offset: { x: 0, y: 0 } };
7555
7683
  delete merged.mask;
7556
7684
  delete merged.fillOpacity;
@@ -7632,9 +7760,9 @@ var ImageEditorController = (_class12 = class {
7632
7760
  if (!surface) return null;
7633
7761
  const ox = layer.type === "pixel" ? layer.offset.x : 0;
7634
7762
  const oy = layer.type === "pixel" ? layer.offset.y : 0;
7635
- const key = `${tw}x${th}:${ox},${oy}`;
7763
+ const key2 = `${tw}x${th}:${ox},${oy}`;
7636
7764
  let byKey = this.thumbCache.get(surface);
7637
- const hit = _optionalChain([byKey, 'optionalAccess', _301 => _301.get, 'call', _302 => _302(key)]);
7765
+ const hit = _optionalChain([byKey, 'optionalAccess', _302 => _302.get, 'call', _303 => _303(key2)]);
7638
7766
  if (hit) return hit;
7639
7767
  const out = new Uint8ClampedArray(tw * th * 4);
7640
7768
  for (let y = 0; y < th; y++) {
@@ -7654,7 +7782,7 @@ var ImageEditorController = (_class12 = class {
7654
7782
  byKey = /* @__PURE__ */ new Map();
7655
7783
  this.thumbCache.set(surface, byKey);
7656
7784
  }
7657
- byKey.set(key, thumb);
7785
+ byKey.set(key2, thumb);
7658
7786
  return thumb;
7659
7787
  }
7660
7788
  /**
@@ -7775,7 +7903,7 @@ var ImageEditorController = (_class12 = class {
7775
7903
  if (layer.mask.source) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)(`Layer "${name}" has a depth mask, which is generated, not painted.`);
7776
7904
  _chunkH65IBXFIcjs.requireUnlocked.call(void 0, layer, "all", action);
7777
7905
  } else if (ch === "filter-mask") {
7778
- if (layer.type !== "smart" || !_optionalChain([layer, 'access', _303 => _303.smartFilters, 'optionalAccess', _304 => _304.mask])) {
7906
+ if (layer.type !== "smart" || !_optionalChain([layer, 'access', _304 => _304.smartFilters, 'optionalAccess', _305 => _305.mask])) {
7779
7907
  throw new (0, _chunkH65IBXFIcjs.LayerOperationError)(`Layer "${name}" has no smart filter mask to ${action}; add one with set_smart_filter_mask, or target pixels or mask.`, `Layer "${name}" has no smart filter mask to ${action}.`);
7780
7908
  }
7781
7909
  if (!_chunkH65IBXFIcjs.isContentsDecoded.call(void 0, layer.contents)) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)(`The contents of "${name}" are not decoded here, so its filter mask cannot be painted; run prepareSmartObjects() first.`, `The smart object "${name}" is still loading; try again in a moment.`);
@@ -7790,7 +7918,7 @@ var ImageEditorController = (_class12 = class {
7790
7918
  if (!layer.visible) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)(`Layer "${name}" is hidden; show it before you ${action}.`);
7791
7919
  const offset = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
7792
7920
  const surface = ch === "mask" ? layer.mask.surface : ch === "filter-mask" ? layer.smartFilters.mask.surface : this.surfaceOf(layer);
7793
- const lockTransparency = ch === "pixels" && Boolean(_optionalChain([layer, 'access', _305 => _305.locks, 'optionalAccess', _306 => _306.transparency]));
7921
+ const lockTransparency = ch === "pixels" && Boolean(_optionalChain([layer, 'access', _306 => _306.locks, 'optionalAccess', _307 => _307.transparency]));
7794
7922
  return { id, layer, channel: ch, offset, surface, lockTransparency };
7795
7923
  }
7796
7924
  /** The layer with its pixels (or mask) replaced by `surface`. */
@@ -7834,13 +7962,13 @@ var ImageEditorController = (_class12 = class {
7834
7962
  blend: target.channel !== "pixels" ? "normal" : brush.blend,
7835
7963
  lockTransparency: target.lockTransparency,
7836
7964
  // In Quick Mask mode the selection is what is painted, so it does not limit the stroke.
7837
- selection: target.channel !== "quick-mask" && _optionalChain([this, 'access', _307 => _307.state, 'access', _308 => _308.selection, 'optionalAccess', _309 => _309.bounds]) ? this.state.selection : null,
7965
+ selection: target.channel !== "quick-mask" && _optionalChain([this, 'access', _308 => _308.state, 'access', _309 => _309.selection, 'optionalAccess', _310 => _310.bounds]) ? this.state.selection : null,
7838
7966
  offset: target.offset
7839
7967
  };
7840
7968
  const depth = target.channel !== "filter-mask" && target.channel !== "quick-mask" && this.bitDepth !== 8 ? this.bitDepth : null;
7841
7969
  if (tool === "mixer") return new PaintStrokeSession(this, target, this.mixerStroke(init, brush), apply, depth);
7842
7970
  if (isRetouchTool(tool)) return new PaintStrokeSession(this, target, this.retouchStroke(tool, init, brush, target, apply), apply, depth);
7843
- const gradient = tool === "brush" && _optionalChain([strokePaint, 'optionalAccess', _310 => _310.type]) === "gradient" ? _chunkPQ3H2AANcjs.resolvePaintGradient.call(void 0, strokePaint, { paint: toHex(color), secondary: toHex(background) }) : null;
7971
+ const gradient = tool === "brush" && _optionalChain([strokePaint, 'optionalAccess', _311 => _311.type]) === "gradient" ? _chunkPQ3H2AANcjs.resolvePaintGradient.call(void 0, strokePaint, { paint: toHex(color), secondary: toHex(background) }) : null;
7844
7972
  return new PaintStrokeSession(this, target, new (0, _chunkPQ3H2AANcjs.StrokeCoverage)(brush, gradient, _nullishCoalesce(init.seed, () => ( 0))), apply, depth);
7845
7973
  }
7846
7974
  /** A retouching stroke's start: its settings, what it samples and how it composites. */
@@ -7887,9 +8015,9 @@ var ImageEditorController = (_class12 = class {
7887
8015
  const steps = settings.historySteps;
7888
8016
  const entry = steps > 0 ? _nullishCoalesce(this.undoStack[this.undoStack.length - steps], () => ( this.undoStack[0])) : this.undoStack[0];
7889
8017
  if (!entry) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("There is no earlier state to paint from yet: the History Brush paints a layer as it was some undo steps back. Make a change first.");
7890
- const then = _optionalChain([_chunkUOGKSVRQcjs.findLayer.call(void 0, entry.layers, target.id), 'optionalAccess', _311 => _311.layer]);
8018
+ const then = _optionalChain([_chunkUOGKSVRQcjs.findLayer.call(void 0, entry.layers, target.id), 'optionalAccess', _312 => _312.layer]);
7891
8019
  if (!then) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)(`Layer "${target.id}" did not exist ${steps > 0 ? `${steps} steps back` : "in the oldest state"}; choose fewer history steps (historySteps).`);
7892
- const surface = target.channel === "mask" ? _optionalChain([then, 'access', _312 => _312.mask, 'optionalAccess', _313 => _313.surface]) : then.type === "pixel" ? then.surface : void 0;
8020
+ const surface = target.channel === "mask" ? _optionalChain([then, 'access', _313 => _313.mask, 'optionalAccess', _314 => _314.surface]) : then.type === "pixel" ? then.surface : void 0;
7893
8021
  if (!surface) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)(`Layer "${target.id}" had no ${target.channel === "mask" ? "mask" : "pixels"} in that state.`);
7894
8022
  const offset2 = then.type === "pixel" ? then.offset : { x: 0, y: 0 };
7895
8023
  const depth = !mask && this.bitDepth !== 8 ? this.bitDepth : null;
@@ -7963,7 +8091,7 @@ var ImageEditorController = (_class12 = class {
7963
8091
  }
7964
8092
  /** A pixel source over a surface (layer pixels or a mask) in layer space at `offset`. */
7965
8093
  surfaceSource(surface, offset) {
7966
- return new (0, _chunkYF3YZZ6Gcjs.TilePixelSource)((tx, ty) => _nullishCoalesce(_optionalChain([surface, 'access', _314 => _314.tiles, 'access', _315 => _315.get, 'call', _316 => _316(_chunk474IQG74cjs.tileKey.call(void 0, tx, ty)), 'optionalAccess', _317 => _317.data]), () => ( (surface.defaultValue ? defaultTile(surface) : null))), surface.channels, offset);
8094
+ return new (0, _chunkYF3YZZ6Gcjs.TilePixelSource)((tx, ty) => _nullishCoalesce(_optionalChain([surface, 'access', _315 => _315.tiles, 'access', _316 => _316.get, 'call', _317 => _317(_chunk474IQG74cjs.tileKey.call(void 0, tx, ty)), 'optionalAccess', _318 => _318.data]), () => ( (surface.defaultValue ? defaultTile(surface) : null))), surface.channels, offset);
7967
8095
  }
7968
8096
  /** A pixel source over the composite of the current layers (through `throughId` and below, or all of them), as it is now. */
7969
8097
  compositeSource(throughId, depth = null) {
@@ -8039,7 +8167,7 @@ var ImageEditorController = (_class12 = class {
8039
8167
  paintStroke(init) {
8040
8168
  if (!Array.isArray(init.points) || !init.points.length) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("points must hold at least one { x, y } point.");
8041
8169
  for (const p of init.points) {
8042
- if (!Number.isFinite(_optionalChain([p, 'optionalAccess', _318 => _318.x])) || !Number.isFinite(_optionalChain([p, 'optionalAccess', _319 => _319.y]))) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("Every point needs finite x and y (document pixels).");
8170
+ if (!Number.isFinite(_optionalChain([p, 'optionalAccess', _319 => _319.x])) || !Number.isFinite(_optionalChain([p, 'optionalAccess', _320 => _320.y]))) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("Every point needs finite x and y (document pixels).");
8043
8171
  }
8044
8172
  const session = this.beginStroke(init);
8045
8173
  session.push(init.points);
@@ -8068,7 +8196,7 @@ var ImageEditorController = (_class12 = class {
8068
8196
  */
8069
8197
  strokeSelection(options) {
8070
8198
  const sel = this.state.selection;
8071
- if (!_optionalChain([sel, 'optionalAccess', _320 => _320.bounds])) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("Nothing is selected; select first, then stroke the selection.");
8199
+ if (!_optionalChain([sel, 'optionalAccess', _321 => _321.bounds])) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("Nothing is selected; select first, then stroke the selection.");
8072
8200
  const width = options.width;
8073
8201
  if (!(width > 0 && width <= 250)) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("width must be greater than 0 and at most 250 px.");
8074
8202
  const location = _nullishCoalesce(options.location, () => ( "outside"));
@@ -8085,7 +8213,7 @@ var ImageEditorController = (_class12 = class {
8085
8213
  */
8086
8214
  cropToSelection() {
8087
8215
  const sel = this.state.selection;
8088
- if (!_optionalChain([sel, 'optionalAccess', _321 => _321.bounds])) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("Nothing is selected; select the area to keep, then crop to it.");
8216
+ if (!_optionalChain([sel, 'optionalAccess', _322 => _322.bounds])) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("Nothing is selected; select the area to keep, then crop to it.");
8089
8217
  const crop = { ...sel.bounds };
8090
8218
  this.setCrop(crop);
8091
8219
  return crop;
@@ -8136,21 +8264,23 @@ var ImageEditorController = (_class12 = class {
8136
8264
  */
8137
8265
  prepareContentAwareFill(options = {}) {
8138
8266
  const sel = this.state.selection;
8139
- if (!_optionalChain([sel, 'optionalAccess', _322 => _322.bounds])) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("Nothing is selected; select what to remove, then fill it.");
8267
+ if (!_optionalChain([sel, 'optionalAccess', _323 => _323.bounds])) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("Nothing is selected; select what to remove, then fill it.");
8140
8268
  if (this.bitDepth !== 8) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("Content-Aware Fill works on 8-bit documents for now; set_bit_depth 8 first, or use spot_heal.");
8141
8269
  const output = _nullishCoalesce(options.output, () => ( "current"));
8142
- if (output !== "current" && output !== "new-layer") throw new (0, _chunkH65IBXFIcjs.LayerOperationError)(`Unknown output "${String(output)}"; use current or new-layer.`);
8270
+ if (output !== "current" && output !== "new-layer" && output !== "duplicate-layer") {
8271
+ throw new (0, _chunkH65IBXFIcjs.LayerOperationError)(`Unknown output "${String(output)}"; use current, new-layer or duplicate-layer.`);
8272
+ }
8143
8273
  const target = this.paintTarget(options.layerId, "pixels", "fill");
8144
8274
  const { width, height } = this.naturalSize;
8145
8275
  const b = sel.bounds;
8146
8276
  let area = _nullishCoalesce(options.samplingArea, () => ( null));
8147
8277
  if (!area && options.samplingChannelId) area = this.requireChannel(options.samplingChannelId).mask;
8148
- if (!area && _optionalChain([options, 'access', _323 => _323.sampleRects, 'optionalAccess', _324 => _324.length])) {
8278
+ if (!area && _optionalChain([options, 'access', _324 => _324.sampleRects, 'optionalAccess', _325 => _325.length])) {
8149
8279
  for (const r of options.sampleRects) area = _chunkQYLWG22Ncjs.combineSelections.call(void 0, area, _chunkL52VMQZScjs.rectSelection.call(void 0, width, height, r, { antiAlias: false }), "add");
8150
8280
  }
8151
8281
  if (area && !area.bounds) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("The sampling area is empty; paint or give an area to sample from.");
8152
8282
  let win;
8153
- if (_optionalChain([area, 'optionalAccess', _325 => _325.bounds])) {
8283
+ if (_optionalChain([area, 'optionalAccess', _326 => _326.bounds])) {
8154
8284
  const a = area.bounds;
8155
8285
  const x0 = Math.max(0, Math.min(b.x - 8, a.x));
8156
8286
  const y0 = Math.max(0, Math.min(b.y - 8, a.y));
@@ -8175,7 +8305,7 @@ var ImageEditorController = (_class12 = class {
8175
8305
  }
8176
8306
  }
8177
8307
  let exclude = null;
8178
- if (area || _optionalChain([options, 'access', _326 => _326.excludeRects, 'optionalAccess', _327 => _327.length])) {
8308
+ if (area || _optionalChain([options, 'access', _327 => _327.excludeRects, 'optionalAccess', _328 => _328.length])) {
8179
8309
  exclude = new Uint8Array(n);
8180
8310
  if (area) {
8181
8311
  const ad = area.data;
@@ -8216,6 +8346,13 @@ var ImageEditorController = (_class12 = class {
8216
8346
  }
8217
8347
  const layerRect = { x: win.x - target.offset.x, y: win.y - target.offset.y, width: win.width, height: win.height };
8218
8348
  const surface = _chunk474IQG74cjs.writeRegion.call(void 0, target.surface, layerRect, out);
8349
+ if (output === "duplicate-layer") {
8350
+ return this.asOneStep(() => {
8351
+ const copy = this.duplicateLayer(target.id);
8352
+ this.commitLayers(_chunkUOGKSVRQcjs.mapLayer.call(void 0, this.state.layers, copy, (l) => this.withSurface(l, "pixels", surface)));
8353
+ return { layerId: copy, bounds: { ...b }, output };
8354
+ });
8355
+ }
8219
8356
  this.commitLayers(_chunkUOGKSVRQcjs.mapLayer.call(void 0, this.state.layers, target.id, (l) => this.withSurface(l, "pixels", surface)));
8220
8357
  return { layerId: target.id, bounds: { ...b }, output };
8221
8358
  }
@@ -8239,28 +8376,28 @@ var ImageEditorController = (_class12 = class {
8239
8376
  */
8240
8377
  copyPixels(options = {}) {
8241
8378
  const { width, height } = this.naturalSize;
8242
- const sel = _optionalChain([this, 'access', _328 => _328.state, 'access', _329 => _329.selection, 'optionalAccess', _330 => _330.bounds]) ? this.state.selection : null;
8243
- const rect = _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _331 => _331.bounds]), () => ( { x: 0, y: 0, width, height }));
8379
+ const sel = _optionalChain([this, 'access', _329 => _329.state, 'access', _330 => _330.selection, 'optionalAccess', _331 => _331.bounds]) ? this.state.selection : null;
8380
+ const rect2 = _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _332 => _332.bounds]), () => ( { x: 0, y: 0, width, height }));
8244
8381
  let data;
8245
8382
  if (options.merged) {
8246
- data = new Uint8ClampedArray(this.compositePixels(rect).data);
8383
+ data = new Uint8ClampedArray(this.compositePixels(rect2).data);
8247
8384
  } else {
8248
8385
  const id = _nullishCoalesce(options.layerId, () => ( this.state.activeLayerId));
8249
8386
  if (!id) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("No layer given and none is active; pass layerId, or merged: true to copy the visible image.");
8250
8387
  const layer = _chunkH65IBXFIcjs.requireLayer.call(void 0, this.state.layers, id).layer;
8251
8388
  if (layer.type !== "pixel") throw new (0, _chunkH65IBXFIcjs.LayerOperationError)(`Layer "${layer.name || id}" is not a pixel layer; copy merged, or rasterize it first.`);
8252
- data = _chunk474IQG74cjs.readRegion.call(void 0, this.surfaceOf(layer), { x: rect.x - layer.offset.x, y: rect.y - layer.offset.y, width: rect.width, height: rect.height });
8389
+ data = _chunk474IQG74cjs.readRegion.call(void 0, this.surfaceOf(layer), { x: rect2.x - layer.offset.x, y: rect2.y - layer.offset.y, width: rect2.width, height: rect2.height });
8253
8390
  }
8254
8391
  if (sel) {
8255
- for (let y = 0; y < rect.height; y++) {
8256
- for (let x = 0; x < rect.width; x++) {
8257
- const k = sel.data[(rect.y + y) * sel.width + rect.x + x];
8258
- const p = (y * rect.width + x) * 4 + 3;
8392
+ for (let y = 0; y < rect2.height; y++) {
8393
+ for (let x = 0; x < rect2.width; x++) {
8394
+ const k = sel.data[(rect2.y + y) * sel.width + rect2.x + x];
8395
+ const p = (y * rect2.width + x) * 4 + 3;
8259
8396
  data[p] = Math.round(data[p] * k / 255);
8260
8397
  }
8261
8398
  }
8262
8399
  }
8263
- this.clipboard = { width: rect.width, height: rect.height, x: rect.x, y: rect.y, data };
8400
+ this.clipboard = { width: rect2.width, height: rect2.height, x: rect2.x, y: rect2.y, data };
8264
8401
  return this.clipboard;
8265
8402
  }
8266
8403
  /** Edit › Cut: Copy, then clear the selected pixels, as one undo step. */
@@ -8280,7 +8417,7 @@ var ImageEditorController = (_class12 = class {
8280
8417
  pastePixels(mode = "new-layer", image = this.clipboard) {
8281
8418
  if (!image) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("The clipboard is empty; copy_pixels first.");
8282
8419
  if (!PASTE_MODES.includes(mode)) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)(`Unknown paste mode "${String(mode)}"; use ${PASTE_MODES.join(", ")}.`);
8283
- const sel = _optionalChain([this, 'access', _332 => _332.state, 'access', _333 => _333.selection, 'optionalAccess', _334 => _334.bounds]) ? this.state.selection : null;
8420
+ const sel = _optionalChain([this, 'access', _333 => _333.state, 'access', _334 => _334.selection, 'optionalAccess', _335 => _335.bounds]) ? this.state.selection : null;
8284
8421
  if ((mode === "into" || mode === "outside") && !sel) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)(`Paste ${mode === "into" ? "Into" : "Outside"} needs a selection; select where it goes first.`);
8285
8422
  const { width, height } = this.naturalSize;
8286
8423
  let x;
@@ -8289,7 +8426,7 @@ var ImageEditorController = (_class12 = class {
8289
8426
  x = image.x;
8290
8427
  y = image.y;
8291
8428
  } else {
8292
- const frame = _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _335 => _335.bounds]), () => ( { x: 0, y: 0, width, height }));
8429
+ const frame = _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _336 => _336.bounds]), () => ( { x: 0, y: 0, width, height }));
8293
8430
  x = Math.round(frame.x + (frame.width - image.width) / 2);
8294
8431
  y = Math.round(frame.y + (frame.height - image.height) / 2);
8295
8432
  }
@@ -8306,8 +8443,8 @@ var ImageEditorController = (_class12 = class {
8306
8443
  if (!(opacity >= 0 && opacity <= 1)) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("opacity must be from 0 to 1.");
8307
8444
  const blend = _nullishCoalesce(_chunkH65IBXFIcjs.parseBlend.call(void 0, options.blend), () => ( "normal"));
8308
8445
  const quickMask = target.channel === "quick-mask";
8309
- const sel = _nullishCoalesce(coverageMask, () => ( (!quickMask && options.useSelection !== false && _optionalChain([this, 'access', _336 => _336.state, 'access', _337 => _337.selection, 'optionalAccess', _338 => _338.bounds]) ? this.state.selection : null)));
8310
- const region = _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _339 => _339.bounds]), () => ( { x: 0, y: 0, width, height }));
8446
+ const sel = _nullishCoalesce(coverageMask, () => ( (!quickMask && options.useSelection !== false && _optionalChain([this, 'access', _337 => _337.state, 'access', _338 => _338.selection, 'optionalAccess', _339 => _339.bounds]) ? this.state.selection : null)));
8447
+ const region = _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _340 => _340.bounds]), () => ( { x: 0, y: 0, width, height }));
8311
8448
  const coverage = new (0, _chunkPQ3H2AANcjs.CoverageMap)();
8312
8449
  const ones = new Float32Array(region.width * region.height);
8313
8450
  if (sel) {
@@ -8432,7 +8569,7 @@ var ImageEditorController = (_class12 = class {
8432
8569
  placeLayer(layers, node, where) {
8433
8570
  if (where.aboveId) {
8434
8571
  const loc = _chunkUOGKSVRQcjs.findLayer.call(void 0, layers, where.aboveId);
8435
- if (loc) return _chunkUOGKSVRQcjs.insertLayer.call(void 0, layers, node, _nullishCoalesce(_optionalChain([loc, 'access', _340 => _340.parent, 'optionalAccess', _341 => _341.id]), () => ( null)), loc.index + 1);
8572
+ if (loc) return _chunkUOGKSVRQcjs.insertLayer.call(void 0, layers, node, _nullishCoalesce(_optionalChain([loc, 'access', _341 => _341.parent, 'optionalAccess', _342 => _342.id]), () => ( null)), loc.index + 1);
8436
8573
  }
8437
8574
  if (where.parentId) {
8438
8575
  const loc = _chunkUOGKSVRQcjs.findLayer.call(void 0, layers, where.parentId);
@@ -8443,11 +8580,11 @@ var ImageEditorController = (_class12 = class {
8443
8580
  const at = Math.max(0, Math.min(nodes.length, Math.round(where.adjustmentIndex)));
8444
8581
  if (at < nodes.length) {
8445
8582
  const loc = _chunkUOGKSVRQcjs.findLayer.call(void 0, layers, nodes[at].id);
8446
- return _chunkUOGKSVRQcjs.insertLayer.call(void 0, layers, node, _nullishCoalesce(_optionalChain([loc, 'access', _342 => _342.parent, 'optionalAccess', _343 => _343.id]), () => ( null)), loc.index);
8583
+ return _chunkUOGKSVRQcjs.insertLayer.call(void 0, layers, node, _nullishCoalesce(_optionalChain([loc, 'access', _343 => _343.parent, 'optionalAccess', _344 => _344.id]), () => ( null)), loc.index);
8447
8584
  }
8448
8585
  if (nodes.length) {
8449
8586
  const loc = _chunkUOGKSVRQcjs.findLayer.call(void 0, layers, nodes[nodes.length - 1].id);
8450
- return _chunkUOGKSVRQcjs.insertLayer.call(void 0, layers, node, _nullishCoalesce(_optionalChain([loc, 'access', _344 => _344.parent, 'optionalAccess', _345 => _345.id]), () => ( null)), loc.index + 1);
8587
+ return _chunkUOGKSVRQcjs.insertLayer.call(void 0, layers, node, _nullishCoalesce(_optionalChain([loc, 'access', _345 => _345.parent, 'optionalAccess', _346 => _346.id]), () => ( null)), loc.index + 1);
8451
8588
  }
8452
8589
  }
8453
8590
  return _chunkUOGKSVRQcjs.insertLayer.call(void 0, layers, node, null, this.defaultInsertIndex(layers));
@@ -8486,7 +8623,7 @@ var ImageEditorController = (_class12 = class {
8486
8623
  enabled: spec.enabled,
8487
8624
  opacity: spec.opacity,
8488
8625
  blend: spec.blend,
8489
- mask: _nullishCoalesce(spec.mask, () => ( (spec.useSelection && _optionalChain([this, 'access', _346 => _346.state, 'access', _347 => _347.selection, 'optionalAccess', _348 => _348.bounds]) ? _chunkH65IBXFIcjs.layerMaskFromSelection.call(void 0, this.state.selection) : void 0)))
8626
+ mask: _nullishCoalesce(spec.mask, () => ( (spec.useSelection && _optionalChain([this, 'access', _347 => _347.state, 'access', _348 => _348.selection, 'optionalAccess', _349 => _349.bounds]) ? _chunkH65IBXFIcjs.layerMaskFromSelection.call(void 0, this.state.selection) : void 0)))
8490
8627
  });
8491
8628
  while (ids.has(layer.id)) layer.id = _chunkH65IBXFIcjs.newLayerId.call(void 0, "adj");
8492
8629
  const { width, height } = this.naturalSize;
@@ -8563,7 +8700,7 @@ var ImageEditorController = (_class12 = class {
8563
8700
  const anchor = nodes[to];
8564
8701
  const without = _chunkUOGKSVRQcjs.mapLayer.call(void 0, layers, id, () => null);
8565
8702
  const loc = _chunkUOGKSVRQcjs.findLayer.call(void 0, without, anchor.id);
8566
- return _chunkUOGKSVRQcjs.insertLayer.call(void 0, without, node, _nullishCoalesce(_optionalChain([loc, 'access', _349 => _349.parent, 'optionalAccess', _350 => _350.id]), () => ( null)), to > from ? loc.index + 1 : loc.index);
8703
+ return _chunkUOGKSVRQcjs.insertLayer.call(void 0, without, node, _nullishCoalesce(_optionalChain([loc, 'access', _350 => _350.parent, 'optionalAccess', _351 => _351.id]), () => ( null)), to > from ? loc.index + 1 : loc.index);
8567
8704
  }
8568
8705
  /** Moves a layer to `toIndex` among the adjustment layers (0 = bottom) as one undo step. Returns false if nothing moved. */
8569
8706
  moveAdjustmentLayer(id, toIndex) {
@@ -8604,7 +8741,7 @@ var ImageEditorController = (_class12 = class {
8604
8741
  return _nullishCoalesce(this.state.selection, () => ( null));
8605
8742
  }
8606
8743
  get hasSelection() {
8607
- return Boolean(_optionalChain([this, 'access', _351 => _351.state, 'access', _352 => _352.selection, 'optionalAccess', _353 => _353.bounds]));
8744
+ return Boolean(_optionalChain([this, 'access', _352 => _352.state, 'access', _353 => _353.selection, 'optionalAccess', _354 => _354.bounds]));
8608
8745
  }
8609
8746
  /** Returns the current canvas (composition) dimensions. */
8610
8747
  getCanvasSize() {
@@ -8696,7 +8833,7 @@ var ImageEditorController = (_class12 = class {
8696
8833
  const prev = normalizeSelection(_nullishCoalesce(this.state.selection, () => ( null)));
8697
8834
  if (prev === next || prev && next && sameSelection(prev, next)) return false;
8698
8835
  this.recordHistory();
8699
- if (!next && _optionalChain([prev, 'optionalAccess', _354 => _354.bounds])) this.lastSelection = prev;
8836
+ if (!next && _optionalChain([prev, 'optionalAccess', _355 => _355.bounds])) this.lastSelection = prev;
8700
8837
  this.state.selection = next;
8701
8838
  this.notify();
8702
8839
  return true;
@@ -8744,20 +8881,20 @@ var ImageEditorController = (_class12 = class {
8744
8881
  if (!Number.isFinite(position) || at < 0 || at >= max) {
8745
8882
  throw new RangeError(`${orientation === "row" ? "y" : "x"} ${position} is outside the image (0..${max - 1}).`);
8746
8883
  }
8747
- const rect = orientation === "row" ? { x: 0, y: at, width, height: 1 } : { x: at, y: 0, width: 1, height };
8748
- return this.shapeCommand(_chunkL52VMQZScjs.rectSelection.call(void 0, width, height, rect, { antiAlias: false }), options);
8884
+ const rect2 = orientation === "row" ? { x: 0, y: at, width, height: 1 } : { x: at, y: 0, width: 1, height };
8885
+ return this.shapeCommand(_chunkL52VMQZScjs.rectSelection.call(void 0, width, height, rect2, { antiAlias: false }), options);
8749
8886
  }
8750
8887
  /** Select › Grow: adds connected pixels within `tolerance` of a selected colour (one undo step). */
8751
8888
  async growSelection(options = {}) {
8752
8889
  const sel = this.state.selection;
8753
- if (!_optionalChain([sel, 'optionalAccess', _355 => _355.bounds])) return false;
8890
+ if (!_optionalChain([sel, 'optionalAccess', _356 => _356.bounds])) return false;
8754
8891
  const pixels = await this.requirePixels(options);
8755
8892
  return this.setSelection(growSelection(pixels, sel, options));
8756
8893
  }
8757
8894
  /** Select › Similar: adds every pixel within `tolerance` of a selected colour (one undo step). */
8758
8895
  async selectSimilar(options = {}) {
8759
8896
  const sel = this.state.selection;
8760
- if (!_optionalChain([sel, 'optionalAccess', _356 => _356.bounds])) return false;
8897
+ if (!_optionalChain([sel, 'optionalAccess', _357 => _357.bounds])) return false;
8761
8898
  const pixels = await this.requirePixels(options);
8762
8899
  return this.setSelection(selectSimilar(pixels, sel, options));
8763
8900
  }
@@ -8801,14 +8938,14 @@ var ImageEditorController = (_class12 = class {
8801
8938
  return this.setSelection(shaped, _nullishCoalesce(options.mode, () => ( "replace")));
8802
8939
  }
8803
8940
  /** Rectangular marquee in natural image pixels. */
8804
- selectRect(rect, options = {}) {
8941
+ selectRect(rect2, options = {}) {
8805
8942
  const { width, height } = this.naturalSize;
8806
- return this.shapeCommand(_chunkL52VMQZScjs.rectSelection.call(void 0, width, height, rect, options), options);
8943
+ return this.shapeCommand(_chunkL52VMQZScjs.rectSelection.call(void 0, width, height, rect2, options), options);
8807
8944
  }
8808
8945
  /** Elliptical marquee inscribed in `rect`. */
8809
- selectEllipse(rect, options = {}) {
8946
+ selectEllipse(rect2, options = {}) {
8810
8947
  const { width, height } = this.naturalSize;
8811
- return this.shapeCommand(_chunkL52VMQZScjs.ellipseSelection.call(void 0, width, height, rect, options), options);
8948
+ return this.shapeCommand(_chunkL52VMQZScjs.ellipseSelection.call(void 0, width, height, rect2, options), options);
8812
8949
  }
8813
8950
  /** Lasso / polygonal lasso. */
8814
8951
  selectPolygon(points, options = {}) {
@@ -8849,7 +8986,7 @@ var ImageEditorController = (_class12 = class {
8849
8986
  size: options.size,
8850
8987
  grow: m === "add",
8851
8988
  enhanceEdge: options.enhanceEdge,
8852
- selection: m === "add" && _optionalChain([sel, 'optionalAccess', _357 => _357.bounds]) ? _chunkL52VMQZScjs.serializeMask.call(void 0, sel) : null
8989
+ selection: m === "add" && _optionalChain([sel, 'optionalAccess', _358 => _358.bounds]) ? _chunkL52VMQZScjs.serializeMask.call(void 0, sel) : null
8853
8990
  };
8854
8991
  const { mask } = await this.runSelectionJob(job, pixels, {
8855
8992
  signal: options.signal,
@@ -8869,7 +9006,7 @@ var ImageEditorController = (_class12 = class {
8869
9006
  const { width, height } = this.naturalSize;
8870
9007
  const image = await this.toDataURL({ format: "image/png" });
8871
9008
  const results = await provider.segment({ ...request, image, width, height });
8872
- _optionalChain([request, 'access', _358 => _358.signal, 'optionalAccess', _359 => _359.throwIfAborted, 'call', _360 => _360()]);
9009
+ _optionalChain([request, 'access', _359 => _359.signal, 'optionalAccess', _360 => _360.throwIfAborted, 'call', _361 => _361()]);
8873
9010
  const decoded = [];
8874
9011
  for (const r of _nullishCoalesce(results, () => ( []))) decoded.push({ ...r, mask: r.mask !== void 0 ? await this.decodeMaskImage(r.mask) : void 0 });
8875
9012
  return decoded;
@@ -8886,7 +9023,7 @@ var ImageEditorController = (_class12 = class {
8886
9023
  let union = null;
8887
9024
  for (const r of decoded) {
8888
9025
  const one = segmentsToSelection(width, height, [r]);
8889
- if (!_optionalChain([one, 'optionalAccess', _361 => _361.bounds])) continue;
9026
+ if (!_optionalChain([one, 'optionalAccess', _362 => _362.bounds])) continue;
8890
9027
  if ("rect" in target) {
8891
9028
  const r0 = target.rect;
8892
9029
  const grow = 0.1 * Math.max(r0.width, r0.height);
@@ -8954,7 +9091,7 @@ var ImageEditorController = (_class12 = class {
8954
9091
  if (this.segmentation && options.useModel !== false) {
8955
9092
  const { width, height } = this.naturalSize;
8956
9093
  const sky = segmentsToSelection(width, height, await this.modelSegments({ target: "the sky", signal: options.signal }));
8957
- if (!_optionalChain([sky, 'optionalAccess', _362 => _362.bounds])) return { selection: _nullishCoalesce(this.state.selection, () => ( null)), method: "model", note: "The segmentation model found no sky." };
9094
+ if (!_optionalChain([sky, 'optionalAccess', _363 => _363.bounds])) return { selection: _nullishCoalesce(this.state.selection, () => ( null)), method: "model", note: "The segmentation model found no sky." };
8958
9095
  this.setSelection(sky, _nullishCoalesce(options.mode, () => ( "replace")));
8959
9096
  return { selection: _nullishCoalesce(this.state.selection, () => ( null)), method: "model" };
8960
9097
  }
@@ -8985,13 +9122,13 @@ var ImageEditorController = (_class12 = class {
8985
9122
  try {
8986
9123
  const canvas = await this.renderSource();
8987
9124
  const ctx = canvas.getContext("2d");
8988
- const data2 = _optionalChain([ctx, 'optionalAccess', _363 => _363.getImageData, 'optionalCall', _364 => _364(0, 0, width, height)]);
9125
+ const data2 = _optionalChain([ctx, 'optionalAccess', _364 => _364.getImageData, 'optionalCall', _365 => _365(0, 0, width, height)]);
8989
9126
  if (data2 && data2.data && data2.data.length >= width * height * 4) {
8990
9127
  base = { width, height, data: data2.data };
8991
9128
  this.samplePixels = base;
8992
9129
  this.samplePixelsOverride = false;
8993
9130
  }
8994
- } catch (e29) {
9131
+ } catch (e30) {
8995
9132
  base = null;
8996
9133
  }
8997
9134
  }
@@ -9060,7 +9197,7 @@ var ImageEditorController = (_class12 = class {
9060
9197
  /** Select › Modify: grow, shrink, feather, border or smooth by `radius` pixels (one undo step). */
9061
9198
  modifySelection(op, radius) {
9062
9199
  const sel = this.state.selection;
9063
- if (!_optionalChain([sel, 'optionalAccess', _365 => _365.bounds])) return false;
9200
+ if (!_optionalChain([sel, 'optionalAccess', _366 => _366.bounds])) return false;
9064
9201
  return this.setSelection(_chunkQYLWG22Ncjs.modifySelection.call(void 0, sel, op, radius));
9065
9202
  }
9066
9203
  /**
@@ -9069,7 +9206,7 @@ var ImageEditorController = (_class12 = class {
9069
9206
  */
9070
9207
  async refineSelection(params, options = {}) {
9071
9208
  const sel = this.state.selection;
9072
- if (!_optionalChain([sel, 'optionalAccess', _366 => _366.bounds])) return false;
9209
+ if (!_optionalChain([sel, 'optionalAccess', _367 => _367.bounds])) return false;
9073
9210
  const pixels = (_nullishCoalesce(params.radius, () => ( 0))) > 0 ? await this.requirePixels(options) : null;
9074
9211
  return this.setSelection(_chunkL52VMQZScjs.refineSelection.call(void 0, pixels, sel, params));
9075
9212
  }
@@ -9091,7 +9228,7 @@ var ImageEditorController = (_class12 = class {
9091
9228
  async refineSelectionTo(params, output = "selection", options = {}) {
9092
9229
  const edits = _nullishCoalesce(options.edits, () => ( []));
9093
9230
  const refineMode = _nullishCoalesce(options.refineMode, () => ( "color"));
9094
- if (!_optionalChain([this, 'access', _367 => _367.state, 'access', _368 => _368.selection, 'optionalAccess', _369 => _369.bounds]) && !edits.length) throw new Error("Nothing is selected; select first, or pass edits that paint a selection.");
9231
+ if (!_optionalChain([this, 'access', _368 => _368.state, 'access', _369 => _369.selection, 'optionalAccess', _370 => _370.bounds]) && !edits.length) throw new Error("Nothing is selected; select first, or pass edits that paint a selection.");
9095
9232
  if (refineMode === "object" && !this.segmentation) {
9096
9233
  throw new Error("Object aware refinement needs a segmentation model (setSegmentationProvider); use refineMode color.");
9097
9234
  }
@@ -9114,14 +9251,14 @@ var ImageEditorController = (_class12 = class {
9114
9251
  const { width, height } = this.naturalSize;
9115
9252
  const edited = _chunkL52VMQZScjs.applyRefineEdits.call(void 0, pixels, _nullishCoalesce(this.state.selection, () => ( null)), edits, width, height);
9116
9253
  let sel = edited.selection;
9117
- if (!_optionalChain([sel, 'optionalAccess', _370 => _370.bounds])) throw new Error("The edits leave nothing selected; paint with mode add first.");
9254
+ if (!_optionalChain([sel, 'optionalAccess', _371 => _371.bounds])) throw new Error("The edits leave nothing selected; paint with mode add first.");
9118
9255
  if (refineMode === "object") {
9119
9256
  const b = sel.bounds;
9120
9257
  const found = await this.modelObject({ rect: b }, options.signal);
9121
9258
  if (!found) throw new Error("The segmentation model found no object in the selection; use refineMode color.");
9122
9259
  const near = _chunkQYLWG22Ncjs.modifySelection.call(void 0, sel, "expand", Math.max(4, _nullishCoalesce(params.radius, () => ( 8))));
9123
9260
  const clipped = _chunkQYLWG22Ncjs.combineSelections.call(void 0, found, near, "intersect");
9124
- if (!_optionalChain([clipped, 'optionalAccess', _371 => _371.bounds])) throw new Error("The segmentation model found no object in the selection; use refineMode color.");
9261
+ if (!_optionalChain([clipped, 'optionalAccess', _372 => _372.bounds])) throw new Error("The segmentation model found no object in the selection; use refineMode color.");
9125
9262
  sel = clipped;
9126
9263
  }
9127
9264
  const refined = _chunkL52VMQZScjs.refineSelection.call(void 0, pixels, sel, params, edited.refineBrush);
@@ -9216,7 +9353,7 @@ var ImageEditorController = (_class12 = class {
9216
9353
  let mask;
9217
9354
  if (source === "selection") {
9218
9355
  const sel = this.state.selection;
9219
- if (!_optionalChain([sel, 'optionalAccess', _372 => _372.bounds])) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("Nothing is selected; select first, or export a channel or a layer mask.");
9356
+ if (!_optionalChain([sel, 'optionalAccess', _373 => _373.bounds])) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("Nothing is selected; select first, or export a channel or a layer mask.");
9220
9357
  mask = sel;
9221
9358
  } else if ("channelId" in source) {
9222
9359
  mask = this.requireChannel(source.channelId).mask;
@@ -9240,7 +9377,7 @@ var ImageEditorController = (_class12 = class {
9240
9377
  const canvas = this.renderer.createCanvas(w, h);
9241
9378
  const ctx = canvas.getContext("2d");
9242
9379
  if (ctx) ctx.drawImage(img, 0, 0, w, h);
9243
- const data = _optionalChain([ctx, 'optionalAccess', _373 => _373.getImageData, 'optionalCall', _374 => _374(0, 0, w, h)]);
9380
+ const data = _optionalChain([ctx, 'optionalAccess', _374 => _374.getImageData, 'optionalCall', _375 => _375(0, 0, w, h)]);
9244
9381
  if (!data) throw new Error("The mask image pixels are not available (no canvas access); pass pixels.");
9245
9382
  return { width: w, height: h, data: data.data };
9246
9383
  }
@@ -9256,7 +9393,7 @@ var ImageEditorController = (_class12 = class {
9256
9393
  const provider = this.segmentation;
9257
9394
  if (!provider) {
9258
9395
  const pixels = await this.requirePixels({});
9259
- _optionalChain([options, 'access', _375 => _375.signal, 'optionalAccess', _376 => _376.throwIfAborted, 'call', _377 => _377()]);
9396
+ _optionalChain([options, 'access', _376 => _376.signal, 'optionalAccess', _377 => _377.throwIfAborted, 'call', _378 => _378()]);
9260
9397
  const { mask: selection, reason } = await this.runSelectionJob({ op: "subject", enhanceEdge: options.enhanceEdge }, pixels, options);
9261
9398
  if (selection.bounds) this.shapeCommand(selection, options);
9262
9399
  const unused = target.trim() ? ` "${target.trim()}" was not used to choose it.` : "";
@@ -9272,17 +9409,17 @@ var ImageEditorController = (_class12 = class {
9272
9409
  const decoded = await this.modelSegments({ target: description, maxSegments: options.maxSegments, signal: options.signal });
9273
9410
  const segments = decoded.map((r) => {
9274
9411
  const one = segmentsToSelection(width, height, [r]);
9275
- return { label: r.label || description, bounds: _nullishCoalesce(_optionalChain([one, 'optionalAccess', _378 => _378.bounds]), () => ( null)), ...r.score !== void 0 ? { score: r.score } : {} };
9412
+ return { label: r.label || description, bounds: _nullishCoalesce(_optionalChain([one, 'optionalAccess', _379 => _379.bounds]), () => ( null)), ...r.score !== void 0 ? { score: r.score } : {} };
9276
9413
  });
9277
9414
  const mask = segmentsToSelection(width, height, decoded);
9278
9415
  if (mask && options.beforeApply) {
9279
9416
  const outlines = decoded.flatMap((r, i) => {
9280
9417
  const rings = segmentationOutlines(r);
9281
- const b = _optionalChain([segments, 'access', _379 => _379[i], 'optionalAccess', _380 => _380.bounds]);
9418
+ const b = _optionalChain([segments, 'access', _380 => _380[i], 'optionalAccess', _381 => _381.bounds]);
9282
9419
  return rings.length ? rings : b ? [[{ x: b.x, y: b.y }, { x: b.x + b.width, y: b.y }, { x: b.x + b.width, y: b.y + b.height }, { x: b.x, y: b.y + b.height }]] : [];
9283
9420
  });
9284
9421
  await options.beforeApply(outlines);
9285
- _optionalChain([options, 'access', _381 => _381.signal, 'optionalAccess', _382 => _382.throwIfAborted, 'call', _383 => _383()]);
9422
+ _optionalChain([options, 'access', _382 => _382.signal, 'optionalAccess', _383 => _383.throwIfAborted, 'call', _384 => _384()]);
9286
9423
  }
9287
9424
  if (mask) this.shapeCommand(mask, options);
9288
9425
  return { segments: segments.filter((s) => s.bounds), method: "model" };
@@ -9315,7 +9452,7 @@ var ImageEditorController = (_class12 = class {
9315
9452
  const view = this.state.maskView;
9316
9453
  if (!view) return null;
9317
9454
  const layer = this.getLayer(view.layerId);
9318
- return _optionalChain([layer, 'optionalAccess', _384 => _384.mask]) && !layer.mask.source ? view : null;
9455
+ return _optionalChain([layer, 'optionalAccess', _385 => _385.mask]) && !layer.mask.source ? view : null;
9319
9456
  }
9320
9457
  /**
9321
9458
  * Shows a layer's mask on the canvas: `gray` alone in grey (Alt-click the mask thumbnail),
@@ -9338,7 +9475,7 @@ var ImageEditorController = (_class12 = class {
9338
9475
  if (!layer.mask) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask to show; add one with add_layer_mask.`);
9339
9476
  if (layer.mask.source) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)(`Layer "${layer.name || id}" has a depth mask, which is computed, not painted, so it has no mask view.`);
9340
9477
  const cur = this.state.maskView;
9341
- if (_optionalChain([cur, 'optionalAccess', _385 => _385.layerId]) !== id || cur.mode !== mode) {
9478
+ if (_optionalChain([cur, 'optionalAccess', _386 => _386.layerId]) !== id || cur.mode !== mode) {
9342
9479
  this.state.maskView = { layerId: id, mode };
9343
9480
  this.notify();
9344
9481
  }
@@ -9350,7 +9487,7 @@ var ImageEditorController = (_class12 = class {
9350
9487
  return _nullishCoalesce(this.state.channels, () => ( []));
9351
9488
  }
9352
9489
  getChannel(id) {
9353
- return _nullishCoalesce(_optionalChain([this, 'access', _386 => _386.state, 'access', _387 => _387.channels, 'optionalAccess', _388 => _388.find, 'call', _389 => _389((c) => c.id === id)]), () => ( null));
9490
+ return _nullishCoalesce(_optionalChain([this, 'access', _387 => _387.state, 'access', _388 => _388.channels, 'optionalAccess', _389 => _389.find, 'call', _390 => _390((c) => c.id === id)]), () => ( null));
9354
9491
  }
9355
9492
  requireChannel(id) {
9356
9493
  const channel = this.getChannel(id);
@@ -9379,14 +9516,14 @@ var ImageEditorController = (_class12 = class {
9379
9516
  */
9380
9517
  saveSelection(options = {}) {
9381
9518
  const sel = this.state.selection;
9382
- if (!_optionalChain([sel, 'optionalAccess', _390 => _390.bounds])) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("Nothing is selected; select first, then save the selection to a channel.");
9519
+ if (!_optionalChain([sel, 'optionalAccess', _391 => _391.bounds])) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("Nothing is selected; select first, then save the selection to a channel.");
9383
9520
  const { width, height } = this.naturalSize;
9384
9521
  const sized = sel.width === width && sel.height === height ? sel : _chunkQYLWG22Ncjs.resizeSelection.call(void 0, sel, width, height);
9385
9522
  const channels = [...this.getChannels()];
9386
9523
  if (options.channelId !== void 0) {
9387
9524
  const existing = this.requireChannel(options.channelId);
9388
9525
  const mask = _nullishCoalesce(_chunkQYLWG22Ncjs.combineSelections.call(void 0, existing.mask.bounds ? existing.mask : null, sized, _nullishCoalesce(options.mode, () => ( "replace"))), () => ( _chunkQYLWG22Ncjs.createSelectionMask.call(void 0, width, height)));
9389
- const next = { ...existing, mask, ..._optionalChain([options, 'access', _391 => _391.name, 'optionalAccess', _392 => _392.trim, 'call', _393 => _393()]) ? { name: options.name.trim() } : {} };
9526
+ const next = { ...existing, mask, ..._optionalChain([options, 'access', _392 => _392.name, 'optionalAccess', _393 => _393.trim, 'call', _394 => _394()]) ? { name: options.name.trim() } : {} };
9390
9527
  this.setChannels(channels.map((c) => c.id === existing.id ? next : c));
9391
9528
  return next;
9392
9529
  }
@@ -9397,7 +9534,7 @@ var ImageEditorController = (_class12 = class {
9397
9534
  const channels = this.getChannels();
9398
9535
  const channel = {
9399
9536
  id: this.newChannelId(),
9400
- name: _optionalChain([name, 'optionalAccess', _394 => _394.trim, 'call', _395 => _395()]) || `Alpha ${channels.length + 1}`,
9537
+ name: _optionalChain([name, 'optionalAccess', _395 => _395.trim, 'call', _396 => _396()]) || `Alpha ${channels.length + 1}`,
9401
9538
  mask,
9402
9539
  color: DEFAULT_CHANNEL_COLOR,
9403
9540
  opacity: 0.5,
@@ -9442,7 +9579,7 @@ var ImageEditorController = (_class12 = class {
9442
9579
  /** Duplicates an alpha channel just after it (one undo step). Returns the copy. */
9443
9580
  duplicateChannel(id, name) {
9444
9581
  const channel = this.requireChannel(id);
9445
- const copy = { ...channel, id: this.newChannelId(), name: _optionalChain([name, 'optionalAccess', _396 => _396.trim, 'call', _397 => _397()]) || `${channel.name} copy` };
9582
+ const copy = { ...channel, id: this.newChannelId(), name: _optionalChain([name, 'optionalAccess', _397 => _397.trim, 'call', _398 => _398()]) || `${channel.name} copy` };
9446
9583
  const channels = [...this.getChannels()];
9447
9584
  channels.splice(channels.findIndex((c) => c.id === id) + 1, 0, copy);
9448
9585
  this.setChannels(channels);
@@ -9473,7 +9610,7 @@ var ImageEditorController = (_class12 = class {
9473
9610
  quickMaskSurface() {
9474
9611
  const { width, height } = this.naturalSize;
9475
9612
  const sel = this.state.selection;
9476
- if (!_optionalChain([sel, 'optionalAccess', _398 => _398.bounds])) return _chunk474IQG74cjs.emptySurface.call(void 0, 1, 0);
9613
+ if (!_optionalChain([sel, 'optionalAccess', _399 => _399.bounds])) return _chunk474IQG74cjs.emptySurface.call(void 0, 1, 0);
9477
9614
  return (sel.width === width && sel.height === height ? sel : _chunkQYLWG22Ncjs.resizeSelection.call(void 0, sel, width, height)).surface;
9478
9615
  }
9479
9616
  /** The selection a painted Quick Mask surface stands for (it shares the surface's tiles). */
@@ -9494,7 +9631,7 @@ var ImageEditorController = (_class12 = class {
9494
9631
  */
9495
9632
  applySelectionAsLayerMask(layerId, props = {}) {
9496
9633
  const sel = this.state.selection;
9497
- if (!_optionalChain([sel, 'optionalAccess', _399 => _399.bounds]) || !this.getAdjustmentLayer(layerId)) return false;
9634
+ if (!_optionalChain([sel, 'optionalAccess', _400 => _400.bounds]) || !this.getAdjustmentLayer(layerId)) return false;
9498
9635
  return this.setLayerMask(layerId, this.maskFromSelection(sel, props));
9499
9636
  }
9500
9637
  setLayerMask(layerId, mask, commitToHistory = true) {
@@ -9534,7 +9671,7 @@ var ImageEditorController = (_class12 = class {
9534
9671
  /** A layer's painted mask over the canvas as a selection mask; null without one (or for a depth mask). */
9535
9672
  layerMaskCoverage(layerId) {
9536
9673
  const layer = this.getLayer(layerId);
9537
- if (!_optionalChain([layer, 'optionalAccess', _400 => _400.mask]) || layer.mask.source) return null;
9674
+ if (!_optionalChain([layer, 'optionalAccess', _401 => _401.mask]) || layer.mask.source) return null;
9538
9675
  const { width, height } = this.naturalSize;
9539
9676
  const ox = layer.type === "pixel" ? layer.offset.x : 0;
9540
9677
  const oy = layer.type === "pixel" ? layer.offset.y : 0;
@@ -9569,7 +9706,7 @@ var ImageEditorController = (_class12 = class {
9569
9706
  this.state.layers = _chunkUOGKSVRQcjs.mapLayer.call(void 0, this.state.layers, target.id, (l) => {
9570
9707
  const next = { ...l };
9571
9708
  if (_chunkH65IBXFIcjs.isDefaultDepthMask.call(void 0, merged)) {
9572
- if (_optionalChain([next, 'access', _401 => _401.mask, 'optionalAccess', _402 => _402.source])) delete next.mask;
9709
+ if (_optionalChain([next, 'access', _402 => _402.mask, 'optionalAccess', _403 => _403.source])) delete next.mask;
9573
9710
  } else next.mask = _chunkH65IBXFIcjs.depthRasterMask.call(void 0, merged);
9574
9711
  return next;
9575
9712
  });
@@ -9579,7 +9716,7 @@ var ImageEditorController = (_class12 = class {
9579
9716
  resetDepthMask() {
9580
9717
  this.recordHistory();
9581
9718
  const target = this.developLayer();
9582
- if (_optionalChain([target, 'optionalAccess', _403 => _403.mask, 'optionalAccess', _404 => _404.source])) {
9719
+ if (_optionalChain([target, 'optionalAccess', _404 => _404.mask, 'optionalAccess', _405 => _405.source])) {
9583
9720
  this.state.layers = _chunkUOGKSVRQcjs.mapLayer.call(void 0, this.state.layers, target.id, (l) => {
9584
9721
  const next = { ...l };
9585
9722
  delete next.mask;
@@ -9591,7 +9728,7 @@ var ImageEditorController = (_class12 = class {
9591
9728
  // --- Annotations & Layers ---
9592
9729
  /** The layer showing annotation `id`: an annotation layer, or a shape layer migrated from it. */
9593
9730
  annotationLayer(id) {
9594
- return _chunkUOGKSVRQcjs.flattenLayers.call(void 0, this.state.layers).find((l) => (l.type === "annotation" || l.type === "shape" || l.type === "type") && _optionalChain([_chunkH65IBXFIcjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _405 => _405.id]) === id);
9731
+ return _chunkUOGKSVRQcjs.flattenLayers.call(void 0, this.state.layers).find((l) => (l.type === "annotation" || l.type === "shape" || l.type === "type") && _optionalChain([_chunkH65IBXFIcjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _406 => _406.id]) === id);
9595
9732
  }
9596
9733
  /** What migrating an annotation needs: the canvas size, patterns and the text shaper. */
9597
9734
  annotationEnv() {
@@ -9609,7 +9746,7 @@ var ImageEditorController = (_class12 = class {
9609
9746
  const fullAnnotation = { ...annotation, id };
9610
9747
  const layer = _chunkH65IBXFIcjs.annotationLayerFor.call(void 0, fullAnnotation, this.annotationEnv());
9611
9748
  const loc = placement.aboveId ? _chunkUOGKSVRQcjs.findLayer.call(void 0, this.state.layers, placement.aboveId) : null;
9612
- this.state.layers = loc ? _chunkUOGKSVRQcjs.insertLayer.call(void 0, this.state.layers, layer, _nullishCoalesce(_optionalChain([loc, 'access', _406 => _406.parent, 'optionalAccess', _407 => _407.id]), () => ( null)), loc.index + 1) : _chunkUOGKSVRQcjs.insertLayer.call(void 0, this.state.layers, layer, null);
9749
+ this.state.layers = loc ? _chunkUOGKSVRQcjs.insertLayer.call(void 0, this.state.layers, layer, _nullishCoalesce(_optionalChain([loc, 'access', _407 => _407.parent, 'optionalAccess', _408 => _408.id]), () => ( null)), loc.index + 1) : _chunkUOGKSVRQcjs.insertLayer.call(void 0, this.state.layers, layer, null);
9613
9750
  this.state.selectedAnnotationId = id;
9614
9751
  this.notify();
9615
9752
  return id;
@@ -9732,11 +9869,11 @@ var ImageEditorController = (_class12 = class {
9732
9869
  await this.renderer.renderToCanvas(targetCanvas, source, this.state, {
9733
9870
  ...options,
9734
9871
  // The clone source follows the brush cursor (both editors pass it).
9735
- cloneSourceMarker: _optionalChain([options, 'optionalAccess', _408 => _408.cloneSourceMarker]) !== void 0 ? options.cloneSourceMarker : _optionalChain([options, 'optionalAccess', _409 => _409.brushCursor]) ? this.cloneSourceMarker(options.brushCursor) : null,
9872
+ cloneSourceMarker: _optionalChain([options, 'optionalAccess', _409 => _409.cloneSourceMarker]) !== void 0 ? options.cloneSourceMarker : _optionalChain([options, 'optionalAccess', _410 => _410.brushCursor]) ? this.cloneSourceMarker(options.brushCursor) : null,
9736
9873
  dirty: dirty === "all" ? void 0 : dirty,
9737
9874
  checkpointLayerId: this.state.activeLayerId
9738
9875
  });
9739
- } catch (e30) {
9876
+ } catch (e31) {
9740
9877
  }
9741
9878
  }
9742
9879
  async renderExport(options) {
@@ -9745,7 +9882,7 @@ var ImageEditorController = (_class12 = class {
9745
9882
  return this.renderer.createCanvas(1, 1);
9746
9883
  }
9747
9884
  this.syncViews();
9748
- if (_optionalChain([options, 'optionalAccess', _410 => _410.layerIds])) {
9885
+ if (_optionalChain([options, 'optionalAccess', _411 => _411.layerIds])) {
9749
9886
  const keep = new Set(options.layerIds);
9750
9887
  const layers = _chunkUOGKSVRQcjs.flattenLayers.call(void 0, this.state.layers).filter((l) => keep.has(l.id));
9751
9888
  return this.renderer.renderExport(source, { ...this.state, layers }, options);
@@ -9791,7 +9928,7 @@ var ImageEditorController = (_class12 = class {
9791
9928
  try {
9792
9929
  if (mime === "image/png") return _chunkBROJYMWUcjs.writePngIcc.call(void 0, bytes, icc, this.getColorProfile().name);
9793
9930
  if (mime === "image/jpeg") return _chunkBROJYMWUcjs.writeJpegIcc.call(void 0, bytes, icc);
9794
- } catch (e31) {
9931
+ } catch (e32) {
9795
9932
  }
9796
9933
  return bytes;
9797
9934
  }
@@ -9899,7 +10036,7 @@ var ImageEditorController = (_class12 = class {
9899
10036
  let px2 = await this.decodeImage(newDataUrl);
9900
10037
  if (px2.width !== width || px2.height !== height) px2 = resizePixels(px2, width, height);
9901
10038
  const data = new Uint8ClampedArray(px2.data);
9902
- const sel = _optionalChain([this, 'access', _411 => _411.state, 'access', _412 => _412.selection, 'optionalAccess', _413 => _413.bounds]) ? this.state.selection : null;
10039
+ const sel = _optionalChain([this, 'access', _412 => _412.state, 'access', _413 => _413.selection, 'optionalAccess', _414 => _414.bounds]) ? this.state.selection : null;
9903
10040
  if (sel) for (let p = 0, i = 3; p < width * height; p++, i += 4) data[i] = Math.round(data[i] * sel.data[p] / 255);
9904
10041
  return this.addPixelLayer({ name: "Inpaint", pixels: { width, height, data } });
9905
10042
  }
@@ -9946,7 +10083,7 @@ var ImageEditorController = (_class12 = class {
9946
10083
  }
9947
10084
  /** Font families the shaper offers (generic families at least). */
9948
10085
  listFonts() {
9949
- return _nullishCoalesce(_optionalChain([this, 'access', _414 => _414.getTextShaper, 'call', _415 => _415(), 'optionalAccess', _416 => _416.families, 'optionalCall', _417 => _417()]), () => ( ["sans-serif", "serif", "monospace"]));
10086
+ return _nullishCoalesce(_optionalChain([this, 'access', _415 => _415.getTextShaper, 'call', _416 => _416(), 'optionalAccess', _417 => _417.families, 'optionalCall', _418 => _418()]), () => ( ["sans-serif", "serif", "monospace"]));
9950
10087
  }
9951
10088
  typeInfo(id) {
9952
10089
  const layer = _chunkH65IBXFIcjs.requireTypeLayer.call(void 0, this.state.layers, id);
@@ -10020,22 +10157,22 @@ var ImageEditorController = (_class12 = class {
10020
10157
  const layer = this.layoutTypeLayer({ ...init, text, orientation: vertical ? "vertical" : "horizontal" });
10021
10158
  const { width, height } = this.naturalSize;
10022
10159
  const b = _chunk474IQG74cjs.contentBounds.call(void 0, layer.surface);
10023
- const x0 = Math.max(0, _nullishCoalesce(_optionalChain([b, 'optionalAccess', _418 => _418.x]), () => ( 0)));
10024
- const y0 = Math.max(0, _nullishCoalesce(_optionalChain([b, 'optionalAccess', _419 => _419.y]), () => ( 0)));
10160
+ const x0 = Math.max(0, _nullishCoalesce(_optionalChain([b, 'optionalAccess', _419 => _419.x]), () => ( 0)));
10161
+ const y0 = Math.max(0, _nullishCoalesce(_optionalChain([b, 'optionalAccess', _420 => _420.y]), () => ( 0)));
10025
10162
  const x1 = Math.min(width, b ? b.x + b.width : 0);
10026
10163
  const y1 = Math.min(height, b ? b.y + b.height : 0);
10027
10164
  let mask;
10028
10165
  if (!b || x1 <= x0 || y1 <= y0) mask = _chunkQYLWG22Ncjs.createSelectionMask.call(void 0, width, height);
10029
10166
  else {
10030
- const rect = { x: x0, y: y0, width: x1 - x0, height: y1 - y0 };
10031
- const rgba = _chunk474IQG74cjs.readRegion.call(void 0, layer.surface, rect);
10032
- const bytes = new Uint8Array(rect.width * rect.height);
10167
+ const rect2 = { x: x0, y: y0, width: x1 - x0, height: y1 - y0 };
10168
+ const rgba = _chunk474IQG74cjs.readRegion.call(void 0, layer.surface, rect2);
10169
+ const bytes = new Uint8Array(rect2.width * rect2.height);
10033
10170
  const hard = init.antiAlias === false;
10034
10171
  for (let i = 0; i < bytes.length; i++) {
10035
10172
  const a = rgba[i * 4 + 3];
10036
10173
  bytes[i] = hard ? a >= 128 ? 255 : 0 : a;
10037
10174
  }
10038
- mask = _chunkQYLWG22Ncjs.selectionFromRegion.call(void 0, width, height, rect, bytes);
10175
+ mask = _chunkQYLWG22Ncjs.selectionFromRegion.call(void 0, width, height, rect2, bytes);
10039
10176
  }
10040
10177
  if ((_nullishCoalesce(init.feather, () => ( 0))) > 0 && mask.bounds) mask = _chunkQYLWG22Ncjs.modifySelection.call(void 0, mask, "feather", init.feather);
10041
10178
  return this.setSelection(mask.bounds ? mask : null, _nullishCoalesce(init.mode, () => ( "replace")));
@@ -10198,7 +10335,7 @@ var ImageEditorController = (_class12 = class {
10198
10335
  if (colors.size > 1) warnings.push("The text had several colours; the shape takes the first one.");
10199
10336
  const missing = _chunkQAUIZPYIcjs.layoutText.call(void 0, layer, shaper).missingFonts;
10200
10337
  if (missing.length) warnings.push(`Missing fonts were drawn with a fallback: ${missing.join(", ")}.`);
10201
- const first = _nullishCoalesce(_optionalChain([layer, 'access', _420 => _420.runs, 'access', _421 => _421.find, 'call', _422 => _422((r) => r.length > 0), 'optionalAccess', _423 => _423.style]), () => ( _chunkQAUIZPYIcjs.DEFAULT_TEXT_STYLE));
10338
+ const first = _nullishCoalesce(_optionalChain([layer, 'access', _421 => _421.runs, 'access', _422 => _422.find, 'call', _423 => _423((r) => r.length > 0), 'optionalAccess', _424 => _424.style]), () => ( _chunkQAUIZPYIcjs.DEFAULT_TEXT_STYLE));
10202
10339
  const fill = first.opacity !== void 0 && first.opacity !== 1 ? { type: "color", color: first.color, opacity: first.opacity } : { type: "color", color: first.color };
10203
10340
  const shape = _chunkH65IBXFIcjs.createShapeLayer.call(void 0, { components: [{ op: "combine", subpaths }], fill, stroke: null, name: layer.name }, this.shapeEnv(), layer.id);
10204
10341
  const keep = { visible: layer.visible, opacity: layer.opacity, blend: layer.blend };
@@ -10231,7 +10368,7 @@ var ImageEditorController = (_class12 = class {
10231
10368
  // --- Shape layers ---
10232
10369
  /** What shape rendering needs: the canvas size and the document's patterns. */
10233
10370
  shapeEnv() {
10234
- return { ...this.naturalSize, pattern: (id) => _nullishCoalesce(_optionalChain([this, 'access', _424 => _424.state, 'access', _425 => _425.patterns, 'optionalAccess', _426 => _426.find, 'call', _427 => _427((p) => p.id === id)]), () => ( null)) };
10371
+ return { ...this.naturalSize, pattern: (id) => _nullishCoalesce(_optionalChain([this, 'access', _425 => _425.state, 'access', _426 => _426.patterns, 'optionalAccess', _427 => _427.find, 'call', _428 => _428((p) => p.id === id)]), () => ( null)) };
10235
10372
  }
10236
10373
  /** One component from tool or UI input (validated). */
10237
10374
  componentFrom(spec, path) {
@@ -10274,9 +10411,9 @@ var ImageEditorController = (_class12 = class {
10274
10411
  * open path) and stroked with `stroke`. Goes above the active layer unless placed. Returns its id.
10275
10412
  */
10276
10413
  addShapeLayer(init) {
10277
- const specs = _optionalChain([init, 'access', _428 => _428.components, 'optionalAccess', _429 => _429.length]) ? init.components : [init];
10278
- if (_optionalChain([init, 'access', _430 => _430.components, 'optionalAccess', _431 => _431.length]) && (init.shape !== void 0 || init.subpaths !== void 0)) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("Give components, or shape / subpaths, not both.");
10279
- const components = specs.map((c, i) => this.componentFrom(c, _optionalChain([init, 'access', _432 => _432.components, 'optionalAccess', _433 => _433.length]) ? `components[${i}].` : ""));
10414
+ const specs = _optionalChain([init, 'access', _429 => _429.components, 'optionalAccess', _430 => _430.length]) ? init.components : [init];
10415
+ if (_optionalChain([init, 'access', _431 => _431.components, 'optionalAccess', _432 => _432.length]) && (init.shape !== void 0 || init.subpaths !== void 0)) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("Give components, or shape / subpaths, not both.");
10416
+ const components = specs.map((c, i) => this.componentFrom(c, _optionalChain([init, 'access', _433 => _433.components, 'optionalAccess', _434 => _434.length]) ? `components[${i}].` : ""));
10280
10417
  const stroke = init.stroke ? _chunkH65IBXFIcjs.normalizeShapeStroke.call(void 0, init.stroke, "stroke") : null;
10281
10418
  const openOnly = components.every((c) => !c.live && c.subpaths.every((sp) => !sp.closed));
10282
10419
  const fill = init.fill === void 0 ? stroke && openOnly ? null : _chunkH65IBXFIcjs.normalizeShapePaint.call(void 0, this.state.paint.foreground, "fill") : init.fill === null ? null : _chunkH65IBXFIcjs.normalizeShapePaint.call(void 0, init.fill, "fill");
@@ -10387,15 +10524,15 @@ var ImageEditorController = (_class12 = class {
10387
10524
  if (layer.locks) next.locks = layer.locks;
10388
10525
  if (this.state.selectedAnnotationId === layer.annotation.id) this.state.selectedAnnotationId = null;
10389
10526
  } else if (layer.type === "pixel") {
10390
- if (!_optionalChain([layer, 'access', _434 => _434.filters, 'optionalAccess', _435 => _435.length])) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)(`Layer "${layer.name || id}" is already pixels with no filters to bake.`);
10527
+ if (!_optionalChain([layer, 'access', _435 => _435.filters, 'optionalAccess', _436 => _436.length])) throw new (0, _chunkH65IBXFIcjs.LayerOperationError)(`Layer "${layer.name || id}" is already pixels with no filters to bake.`);
10391
10528
  _chunkH65IBXFIcjs.requireUnlocked.call(void 0, layer, "pixels", "rasterize it");
10392
10529
  const spatial = layer.filters.some((f) => f.enabled && f.kind === "blur");
10393
10530
  const content = { ...layer, visible: true, opacity: 1, blend: "normal" };
10394
10531
  delete content.mask;
10395
10532
  delete content.clipped;
10396
10533
  delete content.fillOpacity;
10397
- const rect = spatial ? canvas : _nullishCoalesce(this.getLayerBounds(id), () => ( canvas));
10398
- const surface = await this.compositeToSurface([content], rect);
10534
+ const rect2 = spatial ? canvas : _nullishCoalesce(this.getLayerBounds(id), () => ( canvas));
10535
+ const surface = await this.compositeToSurface([content], rect2);
10399
10536
  next = { ...layer, surface, offset: { x: 0, y: 0 } };
10400
10537
  delete next.filters;
10401
10538
  delete next.source;
@@ -10406,7 +10543,7 @@ var ImageEditorController = (_class12 = class {
10406
10543
  return this.rasterizeSmartObject(id);
10407
10544
  } else if (layer.type === "shape" || layer.type === "type") {
10408
10545
  next = layer.type === "shape" ? _chunkH65IBXFIcjs.shapeAsPixelLayer.call(void 0, layer) : _chunkH65IBXFIcjs.typeAsPixelLayer.call(void 0, layer);
10409
- if (this.state.selectedAnnotationId && this.state.selectedAnnotationId === _optionalChain([layer, 'access', _436 => _436.annotation, 'optionalAccess', _437 => _437.id])) this.state.selectedAnnotationId = null;
10546
+ if (this.state.selectedAnnotationId && this.state.selectedAnnotationId === _optionalChain([layer, 'access', _437 => _437.annotation, 'optionalAccess', _438 => _438.id])) this.state.selectedAnnotationId = null;
10410
10547
  } else {
10411
10548
  throw new (0, _chunkH65IBXFIcjs.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.`);
10412
10549
  }
@@ -10420,8 +10557,8 @@ var ImageEditorController = (_class12 = class {
10420
10557
  const doc = this.state.colorProfile;
10421
10558
  const p = resolveProfile(doc);
10422
10559
  const m = this.state.colorMode;
10423
- const out = { name: _nullishCoalesce(_optionalChain([doc, 'optionalAccess', _438 => _438.name]), () => ( p.description)), builtin: doc ? _nullishCoalesce(doc.builtin, () => ( null)) : "srgb", colorSpace: p.colorSpace, srgb: isSrgb(doc), mode: _nullishCoalesce(_optionalChain([m, 'optionalAccess', _439 => _439.mode]), () => ( "rgb")) };
10424
- if (_optionalChain([m, 'optionalAccess', _440 => _440.mode]) === "cmyk") out.cmykProfile = { name: m.profile.name, builtin: _nullishCoalesce(m.profile.builtin, () => ( null)), intent: m.intent };
10560
+ const out = { name: _nullishCoalesce(_optionalChain([doc, 'optionalAccess', _439 => _439.name]), () => ( p.description)), builtin: doc ? _nullishCoalesce(doc.builtin, () => ( null)) : "srgb", colorSpace: p.colorSpace, srgb: isSrgb(doc), mode: _nullishCoalesce(_optionalChain([m, 'optionalAccess', _440 => _440.mode]), () => ( "rgb")) };
10561
+ if (_optionalChain([m, 'optionalAccess', _441 => _441.mode]) === "cmyk") out.cmykProfile = { name: m.profile.name, builtin: _nullishCoalesce(m.profile.builtin, () => ( null)), intent: m.intent };
10425
10562
  return out;
10426
10563
  }
10427
10564
  /**
@@ -10511,7 +10648,7 @@ var ImageEditorController = (_class12 = class {
10511
10648
  const textEnv = this.textEnv();
10512
10649
  const walk = (layers) => layers.map((l) => {
10513
10650
  let next2 = l;
10514
- if (_optionalChain([l, 'access', _441 => _441.effects, 'optionalAccess', _442 => _442.items, 'access', _443 => _443.length])) next2 = { ...next2, effects: convertColorFields(l.effects, hex) };
10651
+ if (_optionalChain([l, 'access', _442 => _442.effects, 'optionalAccess', _443 => _443.items, 'access', _444 => _444.length])) next2 = { ...next2, effects: convertColorFields(l.effects, hex) };
10515
10652
  if (l.type === "group") {
10516
10653
  if (next2 !== l) converted.push(l.id);
10517
10654
  return { ...next2, children: walk(l.children) };
@@ -10525,7 +10662,7 @@ var ImageEditorController = (_class12 = class {
10525
10662
  const recoloured = { ...next2, runs: convertColorFields(l.runs, hex) };
10526
10663
  try {
10527
10664
  next2 = _chunkH65IBXFIcjs.rerenderText.call(void 0, recoloured, textEnv);
10528
- } catch (e32) {
10665
+ } catch (e33) {
10529
10666
  next2 = { ...recoloured, surface: convertSurfaceColors(l.surface, t) };
10530
10667
  }
10531
10668
  } else if (l.type === "annotation") next2 = { ...next2, annotation: convertColorFields(l.annotation, hex) };
@@ -10699,8 +10836,8 @@ var ImageEditorController = (_class12 = class {
10699
10836
  else delete s.bitDepth;
10700
10837
  delete s.colorProfile;
10701
10838
  delete s.colorMode;
10702
- if (_optionalChain([result, 'access', _444 => _444.sourceMode, 'optionalAccess', _445 => _445.mode]) === "cmyk") s.colorMode = { mode: "cmyk", profile: result.sourceMode.profile, intent: "relative" };
10703
- else if (_optionalChain([result, 'access', _446 => _446.sourceMode, 'optionalAccess', _447 => _447.mode]) === "lab") s.colorMode = { mode: "lab" };
10839
+ if (_optionalChain([result, 'access', _445 => _445.sourceMode, 'optionalAccess', _446 => _446.mode]) === "cmyk") s.colorMode = { mode: "cmyk", profile: result.sourceMode.profile, intent: "relative" };
10840
+ else if (_optionalChain([result, 'access', _447 => _447.sourceMode, 'optionalAccess', _448 => _448.mode]) === "lab") s.colorMode = { mode: "lab" };
10704
10841
  else if (result.iccProfile) {
10705
10842
  try {
10706
10843
  const doc = documentProfile(result.iccProfile);
@@ -10764,7 +10901,7 @@ var ImageEditorController = (_class12 = class {
10764
10901
  const compositor = new (0, _chunkH65IBXFIcjs.LayerCompositor)();
10765
10902
  const bakeMask = (layer) => {
10766
10903
  const mask = layer.mask;
10767
- if (!_optionalChain([mask, 'optionalAccess', _448 => _448.source])) return mask;
10904
+ if (!_optionalChain([mask, 'optionalAccess', _449 => _449.source])) return mask;
10768
10905
  add2("Parametric (depth) masks were baked into pixel masks", layer.name);
10769
10906
  const plain3 = { ...layer, mask: { ...mask, density: 1, feather: 0, enabled: true } };
10770
10907
  const ox = layer.type === "pixel" ? layer.offset.x : 0;
@@ -10781,7 +10918,7 @@ var ImageEditorController = (_class12 = class {
10781
10918
  };
10782
10919
  const prepare = async (layer) => {
10783
10920
  const p = await prepareLayer(layer);
10784
- if (_optionalChain([p, 'optionalAccess', _449 => _449.blend]) === "pigment") add2("The Pigment blend mode has no PSD equivalent and was written as Normal", layer.name);
10921
+ if (_optionalChain([p, 'optionalAccess', _450 => _450.blend]) === "pigment") add2("The Pigment blend mode has no PSD equivalent and was written as Normal", layer.name);
10785
10922
  return p;
10786
10923
  };
10787
10924
  const prepareLayer = async (layer) => {
@@ -10824,7 +10961,7 @@ var ImageEditorController = (_class12 = class {
10824
10961
  return out2;
10825
10962
  }
10826
10963
  if (layer.type === "shape" || layer.type === "type") {
10827
- if (layer.type === "type" && _optionalChain([layer, 'access', _450 => _450.missingFonts, 'optionalAccess', _451 => _451.length])) add2(`Type layers drawn with a fallback for missing fonts (${layer.missingFonts.join(", ")}) keep the font names, so Photoshop may draw them differently`, layer.name);
10964
+ if (layer.type === "type" && _optionalChain([layer, 'access', _451 => _451.missingFonts, 'optionalAccess', _452 => _452.length])) add2(`Type layers drawn with a fallback for missing fonts (${layer.missingFonts.join(", ")}) keep the font names, so Photoshop may draw them differently`, layer.name);
10828
10965
  const out2 = { ...layer };
10829
10966
  const mask2 = bakeMask(layer);
10830
10967
  if (mask2) out2.mask = mask2;
@@ -10843,7 +10980,7 @@ var ImageEditorController = (_class12 = class {
10843
10980
  out.surface = this.surfaceOf(layer);
10844
10981
  delete out.source;
10845
10982
  }
10846
- const active = _nullishCoalesce(_optionalChain([layer, 'access', _452 => _452.filters, 'optionalAccess', _453 => _453.filter, 'call', _454 => _454(_chunkH65IBXFIcjs.isActiveFilter)]), () => ( []));
10983
+ const active = _nullishCoalesce(_optionalChain([layer, 'access', _453 => _453.filters, 'optionalAccess', _454 => _454.filter, 'call', _455 => _455(_chunkH65IBXFIcjs.isActiveFilter)]), () => ( []));
10847
10984
  if (active.length) {
10848
10985
  add2("Layer filters (develop, blur) were baked into the pixels", layer.name);
10849
10986
  const content = { ...out, visible: true, opacity: 1, blend: "normal" };
@@ -10854,7 +10991,7 @@ var ImageEditorController = (_class12 = class {
10854
10991
  const data = compositor.composite([content], canvas, sources);
10855
10992
  out = { ...out, surface: _chunk474IQG74cjs.surfaceFromPixels.call(void 0, { width, height, data }, 4, -layer.offset.x, -layer.offset.y) };
10856
10993
  }
10857
- if (_optionalChain([layer, 'access', _455 => _455.filters, 'optionalAccess', _456 => _456.some, 'call', _457 => _457((f) => !f.enabled)])) add2("Disabled layer filters were left out", layer.name);
10994
+ if (_optionalChain([layer, 'access', _456 => _456.filters, 'optionalAccess', _457 => _457.some, 'call', _458 => _458((f) => !f.enabled)])) add2("Disabled layer filters were left out", layer.name);
10858
10995
  delete out.filters;
10859
10996
  const mask = bakeMask(layer);
10860
10997
  if (mask) out.mask = mask;
@@ -10918,7 +11055,7 @@ var ImageEditorController = (_class12 = class {
10918
11055
  );
10919
11056
  }
10920
11057
  layers = resizeLegacyMasks(layers, prev, next.dimensions);
10921
- const env = { ...next.dimensions, pattern: (pid) => _nullishCoalesce(_optionalChain([this, 'access', _458 => _458.state, 'access', _459 => _459.patterns, 'optionalAccess', _460 => _460.find, 'call', _461 => _461((p) => p.id === pid)]), () => ( null)) };
11058
+ const env = { ...next.dimensions, pattern: (pid) => _nullishCoalesce(_optionalChain([this, 'access', _459 => _459.state, 'access', _460 => _460.patterns, 'optionalAccess', _461 => _461.find, 'call', _462 => _462((p) => p.id === pid)]), () => ( null)) };
10922
11059
  for (const l of _chunkUOGKSVRQcjs.flattenLayers.call(void 0, layers)) {
10923
11060
  if (l.type === "annotation") {
10924
11061
  layers = _chunkUOGKSVRQcjs.mapLayer.call(void 0, layers, l.id, () => ({ ...l, annotation: scaleAnnotation(l.annotation, sx, sy) }));
@@ -10927,7 +11064,7 @@ var ImageEditorController = (_class12 = class {
10927
11064
  const scaled = a ? scaleAnnotation(a, sx, sy) : null;
10928
11065
  const fromAnnotation = scaled ? _chunkH65IBXFIcjs.shapeFromAnnotation.call(void 0, scaled) : null;
10929
11066
  const m = [sx, 0, 0, sy, 0, 0];
10930
- const components = _nullishCoalesce(_optionalChain([fromAnnotation, 'optionalAccess', _462 => _462.components]), () => ( _chunkH65IBXFIcjs.transformShapeComponents.call(void 0, l.components, (p) => ({ x: p.x * sx, y: p.y * sy }), m)));
11067
+ const components = _nullishCoalesce(_optionalChain([fromAnnotation, 'optionalAccess', _463 => _463.components]), () => ( _chunkH65IBXFIcjs.transformShapeComponents.call(void 0, l.components, (p) => ({ x: p.x * sx, y: p.y * sy }), m)));
10931
11068
  const moved = { ...l, components, ...fromAnnotation ? { fill: fromAnnotation.fill, stroke: fromAnnotation.stroke } : {} };
10932
11069
  if (scaled && fromAnnotation) moved.annotation = scaled;
10933
11070
  else delete moved.annotation;
@@ -10945,7 +11082,7 @@ var ImageEditorController = (_class12 = class {
10945
11082
  this.notify();
10946
11083
  }
10947
11084
  toJSON(options) {
10948
- const root = _optionalChain([this, 'access', _463 => _463.contentsStack, 'access', _464 => _464[0], 'optionalAccess', _465 => _465.saved]);
11085
+ const root = _optionalChain([this, 'access', _464 => _464.contentsStack, 'access', _465 => _465[0], 'optionalAccess', _466 => _466.saved]);
10949
11086
  const current = this.state;
10950
11087
  const element = this.imageElement;
10951
11088
  if (root) {
@@ -10956,9 +11093,9 @@ var ImageEditorController = (_class12 = class {
10956
11093
  let out;
10957
11094
  try {
10958
11095
  out = this.serializeState();
10959
- if (_optionalChain([this, 'access', _466 => _466.state, 'access', _467 => _467.selection, 'optionalAccess', _468 => _468.bounds])) out.selection = _chunkQYLWG22Ncjs.serializeSelection.call(void 0, this.state.selection);
10960
- if (_optionalChain([this, 'access', _469 => _469.state, 'access', _470 => _470.channels, 'optionalAccess', _471 => _471.length])) out.channels = serializeChannels(this.state.channels);
10961
- if (_optionalChain([this, 'access', _472 => _472.state, 'access', _473 => _473.paths, 'optionalAccess', _474 => _474.length])) out.paths = serializePaths(this.state.paths);
11096
+ if (_optionalChain([this, 'access', _467 => _467.state, 'access', _468 => _468.selection, 'optionalAccess', _469 => _469.bounds])) out.selection = _chunkQYLWG22Ncjs.serializeSelection.call(void 0, this.state.selection);
11097
+ if (_optionalChain([this, 'access', _470 => _470.state, 'access', _471 => _471.channels, 'optionalAccess', _472 => _472.length])) out.channels = serializeChannels(this.state.channels);
11098
+ if (_optionalChain([this, 'access', _473 => _473.state, 'access', _474 => _474.paths, 'optionalAccess', _475 => _475.length])) out.paths = serializePaths(this.state.paths);
10962
11099
  } finally {
10963
11100
  if (root) {
10964
11101
  this.state = current;
@@ -10993,7 +11130,7 @@ var ImageEditorController = (_class12 = class {
10993
11130
  if (data.selection) {
10994
11131
  try {
10995
11132
  selection = normalizeSelection(_chunkQYLWG22Ncjs.deserializeSelection.call(void 0, data.selection));
10996
- } catch (e33) {
11133
+ } catch (e34) {
10997
11134
  selection = null;
10998
11135
  }
10999
11136
  }
@@ -11076,10 +11213,10 @@ var ImageEditorController = (_class12 = class {
11076
11213
  serializeState() {
11077
11214
  const { width, height } = this.naturalSize;
11078
11215
  const view = _chunkH65IBXFIcjs.legacyView.call(void 0, this.stack(), width, height, null);
11079
- if (view.exact && !this.state.globalLight && !_optionalChain([this, 'access', _475 => _475.state, 'access', _476 => _476.patterns, 'optionalAccess', _477 => _477.length]) && this.bitDepth === 8 && !this.state.colorProfile && !this.state.colorMode) {
11216
+ if (view.exact && !this.state.globalLight && !_optionalChain([this, 'access', _476 => _476.state, 'access', _477 => _477.patterns, 'optionalAccess', _478 => _478.length]) && this.bitDepth === 8 && !this.state.colorProfile && !this.state.colorMode) {
11080
11217
  return {
11081
11218
  // States without adjustment layers keep schema 1, so they round-trip unchanged.
11082
- version: _optionalChain([view, 'access', _478 => _478.adjustments, 'access', _479 => _479.layers, 'optionalAccess', _480 => _480.length]) ? 2 : 1,
11219
+ version: _optionalChain([view, 'access', _479 => _479.adjustments, 'access', _480 => _480.layers, 'optionalAccess', _481 => _481.length]) ? 2 : 1,
11083
11220
  crop: this.state.crop ? { ...this.state.crop } : null,
11084
11221
  transform: { ...this.state.transform },
11085
11222
  adjustments: serializeAdjustments(view.adjustments),
@@ -11104,7 +11241,7 @@ var ImageEditorController = (_class12 = class {
11104
11241
  };
11105
11242
  if (this.state.legacyOutputBlur !== void 0) out.legacyOutputBlur = this.state.legacyOutputBlur;
11106
11243
  if (this.state.globalLight) out.globalLight = { ...this.state.globalLight };
11107
- if (_optionalChain([this, 'access', _481 => _481.state, 'access', _482 => _482.patterns, 'optionalAccess', _483 => _483.length])) out.patterns = _chunkH65IBXFIcjs.serializePatterns.call(void 0, this.state.patterns);
11244
+ if (_optionalChain([this, 'access', _482 => _482.state, 'access', _483 => _483.patterns, 'optionalAccess', _484 => _484.length])) out.patterns = _chunkH65IBXFIcjs.serializePatterns.call(void 0, this.state.patterns);
11108
11245
  if (smartContents) out.smartContents = smartContents;
11109
11246
  if (this.state.bitDepth === 16 || this.state.bitDepth === 32) out.bitDepth = this.state.bitDepth;
11110
11247
  if (this.state.colorProfile) out.colorProfile = serializeColorProfile(this.state.colorProfile);
@@ -11114,7 +11251,7 @@ var ImageEditorController = (_class12 = class {
11114
11251
  }, _class12);
11115
11252
  function serializeAdjustments(adjustments) {
11116
11253
  const out = { ...adjustments };
11117
- if (_optionalChain([out, 'access', _484 => _484.layers, 'optionalAccess', _485 => _485.length])) out.layers = JSON.parse(JSON.stringify(out.layers));
11254
+ if (_optionalChain([out, 'access', _485 => _485.layers, 'optionalAccess', _486 => _486.length])) out.layers = JSON.parse(JSON.stringify(out.layers));
11118
11255
  else delete out.layers;
11119
11256
  if (_chunkH65IBXFIcjs.normalizeProcessVersion.call(void 0, out.process) === _chunkH65IBXFIcjs.LEGACY_PROCESS_VERSION) {
11120
11257
  delete out.process;
@@ -11150,11 +11287,11 @@ function withDevelop(layer, partial) {
11150
11287
  return { ...layer, filters };
11151
11288
  }
11152
11289
  function withBlur(layer, radius) {
11153
- const existing = _optionalChain([layer, 'access', _486 => _486.filters, 'optionalAccess', _487 => _487.find, 'call', _488 => _488((f) => f.kind === "blur")]);
11290
+ const existing = _optionalChain([layer, 'access', _487 => _487.filters, 'optionalAccess', _488 => _488.find, 'call', _489 => _489((f) => f.kind === "blur")]);
11154
11291
  const filters = (_nullishCoalesce(layer.filters, () => ( []))).filter((f) => f.kind !== "blur");
11155
11292
  if (radius > 0) {
11156
11293
  filters.push({
11157
- id: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _489 => _489.id]), () => ( (layer.source === "document" ? _chunkH65IBXFIcjs.BLUR_FILTER_ID : _chunkH65IBXFIcjs.newLayerId.call(void 0, "flt")))),
11294
+ id: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _490 => _490.id]), () => ( (layer.source === "document" ? _chunkH65IBXFIcjs.BLUR_FILTER_ID : _chunkH65IBXFIcjs.newLayerId.call(void 0, "flt")))),
11158
11295
  kind: "blur",
11159
11296
  enabled: true,
11160
11297
  radius
@@ -11250,7 +11387,7 @@ function collectStateTiles(layers, into) {
11250
11387
  if (l.type === "shape" || l.type === "type") _chunk474IQG74cjs.collectTiles.call(void 0, l.surface, into);
11251
11388
  if (l.type === "smart") {
11252
11389
  _chunk474IQG74cjs.collectTiles.call(void 0, l.surface, into);
11253
- if (_optionalChain([l, 'access', _490 => _490.smartFilters, 'optionalAccess', _491 => _491.mask])) _chunk474IQG74cjs.collectTiles.call(void 0, l.smartFilters.mask.surface, into);
11390
+ if (_optionalChain([l, 'access', _491 => _491.smartFilters, 'optionalAccess', _492 => _492.mask])) _chunk474IQG74cjs.collectTiles.call(void 0, l.smartFilters.mask.surface, into);
11254
11391
  if (l.contents.raster) _chunk474IQG74cjs.collectTiles.call(void 0, l.contents.raster, into);
11255
11392
  if (l.contents.document) collectStateTiles(l.contents.document.layers, into);
11256
11393
  }
@@ -11282,7 +11419,7 @@ function pixelsOnly(layers) {
11282
11419
  for (const l of layers) {
11283
11420
  if (l.type === "adjustment") continue;
11284
11421
  if (l.type === "group") out.push({ ...l, children: pixelsOnly(l.children) });
11285
- else if (l.type === "pixel" && _optionalChain([l, 'access', _492 => _492.filters, 'optionalAccess', _493 => _493.length])) {
11422
+ else if (l.type === "pixel" && _optionalChain([l, 'access', _493 => _493.filters, 'optionalAccess', _494 => _494.length])) {
11286
11423
  const p = { ...l };
11287
11424
  delete p.filters;
11288
11425
  out.push(p);
@@ -11348,7 +11485,7 @@ function toHex(c) {
11348
11485
  return "#" + [c[0], c[1], c[2]].map((v) => Math.round(v).toString(16).padStart(2, "0")).join("");
11349
11486
  }
11350
11487
  function normalizeSelection(mask) {
11351
- return _optionalChain([mask, 'optionalAccess', _494 => _494.bounds]) ? mask : null;
11488
+ return _optionalChain([mask, 'optionalAccess', _495 => _495.bounds]) ? mask : null;
11352
11489
  }
11353
11490
  function sameSelection(a, b) {
11354
11491
  if (a.width !== b.width || a.height !== b.height) return false;
@@ -11502,7 +11639,7 @@ function loadImageEditorDocument(input) {
11502
11639
  if (typeof input === "string") {
11503
11640
  try {
11504
11641
  parsed = JSON.parse(input);
11505
- } catch (e34) {
11642
+ } catch (e35) {
11506
11643
  parsed = input;
11507
11644
  }
11508
11645
  }
@@ -11558,7 +11695,7 @@ function loadImageEditorDocument(input) {
11558
11695
  }
11559
11696
  const state = { version: 1, ...result.value };
11560
11697
  if (isV2) {
11561
- if (_optionalChain([state, 'access', _495 => _495.adjustments, 'access', _496 => _496.layers, 'optionalAccess', _497 => _497.length])) state.version = 2;
11698
+ if (_optionalChain([state, 'access', _496 => _496.adjustments, 'access', _497 => _497.layers, 'optionalAccess', _498 => _498.length])) state.version = 2;
11562
11699
  result.report.version = 2;
11563
11700
  }
11564
11701
  if (state.selection === void 0) delete state.selection;
@@ -11766,7 +11903,7 @@ function findAdjustmentControl(id) {
11766
11903
  }
11767
11904
  function findLayerControl(kind, id) {
11768
11905
  if (id === "opacity") return ADJUSTMENT_LAYER_OPACITY_CONTROL;
11769
- return _optionalChain([ADJUSTMENT_LAYER_CONTROLS, 'access', _498 => _498[kind], 'optionalAccess', _499 => _499.find, 'call', _500 => _500((c) => c.id === id)]);
11906
+ return _optionalChain([ADJUSTMENT_LAYER_CONTROLS, 'access', _499 => _499[kind], 'optionalAccess', _500 => _500.find, 'call', _501 => _501((c) => c.id === id)]);
11770
11907
  }
11771
11908
  function clampControlValue(spec, v) {
11772
11909
  if (typeof v !== "number" || !Number.isFinite(v)) return spec.default;
@@ -12037,7 +12174,7 @@ function layersOf(args) {
12037
12174
  add2(args.layerId);
12038
12175
  add2(args.id);
12039
12176
  add2(args.target);
12040
- for (const key of ["ids", "layerIds"]) if (Array.isArray(args[key])) args[key].forEach(add2);
12177
+ for (const key2 of ["ids", "layerIds"]) if (Array.isArray(args[key2])) args[key2].forEach(add2);
12041
12178
  return out.slice(0, 6);
12042
12179
  }
12043
12180
  function planImageToolPlayback(tool, args) {
@@ -12050,9 +12187,9 @@ function planImageToolPlayback(tool, args) {
12050
12187
  else if (box) steps.push({ type: "move", to: box.from }, { type: "press" }, { type: "drag", to: box.to }, { type: "release" });
12051
12188
  else if (num(args.x) && num(args.y)) steps.push({ type: "move", to: { x: args.x, y: args.y } }, { type: "press" }, { type: "release" });
12052
12189
  else if (tool === "set_adjustments" && args.values && typeof args.values === "object") {
12053
- for (const key of Object.keys(args.values).slice(0, 4)) {
12054
- const m = /^layers\.([^.]+)\.(.+)$/.exec(key);
12055
- steps.push({ type: "target", ref: m ? { kind: "control", id: m[2] } : { kind: "control", id: key } });
12190
+ for (const key2 of Object.keys(args.values).slice(0, 4)) {
12191
+ const m = /^layers\.([^.]+)\.(.+)$/.exec(key2);
12192
+ steps.push({ type: "target", ref: m ? { kind: "control", id: m[2] } : { kind: "control", id: key2 } });
12056
12193
  }
12057
12194
  } else for (const id of layersOf(args)) steps.push({ type: "target", ref: { kind: IMAGE_PLAYBACK_KIND, id } });
12058
12195
  if (typeof args.text === "string" && args.text.trim()) {
@@ -12228,10 +12365,10 @@ function sampleOptions(args) {
12228
12365
  return { sampleMerged: args.sampleMerged === true, sample: _nullishCoalesce(args.sample, () => ( "composite")) };
12229
12366
  }
12230
12367
  function rectOf(args) {
12231
- const rect = { x: num2(args.x, NaN), y: num2(args.y, NaN), width: num2(args.width, NaN), height: num2(args.height, NaN) };
12232
- if (![rect.x, rect.y, rect.width, rect.height].every(Number.isFinite)) throw new Error("Pass numeric x, y, width and height in natural image pixels.");
12233
- if (rect.width <= 0 || rect.height <= 0) throw new Error("width and height must be greater than 0.");
12234
- return rect;
12368
+ const rect2 = { x: num2(args.x, NaN), y: num2(args.y, NaN), width: num2(args.width, NaN), height: num2(args.height, NaN) };
12369
+ if (![rect2.x, rect2.y, rect2.width, rect2.height].every(Number.isFinite)) throw new Error("Pass numeric x, y, width and height in natural image pixels.");
12370
+ if (rect2.width <= 0 || rect2.height <= 0) throw new Error("width and height must be greater than 0.");
12371
+ return rect2;
12235
12372
  }
12236
12373
  function summary(controller) {
12237
12374
  const sel = controller.getSelection();
@@ -12239,7 +12376,7 @@ function summary(controller) {
12239
12376
  const area = _chunkQYLWG22Ncjs.selectionArea.call(void 0, sel);
12240
12377
  return {
12241
12378
  empty: !sel,
12242
- bounds: _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _501 => _501.bounds]), () => ( null)),
12379
+ bounds: _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _502 => _502.bounds]), () => ( null)),
12243
12380
  /** Σ coverage in pixels. */
12244
12381
  area: Math.round(area),
12245
12382
  percent: Math.round(area / Math.max(1, width * height) * 1e4) / 100,
@@ -12306,16 +12443,16 @@ function createImageSelectionTools(controller) {
12306
12443
  break;
12307
12444
  case "rect":
12308
12445
  case "ellipse": {
12309
- const rect = { x: num2(x, NaN), y: num2(y, NaN), width: num2(width, NaN), height: num2(height, NaN) };
12310
- if (![rect.x, rect.y, rect.width, rect.height].every(Number.isFinite)) {
12446
+ const rect2 = { x: num2(x, NaN), y: num2(y, NaN), width: num2(width, NaN), height: num2(height, NaN) };
12447
+ if (![rect2.x, rect2.y, rect2.width, rect2.height].every(Number.isFinite)) {
12311
12448
  throw new Error("rect and ellipse need numeric x, y, width and height.");
12312
12449
  }
12313
- if (shape === "rect") controller.selectRect(rect, opts);
12314
- else controller.selectEllipse(rect, opts);
12450
+ if (shape === "rect") controller.selectRect(rect2, opts);
12451
+ else controller.selectEllipse(rect2, opts);
12315
12452
  break;
12316
12453
  }
12317
12454
  case "polygon": {
12318
- const list = Array.isArray(points) ? points.map((p) => ({ x: num2(_optionalChain([p, 'optionalAccess', _502 => _502.x]), NaN), y: num2(_optionalChain([p, 'optionalAccess', _503 => _503.y]), NaN) })) : [];
12455
+ const list = Array.isArray(points) ? points.map((p) => ({ x: num2(_optionalChain([p, 'optionalAccess', _503 => _503.x]), NaN), y: num2(_optionalChain([p, 'optionalAccess', _504 => _504.y]), NaN) })) : [];
12319
12456
  if (list.length < 3 || !list.every((p) => Number.isFinite(p.x) && Number.isFinite(p.y))) {
12320
12457
  throw new Error("polygon needs points: at least 3 { x, y } vertices.");
12321
12458
  }
@@ -12443,7 +12580,7 @@ function createImageSelectionTools(controller) {
12443
12580
  },
12444
12581
  annotations: writeAnnotations("Refine the selection edge"),
12445
12582
  handler: async (params) => {
12446
- const edits = Array.isArray(params.edits) ? params.edits.map((e) => e.kind === "object" ? { ...e } : { ...e, points: (_nullishCoalesce(e.points, () => ( []))).map((p) => ({ x: num2(_optionalChain([p, 'optionalAccess', _504 => _504.x]), NaN), y: num2(_optionalChain([p, 'optionalAccess', _505 => _505.y]), NaN) })) }) : [];
12583
+ const edits = Array.isArray(params.edits) ? params.edits.map((e) => e.kind === "object" ? { ...e } : { ...e, points: (_nullishCoalesce(e.points, () => ( []))).map((p) => ({ x: num2(_optionalChain([p, 'optionalAccess', _505 => _505.x]), NaN), y: num2(_optionalChain([p, 'optionalAccess', _506 => _506.y]), NaN) })) }) : [];
12447
12584
  for (const e of edits) {
12448
12585
  if (e.kind === "object") {
12449
12586
  if (!e.rect === !e.point) throw new Error("An object edit takes rect (a box around the object) or point (on it).");
@@ -12607,7 +12744,7 @@ function createImageSelectionTools(controller) {
12607
12744
  },
12608
12745
  annotations: writeAnnotations("Select a polygon (lasso)", true),
12609
12746
  handler: async (args) => {
12610
- const list = Array.isArray(args.points) ? args.points.map((p) => ({ x: num2(_optionalChain([p, 'optionalAccess', _506 => _506.x]), NaN), y: num2(_optionalChain([p, 'optionalAccess', _507 => _507.y]), NaN) })) : [];
12747
+ const list = Array.isArray(args.points) ? args.points.map((p) => ({ x: num2(_optionalChain([p, 'optionalAccess', _507 => _507.x]), NaN), y: num2(_optionalChain([p, 'optionalAccess', _508 => _508.y]), NaN) })) : [];
12611
12748
  if (list.length < 3 || !list.every((p) => Number.isFinite(p.x) && Number.isFinite(p.y))) {
12612
12749
  throw new Error("points needs at least 3 { x, y } vertices in natural image pixels.");
12613
12750
  }
@@ -12644,7 +12781,7 @@ function createImageSelectionTools(controller) {
12644
12781
  },
12645
12782
  annotations: writeAnnotations("Quick Selection"),
12646
12783
  handler: async (args, context) => {
12647
- const strokes = Array.isArray(args.strokes) ? args.strokes.map((s) => Array.isArray(s) ? s.map((p) => ({ x: num2(_optionalChain([p, 'optionalAccess', _508 => _508.x]), NaN), y: num2(_optionalChain([p, 'optionalAccess', _509 => _509.y]), NaN) })) : []) : [];
12784
+ const strokes = Array.isArray(args.strokes) ? args.strokes.map((s) => Array.isArray(s) ? s.map((p) => ({ x: num2(_optionalChain([p, 'optionalAccess', _509 => _509.x]), NaN), y: num2(_optionalChain([p, 'optionalAccess', _510 => _510.y]), NaN) })) : []) : [];
12648
12785
  if (!strokes.length || strokes.some((s) => !s.length || !s.every((p) => Number.isFinite(p.x) && Number.isFinite(p.y)))) {
12649
12786
  throw new Error("strokes needs at least one stroke of { x, y } points in natural image pixels.");
12650
12787
  }
@@ -12653,7 +12790,7 @@ function createImageSelectionTools(controller) {
12653
12790
  mode: _chunkQYLWG22Ncjs.parseSelectionMode.call(void 0, args.mode),
12654
12791
  sampleAllLayers: args.sampleAllLayers,
12655
12792
  enhanceEdge: args.enhanceEdge,
12656
- signal: _optionalChain([context, 'optionalAccess', _510 => _510.signal])
12793
+ signal: _optionalChain([context, 'optionalAccess', _511 => _511.signal])
12657
12794
  });
12658
12795
  return summary(controller);
12659
12796
  }
@@ -12682,18 +12819,18 @@ function createImageSelectionTools(controller) {
12682
12819
  },
12683
12820
  annotations: { ...writeAnnotations("Object Selection"), openWorldHint: true },
12684
12821
  handler: async (args, context) => {
12685
- const rect = args.rect;
12822
+ const rect2 = args.rect;
12686
12823
  const point = args.point;
12687
- if (!rect && !point) throw new Error("Pass rect (a box around the object) or point (a point on it).");
12688
- if (rect && point) throw new Error("Pass rect or point, not both.");
12824
+ if (!rect2 && !point) throw new Error("Pass rect (a box around the object) or point (a point on it).");
12825
+ if (rect2 && point) throw new Error("Pass rect or point, not both.");
12689
12826
  const options = {
12690
12827
  mode: _chunkQYLWG22Ncjs.parseSelectionMode.call(void 0, args.mode),
12691
12828
  sampleAllLayers: args.sampleAllLayers,
12692
12829
  enhanceEdge: args.enhanceEdge,
12693
12830
  useModel: args.useModel,
12694
- signal: _optionalChain([context, 'optionalAccess', _511 => _511.signal])
12831
+ signal: _optionalChain([context, 'optionalAccess', _512 => _512.signal])
12695
12832
  };
12696
- const { method } = rect ? await controller.selectObject({ rect: { x: num2(rect.x, NaN), y: num2(rect.y, NaN), width: num2(rect.width, NaN), height: num2(rect.height, NaN) } }, options) : await controller.selectObject({ point: { x: num2(point.x, NaN), y: num2(point.y, NaN) } }, options);
12833
+ const { method } = rect2 ? await controller.selectObject({ rect: { x: num2(rect2.x, NaN), y: num2(rect2.y, NaN), width: num2(rect2.width, NaN), height: num2(rect2.height, NaN) } }, options) : await controller.selectObject({ point: { x: num2(point.x, NaN), y: num2(point.y, NaN) } }, options);
12697
12834
  return { ...summary(controller), method };
12698
12835
  }
12699
12836
  };
@@ -12720,7 +12857,7 @@ function createImageSelectionTools(controller) {
12720
12857
  softness: args.softness === void 0 ? void 0 : num2(args.softness, 4),
12721
12858
  mode: _chunkQYLWG22Ncjs.parseSelectionMode.call(void 0, args.mode),
12722
12859
  sampleAllLayers: args.sampleAllLayers,
12723
- signal: _optionalChain([context, 'optionalAccess', _512 => _512.signal])
12860
+ signal: _optionalChain([context, 'optionalAccess', _513 => _513.signal])
12724
12861
  });
12725
12862
  return { ...summary(controller), noiseLevel };
12726
12863
  }
@@ -12748,7 +12885,7 @@ function createImageSelectionTools(controller) {
12748
12885
  mode: _chunkQYLWG22Ncjs.parseSelectionMode.call(void 0, args.mode),
12749
12886
  sampleAllLayers: args.sampleAllLayers,
12750
12887
  useModel: args.useModel,
12751
- signal: _optionalChain([context, 'optionalAccess', _513 => _513.signal])
12888
+ signal: _optionalChain([context, 'optionalAccess', _514 => _514.signal])
12752
12889
  });
12753
12890
  return { ...summary(controller), method, ...note ? { note } : {} };
12754
12891
  }
@@ -12846,7 +12983,7 @@ function createImageSelectionTools(controller) {
12846
12983
  await controller.selectColorRangePreset(args.preset, { ...common, falloff: num2(args.fuzziness, 20) });
12847
12984
  } else {
12848
12985
  const samples = args.samples.map((s, i) => {
12849
- if (typeof _optionalChain([s, 'optionalAccess', _514 => _514.color]) !== "string" || !/^#?[0-9a-f]{6}$/i.test(s.color.trim())) throw new Error(`samples[${i}].color must be #rrggbb.`);
12986
+ if (typeof _optionalChain([s, 'optionalAccess', _515 => _515.color]) !== "string" || !/^#?[0-9a-f]{6}$/i.test(s.color.trim())) throw new Error(`samples[${i}].color must be #rrggbb.`);
12850
12987
  const at = typeof s.x === "number" && typeof s.y === "number" ? { x: s.x, y: s.y } : void 0;
12851
12988
  return at ? { color: s.color, at } : { color: s.color };
12852
12989
  });
@@ -13075,7 +13212,7 @@ function createImageSelectionTools(controller) {
13075
13212
  inputSchema: {
13076
13213
  type: "object",
13077
13214
  properties: {
13078
- output: { type: "string", enum: ["new-layer", "current"], description: "new-layer or current (default current)." },
13215
+ output: { type: "string", enum: ["new-layer", "current", "duplicate-layer"], description: "new-layer (the fill alone on a layer above), current (into the layer) or duplicate-layer (into a copy of the layer, above it); default current." },
13079
13216
  sampleRadius: { type: "number", minimum: 32, maximum: 4e3, description: "Sample within this many pixels of the selection (default its larger side)." },
13080
13217
  seed: { type: "integer", minimum: 0, description: "Random seed; another seed gives another fill to choose from (default 0)." },
13081
13218
  sampleRects: { type: "array", minItems: 1, items: rectSchemaStrict, description: "Sample only from these rectangles (natural image pixels), instead of the ring around the selection." },
@@ -13088,7 +13225,7 @@ function createImageSelectionTools(controller) {
13088
13225
  annotations: writeAnnotations("Content-Aware Fill"),
13089
13226
  handler: async (args, context) => {
13090
13227
  if (!controller.getSelection()) throw new Error("Nothing is selected; select what to remove first.");
13091
- const rects = (v) => Array.isArray(v) ? v.map((r) => ({ x: num2(_optionalChain([r, 'optionalAccess', _515 => _515.x]), NaN), y: num2(_optionalChain([r, 'optionalAccess', _516 => _516.y]), NaN), width: num2(_optionalChain([r, 'optionalAccess', _517 => _517.width]), NaN), height: num2(_optionalChain([r, 'optionalAccess', _518 => _518.height]), NaN) })) : void 0;
13228
+ const rects = (v) => Array.isArray(v) ? v.map((r) => ({ x: num2(_optionalChain([r, 'optionalAccess', _516 => _516.x]), NaN), y: num2(_optionalChain([r, 'optionalAccess', _517 => _517.y]), NaN), width: num2(_optionalChain([r, 'optionalAccess', _518 => _518.width]), NaN), height: num2(_optionalChain([r, 'optionalAccess', _519 => _519.height]), NaN) })) : void 0;
13092
13229
  return controller.contentAwareFillAsync({
13093
13230
  output: args.output,
13094
13231
  sampleRadius: args.sampleRadius,
@@ -13097,7 +13234,7 @@ function createImageSelectionTools(controller) {
13097
13234
  sampleRects: rects(args.sampleRects),
13098
13235
  excludeRects: rects(args.excludeRects),
13099
13236
  samplingChannelId: typeof args.samplingChannelId === "string" ? args.samplingChannelId : void 0,
13100
- signal: _optionalChain([context, 'optionalAccess', _519 => _519.signal])
13237
+ signal: _optionalChain([context, 'optionalAccess', _520 => _520.signal])
13101
13238
  });
13102
13239
  }
13103
13240
  };
@@ -13375,13 +13512,13 @@ function createImageSubjectSelectionTool(controller) {
13375
13512
  handler: async ({ target, maxSegments, mode, feather, enhanceEdge }, context) => {
13376
13513
  if (target !== void 0 && typeof target !== "string") throw new Error("target must be a description in words.");
13377
13514
  if (controller.segmentationProvider && !String(_nullishCoalesce(target, () => ( ""))).trim()) throw new Error("target must describe what to select (a model is set, and it selects by description).");
13378
- const perform = _optionalChain([context, 'optionalAccess', _520 => _520.perform]);
13515
+ const perform = _optionalChain([context, 'optionalAccess', _521 => _521.perform]);
13379
13516
  const { segments, method, note } = await controller.selectSubject(String(_nullishCoalesce(target, () => ( ""))), {
13380
13517
  mode: _chunkQYLWG22Ncjs.parseSelectionMode.call(void 0, mode),
13381
13518
  feather: num2(feather, 0),
13382
13519
  maxSegments: typeof maxSegments === "number" ? Math.max(1, Math.round(maxSegments)) : void 0,
13383
13520
  enhanceEdge: enhanceEdge === true,
13384
- signal: _optionalChain([context, 'optionalAccess', _521 => _521.signal]),
13521
+ signal: _optionalChain([context, 'optionalAccess', _522 => _522.signal]),
13385
13522
  // Under playback the cursor traces what the model found, as a lasso, before it is selected.
13386
13523
  beforeApply: perform ? (outlines) => perform(planOutlineTrace(outlines)) : void 0
13387
13524
  });
@@ -13445,7 +13582,7 @@ async function renderImageRegion(controller, request) {
13445
13582
  out.height = request.height;
13446
13583
  const context = out.getContext("2d");
13447
13584
  if (!context) throw new Error(NO_CANVAS);
13448
- const { rect } = request;
13585
+ const { rect: rect2 } = request;
13449
13586
  context.imageSmoothingEnabled = request.scale < 1;
13450
13587
  if (request.format === "jpeg") {
13451
13588
  context.fillStyle = "#ffffff";
@@ -13453,22 +13590,22 @@ async function renderImageRegion(controller, request) {
13453
13590
  }
13454
13591
  const kx = view.width / state.imageDimensions.width;
13455
13592
  const ky = view.height / state.imageDimensions.height;
13456
- context.drawImage(view, rect.x * kx, rect.y * ky, rect.width * kx, rect.height * ky, 0, 0, out.width, out.height);
13593
+ context.drawImage(view, rect2.x * kx, rect2.y * ky, rect2.width * kx, rect2.height * ky, 0, 0, out.width, out.height);
13457
13594
  if (request.includeOverlays) {
13458
13595
  const s = request.scale;
13459
13596
  const maskView = maskViewCanvas(controller, document);
13460
- if (maskView) context.drawImage(maskView, rect.x, rect.y, rect.width, rect.height, 0, 0, out.width, out.height);
13597
+ if (maskView) context.drawImage(maskView, rect2.x, rect2.y, rect2.width, rect2.height, 0, 0, out.width, out.height);
13461
13598
  const selection = state.selection;
13462
- if (_optionalChain([selection, 'optionalAccess', _522 => _522.bounds]) && selection.width === state.imageDimensions.width && selection.height === state.imageDimensions.height) {
13599
+ if (_optionalChain([selection, 'optionalAccess', _523 => _523.bounds]) && selection.width === state.imageDimensions.width && selection.height === state.imageDimensions.height) {
13463
13600
  const shade = selectionShade(selection, document);
13464
- if (shade) context.drawImage(shade, rect.x, rect.y, rect.width, rect.height, 0, 0, out.width, out.height);
13601
+ if (shade) context.drawImage(shade, rect2.x, rect2.y, rect2.width, rect2.height, 0, 0, out.width, out.height);
13465
13602
  }
13466
13603
  if (state.crop) {
13467
13604
  context.save();
13468
13605
  context.strokeStyle = "#ffd400";
13469
13606
  context.lineWidth = 2;
13470
13607
  context.setLineDash([6, 4]);
13471
- context.strokeRect((state.crop.x - rect.x) * s, (state.crop.y - rect.y) * s, state.crop.width * s, state.crop.height * s);
13608
+ context.strokeRect((state.crop.x - rect2.x) * s, (state.crop.y - rect2.y) * s, state.crop.width * s, state.crop.height * s);
13472
13609
  context.restore();
13473
13610
  }
13474
13611
  }
@@ -13484,7 +13621,7 @@ function createImageCaptureSurface(controller) {
13484
13621
  return {
13485
13622
  units: "image pixels",
13486
13623
  content: whole,
13487
- selection: () => ({ rect: _nullishCoalesce(_optionalChain([controller, 'access', _523 => _523.getState, 'call', _524 => _524(), 'access', _525 => _525.selection, 'optionalAccess', _526 => _526.bounds]), () => ( null)) }),
13624
+ selection: () => ({ rect: _nullishCoalesce(_optionalChain([controller, 'access', _524 => _524.getState, 'call', _525 => _525(), 'access', _526 => _526.selection, 'optionalAccess', _527 => _527.bounds]), () => ( null)) }),
13488
13625
  overlays: "a shade over unselected pixels, the crop box outline and a layer mask view (set_mask_view)",
13489
13626
  maxScale: 8,
13490
13627
  render: (request) => renderImageRegion(controller, request)
@@ -13818,7 +13955,7 @@ function describeLayer(layer, activeId, boundsOf) {
13818
13955
  out.bounds = boundsOf(layer);
13819
13956
  out.fillOpacity = round3(_nullishCoalesce(layer.fillOpacity, () => ( 1)));
13820
13957
  out.shape = {
13821
- components: layer.components.map((c) => ({ op: c.op, kind: _nullishCoalesce(_optionalChain([c, 'access', _527 => _527.live, 'optionalAccess', _528 => _528.kind]), () => ( "path")) })),
13958
+ components: layer.components.map((c) => ({ op: c.op, kind: _nullishCoalesce(_optionalChain([c, 'access', _528 => _528.live, 'optionalAccess', _529 => _529.kind]), () => ( "path")) })),
13822
13959
  fill: layer.fill ? layer.fill.type : null,
13823
13960
  stroke: layer.stroke ? { width: layer.stroke.width, paint: layer.stroke.paint.type } : null
13824
13961
  };
@@ -13841,8 +13978,8 @@ function describeLayer(layer, activeId, boundsOf) {
13841
13978
  out.bounds = boundsOf(layer);
13842
13979
  out.fillOpacity = round3(_nullishCoalesce(layer.fillOpacity, () => ( 1)));
13843
13980
  out.contents = { id: layer.contents.id, name: layer.contents.name, kind: layer.contents.kind, width: layer.contents.width, height: layer.contents.height };
13844
- out.smartFilters = (_nullishCoalesce(_optionalChain([layer, 'access', _529 => _529.smartFilters, 'optionalAccess', _530 => _530.filters]), () => ( []))).map((f) => ({ id: f.id, kind: f.kind, enabled: f.enabled }));
13845
- out.filterMask = maskSummary(_optionalChain([layer, 'access', _531 => _531.smartFilters, 'optionalAccess', _532 => _532.mask]));
13981
+ out.smartFilters = (_nullishCoalesce(_optionalChain([layer, 'access', _530 => _530.smartFilters, 'optionalAccess', _531 => _531.filters]), () => ( []))).map((f) => ({ id: f.id, kind: f.kind, enabled: f.enabled }));
13982
+ out.filterMask = maskSummary(_optionalChain([layer, 'access', _532 => _532.smartFilters, 'optionalAccess', _533 => _533.mask]));
13846
13983
  break;
13847
13984
  }
13848
13985
  return out;
@@ -13870,7 +14007,7 @@ function createImageLayerTools(controller) {
13870
14007
  if (!loc) return null;
13871
14008
  return {
13872
14009
  ...describeLayer(loc.layer, s.activeLayerId, (x) => controller.getLayerBounds(x.id)),
13873
- parentId: _nullishCoalesce(_optionalChain([loc, 'access', _533 => _533.parent, 'optionalAccess', _534 => _534.id]), () => ( null)),
14010
+ parentId: _nullishCoalesce(_optionalChain([loc, 'access', _534 => _534.parent, 'optionalAccess', _535 => _535.id]), () => ( null)),
13874
14011
  index: loc.index
13875
14012
  };
13876
14013
  };
@@ -14193,7 +14330,7 @@ function createImageLayerTools(controller) {
14193
14330
  if (view !== "gray" && view !== "overlay" && view !== "off") throw new Error(`Unknown view "${String(view)}". Use gray, overlay or off.`);
14194
14331
  const id = view === "off" || layerId === void 0 ? void 0 : exists(layerId);
14195
14332
  const shown = controller.setMaskView(view, id);
14196
- return { view: _nullishCoalesce(_optionalChain([shown, 'optionalAccess', _535 => _535.mode]), () => ( "off")), layerId: _nullishCoalesce(_optionalChain([shown, 'optionalAccess', _536 => _536.layerId]), () => ( null)) };
14333
+ return { view: _nullishCoalesce(_optionalChain([shown, 'optionalAccess', _536 => _536.mode]), () => ( "off")), layerId: _nullishCoalesce(_optionalChain([shown, 'optionalAccess', _537 => _537.layerId]), () => ( null)) };
14197
14334
  }
14198
14335
  };
14199
14336
  const maskProps = {
@@ -14745,12 +14882,12 @@ var SelectionGesture = (_class13 = class {
14745
14882
  size: _nullishCoalesce(options.quickSize, () => ( 30)),
14746
14883
  grow: q.mode === "add",
14747
14884
  enhanceEdge: _nullishCoalesce(options.quickEnhance, () => ( false)),
14748
- selection: q.mode === "add" && _optionalChain([q, 'access', _537 => _537.base, 'optionalAccess', _538 => _538.bounds]) ? _chunkL52VMQZScjs.serializeMask.call(void 0, q.base) : null
14885
+ selection: q.mode === "add" && _optionalChain([q, 'access', _538 => _538.base, 'optionalAccess', _539 => _539.bounds]) ? _chunkL52VMQZScjs.serializeMask.call(void 0, q.base) : null
14749
14886
  },
14750
14887
  pixels
14751
14888
  );
14752
14889
  if (this.quick === q) this.controller.setSelectionPreview(_chunkQYLWG22Ncjs.combineSelections.call(void 0, q.base, mask, q.mode));
14753
- } catch (e35) {
14890
+ } catch (e36) {
14754
14891
  break;
14755
14892
  }
14756
14893
  } while (q.dirty && this.quick === q);
@@ -14770,19 +14907,19 @@ var SelectionGesture = (_class13 = class {
14770
14907
  const { tool } = this.getOptions();
14771
14908
  if (tool === "quick") return null;
14772
14909
  if (tool === "lasso") return this.points.length > 1 ? this.points.slice() : null;
14773
- const rect = _chunkL52VMQZScjs.normalizeRect.call(void 0, {
14910
+ const rect2 = _chunkL52VMQZScjs.normalizeRect.call(void 0, {
14774
14911
  x: this.start.x,
14775
14912
  y: this.start.y,
14776
14913
  width: this.current.x - this.start.x,
14777
14914
  height: this.current.y - this.start.y
14778
14915
  });
14779
- if (rect.width < 1 && rect.height < 1) return null;
14780
- if (tool === "ellipse") return _chunkL52VMQZScjs.ellipsePoints.call(void 0, rect);
14916
+ if (rect2.width < 1 && rect2.height < 1) return null;
14917
+ if (tool === "ellipse") return _chunkL52VMQZScjs.ellipsePoints.call(void 0, rect2);
14781
14918
  return [
14782
- { x: rect.x, y: rect.y },
14783
- { x: rect.x + rect.width, y: rect.y },
14784
- { x: rect.x + rect.width, y: rect.y + rect.height },
14785
- { x: rect.x, y: rect.y + rect.height }
14919
+ { x: rect2.x, y: rect2.y },
14920
+ { x: rect2.x + rect2.width, y: rect2.y },
14921
+ { x: rect2.x + rect2.width, y: rect2.y + rect2.height },
14922
+ { x: rect2.x, y: rect2.y + rect2.height }
14786
14923
  ];
14787
14924
  }
14788
14925
  /** Pointer down. Resolves once a wand click has been applied. */
@@ -14938,11 +15075,11 @@ var SelectionGesture = (_class13 = class {
14938
15075
  const options = this.getOptions();
14939
15076
  const mode = selectionModeFromModifiers(_nullishCoalesce(modifiers, () => ( this.modifiers)), options.mode);
14940
15077
  if (options.tool === "object") {
14941
- const rect2 = _chunkL52VMQZScjs.normalizeRect.call(void 0, { x: this.start.x, y: this.start.y, width: this.current.x - this.start.x, height: this.current.y - this.start.y });
15078
+ const rect3 = _chunkL52VMQZScjs.normalizeRect.call(void 0, { x: this.start.x, y: this.start.y, width: this.current.x - this.start.x, height: this.current.y - this.start.y });
14942
15079
  this.start = null;
14943
15080
  this.current = null;
14944
15081
  this.points = [];
14945
- const target = rect2.width >= 4 && rect2.height >= 4 ? { rect: rect2 } : { point: { x: rect2.x + rect2.width / 2, y: rect2.y + rect2.height / 2 } };
15082
+ const target = rect3.width >= 4 && rect3.height >= 4 ? { rect: rect3 } : { point: { x: rect3.x + rect3.width / 2, y: rect3.y + rect3.height / 2 } };
14946
15083
  this.pending = this.controller.selectObject(target, { mode, sampleAllLayers: _nullishCoalesce(options.objectSampleAll, () => ( true)), enhanceEdge: _nullishCoalesce(options.objectEnhance, () => ( false)) }).then(
14947
15084
  () => void 0,
14948
15085
  (err) => {
@@ -14956,7 +15093,7 @@ var SelectionGesture = (_class13 = class {
14956
15093
  this.start = null;
14957
15094
  this.current = null;
14958
15095
  this.points = [];
14959
- const strokeMode = _nullishCoalesce(_optionalChain([this, 'access', _539 => _539.quick, 'optionalAccess', _540 => _540.mode]), () => ( (mode === "replace" && this.controller.getSelection() ? "add" : mode)));
15096
+ const strokeMode = _nullishCoalesce(_optionalChain([this, 'access', _540 => _540.quick, 'optionalAccess', _541 => _541.mode]), () => ( (mode === "replace" && this.controller.getSelection() ? "add" : mode)));
14960
15097
  this.quick = null;
14961
15098
  this.pending = this.controller.quickSelect([stroke], {
14962
15099
  size: _nullishCoalesce(options.quickSize, () => ( 30)),
@@ -14972,7 +15109,7 @@ var SelectionGesture = (_class13 = class {
14972
15109
  return false;
14973
15110
  }
14974
15111
  const path = this.draftPath;
14975
- const rect = _chunkL52VMQZScjs.normalizeRect.call(void 0, {
15112
+ const rect2 = _chunkL52VMQZScjs.normalizeRect.call(void 0, {
14976
15113
  x: this.start.x,
14977
15114
  y: this.start.y,
14978
15115
  width: this.current.x - this.start.x,
@@ -14984,7 +15121,7 @@ var SelectionGesture = (_class13 = class {
14984
15121
  if (!path) return mode === "replace" ? this.controller.deselect() : false;
14985
15122
  const opts = { mode, antiAlias: options.antiAlias, feather: _nullishCoalesce(options.feather, () => ( 0)) };
14986
15123
  if (options.tool === "lasso") return path.length >= 3 ? this.controller.selectPolygon(path, opts) : false;
14987
- return options.tool === "ellipse" ? this.controller.selectEllipse(rect, opts) : this.controller.selectRect(rect, opts);
15124
+ return options.tool === "ellipse" ? this.controller.selectEllipse(rect2, opts) : this.controller.selectRect(rect2, opts);
14988
15125
  }
14989
15126
  /** Closes a polygonal lasso and selects it. Returns true when the selection changed. */
14990
15127
  close() {
@@ -15008,11 +15145,11 @@ var SelectionGesture = (_class13 = class {
15008
15145
  * Keys for a polygonal lasso being drawn: Enter closes it, Escape cancels, Backspace / Delete
15009
15146
  * removes the last corner. Returns true when the key was used (the host prevents its default).
15010
15147
  */
15011
- key(key) {
15148
+ key(key2) {
15012
15149
  if (!this.polygon && !this.magnetic) return false;
15013
- if (key === "Enter") this.close();
15014
- else if (key === "Escape") this.cancel();
15015
- else if (key === "Backspace" || key === "Delete") {
15150
+ if (key2 === "Enter") this.close();
15151
+ else if (key2 === "Escape") this.cancel();
15152
+ else if (key2 === "Backspace" || key2 === "Delete") {
15016
15153
  const m = this.magnetic;
15017
15154
  if (m) {
15018
15155
  m.anchors.pop();
@@ -15112,29 +15249,29 @@ var SelectionGesture = (_class13 = class {
15112
15249
  }, _class13);
15113
15250
  function handleSelectionShortcut(controller, e, onError) {
15114
15251
  if (!(e.ctrlKey || e.metaKey)) return false;
15115
- const key = e.key.toLowerCase();
15252
+ const key2 = e.key.toLowerCase();
15116
15253
  const run = (fn) => {
15117
15254
  try {
15118
15255
  fn();
15119
15256
  } catch (err) {
15120
- _optionalChain([onError, 'optionalCall', _541 => _541(err instanceof Error ? err.message : String(err))]);
15257
+ _optionalChain([onError, 'optionalCall', _542 => _542(err instanceof Error ? err.message : String(err))]);
15121
15258
  }
15122
15259
  return true;
15123
15260
  };
15124
- if (key === "c") return run(() => controller.copyPixels({ merged: Boolean(e.shiftKey) }));
15125
- if (key === "x" && !e.shiftKey) return run(() => controller.cutPixels());
15126
- if (key === "v") return run(() => controller.pastePixels(e.shiftKey && e.altKey ? "into" : e.shiftKey ? "in-place" : "new-layer"));
15127
- if (key === "d") return run(() => e.shiftKey ? controller.reselect() : controller.deselect());
15128
- if (key === "i" && e.shiftKey) return run(() => controller.invertSelection());
15261
+ if (key2 === "c") return run(() => controller.copyPixels({ merged: Boolean(e.shiftKey) }));
15262
+ if (key2 === "x" && !e.shiftKey) return run(() => controller.cutPixels());
15263
+ if (key2 === "v") return run(() => controller.pastePixels(e.shiftKey && e.altKey ? "into" : e.shiftKey ? "in-place" : "new-layer"));
15264
+ if (key2 === "d") return run(() => e.shiftKey ? controller.reselect() : controller.deselect());
15265
+ if (key2 === "i" && e.shiftKey) return run(() => controller.invertSelection());
15129
15266
  return false;
15130
15267
  }
15131
15268
  function handleMaskViewKey(controller, e) {
15132
15269
  if (e.ctrlKey || e.metaKey || e.altKey || e.key !== "\\") return false;
15133
15270
  const id = controller.getState().activeLayerId;
15134
15271
  const layer = id ? controller.getLayer(id) : null;
15135
- if (!_optionalChain([layer, 'optionalAccess', _542 => _542.mask]) || layer.mask.source) return false;
15272
+ if (!_optionalChain([layer, 'optionalAccess', _543 => _543.mask]) || layer.mask.source) return false;
15136
15273
  const view = controller.getMaskView();
15137
- controller.setMaskView(_optionalChain([view, 'optionalAccess', _543 => _543.layerId]) === layer.id && view.mode === "overlay" ? "off" : "overlay", layer.id);
15274
+ controller.setMaskView(_optionalChain([view, 'optionalAccess', _544 => _544.layerId]) === layer.id && view.mode === "overlay" ? "off" : "overlay", layer.id);
15138
15275
  return true;
15139
15276
  }
15140
15277
  function handleQuickMaskKey(controller, e) {
@@ -15275,14 +15412,14 @@ function handlePaintShortcut(controller, e) {
15275
15412
  if (e.ctrlKey || e.metaKey || e.altKey || isTyping(e.target)) return false;
15276
15413
  const brush = controller.getState().paint.brush;
15277
15414
  const set = (b) => controller.setPaintOptions({ brush: b });
15278
- const key = e.key;
15415
+ const key2 = e.key;
15279
15416
  if (handleMaskViewKey(controller, e)) return true;
15280
- switch (key.toLowerCase()) {
15417
+ switch (key2.toLowerCase()) {
15281
15418
  case "q":
15282
15419
  controller.setQuickMaskMode(!controller.quickMaskEditing);
15283
15420
  return true;
15284
15421
  case "b":
15285
- controller.setTool(e.shiftKey || key === "B" ? "mixer" : "brush");
15422
+ controller.setTool(e.shiftKey || key2 === "B" ? "mixer" : "brush");
15286
15423
  return true;
15287
15424
  case "e":
15288
15425
  controller.setTool("eraser");
@@ -15294,11 +15431,11 @@ function handlePaintShortcut(controller, e) {
15294
15431
  controller.setTool("clone");
15295
15432
  return true;
15296
15433
  case "j":
15297
- controller.setTool(e.shiftKey || key === "J" ? controller.getState().activeTool === "heal" ? "spot-heal" : "heal" : "spot-heal");
15434
+ controller.setTool(e.shiftKey || key2 === "J" ? controller.getState().activeTool === "heal" ? "spot-heal" : "heal" : "spot-heal");
15298
15435
  return true;
15299
15436
  case "o": {
15300
15437
  const cur = controller.getState().activeTool;
15301
- const next = e.shiftKey || key === "O" ? cur === "dodge" ? "burn" : cur === "burn" ? "sponge" : "dodge" : "dodge";
15438
+ const next = e.shiftKey || key2 === "O" ? cur === "dodge" ? "burn" : cur === "burn" ? "sponge" : "dodge" : "dodge";
15302
15439
  controller.setTool(next);
15303
15440
  return true;
15304
15441
  }
@@ -15312,18 +15449,18 @@ function handlePaintShortcut(controller, e) {
15312
15449
  controller.swapPaintColors();
15313
15450
  return true;
15314
15451
  }
15315
- if (key === "[" || key === "{") {
15316
- if (e.shiftKey || key === "{") set({ hardness: Math.max(0, Math.round((brush.hardness - 0.25) * 4) / 4) });
15452
+ if (key2 === "[" || key2 === "{") {
15453
+ if (e.shiftKey || key2 === "{") set({ hardness: Math.max(0, Math.round((brush.hardness - 0.25) * 4) / 4) });
15317
15454
  else set({ size: Math.max(1, brush.size - sizeStep(brush.size - 1)) });
15318
15455
  return true;
15319
15456
  }
15320
- if (key === "]" || key === "}") {
15321
- if (e.shiftKey || key === "}") set({ hardness: Math.min(1, Math.round((brush.hardness + 0.25) * 4) / 4) });
15457
+ if (key2 === "]" || key2 === "}") {
15458
+ if (e.shiftKey || key2 === "}") set({ hardness: Math.min(1, Math.round((brush.hardness + 0.25) * 4) / 4) });
15322
15459
  else set({ size: Math.min(_chunkPQ3H2AANcjs.MAX_BRUSH_SIZE, brush.size + sizeStep(brush.size)) });
15323
15460
  return true;
15324
15461
  }
15325
- if (/^[0-9]$/.test(key) && isPaintTool(controller.getState().activeTool)) {
15326
- set({ opacity: key === "0" ? 1 : Number(key) / 10 });
15462
+ if (/^[0-9]$/.test(key2) && isPaintTool(controller.getState().activeTool)) {
15463
+ set({ opacity: key2 === "0" ? 1 : Number(key2) / 10 });
15327
15464
  return true;
15328
15465
  }
15329
15466
  return false;
@@ -15348,7 +15485,7 @@ var PaintGesture = (_class14 = class {
15348
15485
  const layer = this.controller.getActiveLayer();
15349
15486
  if (!layer) throw new Error("Select a layer to move in the Layers panel.");
15350
15487
  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.`);
15351
- if (_optionalChain([layer, 'access', _544 => _544.locks, 'optionalAccess', _545 => _545.all]) || _optionalChain([layer, 'access', _546 => _546.locks, 'optionalAccess', _547 => _547.position])) throw new Error(`Layer "${layer.name}" has its position locked.`);
15488
+ if (_optionalChain([layer, 'access', _545 => _545.locks, 'optionalAccess', _546 => _546.all]) || _optionalChain([layer, 'access', _547 => _547.locks, 'optionalAccess', _548 => _548.position])) throw new Error(`Layer "${layer.name}" has its position locked.`);
15352
15489
  const origin = layer.type === "pixel" ? { ...layer.offset } : layer.type === "smart" ? { ...layer.placement.corners[0] } : (() => {
15353
15490
  const b = _chunkH65IBXFIcjs.shapeGeometryBounds.call(void 0, layer);
15354
15491
  return b ? { x: b.x, y: b.y } : { x: 0, y: 0 };
@@ -15405,7 +15542,7 @@ var PaintGesture = (_class14 = class {
15405
15542
  this.move = null;
15406
15543
  }
15407
15544
  cancel() {
15408
- _optionalChain([this, 'access', _548 => _548.stroke, 'optionalAccess', _549 => _549.cancel, 'call', _550 => _550()]);
15545
+ _optionalChain([this, 'access', _549 => _549.stroke, 'optionalAccess', _550 => _550.cancel, 'call', _551 => _551()]);
15409
15546
  this.stroke = null;
15410
15547
  this.move = null;
15411
15548
  }
@@ -15640,7 +15777,7 @@ function profileArg(v) {
15640
15777
  if (s.startsWith("icc:")) {
15641
15778
  try {
15642
15779
  return _chunkOLNIPTB3cjs.base64ToBytes.call(void 0, s.slice(4));
15643
- } catch (e36) {
15780
+ } catch (e37) {
15644
15781
  throw new (0, _chunkH65IBXFIcjs.LayerOperationError)("The icc: value is not valid base64.");
15645
15782
  }
15646
15783
  }
@@ -16486,7 +16623,7 @@ function createImageSmartObjectTools(controller) {
16486
16623
  const layerSummary = (id) => {
16487
16624
  const s = controller.getState();
16488
16625
  const loc = _chunkUOGKSVRQcjs.findLayer.call(void 0, s.layers, id);
16489
- return loc ? { ...describeLayer(loc.layer, s.activeLayerId, (x) => controller.getLayerBounds(x.id)), parentId: _nullishCoalesce(_optionalChain([loc, 'access', _551 => _551.parent, 'optionalAccess', _552 => _552.id]), () => ( null)), index: loc.index } : null;
16626
+ return loc ? { ...describeLayer(loc.layer, s.activeLayerId, (x) => controller.getLayerBounds(x.id)), parentId: _nullishCoalesce(_optionalChain([loc, 'access', _552 => _552.parent, 'optionalAccess', _553 => _553.id]), () => ( null)), index: loc.index } : null;
16490
16627
  };
16491
16628
  const getSmart = {
16492
16629
  name: "get_smart_object",
@@ -17043,7 +17180,7 @@ function createImageShapeTools(controller) {
17043
17180
  const layerSummary = (id) => {
17044
17181
  const s = controller.getState();
17045
17182
  const loc = _chunkUOGKSVRQcjs.findLayer.call(void 0, s.layers, id);
17046
- return loc ? { ...describeLayer(loc.layer, s.activeLayerId, (x) => controller.getLayerBounds(x.id)), parentId: _nullishCoalesce(_optionalChain([loc, 'access', _553 => _553.parent, 'optionalAccess', _554 => _554.id]), () => ( null)), index: loc.index } : null;
17183
+ return loc ? { ...describeLayer(loc.layer, s.activeLayerId, (x) => controller.getLayerBounds(x.id)), parentId: _nullishCoalesce(_optionalChain([loc, 'access', _554 => _554.parent, 'optionalAccess', _555 => _555.id]), () => ( null)), index: loc.index } : null;
17047
17184
  };
17048
17185
  const get = {
17049
17186
  name: "get_shape_layer",
@@ -17274,7 +17411,7 @@ function createImageShapeTools(controller) {
17274
17411
  const mode = args.mode;
17275
17412
  controller.pathToSelection(_nullishCoalesce(fromPathId(args), () => ( pathSpec(args))), { feather: args.feather, antiAlias: args.antiAlias, mode });
17276
17413
  const sel = controller.getSelection();
17277
- return { empty: !sel, bounds: _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _555 => _555.bounds]), () => ( null)), area: Math.round(sel ? _chunkQYLWG22Ncjs.selectionArea.call(void 0, sel) : 0) };
17414
+ return { empty: !sel, bounds: _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _556 => _556.bounds]), () => ( null)), area: Math.round(sel ? _chunkQYLWG22Ncjs.selectionArea.call(void 0, sel) : 0) };
17278
17415
  }
17279
17416
  };
17280
17417
  const getVectorMask = {
@@ -17306,7 +17443,7 @@ function createImageShapeTools(controller) {
17306
17443
  handler: (args) => {
17307
17444
  const id = layerArg(args.layerId);
17308
17445
  const spec = _nullishCoalesce(fromPathId(args), () => ( pathSpec(args)));
17309
- const hasPath = _optionalChain([spec, 'access', _556 => _556.components, 'optionalAccess', _557 => _557.length]) || spec.shape !== void 0 || spec.subpaths !== void 0;
17446
+ const hasPath = _optionalChain([spec, 'access', _557 => _557.components, 'optionalAccess', _558 => _558.length]) || spec.shape !== void 0 || spec.subpaths !== void 0;
17310
17447
  const from = _nullishCoalesce(args.from, () => ( (hasPath ? "path" : "reveal-all")));
17311
17448
  if (from !== "selection" && TRACE_KEYS.some((k) => args[k] !== void 0)) throw new Error("tolerance, cornerRoundness and minArea apply only to from selection.");
17312
17449
  controller.addVectorMask(id, from, spec, traceOptions(args));
@@ -17414,7 +17551,7 @@ function createImageShapeTools(controller) {
17414
17551
  annotations: { title: "Add a document path", ...WRITE8 },
17415
17552
  handler: (args) => {
17416
17553
  const spec = pathSpec(args);
17417
- if (!_optionalChain([spec, 'access', _558 => _558.components, 'optionalAccess', _559 => _559.length]) && spec.shape === void 0 && spec.subpaths === void 0) throw new Error("Give the path as shape, subpaths or components.");
17554
+ if (!_optionalChain([spec, 'access', _559 => _559.components, 'optionalAccess', _560 => _560.length]) && spec.shape === void 0 && spec.subpaths === void 0) throw new Error("Give the path as shape, subpaths or components.");
17418
17555
  return { path: pathSummary(controller.addPath({ ...spec, name: args.name }).id) };
17419
17556
  }
17420
17557
  };
@@ -17558,7 +17695,7 @@ function createImageTypeTools(controller) {
17558
17695
  const layerSummary = (id) => {
17559
17696
  const s = controller.getState();
17560
17697
  const loc = _chunkUOGKSVRQcjs.findLayer.call(void 0, s.layers, id);
17561
- return loc ? { ...describeLayer(loc.layer, s.activeLayerId, (x) => controller.getLayerBounds(x.id)), parentId: _nullishCoalesce(_optionalChain([loc, 'access', _560 => _560.parent, 'optionalAccess', _561 => _561.id]), () => ( null)), index: loc.index } : null;
17698
+ return loc ? { ...describeLayer(loc.layer, s.activeLayerId, (x) => controller.getLayerBounds(x.id)), parentId: _nullishCoalesce(_optionalChain([loc, 'access', _561 => _561.parent, 'optionalAccess', _562 => _562.id]), () => ( null)), index: loc.index } : null;
17562
17699
  };
17563
17700
  const range = (args) => ({ start: args.start, end: args.end });
17564
17701
  const listFonts = {
@@ -17567,7 +17704,7 @@ function createImageTypeTools(controller) {
17567
17704
  description: "Returns the font families type layers can use here (generic families such as sans-serif always work). Changes nothing.",
17568
17705
  inputSchema: { type: "object", properties: {}, additionalProperties: false },
17569
17706
  annotations: { title: "List fonts", ...READ11 },
17570
- handler: () => ({ families: controller.listFonts(), shaper: _nullishCoalesce(_optionalChain([controller, 'access', _562 => _562.getTextShaper, 'call', _563 => _563(), 'optionalAccess', _564 => _564.id]), () => ( null)) })
17707
+ handler: () => ({ families: controller.listFonts(), shaper: _nullishCoalesce(_optionalChain([controller, 'access', _563 => _563.getTextShaper, 'call', _564 => _564(), 'optionalAccess', _565 => _565.id]), () => ( null)) })
17571
17708
  };
17572
17709
  const get = {
17573
17710
  name: "get_text_layer",
@@ -17723,7 +17860,7 @@ function createImageTypeTools(controller) {
17723
17860
  const init = pick2(args, ["text", "x", "y", "orientation", "box", "style", "paragraph", "rotation", "mode", "feather", "antiAlias"]);
17724
17861
  controller.selectTextShape(init);
17725
17862
  const sel = controller.getSelection();
17726
- return { empty: !sel, bounds: _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _565 => _565.bounds]), () => ( null)), area: Math.round(sel ? _chunkQYLWG22Ncjs.selectionArea.call(void 0, sel) : 0) };
17863
+ return { empty: !sel, bounds: _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _566 => _566.bounds]), () => ( null)), area: Math.round(sel ? _chunkQYLWG22Ncjs.selectionArea.call(void 0, sel) : 0) };
17727
17864
  }
17728
17865
  };
17729
17866
  return [listFonts, get, add2, setText, setStyle, setParagraph, setFrame, setOrientation, toShape, typeMask];
@@ -17902,7 +18039,7 @@ function createImageEditorToolProvider(controller, options = {}) {
17902
18039
  for (const ref of [aboveId, parentId]) {
17903
18040
  if (ref !== void 0 && !controller.getLayer(ref)) throw new Error(`Unknown layer "${ref}". Call list_layers for ids.`);
17904
18041
  }
17905
- if (parentId !== void 0 && _optionalChain([controller, 'access', _566 => _566.getLayer, 'call', _567 => _567(parentId), 'optionalAccess', _568 => _568.type]) !== "group") throw new Error(`Layer "${parentId}" is not a group.`);
18042
+ if (parentId !== void 0 && _optionalChain([controller, 'access', _567 => _567.getLayer, 'call', _568 => _568(parentId), 'optionalAccess', _569 => _569.type]) !== "group") throw new Error(`Layer "${parentId}" is not a group.`);
17906
18043
  const id = controller.addAdjustmentLayer({ kind, params, opacity, blend, name, aboveId, parentId, useSelection: useSelection !== false });
17907
18044
  const layer = controller.getAdjustmentLayer(id);
17908
18045
  return { layer: JSON.parse(JSON.stringify(layer)), index: controller.getAdjustmentLayers().findIndex((l) => l.id === id), masked: Boolean(layer.mask) };
@@ -18127,11 +18264,11 @@ function scalePixels(pixels, w, h) {
18127
18264
  return { width: w, height: h, data: out };
18128
18265
  }
18129
18266
  function scaleEdit(edit, s) {
18130
- const pt = (p) => ({ x: p.x * s, y: p.y * s });
18267
+ const pt2 = (p) => ({ x: p.x * s, y: p.y * s });
18131
18268
  if (edit.kind === "object") {
18132
- return { ...edit, rect: edit.rect && { x: edit.rect.x * s, y: edit.rect.y * s, width: edit.rect.width * s, height: edit.rect.height * s }, point: edit.point && pt(edit.point) };
18269
+ return { ...edit, rect: edit.rect && { x: edit.rect.x * s, y: edit.rect.y * s, width: edit.rect.width * s, height: edit.rect.height * s }, point: edit.point && pt2(edit.point) };
18133
18270
  }
18134
- const scaled = { ...edit, points: edit.points.map(pt) };
18271
+ const scaled = { ...edit, points: edit.points.map(pt2) };
18135
18272
  if ("size" in edit && edit.size !== void 0) scaled.size = Math.max(1, edit.size * s);
18136
18273
  return scaled;
18137
18274
  }
@@ -18200,7 +18337,7 @@ var SelectAndMaskSession = (_class15 = class {
18200
18337
  if (!ids.length) return null;
18201
18338
  try {
18202
18339
  return this.controller.compositePixels(void 0, { layerIds: ids });
18203
- } catch (e37) {
18340
+ } catch (e38) {
18204
18341
  return null;
18205
18342
  }
18206
18343
  }
@@ -18237,7 +18374,7 @@ var SelectAndMaskSession = (_class15 = class {
18237
18374
  const h = Math.max(1, Math.round(px2.height * s));
18238
18375
  this.previewPixels = scalePixels(px2, w, h);
18239
18376
  this.belowPreview = this.below ? scalePixels(this.below, w, h) : null;
18240
- this.baseMask = _optionalChain([this, 'access', _569 => _569.base, 'optionalAccess', _570 => _570.bounds]) ? s === 1 ? this.base : _chunkQYLWG22Ncjs.resizeSelection.call(void 0, this.base, w, h) : null;
18377
+ this.baseMask = _optionalChain([this, 'access', _570 => _570.base, 'optionalAccess', _571 => _571.bounds]) ? s === 1 ? this.base : _chunkQYLWG22Ncjs.resizeSelection.call(void 0, this.base, w, h) : null;
18241
18378
  }
18242
18379
  /**
18243
18380
  * Recomputes the preview mask from the base selection, the strokes and the settings: at once on
@@ -18255,7 +18392,7 @@ var SelectAndMaskSession = (_class15 = class {
18255
18392
  const edits = [...this.editsList, ...this.live ? [this.live] : []].map((e) => scaleEdit(e, scale));
18256
18393
  try {
18257
18394
  const { selection, refineBrush } = _chunkL52VMQZScjs.applyRefineEdits.call(void 0, px2, this.baseMask, edits, px2.width, px2.height);
18258
- this.previewMask = _optionalChain([selection, 'optionalAccess', _571 => _571.bounds]) ? _chunkL52VMQZScjs.refineSelection.call(void 0, px2, selection, scaleParams(this.settingsValue.params, scale), refineBrush) : null;
18395
+ this.previewMask = _optionalChain([selection, 'optionalAccess', _572 => _572.bounds]) ? _chunkL52VMQZScjs.refineSelection.call(void 0, px2, selection, scaleParams(this.settingsValue.params, scale), refineBrush) : null;
18259
18396
  this.error = null;
18260
18397
  } catch (err) {
18261
18398
  this.previewMask = null;
@@ -18361,7 +18498,7 @@ var SelectAndMaskSession = (_class15 = class {
18361
18498
  break;
18362
18499
  }
18363
18500
  case "on-layers": {
18364
- const under = _optionalChain([this, 'access', _572 => _572.belowPreview, 'optionalAccess', _573 => _573.data]);
18501
+ const under = _optionalChain([this, 'access', _573 => _573.belowPreview, 'optionalAccess', _574 => _574.data]);
18365
18502
  let ur = checker;
18366
18503
  let ug = checker;
18367
18504
  let ub = checker;
@@ -18423,8 +18560,8 @@ var SelectAndMaskSession = (_class15 = class {
18423
18560
  if (!live || !this.dragStart) return;
18424
18561
  if (live.kind === "object") {
18425
18562
  const a = this.dragStart;
18426
- const rect = { x: Math.min(a.x, point.x), y: Math.min(a.y, point.y), width: Math.abs(point.x - a.x), height: Math.abs(point.y - a.y) };
18427
- this.live = rect.width >= 4 && rect.height >= 4 ? { kind: "object", rect, mode: live.mode } : { kind: "object", point: a, mode: live.mode };
18563
+ const rect2 = { x: Math.min(a.x, point.x), y: Math.min(a.y, point.y), width: Math.abs(point.x - a.x), height: Math.abs(point.y - a.y) };
18564
+ this.live = rect2.width >= 4 && rect2.height >= 4 ? { kind: "object", rect: rect2, mode: live.mode } : { kind: "object", point: a, mode: live.mode };
18428
18565
  return;
18429
18566
  }
18430
18567
  const last = live.points[live.points.length - 1];
@@ -18461,8 +18598,8 @@ var SelectAndMaskSession = (_class15 = class {
18461
18598
  * Show Original), J (Show Edge), P (Show Original), a tool letter, [ and ] (brush size).
18462
18599
  * Returns true when the key was used.
18463
18600
  */
18464
- handleKey(key) {
18465
- const k = key.toLowerCase();
18601
+ handleKey(key2) {
18602
+ const k = key2.toLowerCase();
18466
18603
  const view = SELECT_AND_MASK_VIEWS.find((v) => v.key === k);
18467
18604
  if (view) {
18468
18605
  this.update({ view: view.id });
@@ -18657,7 +18794,7 @@ function maskThumbnailClick(controller, layer, e) {
18657
18794
  } else if (e.altKey && !layer.mask.source) {
18658
18795
  const mode = e.shiftKey ? "overlay" : "gray";
18659
18796
  const view = controller.getMaskView();
18660
- controller.setMaskView(_optionalChain([view, 'optionalAccess', _574 => _574.layerId]) === layer.id && view.mode === mode ? "off" : mode, layer.id);
18797
+ controller.setMaskView(_optionalChain([view, 'optionalAccess', _575 => _575.layerId]) === layer.id && view.mode === mode ? "off" : mode, layer.id);
18661
18798
  } else if (e.shiftKey) {
18662
18799
  controller.setLayerMaskProps(layer.id, { enabled: layer.mask.enabled === false });
18663
18800
  } else {
@@ -18721,7 +18858,7 @@ function layerHasThumbnail(layer) {
18721
18858
  return layer.type === "pixel" || layer.type === "shape" || layer.type === "type";
18722
18859
  }
18723
18860
  function layerWarning(layer) {
18724
- if (layer.type === "type" && _optionalChain([layer, 'access', _575 => _575.missingFonts, 'optionalAccess', _576 => _576.length])) {
18861
+ if (layer.type === "type" && _optionalChain([layer, 'access', _576 => _576.missingFonts, 'optionalAccess', _577 => _577.length])) {
18725
18862
  return `Missing ${layer.missingFonts.length === 1 ? "font" : "fonts"}: ${layer.missingFonts.join(", ")}. ${layer.rendering === "stored" ? "Showing the saved pixels until the text is edited." : "Drawn with a fallback font."}`;
18726
18863
  }
18727
18864
  return null;
@@ -18744,16 +18881,16 @@ function layerMenu(controller) {
18744
18881
  const siblings = loc ? loc.parent ? loc.parent.children : s.layers : [];
18745
18882
  const below = loc ? siblings[loc.index - 1] : void 0;
18746
18883
  const hasSel = controller.hasSelection;
18747
- const isPixel = _optionalChain([active, 'optionalAccess', _577 => _577.type]) === "pixel";
18748
- const hasOwnPixels = _optionalChain([active, 'optionalAccess', _578 => _578.type]) === "pixel" || _optionalChain([active, 'optionalAccess', _579 => _579.type]) === "shape" || _optionalChain([active, 'optionalAccess', _580 => _580.type]) === "type" || _optionalChain([active, 'optionalAccess', _581 => _581.type]) === "smart";
18884
+ const isPixel = _optionalChain([active, 'optionalAccess', _578 => _578.type]) === "pixel";
18885
+ const hasOwnPixels = _optionalChain([active, 'optionalAccess', _579 => _579.type]) === "pixel" || _optionalChain([active, 'optionalAccess', _580 => _580.type]) === "shape" || _optionalChain([active, 'optionalAccess', _581 => _581.type]) === "type" || _optionalChain([active, 'optionalAccess', _582 => _582.type]) === "smart";
18749
18886
  return [
18750
18887
  { action: "new-layer", label: "New Layer", enabled: true },
18751
18888
  { action: "new-group", label: "New Group", enabled: true },
18752
18889
  { action: "duplicate", label: "Duplicate Layer", enabled: Boolean(active) },
18753
18890
  { action: "delete", label: "Delete Layer", enabled: Boolean(active) },
18754
18891
  { action: "group-selected", label: "Group Layer", enabled: Boolean(active) },
18755
- { action: "ungroup", label: "Ungroup", enabled: _optionalChain([active, 'optionalAccess', _582 => _582.type]) === "group" },
18756
- { action: "merge-down", label: "Merge Down", enabled: Boolean(_optionalChain([active, 'optionalAccess', _583 => _583.visible]) && _optionalChain([below, 'optionalAccess', _584 => _584.type]) === "pixel") },
18892
+ { action: "ungroup", label: "Ungroup", enabled: _optionalChain([active, 'optionalAccess', _583 => _583.type]) === "group" },
18893
+ { action: "merge-down", label: "Merge Down", enabled: Boolean(_optionalChain([active, 'optionalAccess', _584 => _584.visible]) && _optionalChain([below, 'optionalAccess', _585 => _585.type]) === "pixel") },
18757
18894
  { action: "merge-visible", label: "Merge Visible", enabled: s.layers.some((l) => l.visible) },
18758
18895
  { action: "flatten", label: "Flatten Image", enabled: s.layers.length > 0 },
18759
18896
  { action: "via-copy", label: "Layer via Copy", enabled: isPixel && hasSel },
@@ -18763,27 +18900,27 @@ function layerMenu(controller) {
18763
18900
  { action: "add-mask-hide-selection", label: "Add Mask Hiding Selection", enabled: Boolean(active) && hasSel },
18764
18901
  { action: "add-mask-transparency", label: "Add Mask from Transparency", enabled: hasOwnPixels },
18765
18902
  { action: "select-transparency", label: "Select Layer Pixels", enabled: hasOwnPixels },
18766
- { action: "apply-mask", label: "Apply Layer Mask", enabled: isPixel && Boolean(_optionalChain([active, 'optionalAccess', _585 => _585.mask])) },
18767
- { action: "delete-mask", label: "Delete Layer Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _586 => _586.mask])) },
18768
- { action: "toggle-mask", label: _optionalChain([active, 'optionalAccess', _587 => _587.mask, 'optionalAccess', _588 => _588.enabled]) === false ? "Enable Layer Mask" : "Disable Layer Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _589 => _589.mask])) },
18769
- { action: "toggle-mask-link", label: _optionalChain([active, 'optionalAccess', _590 => _590.mask, 'optionalAccess', _591 => _591.linked]) === false ? "Link Layer Mask" : "Unlink Layer Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _592 => _592.mask]) && !active.mask.source) },
18770
- { action: "add-vector-mask", label: "Add Vector Mask (Reveal All)", enabled: Boolean(active && active.type !== "shape" && !_optionalChain([active, 'access', _593 => _593.mask, 'optionalAccess', _594 => _594.source])) },
18771
- { action: "add-vector-mask-hide", label: "Add Vector Mask (Hide All)", enabled: Boolean(active && active.type !== "shape" && !_optionalChain([active, 'access', _595 => _595.mask, 'optionalAccess', _596 => _596.source])) },
18772
- { action: "add-vector-mask-selection", label: "Add Vector Mask from Selection", enabled: Boolean(active && active.type !== "shape" && !_optionalChain([active, 'access', _597 => _597.mask, 'optionalAccess', _598 => _598.source])) && hasSel },
18773
- { action: "delete-vector-mask", label: "Delete Vector Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _599 => _599.vectorMask])) },
18774
- { action: "toggle-vector-mask", label: _optionalChain([active, 'optionalAccess', _600 => _600.vectorMask, 'optionalAccess', _601 => _601.enabled]) === false ? "Enable Vector Mask" : "Disable Vector Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _602 => _602.vectorMask])) },
18775
- { action: "rasterize-vector-mask", label: "Rasterize Vector Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _603 => _603.vectorMask])) },
18776
- { action: "rasterize", label: "Rasterize Layer", enabled: _optionalChain([active, 'optionalAccess', _604 => _604.type]) === "annotation" || _optionalChain([active, 'optionalAccess', _605 => _605.type]) === "smart" || _optionalChain([active, 'optionalAccess', _606 => _606.type]) === "shape" || _optionalChain([active, 'optionalAccess', _607 => _607.type]) === "type" || isPixel && Boolean(_optionalChain([active, 'optionalAccess', _608 => _608.type]) === "pixel" && _optionalChain([active, 'access', _609 => _609.filters, 'optionalAccess', _610 => _610.length])) },
18903
+ { action: "apply-mask", label: "Apply Layer Mask", enabled: isPixel && Boolean(_optionalChain([active, 'optionalAccess', _586 => _586.mask])) },
18904
+ { action: "delete-mask", label: "Delete Layer Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _587 => _587.mask])) },
18905
+ { action: "toggle-mask", label: _optionalChain([active, 'optionalAccess', _588 => _588.mask, 'optionalAccess', _589 => _589.enabled]) === false ? "Enable Layer Mask" : "Disable Layer Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _590 => _590.mask])) },
18906
+ { action: "toggle-mask-link", label: _optionalChain([active, 'optionalAccess', _591 => _591.mask, 'optionalAccess', _592 => _592.linked]) === false ? "Link Layer Mask" : "Unlink Layer Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _593 => _593.mask]) && !active.mask.source) },
18907
+ { action: "add-vector-mask", label: "Add Vector Mask (Reveal All)", enabled: Boolean(active && active.type !== "shape" && !_optionalChain([active, 'access', _594 => _594.mask, 'optionalAccess', _595 => _595.source])) },
18908
+ { action: "add-vector-mask-hide", label: "Add Vector Mask (Hide All)", enabled: Boolean(active && active.type !== "shape" && !_optionalChain([active, 'access', _596 => _596.mask, 'optionalAccess', _597 => _597.source])) },
18909
+ { action: "add-vector-mask-selection", label: "Add Vector Mask from Selection", enabled: Boolean(active && active.type !== "shape" && !_optionalChain([active, 'access', _598 => _598.mask, 'optionalAccess', _599 => _599.source])) && hasSel },
18910
+ { action: "delete-vector-mask", label: "Delete Vector Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _600 => _600.vectorMask])) },
18911
+ { action: "toggle-vector-mask", label: _optionalChain([active, 'optionalAccess', _601 => _601.vectorMask, 'optionalAccess', _602 => _602.enabled]) === false ? "Enable Vector Mask" : "Disable Vector Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _603 => _603.vectorMask])) },
18912
+ { action: "rasterize-vector-mask", label: "Rasterize Vector Mask", enabled: Boolean(_optionalChain([active, 'optionalAccess', _604 => _604.vectorMask])) },
18913
+ { action: "rasterize", label: "Rasterize Layer", enabled: _optionalChain([active, 'optionalAccess', _605 => _605.type]) === "annotation" || _optionalChain([active, 'optionalAccess', _606 => _606.type]) === "smart" || _optionalChain([active, 'optionalAccess', _607 => _607.type]) === "shape" || _optionalChain([active, 'optionalAccess', _608 => _608.type]) === "type" || isPixel && Boolean(_optionalChain([active, 'optionalAccess', _609 => _609.type]) === "pixel" && _optionalChain([active, 'access', _610 => _610.filters, 'optionalAccess', _611 => _611.length])) },
18777
18914
  { action: "convert-smart", label: "Convert to Smart Object", enabled: Boolean(active && active.type !== "annotation") },
18778
- { action: "edit-contents", label: "Edit Contents", enabled: _optionalChain([active, 'optionalAccess', _611 => _611.type]) === "smart" },
18779
- { action: "smart-via-copy", label: "New Smart Object via Copy", enabled: _optionalChain([active, 'optionalAccess', _612 => _612.type]) === "smart" },
18780
- { action: "add-filter-mask", label: "Add Smart Filter Mask", enabled: _optionalChain([active, 'optionalAccess', _613 => _613.type]) === "smart" && !_optionalChain([active, 'access', _614 => _614.smartFilters, 'optionalAccess', _615 => _615.mask]) },
18781
- { action: "toggle-clip", label: _optionalChain([active, 'optionalAccess', _616 => _616.clipped]) ? "Release Clipping Mask" : "Create Clipping Mask", enabled: Boolean(loc && loc.index > 0) }
18915
+ { action: "edit-contents", label: "Edit Contents", enabled: _optionalChain([active, 'optionalAccess', _612 => _612.type]) === "smart" },
18916
+ { action: "smart-via-copy", label: "New Smart Object via Copy", enabled: _optionalChain([active, 'optionalAccess', _613 => _613.type]) === "smart" },
18917
+ { action: "add-filter-mask", label: "Add Smart Filter Mask", enabled: _optionalChain([active, 'optionalAccess', _614 => _614.type]) === "smart" && !_optionalChain([active, 'access', _615 => _615.smartFilters, 'optionalAccess', _616 => _616.mask]) },
18918
+ { action: "toggle-clip", label: _optionalChain([active, 'optionalAccess', _617 => _617.clipped]) ? "Release Clipping Mask" : "Create Clipping Mask", enabled: Boolean(loc && loc.index > 0) }
18782
18919
  ];
18783
18920
  }
18784
18921
  async function runLayerMenuAction(controller, action) {
18785
18922
  const active = controller.getActiveLayer();
18786
- const id = _optionalChain([active, 'optionalAccess', _617 => _617.id]);
18923
+ const id = _optionalChain([active, 'optionalAccess', _618 => _618.id]);
18787
18924
  try {
18788
18925
  switch (action) {
18789
18926
  case "new-layer":
@@ -18839,10 +18976,10 @@ async function runLayerMenuAction(controller, action) {
18839
18976
  if (id) controller.removeLayerMask(id);
18840
18977
  break;
18841
18978
  case "toggle-mask":
18842
- if (id && _optionalChain([active, 'optionalAccess', _618 => _618.mask])) controller.setLayerMaskProps(id, { enabled: active.mask.enabled === false });
18979
+ if (id && _optionalChain([active, 'optionalAccess', _619 => _619.mask])) controller.setLayerMaskProps(id, { enabled: active.mask.enabled === false });
18843
18980
  break;
18844
18981
  case "toggle-mask-link":
18845
- if (id && _optionalChain([active, 'optionalAccess', _619 => _619.mask])) controller.setLayerMaskProps(id, { linked: active.mask.linked === false });
18982
+ if (id && _optionalChain([active, 'optionalAccess', _620 => _620.mask])) controller.setLayerMaskProps(id, { linked: active.mask.linked === false });
18846
18983
  break;
18847
18984
  case "add-vector-mask":
18848
18985
  case "add-vector-mask-hide":
@@ -18855,7 +18992,7 @@ async function runLayerMenuAction(controller, action) {
18855
18992
  if (id) controller.removeVectorMask(id);
18856
18993
  break;
18857
18994
  case "toggle-vector-mask":
18858
- if (id && _optionalChain([active, 'optionalAccess', _620 => _620.vectorMask])) controller.setVectorMaskProps(id, { enabled: active.vectorMask.enabled === false });
18995
+ if (id && _optionalChain([active, 'optionalAccess', _621 => _621.vectorMask])) controller.setVectorMaskProps(id, { enabled: active.vectorMask.enabled === false });
18859
18996
  break;
18860
18997
  case "rasterize-vector-mask":
18861
18998
  if (id) controller.rasterizeVectorMask(id);
@@ -18876,7 +19013,7 @@ async function runLayerMenuAction(controller, action) {
18876
19013
  if (id) controller.setSmartFilterMask(id, "reveal-all");
18877
19014
  break;
18878
19015
  case "toggle-clip":
18879
- if (id) controller.setLayerProperties(id, { clipped: !_optionalChain([active, 'optionalAccess', _621 => _621.clipped]) });
19016
+ if (id) controller.setLayerProperties(id, { clipped: !_optionalChain([active, 'optionalAccess', _622 => _622.clipped]) });
18880
19017
  break;
18881
19018
  }
18882
19019
  return null;
@@ -18886,7 +19023,7 @@ async function runLayerMenuAction(controller, action) {
18886
19023
  }
18887
19024
  function smartFilterRows(layer) {
18888
19025
  if (layer.type !== "smart") return [];
18889
- const list = _nullishCoalesce(_optionalChain([layer, 'access', _622 => _622.smartFilters, 'optionalAccess', _623 => _623.filters]), () => ( []));
19026
+ const list = _nullishCoalesce(_optionalChain([layer, 'access', _623 => _623.smartFilters, 'optionalAccess', _624 => _624.filters]), () => ( []));
18890
19027
  const rows = list.map((f, index) => ({
18891
19028
  filter: f,
18892
19029
  index,
@@ -18912,8 +19049,8 @@ function extractNormalizedLayerItems(controller, fallbackImageUrl = "") {
18912
19049
  };
18913
19050
  collectSerialized(_nullishCoalesce(serialized.layers, () => ( [])));
18914
19051
  const sLayerMap = new Map(allSerializedLayers.map((sl) => [sl.id, sl]));
18915
- const imgW = _optionalChain([state, 'access', _624 => _624.imageDimensions, 'optionalAccess', _625 => _625.width]) || 1;
18916
- const imgH = _optionalChain([state, 'access', _626 => _626.imageDimensions, 'optionalAccess', _627 => _627.height]) || 1;
19052
+ const imgW = _optionalChain([state, 'access', _625 => _625.imageDimensions, 'optionalAccess', _626 => _626.width]) || 1;
19053
+ const imgH = _optionalChain([state, 'access', _627 => _627.imageDimensions, 'optionalAccess', _628 => _628.height]) || 1;
18917
19054
  return ctrlLayers.map((l) => {
18918
19055
  const bounds = controller.getLayerBounds(l.id) || {
18919
19056
  x: 0,
@@ -18922,8 +19059,8 @@ function extractNormalizedLayerItems(controller, fallbackImageUrl = "") {
18922
19059
  height: imgH
18923
19060
  };
18924
19061
  const sLayer = sLayerMap.get(l.id);
18925
- const assetKey = _optionalChain([sLayer, 'optionalAccess', _628 => _628.asset]);
18926
- const layerDataUrl = assetKey && assets[assetKey] || assets[l.id] || (_optionalChain([sLayer, 'optionalAccess', _629 => _629.source]) === "document" ? fallbackImageUrl : "");
19062
+ const assetKey = _optionalChain([sLayer, 'optionalAccess', _629 => _629.asset]);
19063
+ const layerDataUrl = assetKey && assets[assetKey] || assets[l.id] || (_optionalChain([sLayer, 'optionalAccess', _630 => _630.source]) === "document" ? fallbackImageUrl : "");
18927
19064
  return {
18928
19065
  id: l.id,
18929
19066
  name: l.name || "Untitled Layer",
@@ -18977,9 +19114,9 @@ async function addLayerOfKind(controller, id, init) {
18977
19114
  const cx = Math.round(canvas.width / 2);
18978
19115
  const cy = Math.round(canvas.height / 2);
18979
19116
  return controller.addTextLayer({
18980
- text: _optionalChain([init, 'optionalAccess', _630 => _630.text]) || "New Text",
18981
- x: typeof _optionalChain([init, 'optionalAccess', _631 => _631.x]) === "number" ? init.x : cx - 100,
18982
- y: typeof _optionalChain([init, 'optionalAccess', _632 => _632.y]) === "number" ? init.y : cy,
19117
+ text: _optionalChain([init, 'optionalAccess', _631 => _631.text]) || "New Text",
19118
+ x: typeof _optionalChain([init, 'optionalAccess', _632 => _632.x]) === "number" ? init.x : cx - 100,
19119
+ y: typeof _optionalChain([init, 'optionalAccess', _633 => _633.y]) === "number" ? init.y : cy,
18983
19120
  ...init
18984
19121
  });
18985
19122
  }
@@ -18992,10 +19129,10 @@ async function addLayerOfKind(controller, id, init) {
18992
19129
  return controller.addShapeLayer({
18993
19130
  shape: {
18994
19131
  kind: "rect",
18995
- x: typeof _optionalChain([init, 'optionalAccess', _633 => _633.x]) === "number" ? init.x : cx - Math.round(w / 2),
18996
- y: typeof _optionalChain([init, 'optionalAccess', _634 => _634.y]) === "number" ? init.y : cy - Math.round(h / 2),
18997
- width: typeof _optionalChain([init, 'optionalAccess', _635 => _635.width]) === "number" ? init.width : w,
18998
- height: typeof _optionalChain([init, 'optionalAccess', _636 => _636.height]) === "number" ? init.height : h
19132
+ x: typeof _optionalChain([init, 'optionalAccess', _634 => _634.x]) === "number" ? init.x : cx - Math.round(w / 2),
19133
+ y: typeof _optionalChain([init, 'optionalAccess', _635 => _635.y]) === "number" ? init.y : cy - Math.round(h / 2),
19134
+ width: typeof _optionalChain([init, 'optionalAccess', _636 => _636.width]) === "number" ? init.width : w,
19135
+ height: typeof _optionalChain([init, 'optionalAccess', _637 => _637.height]) === "number" ? init.height : h
18999
19136
  },
19000
19137
  name: "Rectangle",
19001
19138
  ...init
@@ -19010,10 +19147,10 @@ async function addLayerOfKind(controller, id, init) {
19010
19147
  return controller.addShapeLayer({
19011
19148
  shape: {
19012
19149
  kind: "ellipse",
19013
- x: typeof _optionalChain([init, 'optionalAccess', _637 => _637.x]) === "number" ? init.x : cx - Math.round(w / 2),
19014
- y: typeof _optionalChain([init, 'optionalAccess', _638 => _638.y]) === "number" ? init.y : cy - Math.round(h / 2),
19015
- width: typeof _optionalChain([init, 'optionalAccess', _639 => _639.width]) === "number" ? init.width : w,
19016
- height: typeof _optionalChain([init, 'optionalAccess', _640 => _640.height]) === "number" ? init.height : h
19150
+ x: typeof _optionalChain([init, 'optionalAccess', _638 => _638.x]) === "number" ? init.x : cx - Math.round(w / 2),
19151
+ y: typeof _optionalChain([init, 'optionalAccess', _639 => _639.y]) === "number" ? init.y : cy - Math.round(h / 2),
19152
+ width: typeof _optionalChain([init, 'optionalAccess', _640 => _640.width]) === "number" ? init.width : w,
19153
+ height: typeof _optionalChain([init, 'optionalAccess', _641 => _641.height]) === "number" ? init.height : h
19017
19154
  },
19018
19155
  name: "Ellipse",
19019
19156
  ...init
@@ -19074,18 +19211,18 @@ function layerEffectsPanel(layer) {
19074
19211
  if (!layer) return { ...empty, available: false, reason: "Select a layer to add a layer style." };
19075
19212
  if (layer.type === "adjustment") return { ...empty, available: false, reason: "Adjustment layers cannot have a layer style." };
19076
19213
  const fx = layer.effects;
19077
- const readOnly = Boolean(_optionalChain([layer, 'access', _641 => _641.locks, 'optionalAccess', _642 => _642.all]));
19214
+ const readOnly = Boolean(_optionalChain([layer, 'access', _642 => _642.locks, 'optionalAccess', _643 => _643.all]));
19078
19215
  return {
19079
19216
  available: true,
19080
19217
  readOnly,
19081
19218
  reason: readOnly ? "The layer is locked; unlock it to change its layer style." : void 0,
19082
- enabled: _nullishCoalesce(_optionalChain([fx, 'optionalAccess', _643 => _643.enabled]), () => ( true)),
19083
- scale: _nullishCoalesce(_optionalChain([fx, 'optionalAccess', _644 => _644.scale]), () => ( 1)),
19084
- rows: (_nullishCoalesce(_optionalChain([fx, 'optionalAccess', _645 => _645.items]), () => ( []))).map((e) => ({ id: e.id, kind: e.kind, label: _chunkUOGKSVRQcjs.layerEffectLabel.call(void 0, e.kind), enabled: e.enabled }))
19219
+ enabled: _nullishCoalesce(_optionalChain([fx, 'optionalAccess', _644 => _644.enabled]), () => ( true)),
19220
+ scale: _nullishCoalesce(_optionalChain([fx, 'optionalAccess', _645 => _645.scale]), () => ( 1)),
19221
+ rows: (_nullishCoalesce(_optionalChain([fx, 'optionalAccess', _646 => _646.items]), () => ( []))).map((e) => ({ id: e.id, kind: e.kind, label: _chunkUOGKSVRQcjs.layerEffectLabel.call(void 0, e.kind), enabled: e.enabled }))
19085
19222
  };
19086
19223
  }
19087
19224
  function layerEffectsBadge(layer) {
19088
- if (!_optionalChain([layer, 'access', _646 => _646.effects, 'optionalAccess', _647 => _647.items, 'access', _648 => _648.length])) return null;
19225
+ if (!_optionalChain([layer, 'access', _647 => _647.effects, 'optionalAccess', _648 => _648.items, 'access', _649 => _649.length])) return null;
19089
19226
  return _chunkUOGKSVRQcjs.hasActiveEffects.call(void 0, layer.effects) ? "on" : "off";
19090
19227
  }
19091
19228
  var LAYER_EFFECT_MENU = _chunkUOGKSVRQcjs.LAYER_EFFECT_KINDS.map((kind) => ({ kind, label: _chunkUOGKSVRQcjs.layerEffectLabel.call(void 0, kind) }));
@@ -19130,8 +19267,8 @@ function fillControls(f, allowPattern, patterns) {
19130
19267
  }
19131
19268
  function gradientControls(prefix, g) {
19132
19269
  return [
19133
- { key: `${prefix}.stops.0.color`, label: "Start colour", type: "color", value: _nullishCoalesce(_optionalChain([g, 'access', _649 => _649.stops, 'access', _650 => _650[0], 'optionalAccess', _651 => _651.color]), () => ( "#000000")) },
19134
- { key: `${prefix}.stops.last.color`, label: "End colour", type: "color", value: _nullishCoalesce(_optionalChain([g, 'access', _652 => _652.stops, 'access', _653 => _653[g.stops.length - 1], 'optionalAccess', _654 => _654.color]), () => ( "#ffffff")) },
19270
+ { key: `${prefix}.stops.0.color`, label: "Start colour", type: "color", value: _nullishCoalesce(_optionalChain([g, 'access', _650 => _650.stops, 'access', _651 => _651[0], 'optionalAccess', _652 => _652.color]), () => ( "#000000")) },
19271
+ { key: `${prefix}.stops.last.color`, label: "End colour", type: "color", value: _nullishCoalesce(_optionalChain([g, 'access', _653 => _653.stops, 'access', _654 => _654[g.stops.length - 1], 'optionalAccess', _655 => _655.color]), () => ( "#ffffff")) },
19135
19272
  { key: `${prefix}.style`, label: "Style", type: "select", value: g.style, options: opt(["linear", "Linear"], ["radial", "Radial"], ["angle", "Angle"], ["reflected", "Reflected"], ["diamond", "Diamond"]) },
19136
19273
  { key: `${prefix}.angle`, label: "Angle", type: "range", min: -180, max: 180, step: 1, value: g.angle, unit: "\xB0" },
19137
19274
  { key: `${prefix}.scale`, label: "Scale", type: "range", min: 0.1, max: 1.5, step: 0.01, value: g.scale, percent: true, unit: "%" },
@@ -19139,9 +19276,9 @@ function gradientControls(prefix, g) {
19139
19276
  { key: `${prefix}.align`, label: "Align with layer", type: "checkbox", value: g.align }
19140
19277
  ];
19141
19278
  }
19142
- var px = (key, label, value, max = 250) => ({ key, label, type: "range", min: 0, max, step: 1, value, unit: "px" });
19143
- var pct = (key, label, value, min = 0, max = 1) => ({ key, label, type: "range", min, max, step: 0.01, value, percent: true, unit: "%" });
19144
- var deg = (key, label, value, min = -180, max = 180) => ({ key, label, type: "range", min, max, step: 1, value, unit: "\xB0" });
19279
+ var px = (key2, label, value, max = 250) => ({ key: key2, label, type: "range", min: 0, max, step: 1, value, unit: "px" });
19280
+ var pct = (key2, label, value, min = 0, max = 1) => ({ key: key2, label, type: "range", min, max, step: 0.01, value, percent: true, unit: "%" });
19281
+ var deg = (key2, label, value, min = -180, max = 180) => ({ key: key2, label, type: "range", min, max, step: 1, value, unit: "\xB0" });
19145
19282
  function layerEffectControls(e, patterns = []) {
19146
19283
  const blended = e.kind === "bevel-emboss" ? [] : [
19147
19284
  { key: "blend", label: "Blend mode", type: "select", value: e.blend, options: BLENDS },
@@ -19223,19 +19360,19 @@ function layerEffectControls(e, patterns = []) {
19223
19360
  }
19224
19361
  function fillOfType(current, type, patterns) {
19225
19362
  if (type === "gradient") return { type: "gradient", gradient: _chunkUOGKSVRQcjs.defaultEffectGradient.call(void 0, ) };
19226
- if (type === "pattern") return { type: "pattern", patternId: _nullishCoalesce(_optionalChain([patterns, 'access', _655 => _655[0], 'optionalAccess', _656 => _656.id]), () => ( "checker")), scale: 1 };
19363
+ if (type === "pattern") return { type: "pattern", patternId: _nullishCoalesce(_optionalChain([patterns, 'access', _656 => _656[0], 'optionalAccess', _657 => _657.id]), () => ( "checker")), scale: 1 };
19227
19364
  return { type: "color", color: current.type === "color" ? current.color : "#000000" };
19228
19365
  }
19229
- function effectControlChange(effect, key, value, patterns = []) {
19230
- const [top, ...rest] = key.split(".");
19366
+ function effectControlChange(effect, key2, value, patterns = []) {
19367
+ const [top, ...rest] = key2.split(".");
19231
19368
  if (top === "fill" && rest[0] === "type") return { fill: fillOfType(effect.fill, String(value), patterns) };
19232
19369
  if (top === "patternId" && !rest.length) {
19233
- const name = _optionalChain([patternOptions, 'call', _657 => _657(patterns), 'access', _658 => _658.find, 'call', _659 => _659((o) => o.value === value), 'optionalAccess', _660 => _660.label]);
19370
+ const name = _optionalChain([patternOptions, 'call', _658 => _658(patterns), 'access', _659 => _659.find, 'call', _660 => _660((o) => o.value === value), 'optionalAccess', _661 => _661.label]);
19234
19371
  return name ? { patternId: value, name } : { patternId: value };
19235
19372
  }
19236
19373
  if (!rest.length) return { [top]: value };
19237
19374
  if (top === "fill" && rest[0] === "patternId") {
19238
- const name = _optionalChain([patternOptions, 'call', _661 => _661(patterns), 'access', _662 => _662.find, 'call', _663 => _663((o) => o.value === value), 'optionalAccess', _664 => _664.label]);
19375
+ const name = _optionalChain([patternOptions, 'call', _662 => _662(patterns), 'access', _663 => _663.find, 'call', _664 => _664((o) => o.value === value), 'optionalAccess', _665 => _665.label]);
19239
19376
  return { fill: { ...effect.fill, patternId: value, ...name ? { name } : {} } };
19240
19377
  }
19241
19378
  return { [top]: setPath(getPath(effect, top), rest, value) };
@@ -19262,7 +19399,7 @@ function colorPanelView(controller) {
19262
19399
  profileName: profile.name,
19263
19400
  workingSpace: profile.builtin,
19264
19401
  mode: profile.mode,
19265
- cmykProfileName: _nullishCoalesce(_optionalChain([profile, 'access', _665 => _665.cmykProfile, 'optionalAccess', _666 => _666.name]), () => ( null)),
19402
+ cmykProfileName: _nullishCoalesce(_optionalChain([profile, 'access', _666 => _666.cmykProfile, 'optionalAccess', _667 => _667.name]), () => ( null)),
19266
19403
  proof: proof ? { id: _nullishCoalesce(proof.profile.builtin, () => ( null)), name: proof.profile.name, intent: proof.intent, simulatePaper: proof.simulatePaper, gamutWarning: proof.gamutWarning, bpc: proof.bpc } : null
19267
19404
  };
19268
19405
  }
@@ -19470,7 +19607,7 @@ var FreeTransformTool = (_class16 = class {
19470
19607
  __init146() {this.error = null}
19471
19608
  __init147() {this.lastResult = null}
19472
19609
  get active() {
19473
- return Boolean(_optionalChain([this, 'access', _667 => _667.sessionRef, 'optionalAccess', _668 => _668.isOpen]));
19610
+ return Boolean(_optionalChain([this, 'access', _668 => _668.sessionRef, 'optionalAccess', _669 => _669.isOpen]));
19474
19611
  }
19475
19612
  get session() {
19476
19613
  return this.active ? this.sessionRef : null;
@@ -19479,7 +19616,7 @@ var FreeTransformTool = (_class16 = class {
19479
19616
  return this.modeValue;
19480
19617
  }
19481
19618
  get interpolation() {
19482
- return _nullishCoalesce(_optionalChain([this, 'access', _669 => _669.sessionRef, 'optionalAccess', _670 => _670.interpolation]), () => ( "bicubic"));
19619
+ return _nullishCoalesce(_optionalChain([this, 'access', _670 => _670.sessionRef, 'optionalAccess', _671 => _671.interpolation]), () => ( "bicubic"));
19483
19620
  }
19484
19621
  /** Whether the open transform has changed anything yet (a commit would add an undo step). */
19485
19622
  get modified() {
@@ -19498,7 +19635,7 @@ var FreeTransformTool = (_class16 = class {
19498
19635
  };
19499
19636
  }
19500
19637
  changed() {
19501
- _optionalChain([this, 'access', _671 => _671.options, 'access', _672 => _672.onChange, 'optionalCall', _673 => _673()]);
19638
+ _optionalChain([this, 'access', _672 => _672.options, 'access', _673 => _673.onChange, 'optionalCall', _674 => _674()]);
19502
19639
  for (const l of this.listeners) l();
19503
19640
  }
19504
19641
  /** Opens a Free Transform (default: the selected pixels of the active layer, or the whole layer). Returns an error message or `null`. */
@@ -19891,7 +20028,7 @@ var FreeTransformTool = (_class16 = class {
19891
20028
  }
19892
20029
  /** Abandons the transform and restores everything. */
19893
20030
  cancel() {
19894
- _optionalChain([this, 'access', _674 => _674.sessionRef, 'optionalAccess', _675 => _675.cancel, 'call', _676 => _676()]);
20031
+ _optionalChain([this, 'access', _675 => _675.sessionRef, 'optionalAccess', _676 => _676.cancel, 'call', _677 => _677()]);
19895
20032
  this.sessionRef = null;
19896
20033
  this.corners = null;
19897
20034
  this.mesh = null;
@@ -19947,7 +20084,7 @@ function imageLayerAppliedEffects(layer) {
19947
20084
  const ref = (r) => ({ effect: r.effect, ...r.name ? { name: r.name } : {}, ...r.provider ? { provider: r.provider } : {} });
19948
20085
  if (layer.type === "pixel" && layer.generator) out.push({ id: "generator", ...ref(layer.generator), role: "effect layer", enabled: true, values: layer.generator.values, ...layer.generator.time ? { time: layer.generator.time } : {}, ...layer.generator.animate ? { animate: layer.generator.animate } : {} });
19949
20086
  if (layer.type === "smart")
19950
- (_nullishCoalesce(_optionalChain([layer, 'access', _677 => _677.smartFilters, 'optionalAccess', _678 => _678.filters]), () => ( []))).forEach((f, index) => {
20087
+ (_nullishCoalesce(_optionalChain([layer, 'access', _678 => _678.smartFilters, 'optionalAccess', _679 => _679.filters]), () => ( []))).forEach((f, index) => {
19951
20088
  if (f.kind === "effect") out.push({ id: f.id, ...ref(f), role: "smart filter", enabled: f.enabled && layer.smartFilters.enabled, opacity: f.opacity, blend: f.blend, values: f.values, index });
19952
20089
  });
19953
20090
  return out;
@@ -20079,7 +20216,9 @@ var IMAGE_TOOL_GROUPS = [
20079
20216
  { id: "focus", label: "Blur & Sharpen", tools: ["blur", "sharpen", "smudge"] },
20080
20217
  { id: "tone", label: "Dodge & Burn", tools: ["dodge", "burn", "sponge"] },
20081
20218
  { id: "shape", label: "Shape", tools: ["shape"] },
20219
+ { id: "pen", label: "Pen", tools: ["path-pen"] },
20082
20220
  { id: "type", label: "Type", tools: ["type"] },
20221
+ { id: "path-select", label: "Path Selection", tools: ["path-select", "direct-select"] },
20083
20222
  { id: "annotate", label: "Annotate", tools: ["pen", "line", "arrow", "rect", "circle"] }
20084
20223
  ];
20085
20224
  function imageToolGroup(tool) {
@@ -20090,7 +20229,10 @@ var OTHER_TOOL_LABELS = {
20090
20229
  crop: "Crop",
20091
20230
  shape: "Shape",
20092
20231
  type: "Type",
20093
- pen: "Pen",
20232
+ "path-pen": "Pen",
20233
+ "path-select": "Path Selection",
20234
+ "direct-select": "Direct Selection",
20235
+ pen: "Freehand",
20094
20236
  line: "Line",
20095
20237
  arrow: "Arrow",
20096
20238
  rect: "Rectangle",
@@ -20099,17 +20241,20 @@ var OTHER_TOOL_LABELS = {
20099
20241
  watermark: "Watermark"
20100
20242
  };
20101
20243
  function imageToolLabel(tool) {
20102
- return _nullishCoalesce(_nullishCoalesce(_optionalChain([PAINT_TOOLS, 'access', _679 => _679.find, 'call', _680 => _680((t) => t.id === tool), 'optionalAccess', _681 => _681.label]), () => ( OTHER_TOOL_LABELS[tool])), () => ( tool));
20244
+ return _nullishCoalesce(_nullishCoalesce(_optionalChain([PAINT_TOOLS, 'access', _680 => _680.find, 'call', _681 => _681((t) => t.id === tool), 'optionalAccess', _682 => _682.label]), () => ( OTHER_TOOL_LABELS[tool])), () => ( tool));
20103
20245
  }
20104
20246
  var IMAGE_TOOL_SHORTCUTS = {
20105
20247
  ...Object.fromEntries(PAINT_TOOLS.filter((t) => t.shortcut).map((t) => [t.id, t.shortcut])),
20106
20248
  select: "M",
20107
20249
  crop: "C",
20108
20250
  shape: "U",
20109
- type: "T"
20251
+ type: "T",
20252
+ "path-pen": "P",
20253
+ "path-select": "A",
20254
+ "direct-select": "Shift+A"
20110
20255
  };
20111
- function imageToolForShortcut(key, shift = false) {
20112
- const shortcut = `${shift ? "Shift+" : ""}${key.toUpperCase()}`;
20256
+ function imageToolForShortcut(key2, shift = false) {
20257
+ const shortcut = `${shift ? "Shift+" : ""}${key2.toUpperCase()}`;
20113
20258
  for (const group of IMAGE_TOOL_GROUPS) {
20114
20259
  for (const tool of group.tools) if (IMAGE_TOOL_SHORTCUTS[tool] === shortcut) return tool;
20115
20260
  }
@@ -20166,6 +20311,422 @@ function createImageEditorDocument(controller, options = {}) {
20166
20311
  });
20167
20312
  }
20168
20313
 
20314
+ // src/image-editor/path-edit.ts
20315
+ var PATH_EDIT_TOOLS = ["path-select", "direct-select", "path-pen"];
20316
+ function isPathEditTool(tool) {
20317
+ return PATH_EDIT_TOOLS.includes(tool);
20318
+ }
20319
+ var key = (r) => `${r.component}:${r.subpath}:${r.anchor}`;
20320
+ var parseKey = (k) => {
20321
+ const [component, subpath, anchor] = k.split(":").map(Number);
20322
+ return { component, subpath, anchor };
20323
+ };
20324
+ var pt = (p) => ({ x: p.x, y: p.y });
20325
+ var cloneComponents = (cs) => cs.map((c) => ({ op: c.op, subpaths: c.subpaths.map((sp) => ({ anchors: sp.anchors.map(_chunkQAUIZPYIcjs.cloneAnchor), closed: sp.closed })), ...c.live ? { live: c.live } : {} }));
20326
+ var sameTarget = (a, b) => !!a && !!b && a.kind === b.kind && (a.kind === "path" ? a.id === b.id : a.layerId === b.layerId);
20327
+ var PathEditGesture = (_class17 = class {
20328
+ constructor(controller) {;_class17.prototype.__init149.call(this);_class17.prototype.__init150.call(this);_class17.prototype.__init151.call(this);_class17.prototype.__init152.call(this);_class17.prototype.__init153.call(this);_class17.prototype.__init154.call(this);_class17.prototype.__init155.call(this);
20329
+ this.controller = controller;
20330
+ }
20331
+
20332
+ /** Selected anchors, as `component:subpath:anchor` keys. */
20333
+ __init149() {this.selected = /* @__PURE__ */ new Set()}
20334
+ __init150() {this.target = null}
20335
+ __init151() {this.drag = null}
20336
+ /** The Pen's open subpath being drawn. */
20337
+ __init152() {this.drawing = null}
20338
+ __init153() {this.pointer = null}
20339
+ __init154() {this.scale = 1}
20340
+ __init155() {this.error = null}
20341
+ /** Screen pixels per document pixel (the viewport projection's scale). */
20342
+ setView(scale) {
20343
+ if (scale > 0 && Number.isFinite(scale)) this.scale = scale;
20344
+ }
20345
+ get active() {
20346
+ return this.drag !== null;
20347
+ }
20348
+ /** The anchors selected now (on the current target). */
20349
+ get selection() {
20350
+ return [...this.selected].map(parseKey);
20351
+ }
20352
+ /** True while the Pen has an open subpath it adds to. */
20353
+ get isDrawing() {
20354
+ return this.drawing !== null;
20355
+ }
20356
+ get tolerance() {
20357
+ return 6 / this.scale;
20358
+ }
20359
+ /** The target's components, or null (and the selection dropped) when the target changed or is gone. */
20360
+ components() {
20361
+ const target = this.controller.pathEditTarget();
20362
+ if (!sameTarget(target, this.target)) {
20363
+ this.target = target;
20364
+ this.selected.clear();
20365
+ this.drawing = null;
20366
+ }
20367
+ if (!target) return null;
20368
+ let cs;
20369
+ try {
20370
+ cs = this.controller.getPathEditComponents(target);
20371
+ } catch (e39) {
20372
+ return null;
20373
+ }
20374
+ for (const k of [...this.selected]) {
20375
+ const r = parseKey(k);
20376
+ if (!_optionalChain([cs, 'access', _683 => _683[r.component], 'optionalAccess', _684 => _684.subpaths, 'access', _685 => _685[r.subpath], 'optionalAccess', _686 => _686.anchors, 'access', _687 => _687[r.anchor]])) this.selected.delete(k);
20377
+ }
20378
+ const d = this.drawing;
20379
+ if (d && (!_optionalChain([cs, 'access', _688 => _688[d.component], 'optionalAccess', _689 => _689.subpaths, 'access', _690 => _690[d.subpath]]) || cs[d.component].subpaths[d.subpath].closed)) this.drawing = null;
20380
+ return cs;
20381
+ }
20382
+ anchorAt(cs, p) {
20383
+ const tol = this.tolerance;
20384
+ let best = null;
20385
+ let bestD = tol;
20386
+ cs.forEach(
20387
+ (c, ci) => c.subpaths.forEach(
20388
+ (sp, si) => sp.anchors.forEach((a, ai) => {
20389
+ const d = Math.hypot(a.x - p.x, a.y - p.y);
20390
+ if (d <= bestD) {
20391
+ bestD = d;
20392
+ best = { component: ci, subpath: si, anchor: ai };
20393
+ }
20394
+ })
20395
+ )
20396
+ );
20397
+ return best;
20398
+ }
20399
+ /** A handle of a selected anchor near `p`. */
20400
+ handleAt(cs, p) {
20401
+ const tol = this.tolerance;
20402
+ for (const r of this.selection) {
20403
+ const a = cs[r.component].subpaths[r.subpath].anchors[r.anchor];
20404
+ for (const side of ["out", "in"]) {
20405
+ const h = a[side];
20406
+ if (h && Math.hypot(h.x - p.x, h.y - p.y) <= tol) return { ref: r, side };
20407
+ }
20408
+ }
20409
+ return null;
20410
+ }
20411
+ /** The segment near `p`: its first anchor (as `anchor`) and the parameter on it. */
20412
+ segmentAt(cs, p) {
20413
+ let best = null;
20414
+ let bestD = this.tolerance;
20415
+ cs.forEach(
20416
+ (c, ci) => c.subpaths.forEach((sp, si) => {
20417
+ for (let i = 0; i < _chunkQAUIZPYIcjs.subpathSegmentCount.call(void 0, sp); i++) {
20418
+ const { t, distance } = _chunkGF2RBSDMcjs.segmentNearest.call(void 0, _chunkQAUIZPYIcjs.subpathSegment.call(void 0, sp, i), [p.x, p.y]);
20419
+ if (distance <= bestD) {
20420
+ bestD = distance;
20421
+ best = { ref: { component: ci, subpath: si, anchor: i }, t };
20422
+ }
20423
+ }
20424
+ })
20425
+ );
20426
+ return best;
20427
+ }
20428
+ /** The component under `p`: on its outline, or inside its fill. */
20429
+ componentAt(cs, p) {
20430
+ const seg = _nullishCoalesce(this.segmentAt(cs, p), () => ( (this.anchorAt(cs, p) ? { ref: this.anchorAt(cs, p) } : null)));
20431
+ if (seg) return seg.ref.component;
20432
+ for (let i = cs.length - 1; i >= 0; i--) {
20433
+ const closed = cs[i].subpaths.filter((sp) => sp.anchors.length > 2);
20434
+ if (closed.length && _chunkGF2RBSDMcjs.pointInBezierPath.call(void 0, _chunkQAUIZPYIcjs.subpathsToBezier.call(void 0, closed), [p.x, p.y])) return i;
20435
+ }
20436
+ return null;
20437
+ }
20438
+ selectComponent(cs, ci) {
20439
+ cs[ci].subpaths.forEach((sp, si) => sp.anchors.forEach((_, ai) => this.selected.add(key({ component: ci, subpath: si, anchor: ai }))));
20440
+ }
20441
+ commit(cs, record) {
20442
+ if (!this.target) return false;
20443
+ try {
20444
+ this.controller.setPathEditComponents(this.target, cs, record);
20445
+ return true;
20446
+ } catch (e) {
20447
+ this.error = e instanceof Error ? e.message : String(e);
20448
+ return false;
20449
+ }
20450
+ }
20451
+ down(p, tool, mods = {}) {
20452
+ this.error = null;
20453
+ this.pointer = pt(p);
20454
+ const cs = this.components();
20455
+ if (tool === "path-pen") return this.penDown(cs, p, mods);
20456
+ if (!cs) {
20457
+ this.error = "There is no path to edit: pick a path in the Paths panel, a shape layer, or a layer with a vector mask (or draw one with the Pen).";
20458
+ return;
20459
+ }
20460
+ if (tool === "path-select") {
20461
+ const ci = this.componentAt(cs, p);
20462
+ if (ci === null) {
20463
+ this.drag = { kind: "marquee", start: pt(p), end: pt(p), keep: mods.shift ? new Set(this.selected) : /* @__PURE__ */ new Set() };
20464
+ if (!mods.shift) this.selected.clear();
20465
+ return;
20466
+ }
20467
+ const ref = { component: ci, subpath: 0, anchor: 0 };
20468
+ if (!mods.shift && !this.selected.has(key(ref))) this.selected.clear();
20469
+ this.selectComponent(cs, ci);
20470
+ this.drag = { kind: "anchors", start: pt(p), base: cloneComponents(cs), moved: false };
20471
+ return;
20472
+ }
20473
+ const handle = this.handleAt(cs, p);
20474
+ if (handle) {
20475
+ this.drag = { kind: "handle", ...handle, base: cloneComponents(cs), breakHandles: !!mods.alt, moved: false };
20476
+ return;
20477
+ }
20478
+ const anchor = this.anchorAt(cs, p);
20479
+ if (anchor) {
20480
+ if (mods.alt) return this.convert(cs, anchor);
20481
+ const k = key(anchor);
20482
+ if (mods.shift) {
20483
+ if (this.selected.has(k)) this.selected.delete(k);
20484
+ else this.selected.add(k);
20485
+ } else if (!this.selected.has(k)) {
20486
+ this.selected.clear();
20487
+ this.selected.add(k);
20488
+ }
20489
+ this.drag = { kind: "anchors", start: pt(p), base: cloneComponents(cs), moved: false };
20490
+ return;
20491
+ }
20492
+ const seg = this.segmentAt(cs, p);
20493
+ if (seg) {
20494
+ if (!mods.shift) this.selected.clear();
20495
+ this.drag = { kind: "segment", ...seg, base: cloneComponents(cs), moved: false };
20496
+ return;
20497
+ }
20498
+ this.drag = { kind: "marquee", start: pt(p), end: pt(p), keep: mods.shift ? new Set(this.selected) : /* @__PURE__ */ new Set() };
20499
+ if (!mods.shift) this.selected.clear();
20500
+ }
20501
+ /** Alt-click: a corner anchor becomes smooth, a smooth one a corner (one undo step). */
20502
+ convert(cs, r) {
20503
+ const next = cloneComponents(cs);
20504
+ const c = next[r.component];
20505
+ const sp = c.subpaths[r.subpath];
20506
+ const a = sp.anchors[r.anchor];
20507
+ const type = _chunkQAUIZPYIcjs.inferAnchorType.call(void 0, a) === "corner" && !a.in && !a.out ? "smooth" : "corner";
20508
+ c.subpaths[r.subpath] = _chunkQAUIZPYIcjs.convertAnchor.call(void 0, sp, r.anchor, type);
20509
+ delete c.live;
20510
+ this.selected.clear();
20511
+ this.selected.add(key(r));
20512
+ this.commit(next, true);
20513
+ }
20514
+ penDown(cs, p, mods) {
20515
+ const d = this.drawing;
20516
+ if (cs && d) {
20517
+ const next = cloneComponents(cs);
20518
+ const c = next[d.component];
20519
+ const sp = c.subpaths[d.subpath];
20520
+ const first = sp.anchors[0];
20521
+ delete c.live;
20522
+ if (sp.anchors.length > 1 && Math.hypot(first.x - p.x, first.y - p.y) <= this.tolerance) {
20523
+ sp.closed = true;
20524
+ this.drawing = null;
20525
+ const ref3 = { component: d.component, subpath: d.subpath, anchor: 0 };
20526
+ if (this.commit(next, true)) this.drag = { kind: "pen", ref: ref3, base: next };
20527
+ return;
20528
+ }
20529
+ sp.anchors.push({ x: p.x, y: p.y });
20530
+ const ref2 = { component: d.component, subpath: d.subpath, anchor: sp.anchors.length - 1 };
20531
+ this.selected = /* @__PURE__ */ new Set([key(ref2)]);
20532
+ if (this.commit(next, true)) this.drag = { kind: "pen", ref: ref2, base: next };
20533
+ return;
20534
+ }
20535
+ if (cs) {
20536
+ const anchor = this.anchorAt(cs, p);
20537
+ if (anchor && mods.alt) return this.convert(cs, anchor);
20538
+ if (anchor) {
20539
+ const next = cloneComponents(cs);
20540
+ const c = next[anchor.component];
20541
+ const sp = c.subpaths[anchor.subpath];
20542
+ delete c.live;
20543
+ c.subpaths[anchor.subpath] = sp.anchors.length > 2 ? _chunkLCCMOWR7cjs.removeAnchorsKeepingShape.call(void 0, sp, [anchor.anchor]) : _chunkQAUIZPYIcjs.removeAnchors.call(void 0, sp, [anchor.anchor]);
20544
+ this.selected.clear();
20545
+ this.commit(prune(next), true);
20546
+ return;
20547
+ }
20548
+ const seg = this.segmentAt(cs, p);
20549
+ if (seg) {
20550
+ const next = cloneComponents(cs);
20551
+ const c = next[seg.ref.component];
20552
+ const { subpath, index } = _chunkQAUIZPYIcjs.insertAnchor.call(void 0, c.subpaths[seg.ref.subpath], seg.ref.anchor, seg.t);
20553
+ c.subpaths[seg.ref.subpath] = subpath;
20554
+ delete c.live;
20555
+ this.selected = /* @__PURE__ */ new Set([key({ ...seg.ref, anchor: index })]);
20556
+ this.commit(next, true);
20557
+ return;
20558
+ }
20559
+ }
20560
+ const start = { anchors: [{ x: p.x, y: p.y }], closed: false };
20561
+ if (!this.target || !cs) {
20562
+ try {
20563
+ const path = this.controller.startWorkPath([{ op: "combine", subpaths: [start] }]);
20564
+ this.target = { kind: "path", id: path.id };
20565
+ } catch (e) {
20566
+ this.error = e instanceof Error ? e.message : String(e);
20567
+ return;
20568
+ }
20569
+ this.drawing = { component: 0, subpath: 0 };
20570
+ } else {
20571
+ const next = cloneComponents(cs);
20572
+ if (!next.length) next.push({ op: "combine", subpaths: [] });
20573
+ const ci = next.length - 1;
20574
+ delete next[ci].live;
20575
+ next[ci].subpaths.push(start);
20576
+ if (!this.commit(next, true)) return;
20577
+ this.drawing = { component: ci, subpath: next[ci].subpaths.length - 1 };
20578
+ }
20579
+ const ref = { component: this.drawing.component, subpath: this.drawing.subpath, anchor: 0 };
20580
+ this.selected = /* @__PURE__ */ new Set([key(ref)]);
20581
+ this.drag = { kind: "pen", ref, base: cloneComponents(this.controller.getPathEditComponents(this.target)) };
20582
+ }
20583
+ move(p, mods = {}) {
20584
+ this.pointer = pt(p);
20585
+ const g = this.drag;
20586
+ if (!g) return;
20587
+ if (g.kind === "marquee") {
20588
+ g.end = pt(p);
20589
+ const box = rect(g.start, g.end);
20590
+ const cs = this.target ? this.controller.getPathEditComponents(this.target) : [];
20591
+ this.selected = new Set(g.keep);
20592
+ cs.forEach(
20593
+ (c, ci) => c.subpaths.forEach(
20594
+ (sp, si) => sp.anchors.forEach((a, ai) => {
20595
+ if (a.x >= box.x && a.x <= box.x + box.width && a.y >= box.y && a.y <= box.y + box.height) this.selected.add(key({ component: ci, subpath: si, anchor: ai }));
20596
+ })
20597
+ )
20598
+ );
20599
+ return;
20600
+ }
20601
+ const next = cloneComponents(g.base);
20602
+ if (g.kind === "anchors") {
20603
+ let dx = p.x - g.start.x;
20604
+ let dy = p.y - g.start.y;
20605
+ if (!g.moved && Math.hypot(dx, dy) < 1 / this.scale) return;
20606
+ if (mods.shift) {
20607
+ if (Math.abs(dx) > Math.abs(dy)) dy = 0;
20608
+ else dx = 0;
20609
+ }
20610
+ for (const r of this.selection) {
20611
+ const c = next[r.component];
20612
+ c.subpaths[r.subpath].anchors[r.anchor] = _chunkQAUIZPYIcjs.translateAnchor.call(void 0, c.subpaths[r.subpath].anchors[r.anchor], dx, dy);
20613
+ delete c.live;
20614
+ }
20615
+ } else if (g.kind === "handle") {
20616
+ const c = next[g.ref.component];
20617
+ const a = c.subpaths[g.ref.subpath].anchors[g.ref.anchor];
20618
+ const typed = { ...a, type: _nullishCoalesce(a.type, () => ( _chunkQAUIZPYIcjs.inferAnchorType.call(void 0, a))) };
20619
+ const moved = _chunkQAUIZPYIcjs.moveAnchorHandle.call(void 0, typed, g.side, p, g.breakHandles);
20620
+ delete moved.type;
20621
+ c.subpaths[g.ref.subpath].anchors[g.ref.anchor] = moved;
20622
+ delete c.live;
20623
+ } else if (g.kind === "segment") {
20624
+ const c = next[g.ref.component];
20625
+ c.subpaths[g.ref.subpath] = _chunkLCCMOWR7cjs.bendSegment.call(void 0, c.subpaths[g.ref.subpath], g.ref.anchor, g.t, p);
20626
+ delete c.live;
20627
+ } else {
20628
+ const c = next[g.ref.component];
20629
+ const a = c.subpaths[g.ref.subpath].anchors[g.ref.anchor];
20630
+ if (Math.hypot(p.x - a.x, p.y - a.y) < 1 / this.scale) return;
20631
+ a.out = { x: p.x, y: p.y };
20632
+ a.in = { x: 2 * a.x - p.x, y: 2 * a.y - p.y };
20633
+ delete c.live;
20634
+ this.commit(next, false);
20635
+ return;
20636
+ }
20637
+ if (this.commit(next, !g.moved)) g.moved = true;
20638
+ }
20639
+ /** The pointer moving with no button down (the Pen's preview of its next segment). */
20640
+ hover(p) {
20641
+ this.pointer = pt(p);
20642
+ }
20643
+ up() {
20644
+ this.drag = null;
20645
+ }
20646
+ /** Ends the Pen's subpath (left open). */
20647
+ finish() {
20648
+ this.drawing = null;
20649
+ this.drag = null;
20650
+ }
20651
+ cancel() {
20652
+ this.drag = null;
20653
+ this.drawing = null;
20654
+ this.selected.clear();
20655
+ }
20656
+ /**
20657
+ * Keys: Delete / Backspace remove the selected anchors (one undo step), Enter and Escape end the
20658
+ * Pen's subpath, Escape also deselects. Returns true when the key was handled.
20659
+ */
20660
+ key(k) {
20661
+ if (k === "Enter" && this.drawing) {
20662
+ this.finish();
20663
+ return true;
20664
+ }
20665
+ if (k === "Escape") {
20666
+ if (!this.drawing && !this.selected.size) return false;
20667
+ this.drawing = null;
20668
+ this.selected.clear();
20669
+ return true;
20670
+ }
20671
+ if ((k === "Delete" || k === "Backspace") && this.selected.size && !this.drawing) {
20672
+ const cs = this.components();
20673
+ if (!cs) return false;
20674
+ const next = cloneComponents(cs);
20675
+ const bySub = /* @__PURE__ */ new Map();
20676
+ for (const r of this.selection) {
20677
+ const sk = `${r.component}:${r.subpath}`;
20678
+ bySub.set(sk, [..._nullishCoalesce(bySub.get(sk), () => ( [])), r.anchor]);
20679
+ }
20680
+ for (const [sk, indices] of bySub) {
20681
+ const [ci, si] = sk.split(":").map(Number);
20682
+ next[ci].subpaths[si] = _chunkQAUIZPYIcjs.removeAnchors.call(void 0, next[ci].subpaths[si], indices);
20683
+ delete next[ci].live;
20684
+ }
20685
+ this.selected.clear();
20686
+ this.commit(prune(next), true);
20687
+ return true;
20688
+ }
20689
+ return false;
20690
+ }
20691
+ /** What to draw (`RenderOptions.pathEdit`) for `tool`, or null when there is no target. */
20692
+ overlay(tool) {
20693
+ const cs = this.components();
20694
+ if (!cs) return null;
20695
+ const curves = [];
20696
+ const anchors = [];
20697
+ const handles = [];
20698
+ const selectedComponents = new Set(this.selection.map((r) => r.component));
20699
+ cs.forEach(
20700
+ (c, ci) => c.subpaths.forEach((sp, si) => {
20701
+ for (let i = 0; i < _chunkQAUIZPYIcjs.subpathSegmentCount.call(void 0, sp); i++) curves.push(_chunkQAUIZPYIcjs.subpathSegment.call(void 0, sp, i).map(([x, y]) => ({ x, y })));
20702
+ sp.anchors.forEach((a, ai) => {
20703
+ const selected = this.selected.has(key({ component: ci, subpath: si, anchor: ai }));
20704
+ if (tool === "path-select" && !selectedComponents.has(ci)) return;
20705
+ anchors.push({ point: pt(a), selected });
20706
+ if (!selected || tool === "path-select") return;
20707
+ for (const side of ["in", "out"]) if (a[side]) handles.push({ point: pt(a[side]), anchor: pt(a) });
20708
+ });
20709
+ })
20710
+ );
20711
+ let preview = null;
20712
+ const d = this.drawing;
20713
+ if (tool === "path-pen" && d && this.pointer && !this.drag) {
20714
+ const sp = _optionalChain([cs, 'access', _691 => _691[d.component], 'optionalAccess', _692 => _692.subpaths, 'access', _693 => _693[d.subpath]]);
20715
+ const last = _optionalChain([sp, 'optionalAccess', _694 => _694.anchors, 'access', _695 => _695[sp.anchors.length - 1]]);
20716
+ if (last) preview = last.out ? [pt(last), pt(last.out), this.pointer, this.pointer] : [pt(last), this.pointer];
20717
+ }
20718
+ const marquee = _optionalChain([this, 'access', _696 => _696.drag, 'optionalAccess', _697 => _697.kind]) === "marquee" ? rect(this.drag.start, this.drag.end) : null;
20719
+ return { curves, anchors, handles, marquee, preview };
20720
+ }
20721
+ }, _class17);
20722
+ function rect(a, b) {
20723
+ return { x: Math.min(a.x, b.x), y: Math.min(a.y, b.y), width: Math.abs(b.x - a.x), height: Math.abs(b.y - a.y) };
20724
+ }
20725
+ function prune(cs) {
20726
+ for (const c of cs) c.subpaths = c.subpaths.filter((sp) => sp.anchors.length);
20727
+ return cs.filter((c) => c.subpaths.length);
20728
+ }
20729
+
20169
20730
  // src/image-editor/content-aware-fill-session.ts
20170
20731
  var CONTENT_AWARE_FILL_TOOLS = [
20171
20732
  { id: "sampling-brush", label: "Sampling Brush", key: "b" },
@@ -20188,27 +20749,27 @@ var DEFAULT_CONTENT_AWARE_FILL_SETTINGS = {
20188
20749
  output: "new-layer",
20189
20750
  livePreview: true
20190
20751
  };
20191
- var ContentAwareFillSession = (_class17 = class {
20192
- constructor(controller) {;_class17.prototype.__init149.call(this);_class17.prototype.__init150.call(this);_class17.prototype.__init151.call(this);_class17.prototype.__init152.call(this);_class17.prototype.__init153.call(this);_class17.prototype.__init154.call(this);_class17.prototype.__init155.call(this);_class17.prototype.__init156.call(this);_class17.prototype.__init157.call(this);_class17.prototype.__init158.call(this);_class17.prototype.__init159.call(this);_class17.prototype.__init160.call(this);_class17.prototype.__init161.call(this);_class17.prototype.__init162.call(this);
20752
+ var ContentAwareFillSession = (_class18 = class _ContentAwareFillSession {
20753
+ constructor(controller) {;_class18.prototype.__init156.call(this);_class18.prototype.__init157.call(this);_class18.prototype.__init158.call(this);_class18.prototype.__init159.call(this);_class18.prototype.__init160.call(this);_class18.prototype.__init161.call(this);_class18.prototype.__init162.call(this);_class18.prototype.__init163.call(this);_class18.prototype.__init164.call(this);_class18.prototype.__init165.call(this);_class18.prototype.__init166.call(this);_class18.prototype.__init167.call(this);_class18.prototype.__init168.call(this);_class18.prototype.__init169.call(this);_class18.prototype.__init170.call(this);
20193
20754
  this.controller = controller;
20194
20755
  }
20195
20756
 
20196
- __init149() {this.settingsValue = { ...DEFAULT_CONTENT_AWARE_FILL_SETTINGS }}
20197
- __init150() {this.plan = null}
20757
+ __init156() {this.settingsValue = { ...DEFAULT_CONTENT_AWARE_FILL_SETTINGS }}
20758
+ __init157() {this.plan = null}
20198
20759
  /** The source view's window (document pixels): the selection with room around it to sample. */
20199
- __init151() {this.win = null}
20200
- __init152() {this.before = null}
20201
- __init153() {this.hole = null}
20760
+ __init158() {this.win = null}
20761
+ __init159() {this.before = null}
20762
+ __init160() {this.hole = null}
20202
20763
  /** 1 where the fill may copy from, per window pixel. */
20203
- __init154() {this.area = null}
20204
- __init155() {this.after = null}
20205
- __init156() {this.lastPoint = null}
20206
- __init157() {this.listeners = /* @__PURE__ */ new Set()}
20207
- __init158() {this.dirty = false}
20764
+ __init161() {this.area = null}
20765
+ __init162() {this.after = null}
20766
+ __init163() {this.lastPoint = null}
20767
+ __init164() {this.listeners = /* @__PURE__ */ new Set()}
20768
+ __init165() {this.dirty = false}
20208
20769
  /** Why the workspace can't fill (nothing selected, not a pixel layer), for the UI. */
20209
- __init159() {this.error = null}
20210
- __init160() {this.computing = false}
20211
- __init161() {this.revision = 0}
20770
+ __init166() {this.error = null}
20771
+ __init167() {this.computing = false}
20772
+ __init168() {this.revision = 0}
20212
20773
  get settings() {
20213
20774
  return this.settingsValue;
20214
20775
  }
@@ -20224,16 +20785,21 @@ var ContentAwareFillSession = (_class17 = class {
20224
20785
  this.revision++;
20225
20786
  for (const l of this.listeners) l();
20226
20787
  }
20788
+ /** Images up to this many pixels show (and can be sampled) whole in the workspace. */
20789
+ static __initStatic() {this.WHOLE_IMAGE_PIXELS = 4e6}
20790
+ /** Room around the selection the window holds, in px each way. */
20791
+ __init169() {this.margin = 0}
20227
20792
  /**
20228
- * Reads the layer around the selection and makes the first preview. The window holds the
20229
- * selection and room around it to sample from (its larger side, at least 64 px, each way).
20793
+ * Reads the layer and makes the first preview. The window is the whole image up to
20794
+ * {@link WHOLE_IMAGE_PIXELS}; on a larger one it holds the selection and room around it (twice
20795
+ * its larger side, at least 256 px, each way), and {@link expandView} widens it.
20230
20796
  */
20231
20797
  async open() {
20232
20798
  try {
20233
- const sel = this.controller.getSelection();
20234
- const b = _optionalChain([sel, 'optionalAccess', _682 => _682.bounds]);
20235
- const margin = b ? Math.max(64, Math.max(b.width, b.height)) : 64;
20236
- this.plan = this.controller.prepareContentAwareFill({ sampleRadius: margin });
20799
+ const { width, height } = this.controller.getState().imageDimensions;
20800
+ const b = _optionalChain([this, 'access', _698 => _698.controller, 'access', _699 => _699.getSelection, 'call', _700 => _700(), 'optionalAccess', _701 => _701.bounds]);
20801
+ this.margin = width * height <= _ContentAwareFillSession.WHOLE_IMAGE_PIXELS ? Math.max(width, height) : Math.max(256, 2 * Math.max(_nullishCoalesce(_optionalChain([b, 'optionalAccess', _702 => _702.width]), () => ( 0)), _nullishCoalesce(_optionalChain([b, 'optionalAccess', _703 => _703.height]), () => ( 0))));
20802
+ this.plan = this.controller.prepareContentAwareFill({ sampleRadius: this.margin });
20237
20803
  } catch (err) {
20238
20804
  this.error = err instanceof Error ? err.message : String(err);
20239
20805
  this.emit();
@@ -20247,6 +20813,42 @@ var ContentAwareFillSession = (_class17 = class {
20247
20813
  await this.refresh();
20248
20814
  return true;
20249
20815
  }
20816
+ /** Whether the window shows the whole image (else {@link expandView} can widen it). */
20817
+ get showsWholeImage() {
20818
+ const { width, height } = this.controller.getState().imageDimensions;
20819
+ const w = this.win;
20820
+ return !w || w.x === 0 && w.y === 0 && w.width >= width && w.height >= height;
20821
+ }
20822
+ /**
20823
+ * Doubles the room around the selection (up to the whole image), keeping what was painted; a
20824
+ * preset fills the new room as it would. Returns false when the whole image already shows.
20825
+ */
20826
+ expandView() {
20827
+ if (!this.win || this.showsWholeImage) return false;
20828
+ const { width, height } = this.controller.getState().imageDimensions;
20829
+ const old = { win: this.win, area: this.area };
20830
+ this.margin = Math.min(Math.max(width, height), this.margin * 2);
20831
+ const plan = this.controller.prepareContentAwareFill({ layerId: this.plan.layerId, sampleRadius: this.margin });
20832
+ this.plan = plan;
20833
+ this.win = plan.window;
20834
+ this.before = plan.before;
20835
+ this.hole = plan.hole;
20836
+ const mode = this.settingsValue.sampling;
20837
+ this.area = null;
20838
+ this.applySampling(mode === "custom" ? "auto" : mode);
20839
+ if (mode === "custom") {
20840
+ const area = new Uint8Array(plan.window.width * plan.window.height);
20841
+ for (let y = 0; y < old.win.height; y++) {
20842
+ const src = y * old.win.width;
20843
+ const dst = (old.win.y - plan.window.y + y) * plan.window.width + (old.win.x - plan.window.x);
20844
+ area.set(old.area.subarray(src, src + old.win.width), dst);
20845
+ }
20846
+ this.area = area;
20847
+ }
20848
+ this.emit();
20849
+ if (this.settingsValue.livePreview) void this.refresh();
20850
+ return true;
20851
+ }
20250
20852
  /** Sets the area to a preset: Auto (a band around the selection), Rectangular (the whole window). */
20251
20853
  applySampling(mode) {
20252
20854
  const win = this.win;
@@ -20328,7 +20930,7 @@ var ContentAwareFillSession = (_class17 = class {
20328
20930
  this.emit();
20329
20931
  return true;
20330
20932
  }
20331
- __init162() {this.strokeAdds = true}
20933
+ __init170() {this.strokeAdds = true}
20332
20934
  move(point) {
20333
20935
  if (!this.lastPoint) return;
20334
20936
  this.paint(this.lastPoint, point, this.strokeAdds);
@@ -20354,7 +20956,7 @@ var ContentAwareFillSession = (_class17 = class {
20354
20956
  this.dirty = false;
20355
20957
  try {
20356
20958
  const area = this.samplingMask();
20357
- if (!_optionalChain([area, 'optionalAccess', _683 => _683.bounds])) throw new Error("The sampling area is empty; paint where the fill may copy from.");
20959
+ if (!_optionalChain([area, 'optionalAccess', _704 => _704.bounds])) throw new Error("The sampling area is empty; paint where the fill may copy from.");
20358
20960
  const { plan, after } = await this.controller.previewContentAwareFill({ layerId: this.plan.layerId, samplingArea: area, seed: this.settingsValue.seed });
20359
20961
  const win = this.win;
20360
20962
  const out = Uint8ClampedArray.from(this.before);
@@ -20416,8 +21018,8 @@ var ContentAwareFillSession = (_class17 = class {
20416
21018
  /**
20417
21019
  * Keys: B, H, Z for the tools, [ and ] for the brush size. Returns true when the key was used.
20418
21020
  */
20419
- handleKey(key) {
20420
- const k = key.toLowerCase();
21021
+ handleKey(key2) {
21022
+ const k = key2.toLowerCase();
20421
21023
  const tool = CONTENT_AWARE_FILL_TOOLS.find((t) => t.key === k);
20422
21024
  if (tool) {
20423
21025
  this.update({ tool: tool.id });
@@ -20433,10 +21035,13 @@ var ContentAwareFillSession = (_class17 = class {
20433
21035
  /** OK: fills with this sampling area, seed and output as one undo step. */
20434
21036
  async commit(options = {}) {
20435
21037
  const area = this.samplingMask();
20436
- if (!this.plan || !_optionalChain([area, 'optionalAccess', _684 => _684.bounds])) throw new Error(_nullishCoalesce(this.error, () => ( "The sampling area is empty; paint where the fill may copy from.")));
21038
+ if (!this.plan || !_optionalChain([area, 'optionalAccess', _705 => _705.bounds])) throw new Error(_nullishCoalesce(this.error, () => ( "The sampling area is empty; paint where the fill may copy from.")));
20437
21039
  return this.controller.contentAwareFillAsync({ layerId: this.plan.layerId, samplingArea: area, seed: this.settingsValue.seed, output: this.settingsValue.output, signal: options.signal });
20438
21040
  }
20439
- }, _class17);
21041
+ }, _class18.__initStatic(), _class18);
21042
+
21043
+
21044
+
20440
21045
 
20441
21046
 
20442
21047
 
@@ -21535,4 +22140,4 @@ var ContentAwareFillSession = (_class17 = class {
21535
22140
 
21536
22141
 
21537
22142
 
21538
- exports.ADJUSTMENT_KEYS = _chunkH65IBXFIcjs.ADJUSTMENT_KEYS; exports.ADJUSTMENT_KINDS = _chunkH65IBXFIcjs.ADJUSTMENT_KINDS; exports.ADJUSTMENT_LAYER_CONTROLS = ADJUSTMENT_LAYER_CONTROLS; exports.ADJUSTMENT_LAYER_OPACITY_CONTROL = ADJUSTMENT_LAYER_OPACITY_CONTROL; exports.ADJUSTMENT_LUT_SIZE = _chunkH65IBXFIcjs.ADJUSTMENT_LUT_SIZE; exports.ANCHOR_FRACTION = _chunkH65IBXFIcjs.ANCHOR_FRACTION; exports.AS_SHOT_KELVIN = _chunkH65IBXFIcjs.AS_SHOT_KELVIN; exports.BACKGROUND_LAYER_ID = _chunkH65IBXFIcjs.BACKGROUND_LAYER_ID; exports.BACKGROUND_LAYER_NAME = _chunkH65IBXFIcjs.BACKGROUND_LAYER_NAME; exports.BIT_DEPTHS = _chunkOLNIPTB3cjs.BIT_DEPTHS; exports.BIT_DEPTH_OPTIONS = BIT_DEPTH_OPTIONS; exports.BLEND_MODES = _chunkOLNIPTB3cjs.BLEND_MODES; exports.BLUR_FILTER_ID = _chunkH65IBXFIcjs.BLUR_FILTER_ID; exports.BODY_SCATTER = _chunkKWNMBMKGcjs.BODY_SCATTER; exports.BRUSHSTROKE_MAX_SCALE = _chunkYQGCPL5Xcjs.BRUSHSTROKE_MAX_SCALE; exports.BRUSHSTROKE_MIN_SCALE = _chunkYQGCPL5Xcjs.BRUSHSTROKE_MIN_SCALE; exports.BRUSH_OPTION_CONTROLS = BRUSH_OPTION_CONTROLS; exports.BUILTIN_PROFILES = _chunkBROJYMWUcjs.BUILTIN_PROFILES; exports.BrushstrokeCache = _chunkPQ3H2AANcjs.BrushstrokeCache; exports.CANVAS_SIZE_PRESETS = CANVAS_SIZE_PRESETS; exports.CLONE_TRANSFORM_CONTROLS = CLONE_TRANSFORM_CONTROLS; exports.COLOR_MODE_OPTIONS = COLOR_MODE_OPTIONS; exports.COLOR_RANGE_PRESETS = COLOR_RANGE_PRESETS; exports.COLOR_RANGE_PRESET_LABELS = COLOR_RANGE_PRESET_LABELS; exports.CONTENT_AWARE_FILL_SAMPLING = CONTENT_AWARE_FILL_SAMPLING; exports.CONTENT_AWARE_FILL_TOOLS = CONTENT_AWARE_FILL_TOOLS; exports.ColorGmm = _chunkL52VMQZScjs.ColorGmm; exports.ContentAwareFillSession = ContentAwareFillSession; exports.CoverageMap = _chunkPQ3H2AANcjs.CoverageMap; exports.D50 = _chunkH65IBXFIcjs.D50; exports.D65 = _chunkH65IBXFIcjs.D65; exports.DEFAULT_ADJUSTMENTS = DEFAULT_ADJUSTMENTS; exports.DEFAULT_AUTO_LEADING = _chunkQAUIZPYIcjs.DEFAULT_AUTO_LEADING; exports.DEFAULT_BLENDER = _chunkPQ3H2AANcjs.DEFAULT_BLENDER; exports.DEFAULT_BRUSH = _chunkPQ3H2AANcjs.DEFAULT_BRUSH; exports.DEFAULT_CANVAS_VIEWPORT = DEFAULT_CANVAS_VIEWPORT; exports.DEFAULT_CHANNEL_COLOR = DEFAULT_CHANNEL_COLOR; exports.DEFAULT_CONTENT_AWARE_FILL_SETTINGS = DEFAULT_CONTENT_AWARE_FILL_SETTINGS; exports.DEFAULT_DEPTH_MASK = DEFAULT_DEPTH_MASK; exports.DEFAULT_FLOW = _chunkKWNMBMKGcjs.DEFAULT_FLOW; exports.DEFAULT_GLOBAL_LIGHT = _chunkUOGKSVRQcjs.DEFAULT_GLOBAL_LIGHT; exports.DEFAULT_MITER_LIMIT = _chunkH65IBXFIcjs.DEFAULT_MITER_LIMIT; exports.DEFAULT_MIXER = _chunkPQ3H2AANcjs.DEFAULT_MIXER; exports.DEFAULT_PAINT_GRADIENT = _chunkPQ3H2AANcjs.DEFAULT_PAINT_GRADIENT; exports.DEFAULT_PAINT_GRADIENT_MAPPING = _chunkPQ3H2AANcjs.DEFAULT_PAINT_GRADIENT_MAPPING; exports.DEFAULT_PROOF = DEFAULT_PROOF; exports.DEFAULT_REFINE_EDGE_PARAMS = _chunkL52VMQZScjs.DEFAULT_REFINE_EDGE_PARAMS; exports.DEFAULT_RETOUCH = _chunkYF3YZZ6Gcjs.DEFAULT_RETOUCH; exports.DEFAULT_SELECTION_TOOL_OPTIONS = DEFAULT_SELECTION_TOOL_OPTIONS; exports.DEFAULT_SELECT_AND_MASK_SETTINGS = DEFAULT_SELECT_AND_MASK_SETTINGS; exports.DEFAULT_SHAPE_TOOL_OPTIONS = DEFAULT_SHAPE_TOOL_OPTIONS; exports.DEFAULT_SMUDGE = _chunkPQ3H2AANcjs.DEFAULT_SMUDGE; exports.DEFAULT_TEXT_STYLE = _chunkQAUIZPYIcjs.DEFAULT_TEXT_STYLE; exports.DEFAULT_TRANSFORM = DEFAULT_TRANSFORM; exports.DEFAULT_TYPE_TOOL_OPTIONS = DEFAULT_TYPE_TOOL_OPTIONS; exports.DEFAULT_WET_PAPER = _chunkKWNMBMKGcjs.DEFAULT_WET_PAPER; exports.DEFAULT_WET_PARAMS = _chunkKWNMBMKGcjs.DEFAULT_WET_PARAMS; exports.DEPTH_MASK_CONTROLS = DEPTH_MASK_CONTROLS; exports.DEVELOP_FILTER_ID = _chunkH65IBXFIcjs.DEVELOP_FILTER_ID; exports.DIRECT_GAUSSIAN_MAX_SIGMA = _chunkK6PXS6DOcjs.DIRECT_GAUSSIAN_MAX_SIGMA; exports.DRY_EPS = _chunkKWNMBMKGcjs.DRY_EPS; exports.DabWalker = _chunkPQ3H2AANcjs.DabWalker; exports.EFFECT_LAYER_USES = EFFECT_LAYER_USES; exports.EMPTY_DISTANCE = _chunkQYLWG22Ncjs.EMPTY_DISTANCE; exports.EMPTY_MIXER_LOAD = _chunkPQ3H2AANcjs.EMPTY_MIXER_LOAD; exports.EX = _chunkKWNMBMKGcjs.EX; exports.EY = _chunkKWNMBMKGcjs.EY; exports.EdgeMap = EdgeMap; exports.FLAG_ALIVE = _chunkKWNMBMKGcjs.FLAG_ALIVE; exports.FLAG_BOTTOM = _chunkKWNMBMKGcjs.FLAG_BOTTOM; exports.FLAG_LEFT = _chunkKWNMBMKGcjs.FLAG_LEFT; exports.FLAG_RIGHT = _chunkKWNMBMKGcjs.FLAG_RIGHT; exports.FLAG_TOP = _chunkKWNMBMKGcjs.FLAG_TOP; exports.FLAG_WET = _chunkKWNMBMKGcjs.FLAG_WET; exports.FLAT = _chunkKWNMBMKGcjs.FLAT; exports.FREE_INTERVAL = _chunkKWNMBMKGcjs.FREE_INTERVAL; exports.FREE_TRANSFORM_CONTENTS = FREE_TRANSFORM_CONTENTS; exports.FREE_TRANSFORM_FIELDS = FREE_TRANSFORM_FIELDS; exports.FREE_TRANSFORM_MODES = _chunkH65IBXFIcjs.FREE_TRANSFORM_MODES; exports.FREE_TRANSFORM_MODE_OPTIONS = FREE_TRANSFORM_MODE_OPTIONS; exports.FreeTransformSession = FreeTransformSession; exports.FreeTransformTool = FreeTransformTool; exports.GAMMA = _chunkL52VMQZScjs.GAMMA; exports.GRAIN_PATTERNS = _chunkPQ3H2AANcjs.GRAIN_PATTERNS; exports.GRAIN_TILE = _chunkPQ3H2AANcjs.GRAIN_TILE; exports.GUIDED_FILTER_EPS = _chunkL52VMQZScjs.GUIDED_FILTER_EPS; exports.GridGraph = _chunkL52VMQZScjs.GridGraph; exports.HIDE = _chunkKWNMBMKGcjs.HIDE; exports.HISTOGRAM_BINS = HISTOGRAM_BINS; exports.HUE_RANGE_LABELS = _chunkH65IBXFIcjs.HUE_RANGE_LABELS; exports.HUE_RANGE_PRESETS = HUE_RANGE_PRESETS; exports.IDENTITY_CLONE_TRANSFORM = _chunkYF3YZZ6Gcjs.IDENTITY_CLONE_TRANSFORM; exports.IDENTITY_MATRIX3 = _chunkH65IBXFIcjs.IDENTITY_MATRIX3; exports.IMAGE_ADJUSTMENT_CONTROLS = IMAGE_ADJUSTMENT_CONTROLS; exports.IMAGE_CROP_PRESETS = IMAGE_CROP_PRESETS; exports.IMAGE_EDITOR_SCHEMA_VERSION = IMAGE_EDITOR_SCHEMA_VERSION; exports.IMAGE_EDITOR_STATE_VERSION = IMAGE_EDITOR_STATE_VERSION; exports.IMAGE_EFFECT_PLACES = IMAGE_EFFECT_PLACES; exports.IMAGE_FILTER_PRESETS = IMAGE_FILTER_PRESETS; exports.IMAGE_PLAYBACK_KIND = IMAGE_PLAYBACK_KIND; exports.IMAGE_TOOL_GROUPS = IMAGE_TOOL_GROUPS; exports.IMAGE_TOOL_SHORTCUTS = IMAGE_TOOL_SHORTCUTS; exports.INTENTS = _chunkBROJYMWUcjs.INTENTS; exports.INTENT_OPTIONS = INTENT_OPTIONS; exports.INTERPOLATIONS = _chunkUOGKSVRQcjs.INTERPOLATIONS; exports.ImageEditorController = ImageEditorController; exports.ImageEditorRenderer = ImageEditorRenderer; exports.ImageEffectsEngine = ImageEffectsEngine; exports.LATEST_PROCESS_VERSION = _chunkH65IBXFIcjs.LATEST_PROCESS_VERSION; exports.LAYERED_SCHEMA_VERSION = _chunkH65IBXFIcjs.LAYERED_SCHEMA_VERSION; exports.LAYER_EFFECT_KINDS = _chunkUOGKSVRQcjs.LAYER_EFFECT_KINDS; exports.LAYER_EFFECT_MENU = LAYER_EFFECT_MENU; exports.LEGACY_PROCESS_VERSION = _chunkH65IBXFIcjs.LEGACY_PROCESS_VERSION; exports.LIVE_SHAPE_KINDS = _chunkH65IBXFIcjs.LIVE_SHAPE_KINDS; exports.LUMA_709 = _chunkH65IBXFIcjs.LUMA_709; exports.LayerCompositor = _chunkH65IBXFIcjs.LayerCompositor; exports.LayerEffectError = _chunkUOGKSVRQcjs.LayerEffectError; exports.LayerOperationError = _chunkH65IBXFIcjs.LayerOperationError; exports.MARCHING_ANTS_STEP_MS = MARCHING_ANTS_STEP_MS; exports.MASK_FILE_ACCEPT = MASK_FILE_ACCEPT; exports.MAX_BATCH = _chunkKWNMBMKGcjs.MAX_BATCH; exports.MAX_BRUSH_SIZE = _chunkPQ3H2AANcjs.MAX_BRUSH_SIZE; exports.MAX_CANVAS_BACKING_SIDE = MAX_CANVAS_BACKING_SIDE; exports.MAX_EFFECT_ANIMATION_MS = _chunkH65IBXFIcjs.MAX_EFFECT_ANIMATION_MS; exports.MAX_EFFECT_REACH = _chunkUOGKSVRQcjs.MAX_EFFECT_REACH; exports.MAX_KELVIN = _chunkH65IBXFIcjs.MAX_KELVIN; exports.MAX_TILT_ACCEL = _chunkKWNMBMKGcjs.MAX_TILT_ACCEL; exports.MAX_TRANSFORM_PIXELS = _chunkUOGKSVRQcjs.MAX_TRANSFORM_PIXELS; exports.MAX_WET_LANES = _chunkKWNMBMKGcjs.MAX_WET_LANES; exports.MAX_WET_SLOTS = _chunkKWNMBMKGcjs.MAX_WET_SLOTS; exports.MIN_KELVIN = _chunkH65IBXFIcjs.MIN_KELVIN; exports.MIRED_PER_TEMPERATURE_UNIT = _chunkH65IBXFIcjs.MIRED_PER_TEMPERATURE_UNIT; exports.MIXER_DRAIN = _chunkPQ3H2AANcjs.MIXER_DRAIN; exports.MIXER_MIXING_OPTIONS = MIXER_MIXING_OPTIONS; exports.MIXER_OPTION_CONTROLS = MIXER_OPTION_CONTROLS; exports.MIXER_PICKUP_RATE = _chunkPQ3H2AANcjs.MIXER_PICKUP_RATE; exports.MIXING_MODELS = _chunkPQ3H2AANcjs.MIXING_MODELS; exports.MixerStroke = _chunkPQ3H2AANcjs.MixerStroke; exports.OPP = _chunkKWNMBMKGcjs.OPP; exports.PAINTERLY_BLEND_MODES = _chunkOLNIPTB3cjs.PAINTERLY_BLEND_MODES; exports.PAINT_COLOR_JSON_SCHEMA = _chunkPQ3H2AANcjs.PAINT_COLOR_JSON_SCHEMA; exports.PAINT_GRADIENT_FULL_SPEED = _chunkPQ3H2AANcjs.PAINT_GRADIENT_FULL_SPEED; exports.PAINT_GRADIENT_JSON_SCHEMA = _chunkPQ3H2AANcjs.PAINT_GRADIENT_JSON_SCHEMA; exports.PAINT_GRADIENT_KIT = _chunkPQ3H2AANcjs.PAINT_GRADIENT_KIT; exports.PAINT_GRADIENT_MAPPINGS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_MAPPINGS; exports.PAINT_GRADIENT_MAPPING_LABELS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_MAPPING_LABELS; exports.PAINT_GRADIENT_PRESETS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_PRESETS; exports.PAINT_GRADIENT_REPEATS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_REPEATS; exports.PAINT_GRADIENT_REPEAT_LABELS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_REPEAT_LABELS; exports.PAINT_GRADIENT_SPACES = _chunkPQ3H2AANcjs.PAINT_GRADIENT_SPACES; exports.PAINT_GRADIENT_SPACE_LABELS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_SPACE_LABELS; exports.PAINT_SOURCE_JSON_SCHEMA = _chunkPQ3H2AANcjs.PAINT_SOURCE_JSON_SCHEMA; exports.PAINT_TOOLS = PAINT_TOOLS; exports.PAPER_CAPACITY = _chunkKWNMBMKGcjs.PAPER_CAPACITY; exports.PARAGRAPH_STYLE_FIELDS = _chunkH65IBXFIcjs.PARAGRAPH_STYLE_FIELDS; exports.PARAM = _chunkKWNMBMKGcjs.PARAM; exports.PARAM_FLOATS = _chunkKWNMBMKGcjs.PARAM_FLOATS; exports.PASTE_MODES = PASTE_MODES; exports.PATTERN_BLOCK_KEYS = _chunkH65IBXFIcjs.PATTERN_BLOCK_KEYS; exports.PIGMENT_BANDS = _chunkOLNIPTB3cjs.PIGMENT_BANDS; exports.PIGMENT_CHANNELS = _chunkKWNMBMKGcjs.PIGMENT_CHANNELS; exports.PIGMENT_LAMBDA_MIN = _chunkOLNIPTB3cjs.PIGMENT_LAMBDA_MIN; exports.PIGMENT_LAMBDA_STEP = _chunkOLNIPTB3cjs.PIGMENT_LAMBDA_STEP; exports.PIGMENT_UNIT = _chunkKWNMBMKGcjs.PIGMENT_UNIT; exports.PIGMENT_WAVELENGTHS = _chunkOLNIPTB3cjs.PIGMENT_WAVELENGTHS; exports.PLANE = _chunkKWNMBMKGcjs.PLANE; exports.PLANE_BYTES = _chunkKWNMBMKGcjs.PLANE_BYTES; exports.PREVIEW_SIZE = PREVIEW_SIZE; exports.PROOF_PROFILE_OPTIONS = PROOF_PROFILE_OPTIONS; exports.PSD_BLEND_KEYS = _chunkH65IBXFIcjs.PSD_BLEND_KEYS; exports.PSD_FILE_ACCEPT = PSD_FILE_ACCEPT; exports.P_D0 = _chunkKWNMBMKGcjs.P_D0; exports.P_EDGE = _chunkKWNMBMKGcjs.P_EDGE; exports.P_FX = _chunkKWNMBMKGcjs.P_FX; exports.P_FY = _chunkKWNMBMKGcjs.P_FY; exports.P_H = _chunkKWNMBMKGcjs.P_H; exports.P_P0 = _chunkKWNMBMKGcjs.P_P0; exports.P_RHO = _chunkKWNMBMKGcjs.P_RHO; exports.P_SW = _chunkKWNMBMKGcjs.P_SW; exports.P_UX = _chunkKWNMBMKGcjs.P_UX; exports.P_UY = _chunkKWNMBMKGcjs.P_UY; exports.PaintExchange = _chunkPQ3H2AANcjs.PaintExchange; exports.PaintGesture = PaintGesture; exports.PaintGradientSampler = _chunkPQ3H2AANcjs.PaintGradientSampler; exports.PaintSourceError = _chunkPQ3H2AANcjs.PaintSourceError; exports.PaintStrokeSession = PaintStrokeSession; exports.PaperGrain = _chunkPQ3H2AANcjs.PaperGrain; exports.PatternPlacement = _chunkUOGKSVRQcjs.PatternPlacement; exports.PatternTile = _chunkUOGKSVRQcjs.PatternTile; exports.PsdError = _chunkH65IBXFIcjs.PsdError; exports.QUICK_MASK_TARGET = QUICK_MASK_TARGET; exports.REFINE_EDGE_CONTROLS = REFINE_EDGE_CONTROLS; exports.REFINE_EDIT_KINDS = _chunkL52VMQZScjs.REFINE_EDIT_KINDS; exports.REFINE_OUTPUTS = REFINE_OUTPUTS; exports.RETOUCH_CHOICES = RETOUCH_CHOICES; exports.RETOUCH_OPTION_CONTROLS = RETOUCH_OPTION_CONTROLS; exports.RETOUCH_SAMPLES = _chunkYF3YZZ6Gcjs.RETOUCH_SAMPLES; exports.RETOUCH_TOGGLES = RETOUCH_TOGGLES; exports.RETOUCH_TOOLS = RETOUCH_TOOLS; exports.RegionPixelSource = _chunkYF3YZZ6Gcjs.RegionPixelSource; exports.RetouchDabStroke = _chunkYF3YZZ6Gcjs.RetouchDabStroke; exports.SELECTION_MODES = _chunkQYLWG22Ncjs.SELECTION_MODES; exports.SELECTION_MODE_LABELS = SELECTION_MODE_LABELS; exports.SELECTION_MODIFY_OPS = _chunkQYLWG22Ncjs.SELECTION_MODIFY_OPS; exports.SELECTION_TOOLS = SELECTION_TOOLS; exports.SELECT_AND_MASK_TOOLS = SELECT_AND_MASK_TOOLS; exports.SELECT_AND_MASK_VIEWS = SELECT_AND_MASK_VIEWS; exports.SET_PLANES = _chunkKWNMBMKGcjs.SET_PLANES; exports.SHADOW_AMBIENT = _chunkOLNIPTB3cjs.SHADOW_AMBIENT; exports.SHAPE_KIND_LABELS = SHAPE_KIND_LABELS; exports.SHAPE_OPERATIONS = _chunkH65IBXFIcjs.SHAPE_OPERATIONS; exports.SHAPE_RENDER_MARGIN = _chunkH65IBXFIcjs.SHAPE_RENDER_MARGIN; exports.SLOT_BYTES = _chunkKWNMBMKGcjs.SLOT_BYTES; exports.SLOT_PLANES = _chunkKWNMBMKGcjs.SLOT_PLANES; exports.SLOT_SIDE = _chunkKWNMBMKGcjs.SLOT_SIDE; exports.SMART_RENDER_MARGIN = _chunkH65IBXFIcjs.SMART_RENDER_MARGIN; exports.SPOT_HEAL_TYPES = _chunkYF3YZZ6Gcjs.SPOT_HEAL_TYPES; exports.SRGB_TO_LINEAR = _chunkKWNMBMKGcjs.SRGB_TO_LINEAR; exports.STRIP = _chunkKWNMBMKGcjs.STRIP; exports.SUPPORTED_ADJUSTMENT_KEYS = _chunkH65IBXFIcjs.SUPPORTED_ADJUSTMENT_KEYS; exports.SelectAndMaskSession = SelectAndMaskSession; exports.SelectionGesture = SelectionGesture; exports.SelectionWorkerClient = _chunkL52VMQZScjs.SelectionWorkerClient; exports.ShapeDrawGesture = ShapeDrawGesture; exports.SmudgeTip = _chunkPQ3H2AANcjs.SmudgeTip; exports.StrokeCoverage = _chunkPQ3H2AANcjs.StrokeCoverage; exports.SurfaceDraft = _chunk474IQG74cjs.SurfaceDraft; exports.TEXT_ALIGNS = _chunkH65IBXFIcjs.TEXT_ALIGNS; exports.TEXT_ORIENTATIONS = _chunkH65IBXFIcjs.TEXT_ORIENTATIONS; exports.TEXT_RENDER_MARGIN = _chunkH65IBXFIcjs.TEXT_RENDER_MARGIN; exports.TEXT_STYLE_FIELDS = _chunkH65IBXFIcjs.TEXT_STYLE_FIELDS; exports.TILE = _chunk474IQG74cjs.TILE; exports.TILE_SHIFT = _chunk474IQG74cjs.TILE_SHIFT; exports.TINT_SCALE = _chunkH65IBXFIcjs.TINT_SCALE; exports.TIP_GRADIENT_STEPS = _chunkPQ3H2AANcjs.TIP_GRADIENT_STEPS; exports.TONE_LUT_SIZE = _chunkH65IBXFIcjs.TONE_LUT_SIZE; exports.TONE_RANGES = _chunkYF3YZZ6Gcjs.TONE_RANGES; exports.TONE_RANGE_PRESETS = TONE_RANGE_PRESETS; exports.TRANSFORM_ANCHORS = _chunkH65IBXFIcjs.TRANSFORM_ANCHORS; exports.TRANSFORM_ROTATE_HANDLE_OFFSET = TRANSFORM_ROTATE_HANDLE_OFFSET; exports.TextEditSession = TextEditSession; exports.TileMedium = _chunkPQ3H2AANcjs.TileMedium; exports.TilePixelSource = _chunkYF3YZZ6Gcjs.TilePixelSource; exports.TileableNoise = _chunkPQ3H2AANcjs.TileableNoise; exports.TiledSurface = _chunk474IQG74cjs.TiledSurface; exports.TransformTooLargeError = _chunkUOGKSVRQcjs.TransformTooLargeError; exports.TransformedPixelSource = _chunkYF3YZZ6Gcjs.TransformedPixelSource; exports.TypeToolGesture = TypeToolGesture; exports.UNITS = _chunkL52VMQZScjs.UNITS; exports.U_MAX = _chunkKWNMBMKGcjs.U_MAX; exports.VIBRANCE_GREY = _chunkH65IBXFIcjs.VIBRANCE_GREY; exports.W9 = _chunkKWNMBMKGcjs.W9; exports.WARP_GRID_OPTIONS = WARP_GRID_OPTIONS; exports.WARP_STYLES = _chunkQAUIZPYIcjs.WARP_STYLES; exports.WARP_STYLE_LABELS = _chunkQAUIZPYIcjs.WARP_STYLE_LABELS; exports.WARP_STYLE_OPTIONS = WARP_STYLE_OPTIONS; exports.WET_FLOW_KINDS = _chunkKWNMBMKGcjs.WET_FLOW_KINDS; exports.WET_PARAM_KEYS = _chunkKWNMBMKGcjs.WET_PARAM_KEYS; exports.WET_TILE = _chunkKWNMBMKGcjs.WET_TILE; exports.WGSL_HALO = _chunkKWNMBMKGcjs.WGSL_HALO; exports.WGSL_SHADE = _chunkKWNMBMKGcjs.WGSL_SHADE; exports.WGSL_STEP = _chunkKWNMBMKGcjs.WGSL_STEP; exports.WORKING_SPACE_OPTIONS = WORKING_SPACE_OPTIONS; exports.WORK_PATH_NAME = WORK_PATH_NAME; exports.WORK_SIZE = _chunkL52VMQZScjs.WORK_SIZE; exports.WetGpuEngine = _chunkKWNMBMKGcjs.WetGpuEngine; exports.WetMedium = _chunkKWNMBMKGcjs.WetMedium; exports.WetWorkerPool = _chunkKWNMBMKGcjs.WetWorkerPool; exports.WetWorld = _chunkKWNMBMKGcjs.WetWorld; exports.WetWorldError = _chunkKWNMBMKGcjs.WetWorldError; exports.XYZ_D50_TO_SRGB = _chunkH65IBXFIcjs.XYZ_D50_TO_SRGB; exports.ZlibError = _chunkXFM3OCHUcjs.ZlibError; exports.activeAdjustmentLayers = _chunkH65IBXFIcjs.activeAdjustmentLayers; exports.activeEffectSmartFilters = _chunkH65IBXFIcjs.activeEffectSmartFilters; exports.activeLayerAfterRemoval = _chunkH65IBXFIcjs.activeLayerAfterRemoval; exports.activeSmartFilters = _chunkH65IBXFIcjs.activeSmartFilters; exports.addLayerEffect = _chunkH65IBXFIcjs.addLayerEffect; exports.addLayerFilter = _chunkH65IBXFIcjs.addLayerFilter; exports.addLayerOfKind = addLayerOfKind; exports.addPaintGradientStop = _chunkPQ3H2AANcjs.addPaintGradientStop; exports.addSmartFilter = _chunkH65IBXFIcjs.addSmartFilter; exports.addToHistogram = addToHistogram; exports.adjustmentKindLabel = _chunkH65IBXFIcjs.adjustmentKindLabel; exports.adjustmentLayersKey = _chunkH65IBXFIcjs.adjustmentLayersKey; exports.adjustmentNodeAsLayer = _chunkH65IBXFIcjs.adjustmentNodeAsLayer; exports.adjustmentNodeFromLegacy = _chunkH65IBXFIcjs.adjustmentNodeFromLegacy; exports.adler32 = _chunkXFM3OCHUcjs.adler32; exports.agentDragDraft = agentDragDraft; exports.anchorPoint = _chunkH65IBXFIcjs.anchorPoint; exports.annotationBlend = _chunkH65IBXFIcjs.annotationBlend; exports.annotationLayerFor = _chunkH65IBXFIcjs.annotationLayerFor; exports.annotationLayerName = _chunkH65IBXFIcjs.annotationLayerName; exports.annotationOfLayer = _chunkH65IBXFIcjs.annotationOfLayer; exports.annotationOfShape = _chunkH65IBXFIcjs.annotationOfShape; exports.annotationOfType = _chunkH65IBXFIcjs.annotationOfType; exports.applyAdjustmentLayers = _chunkH65IBXFIcjs.applyAdjustmentLayers; exports.applyAdjustmentLayersFloat = _chunkH65IBXFIcjs.applyAdjustmentLayersFloat; exports.applyAdjustments = _chunkH65IBXFIcjs.applyAdjustments; exports.applyBoxBlur = _chunkH65IBXFIcjs.applyBoxBlur; exports.applyBoxBlurFloat = _chunkH65IBXFIcjs.applyBoxBlurFloat; exports.applyDepthMask = _chunkH65IBXFIcjs.applyDepthMask; exports.applyHomography = _chunkQT26RHKKcjs.applyHomography; exports.applyImageProjectionToContext = _chunkH65IBXFIcjs.applyImageProjectionToContext; exports.applyLegacyAdjustments = _chunkH65IBXFIcjs.applyLegacyAdjustments; exports.applyLegacyFloat = _chunkH65IBXFIcjs.applyLegacyFloat; exports.applyMatrix3 = _chunkH65IBXFIcjs.applyMatrix3; exports.applyOutputStage = applyOutputStage; exports.applyParams = _chunkH65IBXFIcjs.applyParams; exports.applyProcess2Adjustments = _chunkH65IBXFIcjs.applyProcess2Adjustments; exports.applyProcess2Float = _chunkH65IBXFIcjs.applyProcess2Float; exports.applyRefineEdits = _chunkL52VMQZScjs.applyRefineEdits; exports.applyRegionBlur = applyRegionBlur; exports.applyRegionMosaic = applyRegionMosaic; exports.applyRetouchToTile = _chunkYF3YZZ6Gcjs.applyRetouchToTile; exports.applyShapeOptions = applyShapeOptions; exports.applySmartFilters = _chunkH65IBXFIcjs.applySmartFilters; exports.applyStrokeToDeepTile = _chunkPQ3H2AANcjs.applyStrokeToDeepTile; exports.applyStrokeToTile = _chunkPQ3H2AANcjs.applyStrokeToTile; exports.applyToneToDeepTile = _chunkYF3YZZ6Gcjs.applyToneToDeepTile; exports.backgroundLayer = _chunkH65IBXFIcjs.backgroundLayer; exports.base64ToBytes = _chunkOLNIPTB3cjs.base64ToBytes; exports.baseProjection = baseProjection; exports.bestOffset = _chunkMQDIP4CFcjs.bestOffset; exports.blackWhiteGray = _chunkH65IBXFIcjs.blackWhiteGray; exports.blendChannel = _chunkOLNIPTB3cjs.blendChannel; exports.blendImageData = _chunkOLNIPTB3cjs.blendImageData; exports.blendLum = _chunkOLNIPTB3cjs.blendLum; exports.blendPixel = _chunkOLNIPTB3cjs.blendPixel; exports.blendRadius = _chunkPQ3H2AANcjs.blendRadius; exports.blendRgb = _chunkOLNIPTB3cjs.blendRgb; exports.blendTile = _chunkUOGKSVRQcjs.blendTile; exports.blenderDab = _chunkPQ3H2AANcjs.blenderDab; exports.blurFilter = _chunkH65IBXFIcjs.blurFilter; exports.borderCoverage = _chunkQYLWG22Ncjs.borderCoverage; exports.boxBlur = _chunkL52VMQZScjs.boxBlur; exports.boxBlurPixels = _chunkYF3YZZ6Gcjs.boxBlurPixels; exports.boxFrameHit = boxFrameHit; exports.boxFrameOverlay = boxFrameOverlay; exports.boxMean = _chunkL52VMQZScjs.boxMean; exports.boxPointOf = _chunkH65IBXFIcjs.boxPointOf; exports.boxQuad = _chunkQT26RHKKcjs.boxQuad; exports.boxToCurvePoint = boxToCurvePoint; exports.bradfordAdaptation = _chunkH65IBXFIcjs.bradfordAdaptation; exports.brushStrokeMask = _chunkL52VMQZScjs.brushStrokeMask; exports.brushstrokeDataUrl = _chunkPQ3H2AANcjs.brushstrokeDataUrl; exports.brushstrokeKey = _chunkPQ3H2AANcjs.brushstrokeKey; exports.brushstrokeSamples = _chunkPQ3H2AANcjs.brushstrokeSamples; exports.brushstrokeScaleBucket = _chunkYQGCPL5Xcjs.brushstrokeScaleBucket; exports.brushstrokeStrokeOptions = _chunkPQ3H2AANcjs.brushstrokeStrokeOptions; exports.brushstrokeToCanvas = _chunkPQ3H2AANcjs.brushstrokeToCanvas; exports.buildLayerMaskPlanes = _chunkH65IBXFIcjs.buildLayerMaskPlanes; exports.buildToneLut = _chunkH65IBXFIcjs.buildToneLut; exports.builtinPattern = _chunkUOGKSVRQcjs.builtinPattern; exports.builtinPatternIds = _chunkUOGKSVRQcjs.builtinPatternIds; exports.bytesToBase64 = _chunkOLNIPTB3cjs.bytesToBase64; exports.calculateCropDrag = _chunkH65IBXFIcjs.calculateCropDrag; exports.canShareMemory = _chunkKWNMBMKGcjs.canShareMemory; exports.canvasCompositeOperation = _chunkOLNIPTB3cjs.canvasCompositeOperation; exports.canvasToImagePoint = _chunkH65IBXFIcjs.canvasToImagePoint; exports.caretAt = _chunkQAUIZPYIcjs.caretAt; exports.changedTiles = _chunkUOGKSVRQcjs.changedTiles; exports.channelThumbnail = channelThumbnail; exports.checkEffectAnimation = checkEffectAnimation; exports.checkEffectTime = checkEffectTime; exports.checkImageEffectPlace = checkImageEffectPlace; exports.clampControlValue = clampControlValue; exports.clampCropToImage = _chunkH65IBXFIcjs.clampCropToImage; exports.cleanMixer = _chunkPQ3H2AANcjs.cleanMixer; exports.cloneSamplePoint = _chunkYF3YZZ6Gcjs.cloneSamplePoint; exports.cloneSourceLabel = cloneSourceLabel; exports.cloneTransformView = cloneTransformView; exports.collectTiles = _chunk474IQG74cjs.collectTiles; exports.colorBalanceChannel = _chunkH65IBXFIcjs.colorBalanceChannel; exports.colorModePlanes = colorModePlanes; exports.colorModePlanes16 = colorModePlanes16; exports.colorPanelView = colorPanelView; exports.colorRange = colorRange; exports.colorRangePreset = colorRangePreset; exports.combineSelections = _chunkQYLWG22Ncjs.combineSelections; exports.compileAdjustmentLayer = _chunkH65IBXFIcjs.compileAdjustmentLayer; exports.componentPath = _chunkH65IBXFIcjs.componentPath; exports.componentsCoverage = _chunkH65IBXFIcjs.componentsCoverage; exports.compositeDeep = _chunkH65IBXFIcjs.compositeDeep; exports.compositeSurfaceOver = _chunkUOGKSVRQcjs.compositeSurfaceOver; exports.computeHistogram = computeHistogram; exports.computeSelectionBounds = _chunkQYLWG22Ncjs.computeSelectionBounds; exports.contentAwareFill = _chunkMQDIP4CFcjs.contentAwareFill; exports.contentBounds = _chunk474IQG74cjs.contentBounds; exports.contentsBox = _chunkH65IBXFIcjs.contentsBox; exports.contentsSurface = _chunkH65IBXFIcjs.contentsSurface; exports.contractCoverage = _chunkQYLWG22Ncjs.contractCoverage; exports.controlPosition = controlPosition; exports.controlTrackBackground = controlTrackBackground; exports.convertColorFields = convertColorFields; exports.convertHex = convertHex; exports.convertSurfaceColors = convertSurfaceColors; exports.convertSurfaceDepth = _chunkOLNIPTB3cjs.convertSurfaceDepth; exports.convertToSmartObject = _chunkH65IBXFIcjs.convertToSmartObject; exports.copySmartObject = _chunkH65IBXFIcjs.copySmartObject; exports.cornersFromMatrix = _chunkH65IBXFIcjs.cornersFromMatrix; exports.coverageTileCoord = _chunkPQ3H2AANcjs.coverageTileCoord; exports.coverageToByte = _chunkQYLWG22Ncjs.coverageToByte; exports.coveringRect = coveringRect; exports.createAdjustmentLayer = _chunkH65IBXFIcjs.createAdjustmentLayer; exports.createBlenderScratch = _chunkPQ3H2AANcjs.createBlenderScratch; exports.createCanvasTextShaper = _chunkQAUIZPYIcjs.createCanvasTextShaper; exports.createImageCaptureSurface = createImageCaptureSurface; exports.createImageColorTools = createImageColorTools; exports.createImageEditTools = createImageEditTools; exports.createImageEditorDocument = createImageEditorDocument; exports.createImageEditorToolProvider = createImageEditorToolProvider; exports.createImageEffectTools = createImageEffectTools; exports.createImageEffectsToolProvider = createImageEffectsToolProvider; exports.createImageLayerTools = createImageLayerTools; exports.createImagePaintTools = createImagePaintTools; exports.createImagePlaybackLocator = createImagePlaybackLocator; exports.createImagePsdTools = createImagePsdTools; exports.createImageRetouchTools = createImageRetouchTools; exports.createImageSegmentationToolProvider = createImageSegmentationToolProvider; exports.createImageSelectionTools = createImageSelectionTools; exports.createImageShapeTools = createImageShapeTools; exports.createImageSmartObjectTools = createImageSmartObjectTools; exports.createImageSubjectSelectionTool = createImageSubjectSelectionTool; exports.createImageTransformTools = createImageTransformTools; exports.createImageTypeTools = createImageTypeTools; exports.createMetricTextShaper = _chunkQAUIZPYIcjs.createMetricTextShaper; exports.createOutlineTextShaper = _chunkQAUIZPYIcjs.createOutlineTextShaper; exports.createPigment = _chunkOLNIPTB3cjs.createPigment; exports.createPigmentTools = _chunkKWNMBMKGcjs.createPigmentTools; exports.createSelectionMask = _chunkQYLWG22Ncjs.createSelectionMask; exports.createShapeLayer = _chunkH65IBXFIcjs.createShapeLayer; exports.createTypeLayer = _chunkH65IBXFIcjs.createTypeLayer; exports.createWetGpuEngine = _chunkKWNMBMKGcjs.createWetGpuEngine; exports.cssFont = _chunkQAUIZPYIcjs.cssFont; exports.cssFontFamily = _chunkQAUIZPYIcjs.cssFontFamily; exports.curveLut = _chunkUOGKSVRQcjs.curveLut; exports.curveLutFromLevels = _chunkH65IBXFIcjs.curveLutFromLevels; exports.curvePointToBox = curvePointToBox; exports.curveSvgPath = curveSvgPath; exports.dabCoverage = _chunkPQ3H2AANcjs.dabCoverage; exports.dabRect = _chunkPQ3H2AANcjs.dabRect; exports.decodeDeepSurface = _chunkH65IBXFIcjs.decodeDeepSurface; exports.decodeLayerChannel = _chunkH65IBXFIcjs.decodeLayerChannel; exports.decodeLayerMask = _chunkH65IBXFIcjs.decodeLayerMask; exports.decodeMergedImage = _chunkH65IBXFIcjs.decodeMergedImage; exports.decodePlanes = _chunkH65IBXFIcjs.decodePlanes; exports.decodePng = _chunkOLNIPTB3cjs.decodePng; exports.decodePngDataUrl = _chunkH65IBXFIcjs.decodePngDataUrl; exports.decodeSelectionRle = _chunkQYLWG22Ncjs.decodeSelectionRle; exports.decontaminateColors = _chunkL52VMQZScjs.decontaminateColors; exports.deepBytes = _chunkOLNIPTB3cjs.deepBytes; exports.deepTile = _chunkOLNIPTB3cjs.deepTile; exports.defaultActiveLayerId = _chunkH65IBXFIcjs.defaultActiveLayerId; exports.defaultAdjustmentParams = _chunkH65IBXFIcjs.defaultAdjustmentParams; exports.defaultEffectGradient = _chunkUOGKSVRQcjs.defaultEffectGradient; exports.defaultLayerEffect = _chunkUOGKSVRQcjs.defaultLayerEffect; exports.defaultShapeName = _chunkH65IBXFIcjs.defaultShapeName; exports.deflate = _chunkXFM3OCHUcjs.deflate; exports.deflateRaw = _chunkXFM3OCHUcjs.deflateRaw; exports.depthMaskAlpha = _chunkH65IBXFIcjs.depthMaskAlpha; exports.depthOf = _chunkOLNIPTB3cjs.depthOf; exports.depthRasterMask = _chunkH65IBXFIcjs.depthRasterMask; exports.describeChannel = describeChannel; exports.describeLayer = describeLayer; exports.describeLayerEffects = describeLayerEffects; exports.describeSelection = describeSelection; exports.describeTransform = _chunkH65IBXFIcjs.describeTransform; exports.deserializeChannels = deserializeChannels; exports.deserializeColorMode = deserializeColorMode; exports.deserializeColorProfile = deserializeColorProfile; exports.deserializeEffects = _chunkH65IBXFIcjs.deserializeEffects; exports.deserializeLayer = _chunkH65IBXFIcjs.deserializeLayer; exports.deserializeLayers = _chunkH65IBXFIcjs.deserializeLayers; exports.deserializeMask = _chunkL52VMQZScjs.deserializeMask; exports.deserializePatterns = _chunkH65IBXFIcjs.deserializePatterns; exports.deserializeSelection = _chunkQYLWG22Ncjs.deserializeSelection; exports.developFilter = _chunkH65IBXFIcjs.developFilter; exports.developFromAdjustments = _chunkH65IBXFIcjs.developFromAdjustments; exports.developTarget = _chunkH65IBXFIcjs.developTarget; exports.dexp = _chunkKWNMBMKGcjs.dexp; exports.dilateMask = _chunkMQDIP4CFcjs.dilateMask; exports.displayTransform = displayTransform; exports.distanceTransform = _chunkQYLWG22Ncjs.distanceTransform; exports.dlog = _chunkKWNMBMKGcjs.dlog; exports.documentContents = _chunkH65IBXFIcjs.documentContents; exports.documentProfile = documentProfile; exports.dodgeBurn = _chunkYF3YZZ6Gcjs.dodgeBurn; exports.dodgeBurnCurve = _chunkYF3YZZ6Gcjs.dodgeBurnCurve; exports.downloadMaskImage = downloadMaskImage; exports.downloadPsd = downloadPsd; exports.dpow = _chunkKWNMBMKGcjs.dpow; exports.dragWarpMeshPoint = _chunkQAUIZPYIcjs.dragWarpMeshPoint; exports.dropPlacement = dropPlacement; exports.dropZone = dropZone; exports.dsincos = _chunkKWNMBMKGcjs.dsincos; exports.duplicateLayer = _chunkH65IBXFIcjs.duplicateLayer; exports.edgeBits = _chunkKWNMBMKGcjs.edgeBits; exports.edgeWidth = _chunkL52VMQZScjs.edgeWidth; exports.effectColorHex = _chunkUOGKSVRQcjs.effectColorHex; exports.effectControlChange = effectControlChange; exports.effectLayerTiming = effectLayerTiming; exports.effectPixelsToSurface = effectPixelsToSurface; exports.effectReach = _chunkUOGKSVRQcjs.effectReach; exports.effectiveLayerMask = _chunkH65IBXFIcjs.effectiveLayerMask; exports.effectiveProof = effectiveProof; exports.effectsFingerprint = _chunkUOGKSVRQcjs.effectsFingerprint; exports.effectsMargin = _chunkUOGKSVRQcjs.effectsMargin; exports.effectsScale = _chunkUOGKSVRQcjs.effectsScale; exports.ellipsePoints = _chunkL52VMQZScjs.ellipsePoints; exports.ellipseSelection = _chunkL52VMQZScjs.ellipseSelection; exports.emptyHistogram = emptyHistogram; exports.emptySurface = _chunk474IQG74cjs.emptySurface; exports.encodeDeepSurface = _chunkH65IBXFIcjs.encodeDeepSurface; exports.encodePng = _chunkOLNIPTB3cjs.encodePng; exports.encodeRle = _chunkH65IBXFIcjs.encodeRle; exports.encodeSelectionRle = _chunkQYLWG22Ncjs.encodeSelectionRle; exports.encodeSurface = _chunkH65IBXFIcjs.encodeSurface; exports.evalWarpMesh = _chunkQAUIZPYIcjs.evalWarpMesh; exports.evaluateAdjustmentLayers = _chunkH65IBXFIcjs.evaluateAdjustmentLayers; exports.exchangeRates = _chunkPQ3H2AANcjs.exchangeRates; exports.expNeg = _chunkKWNMBMKGcjs.expNeg; exports.expandCoverage = _chunkQYLWG22Ncjs.expandCoverage; exports.exportPsd = _chunkH65IBXFIcjs.exportPsd; exports.extractNormalizedLayerItems = extractNormalizedLayerItems; exports.featherCoverage = _chunkQYLWG22Ncjs.featherCoverage; exports.fillRect = _chunk474IQG74cjs.fillRect; exports.filmPixel = _chunkKWNMBMKGcjs.filmPixel; exports.filmReflectance = _chunkKWNMBMKGcjs.filmReflectance; exports.filterMaskCoverage = _chunkH65IBXFIcjs.filterMaskCoverage; exports.findAdjustmentControl = findAdjustmentControl; exports.findLayer = _chunkUOGKSVRQcjs.findLayer; exports.findLayerControl = findLayerControl; exports.findSky = _chunkL52VMQZScjs.findSky; exports.findSubject = _chunkL52VMQZScjs.findSubject; exports.findWebGpu = _chunkKWNMBMKGcjs.findWebGpu; exports.finishTile = _chunk474IQG74cjs.finishTile; exports.fitParagraphRuns = _chunkQAUIZPYIcjs.fitParagraphRuns; exports.fitRuns = _chunkQAUIZPYIcjs.fitRuns; exports.flattenLayers = _chunkUOGKSVRQcjs.flattenLayers; exports.flattenPath = _chunkH65IBXFIcjs.flattenPath; exports.flipCorners = _chunkH65IBXFIcjs.flipCorners; exports.flowField = _chunkKWNMBMKGcjs.flowField; exports.focusArea = _chunkL52VMQZScjs.focusArea; exports.followLayerMove = _chunkH65IBXFIcjs.followLayerMove; exports.fontOf = _chunkQAUIZPYIcjs.fontOf; exports.forgetSelectAndMaskSettings = forgetSelectAndMaskSettings; exports.formatControlValue = formatControlValue; exports.fullSelection = _chunkQYLWG22Ncjs.fullSelection; exports.gaussianBlur = _chunkK6PXS6DOcjs.gaussianBlur; exports.geometryHomography = _chunkH65IBXFIcjs.geometryHomography; exports.getAnnotationBounds = _chunkH65IBXFIcjs.getAnnotationBounds; exports.getControlPath = getControlPath; exports.getCropCursor = _chunkH65IBXFIcjs.getCropCursor; exports.getRotatedSize = _chunkH65IBXFIcjs.getRotatedSize; exports.getViewportMetrics = _chunkH65IBXFIcjs.getViewportMetrics; exports.getViewportProjection = _chunkH65IBXFIcjs.getViewportProjection; exports.globalImageCache = globalImageCache; exports.grabCutLabels = _chunkL52VMQZScjs.grabCutLabels; exports.gradientDabColor = _chunkPQ3H2AANcjs.gradientDabColor; exports.grainCatch = _chunkPQ3H2AANcjs.grainCatch; exports.grainHeights = _chunkPQ3H2AANcjs.grainHeights; exports.greyMorphology = _chunkQYLWG22Ncjs.greyMorphology; exports.groupLayers = _chunkH65IBXFIcjs.groupLayers; exports.growSelection = growSelection; exports.guidePlanes = _chunkL52VMQZScjs.guidePlanes; exports.guidedFilterColor = _chunkL52VMQZScjs.guidedFilterColor; exports.handleMaskViewKey = handleMaskViewKey; exports.handlePaintShortcut = handlePaintShortcut; exports.handleQuickMaskKey = handleQuickMaskKey; exports.handleSelectionShortcut = handleSelectionShortcut; exports.hasActiveEffects = _chunkUOGKSVRQcjs.hasActiveEffects; exports.hasLayersBelow = hasLayersBelow; exports.hasResampledLegacyMask = _chunkH65IBXFIcjs.hasResampledLegacyMask; exports.hasSurface = _chunkH65IBXFIcjs.hasSurface; exports.hasWarp = _chunkH65IBXFIcjs.hasWarp; exports.hash2 = _chunkPQ3H2AANcjs.hash2; exports.hashMaskContent = _chunkQYLWG22Ncjs.hashMaskContent; exports.hashNoise = _chunkUOGKSVRQcjs.hashNoise; exports.healPixels = _chunkYF3YZZ6Gcjs.healPixels; exports.hexToPaintRgb = _chunkPQ3H2AANcjs.hexToPaintRgb; exports.hexToRgb = _chunkH65IBXFIcjs.hexToRgb; exports.histogramPath = histogramPath; exports.hitTestAnnotation = _chunkH65IBXFIcjs.hitTestAnnotation; exports.hitTestCrop = _chunkH65IBXFIcjs.hitTestCrop; exports.hitTestCurvePoint = hitTestCurvePoint; exports.homographyFromAffine = _chunkQT26RHKKcjs.homographyFromAffine; exports.homographyFromPoints = _chunkQT26RHKKcjs.homographyFromPoints; exports.hslToRgb = _chunkH65IBXFIcjs.hslToRgb; exports.hueRange = hueRange; exports.hueRangeTables = _chunkH65IBXFIcjs.hueRangeTables; exports.hueRangeWeight = _chunkH65IBXFIcjs.hueRangeWeight; exports.hueSaturation = _chunkH65IBXFIcjs.hueSaturation; exports.identityCurve = _chunkH65IBXFIcjs.identityCurve; exports.identityLevels = _chunkH65IBXFIcjs.identityLevels; exports.identityTransform = _chunkH65IBXFIcjs.identityTransform; exports.identityWarpMesh = _chunkQAUIZPYIcjs.identityWarpMesh; exports.imageEditorStateMigrations = imageEditorStateMigrations; exports.imageLayerAppliedEffects = imageLayerAppliedEffects; exports.imagePanelTool = imagePanelTool; exports.imagePlaybackPanel = imagePlaybackPanel; exports.imageToCanvasPoint = _chunkH65IBXFIcjs.imageToCanvasPoint; exports.imageToolCanvasMode = imageToolCanvasMode; exports.imageToolForShortcut = imageToolForShortcut; exports.imageToolGroup = imageToolGroup; exports.imageToolLabel = imageToolLabel; exports.imageToolPanel = imageToolPanel; exports.importPsd = _chunkH65IBXFIcjs.importPsd; exports.inflate = _chunkXFM3OCHUcjs.inflate; exports.inflateRaw = _chunkXFM3OCHUcjs.inflateRaw; exports.insertCurvePoint = insertCurvePoint; exports.insertLayer = _chunkUOGKSVRQcjs.insertLayer; exports.instancesOf = _chunkH65IBXFIcjs.instancesOf; exports.invertHomography = _chunkQT26RHKKcjs.invertHomography; exports.invertMatrix3 = _chunkH65IBXFIcjs.invertMatrix3; exports.invertSelection = _chunkQYLWG22Ncjs.invertSelection; exports.isActiveFilter = _chunkH65IBXFIcjs.isActiveFilter; exports.isActiveVectorMask = _chunkH65IBXFIcjs.isActiveVectorMask; exports.isAdjustmentKind = _chunkH65IBXFIcjs.isAdjustmentKind; exports.isBitDepth = _chunkOLNIPTB3cjs.isBitDepth; exports.isBlendMode = _chunkOLNIPTB3cjs.isBlendMode; exports.isBrushstrokeBrush = _chunkPQ3H2AANcjs.isBrushstrokeBrush; exports.isColorRangePreset = isColorRangePreset; exports.isContentsDecoded = _chunkH65IBXFIcjs.isContentsDecoded; exports.isDefaultDepthMask = _chunkH65IBXFIcjs.isDefaultDepthMask; exports.isGradientPaint = _chunkPQ3H2AANcjs.isGradientPaint; exports.isIdentityCloneTransform = _chunkYF3YZZ6Gcjs.isIdentityCloneTransform; exports.isIdentityTransform = _chunkH65IBXFIcjs.isIdentityTransform; exports.isInterpolation = _chunkUOGKSVRQcjs.isInterpolation; exports.isLayerEffectKind = _chunkUOGKSVRQcjs.isLayerEffectKind; exports.isLayerLocked = _chunkUOGKSVRQcjs.isLayerLocked; exports.isLegacyShape = _chunkH65IBXFIcjs.isLegacyShape; exports.isPaintTool = isPaintTool; exports.isPaintableLayer = _chunkH65IBXFIcjs.isPaintableLayer; exports.isPainterlyBlendMode = _chunkOLNIPTB3cjs.isPainterlyBlendMode; exports.isPng = _chunkOLNIPTB3cjs.isPng; exports.isQuarterTurn = isQuarterTurn; exports.isQuarterTurnSwapped = _chunkH65IBXFIcjs.isQuarterTurnSwapped; exports.isRenderedLayer = _chunkH65IBXFIcjs.isRenderedLayer; exports.isRetouchPaintTool = isRetouchPaintTool; exports.isRetouchTool = isRetouchTool; exports.isSelectionEmpty = _chunkQYLWG22Ncjs.isSelectionEmpty; exports.isSelectionMode = _chunkQYLWG22Ncjs.isSelectionMode; exports.isSeparableBlendMode = _chunkOLNIPTB3cjs.isSeparableBlendMode; exports.isSmartSurfaceIncomplete = _chunkH65IBXFIcjs.isSmartSurfaceIncomplete; exports.isSpatialFilter = _chunkH65IBXFIcjs.isSpatialFilter; exports.isSrgb = isSrgb; exports.isTransformAnchor = _chunkH65IBXFIcjs.isTransformAnchor; exports.isValidWarp = _chunkH65IBXFIcjs.isValidWarp; exports.keepDeepSamples = _chunkOLNIPTB3cjs.keepDeepSamples; exports.keepMainPieces = _chunkL52VMQZScjs.keepMainPieces; exports.kelvinToTemperature = _chunkH65IBXFIcjs.kelvinToTemperature; exports.keysWeight = _chunkUOGKSVRQcjs.keysWeight; exports.latticeViscosity = _chunkKWNMBMKGcjs.latticeViscosity; exports.layerBadge = layerBadge; exports.layerEffectControls = layerEffectControls; exports.layerEffectFields = _chunkUOGKSVRQcjs.layerEffectFields; exports.layerEffectLabel = _chunkUOGKSVRQcjs.layerEffectLabel; exports.layerEffectsBadge = layerEffectsBadge; exports.layerEffectsOf = _chunkH65IBXFIcjs.layerEffectsOf; exports.layerEffectsPanel = layerEffectsPanel; exports.layerHasThumbnail = layerHasThumbnail; exports.layerLabel = layerLabel; exports.layerMaskCoverage = _chunkH65IBXFIcjs.layerMaskCoverage; exports.layerMaskFromSelection = _chunkH65IBXFIcjs.layerMaskFromSelection; exports.layerMaskKey = _chunkH65IBXFIcjs.layerMaskKey; exports.layerMaskSelection = _chunkH65IBXFIcjs.layerMaskSelection; exports.layerMenu = layerMenu; exports.layerName = _chunkH65IBXFIcjs.layerName; exports.layerPanelRows = layerPanelRows; exports.layerPanels = layerPanels; exports.layerThumbnailClick = layerThumbnailClick; exports.layerTree = _chunkH65IBXFIcjs.layerTree; exports.layerTypeLabel = _chunkH65IBXFIcjs.layerTypeLabel; exports.layerWarning = layerWarning; exports.layersFromLegacy = _chunkH65IBXFIcjs.layersFromLegacy; exports.layoutText = _chunkQAUIZPYIcjs.layoutText; exports.legacyAdjustmentLayer = _chunkH65IBXFIcjs.legacyAdjustmentLayer; exports.legacyMaskOf = _chunkH65IBXFIcjs.legacyMaskOf; exports.legacyView = _chunkH65IBXFIcjs.legacyView; exports.lerpPigment = _chunkOLNIPTB3cjs.lerpPigment; exports.lerpPigmentInto = _chunkOLNIPTB3cjs.lerpPigmentInto; exports.levelsValue = _chunkH65IBXFIcjs.levelsValue; exports.linearSrgbToXy = _chunkH65IBXFIcjs.linearSrgbToXy; exports.linearToSrgb = _chunkH65IBXFIcjs.linearToSrgb; exports.linearToSrgb8 = _chunkKWNMBMKGcjs.linearToSrgb8; exports.liveComponent = _chunkH65IBXFIcjs.liveComponent; exports.liveShapeForDrag = liveShapeForDrag; exports.liveShapeSubpaths = _chunkH65IBXFIcjs.liveShapeSubpaths; exports.liveWire = liveWire; exports.loadImageEditorDocument = loadImageEditorDocument; exports.loadMixer = _chunkPQ3H2AANcjs.loadMixer; exports.loadOpenTypeFont = _chunk3T5VCDIVcjs.loadOpenTypeFont; exports.loadWetKernel = _chunkKWNMBMKGcjs.loadWetKernel; exports.luma = _chunkYF3YZZ6Gcjs.luma; exports.magicWand = magicWand; exports.magneticAnchorSpacing = magneticAnchorSpacing; exports.mapCropHandle = _chunkH65IBXFIcjs.mapCropHandle; exports.mapLayer = _chunkUOGKSVRQcjs.mapLayer; exports.mapSubpaths = _chunkH65IBXFIcjs.mapSubpaths; exports.maskBounds = _chunkMQDIP4CFcjs.maskBounds; exports.maskFileName = maskFileName; exports.maskNameFromFile = maskNameFromFile; exports.maskSummary = maskSummary; exports.maskThumbnailClick = maskThumbnailClick; exports.matrixFromCorners = _chunkH65IBXFIcjs.matrixFromCorners; exports.matrixFromParams = _chunkH65IBXFIcjs.matrixFromParams; exports.measureCanvasViewport = measureCanvasViewport; exports.membraneFill = _chunkMQDIP4CFcjs.membraneFill; exports.mergeLayerEffect = _chunkUOGKSVRQcjs.mergeLayerEffect; exports.mergeShapeComponents = _chunkH65IBXFIcjs.mergeShapeComponents; exports.migrateSerializedImageEditorState = migrateSerializedImageEditorState; exports.migrateToLayeredState = migrateToLayeredState; exports.mix32 = _chunkPQ3H2AANcjs.mix32; exports.mixPigment8 = _chunkOLNIPTB3cjs.mixPigment8; exports.mixPigmentRgb = _chunkOLNIPTB3cjs.mixPigmentRgb; exports.mixPigments = _chunkOLNIPTB3cjs.mixPigments; exports.mixerLoadResult = mixerLoadResult; exports.mixerRates = _chunkPQ3H2AANcjs.mixerRates; exports.modifySelection = _chunkQYLWG22Ncjs.modifySelection; exports.moveCurvePoint = moveCurvePoint; exports.moveLayer = _chunkH65IBXFIcjs.moveLayer; exports.moveSmartFilter = _chunkH65IBXFIcjs.moveSmartFilter; exports.mulMatrix3 = _chunkH65IBXFIcjs.mulMatrix3; exports.needsLegacyBase = needsLegacyBase; exports.neutralHueRange = _chunkH65IBXFIcjs.neutralHueRange; exports.newContentsId = _chunkH65IBXFIcjs.newContentsId; exports.newEffectId = _chunkUOGKSVRQcjs.newEffectId; exports.newLayerId = _chunkH65IBXFIcjs.newLayerId; exports.newLayerOptions = newLayerOptions; exports.newPathId = newPathId; exports.normalizeAdjustmentLayer = _chunkH65IBXFIcjs.normalizeAdjustmentLayer; exports.normalizeAdjustmentLayers = _chunkH65IBXFIcjs.normalizeAdjustmentLayers; exports.normalizeAngle = _chunkH65IBXFIcjs.normalizeAngle; exports.normalizeBlendMode = _chunkOLNIPTB3cjs.normalizeBlendMode; exports.normalizeBlender = _chunkPQ3H2AANcjs.normalizeBlender; exports.normalizeBrush = _chunkPQ3H2AANcjs.normalizeBrush; exports.normalizeFilter = _chunkH65IBXFIcjs.normalizeFilter; exports.normalizeFlow = _chunkKWNMBMKGcjs.normalizeFlow; exports.normalizeHexColor = _chunkPQ3H2AANcjs.normalizeHexColor; exports.normalizeLayerEffects = _chunkUOGKSVRQcjs.normalizeLayerEffects; exports.normalizeLayerMask = _chunkH65IBXFIcjs.normalizeLayerMask; exports.normalizeLiveShape = _chunkH65IBXFIcjs.normalizeLiveShape; exports.normalizeMixer = _chunkPQ3H2AANcjs.normalizeMixer; exports.normalizePlacement = _chunkH65IBXFIcjs.normalizePlacement; exports.normalizeProcessVersion = _chunkH65IBXFIcjs.normalizeProcessVersion; exports.normalizeRect = _chunkL52VMQZScjs.normalizeRect; exports.normalizeRefineEdgeParams = _chunkL52VMQZScjs.normalizeRefineEdgeParams; exports.normalizeRetouch = _chunkYF3YZZ6Gcjs.normalizeRetouch; exports.normalizeShapePaint = _chunkH65IBXFIcjs.normalizeShapePaint; exports.normalizeShapeStroke = _chunkH65IBXFIcjs.normalizeShapeStroke; exports.normalizeSmartFilter = _chunkH65IBXFIcjs.normalizeSmartFilter; exports.normalizeSmudge = _chunkPQ3H2AANcjs.normalizeSmudge; exports.normalizeStoredAdjustments = normalizeStoredAdjustments; exports.normalizeSubpaths = _chunkH65IBXFIcjs.normalizeSubpaths; exports.normalizeText = _chunkH65IBXFIcjs.normalizeText; exports.normalizeTilt = _chunkKWNMBMKGcjs.normalizeTilt; exports.normalizeWetParams = _chunkKWNMBMKGcjs.normalizeWetParams; exports.offsetLayer = _chunkH65IBXFIcjs.offsetLayer; exports.offsetShape = _chunkH65IBXFIcjs.offsetShape; exports.offsetSmartObject = _chunkH65IBXFIcjs.offsetSmartObject; exports.offsetVectorMask = _chunkH65IBXFIcjs.offsetVectorMask; exports.openMaskFile = openMaskFile; exports.openPsdFile = openPsdFile; exports.otsuThreshold = _chunkL52VMQZScjs.otsuThreshold; exports.packRgba = _chunk474IQG74cjs.packRgba; exports.packWetParams = _chunkKWNMBMKGcjs.packWetParams; exports.paintGradientMappingFor = _chunkPQ3H2AANcjs.paintGradientMappingFor; exports.paintPathStroke = _chunkPQ3H2AANcjs.paintPathStroke; exports.paintSourceColor = _chunkPQ3H2AANcjs.paintSourceColor; exports.paintSourceCss = _chunkPQ3H2AANcjs.paintSourceCss; exports.paragraphRanges = _chunkQAUIZPYIcjs.paragraphRanges; exports.parseAdjustmentBlock = _chunkH65IBXFIcjs.parseAdjustmentBlock; exports.parseBlend = _chunkH65IBXFIcjs.parseBlend; exports.parseColor = parseColor; exports.parseCssColor = _chunkA2IS7EHEcjs.parseCssColor; exports.parseDataUrl = _chunkOLNIPTB3cjs.parseDataUrl; exports.parseEffectColor = _chunkUOGKSVRQcjs.parseEffectColor; exports.parseLfx2 = _chunkH65IBXFIcjs.parseLfx2; exports.parseLrfx = _chunkH65IBXFIcjs.parseLrfx; exports.parseOpenTypeFont = _chunk3T5VCDIVcjs.parseOpenTypeFont; exports.parsePaintSource = _chunkPQ3H2AANcjs.parsePaintSource; exports.parsePatternBlock = _chunkH65IBXFIcjs.parsePatternBlock; exports.parseSelectionMode = _chunkQYLWG22Ncjs.parseSelectionMode; exports.parseVersionedDescriptor = _chunkH65IBXFIcjs.parseVersionedDescriptor; exports.patchParagraphStyle = _chunkH65IBXFIcjs.patchParagraphStyle; exports.patchTextStyle = _chunkH65IBXFIcjs.patchTextStyle; exports.pathAnchorCount = pathAnchorCount; exports.pathBounds = pathBounds; exports.pathStrokeCoverage = _chunkPQ3H2AANcjs.pathStrokeCoverage; exports.pathStrokeDabs = _chunkPQ3H2AANcjs.pathStrokeDabs; exports.pathSvgData = pathSvgData; exports.pathToSelection = pathToSelection; exports.perDabStrength = _chunkYF3YZZ6Gcjs.perDabStrength; exports.photoFilterMatrix = _chunkH65IBXFIcjs.photoFilterMatrix; exports.pigment8 = _chunkOLNIPTB3cjs.pigment8; exports.pigmentColor = _chunkKWNMBMKGcjs.pigmentColor; exports.pigmentOf = _chunkKWNMBMKGcjs.pigmentOf; exports.pixelLayerBounds = _chunkH65IBXFIcjs.pixelLayerBounds; exports.pixelLayers = _chunkH65IBXFIcjs.pixelLayers; exports.pixelPigment = _chunkKWNMBMKGcjs.pixelPigment; exports.placeContents = _chunkH65IBXFIcjs.placeContents; exports.placeLayer = _chunkH65IBXFIcjs.placeLayer; exports.placementAt = _chunkH65IBXFIcjs.placementAt; exports.placementBounds = _chunkH65IBXFIcjs.placementBounds; exports.placementGeometry = _chunkH65IBXFIcjs.placementGeometry; exports.planImageToolPlayback = planImageToolPlayback; exports.planOutlineTrace = planOutlineTrace; exports.pngDataUrl = _chunkOLNIPTB3cjs.pngDataUrl; exports.pointerPressure = _chunkKWNMBMKGcjs.pointerPressure; exports.pointerStrokeSample = _chunkKWNMBMKGcjs.pointerStrokeSample; exports.pointerStrokeSamples = _chunkKWNMBMKGcjs.pointerStrokeSamples; exports.polygonCoverage = _chunkL52VMQZScjs.polygonCoverage; exports.polygonCoverageBox = _chunkL52VMQZScjs.polygonCoverageBox; exports.polygonSelection = _chunkL52VMQZScjs.polygonSelection; exports.posterizeValue = _chunkH65IBXFIcjs.posterizeValue; exports.presetWarp = _chunkH65IBXFIcjs.presetWarp; exports.previewStep = previewStep; exports.profileBytes = profileBytes; exports.projectImagePoint = _chunkH65IBXFIcjs.projectImagePoint; exports.projectImageRect = _chunkH65IBXFIcjs.projectImageRect; exports.projectMaskCoverage = _chunkH65IBXFIcjs.projectMaskCoverage; exports.projectQuarterTurn = projectQuarterTurn; exports.proxyOf = _chunkOLNIPTB3cjs.proxyOf; exports.psdBytesFromBase64 = psdBytesFromBase64; exports.psdFileName = psdFileName; exports.psdPatternToEffectPattern = _chunkH65IBXFIcjs.psdPatternToEffectPattern; exports.psdToLayers = _chunkH65IBXFIcjs.psdToLayers; exports.pullWarpMesh = _chunkQAUIZPYIcjs.pullWarpMesh; exports.put255 = _chunkPQ3H2AANcjs.put255; exports.quadFrameOverlay = quadFrameOverlay; exports.quickMaskPixels = quickMaskPixels; exports.quickSelectStroke = _chunkL52VMQZScjs.quickSelectStroke; exports.rand01 = _chunkPQ3H2AANcjs.rand01; exports.randSigned = _chunkPQ3H2AANcjs.randSigned; exports.rangeLightness = _chunkH65IBXFIcjs.rangeLightness; exports.rasterContents = _chunkH65IBXFIcjs.rasterContents; exports.rasterMaskFromLegacy = _chunkH65IBXFIcjs.rasterMaskFromLegacy; exports.rasterizeCoverage = _chunkH65IBXFIcjs.rasterizeCoverage; exports.rasterizeDab = _chunkPQ3H2AANcjs.rasterizeDab; exports.rasterizeSmartObject = _chunkH65IBXFIcjs.rasterizeSmartObject; exports.readAdjustmentControls = readAdjustmentControls; exports.readDeepRegion = _chunkOLNIPTB3cjs.readDeepRegion; exports.readPaintSource = _chunkPQ3H2AANcjs.readPaintSource; exports.readPaths = readPaths; exports.readPixel = _chunk474IQG74cjs.readPixel; exports.readPsd = _chunkH65IBXFIcjs.readPsd; exports.readRegion = _chunk474IQG74cjs.readRegion; exports.readShapeComponents = _chunkH65IBXFIcjs.readShapeComponents; exports.readSourceRegion = _chunkYF3YZZ6Gcjs.readSourceRegion; exports.rectSelection = _chunkL52VMQZScjs.rectSelection; exports.rectToQuad = _chunkQT26RHKKcjs.rectToQuad; exports.reduceSurface = _chunkUOGKSVRQcjs.reduceSurface; exports.referencePoint = _chunkH65IBXFIcjs.referencePoint; exports.refineCoverage = _chunkL52VMQZScjs.refineCoverage; exports.refineEdgeHalo = _chunkL52VMQZScjs.refineEdgeHalo; exports.refineSelection = _chunkL52VMQZScjs.refineSelection; exports.reflectanceToRgb = _chunkOLNIPTB3cjs.reflectanceToRgb; exports.removeAlpha = _chunkH65IBXFIcjs.removeAlpha; exports.removeCurvePoint = removeCurvePoint; exports.removeLayer = _chunkH65IBXFIcjs.removeLayer; exports.removeLayerEffect = _chunkH65IBXFIcjs.removeLayerEffect; exports.removeLayerFilter = _chunkH65IBXFIcjs.removeLayerFilter; exports.removePaintGradientStop = _chunkPQ3H2AANcjs.removePaintGradientStop; exports.removeSmartFilter = _chunkH65IBXFIcjs.removeSmartFilter; exports.renderBrushstroke = _chunkPQ3H2AANcjs.renderBrushstroke; exports.renderLayerEffects = _chunkUOGKSVRQcjs.renderLayerEffects; exports.renderLayeredBase = renderLayeredBase; exports.renderShape = _chunkH65IBXFIcjs.renderShape; exports.renderShapeRect = _chunkH65IBXFIcjs.renderShapeRect; exports.renderSmartObject = _chunkH65IBXFIcjs.renderSmartObject; exports.renderText = _chunkH65IBXFIcjs.renderText; exports.replaceContents = _chunkH65IBXFIcjs.replaceContents; exports.replaceTextRange = _chunkH65IBXFIcjs.replaceTextRange; exports.requireLayer = _chunkH65IBXFIcjs.requireLayer; exports.requireOperation = _chunkH65IBXFIcjs.requireOperation; exports.requireShapeLayer = _chunkH65IBXFIcjs.requireShapeLayer; exports.requireSmartObject = _chunkH65IBXFIcjs.requireSmartObject; exports.requireTypeLayer = _chunkH65IBXFIcjs.requireTypeLayer; exports.requireUnlocked = _chunkH65IBXFIcjs.requireUnlocked; exports.rerender = _chunkH65IBXFIcjs.rerender; exports.rerenderShape = _chunkH65IBXFIcjs.rerenderShape; exports.rerenderText = _chunkH65IBXFIcjs.rerenderText; exports.resizePixels = resizePixels; exports.resizeSelection = _chunkQYLWG22Ncjs.resizeSelection; exports.resizeWarpMesh = _chunkQAUIZPYIcjs.resizeWarpMesh; exports.resolveExternalAssets = _chunkH65IBXFIcjs.resolveExternalAssets; exports.resolveMosaicRegionBounds = resolveMosaicRegionBounds; exports.resolvePaintGradient = _chunkPQ3H2AANcjs.resolvePaintGradient; exports.resolveProfile = resolveProfile; exports.resolveVectorMasks = _chunkH65IBXFIcjs.resolveVectorMasks; exports.restyleRange = _chunkQAUIZPYIcjs.restyleRange; exports.retouchFilter = _chunkYF3YZZ6Gcjs.retouchFilter; exports.reversePaintGradient = _chunkPQ3H2AANcjs.reversePaintGradient; exports.rgbToGray = _chunkH65IBXFIcjs.rgbToGray; exports.rgbToHsl = _chunkH65IBXFIcjs.rgbToHsl; exports.rgbToReflectance = _chunkOLNIPTB3cjs.rgbToReflectance; exports.rgbUnitToHex = rgbUnitToHex; exports.rgbaViewOfGrey = _chunkYF3YZZ6Gcjs.rgbaViewOfGrey; exports.runLayerFilters = _chunkH65IBXFIcjs.runLayerFilters; exports.runLayerFiltersFloat = _chunkH65IBXFIcjs.runLayerFiltersFloat; exports.runLayerMenuAction = runLayerMenuAction; exports.runSelectionJob = _chunkL52VMQZScjs.runSelectionJob; exports.sameCanvasViewport = sameCanvasViewport; exports.sampleLut = _chunkH65IBXFIcjs.sampleLut; exports.sampleToneLut = _chunkH65IBXFIcjs.sampleToneLut; exports.saturationOf = _chunkYF3YZZ6Gcjs.saturationOf; exports.scaleLayerEffect = _chunkUOGKSVRQcjs.scaleLayerEffect; exports.scalePaintGradient = _chunkPQ3H2AANcjs.scalePaintGradient; exports.seamlessClone = _chunkMQDIP4CFcjs.seamlessClone; exports.seedFromString = _chunkPQ3H2AANcjs.seedFromString; exports.segmentToSelection = segmentToSelection; exports.segmentationOutlines = segmentationOutlines; exports.segmentsToSelection = segmentsToSelection; exports.selectObjectIn = _chunkL52VMQZScjs.selectObjectIn; exports.selectSimilar = selectSimilar; exports.selectionArea = _chunkQYLWG22Ncjs.selectionArea; exports.selectionFromCoverage = _chunkQYLWG22Ncjs.selectionFromCoverage; exports.selectionFromPixels = _chunkQYLWG22Ncjs.selectionFromPixels; exports.selectionFromRegion = _chunkQYLWG22Ncjs.selectionFromRegion; exports.selectionFromTiles = _chunkQYLWG22Ncjs.selectionFromTiles; exports.selectionModeFromModifiers = selectionModeFromModifiers; exports.selectionOutline = selectionOutline; exports.selectionRing = selectionRing; exports.selectionToCoverage = _chunkQYLWG22Ncjs.selectionToCoverage; exports.selectionToPixels = _chunkQYLWG22Ncjs.selectionToPixels; exports.selectionToSubpaths = selectionToSubpaths; exports.selectionValueAt = _chunkQYLWG22Ncjs.selectionValueAt; exports.serializeChannels = serializeChannels; exports.serializeColorMode = serializeColorMode; exports.serializeColorProfile = serializeColorProfile; exports.serializeContents = _chunkH65IBXFIcjs.serializeContents; exports.serializeEffects = _chunkH65IBXFIcjs.serializeEffects; exports.serializeLayer = _chunkH65IBXFIcjs.serializeLayer; exports.serializeLayers = _chunkH65IBXFIcjs.serializeLayers; exports.serializeLayersExternal = _chunkH65IBXFIcjs.serializeLayersExternal; exports.serializeMask = _chunkL52VMQZScjs.serializeMask; exports.serializePaths = serializePaths; exports.serializePatterns = _chunkH65IBXFIcjs.serializePatterns; exports.serializeSelection = _chunkQYLWG22Ncjs.serializeSelection; exports.setCloneTransformValue = setCloneTransformValue; exports.setControlPath = setControlPath; exports.setLayerEffects = _chunkH65IBXFIcjs.setLayerEffects; exports.setLayerEffectsEnabled = _chunkH65IBXFIcjs.setLayerEffectsEnabled; exports.setLayerMask = _chunkH65IBXFIcjs.setLayerMask; exports.setLayerProperties = _chunkH65IBXFIcjs.setLayerProperties; exports.setLum = _chunkOLNIPTB3cjs.setLum; exports.setPigmentColor = _chunkOLNIPTB3cjs.setPigmentColor; exports.setRetouchChoice = setRetouchChoice; exports.setSmartFilterMask = _chunkH65IBXFIcjs.setSmartFilterMask; exports.setSmartFiltersEnabled = _chunkH65IBXFIcjs.setSmartFiltersEnabled; exports.setSmartPlacement = _chunkH65IBXFIcjs.setSmartPlacement; exports.shadeTile = _chunkKWNMBMKGcjs.shadeTile; exports.shapeAsPixelLayer = _chunkH65IBXFIcjs.shapeAsPixelLayer; exports.shapeFromAnnotation = _chunkH65IBXFIcjs.shapeFromAnnotation; exports.shapeGeometryBounds = _chunkH65IBXFIcjs.shapeGeometryBounds; exports.shapeLayers = _chunkH65IBXFIcjs.shapeLayers; exports.shapeOutline = _chunkH65IBXFIcjs.shapeOutline; exports.shapeRenderClip = _chunkH65IBXFIcjs.shapeRenderClip; exports.shiftCoverage = _chunkQYLWG22Ncjs.shiftCoverage; exports.simplifyPixelPath = simplifyPixelPath; exports.skinToneRange = skinToneRange; exports.slicSuperpixels = _chunkL52VMQZScjs.slicSuperpixels; exports.smartFilterRows = smartFilterRows; exports.smartObjectLayers = _chunkH65IBXFIcjs.smartObjectLayers; exports.smoothCoverage = _chunkQYLWG22Ncjs.smoothCoverage; exports.smoothPoints = _chunkPQ3H2AANcjs.smoothPoints; exports.smoothnessWeights = _chunkL52VMQZScjs.smoothnessWeights; exports.smudgeEffect = _chunkYF3YZZ6Gcjs.smudgeEffect; exports.snapPolygonToEdges = snapPolygonToEdges; exports.snapTo45 = snapTo45; exports.snapToEdge = snapToEdge; exports.softMaskToSelection = _chunkL52VMQZScjs.softMaskToSelection; exports.solidPaint = _chunkPQ3H2AANcjs.solidPaint; exports.solidSurface = _chunk474IQG74cjs.solidSurface; exports.solveMembrane = _chunkMQDIP4CFcjs.solveMembrane; exports.spliceRuns = _chunkQAUIZPYIcjs.spliceRuns; exports.splitOverlayAnnotations = splitOverlayAnnotations; exports.sponge = _chunkYF3YZZ6Gcjs.sponge; exports.spongeEffect = _chunkYF3YZZ6Gcjs.spongeEffect; exports.spotHealPixels = _chunkYF3YZZ6Gcjs.spotHealPixels; exports.spotHealWindow = _chunkYF3YZZ6Gcjs.spotHealWindow; exports.srgb8ToLab = srgb8ToLab; exports.srgbByteToLinear = _chunkKWNMBMKGcjs.srgbByteToLinear; exports.srgbDecode = _chunkOLNIPTB3cjs.srgbDecode; exports.srgbEncode = _chunkOLNIPTB3cjs.srgbEncode; exports.srgbToLinear = _chunkH65IBXFIcjs.srgbToLinear; exports.standardBlendMode = _chunkOLNIPTB3cjs.standardBlendMode; exports.startMarchingAnts = startMarchingAnts; exports.startSelectionWorker = _chunkL52VMQZScjs.startSelectionWorker; exports.stepSlotTs = _chunkKWNMBMKGcjs.stepSlotTs; exports.strokeGrainCatch = _chunkPQ3H2AANcjs.strokeGrainCatch; exports.styleAt = _chunkQAUIZPYIcjs.styleAt; exports.subpathsToSvgPath = subpathsToSvgPath; exports.sumHistograms = sumHistograms; exports.superpixelSaliency = _chunkL52VMQZScjs.superpixelSaliency; exports.surfaceBytes = _chunk474IQG74cjs.surfaceBytes; exports.surfaceDepth = _chunkOLNIPTB3cjs.surfaceDepth; exports.surfaceFromDeepPixels = _chunkOLNIPTB3cjs.surfaceFromDeepPixels; exports.surfaceFromPixels = _chunk474IQG74cjs.surfaceFromPixels; exports.surfacesEqual = _chunk474IQG74cjs.surfacesEqual; exports.tempTintToXy = _chunkH65IBXFIcjs.tempTintToXy; exports.temperatureToKelvin = _chunkH65IBXFIcjs.temperatureToKelvin; exports.textIndexAt = _chunkQAUIZPYIcjs.textIndexAt; exports.textMatrix = _chunkH65IBXFIcjs.textMatrix; exports.textOrientation = _chunkH65IBXFIcjs.textOrientation; exports.textOutlines = _chunkH65IBXFIcjs.textOutlines; exports.textRange = _chunkH65IBXFIcjs.textRange; exports.tileCoord = _chunk474IQG74cjs.tileCoord; exports.tileKey = _chunk474IQG74cjs.tileKey; exports.tileRect = _chunk474IQG74cjs.tileRect; exports.tileSamples = _chunkOLNIPTB3cjs.tileSamples; exports.tileSamples16 = _chunkOLNIPTB3cjs.tileSamples16; exports.tileSamples32 = _chunkOLNIPTB3cjs.tileSamples32; exports.tilesInRect = _chunk474IQG74cjs.tilesInRect; exports.tipFalloff = _chunkPQ3H2AANcjs.tipFalloff; exports.tipReach = _chunkPQ3H2AANcjs.tipReach; exports.tipShape = _chunkPQ3H2AANcjs.tipShape; exports.to16From32 = _chunkOLNIPTB3cjs.to16From32; exports.to16From8 = _chunkOLNIPTB3cjs.to16From8; exports.to32From16 = _chunkOLNIPTB3cjs.to32From16; exports.to32From8 = _chunkOLNIPTB3cjs.to32From8; exports.to8From16 = _chunkOLNIPTB3cjs.to8From16; exports.to8From32 = _chunkOLNIPTB3cjs.to8From32; exports.toHex = toHex; exports.toTextSpace = _chunkH65IBXFIcjs.toTextSpace; exports.toneCurve = _chunkH65IBXFIcjs.toneCurve; exports.toneLuts = _chunkH65IBXFIcjs.toneLuts; exports.toneOf = _chunkYF3YZZ6Gcjs.toneOf; exports.toneRange = toneRange; exports.transformHomography = _chunkH65IBXFIcjs.transformHomography; exports.transformMap = _chunkH65IBXFIcjs.transformMap; exports.transformShapeComponents = _chunkH65IBXFIcjs.transformShapeComponents; exports.transformSurface = _chunkUOGKSVRQcjs.transformSurface; exports.transformTypeLayer = _chunkH65IBXFIcjs.transformTypeLayer; exports.transformVectorMask = _chunkH65IBXFIcjs.transformVectorMask; exports.transformedBounds = _chunkUOGKSVRQcjs.transformedBounds; exports.transformedBox = _chunkH65IBXFIcjs.transformedBox; exports.transformedPoint = _chunkH65IBXFIcjs.transformedPoint; exports.translateLayer = _chunkH65IBXFIcjs.translateLayer; exports.translateSurface = _chunk474IQG74cjs.translateSurface; exports.typeAsPixelLayer = _chunkH65IBXFIcjs.typeAsPixelLayer; exports.typeFrame = _chunkH65IBXFIcjs.typeFrame; exports.typeFromAnnotation = _chunkH65IBXFIcjs.typeFromAnnotation; exports.typeLayerAt = typeLayerAt; exports.typeLayerName = _chunkH65IBXFIcjs.typeLayerName; exports.ungroupLayer = _chunkH65IBXFIcjs.ungroupLayer; exports.uniformTile = _chunk474IQG74cjs.uniformTile; exports.unionRect = _chunkH65IBXFIcjs.unionRect; exports.unprojectCanvasPoint = _chunkH65IBXFIcjs.unprojectCanvasPoint; exports.updateLayerEffect = _chunkH65IBXFIcjs.updateLayerEffect; exports.updateLayerFilter = _chunkH65IBXFIcjs.updateLayerFilter; exports.updateLayerMaskProps = _chunkH65IBXFIcjs.updateLayerMaskProps; exports.updatePaintGradientStop = _chunkPQ3H2AANcjs.updatePaintGradientStop; exports.updateShapeLayer = _chunkH65IBXFIcjs.updateShapeLayer; exports.updateSmartFilter = _chunkH65IBXFIcjs.updateSmartFilter; exports.updateTypeLayer = _chunkH65IBXFIcjs.updateTypeLayer; exports.upscaleRegion = _chunkL52VMQZScjs.upscaleRegion; exports.userErrorMessage = _chunkH65IBXFIcjs.userErrorMessage; exports.uvToXy = _chunkH65IBXFIcjs.uvToXy; exports.validateEffectGradient = _chunkUOGKSVRQcjs.validateEffectGradient; exports.validateLayerEffect = _chunkUOGKSVRQcjs.validateLayerEffect; exports.validateLayerEffects = _chunkUOGKSVRQcjs.validateLayerEffects; exports.vectorMaskBounds = _chunkH65IBXFIcjs.vectorMaskBounds; exports.vectorMaskCoverage = _chunkH65IBXFIcjs.vectorMaskCoverage; exports.vectorMaskThumbnail = _chunkH65IBXFIcjs.vectorMaskThumbnail; exports.vectorMaskThumbnailClick = vectorMaskThumbnailClick; exports.versionedDescriptorBytes = _chunkH65IBXFIcjs.versionedDescriptorBytes; exports.vibranceLinear = _chunkH65IBXFIcjs.vibranceLinear; exports.vibrancePixel = _chunkH65IBXFIcjs.vibrancePixel; exports.walkDabs = _chunkPQ3H2AANcjs.walkDabs; exports.warpMeshEditPoints = _chunkQAUIZPYIcjs.warpMeshEditPoints; exports.warpMeshGridCurves = _chunkQAUIZPYIcjs.warpMeshGridCurves; exports.warpMeshParamAt = _chunkQAUIZPYIcjs.warpMeshParamAt; exports.warpPresetMesh = _chunkQAUIZPYIcjs.warpPresetMesh; exports.warpSurface = _chunkUOGKSVRQcjs.warpSurface; exports.watchCanvasViewport = watchCanvasViewport; exports.wbMatrix = _chunkH65IBXFIcjs.wbMatrix; exports.wetGpuSupport = _chunkKWNMBMKGcjs.wetGpuSupport; exports.wetSimdSupported = _chunkKWNMBMKGcjs.wetSimdSupported; exports.wetSupport = _chunkKWNMBMKGcjs.wetSupport; exports.whiteBalanceFromSample = _chunkH65IBXFIcjs.whiteBalanceFromSample; exports.whiteBalanceMatrix = _chunkH65IBXFIcjs.whiteBalanceMatrix; exports.withBackgroundOpacity = withBackgroundOpacity; exports.withFilterMaskSurface = _chunkH65IBXFIcjs.withFilterMaskSurface; exports.withImagePlayback = withImagePlayback; exports.withNewIds = _chunkH65IBXFIcjs.withNewIds; exports.workImage = _chunkL52VMQZScjs.workImage; exports.workLuma = _chunkL52VMQZScjs.workLuma; exports.workPlanes = _chunkL52VMQZScjs.workPlanes; exports.writeAdjustmentBlock = _chunkH65IBXFIcjs.writeAdjustmentBlock; exports.writeDeepRegion = _chunkOLNIPTB3cjs.writeDeepRegion; exports.writeLfx2 = _chunkH65IBXFIcjs.writeLfx2; exports.writePatternBlock = _chunkH65IBXFIcjs.writePatternBlock; exports.writePsd = _chunkH65IBXFIcjs.writePsd; exports.writeRegion = _chunk474IQG74cjs.writeRegion; exports.xyToTempTint = _chunkH65IBXFIcjs.xyToTempTint; exports.xyToUv = _chunkH65IBXFIcjs.xyToUv;
22143
+ exports.ADJUSTMENT_KEYS = _chunkH65IBXFIcjs.ADJUSTMENT_KEYS; exports.ADJUSTMENT_KINDS = _chunkH65IBXFIcjs.ADJUSTMENT_KINDS; exports.ADJUSTMENT_LAYER_CONTROLS = ADJUSTMENT_LAYER_CONTROLS; exports.ADJUSTMENT_LAYER_OPACITY_CONTROL = ADJUSTMENT_LAYER_OPACITY_CONTROL; exports.ADJUSTMENT_LUT_SIZE = _chunkH65IBXFIcjs.ADJUSTMENT_LUT_SIZE; exports.ANCHOR_FRACTION = _chunkH65IBXFIcjs.ANCHOR_FRACTION; exports.AS_SHOT_KELVIN = _chunkH65IBXFIcjs.AS_SHOT_KELVIN; exports.BACKGROUND_LAYER_ID = _chunkH65IBXFIcjs.BACKGROUND_LAYER_ID; exports.BACKGROUND_LAYER_NAME = _chunkH65IBXFIcjs.BACKGROUND_LAYER_NAME; exports.BIT_DEPTHS = _chunkOLNIPTB3cjs.BIT_DEPTHS; exports.BIT_DEPTH_OPTIONS = BIT_DEPTH_OPTIONS; exports.BLEND_MODES = _chunkOLNIPTB3cjs.BLEND_MODES; exports.BLUR_FILTER_ID = _chunkH65IBXFIcjs.BLUR_FILTER_ID; exports.BODY_SCATTER = _chunkKWNMBMKGcjs.BODY_SCATTER; exports.BRUSHSTROKE_MAX_SCALE = _chunkYQGCPL5Xcjs.BRUSHSTROKE_MAX_SCALE; exports.BRUSHSTROKE_MIN_SCALE = _chunkYQGCPL5Xcjs.BRUSHSTROKE_MIN_SCALE; exports.BRUSH_OPTION_CONTROLS = BRUSH_OPTION_CONTROLS; exports.BUILTIN_PROFILES = _chunkBROJYMWUcjs.BUILTIN_PROFILES; exports.BrushstrokeCache = _chunkPQ3H2AANcjs.BrushstrokeCache; exports.CANVAS_SIZE_PRESETS = CANVAS_SIZE_PRESETS; exports.CLONE_TRANSFORM_CONTROLS = CLONE_TRANSFORM_CONTROLS; exports.COLOR_MODE_OPTIONS = COLOR_MODE_OPTIONS; exports.COLOR_RANGE_PRESETS = COLOR_RANGE_PRESETS; exports.COLOR_RANGE_PRESET_LABELS = COLOR_RANGE_PRESET_LABELS; exports.CONTENT_AWARE_FILL_SAMPLING = CONTENT_AWARE_FILL_SAMPLING; exports.CONTENT_AWARE_FILL_TOOLS = CONTENT_AWARE_FILL_TOOLS; exports.ColorGmm = _chunkL52VMQZScjs.ColorGmm; exports.ContentAwareFillSession = ContentAwareFillSession; exports.CoverageMap = _chunkPQ3H2AANcjs.CoverageMap; exports.D50 = _chunkH65IBXFIcjs.D50; exports.D65 = _chunkH65IBXFIcjs.D65; exports.DEFAULT_ADJUSTMENTS = DEFAULT_ADJUSTMENTS; exports.DEFAULT_AUTO_LEADING = _chunkQAUIZPYIcjs.DEFAULT_AUTO_LEADING; exports.DEFAULT_BLENDER = _chunkPQ3H2AANcjs.DEFAULT_BLENDER; exports.DEFAULT_BRUSH = _chunkPQ3H2AANcjs.DEFAULT_BRUSH; exports.DEFAULT_CANVAS_VIEWPORT = DEFAULT_CANVAS_VIEWPORT; exports.DEFAULT_CHANNEL_COLOR = DEFAULT_CHANNEL_COLOR; exports.DEFAULT_CONTENT_AWARE_FILL_SETTINGS = DEFAULT_CONTENT_AWARE_FILL_SETTINGS; exports.DEFAULT_DEPTH_MASK = DEFAULT_DEPTH_MASK; exports.DEFAULT_FLOW = _chunkKWNMBMKGcjs.DEFAULT_FLOW; exports.DEFAULT_GLOBAL_LIGHT = _chunkUOGKSVRQcjs.DEFAULT_GLOBAL_LIGHT; exports.DEFAULT_MITER_LIMIT = _chunkH65IBXFIcjs.DEFAULT_MITER_LIMIT; exports.DEFAULT_MIXER = _chunkPQ3H2AANcjs.DEFAULT_MIXER; exports.DEFAULT_PAINT_GRADIENT = _chunkPQ3H2AANcjs.DEFAULT_PAINT_GRADIENT; exports.DEFAULT_PAINT_GRADIENT_MAPPING = _chunkPQ3H2AANcjs.DEFAULT_PAINT_GRADIENT_MAPPING; exports.DEFAULT_PROOF = DEFAULT_PROOF; exports.DEFAULT_REFINE_EDGE_PARAMS = _chunkL52VMQZScjs.DEFAULT_REFINE_EDGE_PARAMS; exports.DEFAULT_RETOUCH = _chunkYF3YZZ6Gcjs.DEFAULT_RETOUCH; exports.DEFAULT_SELECTION_TOOL_OPTIONS = DEFAULT_SELECTION_TOOL_OPTIONS; exports.DEFAULT_SELECT_AND_MASK_SETTINGS = DEFAULT_SELECT_AND_MASK_SETTINGS; exports.DEFAULT_SHAPE_TOOL_OPTIONS = DEFAULT_SHAPE_TOOL_OPTIONS; exports.DEFAULT_SMUDGE = _chunkPQ3H2AANcjs.DEFAULT_SMUDGE; exports.DEFAULT_TEXT_STYLE = _chunkQAUIZPYIcjs.DEFAULT_TEXT_STYLE; exports.DEFAULT_TRANSFORM = DEFAULT_TRANSFORM; exports.DEFAULT_TYPE_TOOL_OPTIONS = DEFAULT_TYPE_TOOL_OPTIONS; exports.DEFAULT_WET_PAPER = _chunkKWNMBMKGcjs.DEFAULT_WET_PAPER; exports.DEFAULT_WET_PARAMS = _chunkKWNMBMKGcjs.DEFAULT_WET_PARAMS; exports.DEPTH_MASK_CONTROLS = DEPTH_MASK_CONTROLS; exports.DEVELOP_FILTER_ID = _chunkH65IBXFIcjs.DEVELOP_FILTER_ID; exports.DIRECT_GAUSSIAN_MAX_SIGMA = _chunkK6PXS6DOcjs.DIRECT_GAUSSIAN_MAX_SIGMA; exports.DRY_EPS = _chunkKWNMBMKGcjs.DRY_EPS; exports.DabWalker = _chunkPQ3H2AANcjs.DabWalker; exports.EFFECT_LAYER_USES = EFFECT_LAYER_USES; exports.EMPTY_DISTANCE = _chunkQYLWG22Ncjs.EMPTY_DISTANCE; exports.EMPTY_MIXER_LOAD = _chunkPQ3H2AANcjs.EMPTY_MIXER_LOAD; exports.EX = _chunkKWNMBMKGcjs.EX; exports.EY = _chunkKWNMBMKGcjs.EY; exports.EdgeMap = EdgeMap; exports.FLAG_ALIVE = _chunkKWNMBMKGcjs.FLAG_ALIVE; exports.FLAG_BOTTOM = _chunkKWNMBMKGcjs.FLAG_BOTTOM; exports.FLAG_LEFT = _chunkKWNMBMKGcjs.FLAG_LEFT; exports.FLAG_RIGHT = _chunkKWNMBMKGcjs.FLAG_RIGHT; exports.FLAG_TOP = _chunkKWNMBMKGcjs.FLAG_TOP; exports.FLAG_WET = _chunkKWNMBMKGcjs.FLAG_WET; exports.FLAT = _chunkKWNMBMKGcjs.FLAT; exports.FREE_INTERVAL = _chunkKWNMBMKGcjs.FREE_INTERVAL; exports.FREE_TRANSFORM_CONTENTS = FREE_TRANSFORM_CONTENTS; exports.FREE_TRANSFORM_FIELDS = FREE_TRANSFORM_FIELDS; exports.FREE_TRANSFORM_MODES = _chunkH65IBXFIcjs.FREE_TRANSFORM_MODES; exports.FREE_TRANSFORM_MODE_OPTIONS = FREE_TRANSFORM_MODE_OPTIONS; exports.FreeTransformSession = FreeTransformSession; exports.FreeTransformTool = FreeTransformTool; exports.GAMMA = _chunkL52VMQZScjs.GAMMA; exports.GRAIN_PATTERNS = _chunkPQ3H2AANcjs.GRAIN_PATTERNS; exports.GRAIN_TILE = _chunkPQ3H2AANcjs.GRAIN_TILE; exports.GUIDED_FILTER_EPS = _chunkL52VMQZScjs.GUIDED_FILTER_EPS; exports.GridGraph = _chunkL52VMQZScjs.GridGraph; exports.HIDE = _chunkKWNMBMKGcjs.HIDE; exports.HISTOGRAM_BINS = HISTOGRAM_BINS; exports.HUE_RANGE_LABELS = _chunkH65IBXFIcjs.HUE_RANGE_LABELS; exports.HUE_RANGE_PRESETS = HUE_RANGE_PRESETS; exports.IDENTITY_CLONE_TRANSFORM = _chunkYF3YZZ6Gcjs.IDENTITY_CLONE_TRANSFORM; exports.IDENTITY_MATRIX3 = _chunkH65IBXFIcjs.IDENTITY_MATRIX3; exports.IMAGE_ADJUSTMENT_CONTROLS = IMAGE_ADJUSTMENT_CONTROLS; exports.IMAGE_CROP_PRESETS = IMAGE_CROP_PRESETS; exports.IMAGE_EDITOR_SCHEMA_VERSION = IMAGE_EDITOR_SCHEMA_VERSION; exports.IMAGE_EDITOR_STATE_VERSION = IMAGE_EDITOR_STATE_VERSION; exports.IMAGE_EFFECT_PLACES = IMAGE_EFFECT_PLACES; exports.IMAGE_FILTER_PRESETS = IMAGE_FILTER_PRESETS; exports.IMAGE_PLAYBACK_KIND = IMAGE_PLAYBACK_KIND; exports.IMAGE_TOOL_GROUPS = IMAGE_TOOL_GROUPS; exports.IMAGE_TOOL_SHORTCUTS = IMAGE_TOOL_SHORTCUTS; exports.INTENTS = _chunkBROJYMWUcjs.INTENTS; exports.INTENT_OPTIONS = INTENT_OPTIONS; exports.INTERPOLATIONS = _chunkUOGKSVRQcjs.INTERPOLATIONS; exports.ImageEditorController = ImageEditorController; exports.ImageEditorRenderer = ImageEditorRenderer; exports.ImageEffectsEngine = ImageEffectsEngine; exports.LATEST_PROCESS_VERSION = _chunkH65IBXFIcjs.LATEST_PROCESS_VERSION; exports.LAYERED_SCHEMA_VERSION = _chunkH65IBXFIcjs.LAYERED_SCHEMA_VERSION; exports.LAYER_EFFECT_KINDS = _chunkUOGKSVRQcjs.LAYER_EFFECT_KINDS; exports.LAYER_EFFECT_MENU = LAYER_EFFECT_MENU; exports.LEGACY_PROCESS_VERSION = _chunkH65IBXFIcjs.LEGACY_PROCESS_VERSION; exports.LIVE_SHAPE_KINDS = _chunkH65IBXFIcjs.LIVE_SHAPE_KINDS; exports.LUMA_709 = _chunkH65IBXFIcjs.LUMA_709; exports.LayerCompositor = _chunkH65IBXFIcjs.LayerCompositor; exports.LayerEffectError = _chunkUOGKSVRQcjs.LayerEffectError; exports.LayerOperationError = _chunkH65IBXFIcjs.LayerOperationError; exports.MARCHING_ANTS_STEP_MS = MARCHING_ANTS_STEP_MS; exports.MASK_FILE_ACCEPT = MASK_FILE_ACCEPT; exports.MAX_BATCH = _chunkKWNMBMKGcjs.MAX_BATCH; exports.MAX_BRUSH_SIZE = _chunkPQ3H2AANcjs.MAX_BRUSH_SIZE; exports.MAX_CANVAS_BACKING_SIDE = MAX_CANVAS_BACKING_SIDE; exports.MAX_EFFECT_ANIMATION_MS = _chunkH65IBXFIcjs.MAX_EFFECT_ANIMATION_MS; exports.MAX_EFFECT_REACH = _chunkUOGKSVRQcjs.MAX_EFFECT_REACH; exports.MAX_KELVIN = _chunkH65IBXFIcjs.MAX_KELVIN; exports.MAX_TILT_ACCEL = _chunkKWNMBMKGcjs.MAX_TILT_ACCEL; exports.MAX_TRANSFORM_PIXELS = _chunkUOGKSVRQcjs.MAX_TRANSFORM_PIXELS; exports.MAX_WET_LANES = _chunkKWNMBMKGcjs.MAX_WET_LANES; exports.MAX_WET_SLOTS = _chunkKWNMBMKGcjs.MAX_WET_SLOTS; exports.MIN_KELVIN = _chunkH65IBXFIcjs.MIN_KELVIN; exports.MIRED_PER_TEMPERATURE_UNIT = _chunkH65IBXFIcjs.MIRED_PER_TEMPERATURE_UNIT; exports.MIXER_DRAIN = _chunkPQ3H2AANcjs.MIXER_DRAIN; exports.MIXER_MIXING_OPTIONS = MIXER_MIXING_OPTIONS; exports.MIXER_OPTION_CONTROLS = MIXER_OPTION_CONTROLS; exports.MIXER_PICKUP_RATE = _chunkPQ3H2AANcjs.MIXER_PICKUP_RATE; exports.MIXING_MODELS = _chunkPQ3H2AANcjs.MIXING_MODELS; exports.MixerStroke = _chunkPQ3H2AANcjs.MixerStroke; exports.OPP = _chunkKWNMBMKGcjs.OPP; exports.PAINTERLY_BLEND_MODES = _chunkOLNIPTB3cjs.PAINTERLY_BLEND_MODES; exports.PAINT_COLOR_JSON_SCHEMA = _chunkPQ3H2AANcjs.PAINT_COLOR_JSON_SCHEMA; exports.PAINT_GRADIENT_FULL_SPEED = _chunkPQ3H2AANcjs.PAINT_GRADIENT_FULL_SPEED; exports.PAINT_GRADIENT_JSON_SCHEMA = _chunkPQ3H2AANcjs.PAINT_GRADIENT_JSON_SCHEMA; exports.PAINT_GRADIENT_KIT = _chunkPQ3H2AANcjs.PAINT_GRADIENT_KIT; exports.PAINT_GRADIENT_MAPPINGS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_MAPPINGS; exports.PAINT_GRADIENT_MAPPING_LABELS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_MAPPING_LABELS; exports.PAINT_GRADIENT_PRESETS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_PRESETS; exports.PAINT_GRADIENT_REPEATS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_REPEATS; exports.PAINT_GRADIENT_REPEAT_LABELS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_REPEAT_LABELS; exports.PAINT_GRADIENT_SPACES = _chunkPQ3H2AANcjs.PAINT_GRADIENT_SPACES; exports.PAINT_GRADIENT_SPACE_LABELS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_SPACE_LABELS; exports.PAINT_SOURCE_JSON_SCHEMA = _chunkPQ3H2AANcjs.PAINT_SOURCE_JSON_SCHEMA; exports.PAINT_TOOLS = PAINT_TOOLS; exports.PAPER_CAPACITY = _chunkKWNMBMKGcjs.PAPER_CAPACITY; exports.PARAGRAPH_STYLE_FIELDS = _chunkH65IBXFIcjs.PARAGRAPH_STYLE_FIELDS; exports.PARAM = _chunkKWNMBMKGcjs.PARAM; exports.PARAM_FLOATS = _chunkKWNMBMKGcjs.PARAM_FLOATS; exports.PASTE_MODES = PASTE_MODES; exports.PATH_EDIT_TOOLS = PATH_EDIT_TOOLS; exports.PATTERN_BLOCK_KEYS = _chunkH65IBXFIcjs.PATTERN_BLOCK_KEYS; exports.PIGMENT_BANDS = _chunkOLNIPTB3cjs.PIGMENT_BANDS; exports.PIGMENT_CHANNELS = _chunkKWNMBMKGcjs.PIGMENT_CHANNELS; exports.PIGMENT_LAMBDA_MIN = _chunkOLNIPTB3cjs.PIGMENT_LAMBDA_MIN; exports.PIGMENT_LAMBDA_STEP = _chunkOLNIPTB3cjs.PIGMENT_LAMBDA_STEP; exports.PIGMENT_UNIT = _chunkKWNMBMKGcjs.PIGMENT_UNIT; exports.PIGMENT_WAVELENGTHS = _chunkOLNIPTB3cjs.PIGMENT_WAVELENGTHS; exports.PLANE = _chunkKWNMBMKGcjs.PLANE; exports.PLANE_BYTES = _chunkKWNMBMKGcjs.PLANE_BYTES; exports.PREVIEW_SIZE = PREVIEW_SIZE; exports.PROOF_PROFILE_OPTIONS = PROOF_PROFILE_OPTIONS; exports.PSD_BLEND_KEYS = _chunkH65IBXFIcjs.PSD_BLEND_KEYS; exports.PSD_FILE_ACCEPT = PSD_FILE_ACCEPT; exports.P_D0 = _chunkKWNMBMKGcjs.P_D0; exports.P_EDGE = _chunkKWNMBMKGcjs.P_EDGE; exports.P_FX = _chunkKWNMBMKGcjs.P_FX; exports.P_FY = _chunkKWNMBMKGcjs.P_FY; exports.P_H = _chunkKWNMBMKGcjs.P_H; exports.P_P0 = _chunkKWNMBMKGcjs.P_P0; exports.P_RHO = _chunkKWNMBMKGcjs.P_RHO; exports.P_SW = _chunkKWNMBMKGcjs.P_SW; exports.P_UX = _chunkKWNMBMKGcjs.P_UX; exports.P_UY = _chunkKWNMBMKGcjs.P_UY; exports.PaintExchange = _chunkPQ3H2AANcjs.PaintExchange; exports.PaintGesture = PaintGesture; exports.PaintGradientSampler = _chunkPQ3H2AANcjs.PaintGradientSampler; exports.PaintSourceError = _chunkPQ3H2AANcjs.PaintSourceError; exports.PaintStrokeSession = PaintStrokeSession; exports.PaperGrain = _chunkPQ3H2AANcjs.PaperGrain; exports.PathEditGesture = PathEditGesture; exports.PatternPlacement = _chunkUOGKSVRQcjs.PatternPlacement; exports.PatternTile = _chunkUOGKSVRQcjs.PatternTile; exports.PsdError = _chunkH65IBXFIcjs.PsdError; exports.QUICK_MASK_TARGET = QUICK_MASK_TARGET; exports.REFINE_EDGE_CONTROLS = REFINE_EDGE_CONTROLS; exports.REFINE_EDIT_KINDS = _chunkL52VMQZScjs.REFINE_EDIT_KINDS; exports.REFINE_OUTPUTS = REFINE_OUTPUTS; exports.RETOUCH_CHOICES = RETOUCH_CHOICES; exports.RETOUCH_OPTION_CONTROLS = RETOUCH_OPTION_CONTROLS; exports.RETOUCH_SAMPLES = _chunkYF3YZZ6Gcjs.RETOUCH_SAMPLES; exports.RETOUCH_TOGGLES = RETOUCH_TOGGLES; exports.RETOUCH_TOOLS = RETOUCH_TOOLS; exports.RegionPixelSource = _chunkYF3YZZ6Gcjs.RegionPixelSource; exports.RetouchDabStroke = _chunkYF3YZZ6Gcjs.RetouchDabStroke; exports.SELECTION_MODES = _chunkQYLWG22Ncjs.SELECTION_MODES; exports.SELECTION_MODE_LABELS = SELECTION_MODE_LABELS; exports.SELECTION_MODIFY_OPS = _chunkQYLWG22Ncjs.SELECTION_MODIFY_OPS; exports.SELECTION_TOOLS = SELECTION_TOOLS; exports.SELECT_AND_MASK_TOOLS = SELECT_AND_MASK_TOOLS; exports.SELECT_AND_MASK_VIEWS = SELECT_AND_MASK_VIEWS; exports.SET_PLANES = _chunkKWNMBMKGcjs.SET_PLANES; exports.SHADOW_AMBIENT = _chunkOLNIPTB3cjs.SHADOW_AMBIENT; exports.SHAPE_KIND_LABELS = SHAPE_KIND_LABELS; exports.SHAPE_OPERATIONS = _chunkH65IBXFIcjs.SHAPE_OPERATIONS; exports.SHAPE_RENDER_MARGIN = _chunkH65IBXFIcjs.SHAPE_RENDER_MARGIN; exports.SLOT_BYTES = _chunkKWNMBMKGcjs.SLOT_BYTES; exports.SLOT_PLANES = _chunkKWNMBMKGcjs.SLOT_PLANES; exports.SLOT_SIDE = _chunkKWNMBMKGcjs.SLOT_SIDE; exports.SMART_RENDER_MARGIN = _chunkH65IBXFIcjs.SMART_RENDER_MARGIN; exports.SPOT_HEAL_TYPES = _chunkYF3YZZ6Gcjs.SPOT_HEAL_TYPES; exports.SRGB_TO_LINEAR = _chunkKWNMBMKGcjs.SRGB_TO_LINEAR; exports.STRIP = _chunkKWNMBMKGcjs.STRIP; exports.SUPPORTED_ADJUSTMENT_KEYS = _chunkH65IBXFIcjs.SUPPORTED_ADJUSTMENT_KEYS; exports.SelectAndMaskSession = SelectAndMaskSession; exports.SelectionGesture = SelectionGesture; exports.SelectionWorkerClient = _chunkL52VMQZScjs.SelectionWorkerClient; exports.ShapeDrawGesture = ShapeDrawGesture; exports.SmudgeTip = _chunkPQ3H2AANcjs.SmudgeTip; exports.StrokeCoverage = _chunkPQ3H2AANcjs.StrokeCoverage; exports.SurfaceDraft = _chunk474IQG74cjs.SurfaceDraft; exports.TEXT_ALIGNS = _chunkH65IBXFIcjs.TEXT_ALIGNS; exports.TEXT_ORIENTATIONS = _chunkH65IBXFIcjs.TEXT_ORIENTATIONS; exports.TEXT_RENDER_MARGIN = _chunkH65IBXFIcjs.TEXT_RENDER_MARGIN; exports.TEXT_STYLE_FIELDS = _chunkH65IBXFIcjs.TEXT_STYLE_FIELDS; exports.TILE = _chunk474IQG74cjs.TILE; exports.TILE_SHIFT = _chunk474IQG74cjs.TILE_SHIFT; exports.TINT_SCALE = _chunkH65IBXFIcjs.TINT_SCALE; exports.TIP_GRADIENT_STEPS = _chunkPQ3H2AANcjs.TIP_GRADIENT_STEPS; exports.TONE_LUT_SIZE = _chunkH65IBXFIcjs.TONE_LUT_SIZE; exports.TONE_RANGES = _chunkYF3YZZ6Gcjs.TONE_RANGES; exports.TONE_RANGE_PRESETS = TONE_RANGE_PRESETS; exports.TRANSFORM_ANCHORS = _chunkH65IBXFIcjs.TRANSFORM_ANCHORS; exports.TRANSFORM_ROTATE_HANDLE_OFFSET = TRANSFORM_ROTATE_HANDLE_OFFSET; exports.TextEditSession = TextEditSession; exports.TileMedium = _chunkPQ3H2AANcjs.TileMedium; exports.TilePixelSource = _chunkYF3YZZ6Gcjs.TilePixelSource; exports.TileableNoise = _chunkPQ3H2AANcjs.TileableNoise; exports.TiledSurface = _chunk474IQG74cjs.TiledSurface; exports.TransformTooLargeError = _chunkUOGKSVRQcjs.TransformTooLargeError; exports.TransformedPixelSource = _chunkYF3YZZ6Gcjs.TransformedPixelSource; exports.TypeToolGesture = TypeToolGesture; exports.UNITS = _chunkL52VMQZScjs.UNITS; exports.U_MAX = _chunkKWNMBMKGcjs.U_MAX; exports.VIBRANCE_GREY = _chunkH65IBXFIcjs.VIBRANCE_GREY; exports.W9 = _chunkKWNMBMKGcjs.W9; exports.WARP_GRID_OPTIONS = WARP_GRID_OPTIONS; exports.WARP_STYLES = _chunkQAUIZPYIcjs.WARP_STYLES; exports.WARP_STYLE_LABELS = _chunkQAUIZPYIcjs.WARP_STYLE_LABELS; exports.WARP_STYLE_OPTIONS = WARP_STYLE_OPTIONS; exports.WET_FLOW_KINDS = _chunkKWNMBMKGcjs.WET_FLOW_KINDS; exports.WET_PARAM_KEYS = _chunkKWNMBMKGcjs.WET_PARAM_KEYS; exports.WET_TILE = _chunkKWNMBMKGcjs.WET_TILE; exports.WGSL_HALO = _chunkKWNMBMKGcjs.WGSL_HALO; exports.WGSL_SHADE = _chunkKWNMBMKGcjs.WGSL_SHADE; exports.WGSL_STEP = _chunkKWNMBMKGcjs.WGSL_STEP; exports.WORKING_SPACE_OPTIONS = WORKING_SPACE_OPTIONS; exports.WORK_PATH_NAME = WORK_PATH_NAME; exports.WORK_SIZE = _chunkL52VMQZScjs.WORK_SIZE; exports.WetGpuEngine = _chunkKWNMBMKGcjs.WetGpuEngine; exports.WetMedium = _chunkKWNMBMKGcjs.WetMedium; exports.WetWorkerPool = _chunkKWNMBMKGcjs.WetWorkerPool; exports.WetWorld = _chunkKWNMBMKGcjs.WetWorld; exports.WetWorldError = _chunkKWNMBMKGcjs.WetWorldError; exports.XYZ_D50_TO_SRGB = _chunkH65IBXFIcjs.XYZ_D50_TO_SRGB; exports.ZlibError = _chunkXFM3OCHUcjs.ZlibError; exports.activeAdjustmentLayers = _chunkH65IBXFIcjs.activeAdjustmentLayers; exports.activeEffectSmartFilters = _chunkH65IBXFIcjs.activeEffectSmartFilters; exports.activeLayerAfterRemoval = _chunkH65IBXFIcjs.activeLayerAfterRemoval; exports.activeSmartFilters = _chunkH65IBXFIcjs.activeSmartFilters; exports.addLayerEffect = _chunkH65IBXFIcjs.addLayerEffect; exports.addLayerFilter = _chunkH65IBXFIcjs.addLayerFilter; exports.addLayerOfKind = addLayerOfKind; exports.addPaintGradientStop = _chunkPQ3H2AANcjs.addPaintGradientStop; exports.addSmartFilter = _chunkH65IBXFIcjs.addSmartFilter; exports.addToHistogram = addToHistogram; exports.adjustmentKindLabel = _chunkH65IBXFIcjs.adjustmentKindLabel; exports.adjustmentLayersKey = _chunkH65IBXFIcjs.adjustmentLayersKey; exports.adjustmentNodeAsLayer = _chunkH65IBXFIcjs.adjustmentNodeAsLayer; exports.adjustmentNodeFromLegacy = _chunkH65IBXFIcjs.adjustmentNodeFromLegacy; exports.adler32 = _chunkXFM3OCHUcjs.adler32; exports.agentDragDraft = agentDragDraft; exports.anchorPoint = _chunkH65IBXFIcjs.anchorPoint; exports.annotationBlend = _chunkH65IBXFIcjs.annotationBlend; exports.annotationLayerFor = _chunkH65IBXFIcjs.annotationLayerFor; exports.annotationLayerName = _chunkH65IBXFIcjs.annotationLayerName; exports.annotationOfLayer = _chunkH65IBXFIcjs.annotationOfLayer; exports.annotationOfShape = _chunkH65IBXFIcjs.annotationOfShape; exports.annotationOfType = _chunkH65IBXFIcjs.annotationOfType; exports.applyAdjustmentLayers = _chunkH65IBXFIcjs.applyAdjustmentLayers; exports.applyAdjustmentLayersFloat = _chunkH65IBXFIcjs.applyAdjustmentLayersFloat; exports.applyAdjustments = _chunkH65IBXFIcjs.applyAdjustments; exports.applyBoxBlur = _chunkH65IBXFIcjs.applyBoxBlur; exports.applyBoxBlurFloat = _chunkH65IBXFIcjs.applyBoxBlurFloat; exports.applyDepthMask = _chunkH65IBXFIcjs.applyDepthMask; exports.applyHomography = _chunkQT26RHKKcjs.applyHomography; exports.applyImageProjectionToContext = _chunkH65IBXFIcjs.applyImageProjectionToContext; exports.applyLegacyAdjustments = _chunkH65IBXFIcjs.applyLegacyAdjustments; exports.applyLegacyFloat = _chunkH65IBXFIcjs.applyLegacyFloat; exports.applyMatrix3 = _chunkH65IBXFIcjs.applyMatrix3; exports.applyOutputStage = applyOutputStage; exports.applyParams = _chunkH65IBXFIcjs.applyParams; exports.applyProcess2Adjustments = _chunkH65IBXFIcjs.applyProcess2Adjustments; exports.applyProcess2Float = _chunkH65IBXFIcjs.applyProcess2Float; exports.applyRefineEdits = _chunkL52VMQZScjs.applyRefineEdits; exports.applyRegionBlur = applyRegionBlur; exports.applyRegionMosaic = applyRegionMosaic; exports.applyRetouchToTile = _chunkYF3YZZ6Gcjs.applyRetouchToTile; exports.applyShapeOptions = applyShapeOptions; exports.applySmartFilters = _chunkH65IBXFIcjs.applySmartFilters; exports.applyStrokeToDeepTile = _chunkPQ3H2AANcjs.applyStrokeToDeepTile; exports.applyStrokeToTile = _chunkPQ3H2AANcjs.applyStrokeToTile; exports.applyToneToDeepTile = _chunkYF3YZZ6Gcjs.applyToneToDeepTile; exports.backgroundLayer = _chunkH65IBXFIcjs.backgroundLayer; exports.base64ToBytes = _chunkOLNIPTB3cjs.base64ToBytes; exports.baseProjection = baseProjection; exports.bestOffset = _chunkMQDIP4CFcjs.bestOffset; exports.blackWhiteGray = _chunkH65IBXFIcjs.blackWhiteGray; exports.blendChannel = _chunkOLNIPTB3cjs.blendChannel; exports.blendImageData = _chunkOLNIPTB3cjs.blendImageData; exports.blendLum = _chunkOLNIPTB3cjs.blendLum; exports.blendPixel = _chunkOLNIPTB3cjs.blendPixel; exports.blendRadius = _chunkPQ3H2AANcjs.blendRadius; exports.blendRgb = _chunkOLNIPTB3cjs.blendRgb; exports.blendTile = _chunkUOGKSVRQcjs.blendTile; exports.blenderDab = _chunkPQ3H2AANcjs.blenderDab; exports.blurFilter = _chunkH65IBXFIcjs.blurFilter; exports.borderCoverage = _chunkQYLWG22Ncjs.borderCoverage; exports.boxBlur = _chunkL52VMQZScjs.boxBlur; exports.boxBlurPixels = _chunkYF3YZZ6Gcjs.boxBlurPixels; exports.boxFrameHit = boxFrameHit; exports.boxFrameOverlay = boxFrameOverlay; exports.boxMean = _chunkL52VMQZScjs.boxMean; exports.boxPointOf = _chunkH65IBXFIcjs.boxPointOf; exports.boxQuad = _chunkQT26RHKKcjs.boxQuad; exports.boxToCurvePoint = boxToCurvePoint; exports.bradfordAdaptation = _chunkH65IBXFIcjs.bradfordAdaptation; exports.brushStrokeMask = _chunkL52VMQZScjs.brushStrokeMask; exports.brushstrokeDataUrl = _chunkPQ3H2AANcjs.brushstrokeDataUrl; exports.brushstrokeKey = _chunkPQ3H2AANcjs.brushstrokeKey; exports.brushstrokeSamples = _chunkPQ3H2AANcjs.brushstrokeSamples; exports.brushstrokeScaleBucket = _chunkYQGCPL5Xcjs.brushstrokeScaleBucket; exports.brushstrokeStrokeOptions = _chunkPQ3H2AANcjs.brushstrokeStrokeOptions; exports.brushstrokeToCanvas = _chunkPQ3H2AANcjs.brushstrokeToCanvas; exports.buildLayerMaskPlanes = _chunkH65IBXFIcjs.buildLayerMaskPlanes; exports.buildToneLut = _chunkH65IBXFIcjs.buildToneLut; exports.builtinPattern = _chunkUOGKSVRQcjs.builtinPattern; exports.builtinPatternIds = _chunkUOGKSVRQcjs.builtinPatternIds; exports.bytesToBase64 = _chunkOLNIPTB3cjs.bytesToBase64; exports.calculateCropDrag = _chunkH65IBXFIcjs.calculateCropDrag; exports.canShareMemory = _chunkKWNMBMKGcjs.canShareMemory; exports.canvasCompositeOperation = _chunkOLNIPTB3cjs.canvasCompositeOperation; exports.canvasToImagePoint = _chunkH65IBXFIcjs.canvasToImagePoint; exports.caretAt = _chunkQAUIZPYIcjs.caretAt; exports.changedTiles = _chunkUOGKSVRQcjs.changedTiles; exports.channelThumbnail = channelThumbnail; exports.checkEffectAnimation = checkEffectAnimation; exports.checkEffectTime = checkEffectTime; exports.checkImageEffectPlace = checkImageEffectPlace; exports.clampControlValue = clampControlValue; exports.clampCropToImage = _chunkH65IBXFIcjs.clampCropToImage; exports.cleanMixer = _chunkPQ3H2AANcjs.cleanMixer; exports.cloneSamplePoint = _chunkYF3YZZ6Gcjs.cloneSamplePoint; exports.cloneSourceLabel = cloneSourceLabel; exports.cloneTransformView = cloneTransformView; exports.collectTiles = _chunk474IQG74cjs.collectTiles; exports.colorBalanceChannel = _chunkH65IBXFIcjs.colorBalanceChannel; exports.colorModePlanes = colorModePlanes; exports.colorModePlanes16 = colorModePlanes16; exports.colorPanelView = colorPanelView; exports.colorRange = colorRange; exports.colorRangePreset = colorRangePreset; exports.combineSelections = _chunkQYLWG22Ncjs.combineSelections; exports.compileAdjustmentLayer = _chunkH65IBXFIcjs.compileAdjustmentLayer; exports.componentPath = _chunkH65IBXFIcjs.componentPath; exports.componentsCoverage = _chunkH65IBXFIcjs.componentsCoverage; exports.compositeDeep = _chunkH65IBXFIcjs.compositeDeep; exports.compositeSurfaceOver = _chunkUOGKSVRQcjs.compositeSurfaceOver; exports.computeHistogram = computeHistogram; exports.computeSelectionBounds = _chunkQYLWG22Ncjs.computeSelectionBounds; exports.contentAwareFill = _chunkMQDIP4CFcjs.contentAwareFill; exports.contentBounds = _chunk474IQG74cjs.contentBounds; exports.contentsBox = _chunkH65IBXFIcjs.contentsBox; exports.contentsSurface = _chunkH65IBXFIcjs.contentsSurface; exports.contractCoverage = _chunkQYLWG22Ncjs.contractCoverage; exports.controlPosition = controlPosition; exports.controlTrackBackground = controlTrackBackground; exports.convertColorFields = convertColorFields; exports.convertHex = convertHex; exports.convertSurfaceColors = convertSurfaceColors; exports.convertSurfaceDepth = _chunkOLNIPTB3cjs.convertSurfaceDepth; exports.convertToSmartObject = _chunkH65IBXFIcjs.convertToSmartObject; exports.copySmartObject = _chunkH65IBXFIcjs.copySmartObject; exports.cornersFromMatrix = _chunkH65IBXFIcjs.cornersFromMatrix; exports.coverageTileCoord = _chunkPQ3H2AANcjs.coverageTileCoord; exports.coverageToByte = _chunkQYLWG22Ncjs.coverageToByte; exports.coveringRect = coveringRect; exports.createAdjustmentLayer = _chunkH65IBXFIcjs.createAdjustmentLayer; exports.createBlenderScratch = _chunkPQ3H2AANcjs.createBlenderScratch; exports.createCanvasTextShaper = _chunkQAUIZPYIcjs.createCanvasTextShaper; exports.createImageCaptureSurface = createImageCaptureSurface; exports.createImageColorTools = createImageColorTools; exports.createImageEditTools = createImageEditTools; exports.createImageEditorDocument = createImageEditorDocument; exports.createImageEditorToolProvider = createImageEditorToolProvider; exports.createImageEffectTools = createImageEffectTools; exports.createImageEffectsToolProvider = createImageEffectsToolProvider; exports.createImageLayerTools = createImageLayerTools; exports.createImagePaintTools = createImagePaintTools; exports.createImagePlaybackLocator = createImagePlaybackLocator; exports.createImagePsdTools = createImagePsdTools; exports.createImageRetouchTools = createImageRetouchTools; exports.createImageSegmentationToolProvider = createImageSegmentationToolProvider; exports.createImageSelectionTools = createImageSelectionTools; exports.createImageShapeTools = createImageShapeTools; exports.createImageSmartObjectTools = createImageSmartObjectTools; exports.createImageSubjectSelectionTool = createImageSubjectSelectionTool; exports.createImageTransformTools = createImageTransformTools; exports.createImageTypeTools = createImageTypeTools; exports.createMetricTextShaper = _chunkQAUIZPYIcjs.createMetricTextShaper; exports.createOutlineTextShaper = _chunkQAUIZPYIcjs.createOutlineTextShaper; exports.createPigment = _chunkOLNIPTB3cjs.createPigment; exports.createPigmentTools = _chunkKWNMBMKGcjs.createPigmentTools; exports.createSelectionMask = _chunkQYLWG22Ncjs.createSelectionMask; exports.createShapeLayer = _chunkH65IBXFIcjs.createShapeLayer; exports.createTypeLayer = _chunkH65IBXFIcjs.createTypeLayer; exports.createWetGpuEngine = _chunkKWNMBMKGcjs.createWetGpuEngine; exports.cssFont = _chunkQAUIZPYIcjs.cssFont; exports.cssFontFamily = _chunkQAUIZPYIcjs.cssFontFamily; exports.curveLut = _chunkUOGKSVRQcjs.curveLut; exports.curveLutFromLevels = _chunkH65IBXFIcjs.curveLutFromLevels; exports.curvePointToBox = curvePointToBox; exports.curveSvgPath = curveSvgPath; exports.dabCoverage = _chunkPQ3H2AANcjs.dabCoverage; exports.dabRect = _chunkPQ3H2AANcjs.dabRect; exports.decodeDeepSurface = _chunkH65IBXFIcjs.decodeDeepSurface; exports.decodeLayerChannel = _chunkH65IBXFIcjs.decodeLayerChannel; exports.decodeLayerMask = _chunkH65IBXFIcjs.decodeLayerMask; exports.decodeMergedImage = _chunkH65IBXFIcjs.decodeMergedImage; exports.decodePlanes = _chunkH65IBXFIcjs.decodePlanes; exports.decodePng = _chunkOLNIPTB3cjs.decodePng; exports.decodePngDataUrl = _chunkH65IBXFIcjs.decodePngDataUrl; exports.decodeSelectionRle = _chunkQYLWG22Ncjs.decodeSelectionRle; exports.decontaminateColors = _chunkL52VMQZScjs.decontaminateColors; exports.deepBytes = _chunkOLNIPTB3cjs.deepBytes; exports.deepTile = _chunkOLNIPTB3cjs.deepTile; exports.defaultActiveLayerId = _chunkH65IBXFIcjs.defaultActiveLayerId; exports.defaultAdjustmentParams = _chunkH65IBXFIcjs.defaultAdjustmentParams; exports.defaultEffectGradient = _chunkUOGKSVRQcjs.defaultEffectGradient; exports.defaultLayerEffect = _chunkUOGKSVRQcjs.defaultLayerEffect; exports.defaultShapeName = _chunkH65IBXFIcjs.defaultShapeName; exports.deflate = _chunkXFM3OCHUcjs.deflate; exports.deflateRaw = _chunkXFM3OCHUcjs.deflateRaw; exports.depthMaskAlpha = _chunkH65IBXFIcjs.depthMaskAlpha; exports.depthOf = _chunkOLNIPTB3cjs.depthOf; exports.depthRasterMask = _chunkH65IBXFIcjs.depthRasterMask; exports.describeChannel = describeChannel; exports.describeLayer = describeLayer; exports.describeLayerEffects = describeLayerEffects; exports.describeSelection = describeSelection; exports.describeTransform = _chunkH65IBXFIcjs.describeTransform; exports.deserializeChannels = deserializeChannels; exports.deserializeColorMode = deserializeColorMode; exports.deserializeColorProfile = deserializeColorProfile; exports.deserializeEffects = _chunkH65IBXFIcjs.deserializeEffects; exports.deserializeLayer = _chunkH65IBXFIcjs.deserializeLayer; exports.deserializeLayers = _chunkH65IBXFIcjs.deserializeLayers; exports.deserializeMask = _chunkL52VMQZScjs.deserializeMask; exports.deserializePatterns = _chunkH65IBXFIcjs.deserializePatterns; exports.deserializeSelection = _chunkQYLWG22Ncjs.deserializeSelection; exports.developFilter = _chunkH65IBXFIcjs.developFilter; exports.developFromAdjustments = _chunkH65IBXFIcjs.developFromAdjustments; exports.developTarget = _chunkH65IBXFIcjs.developTarget; exports.dexp = _chunkKWNMBMKGcjs.dexp; exports.dilateMask = _chunkMQDIP4CFcjs.dilateMask; exports.displayTransform = displayTransform; exports.distanceTransform = _chunkQYLWG22Ncjs.distanceTransform; exports.dlog = _chunkKWNMBMKGcjs.dlog; exports.documentContents = _chunkH65IBXFIcjs.documentContents; exports.documentProfile = documentProfile; exports.dodgeBurn = _chunkYF3YZZ6Gcjs.dodgeBurn; exports.dodgeBurnCurve = _chunkYF3YZZ6Gcjs.dodgeBurnCurve; exports.downloadMaskImage = downloadMaskImage; exports.downloadPsd = downloadPsd; exports.dpow = _chunkKWNMBMKGcjs.dpow; exports.dragWarpMeshPoint = _chunkQAUIZPYIcjs.dragWarpMeshPoint; exports.dropPlacement = dropPlacement; exports.dropZone = dropZone; exports.dsincos = _chunkKWNMBMKGcjs.dsincos; exports.duplicateLayer = _chunkH65IBXFIcjs.duplicateLayer; exports.edgeBits = _chunkKWNMBMKGcjs.edgeBits; exports.edgeWidth = _chunkL52VMQZScjs.edgeWidth; exports.effectColorHex = _chunkUOGKSVRQcjs.effectColorHex; exports.effectControlChange = effectControlChange; exports.effectLayerTiming = effectLayerTiming; exports.effectPixelsToSurface = effectPixelsToSurface; exports.effectReach = _chunkUOGKSVRQcjs.effectReach; exports.effectiveLayerMask = _chunkH65IBXFIcjs.effectiveLayerMask; exports.effectiveProof = effectiveProof; exports.effectsFingerprint = _chunkUOGKSVRQcjs.effectsFingerprint; exports.effectsMargin = _chunkUOGKSVRQcjs.effectsMargin; exports.effectsScale = _chunkUOGKSVRQcjs.effectsScale; exports.ellipsePoints = _chunkL52VMQZScjs.ellipsePoints; exports.ellipseSelection = _chunkL52VMQZScjs.ellipseSelection; exports.emptyHistogram = emptyHistogram; exports.emptySurface = _chunk474IQG74cjs.emptySurface; exports.encodeDeepSurface = _chunkH65IBXFIcjs.encodeDeepSurface; exports.encodePng = _chunkOLNIPTB3cjs.encodePng; exports.encodeRle = _chunkH65IBXFIcjs.encodeRle; exports.encodeSelectionRle = _chunkQYLWG22Ncjs.encodeSelectionRle; exports.encodeSurface = _chunkH65IBXFIcjs.encodeSurface; exports.evalWarpMesh = _chunkQAUIZPYIcjs.evalWarpMesh; exports.evaluateAdjustmentLayers = _chunkH65IBXFIcjs.evaluateAdjustmentLayers; exports.exchangeRates = _chunkPQ3H2AANcjs.exchangeRates; exports.expNeg = _chunkKWNMBMKGcjs.expNeg; exports.expandCoverage = _chunkQYLWG22Ncjs.expandCoverage; exports.exportPsd = _chunkH65IBXFIcjs.exportPsd; exports.extractNormalizedLayerItems = extractNormalizedLayerItems; exports.featherCoverage = _chunkQYLWG22Ncjs.featherCoverage; exports.fillRect = _chunk474IQG74cjs.fillRect; exports.filmPixel = _chunkKWNMBMKGcjs.filmPixel; exports.filmReflectance = _chunkKWNMBMKGcjs.filmReflectance; exports.filterMaskCoverage = _chunkH65IBXFIcjs.filterMaskCoverage; exports.findAdjustmentControl = findAdjustmentControl; exports.findLayer = _chunkUOGKSVRQcjs.findLayer; exports.findLayerControl = findLayerControl; exports.findSky = _chunkL52VMQZScjs.findSky; exports.findSubject = _chunkL52VMQZScjs.findSubject; exports.findWebGpu = _chunkKWNMBMKGcjs.findWebGpu; exports.finishTile = _chunk474IQG74cjs.finishTile; exports.fitParagraphRuns = _chunkQAUIZPYIcjs.fitParagraphRuns; exports.fitRuns = _chunkQAUIZPYIcjs.fitRuns; exports.flattenLayers = _chunkUOGKSVRQcjs.flattenLayers; exports.flattenPath = _chunkH65IBXFIcjs.flattenPath; exports.flipCorners = _chunkH65IBXFIcjs.flipCorners; exports.flowField = _chunkKWNMBMKGcjs.flowField; exports.focusArea = _chunkL52VMQZScjs.focusArea; exports.followLayerMove = _chunkH65IBXFIcjs.followLayerMove; exports.fontOf = _chunkQAUIZPYIcjs.fontOf; exports.forgetSelectAndMaskSettings = forgetSelectAndMaskSettings; exports.formatControlValue = formatControlValue; exports.fullSelection = _chunkQYLWG22Ncjs.fullSelection; exports.gaussianBlur = _chunkK6PXS6DOcjs.gaussianBlur; exports.geometryHomography = _chunkH65IBXFIcjs.geometryHomography; exports.getAnnotationBounds = _chunkH65IBXFIcjs.getAnnotationBounds; exports.getControlPath = getControlPath; exports.getCropCursor = _chunkH65IBXFIcjs.getCropCursor; exports.getRotatedSize = _chunkH65IBXFIcjs.getRotatedSize; exports.getViewportMetrics = _chunkH65IBXFIcjs.getViewportMetrics; exports.getViewportProjection = _chunkH65IBXFIcjs.getViewportProjection; exports.globalImageCache = globalImageCache; exports.grabCutLabels = _chunkL52VMQZScjs.grabCutLabels; exports.gradientDabColor = _chunkPQ3H2AANcjs.gradientDabColor; exports.grainCatch = _chunkPQ3H2AANcjs.grainCatch; exports.grainHeights = _chunkPQ3H2AANcjs.grainHeights; exports.greyMorphology = _chunkQYLWG22Ncjs.greyMorphology; exports.groupLayers = _chunkH65IBXFIcjs.groupLayers; exports.growSelection = growSelection; exports.guidePlanes = _chunkL52VMQZScjs.guidePlanes; exports.guidedFilterColor = _chunkL52VMQZScjs.guidedFilterColor; exports.handleMaskViewKey = handleMaskViewKey; exports.handlePaintShortcut = handlePaintShortcut; exports.handleQuickMaskKey = handleQuickMaskKey; exports.handleSelectionShortcut = handleSelectionShortcut; exports.hasActiveEffects = _chunkUOGKSVRQcjs.hasActiveEffects; exports.hasLayersBelow = hasLayersBelow; exports.hasResampledLegacyMask = _chunkH65IBXFIcjs.hasResampledLegacyMask; exports.hasSurface = _chunkH65IBXFIcjs.hasSurface; exports.hasWarp = _chunkH65IBXFIcjs.hasWarp; exports.hash2 = _chunkPQ3H2AANcjs.hash2; exports.hashMaskContent = _chunkQYLWG22Ncjs.hashMaskContent; exports.hashNoise = _chunkUOGKSVRQcjs.hashNoise; exports.healPixels = _chunkYF3YZZ6Gcjs.healPixels; exports.hexToPaintRgb = _chunkPQ3H2AANcjs.hexToPaintRgb; exports.hexToRgb = _chunkH65IBXFIcjs.hexToRgb; exports.histogramPath = histogramPath; exports.hitTestAnnotation = _chunkH65IBXFIcjs.hitTestAnnotation; exports.hitTestCrop = _chunkH65IBXFIcjs.hitTestCrop; exports.hitTestCurvePoint = hitTestCurvePoint; exports.homographyFromAffine = _chunkQT26RHKKcjs.homographyFromAffine; exports.homographyFromPoints = _chunkQT26RHKKcjs.homographyFromPoints; exports.hslToRgb = _chunkH65IBXFIcjs.hslToRgb; exports.hueRange = hueRange; exports.hueRangeTables = _chunkH65IBXFIcjs.hueRangeTables; exports.hueRangeWeight = _chunkH65IBXFIcjs.hueRangeWeight; exports.hueSaturation = _chunkH65IBXFIcjs.hueSaturation; exports.identityCurve = _chunkH65IBXFIcjs.identityCurve; exports.identityLevels = _chunkH65IBXFIcjs.identityLevels; exports.identityTransform = _chunkH65IBXFIcjs.identityTransform; exports.identityWarpMesh = _chunkQAUIZPYIcjs.identityWarpMesh; exports.imageEditorStateMigrations = imageEditorStateMigrations; exports.imageLayerAppliedEffects = imageLayerAppliedEffects; exports.imagePanelTool = imagePanelTool; exports.imagePlaybackPanel = imagePlaybackPanel; exports.imageToCanvasPoint = _chunkH65IBXFIcjs.imageToCanvasPoint; exports.imageToolCanvasMode = imageToolCanvasMode; exports.imageToolForShortcut = imageToolForShortcut; exports.imageToolGroup = imageToolGroup; exports.imageToolLabel = imageToolLabel; exports.imageToolPanel = imageToolPanel; exports.importPsd = _chunkH65IBXFIcjs.importPsd; exports.inflate = _chunkXFM3OCHUcjs.inflate; exports.inflateRaw = _chunkXFM3OCHUcjs.inflateRaw; exports.insertCurvePoint = insertCurvePoint; exports.insertLayer = _chunkUOGKSVRQcjs.insertLayer; exports.instancesOf = _chunkH65IBXFIcjs.instancesOf; exports.invertHomography = _chunkQT26RHKKcjs.invertHomography; exports.invertMatrix3 = _chunkH65IBXFIcjs.invertMatrix3; exports.invertSelection = _chunkQYLWG22Ncjs.invertSelection; exports.isActiveFilter = _chunkH65IBXFIcjs.isActiveFilter; exports.isActiveVectorMask = _chunkH65IBXFIcjs.isActiveVectorMask; exports.isAdjustmentKind = _chunkH65IBXFIcjs.isAdjustmentKind; exports.isBitDepth = _chunkOLNIPTB3cjs.isBitDepth; exports.isBlendMode = _chunkOLNIPTB3cjs.isBlendMode; exports.isBrushstrokeBrush = _chunkPQ3H2AANcjs.isBrushstrokeBrush; exports.isColorRangePreset = isColorRangePreset; exports.isContentsDecoded = _chunkH65IBXFIcjs.isContentsDecoded; exports.isDefaultDepthMask = _chunkH65IBXFIcjs.isDefaultDepthMask; exports.isGradientPaint = _chunkPQ3H2AANcjs.isGradientPaint; exports.isIdentityCloneTransform = _chunkYF3YZZ6Gcjs.isIdentityCloneTransform; exports.isIdentityTransform = _chunkH65IBXFIcjs.isIdentityTransform; exports.isInterpolation = _chunkUOGKSVRQcjs.isInterpolation; exports.isLayerEffectKind = _chunkUOGKSVRQcjs.isLayerEffectKind; exports.isLayerLocked = _chunkUOGKSVRQcjs.isLayerLocked; exports.isLegacyShape = _chunkH65IBXFIcjs.isLegacyShape; exports.isPaintTool = isPaintTool; exports.isPaintableLayer = _chunkH65IBXFIcjs.isPaintableLayer; exports.isPainterlyBlendMode = _chunkOLNIPTB3cjs.isPainterlyBlendMode; exports.isPathEditTool = isPathEditTool; exports.isPng = _chunkOLNIPTB3cjs.isPng; exports.isQuarterTurn = isQuarterTurn; exports.isQuarterTurnSwapped = _chunkH65IBXFIcjs.isQuarterTurnSwapped; exports.isRenderedLayer = _chunkH65IBXFIcjs.isRenderedLayer; exports.isRetouchPaintTool = isRetouchPaintTool; exports.isRetouchTool = isRetouchTool; exports.isSelectionEmpty = _chunkQYLWG22Ncjs.isSelectionEmpty; exports.isSelectionMode = _chunkQYLWG22Ncjs.isSelectionMode; exports.isSeparableBlendMode = _chunkOLNIPTB3cjs.isSeparableBlendMode; exports.isSmartSurfaceIncomplete = _chunkH65IBXFIcjs.isSmartSurfaceIncomplete; exports.isSpatialFilter = _chunkH65IBXFIcjs.isSpatialFilter; exports.isSrgb = isSrgb; exports.isTransformAnchor = _chunkH65IBXFIcjs.isTransformAnchor; exports.isValidWarp = _chunkH65IBXFIcjs.isValidWarp; exports.keepDeepSamples = _chunkOLNIPTB3cjs.keepDeepSamples; exports.keepMainPieces = _chunkL52VMQZScjs.keepMainPieces; exports.kelvinToTemperature = _chunkH65IBXFIcjs.kelvinToTemperature; exports.keysWeight = _chunkUOGKSVRQcjs.keysWeight; exports.latticeViscosity = _chunkKWNMBMKGcjs.latticeViscosity; exports.layerBadge = layerBadge; exports.layerEffectControls = layerEffectControls; exports.layerEffectFields = _chunkUOGKSVRQcjs.layerEffectFields; exports.layerEffectLabel = _chunkUOGKSVRQcjs.layerEffectLabel; exports.layerEffectsBadge = layerEffectsBadge; exports.layerEffectsOf = _chunkH65IBXFIcjs.layerEffectsOf; exports.layerEffectsPanel = layerEffectsPanel; exports.layerHasThumbnail = layerHasThumbnail; exports.layerLabel = layerLabel; exports.layerMaskCoverage = _chunkH65IBXFIcjs.layerMaskCoverage; exports.layerMaskFromSelection = _chunkH65IBXFIcjs.layerMaskFromSelection; exports.layerMaskKey = _chunkH65IBXFIcjs.layerMaskKey; exports.layerMaskSelection = _chunkH65IBXFIcjs.layerMaskSelection; exports.layerMenu = layerMenu; exports.layerName = _chunkH65IBXFIcjs.layerName; exports.layerPanelRows = layerPanelRows; exports.layerPanels = layerPanels; exports.layerThumbnailClick = layerThumbnailClick; exports.layerTree = _chunkH65IBXFIcjs.layerTree; exports.layerTypeLabel = _chunkH65IBXFIcjs.layerTypeLabel; exports.layerWarning = layerWarning; exports.layersFromLegacy = _chunkH65IBXFIcjs.layersFromLegacy; exports.layoutText = _chunkQAUIZPYIcjs.layoutText; exports.legacyAdjustmentLayer = _chunkH65IBXFIcjs.legacyAdjustmentLayer; exports.legacyMaskOf = _chunkH65IBXFIcjs.legacyMaskOf; exports.legacyView = _chunkH65IBXFIcjs.legacyView; exports.lerpPigment = _chunkOLNIPTB3cjs.lerpPigment; exports.lerpPigmentInto = _chunkOLNIPTB3cjs.lerpPigmentInto; exports.levelsValue = _chunkH65IBXFIcjs.levelsValue; exports.linearSrgbToXy = _chunkH65IBXFIcjs.linearSrgbToXy; exports.linearToSrgb = _chunkH65IBXFIcjs.linearToSrgb; exports.linearToSrgb8 = _chunkKWNMBMKGcjs.linearToSrgb8; exports.liveComponent = _chunkH65IBXFIcjs.liveComponent; exports.liveShapeForDrag = liveShapeForDrag; exports.liveShapeSubpaths = _chunkH65IBXFIcjs.liveShapeSubpaths; exports.liveWire = liveWire; exports.loadImageEditorDocument = loadImageEditorDocument; exports.loadMixer = _chunkPQ3H2AANcjs.loadMixer; exports.loadOpenTypeFont = _chunkLCCMOWR7cjs.loadOpenTypeFont; exports.loadWetKernel = _chunkKWNMBMKGcjs.loadWetKernel; exports.luma = _chunkYF3YZZ6Gcjs.luma; exports.magicWand = magicWand; exports.magneticAnchorSpacing = magneticAnchorSpacing; exports.mapCropHandle = _chunkH65IBXFIcjs.mapCropHandle; exports.mapLayer = _chunkUOGKSVRQcjs.mapLayer; exports.mapSubpaths = _chunkH65IBXFIcjs.mapSubpaths; exports.maskBounds = _chunkMQDIP4CFcjs.maskBounds; exports.maskFileName = maskFileName; exports.maskNameFromFile = maskNameFromFile; exports.maskSummary = maskSummary; exports.maskThumbnailClick = maskThumbnailClick; exports.matrixFromCorners = _chunkH65IBXFIcjs.matrixFromCorners; exports.matrixFromParams = _chunkH65IBXFIcjs.matrixFromParams; exports.measureCanvasViewport = measureCanvasViewport; exports.membraneFill = _chunkMQDIP4CFcjs.membraneFill; exports.mergeLayerEffect = _chunkUOGKSVRQcjs.mergeLayerEffect; exports.mergeShapeComponents = _chunkH65IBXFIcjs.mergeShapeComponents; exports.migrateSerializedImageEditorState = migrateSerializedImageEditorState; exports.migrateToLayeredState = migrateToLayeredState; exports.mix32 = _chunkPQ3H2AANcjs.mix32; exports.mixPigment8 = _chunkOLNIPTB3cjs.mixPigment8; exports.mixPigmentRgb = _chunkOLNIPTB3cjs.mixPigmentRgb; exports.mixPigments = _chunkOLNIPTB3cjs.mixPigments; exports.mixerLoadResult = mixerLoadResult; exports.mixerRates = _chunkPQ3H2AANcjs.mixerRates; exports.modifySelection = _chunkQYLWG22Ncjs.modifySelection; exports.moveCurvePoint = moveCurvePoint; exports.moveLayer = _chunkH65IBXFIcjs.moveLayer; exports.moveSmartFilter = _chunkH65IBXFIcjs.moveSmartFilter; exports.mulMatrix3 = _chunkH65IBXFIcjs.mulMatrix3; exports.needsLegacyBase = needsLegacyBase; exports.neutralHueRange = _chunkH65IBXFIcjs.neutralHueRange; exports.newContentsId = _chunkH65IBXFIcjs.newContentsId; exports.newEffectId = _chunkUOGKSVRQcjs.newEffectId; exports.newLayerId = _chunkH65IBXFIcjs.newLayerId; exports.newLayerOptions = newLayerOptions; exports.newPathId = newPathId; exports.normalizeAdjustmentLayer = _chunkH65IBXFIcjs.normalizeAdjustmentLayer; exports.normalizeAdjustmentLayers = _chunkH65IBXFIcjs.normalizeAdjustmentLayers; exports.normalizeAngle = _chunkH65IBXFIcjs.normalizeAngle; exports.normalizeBlendMode = _chunkOLNIPTB3cjs.normalizeBlendMode; exports.normalizeBlender = _chunkPQ3H2AANcjs.normalizeBlender; exports.normalizeBrush = _chunkPQ3H2AANcjs.normalizeBrush; exports.normalizeFilter = _chunkH65IBXFIcjs.normalizeFilter; exports.normalizeFlow = _chunkKWNMBMKGcjs.normalizeFlow; exports.normalizeHexColor = _chunkPQ3H2AANcjs.normalizeHexColor; exports.normalizeLayerEffects = _chunkUOGKSVRQcjs.normalizeLayerEffects; exports.normalizeLayerMask = _chunkH65IBXFIcjs.normalizeLayerMask; exports.normalizeLiveShape = _chunkH65IBXFIcjs.normalizeLiveShape; exports.normalizeMixer = _chunkPQ3H2AANcjs.normalizeMixer; exports.normalizePlacement = _chunkH65IBXFIcjs.normalizePlacement; exports.normalizeProcessVersion = _chunkH65IBXFIcjs.normalizeProcessVersion; exports.normalizeRect = _chunkL52VMQZScjs.normalizeRect; exports.normalizeRefineEdgeParams = _chunkL52VMQZScjs.normalizeRefineEdgeParams; exports.normalizeRetouch = _chunkYF3YZZ6Gcjs.normalizeRetouch; exports.normalizeShapePaint = _chunkH65IBXFIcjs.normalizeShapePaint; exports.normalizeShapeStroke = _chunkH65IBXFIcjs.normalizeShapeStroke; exports.normalizeSmartFilter = _chunkH65IBXFIcjs.normalizeSmartFilter; exports.normalizeSmudge = _chunkPQ3H2AANcjs.normalizeSmudge; exports.normalizeStoredAdjustments = normalizeStoredAdjustments; exports.normalizeSubpaths = _chunkH65IBXFIcjs.normalizeSubpaths; exports.normalizeText = _chunkH65IBXFIcjs.normalizeText; exports.normalizeTilt = _chunkKWNMBMKGcjs.normalizeTilt; exports.normalizeWetParams = _chunkKWNMBMKGcjs.normalizeWetParams; exports.offsetLayer = _chunkH65IBXFIcjs.offsetLayer; exports.offsetShape = _chunkH65IBXFIcjs.offsetShape; exports.offsetSmartObject = _chunkH65IBXFIcjs.offsetSmartObject; exports.offsetVectorMask = _chunkH65IBXFIcjs.offsetVectorMask; exports.openMaskFile = openMaskFile; exports.openPsdFile = openPsdFile; exports.otsuThreshold = _chunkL52VMQZScjs.otsuThreshold; exports.packRgba = _chunk474IQG74cjs.packRgba; exports.packWetParams = _chunkKWNMBMKGcjs.packWetParams; exports.paintGradientMappingFor = _chunkPQ3H2AANcjs.paintGradientMappingFor; exports.paintPathStroke = _chunkPQ3H2AANcjs.paintPathStroke; exports.paintSourceColor = _chunkPQ3H2AANcjs.paintSourceColor; exports.paintSourceCss = _chunkPQ3H2AANcjs.paintSourceCss; exports.paragraphRanges = _chunkQAUIZPYIcjs.paragraphRanges; exports.parseAdjustmentBlock = _chunkH65IBXFIcjs.parseAdjustmentBlock; exports.parseBlend = _chunkH65IBXFIcjs.parseBlend; exports.parseColor = parseColor; exports.parseCssColor = _chunkA2IS7EHEcjs.parseCssColor; exports.parseDataUrl = _chunkOLNIPTB3cjs.parseDataUrl; exports.parseEffectColor = _chunkUOGKSVRQcjs.parseEffectColor; exports.parseLfx2 = _chunkH65IBXFIcjs.parseLfx2; exports.parseLrfx = _chunkH65IBXFIcjs.parseLrfx; exports.parseOpenTypeFont = _chunkLCCMOWR7cjs.parseOpenTypeFont; exports.parsePaintSource = _chunkPQ3H2AANcjs.parsePaintSource; exports.parsePatternBlock = _chunkH65IBXFIcjs.parsePatternBlock; exports.parseSelectionMode = _chunkQYLWG22Ncjs.parseSelectionMode; exports.parseVersionedDescriptor = _chunkH65IBXFIcjs.parseVersionedDescriptor; exports.patchParagraphStyle = _chunkH65IBXFIcjs.patchParagraphStyle; exports.patchTextStyle = _chunkH65IBXFIcjs.patchTextStyle; exports.pathAnchorCount = pathAnchorCount; exports.pathBounds = pathBounds; exports.pathStrokeCoverage = _chunkPQ3H2AANcjs.pathStrokeCoverage; exports.pathStrokeDabs = _chunkPQ3H2AANcjs.pathStrokeDabs; exports.pathSvgData = pathSvgData; exports.pathToSelection = pathToSelection; exports.perDabStrength = _chunkYF3YZZ6Gcjs.perDabStrength; exports.photoFilterMatrix = _chunkH65IBXFIcjs.photoFilterMatrix; exports.pigment8 = _chunkOLNIPTB3cjs.pigment8; exports.pigmentColor = _chunkKWNMBMKGcjs.pigmentColor; exports.pigmentOf = _chunkKWNMBMKGcjs.pigmentOf; exports.pixelLayerBounds = _chunkH65IBXFIcjs.pixelLayerBounds; exports.pixelLayers = _chunkH65IBXFIcjs.pixelLayers; exports.pixelPigment = _chunkKWNMBMKGcjs.pixelPigment; exports.placeContents = _chunkH65IBXFIcjs.placeContents; exports.placeLayer = _chunkH65IBXFIcjs.placeLayer; exports.placementAt = _chunkH65IBXFIcjs.placementAt; exports.placementBounds = _chunkH65IBXFIcjs.placementBounds; exports.placementGeometry = _chunkH65IBXFIcjs.placementGeometry; exports.planImageToolPlayback = planImageToolPlayback; exports.planOutlineTrace = planOutlineTrace; exports.pngDataUrl = _chunkOLNIPTB3cjs.pngDataUrl; exports.pointerPressure = _chunkKWNMBMKGcjs.pointerPressure; exports.pointerStrokeSample = _chunkKWNMBMKGcjs.pointerStrokeSample; exports.pointerStrokeSamples = _chunkKWNMBMKGcjs.pointerStrokeSamples; exports.polygonCoverage = _chunkL52VMQZScjs.polygonCoverage; exports.polygonCoverageBox = _chunkL52VMQZScjs.polygonCoverageBox; exports.polygonSelection = _chunkL52VMQZScjs.polygonSelection; exports.posterizeValue = _chunkH65IBXFIcjs.posterizeValue; exports.presetWarp = _chunkH65IBXFIcjs.presetWarp; exports.previewStep = previewStep; exports.profileBytes = profileBytes; exports.projectImagePoint = _chunkH65IBXFIcjs.projectImagePoint; exports.projectImageRect = _chunkH65IBXFIcjs.projectImageRect; exports.projectMaskCoverage = _chunkH65IBXFIcjs.projectMaskCoverage; exports.projectQuarterTurn = projectQuarterTurn; exports.proxyOf = _chunkOLNIPTB3cjs.proxyOf; exports.psdBytesFromBase64 = psdBytesFromBase64; exports.psdFileName = psdFileName; exports.psdPatternToEffectPattern = _chunkH65IBXFIcjs.psdPatternToEffectPattern; exports.psdToLayers = _chunkH65IBXFIcjs.psdToLayers; exports.pullWarpMesh = _chunkQAUIZPYIcjs.pullWarpMesh; exports.put255 = _chunkPQ3H2AANcjs.put255; exports.quadFrameOverlay = quadFrameOverlay; exports.quickMaskPixels = quickMaskPixels; exports.quickSelectStroke = _chunkL52VMQZScjs.quickSelectStroke; exports.rand01 = _chunkPQ3H2AANcjs.rand01; exports.randSigned = _chunkPQ3H2AANcjs.randSigned; exports.rangeLightness = _chunkH65IBXFIcjs.rangeLightness; exports.rasterContents = _chunkH65IBXFIcjs.rasterContents; exports.rasterMaskFromLegacy = _chunkH65IBXFIcjs.rasterMaskFromLegacy; exports.rasterizeCoverage = _chunkH65IBXFIcjs.rasterizeCoverage; exports.rasterizeDab = _chunkPQ3H2AANcjs.rasterizeDab; exports.rasterizeSmartObject = _chunkH65IBXFIcjs.rasterizeSmartObject; exports.readAdjustmentControls = readAdjustmentControls; exports.readDeepRegion = _chunkOLNIPTB3cjs.readDeepRegion; exports.readPaintSource = _chunkPQ3H2AANcjs.readPaintSource; exports.readPaths = readPaths; exports.readPixel = _chunk474IQG74cjs.readPixel; exports.readPsd = _chunkH65IBXFIcjs.readPsd; exports.readRegion = _chunk474IQG74cjs.readRegion; exports.readShapeComponents = _chunkH65IBXFIcjs.readShapeComponents; exports.readSourceRegion = _chunkYF3YZZ6Gcjs.readSourceRegion; exports.rectSelection = _chunkL52VMQZScjs.rectSelection; exports.rectToQuad = _chunkQT26RHKKcjs.rectToQuad; exports.reduceSurface = _chunkUOGKSVRQcjs.reduceSurface; exports.referencePoint = _chunkH65IBXFIcjs.referencePoint; exports.refineCoverage = _chunkL52VMQZScjs.refineCoverage; exports.refineEdgeHalo = _chunkL52VMQZScjs.refineEdgeHalo; exports.refineSelection = _chunkL52VMQZScjs.refineSelection; exports.reflectanceToRgb = _chunkOLNIPTB3cjs.reflectanceToRgb; exports.removeAlpha = _chunkH65IBXFIcjs.removeAlpha; exports.removeCurvePoint = removeCurvePoint; exports.removeLayer = _chunkH65IBXFIcjs.removeLayer; exports.removeLayerEffect = _chunkH65IBXFIcjs.removeLayerEffect; exports.removeLayerFilter = _chunkH65IBXFIcjs.removeLayerFilter; exports.removePaintGradientStop = _chunkPQ3H2AANcjs.removePaintGradientStop; exports.removeSmartFilter = _chunkH65IBXFIcjs.removeSmartFilter; exports.renderBrushstroke = _chunkPQ3H2AANcjs.renderBrushstroke; exports.renderLayerEffects = _chunkUOGKSVRQcjs.renderLayerEffects; exports.renderLayeredBase = renderLayeredBase; exports.renderShape = _chunkH65IBXFIcjs.renderShape; exports.renderShapeRect = _chunkH65IBXFIcjs.renderShapeRect; exports.renderSmartObject = _chunkH65IBXFIcjs.renderSmartObject; exports.renderText = _chunkH65IBXFIcjs.renderText; exports.replaceContents = _chunkH65IBXFIcjs.replaceContents; exports.replaceTextRange = _chunkH65IBXFIcjs.replaceTextRange; exports.requireLayer = _chunkH65IBXFIcjs.requireLayer; exports.requireOperation = _chunkH65IBXFIcjs.requireOperation; exports.requireShapeLayer = _chunkH65IBXFIcjs.requireShapeLayer; exports.requireSmartObject = _chunkH65IBXFIcjs.requireSmartObject; exports.requireTypeLayer = _chunkH65IBXFIcjs.requireTypeLayer; exports.requireUnlocked = _chunkH65IBXFIcjs.requireUnlocked; exports.rerender = _chunkH65IBXFIcjs.rerender; exports.rerenderShape = _chunkH65IBXFIcjs.rerenderShape; exports.rerenderText = _chunkH65IBXFIcjs.rerenderText; exports.resizePixels = resizePixels; exports.resizeSelection = _chunkQYLWG22Ncjs.resizeSelection; exports.resizeWarpMesh = _chunkQAUIZPYIcjs.resizeWarpMesh; exports.resolveExternalAssets = _chunkH65IBXFIcjs.resolveExternalAssets; exports.resolveMosaicRegionBounds = resolveMosaicRegionBounds; exports.resolvePaintGradient = _chunkPQ3H2AANcjs.resolvePaintGradient; exports.resolveProfile = resolveProfile; exports.resolveVectorMasks = _chunkH65IBXFIcjs.resolveVectorMasks; exports.restyleRange = _chunkQAUIZPYIcjs.restyleRange; exports.retouchFilter = _chunkYF3YZZ6Gcjs.retouchFilter; exports.reversePaintGradient = _chunkPQ3H2AANcjs.reversePaintGradient; exports.rgbToGray = _chunkH65IBXFIcjs.rgbToGray; exports.rgbToHsl = _chunkH65IBXFIcjs.rgbToHsl; exports.rgbToReflectance = _chunkOLNIPTB3cjs.rgbToReflectance; exports.rgbUnitToHex = rgbUnitToHex; exports.rgbaViewOfGrey = _chunkYF3YZZ6Gcjs.rgbaViewOfGrey; exports.runLayerFilters = _chunkH65IBXFIcjs.runLayerFilters; exports.runLayerFiltersFloat = _chunkH65IBXFIcjs.runLayerFiltersFloat; exports.runLayerMenuAction = runLayerMenuAction; exports.runSelectionJob = _chunkL52VMQZScjs.runSelectionJob; exports.sameCanvasViewport = sameCanvasViewport; exports.sampleLut = _chunkH65IBXFIcjs.sampleLut; exports.sampleToneLut = _chunkH65IBXFIcjs.sampleToneLut; exports.saturationOf = _chunkYF3YZZ6Gcjs.saturationOf; exports.scaleLayerEffect = _chunkUOGKSVRQcjs.scaleLayerEffect; exports.scalePaintGradient = _chunkPQ3H2AANcjs.scalePaintGradient; exports.seamlessClone = _chunkMQDIP4CFcjs.seamlessClone; exports.seedFromString = _chunkPQ3H2AANcjs.seedFromString; exports.segmentToSelection = segmentToSelection; exports.segmentationOutlines = segmentationOutlines; exports.segmentsToSelection = segmentsToSelection; exports.selectObjectIn = _chunkL52VMQZScjs.selectObjectIn; exports.selectSimilar = selectSimilar; exports.selectionArea = _chunkQYLWG22Ncjs.selectionArea; exports.selectionFromCoverage = _chunkQYLWG22Ncjs.selectionFromCoverage; exports.selectionFromPixels = _chunkQYLWG22Ncjs.selectionFromPixels; exports.selectionFromRegion = _chunkQYLWG22Ncjs.selectionFromRegion; exports.selectionFromTiles = _chunkQYLWG22Ncjs.selectionFromTiles; exports.selectionModeFromModifiers = selectionModeFromModifiers; exports.selectionOutline = selectionOutline; exports.selectionRing = selectionRing; exports.selectionToCoverage = _chunkQYLWG22Ncjs.selectionToCoverage; exports.selectionToPixels = _chunkQYLWG22Ncjs.selectionToPixels; exports.selectionToSubpaths = selectionToSubpaths; exports.selectionValueAt = _chunkQYLWG22Ncjs.selectionValueAt; exports.serializeChannels = serializeChannels; exports.serializeColorMode = serializeColorMode; exports.serializeColorProfile = serializeColorProfile; exports.serializeContents = _chunkH65IBXFIcjs.serializeContents; exports.serializeEffects = _chunkH65IBXFIcjs.serializeEffects; exports.serializeLayer = _chunkH65IBXFIcjs.serializeLayer; exports.serializeLayers = _chunkH65IBXFIcjs.serializeLayers; exports.serializeLayersExternal = _chunkH65IBXFIcjs.serializeLayersExternal; exports.serializeMask = _chunkL52VMQZScjs.serializeMask; exports.serializePaths = serializePaths; exports.serializePatterns = _chunkH65IBXFIcjs.serializePatterns; exports.serializeSelection = _chunkQYLWG22Ncjs.serializeSelection; exports.setCloneTransformValue = setCloneTransformValue; exports.setControlPath = setControlPath; exports.setLayerEffects = _chunkH65IBXFIcjs.setLayerEffects; exports.setLayerEffectsEnabled = _chunkH65IBXFIcjs.setLayerEffectsEnabled; exports.setLayerMask = _chunkH65IBXFIcjs.setLayerMask; exports.setLayerProperties = _chunkH65IBXFIcjs.setLayerProperties; exports.setLum = _chunkOLNIPTB3cjs.setLum; exports.setPigmentColor = _chunkOLNIPTB3cjs.setPigmentColor; exports.setRetouchChoice = setRetouchChoice; exports.setSmartFilterMask = _chunkH65IBXFIcjs.setSmartFilterMask; exports.setSmartFiltersEnabled = _chunkH65IBXFIcjs.setSmartFiltersEnabled; exports.setSmartPlacement = _chunkH65IBXFIcjs.setSmartPlacement; exports.shadeTile = _chunkKWNMBMKGcjs.shadeTile; exports.shapeAsPixelLayer = _chunkH65IBXFIcjs.shapeAsPixelLayer; exports.shapeFromAnnotation = _chunkH65IBXFIcjs.shapeFromAnnotation; exports.shapeGeometryBounds = _chunkH65IBXFIcjs.shapeGeometryBounds; exports.shapeLayers = _chunkH65IBXFIcjs.shapeLayers; exports.shapeOutline = _chunkH65IBXFIcjs.shapeOutline; exports.shapeRenderClip = _chunkH65IBXFIcjs.shapeRenderClip; exports.shiftCoverage = _chunkQYLWG22Ncjs.shiftCoverage; exports.simplifyPixelPath = simplifyPixelPath; exports.skinToneRange = skinToneRange; exports.slicSuperpixels = _chunkL52VMQZScjs.slicSuperpixels; exports.smartFilterRows = smartFilterRows; exports.smartObjectLayers = _chunkH65IBXFIcjs.smartObjectLayers; exports.smoothCoverage = _chunkQYLWG22Ncjs.smoothCoverage; exports.smoothPoints = _chunkPQ3H2AANcjs.smoothPoints; exports.smoothnessWeights = _chunkL52VMQZScjs.smoothnessWeights; exports.smudgeEffect = _chunkYF3YZZ6Gcjs.smudgeEffect; exports.snapPolygonToEdges = snapPolygonToEdges; exports.snapTo45 = snapTo45; exports.snapToEdge = snapToEdge; exports.softMaskToSelection = _chunkL52VMQZScjs.softMaskToSelection; exports.solidPaint = _chunkPQ3H2AANcjs.solidPaint; exports.solidSurface = _chunk474IQG74cjs.solidSurface; exports.solveMembrane = _chunkMQDIP4CFcjs.solveMembrane; exports.spliceRuns = _chunkQAUIZPYIcjs.spliceRuns; exports.splitOverlayAnnotations = splitOverlayAnnotations; exports.sponge = _chunkYF3YZZ6Gcjs.sponge; exports.spongeEffect = _chunkYF3YZZ6Gcjs.spongeEffect; exports.spotHealPixels = _chunkYF3YZZ6Gcjs.spotHealPixels; exports.spotHealWindow = _chunkYF3YZZ6Gcjs.spotHealWindow; exports.srgb8ToLab = srgb8ToLab; exports.srgbByteToLinear = _chunkKWNMBMKGcjs.srgbByteToLinear; exports.srgbDecode = _chunkOLNIPTB3cjs.srgbDecode; exports.srgbEncode = _chunkOLNIPTB3cjs.srgbEncode; exports.srgbToLinear = _chunkH65IBXFIcjs.srgbToLinear; exports.standardBlendMode = _chunkOLNIPTB3cjs.standardBlendMode; exports.startMarchingAnts = startMarchingAnts; exports.startSelectionWorker = _chunkL52VMQZScjs.startSelectionWorker; exports.stepSlotTs = _chunkKWNMBMKGcjs.stepSlotTs; exports.strokeGrainCatch = _chunkPQ3H2AANcjs.strokeGrainCatch; exports.styleAt = _chunkQAUIZPYIcjs.styleAt; exports.subpathsToSvgPath = subpathsToSvgPath; exports.sumHistograms = sumHistograms; exports.superpixelSaliency = _chunkL52VMQZScjs.superpixelSaliency; exports.surfaceBytes = _chunk474IQG74cjs.surfaceBytes; exports.surfaceDepth = _chunkOLNIPTB3cjs.surfaceDepth; exports.surfaceFromDeepPixels = _chunkOLNIPTB3cjs.surfaceFromDeepPixels; exports.surfaceFromPixels = _chunk474IQG74cjs.surfaceFromPixels; exports.surfacesEqual = _chunk474IQG74cjs.surfacesEqual; exports.tempTintToXy = _chunkH65IBXFIcjs.tempTintToXy; exports.temperatureToKelvin = _chunkH65IBXFIcjs.temperatureToKelvin; exports.textIndexAt = _chunkQAUIZPYIcjs.textIndexAt; exports.textMatrix = _chunkH65IBXFIcjs.textMatrix; exports.textOrientation = _chunkH65IBXFIcjs.textOrientation; exports.textOutlines = _chunkH65IBXFIcjs.textOutlines; exports.textRange = _chunkH65IBXFIcjs.textRange; exports.tileCoord = _chunk474IQG74cjs.tileCoord; exports.tileKey = _chunk474IQG74cjs.tileKey; exports.tileRect = _chunk474IQG74cjs.tileRect; exports.tileSamples = _chunkOLNIPTB3cjs.tileSamples; exports.tileSamples16 = _chunkOLNIPTB3cjs.tileSamples16; exports.tileSamples32 = _chunkOLNIPTB3cjs.tileSamples32; exports.tilesInRect = _chunk474IQG74cjs.tilesInRect; exports.tipFalloff = _chunkPQ3H2AANcjs.tipFalloff; exports.tipReach = _chunkPQ3H2AANcjs.tipReach; exports.tipShape = _chunkPQ3H2AANcjs.tipShape; exports.to16From32 = _chunkOLNIPTB3cjs.to16From32; exports.to16From8 = _chunkOLNIPTB3cjs.to16From8; exports.to32From16 = _chunkOLNIPTB3cjs.to32From16; exports.to32From8 = _chunkOLNIPTB3cjs.to32From8; exports.to8From16 = _chunkOLNIPTB3cjs.to8From16; exports.to8From32 = _chunkOLNIPTB3cjs.to8From32; exports.toHex = toHex; exports.toTextSpace = _chunkH65IBXFIcjs.toTextSpace; exports.toneCurve = _chunkH65IBXFIcjs.toneCurve; exports.toneLuts = _chunkH65IBXFIcjs.toneLuts; exports.toneOf = _chunkYF3YZZ6Gcjs.toneOf; exports.toneRange = toneRange; exports.transformHomography = _chunkH65IBXFIcjs.transformHomography; exports.transformMap = _chunkH65IBXFIcjs.transformMap; exports.transformShapeComponents = _chunkH65IBXFIcjs.transformShapeComponents; exports.transformSurface = _chunkUOGKSVRQcjs.transformSurface; exports.transformTypeLayer = _chunkH65IBXFIcjs.transformTypeLayer; exports.transformVectorMask = _chunkH65IBXFIcjs.transformVectorMask; exports.transformedBounds = _chunkUOGKSVRQcjs.transformedBounds; exports.transformedBox = _chunkH65IBXFIcjs.transformedBox; exports.transformedPoint = _chunkH65IBXFIcjs.transformedPoint; exports.translateLayer = _chunkH65IBXFIcjs.translateLayer; exports.translateSurface = _chunk474IQG74cjs.translateSurface; exports.typeAsPixelLayer = _chunkH65IBXFIcjs.typeAsPixelLayer; exports.typeFrame = _chunkH65IBXFIcjs.typeFrame; exports.typeFromAnnotation = _chunkH65IBXFIcjs.typeFromAnnotation; exports.typeLayerAt = typeLayerAt; exports.typeLayerName = _chunkH65IBXFIcjs.typeLayerName; exports.ungroupLayer = _chunkH65IBXFIcjs.ungroupLayer; exports.uniformTile = _chunk474IQG74cjs.uniformTile; exports.unionRect = _chunkH65IBXFIcjs.unionRect; exports.unprojectCanvasPoint = _chunkH65IBXFIcjs.unprojectCanvasPoint; exports.updateLayerEffect = _chunkH65IBXFIcjs.updateLayerEffect; exports.updateLayerFilter = _chunkH65IBXFIcjs.updateLayerFilter; exports.updateLayerMaskProps = _chunkH65IBXFIcjs.updateLayerMaskProps; exports.updatePaintGradientStop = _chunkPQ3H2AANcjs.updatePaintGradientStop; exports.updateShapeLayer = _chunkH65IBXFIcjs.updateShapeLayer; exports.updateSmartFilter = _chunkH65IBXFIcjs.updateSmartFilter; exports.updateTypeLayer = _chunkH65IBXFIcjs.updateTypeLayer; exports.upscaleRegion = _chunkL52VMQZScjs.upscaleRegion; exports.userErrorMessage = _chunkH65IBXFIcjs.userErrorMessage; exports.uvToXy = _chunkH65IBXFIcjs.uvToXy; exports.validateEffectGradient = _chunkUOGKSVRQcjs.validateEffectGradient; exports.validateLayerEffect = _chunkUOGKSVRQcjs.validateLayerEffect; exports.validateLayerEffects = _chunkUOGKSVRQcjs.validateLayerEffects; exports.vectorMaskBounds = _chunkH65IBXFIcjs.vectorMaskBounds; exports.vectorMaskCoverage = _chunkH65IBXFIcjs.vectorMaskCoverage; exports.vectorMaskThumbnail = _chunkH65IBXFIcjs.vectorMaskThumbnail; exports.vectorMaskThumbnailClick = vectorMaskThumbnailClick; exports.versionedDescriptorBytes = _chunkH65IBXFIcjs.versionedDescriptorBytes; exports.vibranceLinear = _chunkH65IBXFIcjs.vibranceLinear; exports.vibrancePixel = _chunkH65IBXFIcjs.vibrancePixel; exports.walkDabs = _chunkPQ3H2AANcjs.walkDabs; exports.warpMeshEditPoints = _chunkQAUIZPYIcjs.warpMeshEditPoints; exports.warpMeshGridCurves = _chunkQAUIZPYIcjs.warpMeshGridCurves; exports.warpMeshParamAt = _chunkQAUIZPYIcjs.warpMeshParamAt; exports.warpPresetMesh = _chunkQAUIZPYIcjs.warpPresetMesh; exports.warpSurface = _chunkUOGKSVRQcjs.warpSurface; exports.watchCanvasViewport = watchCanvasViewport; exports.wbMatrix = _chunkH65IBXFIcjs.wbMatrix; exports.wetGpuSupport = _chunkKWNMBMKGcjs.wetGpuSupport; exports.wetSimdSupported = _chunkKWNMBMKGcjs.wetSimdSupported; exports.wetSupport = _chunkKWNMBMKGcjs.wetSupport; exports.whiteBalanceFromSample = _chunkH65IBXFIcjs.whiteBalanceFromSample; exports.whiteBalanceMatrix = _chunkH65IBXFIcjs.whiteBalanceMatrix; exports.withBackgroundOpacity = withBackgroundOpacity; exports.withFilterMaskSurface = _chunkH65IBXFIcjs.withFilterMaskSurface; exports.withImagePlayback = withImagePlayback; exports.withNewIds = _chunkH65IBXFIcjs.withNewIds; exports.workImage = _chunkL52VMQZScjs.workImage; exports.workLuma = _chunkL52VMQZScjs.workLuma; exports.workPlanes = _chunkL52VMQZScjs.workPlanes; exports.writeAdjustmentBlock = _chunkH65IBXFIcjs.writeAdjustmentBlock; exports.writeDeepRegion = _chunkOLNIPTB3cjs.writeDeepRegion; exports.writeLfx2 = _chunkH65IBXFIcjs.writeLfx2; exports.writePatternBlock = _chunkH65IBXFIcjs.writePatternBlock; exports.writePsd = _chunkH65IBXFIcjs.writePsd; exports.writeRegion = _chunk474IQG74cjs.writeRegion; exports.xyToTempTint = _chunkH65IBXFIcjs.xyToTempTint; exports.xyToUv = _chunkH65IBXFIcjs.xyToUv;