@pixerate/editor 0.160.0 → 0.162.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. package/dist/agent/index.cjs +36 -35
  2. package/dist/agent/index.js +7 -6
  3. package/dist/animation/index.cjs +5 -4
  4. package/dist/animation/index.js +4 -3
  5. package/dist/animation-editor/index.cjs +62 -61
  6. package/dist/animation-editor/index.js +6 -5
  7. package/dist/canvas/index.cjs +33 -32
  8. package/dist/canvas/index.js +6 -5
  9. package/dist/chart/index.cjs +88 -87
  10. package/dist/chart/index.js +7 -6
  11. package/dist/{chunk-QMI5HZWA.cjs → chunk-236TKNUR.cjs} +3 -3
  12. package/dist/{chunk-6UPGM3JB.js → chunk-2TKHLX6H.js} +1 -1
  13. package/dist/{chunk-3YDQLQH2.cjs → chunk-32MMQYCQ.cjs} +81 -81
  14. package/dist/{chunk-MHEXLG3M.cjs → chunk-3GJH2MGH.cjs} +37 -37
  15. package/dist/{chunk-AKDWAWSY.cjs → chunk-3IHNXRUV.cjs} +45 -45
  16. package/dist/{chunk-VKF3PWKR.cjs → chunk-3OSXHLIT.cjs} +259 -28
  17. package/dist/{chunk-TVO6W2Q6.cjs → chunk-4NGVHHJB.cjs} +17 -17
  18. package/dist/chunk-4VU4CP7R.js +769 -0
  19. package/dist/chunk-6DM3PUQD.cjs +767 -0
  20. package/dist/{chunk-DBIVICAO.js → chunk-7CKPUUN4.js} +1 -1
  21. package/dist/{chunk-57JLBGJ5.cjs → chunk-7YBDRJXT.cjs} +8 -8
  22. package/dist/{chunk-KY3FYKP3.js → chunk-BQWGN5WH.js} +1 -1
  23. package/dist/{chunk-LEUZ4FRC.cjs → chunk-CIPIESX4.cjs} +3 -3
  24. package/dist/chunk-CJE5MOIS.js +347 -0
  25. package/dist/{chunk-5QBRAIVK.js → chunk-CX6JLDFC.js} +3 -3
  26. package/dist/{chunk-R3QY7PPL.js → chunk-DTSTNRPH.js} +1 -1
  27. package/dist/{chunk-6LUYFHHN.cjs → chunk-EQ46F75O.cjs} +51 -51
  28. package/dist/{chunk-UKCJ43YL.cjs → chunk-ES3UEVUT.cjs} +130 -898
  29. package/dist/{chunk-UM3RPYC5.js → chunk-EVPZ5IKN.js} +1 -1
  30. package/dist/{chunk-XNQ5EFB4.cjs → chunk-EY22AY6R.cjs} +16 -16
  31. package/dist/chunk-FKUKJ3XA.cjs +347 -0
  32. package/dist/{chunk-YABNLNY7.js → chunk-GLMP22FT.js} +3 -3
  33. package/dist/{chunk-SUF6WRXR.cjs → chunk-GTELFJRE.cjs} +2 -2
  34. package/dist/{chunk-72BGL3I2.js → chunk-GWV4T5NZ.js} +1 -1
  35. package/dist/{chunk-AY65VQSU.js → chunk-H3OEM3Q2.js} +1 -1
  36. package/dist/{chunk-4YWAEV4W.cjs → chunk-HDGBM7EA.cjs} +26 -26
  37. package/dist/{chunk-H5XX4KHB.js → chunk-HLOKB7WW.js} +5 -3
  38. package/dist/{chunk-WNAAWLZ5.js → chunk-KGTF55R3.js} +2 -2
  39. package/dist/{chunk-WPPJH6X4.cjs → chunk-LL3H5XUH.cjs} +6 -4
  40. package/dist/{chunk-4T44CJ5K.cjs → chunk-NA4UVVJ4.cjs} +15 -15
  41. package/dist/{chunk-Q6PA362P.js → chunk-NO5QQDHZ.js} +2 -2
  42. package/dist/{chunk-AA34BA7G.js → chunk-QYZGBVNC.js} +30 -798
  43. package/dist/chunk-S6X2QRVU.cjs +769 -0
  44. package/dist/{chunk-SSCL7QQ4.js → chunk-XDCFJEU7.js} +2 -2
  45. package/dist/{chunk-IQ6KKXOU.js → chunk-YN4AYYBJ.js} +243 -12
  46. package/dist/chunk-ZGOHKS3X.js +767 -0
  47. package/dist/color/index.cjs +6 -2
  48. package/dist/color/index.d.cts +1 -0
  49. package/dist/color/index.d.ts +1 -0
  50. package/dist/color/index.js +28 -24
  51. package/dist/color/suggest.d.cts +12 -0
  52. package/dist/color/suggest.d.ts +12 -0
  53. package/dist/effects/index.cjs +44 -771
  54. package/dist/effects/index.js +34 -761
  55. package/dist/effects/ui.d.cts +20 -3
  56. package/dist/effects/ui.d.ts +20 -3
  57. package/dist/export/index.cjs +6 -5
  58. package/dist/export/index.js +5 -4
  59. package/dist/extensions/index.cjs +9 -8
  60. package/dist/extensions/index.js +8 -7
  61. package/dist/gradient/index.cjs +28 -26
  62. package/dist/gradient/index.js +7 -5
  63. package/dist/image-editor/index.cjs +638 -637
  64. package/dist/image-editor/index.js +5 -4
  65. package/dist/index.cjs +15 -14
  66. package/dist/index.js +9 -8
  67. package/dist/paint-editor/index.cjs +17 -16
  68. package/dist/paint-editor/index.js +6 -5
  69. package/dist/typography/accessibility.d.cts +44 -0
  70. package/dist/typography/accessibility.d.ts +44 -0
  71. package/dist/typography/catalog.d.cts +98 -0
  72. package/dist/typography/catalog.d.ts +98 -0
  73. package/dist/typography/index.cjs +1099 -0
  74. package/dist/typography/index.d.cts +16 -0
  75. package/dist/typography/index.d.ts +16 -0
  76. package/dist/typography/index.js +1099 -0
  77. package/dist/typography/metrics.d.cts +31 -0
  78. package/dist/typography/metrics.d.ts +31 -0
  79. package/dist/typography/picker.d.cts +132 -0
  80. package/dist/typography/picker.d.ts +132 -0
  81. package/dist/typography/registry.d.cts +66 -0
  82. package/dist/typography/registry.d.ts +66 -0
  83. package/dist/typography/scale.d.cts +62 -0
  84. package/dist/typography/scale.d.ts +62 -0
  85. package/dist/typography/segment.d.cts +26 -0
  86. package/dist/typography/segment.d.ts +26 -0
  87. package/dist/typography/stack.d.cts +26 -0
  88. package/dist/typography/stack.d.ts +26 -0
  89. package/dist/typography/tools.d.cts +34 -0
  90. package/dist/typography/tools.d.ts +34 -0
  91. package/dist/typography/types.d.cts +96 -0
  92. package/dist/typography/types.d.ts +96 -0
  93. package/dist/typography/weight.d.cts +13 -0
  94. package/dist/typography/weight.d.ts +13 -0
  95. package/dist/vector/index.cjs +950 -949
  96. package/dist/vector/index.js +5 -4
  97. package/dist/video-editor/audio.d.cts +9 -0
  98. package/dist/video-editor/audio.d.ts +9 -0
  99. package/dist/video-editor/check.d.cts +1 -1
  100. package/dist/video-editor/check.d.ts +1 -1
  101. package/dist/video-editor/controller.d.cts +47 -0
  102. package/dist/video-editor/controller.d.ts +47 -0
  103. package/dist/video-editor/dialogue-tools.d.cts +19 -0
  104. package/dist/video-editor/dialogue-tools.d.ts +19 -0
  105. package/dist/video-editor/effect-authoring.d.cts +54 -0
  106. package/dist/video-editor/effect-authoring.d.ts +54 -0
  107. package/dist/video-editor/evaluate.d.cts +11 -0
  108. package/dist/video-editor/evaluate.d.ts +11 -0
  109. package/dist/video-editor/export.d.cts +7 -1
  110. package/dist/video-editor/export.d.ts +7 -1
  111. package/dist/video-editor/index.cjs +1857 -531
  112. package/dist/video-editor/index.d.cts +7 -0
  113. package/dist/video-editor/index.d.ts +7 -0
  114. package/dist/video-editor/index.js +1516 -190
  115. package/dist/video-editor/lut.d.cts +12 -2
  116. package/dist/video-editor/lut.d.ts +12 -2
  117. package/dist/video-editor/mask.d.cts +48 -0
  118. package/dist/video-editor/mask.d.ts +48 -0
  119. package/dist/video-editor/mix.d.cts +107 -0
  120. package/dist/video-editor/mix.d.ts +107 -0
  121. package/dist/video-editor/music-tools.d.cts +19 -0
  122. package/dist/video-editor/music-tools.d.ts +19 -0
  123. package/dist/video-editor/parse.d.cts +3 -1
  124. package/dist/video-editor/parse.d.ts +3 -1
  125. package/dist/video-editor/plan.d.cts +75 -0
  126. package/dist/video-editor/plan.d.ts +75 -0
  127. package/dist/video-editor/render.d.cts +1 -1
  128. package/dist/video-editor/render.d.ts +1 -1
  129. package/dist/video-editor/timeline.d.cts +2 -0
  130. package/dist/video-editor/timeline.d.ts +2 -0
  131. package/dist/video-editor/tools.d.cts +90 -0
  132. package/dist/video-editor/tools.d.ts +90 -0
  133. package/dist/video-editor/transcript-controller.d.cts +106 -0
  134. package/dist/video-editor/transcript-controller.d.ts +106 -0
  135. package/dist/video-editor/transcript.d.cts +40 -0
  136. package/dist/video-editor/transcript.d.ts +40 -0
  137. package/dist/video-editor/types.d.cts +62 -2
  138. package/dist/video-editor/types.d.ts +62 -2
  139. package/dist/video-editor/ui.d.cts +21 -1
  140. package/dist/video-editor/ui.d.ts +21 -1
  141. package/package.json +11 -1
  142. package/skills/README.md +3 -0
  143. package/skills/pixerate-bgm-alignment/SKILL.md +82 -0
  144. package/skills/pixerate-talking-head-edit/SKILL.md +80 -0
  145. package/skills/pixerate-typography/SKILL.md +91 -0
  146. package/skills/pixerate-video-editor/SKILL.md +40 -2
@@ -369,7 +369,7 @@ var _chunk5UEFNX24cjs = require('../chunk-5UEFNX24.cjs');
369
369
 
370
370
 
371
371
 
372
- var _chunk3YDQLQH2cjs = require('../chunk-3YDQLQH2.cjs');
372
+ var _chunk32MMQYCQcjs = require('../chunk-32MMQYCQ.cjs');
373
373
 
374
374
 
375
375
  var _chunkA2IS7EHEcjs = require('../chunk-A2IS7EHE.cjs');
@@ -624,7 +624,7 @@ var _chunkBROJYMWUcjs = require('../chunk-BROJYMWU.cjs');
624
624
 
625
625
 
626
626
 
627
- var _chunkQMI5HZWAcjs = require('../chunk-QMI5HZWA.cjs');
627
+ var _chunk236TKNURcjs = require('../chunk-236TKNUR.cjs');
628
628
  require('../chunk-JGKCC5OF.cjs');
629
629
  require('../chunk-CVFAAZXE.cjs');
630
630
  require('../chunk-GF2RBSDM.cjs');
@@ -840,9 +840,10 @@ require('../chunk-UWEQ55MY.cjs');
840
840
 
841
841
  var _chunkM4MIZPQIcjs = require('../chunk-M4MIZPQI.cjs');
842
842
  require('../chunk-2BSBFBOA.cjs');
843
- require('../chunk-LEUZ4FRC.cjs');
843
+ require('../chunk-CIPIESX4.cjs');
844
844
  require('../chunk-A6QWKBJP.cjs');
845
- require('../chunk-UKCJ43YL.cjs');
845
+ require('../chunk-ES3UEVUT.cjs');
846
+ require('../chunk-S6X2QRVU.cjs');
846
847
  require('../chunk-IPJ3TEYR.cjs');
847
848
 
848
849
  // src/image-editor/histogram.ts
@@ -948,7 +949,7 @@ function quickMaskPixels(mask, style = {}) {
948
949
 
949
950
  // src/image-editor/layers/render.ts
950
951
  function isQuarterTurn(rotate) {
951
- return _chunk3YDQLQH2cjs.normalizeAngle.call(void 0, rotate) % 90 === 0;
952
+ return _chunk32MMQYCQcjs.normalizeAngle.call(void 0, rotate) % 90 === 0;
952
953
  }
953
954
  function isIntegerRect(r) {
954
955
  return Number.isInteger(r.x) && Number.isInteger(r.y) && Number.isInteger(r.width) && Number.isInteger(r.height);
@@ -956,7 +957,7 @@ function isIntegerRect(r) {
956
957
  function baseProjection(region, transform, baseW, baseH) {
957
958
  return {
958
959
  region,
959
- angle: _chunk3YDQLQH2cjs.normalizeAngle.call(void 0, transform.rotate),
960
+ angle: _chunk32MMQYCQcjs.normalizeAngle.call(void 0, transform.rotate),
960
961
  flipH: transform.flipH,
961
962
  flipV: transform.flipV,
962
963
  scale: 1,
@@ -965,14 +966,14 @@ function baseProjection(region, transform, baseW, baseH) {
965
966
  };
966
967
  }
967
968
  function projectQuarterTurn(src, srcRect, region, transform) {
968
- const rotated = _chunk3YDQLQH2cjs.getRotatedSize.call(void 0, region.width, region.height, transform);
969
+ const rotated = _chunk32MMQYCQcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
969
970
  const w = Math.max(1, Math.round(rotated.width));
970
971
  const h = Math.max(1, Math.round(rotated.height));
971
972
  const out = new Uint8ClampedArray(w * h * 4);
972
973
  const p = baseProjection(region, transform, w, h);
973
- const o = _chunk3YDQLQH2cjs.unprojectCanvasPoint.call(void 0, { x: 0.5, y: 0.5 }, p);
974
- const ox = _chunk3YDQLQH2cjs.unprojectCanvasPoint.call(void 0, { x: 1.5, y: 0.5 }, p);
975
- const oy = _chunk3YDQLQH2cjs.unprojectCanvasPoint.call(void 0, { x: 0.5, y: 1.5 }, p);
974
+ const o = _chunk32MMQYCQcjs.unprojectCanvasPoint.call(void 0, { x: 0.5, y: 0.5 }, p);
975
+ const ox = _chunk32MMQYCQcjs.unprojectCanvasPoint.call(void 0, { x: 1.5, y: 0.5 }, p);
976
+ const oy = _chunk32MMQYCQcjs.unprojectCanvasPoint.call(void 0, { x: 0.5, y: 1.5 }, p);
976
977
  const ux = Math.round(ox.x - o.x);
977
978
  const vx = Math.round(ox.y - o.y);
978
979
  const uy = Math.round(oy.x - o.x);
@@ -1001,23 +1002,23 @@ function applyOutputStage(img, opacity, legacyOutputBlur) {
1001
1002
  const d = img.data;
1002
1003
  for (let i = 3; i < d.length; i += 4) d[i] = d[i] * opacity;
1003
1004
  }
1004
- if (legacyOutputBlur && legacyOutputBlur > 0) _chunk3YDQLQH2cjs.applyBoxBlur.call(void 0, img, Math.min(Math.round(legacyOutputBlur), 40));
1005
+ if (legacyOutputBlur && legacyOutputBlur > 0) _chunk32MMQYCQcjs.applyBoxBlur.call(void 0, img, Math.min(Math.round(legacyOutputBlur), 40));
1005
1006
  }
1006
1007
  function needsLegacyBase(input) {
1007
1008
  const { stack, region, canvas, transform } = input;
1008
- if (!_chunk3YDQLQH2cjs.isLegacyShape.call(void 0, stack)) return false;
1009
+ if (!_chunk32MMQYCQcjs.isLegacyShape.call(void 0, stack)) return false;
1009
1010
  const bg = stack.layers[0];
1010
1011
  if (!isQuarterTurn(transform.rotate) || !isIntegerRect(region)) return true;
1011
1012
  if (_optionalChain([bg, 'access', _2 => _2.mask, 'optionalAccess', _3 => _3.source, 'optionalAccess', _4 => _4.enabled]) && bg.mask.source.maskSource) return true;
1012
1013
  if (stack.outputOpacity < 1) return true;
1013
- const blur = _chunk3YDQLQH2cjs.blurFilter.call(void 0, bg);
1014
+ const blur = _chunk32MMQYCQcjs.blurFilter.call(void 0, bg);
1014
1015
  if (blur && blur.enabled && blur.radius > 0) {
1015
1016
  const full = region.x === 0 && region.y === 0 && region.width === canvas.width && region.height === canvas.height;
1016
- const angle = _chunk3YDQLQH2cjs.normalizeAngle.call(void 0, transform.rotate);
1017
+ const angle = _chunk32MMQYCQcjs.normalizeAngle.call(void 0, transform.rotate);
1017
1018
  if (!full || angle === 90 || angle === 270) return true;
1018
1019
  }
1019
1020
  if ((_nullishCoalesce(stack.legacyOutputBlur, () => ( 0))) > 0 && !input.sourceOpaque) return true;
1020
- if (_chunk3YDQLQH2cjs.hasResampledLegacyMask.call(void 0, stack.layers, canvas.width, canvas.height)) return true;
1021
+ if (_chunk32MMQYCQcjs.hasResampledLegacyMask.call(void 0, stack.layers, canvas.width, canvas.height)) return true;
1021
1022
  return false;
1022
1023
  }
1023
1024
  var isPlainAnnotation = (l) => l.type === "annotation" ? l.opacity === 1 && l.blend === "normal" && !l.clipped && !l.mask : (l.type === "shape" || l.type === "type") && Boolean(l.annotation) && l.opacity === 1 && l.blend === (_nullishCoalesce(l.annotation.blend, () => ( "normal"))) && !l.clipped && !l.mask && !l.effects && (_nullishCoalesce(l.fillOpacity, () => ( 1))) === 1;
@@ -1049,7 +1050,7 @@ function coveringRect(region) {
1049
1050
  const y = Math.floor(region.y);
1050
1051
  return { x, y, width: Math.ceil(region.x + region.width) - x, height: Math.ceil(region.y + region.height) - y };
1051
1052
  }
1052
- function renderLayeredBase(stack, region, transform, sources, compositor = new (0, _chunk3YDQLQH2cjs.LayerCompositor)()) {
1053
+ function renderLayeredBase(stack, region, transform, sources, compositor = new (0, _chunk32MMQYCQcjs.LayerCompositor)()) {
1053
1054
  if (!isQuarterTurn(transform.rotate) || !isIntegerRect(region)) {
1054
1055
  throw new Error("renderLayeredBase needs an integer region and a quarter-turn rotation.");
1055
1056
  }
@@ -1183,8 +1184,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1183
1184
  * The viewport's compositor. It only ever composites the viewport's stack, so its tile cache can
1184
1185
  * trust dirty rectangles; exports use `exportCompositor`.
1185
1186
  */
1186
- __init8() {this.compositor = new (0, _chunk3YDQLQH2cjs.LayerCompositor)()}
1187
- __init9() {this.exportCompositor = new (0, _chunk3YDQLQH2cjs.LayerCompositor)({ maxCacheBytes: 64 * 1024 * 1024 })}
1187
+ __init8() {this.compositor = new (0, _chunk32MMQYCQcjs.LayerCompositor)()}
1188
+ __init9() {this.exportCompositor = new (0, _chunk32MMQYCQcjs.LayerCompositor)({ maxCacheBytes: 64 * 1024 * 1024 })}
1188
1189
  /** How the host resolves layer pixels (set by the controller). */
1189
1190
 
1190
1191
  /**
@@ -1263,9 +1264,9 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1263
1264
  return;
1264
1265
  }
1265
1266
  const isActivelyCropping = Boolean(options.showCropOverlay || state.activeTool === "crop");
1266
- const projection = _chunk3YDQLQH2cjs.getViewportProjection.call(void 0, geoState, vpWidth, vpHeight, isActivelyCropping);
1267
+ const projection = _chunk32MMQYCQcjs.getViewportProjection.call(void 0, geoState, vpWidth, vpHeight, isActivelyCropping);
1267
1268
  const { region } = projection;
1268
- const rotated = _chunk3YDQLQH2cjs.getRotatedSize.call(void 0, region.width, region.height, transform);
1269
+ const rotated = _chunk32MMQYCQcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
1269
1270
  const route = this.chooseRoute(state, region, naturalWidth, naturalHeight);
1270
1271
  let overlay = annotations;
1271
1272
  if (route === "legacy") {
@@ -1275,8 +1276,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1275
1276
  `${naturalWidth}x${naturalHeight}`,
1276
1277
  `${region.x},${region.y},${region.width},${region.height}`,
1277
1278
  `${projection.angle},${transform.flipH},${transform.flipV}`,
1278
- `${adjustments.brightness},${adjustments.contrast},${adjustments.saturation},${adjustments.exposure},${adjustments.temperature},${_nullishCoalesce(adjustments.tint, () => ( 0))},${adjustments.blur},${adjustments.opacity},p${_chunk3YDQLQH2cjs.normalizeProcessVersion.call(void 0, adjustments.process)}`,
1279
- _chunk3YDQLQH2cjs.adjustmentLayersKey.call(void 0, adjustments.layers),
1279
+ `${adjustments.brightness},${adjustments.contrast},${adjustments.saturation},${adjustments.exposure},${adjustments.temperature},${_nullishCoalesce(adjustments.tint, () => ( 0))},${adjustments.blur},${adjustments.opacity},p${_chunk32MMQYCQcjs.normalizeProcessVersion.call(void 0, adjustments.process)}`,
1280
+ _chunk32MMQYCQcjs.adjustmentLayersKey.call(void 0, adjustments.layers),
1280
1281
  `${depthMask.enabled},${depthMask.maskSource},${_optionalChain([depthMask, 'access', _5 => _5.depthRange, 'optionalAccess', _6 => _6[0]])}-${_optionalChain([depthMask, 'access', _7 => _7.depthRange, 'optionalAccess', _8 => _8[1]])},${depthMask.softness},${depthMask.invert},${depthMask.mode}`,
1281
1282
  `d${this.displayKey}`
1282
1283
  ].join("|");
@@ -1310,7 +1311,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1310
1311
  }
1311
1312
  if (overlay.length > 0 || options.draftAnnotation) {
1312
1313
  ctx.save();
1313
- _chunk3YDQLQH2cjs.applyImageProjectionToContext.call(void 0, ctx, projection);
1314
+ _chunk32MMQYCQcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
1314
1315
  ctx.beginPath();
1315
1316
  ctx.rect(region.x, region.y, region.width, region.height);
1316
1317
  ctx.clip();
@@ -1333,7 +1334,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1333
1334
  if (_optionalChain([state, 'access', _15 => _15.selection, 'optionalAccess', _16 => _16.bounds]) && display !== "none" || _optionalChain([options, 'access', _17 => _17.draftSelectionPath, 'optionalAccess', _18 => _18.length])) {
1334
1335
  ctx.save();
1335
1336
  try {
1336
- _chunk3YDQLQH2cjs.applyImageProjectionToContext.call(void 0, ctx, projection);
1337
+ _chunk32MMQYCQcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
1337
1338
  ctx.beginPath();
1338
1339
  ctx.rect(region.x, region.y, region.width, region.height);
1339
1340
  ctx.clip();
@@ -1348,7 +1349,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1348
1349
  const b = options.brushCursor;
1349
1350
  ctx.save();
1350
1351
  try {
1351
- _chunk3YDQLQH2cjs.applyImageProjectionToContext.call(void 0, ctx, projection);
1352
+ _chunk32MMQYCQcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
1352
1353
  const px2 = 1 / (projection.scale || 1);
1353
1354
  ctx.beginPath();
1354
1355
  ctx.arc(b.x, b.y, Math.max(px2, b.diameter / 2), 0, Math.PI * 2);
@@ -1363,7 +1364,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1363
1364
  ctx.restore();
1364
1365
  }
1365
1366
  if (options.cloneSourceMarker) {
1366
- const m = _chunk3YDQLQH2cjs.projectImagePoint.call(void 0, options.cloneSourceMarker, projection);
1367
+ const m = _chunk32MMQYCQcjs.projectImagePoint.call(void 0, options.cloneSourceMarker, projection);
1367
1368
  ctx.save();
1368
1369
  try {
1369
1370
  const r = 7;
@@ -1387,7 +1388,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1387
1388
  const t = options.textEdit;
1388
1389
  ctx.save();
1389
1390
  try {
1390
- const scr = (p) => _chunk3YDQLQH2cjs.projectImagePoint.call(void 0, p, projection);
1391
+ const scr = (p) => _chunk32MMQYCQcjs.projectImagePoint.call(void 0, p, projection);
1391
1392
  const poly = (pts) => {
1392
1393
  ctx.beginPath();
1393
1394
  pts.map(scr).forEach((p, i) => i ? ctx.lineTo(p.x, p.y) : ctx.moveTo(p.x, p.y));
@@ -1426,7 +1427,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1426
1427
  const t = options.freeTransform;
1427
1428
  ctx.save();
1428
1429
  try {
1429
- const scr = (p) => _chunk3YDQLQH2cjs.projectImagePoint.call(void 0, p, projection);
1430
+ const scr = (p) => _chunk32MMQYCQcjs.projectImagePoint.call(void 0, p, projection);
1430
1431
  ctx.beginPath();
1431
1432
  if (t.warp) {
1432
1433
  for (const c of t.warp.curves) {
@@ -1484,7 +1485,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1484
1485
  }
1485
1486
  if (isActivelyCropping) {
1486
1487
  const activeCrop = options.draftCrop !== void 0 && options.draftCrop !== null ? options.draftCrop : _nullishCoalesce(crop, () => ( { x: 0, y: 0, width: naturalWidth, height: naturalHeight }));
1487
- this.drawCropOverlay(ctx, _chunk3YDQLQH2cjs.getViewportMetrics.call(void 0, geoState, vpWidth, vpHeight, true, activeCrop));
1488
+ this.drawCropOverlay(ctx, _chunk32MMQYCQcjs.getViewportMetrics.call(void 0, geoState, vpWidth, vpHeight, true, activeCrop));
1488
1489
  }
1489
1490
  }
1490
1491
  /**
@@ -1493,7 +1494,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1493
1494
  */
1494
1495
  async renderBaseImage(img, naturalWidth, naturalHeight, region, transform, state, onPixels) {
1495
1496
  const { adjustments, depthMask } = state;
1496
- const rotated = _chunk3YDQLQH2cjs.getRotatedSize.call(void 0, region.width, region.height, transform);
1497
+ const rotated = _chunk32MMQYCQcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
1497
1498
  const baseW = Math.max(1, Math.round(rotated.width));
1498
1499
  const baseH = Math.max(1, Math.round(rotated.height));
1499
1500
  const baseCanvas = this.createCanvas(baseW, baseH);
@@ -1501,7 +1502,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1501
1502
  if (!baseCtx) return baseCanvas;
1502
1503
  const projection = getBaseProjection(region, transform, baseW, baseH);
1503
1504
  baseCtx.save();
1504
- _chunk3YDQLQH2cjs.applyImageProjectionToContext.call(void 0, baseCtx, projection);
1505
+ _chunk32MMQYCQcjs.applyImageProjectionToContext.call(void 0, baseCtx, projection);
1505
1506
  baseCtx.drawImage(
1506
1507
  img,
1507
1508
  region.x,
@@ -1516,8 +1517,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1516
1517
  baseCtx.restore();
1517
1518
  const imageData = baseCtx.getImageData(0, 0, baseW, baseH);
1518
1519
  if (imageData) {
1519
- const layerMasks = _chunk3YDQLQH2cjs.buildLayerMaskPlanes.call(void 0, adjustments.layers, naturalWidth, naturalHeight, projection, baseW, baseH);
1520
- _chunk3YDQLQH2cjs.applyAdjustments.call(void 0, imageData, adjustments, layerMasks ? { layerMasks } : {});
1520
+ const layerMasks = _chunk32MMQYCQcjs.buildLayerMaskPlanes.call(void 0, adjustments.layers, naturalWidth, naturalHeight, projection, baseW, baseH);
1521
+ _chunk32MMQYCQcjs.applyAdjustments.call(void 0, imageData, adjustments, layerMasks ? { layerMasks } : {});
1521
1522
  if (depthMask.enabled && depthMask.maskSource) {
1522
1523
  try {
1523
1524
  const maskImg = await this.imageCache.get(depthMask.maskSource);
@@ -1528,7 +1529,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1528
1529
  const maskCtx = maskCanvas.getContext("2d");
1529
1530
  if (maskCtx) {
1530
1531
  maskCtx.save();
1531
- _chunk3YDQLQH2cjs.applyImageProjectionToContext.call(void 0, maskCtx, projection);
1532
+ _chunk32MMQYCQcjs.applyImageProjectionToContext.call(void 0, maskCtx, projection);
1532
1533
  maskCtx.drawImage(
1533
1534
  maskImg,
1534
1535
  region.x * sx,
@@ -1543,7 +1544,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1543
1544
  maskCtx.restore();
1544
1545
  const maskData = maskCtx.getImageData(0, 0, baseW, baseH);
1545
1546
  if (maskData) {
1546
- _chunk3YDQLQH2cjs.applyDepthMask.call(void 0, imageData, maskData, depthMask);
1547
+ _chunk32MMQYCQcjs.applyDepthMask.call(void 0, imageData, maskData, depthMask);
1547
1548
  }
1548
1549
  }
1549
1550
  } catch (e8) {
@@ -1562,7 +1563,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1562
1563
  else if (this.baseRoute === "layers") route = "layers";
1563
1564
  else {
1564
1565
  const stack = { layers: state.layers, outputOpacity: _nullishCoalesce(state.outputOpacity, () => ( 1)), legacyOutputBlur: state.legacyOutputBlur };
1565
- const shaped = this.baseRoute === "legacy" && _chunk3YDQLQH2cjs.isLegacyShape.call(void 0, stack);
1566
+ const shaped = this.baseRoute === "legacy" && _chunk32MMQYCQcjs.isLegacyShape.call(void 0, stack);
1566
1567
  route = shaped || needsLegacyBase({
1567
1568
  stack,
1568
1569
  region,
@@ -1697,17 +1698,17 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1697
1698
  if (!comp) return null;
1698
1699
  const opacity = _nullishCoalesce(state.outputOpacity, () => ( 1));
1699
1700
  const blur = _nullishCoalesce(state.legacyOutputBlur, () => ( 0));
1700
- const rotated = _chunk3YDQLQH2cjs.getRotatedSize.call(void 0, region.width, region.height, transform);
1701
+ const rotated = _chunk32MMQYCQcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
1701
1702
  const baseW = Math.max(1, Math.round(rotated.width));
1702
1703
  const baseH = Math.max(1, Math.round(rotated.height));
1703
- const key = `${this.displayKey}:${comp.version}|${region.x},${region.y},${region.width},${region.height}|${_chunk3YDQLQH2cjs.normalizeAngle.call(void 0, transform.rotate)},${transform.flipH},${transform.flipV}|${opacity}|${blur}`;
1704
+ const key = `${this.displayKey}:${comp.version}|${region.x},${region.y},${region.width},${region.height}|${_chunk32MMQYCQcjs.normalizeAngle.call(void 0, transform.rotate)},${transform.flipH},${transform.flipV}|${opacity}|${blur}`;
1704
1705
  if (this.cachedPostCanvas && this.cachedPostKey === key) return { canvas: this.cachedPostCanvas, histogram: this.cachedPostHistogram };
1705
1706
  const canvas = this.cachedPostCanvas && this.cachedPostCanvas.width === baseW && this.cachedPostCanvas.height === baseH ? this.cachedPostCanvas : this.createCanvas(baseW, baseH);
1706
1707
  const ctx = canvas.getContext("2d");
1707
1708
  if (!ctx) return null;
1708
1709
  ctx.clearRect(0, 0, baseW, baseH);
1709
1710
  ctx.save();
1710
- _chunk3YDQLQH2cjs.applyImageProjectionToContext.call(void 0, ctx, baseProjection(region, transform, baseW, baseH));
1711
+ _chunk32MMQYCQcjs.applyImageProjectionToContext.call(void 0, ctx, baseProjection(region, transform, baseW, baseH));
1711
1712
  ctx.beginPath();
1712
1713
  ctx.rect(region.x, region.y, region.width, region.height);
1713
1714
  ctx.clip();
@@ -1979,7 +1980,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1979
1980
  ctx.strokeStyle = "#3b82f6";
1980
1981
  ctx.lineWidth = 1.5;
1981
1982
  ctx.setLineDash([4, 4]);
1982
- const bounds = _chunk3YDQLQH2cjs.getAnnotationBounds.call(void 0, ann);
1983
+ const bounds = _chunk32MMQYCQcjs.getAnnotationBounds.call(void 0, ann);
1983
1984
  const pad = 4;
1984
1985
  ctx.strokeRect(bounds.x - pad, bounds.y - pad, bounds.width + pad * 2, bounds.height + pad * 2);
1985
1986
  ctx.fillStyle = "#ffffff";
@@ -2000,7 +2001,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
2000
2001
  }
2001
2002
  /** @deprecated Use the standalone `getAnnotationBounds` from the geometry module. */
2002
2003
  getAnnotationBounds(ann) {
2003
- return _chunk3YDQLQH2cjs.getAnnotationBounds.call(void 0, ann);
2004
+ return _chunk32MMQYCQcjs.getAnnotationBounds.call(void 0, ann);
2004
2005
  }
2005
2006
  /**
2006
2007
  * Draws a rule-of-thirds crop grid overlay. All rectangles come from
@@ -2082,8 +2083,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
2082
2083
  }
2083
2084
  const { width: naturalWidth, height: naturalHeight } = getSourceSize(img);
2084
2085
  const { crop, transform, annotations } = state;
2085
- const region = crop ? _chunk3YDQLQH2cjs.clampCropToImage.call(void 0, crop, naturalWidth, naturalHeight) : { x: 0, y: 0, width: naturalWidth, height: naturalHeight };
2086
- const rotated = _chunk3YDQLQH2cjs.getRotatedSize.call(void 0, region.width, region.height, transform);
2086
+ const region = crop ? _chunk32MMQYCQcjs.clampCropToImage.call(void 0, crop, naturalWidth, naturalHeight) : { x: 0, y: 0, width: naturalWidth, height: naturalHeight };
2087
+ const rotated = _chunk32MMQYCQcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
2087
2088
  const baseW = Math.max(1, Math.round(rotated.width));
2088
2089
  const baseH = Math.max(1, Math.round(rotated.height));
2089
2090
  const exportW = options.width || baseW;
@@ -2112,7 +2113,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
2112
2113
  const bctx = baseCanvas.getContext("2d");
2113
2114
  if (bctx) {
2114
2115
  bctx.save();
2115
- _chunk3YDQLQH2cjs.applyImageProjectionToContext.call(void 0, bctx, baseProjection(region, transform, baseW, baseH));
2116
+ _chunk32MMQYCQcjs.applyImageProjectionToContext.call(void 0, bctx, baseProjection(region, transform, baseW, baseH));
2116
2117
  bctx.beginPath();
2117
2118
  bctx.rect(region.x, region.y, region.width, region.height);
2118
2119
  bctx.clip();
@@ -2125,7 +2126,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
2125
2126
  if (options.includeAnnotations !== false && overlay.length > 0) {
2126
2127
  ctx.save();
2127
2128
  ctx.scale(exportW / baseW, exportH / baseH);
2128
- _chunk3YDQLQH2cjs.applyImageProjectionToContext.call(void 0, ctx, getBaseProjection(region, transform, baseW, baseH));
2129
+ _chunk32MMQYCQcjs.applyImageProjectionToContext.call(void 0, ctx, getBaseProjection(region, transform, baseW, baseH));
2129
2130
  for (const ann of overlay) {
2130
2131
  await this.drawAnnotation(ctx, ann);
2131
2132
  }
@@ -2215,7 +2216,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
2215
2216
  case "rect":
2216
2217
  case "image":
2217
2218
  case "text": {
2218
- const b = _chunk3YDQLQH2cjs.getAnnotationBounds.call(void 0, ann);
2219
+ const b = _chunk32MMQYCQcjs.getAnnotationBounds.call(void 0, ann);
2219
2220
  ctx.fillRect(b.x, b.y, b.width, b.height);
2220
2221
  break;
2221
2222
  }
@@ -2235,7 +2236,7 @@ function getSourceSize(img, fallbackW = 800, fallbackH = 600) {
2235
2236
  function getBaseProjection(region, transform, baseW, baseH) {
2236
2237
  return {
2237
2238
  region,
2238
- angle: _chunk3YDQLQH2cjs.normalizeAngle.call(void 0, transform.rotate),
2239
+ angle: _chunk32MMQYCQcjs.normalizeAngle.call(void 0, transform.rotate),
2239
2240
  flipH: transform.flipH,
2240
2241
  flipV: transform.flipV,
2241
2242
  scale: 1,
@@ -2512,7 +2513,7 @@ var TextEditSession = (_class5 = class {
2512
2513
  else {
2513
2514
  const layout = this.layout();
2514
2515
  if (layout && layout.lines.length) {
2515
- const c = _chunkQMI5HZWAcjs.caretAt.call(void 0, layout, f);
2516
+ const c = _chunk236TKNURcjs.caretAt.call(void 0, layout, f);
2516
2517
  const line = layout.lines[c.line];
2517
2518
  if (to === "home") f = line.start;
2518
2519
  else if (to === "end") {
@@ -2607,7 +2608,7 @@ var TextEditSession = (_class5 = class {
2607
2608
  styleHere() {
2608
2609
  const layer = this.layer;
2609
2610
  const at = this.start > 0 && this.start === this.end ? this.start - 1 : this.start;
2610
- return _chunkQMI5HZWAcjs.styleAt.call(void 0, layer.runs, at, _chunkQMI5HZWAcjs.DEFAULT_TEXT_STYLE);
2611
+ return _chunk236TKNURcjs.styleAt.call(void 0, layer.runs, at, _chunk236TKNURcjs.DEFAULT_TEXT_STYLE);
2611
2612
  }
2612
2613
  info() {
2613
2614
  return this.controller.getTextLayer(this.layerId);
@@ -2616,8 +2617,8 @@ var TextEditSession = (_class5 = class {
2616
2617
  overlay() {
2617
2618
  const layer = this.layer;
2618
2619
  const layout = this.layout();
2619
- const m = _chunk3YDQLQH2cjs.textMatrix.call(void 0, layer);
2620
- const at = (x, y) => _chunkQMI5HZWAcjs.applyMatrix.call(void 0, m, { x, y });
2620
+ const m = _chunk32MMQYCQcjs.textMatrix.call(void 0, layer);
2621
+ const at = (x, y) => _chunk236TKNURcjs.applyMatrix.call(void 0, m, { x, y });
2621
2622
  let frame = null;
2622
2623
  if (layer.frame.kind === "box") frame = [at(0, 0), at(layer.frame.width, 0), at(layer.frame.width, layer.frame.height), at(0, layer.frame.height)];
2623
2624
  else if (layout) {
@@ -2637,7 +2638,7 @@ var TextEditSession = (_class5 = class {
2637
2638
  selection.push([at(x0, top), at(x1, top), at(x1, bottom), at(x0, bottom)]);
2638
2639
  }
2639
2640
  }
2640
- const c = _chunkQMI5HZWAcjs.caretAt.call(void 0, layout, this.focus);
2641
+ const c = _chunk236TKNURcjs.caretAt.call(void 0, layout, this.focus);
2641
2642
  return { caret: [at(c.x, c.top), at(c.x, c.bottom)], selection, frame };
2642
2643
  }
2643
2644
  /** Ends editing: an empty layer made for this session is deleted (as Photoshop does). Returns whether the layer remains. */
@@ -2652,7 +2653,7 @@ var TextEditSession = (_class5 = class {
2652
2653
  }
2653
2654
  if (this.layer.name === "Text" && this.changed) {
2654
2655
  try {
2655
- this.controller.setLayerProperties(this.layerId, { name: _chunk3YDQLQH2cjs.typeLayerName.call(void 0, this.text) }, false);
2656
+ this.controller.setLayerProperties(this.layerId, { name: _chunk32MMQYCQcjs.typeLayerName.call(void 0, this.text) }, false);
2656
2657
  } catch (e15) {
2657
2658
  }
2658
2659
  }
@@ -2663,8 +2664,8 @@ function typeLayerAt(controller, p, slop = 4) {
2663
2664
  const layers = [...flattenTypeLayers(controller.getLayers())].reverse();
2664
2665
  for (const l of layers) {
2665
2666
  if (!l.visible) continue;
2666
- const inv = invert(_chunk3YDQLQH2cjs.textMatrix.call(void 0, l));
2667
- const q = _chunkQMI5HZWAcjs.applyMatrix.call(void 0, inv, p);
2667
+ const inv = invert(_chunk32MMQYCQcjs.textMatrix.call(void 0, l));
2668
+ const q = _chunk236TKNURcjs.applyMatrix.call(void 0, inv, p);
2668
2669
  let b = null;
2669
2670
  if (l.frame.kind === "box") b = { x: 0, y: 0, width: l.frame.width, height: l.frame.height };
2670
2671
  else {
@@ -2803,8 +2804,8 @@ function polygonCoverage(points, width, height, antiAlias = true) {
2803
2804
  }
2804
2805
  function toMask(width, height, coverage) {
2805
2806
  const out = new Uint8Array(coverage.length);
2806
- for (let i = 0; i < out.length; i++) out[i] = _chunk3YDQLQH2cjs.coverageToByte.call(void 0, coverage[i]);
2807
- return _chunk3YDQLQH2cjs.createSelectionMask.call(void 0, width, height, out);
2807
+ for (let i = 0; i < out.length; i++) out[i] = _chunk32MMQYCQcjs.coverageToByte.call(void 0, coverage[i]);
2808
+ return _chunk32MMQYCQcjs.createSelectionMask.call(void 0, width, height, out);
2808
2809
  }
2809
2810
  function polygonSelection(width, height, points, options = {}) {
2810
2811
  return toMask(width, height, polygonCoverage(points, width, height, _nullishCoalesce(options.antiAlias, () => ( true))));
@@ -2931,7 +2932,7 @@ function magicWand(pixels, seed, options = {}) {
2931
2932
  const { width: w, height: h } = pixels;
2932
2933
  const sx = Math.floor(seed.x);
2933
2934
  const sy = Math.floor(seed.y);
2934
- if (!(sx >= 0 && sy >= 0 && sx < w && sy < h)) return _chunk3YDQLQH2cjs.createSelectionMask.call(void 0, w, h);
2935
+ if (!(sx >= 0 && sy >= 0 && sx < w && sy < h)) return _chunk32MMQYCQcjs.createSelectionMask.call(void 0, w, h);
2935
2936
  const similar = similarity(pixels, sy * w + sx, _nullishCoalesce(options.tolerance, () => ( 32)), _nullishCoalesce(options.distance, () => ( "rgb")));
2936
2937
  const marks = new Uint8Array(n);
2937
2938
  let bx0 = w;
@@ -2979,9 +2980,9 @@ function magicWand(pixels, seed, options = {}) {
2979
2980
  }
2980
2981
  }
2981
2982
  }
2982
- if (bx1 < 0) return _chunk3YDQLQH2cjs.createSelectionMask.call(void 0, w, h);
2983
- if (!(_nullishCoalesce(options.antiAlias, () => ( true)))) return _chunk3YDQLQH2cjs.createSelectionMask.call(void 0, w, h, marks);
2984
- return _chunk3YDQLQH2cjs.createSelectionMask.call(void 0,
2983
+ if (bx1 < 0) return _chunk32MMQYCQcjs.createSelectionMask.call(void 0, w, h);
2984
+ if (!(_nullishCoalesce(options.antiAlias, () => ( true)))) return _chunk32MMQYCQcjs.createSelectionMask.call(void 0, w, h, marks);
2985
+ return _chunk32MMQYCQcjs.createSelectionMask.call(void 0,
2985
2986
  w,
2986
2987
  h,
2987
2988
  antialiasMarks(marks, w, h, Math.max(0, bx0 - 1), Math.max(0, by0 - 1), Math.min(w, bx1 + 2), Math.min(h, by1 + 2))
@@ -3003,7 +3004,7 @@ function colorRange(pixels, samples, options = {}) {
3003
3004
  const parsed = samples.map((s) => ({ c: sampleColor(s.color), at: s.at }));
3004
3005
  const radius = options.localized !== void 0 ? Math.max(1, options.localized) : void 0;
3005
3006
  const out = new Uint8Array(n);
3006
- if (!parsed.length) return _chunk3YDQLQH2cjs.createSelectionMask.call(void 0, w, h, out);
3007
+ if (!parsed.length) return _chunk32MMQYCQcjs.createSelectionMask.call(void 0, w, h, out);
3007
3008
  for (let i = 0; i < n; i++) {
3008
3009
  const p = i * 4;
3009
3010
  if (data[p + 3] <= 0) continue;
@@ -3019,9 +3020,9 @@ function colorRange(pixels, samples, options = {}) {
3019
3020
  }
3020
3021
  if (k > best) best = k;
3021
3022
  }
3022
- out[i] = _chunk3YDQLQH2cjs.coverageToByte.call(void 0, best);
3023
+ out[i] = _chunk32MMQYCQcjs.coverageToByte.call(void 0, best);
3023
3024
  }
3024
- return _chunk3YDQLQH2cjs.createSelectionMask.call(void 0, w, h, out);
3025
+ return _chunk32MMQYCQcjs.createSelectionMask.call(void 0, w, h, out);
3025
3026
  }
3026
3027
  var TONE_RANGE_PRESETS = {
3027
3028
  shadows: [0, 65],
@@ -3039,9 +3040,9 @@ function toneRange(pixels, range, falloff = 20) {
3039
3040
  if (d[p + 3] <= 0) continue;
3040
3041
  const l = Math.min(255, Math.max(0, 0.299 * d[p] + 0.587 * d[p + 1] + 0.114 * d[p + 2]));
3041
3042
  const outside = l < lo ? lo - l : l > hi ? l - hi : 0;
3042
- out[i] = _chunk3YDQLQH2cjs.coverageToByte.call(void 0, 1 - outside / ramp);
3043
+ out[i] = _chunk32MMQYCQcjs.coverageToByte.call(void 0, 1 - outside / ramp);
3043
3044
  }
3044
- return _chunk3YDQLQH2cjs.createSelectionMask.call(void 0, pixels.width, pixels.height, out);
3045
+ return _chunk32MMQYCQcjs.createSelectionMask.call(void 0, pixels.width, pixels.height, out);
3045
3046
  }
3046
3047
  function hueRange(pixels, center) {
3047
3048
  const n = checkPixels(pixels);
@@ -3064,9 +3065,9 @@ function hueRange(pixels, center) {
3064
3065
  hue *= 60;
3065
3066
  let dh = ((hue - center) % 360 + 360) % 360;
3066
3067
  dh = Math.min(dh, 360 - dh);
3067
- out[i] = _chunk3YDQLQH2cjs.coverageToByte.call(void 0, Math.min(1, Math.max(0, 1 - dh / 60)) * chroma * (2 - mx));
3068
+ out[i] = _chunk32MMQYCQcjs.coverageToByte.call(void 0, Math.min(1, Math.max(0, 1 - dh / 60)) * chroma * (2 - mx));
3068
3069
  }
3069
- return _chunk3YDQLQH2cjs.createSelectionMask.call(void 0, pixels.width, pixels.height, out);
3070
+ return _chunk32MMQYCQcjs.createSelectionMask.call(void 0, pixels.width, pixels.height, out);
3070
3071
  }
3071
3072
 
3072
3073
  // src/image-editor/selection/refine.ts
@@ -3200,9 +3201,9 @@ function edgeWidth(guide, w, h, r) {
3200
3201
  g[yy * w + xx] = Math.sqrt(gx * gx + gy * gy);
3201
3202
  }
3202
3203
  }
3203
- const gm = _chunk3YDQLQH2cjs.greyMorphology.call(void 0, g, w, h, r, true);
3204
- const hi = _chunk3YDQLQH2cjs.greyMorphology.call(void 0, y, w, h, r, true);
3205
- const lo = _chunk3YDQLQH2cjs.greyMorphology.call(void 0, y, w, h, r, false);
3204
+ const gm = _chunk32MMQYCQcjs.greyMorphology.call(void 0, g, w, h, r, true);
3205
+ const hi = _chunk32MMQYCQcjs.greyMorphology.call(void 0, y, w, h, r, true);
3206
+ const lo = _chunk32MMQYCQcjs.greyMorphology.call(void 0, y, w, h, r, false);
3206
3207
  const out = new Float32Array(n);
3207
3208
  for (let i = 0; i < n; i++) out[i] = (hi[i] - lo[i]) / Math.max(gm[i], 1e-4);
3208
3209
  return out;
@@ -3226,7 +3227,7 @@ function refineCoverage(guide, m, w, h, params = {}) {
3226
3227
  }
3227
3228
  }
3228
3229
  if (any) {
3229
- const dist = _chunk3YDQLQH2cjs.distanceTransform.call(void 0, boundary, w, h);
3230
+ const dist = _chunk32MMQYCQcjs.distanceTransform.call(void 0, boundary, w, h);
3230
3231
  const r = gfRadius(p);
3231
3232
  const q = guidedFilterColor(guide, m, w, h, r);
3232
3233
  const widths = p.smartRadius ? edgeWidth(guide, w, h, r) : null;
@@ -3252,7 +3253,7 @@ function refineCoverage(guide, m, w, h, params = {}) {
3252
3253
  for (let i = 0; i < a.length; i++) a[i] = Math.min(1, Math.max(0, (a[i] - 0.5) * gain + 0.5));
3253
3254
  }
3254
3255
  const amount = shiftAmount(p);
3255
- if (Math.abs(amount) >= 1e-4) a = _chunk3YDQLQH2cjs.shiftCoverage.call(void 0, a, w, h, amount);
3256
+ if (Math.abs(amount) >= 1e-4) a = _chunk32MMQYCQcjs.shiftCoverage.call(void 0, a, w, h, amount);
3256
3257
  return a;
3257
3258
  }
3258
3259
  function guidePlanes(pixels, win) {
@@ -3296,9 +3297,9 @@ function refineSelection(pixels, mask, params = {}) {
3296
3297
  const out = new Uint8Array(mask.width * mask.height);
3297
3298
  for (let y = 0; y < wh; y++) {
3298
3299
  const dst = (y0 + y) * mask.width + x0;
3299
- for (let x = 0; x < ww; x++) out[dst + x] = _chunk3YDQLQH2cjs.coverageToByte.call(void 0, refined[y * ww + x]);
3300
+ for (let x = 0; x < ww; x++) out[dst + x] = _chunk32MMQYCQcjs.coverageToByte.call(void 0, refined[y * ww + x]);
3300
3301
  }
3301
- return _chunk3YDQLQH2cjs.createSelectionMask.call(void 0, mask.width, mask.height, out);
3302
+ return _chunk32MMQYCQcjs.createSelectionMask.call(void 0, mask.width, mask.height, out);
3302
3303
  }
3303
3304
 
3304
3305
  // src/image-editor/effects.ts
@@ -3468,7 +3469,7 @@ var ImageEffectsEngine = (_class7 = class {
3468
3469
  // src/image-editor/free-transform.ts
3469
3470
  var FREE_TRANSFORM_CONTENTS = ["auto", "layer", "selection", "selection-copy", "selection-outline"];
3470
3471
  var fail = (message) => {
3471
- throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(message);
3472
+ throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(message);
3472
3473
  };
3473
3474
  var T = (x, y) => [1, 0, x, 0, 1, y, 0, 0, 1];
3474
3475
  function previewStep(scale) {
@@ -3577,7 +3578,7 @@ var FreeTransformSession = (_class8 = class {
3577
3578
  } else {
3578
3579
  const id = _nullishCoalesce(init.layerId, () => ( host.activeLayerId()));
3579
3580
  if (!id) fail("No layer given and none is active; pass layerId (see list_layers).");
3580
- const layer = _chunk3YDQLQH2cjs.requireLayer.call(void 0, layers, id).layer;
3581
+ const layer = _chunk32MMQYCQcjs.requireLayer.call(void 0, layers, id).layer;
3581
3582
  this.layerId = layer.id;
3582
3583
  const mask = layer.mask && !layer.mask.source ? layer.mask : void 0;
3583
3584
  const channel = _nullishCoalesce(init.channel, () => ( (layer.id === host.activeLayerId() ? host.activeTarget() : "pixels")));
@@ -3588,20 +3589,20 @@ var FreeTransformSession = (_class8 = class {
3588
3589
  if (!maskAlone && layer.type !== "pixel" && layer.type !== "smart" && layer.type !== "shape" && layer.type !== "type") fail(`Layer "${layer.name || id}" is a ${layer.type} layer; Free Transform works on pixel, shape, type and smart object layers, layer masks (channel mask) and selections.`);
3589
3590
  if (!layer.visible && content !== "selection-copy") fail(`Layer "${layer.name || id}" is hidden; show it before you transform it.`);
3590
3591
  if (content !== "selection-copy") {
3591
- _chunk3YDQLQH2cjs.requireUnlocked.call(void 0, layer, "position", "transform it");
3592
- if (!maskAlone) _chunk3YDQLQH2cjs.requireUnlocked.call(void 0, layer, "pixels", "transform it");
3592
+ _chunk32MMQYCQcjs.requireUnlocked.call(void 0, layer, "position", "transform it");
3593
+ if (!maskAlone) _chunk32MMQYCQcjs.requireUnlocked.call(void 0, layer, "pixels", "transform it");
3593
3594
  }
3594
3595
  const o = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
3595
3596
  const pixels = layer.type === "pixel" ? host.pixelsOf(layer) : null;
3596
3597
  if (layer.type === "smart" && !maskAlone) {
3597
3598
  if (content !== "layer") fail(`Layer "${layer.name || id}" is a smart object, which transforms as a whole; use content layer (or rasterize it to transform part of it).`);
3598
- if (!_chunk3YDQLQH2cjs.isContentsDecoded.call(void 0, layer.contents)) fail(`The contents of "${layer.name || id}" are not decoded here, so it cannot be transformed; run prepareSmartObjects() first.`);
3599
+ if (!_chunk32MMQYCQcjs.isContentsDecoded.call(void 0, layer.contents)) fail(`The contents of "${layer.name || id}" are not decoded here, so it cannot be transformed; run prepareSmartObjects() first.`);
3599
3600
  this.smart = layer;
3600
3601
  this.smartObject = true;
3601
- this.startGeometry = _chunk3YDQLQH2cjs.placementGeometry.call(void 0, layer);
3602
+ this.startGeometry = _chunk32MMQYCQcjs.placementGeometry.call(void 0, layer);
3602
3603
  if (init.interpolation === void 0 && layer.placement.interpolation) this.interp = layer.placement.interpolation;
3603
3604
  this.startInterp = this.interp;
3604
- this.box = _chunk3YDQLQH2cjs.contentsBox.call(void 0, layer.contents);
3605
+ this.box = _chunk32MMQYCQcjs.contentsBox.call(void 0, layer.contents);
3605
3606
  this.moves = mask && linked ? ["pixels", "mask"] : ["pixels"];
3606
3607
  this.geometryValue = this.startGeometry;
3607
3608
  this.shown = this.startLayers;
@@ -3609,8 +3610,8 @@ var FreeTransformSession = (_class8 = class {
3609
3610
  }
3610
3611
  if (layer.type === "type" && !maskAlone) {
3611
3612
  if (content !== "layer") fail(`Layer "${layer.name || id}" is a type layer, which transforms as a whole; use content layer (or rasterize it to transform part of it).`);
3612
- const frame = _chunk3YDQLQH2cjs.typeFrame.call(void 0, layer, host.textEnv().shaper);
3613
- const m = _chunk3YDQLQH2cjs.textMatrix.call(void 0, layer);
3613
+ const frame = _chunk32MMQYCQcjs.typeFrame.call(void 0, layer, host.textEnv().shaper);
3614
+ const m = _chunk32MMQYCQcjs.textMatrix.call(void 0, layer);
3614
3615
  const at = (x, y) => ({ x: m[0] * x + m[2] * y + m[4], y: m[1] * x + m[3] * y + m[5] });
3615
3616
  this.typeTarget = layer;
3616
3617
  this.typeLayer = true;
@@ -3629,7 +3630,7 @@ var FreeTransformSession = (_class8 = class {
3629
3630
  }
3630
3631
  if (layer.type === "shape" && !maskAlone) {
3631
3632
  if (content !== "layer") fail(`Layer "${layer.name || id}" is a shape layer, which transforms as a whole; use content layer (or rasterize it to transform part of it).`);
3632
- const g = _chunk3YDQLQH2cjs.shapeGeometryBounds.call(void 0, layer);
3633
+ const g = _chunk32MMQYCQcjs.shapeGeometryBounds.call(void 0, layer);
3633
3634
  if (!g) fail(`Shape layer "${layer.name || id}" has no path to transform.`);
3634
3635
  const w = Math.max(g.width, 1);
3635
3636
  const h = Math.max(g.height, 1);
@@ -3677,7 +3678,7 @@ var FreeTransformSession = (_class8 = class {
3677
3678
  if (box) {
3678
3679
  const copy = {
3679
3680
  type: "pixel",
3680
- id: _chunk3YDQLQH2cjs.newLayerId.call(void 0, ),
3681
+ id: _chunk32MMQYCQcjs.newLayerId.call(void 0, ),
3681
3682
  name: `${layer.name || "Layer"} copy`,
3682
3683
  visible: true,
3683
3684
  opacity: 1,
@@ -3701,7 +3702,7 @@ var FreeTransformSession = (_class8 = class {
3701
3702
  if (!box) fail(content === "layer" ? "The layer has no pixels to transform." : "The selection holds no pixels of this layer; select some, or transform the outline (content selection-outline).");
3702
3703
  this.box = box;
3703
3704
  this.moves = moves;
3704
- this.startGeometry = _chunk3YDQLQH2cjs.identityTransform.call(void 0, box);
3705
+ this.startGeometry = _chunk32MMQYCQcjs.identityTransform.call(void 0, box);
3705
3706
  this.startInterp = this.interp;
3706
3707
  this.geometryValue = this.startGeometry;
3707
3708
  this.shown = this.startLayers;
@@ -3779,8 +3780,8 @@ var FreeTransformSession = (_class8 = class {
3779
3780
  warp: changes.warp === void 0 ? _nullishCoalesce(this.geometryValue.warp, () => ( null)) : changes.warp
3780
3781
  };
3781
3782
  if (next.corners.length !== 4 || !next.corners.every((p) => Number.isFinite(p.x) && Number.isFinite(p.y))) fail("corners must be four finite points: top-left, top-right, bottom-right, bottom-left.");
3782
- if (!_chunk3YDQLQH2cjs.transformMap.call(void 0, next)) fail("These corners fold the frame over itself or through the horizon; keep the quad convex.");
3783
- if (this.typeTarget && (_chunk3YDQLQH2cjs.hasWarp.call(void 0, next) || !_chunk3YDQLQH2cjs.matrixFromCorners.call(void 0, next.box, next.corners))) {
3783
+ if (!_chunk32MMQYCQcjs.transformMap.call(void 0, next)) fail("These corners fold the frame over itself or through the horizon; keep the quad convex.");
3784
+ if (this.typeTarget && (_chunk32MMQYCQcjs.hasWarp.call(void 0, next) || !_chunk32MMQYCQcjs.matrixFromCorners.call(void 0, next.box, next.corners))) {
3784
3785
  fail("Type layers take scale, rotate, skew and flips only (the corners must stay a parallelogram, no warp); rasterize the layer (rasterize_layer) for distort, perspective or warp.");
3785
3786
  }
3786
3787
  this.geometryValue = next;
@@ -3792,10 +3793,10 @@ var FreeTransformSession = (_class8 = class {
3792
3793
  if (this.smart) return { layers: this.resampleSmart(final, preview), selection: this.startSelection };
3793
3794
  if (this.typeTarget) return { layers: this.resampleType(), selection: this.startSelection };
3794
3795
  const g = this.geometryValue;
3795
- const identity = _chunk3YDQLQH2cjs.isIdentityTransform.call(void 0, g);
3796
- const warp = _chunk3YDQLQH2cjs.hasWarp.call(void 0, g);
3797
- const h = warp ? null : _chunk3YDQLQH2cjs.geometryHomography.call(void 0, g);
3798
- const f = warp ? _chunk3YDQLQH2cjs.transformMap.call(void 0, g) : null;
3796
+ const identity = _chunk32MMQYCQcjs.isIdentityTransform.call(void 0, g);
3797
+ const warp = _chunk32MMQYCQcjs.hasWarp.call(void 0, g);
3798
+ const h = warp ? null : _chunk32MMQYCQcjs.geometryHomography.call(void 0, g);
3799
+ const f = warp ? _chunk32MMQYCQcjs.transformMap.call(void 0, g) : null;
3799
3800
  const step = final ? 1 : previewStep(preview.scale);
3800
3801
  const interpolation = final ? this.interp : this.interp === "nearest" ? "nearest" : "bilinear";
3801
3802
  let layers = this.startLayers;
@@ -3839,7 +3840,7 @@ var FreeTransformSession = (_class8 = class {
3839
3840
  if (part.what === "selection") {
3840
3841
  const { width, height } = this.host.canvas();
3841
3842
  const data = new Uint8Array(_chunkCWM3CUUXcjs.readRegion.call(void 0, result, { x: 0, y: 0, width, height }).buffer);
3842
- const next = _chunk3YDQLQH2cjs.createSelectionMask.call(void 0, width, height, data);
3843
+ const next = _chunk32MMQYCQcjs.createSelectionMask.call(void 0, width, height, data);
3843
3844
  selection = next.bounds ? next : null;
3844
3845
  } else if (part.what === "pixels") {
3845
3846
  layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0, layers, targetId, (l) => {
@@ -3861,14 +3862,14 @@ var FreeTransformSession = (_class8 = class {
3861
3862
  resampleShape(final, preview, warpMap, h) {
3862
3863
  const layer = this.shape;
3863
3864
  let components = layer.components;
3864
- if (!_chunk3YDQLQH2cjs.isIdentityTransform.call(void 0, this.geometryValue)) {
3865
+ if (!_chunk32MMQYCQcjs.isIdentityTransform.call(void 0, this.geometryValue)) {
3865
3866
  const affine = !warpMap && h && Math.abs(h[6]) < 1e-12 && Math.abs(h[7]) < 1e-12 && Math.abs(h[8] - 1) < 1e-12 ? [h[0], h[3], h[1], h[4], h[2], h[5]] : void 0;
3866
3867
  const map = _nullishCoalesce(warpMap, () => ( ((p) => h ? _chunkQT26RHKKcjs.applyHomography.call(void 0, h, p) : p)));
3867
- components = _chunk3YDQLQH2cjs.transformShapeComponents.call(void 0, layer.components, (p) => _nullishCoalesce(map(p), () => ( p)), affine);
3868
+ components = _chunk32MMQYCQcjs.transformShapeComponents.call(void 0, layer.components, (p) => _nullishCoalesce(map(p), () => ( p)), affine);
3868
3869
  }
3869
3870
  const moved = { ...layer, components };
3870
3871
  delete moved.annotation;
3871
- const surface = _chunk3YDQLQH2cjs.renderShape.call(void 0, moved, this.host.shapeEnv(), final ? {} : { clip: preview.clip });
3872
+ const surface = _chunk32MMQYCQcjs.renderShape.call(void 0, moved, this.host.shapeEnv(), final ? {} : { clip: preview.clip });
3872
3873
  return _chunkHGTDMKNEcjs.mapLayer.call(void 0, this.startLayers, layer.id, () => ({ ...moved, surface }));
3873
3874
  }
3874
3875
  /**
@@ -3878,13 +3879,13 @@ var FreeTransformSession = (_class8 = class {
3878
3879
  resampleType() {
3879
3880
  const layer = this.typeTarget;
3880
3881
  const g = this.geometryValue;
3881
- if (_chunk3YDQLQH2cjs.hasWarp.call(void 0, g)) fail("Type layers cannot be warped here; rasterize the layer first (rasterize_layer), or transform it with scale, rotate and skew.");
3882
- const m = _chunk3YDQLQH2cjs.matrixFromCorners.call(void 0, g.box, g.corners);
3882
+ if (_chunk32MMQYCQcjs.hasWarp.call(void 0, g)) fail("Type layers cannot be warped here; rasterize the layer first (rasterize_layer), or transform it with scale, rotate and skew.");
3883
+ const m = _chunk32MMQYCQcjs.matrixFromCorners.call(void 0, g.box, g.corners);
3883
3884
  if (!m) fail("Type layers take scale, rotate, skew and flips only (the corners must stay a parallelogram); rasterize the layer for distort or perspective.");
3884
3885
  const next = { ...layer, transform: m };
3885
3886
  delete next.annotation;
3886
- let layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0, this.startLayers, layer.id, () => _chunk3YDQLQH2cjs.rerenderText.call(void 0, next, this.host.textEnv()));
3887
- const change = _chunkQT26RHKKcjs.multiplyHomographies.call(void 0, _chunkQT26RHKKcjs.homographyFromAffine.call(void 0, _chunkQMI5HZWAcjs.invertMatrix.call(void 0, _chunk3YDQLQH2cjs.textMatrix.call(void 0, layer))), _chunkQT26RHKKcjs.homographyFromAffine.call(void 0, m));
3887
+ let layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0, this.startLayers, layer.id, () => _chunk32MMQYCQcjs.rerenderText.call(void 0, next, this.host.textEnv()));
3888
+ const change = _chunkQT26RHKKcjs.multiplyHomographies.call(void 0, _chunkQT26RHKKcjs.homographyFromAffine.call(void 0, _chunk236TKNURcjs.invertMatrix.call(void 0, _chunk32MMQYCQcjs.textMatrix.call(void 0, layer))), _chunkQT26RHKKcjs.homographyFromAffine.call(void 0, m));
3888
3889
  for (const part of this.parts) {
3889
3890
  if (part.what !== "mask") continue;
3890
3891
  const surface = _chunkHGTDMKNEcjs.transformSurface.call(void 0, part.moving, change, { interpolation: this.interp === "nearest" ? "nearest" : "bilinear" });
@@ -3900,12 +3901,12 @@ var FreeTransformSession = (_class8 = class {
3900
3901
  const canvas = this.host.canvas();
3901
3902
  try {
3902
3903
  if (final) {
3903
- const res = _chunk3YDQLQH2cjs.setSmartPlacement.call(void 0, this.startLayers, layer.id, placement, canvas);
3904
+ const res = _chunk32MMQYCQcjs.setSmartPlacement.call(void 0, this.startLayers, layer.id, placement, canvas);
3904
3905
  this.smartMasksMoved = res.masksMoved;
3905
3906
  return res.layers;
3906
3907
  }
3907
3908
  const step = previewStep(preview.scale);
3908
- const surface = _chunk3YDQLQH2cjs.renderSmartObject.call(void 0, { ...layer, placement }, canvas, { step, clip: preview.clip, skipFilters: true, reduced: this.smartReduced });
3909
+ const surface = _chunk32MMQYCQcjs.renderSmartObject.call(void 0, { ...layer, placement }, canvas, { step, clip: preview.clip, skipFilters: true, reduced: this.smartReduced });
3909
3910
  return _chunkHGTDMKNEcjs.mapLayer.call(void 0, this.startLayers, layer.id, (l) => ({ ...l, placement, surface }));
3910
3911
  } catch (e) {
3911
3912
  if (e instanceof _chunkHGTDMKNEcjs.TransformTooLargeError) fail(e.message);
@@ -3915,10 +3916,10 @@ var FreeTransformSession = (_class8 = class {
3915
3916
  /** Whether the geometry (or the interpolation of a smart object) differs from where it started. */
3916
3917
  isChanged() {
3917
3918
  const g = this.geometryValue;
3918
- if (!this.smart && !this.typeTarget) return !_chunk3YDQLQH2cjs.isIdentityTransform.call(void 0, g);
3919
+ if (!this.smart && !this.typeTarget) return !_chunk32MMQYCQcjs.isIdentityTransform.call(void 0, g);
3919
3920
  const a = this.startGeometry;
3920
3921
  const same = g.corners.every((c, i) => Math.abs(c.x - a.corners[i].x) < 1e-9 && Math.abs(c.y - a.corners[i].y) < 1e-9);
3921
- const warp = (w, box) => w && _chunk3YDQLQH2cjs.hasWarp.call(void 0, { box, corners: a.corners, warp: w }) ? JSON.stringify(w) : "";
3922
+ const warp = (w, box) => w && _chunk32MMQYCQcjs.hasWarp.call(void 0, { box, corners: a.corners, warp: w }) ? JSON.stringify(w) : "";
3922
3923
  return !same || warp(g.warp, g.box) !== warp(a.warp, a.box) || this.interp !== this.startInterp;
3923
3924
  }
3924
3925
  render(preview) {
@@ -4178,7 +4179,7 @@ function convertSurfaceColors(surface, t) {
4178
4179
  }
4179
4180
 
4180
4181
  // src/image-editor/controller.ts
4181
- var IMAGE_EDITOR_SCHEMA_VERSION = _chunk3YDQLQH2cjs.LAYERED_SCHEMA_VERSION;
4182
+ var IMAGE_EDITOR_SCHEMA_VERSION = _chunk32MMQYCQcjs.LAYERED_SCHEMA_VERSION;
4182
4183
  var RETOUCH_TOOLS = ["clone", "heal", "spot-heal", "smudge", "dodge", "burn", "sponge", "blur", "sharpen", "history"];
4183
4184
  var isRetouchTool = (tool) => RETOUCH_TOOLS.includes(tool);
4184
4185
  var STROKE_TOOLS = ["brush", "eraser", "mixer", ...RETOUCH_TOOLS];
@@ -4372,7 +4373,7 @@ var PaintStrokeSession = (_class9 = class {
4372
4373
  for (const t of _chunkCWM3CUUXcjs.tilesInRect.call(void 0, { x: r.x - this.apply.offset.x, y: r.y - this.apply.offset.y, width: r.width, height: r.height })) {
4373
4374
  const key = _chunkCWM3CUUXcjs.tileKey.call(void 0, t.tx, t.ty);
4374
4375
  const cur = regions.get(key);
4375
- regions.set(key, { tx: t.tx, ty: t.ty, r: cur ? _chunk3YDQLQH2cjs.unionRect.call(void 0, cur.r, r) : r });
4376
+ regions.set(key, { tx: t.tx, ty: t.ty, r: cur ? _chunk32MMQYCQcjs.unionRect.call(void 0, cur.r, r) : r });
4376
4377
  }
4377
4378
  }
4378
4379
  for (const [key, { tx, ty, r }] of regions) {
@@ -4404,7 +4405,7 @@ var PaintStrokeSession = (_class9 = class {
4404
4405
  }
4405
4406
  /** Finishes the stroke (one undo step) and returns what changed. */
4406
4407
  end() {
4407
- if (this.closed) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("This stroke has already ended.");
4408
+ if (this.closed) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("This stroke has already ended.");
4408
4409
  const last = _nullishCoalesce(this.last, () => ( void 0));
4409
4410
  const rects = this.mixer ? this.mixer.finish(last) : this.stroke.finish(last);
4410
4411
  _optionalChain([this, 'access', _122 => _122.flushView, 'optionalCall', _123 => _123()]);
@@ -4540,20 +4541,20 @@ function sameTile(a, b) {
4540
4541
  for (let i = 0; i < a.data.length; i++) if (a.data[i] !== b.data[i]) return false;
4541
4542
  return true;
4542
4543
  }
4543
- var DEFAULT_ADJUSTMENTS = _chunk3YDQLQH2cjs.DEFAULT_ADJUSTMENTS_VALUES;
4544
+ var DEFAULT_ADJUSTMENTS = _chunk32MMQYCQcjs.DEFAULT_ADJUSTMENTS_VALUES;
4544
4545
  function normalizeStoredAdjustments(stored) {
4545
4546
  if (!stored) return { ...DEFAULT_ADJUSTMENTS };
4546
4547
  const out = {
4547
4548
  ...DEFAULT_ADJUSTMENTS,
4548
4549
  ...stored,
4549
- process: _chunk3YDQLQH2cjs.normalizeProcessVersion.call(void 0, stored.process)
4550
+ process: _chunk32MMQYCQcjs.normalizeProcessVersion.call(void 0, stored.process)
4550
4551
  };
4551
- const layers = _chunk3YDQLQH2cjs.normalizeAdjustmentLayers.call(void 0, stored.layers);
4552
+ const layers = _chunk32MMQYCQcjs.normalizeAdjustmentLayers.call(void 0, stored.layers);
4552
4553
  if (layers.length) out.layers = layers;
4553
4554
  else delete out.layers;
4554
4555
  return out;
4555
4556
  }
4556
- var isLayered = (data) => Boolean(data && data.version === _chunk3YDQLQH2cjs.LAYERED_SCHEMA_VERSION && Array.isArray(data.layers));
4557
+ var isLayered = (data) => Boolean(data && data.version === _chunk32MMQYCQcjs.LAYERED_SCHEMA_VERSION && Array.isArray(data.layers));
4557
4558
  function migrateSerializedImageEditorState(data) {
4558
4559
  if (isLayered(data)) {
4559
4560
  const out = {
@@ -4585,10 +4586,10 @@ function migrateSerializedImageEditorState(data) {
4585
4586
  function migrateToLayeredState(data, size) {
4586
4587
  const clean = migrateSerializedImageEditorState(data);
4587
4588
  if (isLayered(clean)) return clean;
4588
- const stack = _chunk3YDQLQH2cjs.layersFromLegacy.call(void 0, clean, Math.round(size.width), Math.round(size.height));
4589
- const { layers, assets } = _chunk3YDQLQH2cjs.serializeLayers.call(void 0, stack.layers);
4589
+ const stack = _chunk32MMQYCQcjs.layersFromLegacy.call(void 0, clean, Math.round(size.width), Math.round(size.height));
4590
+ const { layers, assets } = _chunk32MMQYCQcjs.serializeLayers.call(void 0, stack.layers);
4590
4591
  const out = {
4591
- version: _chunk3YDQLQH2cjs.LAYERED_SCHEMA_VERSION,
4592
+ version: _chunk32MMQYCQcjs.LAYERED_SCHEMA_VERSION,
4592
4593
  width: Math.round(size.width),
4593
4594
  height: Math.round(size.height),
4594
4595
  layers,
@@ -4602,8 +4603,8 @@ function migrateToLayeredState(data, size) {
4602
4603
  if (clean.selection) out.selection = clean.selection;
4603
4604
  return out;
4604
4605
  }
4605
- var DEFAULT_TRANSFORM = _chunk3YDQLQH2cjs.DEFAULT_TRANSFORM_VALUES;
4606
- var DEFAULT_DEPTH_MASK = _chunk3YDQLQH2cjs.DEFAULT_DEPTH_MASK_VALUES;
4606
+ var DEFAULT_TRANSFORM = _chunk32MMQYCQcjs.DEFAULT_TRANSFORM_VALUES;
4607
+ var DEFAULT_DEPTH_MASK = _chunk32MMQYCQcjs.DEFAULT_DEPTH_MASK_VALUES;
4607
4608
  var DEVELOP_KEYS = ["brightness", "contrast", "saturation", "exposure", "temperature", "tint"];
4608
4609
  var ImageEditorController = (_class10 = class {
4609
4610
 
@@ -4626,7 +4627,7 @@ var ImageEditorController = (_class10 = class {
4626
4627
  __init71() {this.sourceSurfaces = /* @__PURE__ */ new WeakMap()}
4627
4628
  __init72() {this.viewKey = []}
4628
4629
  /** For `compositePixels` and mask evaluation (the renderer keeps its own for the viewport). */
4629
- __init73() {this.compositor = new (0, _chunk3YDQLQH2cjs.LayerCompositor)()}
4630
+ __init73() {this.compositor = new (0, _chunk32MMQYCQcjs.LayerCompositor)()}
4630
4631
  /** The effects provider slot (see `setEffectsProvider`). */
4631
4632
  __init74() {this.effects = new (0, _chunkRUZQMYXHcjs.EffectsSlot)()}
4632
4633
  /** Renders provider effects: effect smart filter results and effect layers. */
@@ -4684,7 +4685,7 @@ var ImageEditorController = (_class10 = class {
4684
4685
  this.applyStored(_nullishCoalesce(options.initialState, () => ( {})));
4685
4686
  if (_optionalChain([options, 'access', _139 => _139.initialState, 'optionalAccess', _140 => _140.selection])) {
4686
4687
  try {
4687
- this.state.selection = normalizeSelection(_chunk3YDQLQH2cjs.deserializeSelection.call(void 0, options.initialState.selection));
4688
+ this.state.selection = normalizeSelection(_chunk32MMQYCQcjs.deserializeSelection.call(void 0, options.initialState.selection));
4688
4689
  } catch (e17) {
4689
4690
  }
4690
4691
  }
@@ -4797,10 +4798,10 @@ var ImageEditorController = (_class10 = class {
4797
4798
  if (l.type === "group") {
4798
4799
  const children = walk(l.children);
4799
4800
  if (children !== l.children) next2 = { ...l, children };
4800
- } else if (l.type === "smart" && _optionalChain([l, 'access', _143 => _143.smartFilters, 'optionalAccess', _144 => _144.filters, 'access', _145 => _145.some, 'call', _146 => _146((f) => f.kind === "effect")]) && (all || _chunk3YDQLQH2cjs.isSmartSurfaceIncomplete.call(void 0, l.surface))) {
4801
+ } else if (l.type === "smart" && _optionalChain([l, 'access', _143 => _143.smartFilters, 'optionalAccess', _144 => _144.filters, 'access', _145 => _145.some, 'call', _146 => _146((f) => f.kind === "effect")]) && (all || _chunk32MMQYCQcjs.isSmartSurfaceIncomplete.call(void 0, l.surface))) {
4801
4802
  try {
4802
- const r = _chunk3YDQLQH2cjs.rerender.call(void 0, l, canvas);
4803
- if (all || !_chunk3YDQLQH2cjs.isSmartSurfaceIncomplete.call(void 0, r.surface)) next2 = r;
4803
+ const r = _chunk32MMQYCQcjs.rerender.call(void 0, l, canvas);
4804
+ if (all || !_chunk32MMQYCQcjs.isSmartSurfaceIncomplete.call(void 0, r.surface)) next2 = r;
4804
4805
  } catch (e19) {
4805
4806
  }
4806
4807
  }
@@ -4856,19 +4857,19 @@ var ImageEditorController = (_class10 = class {
4856
4857
  const d = await this.describeEffect(effect, "filter");
4857
4858
  const values = _chunkRUZQMYXHcjs.resolveEffectValues.call(void 0, d, options.values);
4858
4859
  const found = _chunkHGTDMKNEcjs.findLayer.call(void 0, this.state.layers, layerId);
4859
- if (!found) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`There is no layer "${layerId}"; call list_layers for the layer ids.`);
4860
+ if (!found) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`There is no layer "${layerId}"; call list_layers for the layer ids.`);
4860
4861
  let layers = this.state.layers;
4861
4862
  let id = layerId;
4862
4863
  let converted = false;
4863
4864
  if (found.layer.type !== "smart") {
4864
- if (found.layer.type === "adjustment" || found.layer.type === "annotation") throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`Layer "${found.layer.name || layerId}" is ${found.layer.type === "adjustment" ? "an adjustment layer" : "an annotation"}, which has no pixels to filter; apply the effect to a pixel layer or smart object.`);
4865
- const res2 = _chunk3YDQLQH2cjs.convertToSmartObject.call(void 0, layers, [layerId], this.canvasSize, { surfaceOf: (l) => this.surfaceOf(l) });
4865
+ if (found.layer.type === "adjustment" || found.layer.type === "annotation") throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`Layer "${found.layer.name || layerId}" is ${found.layer.type === "adjustment" ? "an adjustment layer" : "an annotation"}, which has no pixels to filter; apply the effect to a pixel layer or smart object.`);
4866
+ const res2 = _chunk32MMQYCQcjs.convertToSmartObject.call(void 0, layers, [layerId], this.canvasSize, { surfaceOf: (l) => this.surfaceOf(l) });
4866
4867
  layers = res2.layers;
4867
4868
  id = res2.layer.id;
4868
4869
  converted = true;
4869
4870
  }
4870
- const filter = _chunk3YDQLQH2cjs.normalizeSmartFilter.call(void 0, { kind: "effect", effect: d.id, provider: this.effects.require().id, name: d.name, values, enabled: options.enabled !== false, blend: options.blend, opacity: options.opacity });
4871
- const res = _chunk3YDQLQH2cjs.addSmartFilter.call(void 0, layers, id, filter, this.canvasSize, options.index);
4871
+ const filter = _chunk32MMQYCQcjs.normalizeSmartFilter.call(void 0, { kind: "effect", effect: d.id, provider: this.effects.require().id, name: d.name, values, enabled: options.enabled !== false, blend: options.blend, opacity: options.opacity });
4872
+ const res = _chunk32MMQYCQcjs.addSmartFilter.call(void 0, layers, id, filter, this.canvasSize, options.index);
4872
4873
  this.commitLayers(res.layers);
4873
4874
  return { layerId: id, filter: res.filter, converted };
4874
4875
  }
@@ -4879,9 +4880,9 @@ var ImageEditorController = (_class10 = class {
4879
4880
  * false, during a drag).
4880
4881
  */
4881
4882
  async updateEffectFilter(layerId, filterId, changes, commitToHistory = true) {
4882
- const layer = _chunk3YDQLQH2cjs.requireSmartObject.call(void 0, this.state.layers, layerId);
4883
+ const layer = _chunk32MMQYCQcjs.requireSmartObject.call(void 0, this.state.layers, layerId);
4883
4884
  const was = _optionalChain([layer, 'access', _147 => _147.smartFilters, 'optionalAccess', _148 => _148.filters, 'access', _149 => _149.find, 'call', _150 => _150((f) => f.id === filterId)]);
4884
- if (!was || was.kind !== "effect") throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`Smart object "${layer.name || layerId}" has no effect filter "${filterId}"; its filters are ${(_nullishCoalesce(_optionalChain([layer, 'access', _151 => _151.smartFilters, 'optionalAccess', _152 => _152.filters]), () => ( []))).map((f) => `${f.id} (${f.kind === "effect" ? _nullishCoalesce(f.name, () => ( f.effect)) : f.kind})`).join(", ") || "none"}.`);
4885
+ if (!was || was.kind !== "effect") throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`Smart object "${layer.name || layerId}" has no effect filter "${filterId}"; its filters are ${(_nullishCoalesce(_optionalChain([layer, 'access', _151 => _151.smartFilters, 'optionalAccess', _152 => _152.filters]), () => ( []))).map((f) => `${f.id} (${f.kind === "effect" ? _nullishCoalesce(f.name, () => ( f.effect)) : f.kind})`).join(", ") || "none"}.`);
4885
4886
  const update = {};
4886
4887
  if (changes.values) {
4887
4888
  const d = await this.describeEffect(was.effect);
@@ -4890,15 +4891,15 @@ var ImageEditorController = (_class10 = class {
4890
4891
  for (const [k, v] of Object.entries(changes.values)) {
4891
4892
  if (v !== null) given[k] = v;
4892
4893
  else if (k in d.controls.properties) base[k] = d.defaults[k];
4893
- else throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`"${k}" is not a control of "${d.id}"; its controls are ${Object.keys(d.controls.properties).join(", ")}.`);
4894
+ else throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`"${k}" is not a control of "${d.id}"; its controls are ${Object.keys(d.controls.properties).join(", ")}.`);
4894
4895
  }
4895
4896
  update.values = { ...base, ..._chunkRUZQMYXHcjs.resolveEffectValues.call(void 0, { ...d, defaults: base }, given) };
4896
4897
  }
4897
4898
  for (const k of ["enabled", "blend", "opacity"]) if (changes[k] !== void 0) update[k] = changes[k];
4898
- let res = _chunk3YDQLQH2cjs.updateSmartFilter.call(void 0, this.state.layers, layerId, filterId, update, this.canvasSize);
4899
- if (changes.index !== void 0) res = { ...res, layers: _chunk3YDQLQH2cjs.moveSmartFilter.call(void 0, res.layers, layerId, filterId, changes.index, this.canvasSize).layers };
4899
+ let res = _chunk32MMQYCQcjs.updateSmartFilter.call(void 0, this.state.layers, layerId, filterId, update, this.canvasSize);
4900
+ if (changes.index !== void 0) res = { ...res, layers: _chunk32MMQYCQcjs.moveSmartFilter.call(void 0, res.layers, layerId, filterId, changes.index, this.canvasSize).layers };
4900
4901
  this.commitLayers(res.layers, void 0, commitToHistory);
4901
- return _chunk3YDQLQH2cjs.requireSmartObject.call(void 0, this.state.layers, layerId).smartFilters.filters.find((f) => f.id === filterId);
4902
+ return _chunk32MMQYCQcjs.requireSmartObject.call(void 0, this.state.layers, layerId).smartFilters.filters.find((f) => f.id === filterId);
4902
4903
  }
4903
4904
  /**
4904
4905
  * Adds an effect layer: a pixel layer drawn by a provider generator, overlay or title effect at
@@ -4910,12 +4911,12 @@ var ImageEditorController = (_class10 = class {
4910
4911
  const values = _chunkRUZQMYXHcjs.resolveEffectValues.call(void 0, d, options.values);
4911
4912
  const { width, height } = this.naturalSize;
4912
4913
  const pixels = await this.effectsEngine.renderLayer(d.id, values, { width, height, depth: this.bitDepth, time: options.time });
4913
- const blend = _chunk3YDQLQH2cjs.parseBlend.call(void 0, options.blend);
4914
- if (options.opacity !== void 0 && !(options.opacity >= 0 && options.opacity <= 1)) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("opacity must be from 0 to 1.");
4914
+ const blend = _chunk32MMQYCQcjs.parseBlend.call(void 0, options.blend);
4915
+ if (options.opacity !== void 0 && !(options.opacity >= 0 && options.opacity <= 1)) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("opacity must be from 0 to 1.");
4915
4916
  const ids = new Set(_chunkHGTDMKNEcjs.flattenLayers.call(void 0, this.state.layers).map((l) => l.id));
4916
4917
  const layer = {
4917
4918
  type: "pixel",
4918
- id: options.id && !ids.has(options.id) ? options.id : _chunk3YDQLQH2cjs.newLayerId.call(void 0, ),
4919
+ id: options.id && !ids.has(options.id) ? options.id : _chunk32MMQYCQcjs.newLayerId.call(void 0, ),
4919
4920
  name: _optionalChain([options, 'access', _153 => _153.name, 'optionalAccess', _154 => _154.trim, 'call', _155 => _155()]) || d.name,
4920
4921
  visible: true,
4921
4922
  opacity: _nullishCoalesce(options.opacity, () => ( 1)),
@@ -4924,7 +4925,7 @@ var ImageEditorController = (_class10 = class {
4924
4925
  offset: { x: 0, y: 0 },
4925
4926
  generator: { effect: d.id, provider: this.effects.require().id, name: d.name, values, ...options.time ? { time: options.time } : {} }
4926
4927
  };
4927
- const next = _chunk3YDQLQH2cjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(options));
4928
+ const next = _chunk32MMQYCQcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(options));
4928
4929
  this.commitLayers(next, () => {
4929
4930
  this.state.activeLayerId = layer.id;
4930
4931
  this.state.activeTarget = "pixels";
@@ -4939,8 +4940,8 @@ var ImageEditorController = (_class10 = class {
4939
4940
  async updateEffectLayer(layerId, changes, commitToHistory = true) {
4940
4941
  const found = _chunkHGTDMKNEcjs.findLayer.call(void 0, this.state.layers, layerId);
4941
4942
  const layer = _optionalChain([found, 'optionalAccess', _156 => _156.layer]);
4942
- if (!layer || layer.type !== "pixel" || !layer.generator) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`"${layerId}" is not an effect layer; add one with add_effect_layer.`);
4943
- _chunk3YDQLQH2cjs.requireUnlocked.call(void 0, layer, "pixels", "draw its effect again");
4943
+ if (!layer || layer.type !== "pixel" || !layer.generator) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`"${layerId}" is not an effect layer; add one with add_effect_layer.`);
4944
+ _chunk32MMQYCQcjs.requireUnlocked.call(void 0, layer, "pixels", "draw its effect again");
4944
4945
  const g = layer.generator;
4945
4946
  const d = await this.describeEffect(g.effect);
4946
4947
  const base = { ...g.values };
@@ -4948,7 +4949,7 @@ var ImageEditorController = (_class10 = class {
4948
4949
  for (const [k, v] of Object.entries(_nullishCoalesce(changes.values, () => ( {})))) {
4949
4950
  if (v !== null) given[k] = v;
4950
4951
  else if (k in d.controls.properties) base[k] = d.defaults[k];
4951
- else throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`"${k}" is not a control of "${d.id}"; its controls are ${Object.keys(d.controls.properties).join(", ")}.`);
4952
+ else throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`"${k}" is not a control of "${d.id}"; its controls are ${Object.keys(d.controls.properties).join(", ")}.`);
4952
4953
  }
4953
4954
  const values = { ...base, ..._chunkRUZQMYXHcjs.resolveEffectValues.call(void 0, { ...d, defaults: base }, given) };
4954
4955
  const time = _nullishCoalesce(_nullishCoalesce(changes.time, () => ( g.time)), () => ( 0));
@@ -4963,7 +4964,7 @@ var ImageEditorController = (_class10 = class {
4963
4964
  /** Turns an effect layer into a plain pixel layer keeping its pixels (one undo step). */
4964
4965
  rasterizeEffectLayer(layerId) {
4965
4966
  const found = _chunkHGTDMKNEcjs.findLayer.call(void 0, this.state.layers, layerId);
4966
- if (!found || found.layer.type !== "pixel" || !found.layer.generator) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`"${layerId}" is not an effect layer.`);
4967
+ if (!found || found.layer.type !== "pixel" || !found.layer.generator) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`"${layerId}" is not an effect layer.`);
4967
4968
  this.commitLayers(
4968
4969
  _chunkHGTDMKNEcjs.mapLayer.call(void 0, this.state.layers, layerId, (l) => {
4969
4970
  const { generator: _g, ...rest } = l;
@@ -4991,7 +4992,7 @@ var ImageEditorController = (_class10 = class {
4991
4992
  if (key.length === this.viewKey.length && key.every((v, i) => v === this.viewKey[i])) return;
4992
4993
  this.viewKey = key;
4993
4994
  const { width, height } = this.naturalSize;
4994
- const view = _chunk3YDQLQH2cjs.legacyView.call(void 0, this.stack(), width, height, s.activeLayerId);
4995
+ const view = _chunk32MMQYCQcjs.legacyView.call(void 0, this.stack(), width, height, s.activeLayerId);
4995
4996
  s.adjustments = view.adjustments;
4996
4997
  s.depthMask = view.depthMask;
4997
4998
  s.annotations = view.annotations;
@@ -5162,7 +5163,7 @@ var ImageEditorController = (_class10 = class {
5162
5163
  applyCropPreset(ratio) {
5163
5164
  this.recordHistory();
5164
5165
  const { width, height } = this.state.imageDimensions;
5165
- if (ratio && _chunk3YDQLQH2cjs.isQuarterTurnSwapped.call(void 0, this.state.transform)) {
5166
+ if (ratio && _chunk32MMQYCQcjs.isQuarterTurnSwapped.call(void 0, this.state.transform)) {
5166
5167
  ratio = 1 / ratio;
5167
5168
  }
5168
5169
  if (!ratio) {
@@ -5244,7 +5245,7 @@ var ImageEditorController = (_class10 = class {
5244
5245
  */
5245
5246
  getLayerPixels(id) {
5246
5247
  const layer = this.getLayer(id);
5247
- if (!layer || !_chunk3YDQLQH2cjs.hasSurface.call(void 0, layer)) return null;
5248
+ if (!layer || !_chunk32MMQYCQcjs.hasSurface.call(void 0, layer)) return null;
5248
5249
  const surface = this.surfaceOf(layer);
5249
5250
  const b = _chunkCWM3CUUXcjs.contentBounds.call(void 0, surface);
5250
5251
  if (!b) return null;
@@ -5257,7 +5258,7 @@ var ImageEditorController = (_class10 = class {
5257
5258
  */
5258
5259
  getLayerBounds(id) {
5259
5260
  const layer = this.getLayer(id);
5260
- if (!layer || !_chunk3YDQLQH2cjs.hasSurface.call(void 0, layer)) return null;
5261
+ if (!layer || !_chunk32MMQYCQcjs.hasSurface.call(void 0, layer)) return null;
5261
5262
  const surface = this.surfaceOf(layer);
5262
5263
  let b = this.boundsCache.get(surface);
5263
5264
  if (b === void 0) {
@@ -5281,15 +5282,15 @@ var ImageEditorController = (_class10 = class {
5281
5282
  { x: b2.x + b2.width, y: b2.y + b2.height },
5282
5283
  { x: b2.x, y: b2.y + b2.height }
5283
5284
  ];
5284
- if (layer.type === "smart") return _chunk3YDQLQH2cjs.placementGeometry.call(void 0, layer).corners.map((p) => ({ x: p.x, y: p.y }));
5285
+ if (layer.type === "smart") return _chunk32MMQYCQcjs.placementGeometry.call(void 0, layer).corners.map((p) => ({ x: p.x, y: p.y }));
5285
5286
  if (layer.type === "type") {
5286
- const f = _chunk3YDQLQH2cjs.typeFrame.call(void 0, layer, this.textEnv().shaper);
5287
- const m = _chunk3YDQLQH2cjs.textMatrix.call(void 0, layer);
5287
+ const f = _chunk32MMQYCQcjs.typeFrame.call(void 0, layer, this.textEnv().shaper);
5288
+ const m = _chunk32MMQYCQcjs.textMatrix.call(void 0, layer);
5288
5289
  const at = (x, y) => ({ x: m[0] * x + m[2] * y + m[4], y: m[1] * x + m[3] * y + m[5] });
5289
5290
  return [at(f.x, f.y), at(f.x + f.width, f.y), at(f.x + f.width, f.y + f.height), at(f.x, f.y + f.height)];
5290
5291
  }
5291
5292
  if (layer.type === "shape") {
5292
- const g = _chunk3YDQLQH2cjs.shapeGeometryBounds.call(void 0, layer);
5293
+ const g = _chunk32MMQYCQcjs.shapeGeometryBounds.call(void 0, layer);
5293
5294
  return g ? rect(g) : null;
5294
5295
  }
5295
5296
  const b = this.getLayerBounds(id);
@@ -5321,7 +5322,7 @@ var ImageEditorController = (_class10 = class {
5321
5322
  return null;
5322
5323
  }
5323
5324
  if (layer.type === "annotation") {
5324
- if (_chunk3YDQLQH2cjs.hitTestAnnotation.call(void 0, point, layer.annotation)) return layer.id;
5325
+ if (_chunk32MMQYCQcjs.hitTestAnnotation.call(void 0, point, layer.annotation)) return layer.id;
5325
5326
  return null;
5326
5327
  }
5327
5328
  if (layer.type === "shape") {
@@ -5364,9 +5365,9 @@ var ImageEditorController = (_class10 = class {
5364
5365
  */
5365
5366
  getLayerDataURL(id) {
5366
5367
  const layer = this.getLayer(id);
5367
- if (!layer || !_chunk3YDQLQH2cjs.hasSurface.call(void 0, layer)) return null;
5368
+ if (!layer || !_chunk32MMQYCQcjs.hasSurface.call(void 0, layer)) return null;
5368
5369
  const surface = this.surfaceOf(layer);
5369
- const enc = _chunk3YDQLQH2cjs.encodeSurface.call(void 0, surface);
5370
+ const enc = _chunk32MMQYCQcjs.encodeSurface.call(void 0, surface);
5370
5371
  return enc ? enc.url : null;
5371
5372
  }
5372
5373
  /**
@@ -5486,7 +5487,7 @@ var ImageEditorController = (_class10 = class {
5486
5487
  _optionalChain([extra, 'optionalCall', _167 => _167()]);
5487
5488
  if (depth !== 8 && this.bitDepth === depth) this.state.layers = keepDeepLayers(prev, this.state.layers);
5488
5489
  if (this.state.activeLayerId && !_chunkHGTDMKNEcjs.findLayer.call(void 0, this.state.layers, this.state.activeLayerId)) {
5489
- this.state.activeLayerId = _chunk3YDQLQH2cjs.activeLayerAfterRemoval.call(void 0, prev, this.state.layers, this.state.activeLayerId);
5490
+ this.state.activeLayerId = _chunk32MMQYCQcjs.activeLayerAfterRemoval.call(void 0, prev, this.state.layers, this.state.activeLayerId);
5490
5491
  this.state.activeTarget = "pixels";
5491
5492
  }
5492
5493
  this.notify();
@@ -5508,19 +5509,19 @@ var ImageEditorController = (_class10 = class {
5508
5509
  if (init.pixels) {
5509
5510
  const px2 = init.pixels;
5510
5511
  if (!(px2.width > 0 && px2.height > 0) || px2.data.length < px2.width * px2.height * 4) {
5511
- throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("pixels must be RGBA with width \xD7 height \xD7 4 bytes.");
5512
+ throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("pixels must be RGBA with width \xD7 height \xD7 4 bytes.");
5512
5513
  }
5513
5514
  surface = _chunkCWM3CUUXcjs.surfaceFromPixels.call(void 0, px2, 4);
5514
5515
  } else if (init.color !== void 0) {
5515
5516
  const c = parseColor(init.color);
5516
5517
  surface = _chunkCWM3CUUXcjs.solidSurface.call(void 0, 4, { x: 0, y: 0, width, height }, _chunkCWM3CUUXcjs.packRgba.call(void 0, c[0], c[1], c[2], c[3]));
5517
5518
  }
5518
- const blend = _chunk3YDQLQH2cjs.parseBlend.call(void 0, init.blend);
5519
- if (init.opacity !== void 0 && !(init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("opacity must be from 0 to 1.");
5519
+ const blend = _chunk32MMQYCQcjs.parseBlend.call(void 0, init.blend);
5520
+ if (init.opacity !== void 0 && !(init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("opacity must be from 0 to 1.");
5520
5521
  const ids = new Set(_chunkHGTDMKNEcjs.flattenLayers.call(void 0, this.state.layers).map((l) => l.id));
5521
5522
  const layer = {
5522
5523
  type: "pixel",
5523
- id: init.id && !ids.has(init.id) ? init.id : _chunk3YDQLQH2cjs.newLayerId.call(void 0, ),
5524
+ id: init.id && !ids.has(init.id) ? init.id : _chunk32MMQYCQcjs.newLayerId.call(void 0, ),
5524
5525
  name: _optionalChain([init, 'access', _168 => _168.name, 'optionalAccess', _169 => _169.trim, 'call', _170 => _170()]) || this.nextLayerName(),
5525
5526
  visible: _nullishCoalesce(init.visible, () => ( true)),
5526
5527
  opacity: _nullishCoalesce(init.opacity, () => ( 1)),
@@ -5529,7 +5530,7 @@ var ImageEditorController = (_class10 = class {
5529
5530
  offset: { x: Math.round(_nullishCoalesce(init.x, () => ( 0))), y: Math.round(_nullishCoalesce(init.y, () => ( 0))) }
5530
5531
  };
5531
5532
  if (init.fillOpacity !== void 0 && init.fillOpacity !== 1) layer.fillOpacity = init.fillOpacity;
5532
- const next = _chunk3YDQLQH2cjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
5533
+ const next = _chunk32MMQYCQcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
5533
5534
  this.commitLayers(next, () => {
5534
5535
  this.state.activeLayerId = layer.id;
5535
5536
  this.state.activeTarget = "pixels";
@@ -5569,12 +5570,12 @@ var ImageEditorController = (_class10 = class {
5569
5570
  try {
5570
5571
  img = await this.renderer.imageCache.get(src);
5571
5572
  } catch (e24) {
5572
- throw new (0, _chunk3YDQLQH2cjs.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.");
5573
+ throw new (0, _chunk32MMQYCQcjs.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.");
5573
5574
  }
5574
5575
  const w = img.naturalWidth || img.width;
5575
5576
  const h = img.naturalHeight || img.height;
5576
5577
  const ctx = this.renderer.createCanvas(w, h).getContext("2d");
5577
- if (!ctx || typeof ctx.getImageData !== "function") throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("Decoding this image needs a canvas; pass a PNG instead.");
5578
+ if (!ctx || typeof ctx.getImageData !== "function") throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("Decoding this image needs a canvas; pass a PNG instead.");
5578
5579
  ctx.drawImage(img, 0, 0, w, h);
5579
5580
  const data = ctx.getImageData(0, 0, w, h);
5580
5581
  return { width: w, height: h, data: data.data };
@@ -5587,7 +5588,7 @@ var ImageEditorController = (_class10 = class {
5587
5588
  }
5588
5589
  /** Duplicates a layer (with its children) directly above it, as one undo step. Returns the copy's id. */
5589
5590
  duplicateLayer(id, name) {
5590
- const res = _chunk3YDQLQH2cjs.duplicateLayer.call(void 0, this.state.layers, id, name);
5591
+ const res = _chunk32MMQYCQcjs.duplicateLayer.call(void 0, this.state.layers, id, name);
5591
5592
  this.commitLayers(res.layers, () => {
5592
5593
  this.state.activeLayerId = res.id;
5593
5594
  });
@@ -5595,16 +5596,16 @@ var ImageEditorController = (_class10 = class {
5595
5596
  }
5596
5597
  /** Deletes a layer (refused when locked), as one undo step. */
5597
5598
  removeLayer(id) {
5598
- const next = _chunk3YDQLQH2cjs.removeLayer.call(void 0, this.state.layers, id);
5599
+ const next = _chunk32MMQYCQcjs.removeLayer.call(void 0, this.state.layers, id);
5599
5600
  this.commitLayers(next, () => {
5600
- if (this.state.selectedAnnotationId && !_chunkHGTDMKNEcjs.flattenLayers.call(void 0, next).some((l) => _optionalChain([_chunk3YDQLQH2cjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _172 => _172.id]) === this.state.selectedAnnotationId)) {
5601
+ if (this.state.selectedAnnotationId && !_chunkHGTDMKNEcjs.flattenLayers.call(void 0, next).some((l) => _optionalChain([_chunk32MMQYCQcjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _172 => _172.id]) === this.state.selectedAnnotationId)) {
5601
5602
  this.state.selectedAnnotationId = null;
5602
5603
  }
5603
5604
  });
5604
5605
  }
5605
5606
  /** Moves a layer above / below another, or into a group, as one undo step. Returns its new parent and index. */
5606
5607
  moveLayer(id, placement) {
5607
- const next = _chunk3YDQLQH2cjs.moveLayer.call(void 0, this.state.layers, id, placement);
5608
+ const next = _chunk32MMQYCQcjs.moveLayer.call(void 0, this.state.layers, id, placement);
5608
5609
  const loc = _chunkHGTDMKNEcjs.findLayer.call(void 0, next, id);
5609
5610
  if (next === this.state.layers) return { parentId: _nullishCoalesce(_optionalChain([loc, 'access', _173 => _173.parent, 'optionalAccess', _174 => _174.id]), () => ( null)), index: loc.index };
5610
5611
  this.commitLayers(next);
@@ -5615,23 +5616,23 @@ var ImageEditorController = (_class10 = class {
5615
5616
  * one undo step (`commitToHistory = false` for the moves of a slider drag). Returns the layer.
5616
5617
  */
5617
5618
  setLayerProperties(id, props, commitToHistory = true) {
5618
- const next = _chunk3YDQLQH2cjs.setLayerProperties.call(void 0, this.state.layers, id, props);
5619
+ const next = _chunk32MMQYCQcjs.setLayerProperties.call(void 0, this.state.layers, id, props);
5619
5620
  this.commitLayers(next, void 0, commitToHistory);
5620
5621
  return _chunkHGTDMKNEcjs.findLayer.call(void 0, next, id).layer;
5621
5622
  }
5622
5623
  /** Adds an empty pass-through group above the active layer (or at `placement`) and makes it active. Returns its id. */
5623
5624
  addGroup(init = {}) {
5624
- const blend = init.blend === void 0 ? "pass-through" : _chunk3YDQLQH2cjs.parseBlend.call(void 0, init.blend, true);
5625
+ const blend = init.blend === void 0 ? "pass-through" : _chunk32MMQYCQcjs.parseBlend.call(void 0, init.blend, true);
5625
5626
  const group = {
5626
5627
  type: "group",
5627
- id: _chunk3YDQLQH2cjs.newLayerId.call(void 0, "group"),
5628
+ id: _chunk32MMQYCQcjs.newLayerId.call(void 0, "group"),
5628
5629
  name: _optionalChain([init, 'access', _177 => _177.name, 'optionalAccess', _178 => _178.trim, 'call', _179 => _179()]) || "Group",
5629
5630
  visible: true,
5630
5631
  opacity: 1,
5631
5632
  blend,
5632
5633
  children: []
5633
5634
  };
5634
- const next = _chunk3YDQLQH2cjs.placeLayer.call(void 0, this.state.layers, group, this.newLayerPlacement(init));
5635
+ const next = _chunk32MMQYCQcjs.placeLayer.call(void 0, this.state.layers, group, this.newLayerPlacement(init));
5635
5636
  this.commitLayers(next, () => {
5636
5637
  this.state.activeLayerId = group.id;
5637
5638
  this.state.activeTarget = "pixels";
@@ -5640,7 +5641,7 @@ var ImageEditorController = (_class10 = class {
5640
5641
  }
5641
5642
  /** Puts sibling layers into a new group (one undo step). Returns the group id. */
5642
5643
  groupLayers(ids, name) {
5643
- const res = _chunk3YDQLQH2cjs.groupLayers.call(void 0, this.state.layers, ids, name);
5644
+ const res = _chunk32MMQYCQcjs.groupLayers.call(void 0, this.state.layers, ids, name);
5644
5645
  this.commitLayers(res.layers, () => {
5645
5646
  this.state.activeLayerId = res.id;
5646
5647
  });
@@ -5648,7 +5649,7 @@ var ImageEditorController = (_class10 = class {
5648
5649
  }
5649
5650
  /** Replaces a group by its children (one undo step). Returns the child ids, bottom to top. */
5650
5651
  ungroupLayer(id) {
5651
- const res = _chunk3YDQLQH2cjs.ungroupLayer.call(void 0, this.state.layers, id);
5652
+ const res = _chunk32MMQYCQcjs.ungroupLayer.call(void 0, this.state.layers, id);
5652
5653
  this.commitLayers(res.layers);
5653
5654
  return res.ids;
5654
5655
  }
@@ -5657,38 +5658,38 @@ var ImageEditorController = (_class10 = class {
5657
5658
  * (`commitToHistory = false` for the moves of a drag). Returns the offset and document bounds.
5658
5659
  */
5659
5660
  offsetLayer(id, move, commitToHistory = true) {
5660
- const layer = _chunk3YDQLQH2cjs.requireLayer.call(void 0, this.state.layers, id).layer;
5661
+ const layer = _chunk32MMQYCQcjs.requireLayer.call(void 0, this.state.layers, id).layer;
5661
5662
  if (layer.type === "smart") {
5662
5663
  const tl = layer.placement.corners[0];
5663
5664
  const dx = move.x !== void 0 ? move.x - tl.x : _nullishCoalesce(move.dx, () => ( 0));
5664
5665
  const dy = move.y !== void 0 ? move.y - tl.y : _nullishCoalesce(move.dy, () => ( 0));
5665
- if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("x and y must be numbers.");
5666
- this.commitLayers(_chunk3YDQLQH2cjs.offsetSmartObject.call(void 0, this.state.layers, id, dx, dy, this.canvasSize), void 0, commitToHistory);
5666
+ if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("x and y must be numbers.");
5667
+ this.commitLayers(_chunk32MMQYCQcjs.offsetSmartObject.call(void 0, this.state.layers, id, dx, dy, this.canvasSize), void 0, commitToHistory);
5667
5668
  const moved = _chunkHGTDMKNEcjs.findLayer.call(void 0, this.state.layers, id).layer;
5668
5669
  return { offset: { x: Math.round(moved.placement.corners[0].x), y: Math.round(moved.placement.corners[0].y) }, bounds: this.getLayerBounds(id) };
5669
5670
  }
5670
5671
  if (layer.type === "shape") {
5671
- const g = _nullishCoalesce(_chunk3YDQLQH2cjs.shapeGeometryBounds.call(void 0, layer), () => ( { x: 0, y: 0 }));
5672
+ const g = _nullishCoalesce(_chunk32MMQYCQcjs.shapeGeometryBounds.call(void 0, layer), () => ( { x: 0, y: 0 }));
5672
5673
  const dx = move.x !== void 0 ? move.x - g.x : _nullishCoalesce(move.dx, () => ( 0));
5673
5674
  const dy = move.y !== void 0 ? move.y - g.y : _nullishCoalesce(move.dy, () => ( 0));
5674
- if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("x and y must be numbers.");
5675
- _chunk3YDQLQH2cjs.requireUnlocked.call(void 0, layer, "position", "move it");
5676
- let moved = _chunk3YDQLQH2cjs.offsetShape.call(void 0, layer, dx, dy, this.shapeEnv());
5675
+ if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("x and y must be numbers.");
5676
+ _chunk32MMQYCQcjs.requireUnlocked.call(void 0, layer, "position", "move it");
5677
+ let moved = _chunk32MMQYCQcjs.offsetShape.call(void 0, layer, dx, dy, this.shapeEnv());
5677
5678
  const mask = layer.mask;
5678
5679
  if (mask && mask.linked !== false && !mask.source && (Math.round(dx) || Math.round(dy))) moved = { ...moved, mask: { ...mask, surface: _chunkCWM3CUUXcjs.translateSurface.call(void 0, mask.surface, Math.round(dx), Math.round(dy)) } };
5679
5680
  this.commitLayers(_chunkHGTDMKNEcjs.mapLayer.call(void 0, this.state.layers, id, () => moved), void 0, commitToHistory);
5680
- const b = _nullishCoalesce(_chunk3YDQLQH2cjs.shapeGeometryBounds.call(void 0, moved), () => ( { x: 0, y: 0 }));
5681
+ const b = _nullishCoalesce(_chunk32MMQYCQcjs.shapeGeometryBounds.call(void 0, moved), () => ( { x: 0, y: 0 }));
5681
5682
  return { offset: { x: Math.round(b.x), y: Math.round(b.y) }, bounds: this.getLayerBounds(id) };
5682
5683
  }
5683
5684
  if (layer.type === "type") {
5684
5685
  const m = _nullishCoalesce(layer.transform, () => ( [1, 0, 0, 1, 0, 0]));
5685
5686
  const dx = move.x !== void 0 ? move.x - m[4] : _nullishCoalesce(move.dx, () => ( 0));
5686
5687
  const dy = move.y !== void 0 ? move.y - m[5] : _nullishCoalesce(move.dy, () => ( 0));
5687
- if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("x and y must be numbers.");
5688
- _chunk3YDQLQH2cjs.requireUnlocked.call(void 0, layer, "position", "move it");
5688
+ if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("x and y must be numbers.");
5689
+ _chunk32MMQYCQcjs.requireUnlocked.call(void 0, layer, "position", "move it");
5689
5690
  const mx = Math.round(dx);
5690
5691
  const my = Math.round(dy);
5691
- let moved = { ..._chunk3YDQLQH2cjs.transformTypeLayer.call(void 0, layer, [1, 0, 0, 1, mx, my]), surface: _chunkCWM3CUUXcjs.translateSurface.call(void 0, layer.surface, mx, my) };
5692
+ let moved = { ..._chunk32MMQYCQcjs.transformTypeLayer.call(void 0, layer, [1, 0, 0, 1, mx, my]), surface: _chunkCWM3CUUXcjs.translateSurface.call(void 0, layer.surface, mx, my) };
5692
5693
  const mask = layer.mask;
5693
5694
  if (mask && mask.linked !== false && !mask.source && (mx || my)) moved = { ...moved, mask: { ...mask, surface: _chunkCWM3CUUXcjs.translateSurface.call(void 0, mask.surface, mx, my) } };
5694
5695
  this.commitLayers(_chunkHGTDMKNEcjs.mapLayer.call(void 0, this.state.layers, id, () => moved), void 0, commitToHistory);
@@ -5698,7 +5699,7 @@ var ImageEditorController = (_class10 = class {
5698
5699
  const current = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
5699
5700
  const x = _nullishCoalesce(move.x, () => ( current.x + (_nullishCoalesce(move.dx, () => ( 0)))));
5700
5701
  const y = _nullishCoalesce(move.y, () => ( current.y + (_nullishCoalesce(move.dy, () => ( 0)))));
5701
- const next = _chunk3YDQLQH2cjs.offsetLayer.call(void 0, this.state.layers, id, { x, y });
5702
+ const next = _chunk32MMQYCQcjs.offsetLayer.call(void 0, this.state.layers, id, { x, y });
5702
5703
  this.commitLayers(next, void 0, commitToHistory);
5703
5704
  return { offset: { x: Math.round(x), y: Math.round(y) }, bounds: this.getLayerBounds(id) };
5704
5705
  }
@@ -5708,11 +5709,11 @@ var ImageEditorController = (_class10 = class {
5708
5709
  * target when the layer is active.
5709
5710
  */
5710
5711
  addLayerMask(id, from = "reveal-all", props = {}) {
5711
- const layer = _chunk3YDQLQH2cjs.requireLayer.call(void 0, this.state.layers, id).layer;
5712
+ const layer = _chunk32MMQYCQcjs.requireLayer.call(void 0, this.state.layers, id).layer;
5712
5713
  let mask;
5713
5714
  if (from === "selection") {
5714
5715
  const sel = this.state.selection;
5715
- if (!_optionalChain([sel, 'optionalAccess', _180 => _180.bounds])) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
5716
+ if (!_optionalChain([sel, 'optionalAccess', _180 => _180.bounds])) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
5716
5717
  mask = this.maskFromSelection(sel, props);
5717
5718
  if (layer.type === "pixel" && (layer.offset.x || layer.offset.y)) {
5718
5719
  mask = { ...mask, surface: _chunkCWM3CUUXcjs.translateSurface.call(void 0, mask.surface, -layer.offset.x, -layer.offset.y) };
@@ -5721,7 +5722,7 @@ var ImageEditorController = (_class10 = class {
5721
5722
  const v = from === "reveal-all" ? 255 : 0;
5722
5723
  mask = withMaskProps({ surface: _chunkCWM3CUUXcjs.emptySurface.call(void 0, 1, v), defaultValue: v }, props);
5723
5724
  }
5724
- const next = _chunk3YDQLQH2cjs.setLayerMask.call(void 0, this.state.layers, id, mask);
5725
+ const next = _chunk32MMQYCQcjs.setLayerMask.call(void 0, this.state.layers, id, mask);
5725
5726
  this.commitLayers(next, () => {
5726
5727
  if (this.state.activeLayerId === id) this.state.activeTarget = "mask";
5727
5728
  });
@@ -5729,18 +5730,18 @@ var ImageEditorController = (_class10 = class {
5729
5730
  }
5730
5731
  /** Removes a layer's mask (one undo step). */
5731
5732
  removeLayerMask(id) {
5732
- const layer = _chunk3YDQLQH2cjs.requireLayer.call(void 0, this.state.layers, id).layer;
5733
- if (!layer.mask) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask.`);
5734
- this.commitLayers(_chunk3YDQLQH2cjs.setLayerMask.call(void 0, this.state.layers, id, null), () => {
5733
+ const layer = _chunk32MMQYCQcjs.requireLayer.call(void 0, this.state.layers, id).layer;
5734
+ if (!layer.mask) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask.`);
5735
+ this.commitLayers(_chunk32MMQYCQcjs.setLayerMask.call(void 0, this.state.layers, id, null), () => {
5735
5736
  if (this.state.activeLayerId === id) this.state.activeTarget = "pixels";
5736
5737
  });
5737
5738
  }
5738
5739
  /** Changes any layer mask's density, feather, enabled or linked flag (pixels kept). Returns the mask. */
5739
5740
  setLayerMaskProps(id, props, commitToHistory = true) {
5740
- const layer = _chunk3YDQLQH2cjs.requireLayer.call(void 0, this.state.layers, id).layer;
5741
- if (!layer.mask) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask; add one with add_layer_mask.`);
5741
+ const layer = _chunk32MMQYCQcjs.requireLayer.call(void 0, this.state.layers, id).layer;
5742
+ if (!layer.mask) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask; add one with add_layer_mask.`);
5742
5743
  const mask = withMaskProps(layer.mask, props);
5743
- this.commitLayers(_chunk3YDQLQH2cjs.setLayerMask.call(void 0, this.state.layers, id, mask), void 0, commitToHistory);
5744
+ this.commitLayers(_chunk32MMQYCQcjs.setLayerMask.call(void 0, this.state.layers, id, mask), void 0, commitToHistory);
5744
5745
  return mask;
5745
5746
  }
5746
5747
  /**
@@ -5748,11 +5749,11 @@ var ImageEditorController = (_class10 = class {
5748
5749
  * the depth map) and removes the mask, as one undo step.
5749
5750
  */
5750
5751
  async applyLayerMask(id) {
5751
- const loc = _chunk3YDQLQH2cjs.requireLayer.call(void 0, this.state.layers, id);
5752
+ const loc = _chunk32MMQYCQcjs.requireLayer.call(void 0, this.state.layers, id);
5752
5753
  const layer = loc.layer;
5753
- if (layer.type !== "pixel") throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`Only a pixel layer's mask can be applied to its pixels; "${id}" is a ${layer.type} layer. Remove the mask or keep it.`);
5754
- if (!layer.mask) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask.`);
5755
- _chunk3YDQLQH2cjs.requireUnlocked.call(void 0, layer, "pixels", "apply its mask");
5754
+ if (layer.type !== "pixel") throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`Only a pixel layer's mask can be applied to its pixels; "${id}" is a ${layer.type} layer. Remove the mask or keep it.`);
5755
+ if (!layer.mask) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask.`);
5756
+ _chunk32MMQYCQcjs.requireUnlocked.call(void 0, layer, "pixels", "apply its mask");
5756
5757
  const { width, height } = this.naturalSize;
5757
5758
  await this.renderer.prepareLayerAssets([layer], width, height);
5758
5759
  const sources = this.renderer.compositorSources(width, height);
@@ -5785,13 +5786,13 @@ var ImageEditorController = (_class10 = class {
5785
5786
  */
5786
5787
  layerViaCopy(options = {}) {
5787
5788
  const id = _nullishCoalesce(options.layerId, () => ( this.state.activeLayerId));
5788
- if (!id) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("No layer given and none is active; pass layerId (see list_layers).");
5789
- const loc = _chunk3YDQLQH2cjs.requireLayer.call(void 0, this.state.layers, id);
5789
+ if (!id) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("No layer given and none is active; pass layerId (see list_layers).");
5790
+ const loc = _chunk32MMQYCQcjs.requireLayer.call(void 0, this.state.layers, id);
5790
5791
  const layer = loc.layer;
5791
- if (layer.type !== "pixel") throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`Layer via copy needs a pixel layer; "${id}" is a ${layer.type} layer.`);
5792
+ if (layer.type !== "pixel") throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`Layer via copy needs a pixel layer; "${id}" is a ${layer.type} layer.`);
5792
5793
  const sel = this.state.selection;
5793
- if (!_optionalChain([sel, 'optionalAccess', _181 => _181.bounds])) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("Nothing is selected; select the pixels to copy first.");
5794
- if (options.cut) _chunk3YDQLQH2cjs.requireUnlocked.call(void 0, layer, "pixels", "cut from it");
5794
+ if (!_optionalChain([sel, 'optionalAccess', _181 => _181.bounds])) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("Nothing is selected; select the pixels to copy first.");
5795
+ if (options.cut) _chunk32MMQYCQcjs.requireUnlocked.call(void 0, layer, "pixels", "cut from it");
5795
5796
  const surface = this.surfaceOf(layer);
5796
5797
  const sb = sel.bounds;
5797
5798
  const src = { x: sb.x - layer.offset.x, y: sb.y - layer.offset.y, width: sb.width, height: sb.height };
@@ -5807,7 +5808,7 @@ var ImageEditorController = (_class10 = class {
5807
5808
  }
5808
5809
  const copy = {
5809
5810
  type: "pixel",
5810
- id: _chunk3YDQLQH2cjs.newLayerId.call(void 0, ),
5811
+ id: _chunk32MMQYCQcjs.newLayerId.call(void 0, ),
5811
5812
  name: _optionalChain([options, 'access', _182 => _182.name, 'optionalAccess', _183 => _183.trim, 'call', _184 => _184()]) || `${layer.name || "Layer"} ${options.cut ? "cut" : "copy"}`,
5812
5813
  visible: true,
5813
5814
  opacity: 1,
@@ -5880,7 +5881,7 @@ var ImageEditorController = (_class10 = class {
5880
5881
  * Refused while another transform is open.
5881
5882
  */
5882
5883
  beginFreeTransform(init = {}) {
5883
- if (this.getFreeTransform()) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("A Free Transform is already open; commit or cancel it first.");
5884
+ if (this.getFreeTransform()) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("A Free Transform is already open; commit or cancel it first.");
5884
5885
  const session = new FreeTransformSession(this.transformHost(), init);
5885
5886
  this.openTransform = session;
5886
5887
  this.notify();
@@ -5894,26 +5895,26 @@ var ImageEditorController = (_class10 = class {
5894
5895
  */
5895
5896
  transformLayer(spec) {
5896
5897
  const given = [spec.matrix, spec.corners, spec.params].filter((v) => v !== void 0).length;
5897
- if (given > 1) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("Give only one of matrix, corners and params.");
5898
- if (!given && spec.warp === void 0) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("Give matrix, corners or params (or a warp).");
5898
+ if (given > 1) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("Give only one of matrix, corners and params.");
5899
+ if (!given && spec.warp === void 0) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("Give matrix, corners or params (or a warp).");
5899
5900
  if (spec.matrix && !(Array.isArray(spec.matrix) && spec.matrix.length === 6 && spec.matrix.every(Number.isFinite))) {
5900
- throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("matrix must be six finite numbers [a, b, c, d, e, f] (x' = a\xB7x + c\xB7y + e, y' = b\xB7x + d\xB7y + f).");
5901
+ throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("matrix must be six finite numbers [a, b, c, d, e, f] (x' = a\xB7x + c\xB7y + e, y' = b\xB7x + d\xB7y + f).");
5901
5902
  }
5902
5903
  if (spec.matrix) {
5903
5904
  const [a, b, c, d] = spec.matrix;
5904
- if (Math.abs(a * d - b * c) < 1e-9) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("matrix is singular (it collapses the layer to a line); its determinant a\xB7d \u2212 b\xB7c must not be 0.");
5905
+ if (Math.abs(a * d - b * c) < 1e-9) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("matrix is singular (it collapses the layer to a line); its determinant a\xB7d \u2212 b\xB7c must not be 0.");
5905
5906
  }
5906
5907
  const session = this.beginFreeTransform(spec);
5907
5908
  try {
5908
5909
  const g = session.startGeometry;
5909
- const corners = spec.matrix ? g.corners.map((p) => _chunkQMI5HZWAcjs.applyMatrix.call(void 0, spec.matrix, p)) : spec.corners ? spec.corners : spec.params ? _chunk3YDQLQH2cjs.applyParams.call(void 0, g, spec.params) : g.corners;
5910
+ const corners = spec.matrix ? g.corners.map((p) => _chunk236TKNURcjs.applyMatrix.call(void 0, spec.matrix, p)) : spec.corners ? spec.corners : spec.params ? _chunk32MMQYCQcjs.applyParams.call(void 0, g, spec.params) : g.corners;
5910
5911
  let warp = spec.warp === void 0 ? _nullishCoalesce(g.warp, () => ( null)) : null;
5911
5912
  if (spec.warp) {
5912
5913
  if ("style" in spec.warp) {
5913
- if (!_chunkQMI5HZWAcjs.WARP_STYLES.includes(spec.warp.style)) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`Unknown warp style "${String(spec.warp.style)}". Styles: ${_chunkQMI5HZWAcjs.WARP_STYLES.join(", ")}.`);
5914
- warp = _chunk3YDQLQH2cjs.presetWarp.call(void 0, session.box, spec.warp);
5914
+ if (!_chunk236TKNURcjs.WARP_STYLES.includes(spec.warp.style)) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`Unknown warp style "${String(spec.warp.style)}". Styles: ${_chunk236TKNURcjs.WARP_STYLES.join(", ")}.`);
5915
+ warp = _chunk32MMQYCQcjs.presetWarp.call(void 0, session.box, spec.warp);
5915
5916
  } else {
5916
- if (!_chunk3YDQLQH2cjs.isValidWarp.call(void 0, spec.warp)) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("mesh must have us and vs (knots from 0 to 1, increasing) and (3\xB7columns + 1) \xD7 (3\xB7rows + 1) finite points, row by row.");
5917
+ if (!_chunk32MMQYCQcjs.isValidWarp.call(void 0, spec.warp)) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("mesh must have us and vs (knots from 0 to 1, increasing) and (3\xB7columns + 1) \xD7 (3\xB7rows + 1) finite points, row by row.");
5917
5918
  warp = spec.warp;
5918
5919
  }
5919
5920
  }
@@ -5926,10 +5927,10 @@ var ImageEditorController = (_class10 = class {
5926
5927
  }
5927
5928
  /** Flips the layer (or its selected pixels, or the outline) about the frame's centre, exactly (one undo step). */
5928
5929
  flipLayer(axis, init = {}) {
5929
- if (axis !== "horizontal" && axis !== "vertical") throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`axis must be horizontal or vertical, got "${String(axis)}".`);
5930
+ if (axis !== "horizontal" && axis !== "vertical") throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`axis must be horizontal or vertical, got "${String(axis)}".`);
5930
5931
  const session = this.beginFreeTransform({ interpolation: "nearest", ...init });
5931
5932
  try {
5932
- session.update({ corners: _chunk3YDQLQH2cjs.flipCorners.call(void 0, session.startGeometry, axis) }, false);
5933
+ session.update({ corners: _chunk32MMQYCQcjs.flipCorners.call(void 0, session.startGeometry, axis) }, false);
5933
5934
  return session.commit();
5934
5935
  } catch (e) {
5935
5936
  session.cancel();
@@ -5941,16 +5942,16 @@ var ImageEditorController = (_class10 = class {
5941
5942
  * centre, snapped so pixels land on whole pixels: exact, no resampling (one undo step).
5942
5943
  */
5943
5944
  rotateLayer90(turn, init = {}) {
5944
- if (turn !== 90 && turn !== -90 && turn !== 180) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`turn must be 90, -90 or 180, got ${String(turn)}.`);
5945
+ if (turn !== 90 && turn !== -90 && turn !== 180) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`turn must be 90, -90 or 180, got ${String(turn)}.`);
5945
5946
  const session = this.beginFreeTransform({ interpolation: "nearest", ...init });
5946
5947
  try {
5947
- const b = session.smartObject || session.typeLayer ? _nullishCoalesce(_chunk3YDQLQH2cjs.transformedBox.call(void 0, session.startGeometry), () => ( session.box)) : session.box;
5948
+ const b = session.smartObject || session.typeLayer ? _nullishCoalesce(_chunk32MMQYCQcjs.transformedBox.call(void 0, session.startGeometry), () => ( session.box)) : session.box;
5948
5949
  const cx = b.x + b.width / 2;
5949
5950
  const cy = b.y + b.height / 2;
5950
5951
  const ox = turn === 180 ? 0 : Math.round(cx - b.height / 2) - (cx - b.height / 2);
5951
5952
  const oy = turn === 180 ? 0 : Math.round(cy - b.width / 2) - (cy - b.width / 2);
5952
5953
  const m = turn === 90 ? [0, 1, -1, 0, cx + cy + ox, cy - cx + oy] : turn === -90 ? [0, -1, 1, 0, cx - cy + ox, cy + cx + oy] : [-1, 0, 0, -1, 2 * cx, 2 * cy];
5953
- session.update({ corners: session.startGeometry.corners.map((p) => _chunkQMI5HZWAcjs.applyMatrix.call(void 0, m, p)) }, false);
5954
+ session.update({ corners: session.startGeometry.corners.map((p) => _chunk236TKNURcjs.applyMatrix.call(void 0, m, p)) }, false);
5954
5955
  return session.commit();
5955
5956
  } catch (e) {
5956
5957
  session.cancel();
@@ -5959,20 +5960,20 @@ var ImageEditorController = (_class10 = class {
5959
5960
  }
5960
5961
  /** Adds a `develop` or `blur` filter to a pixel layer (one undo step). Returns the layer's filters. */
5961
5962
  addLayerFilter(id, filter) {
5962
- const f = _chunk3YDQLQH2cjs.normalizeFilter.call(void 0, filter);
5963
- const next = _chunk3YDQLQH2cjs.addLayerFilter.call(void 0, this.state.layers, id, f);
5963
+ const f = _chunk32MMQYCQcjs.normalizeFilter.call(void 0, filter);
5964
+ const next = _chunk32MMQYCQcjs.addLayerFilter.call(void 0, this.state.layers, id, f);
5964
5965
  this.commitLayers(next);
5965
5966
  return _nullishCoalesce(_chunkHGTDMKNEcjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
5966
5967
  }
5967
5968
  /** Changes one filter (one undo step, or none with `commitToHistory = false` during a drag). Returns the filters. */
5968
5969
  updateLayerFilter(id, filterId, changes, commitToHistory = true) {
5969
- const next = _chunk3YDQLQH2cjs.updateLayerFilter.call(void 0, this.state.layers, id, filterId, changes);
5970
+ const next = _chunk32MMQYCQcjs.updateLayerFilter.call(void 0, this.state.layers, id, filterId, changes);
5970
5971
  this.commitLayers(next, void 0, commitToHistory);
5971
5972
  return _nullishCoalesce(_chunkHGTDMKNEcjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
5972
5973
  }
5973
5974
  /** Removes one filter (one undo step). Returns the remaining filters. */
5974
5975
  removeLayerFilter(id, filterId) {
5975
- const next = _chunk3YDQLQH2cjs.removeLayerFilter.call(void 0, this.state.layers, id, filterId);
5976
+ const next = _chunk32MMQYCQcjs.removeLayerFilter.call(void 0, this.state.layers, id, filterId);
5976
5977
  this.commitLayers(next);
5977
5978
  return _nullishCoalesce(_chunkHGTDMKNEcjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
5978
5979
  }
@@ -5988,8 +5989,8 @@ var ImageEditorController = (_class10 = class {
5988
5989
  */
5989
5990
  convertToSmartObject(ids, options = {}) {
5990
5991
  const list = _optionalChain([ids, 'optionalAccess', _190 => _190.length]) ? ids : this.state.activeLayerId ? [this.state.activeLayerId] : [];
5991
- if (!list.length) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("No layers given and none is active; pass layerIds (see list_layers).");
5992
- const res = _chunk3YDQLQH2cjs.convertToSmartObject.call(void 0, this.state.layers, list, this.canvasSize, { surfaceOf: (l) => this.surfaceOf(l), name: options.name });
5992
+ if (!list.length) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("No layers given and none is active; pass layerIds (see list_layers).");
5993
+ const res = _chunk32MMQYCQcjs.convertToSmartObject.call(void 0, this.state.layers, list, this.canvasSize, { surfaceOf: (l) => this.surfaceOf(l), name: options.name });
5993
5994
  this.commitLayers(res.layers, () => {
5994
5995
  this.state.activeLayerId = res.layer.id;
5995
5996
  this.state.activeTarget = "pixels";
@@ -5998,7 +5999,7 @@ var ImageEditorController = (_class10 = class {
5998
5999
  }
5999
6000
  /** Layer › Smart Objects › Rasterize (one undo step): the smart object becomes a pixel layer holding what it renders. */
6000
6001
  rasterizeSmartObject(id) {
6001
- const res = _chunk3YDQLQH2cjs.rasterizeSmartObject.call(void 0, this.state.layers, id);
6002
+ const res = _chunk32MMQYCQcjs.rasterizeSmartObject.call(void 0, this.state.layers, id);
6002
6003
  this.commitLayers(res.layers, () => {
6003
6004
  if (this.state.activeLayerId === id && this.state.activeTarget === "filter-mask") this.state.activeTarget = "pixels";
6004
6005
  });
@@ -6006,10 +6007,10 @@ var ImageEditorController = (_class10 = class {
6006
6007
  }
6007
6008
  /** A smart object's contents, placement and smart filters as plain data (see `SmartObjectInfo`). */
6008
6009
  getSmartObject(id) {
6009
- const layer = _chunk3YDQLQH2cjs.requireSmartObject.call(void 0, this.state.layers, id);
6010
+ const layer = _chunk32MMQYCQcjs.requireSmartObject.call(void 0, this.state.layers, id);
6010
6011
  const c = layer.contents;
6011
- const g = _chunk3YDQLQH2cjs.placementGeometry.call(void 0, layer);
6012
- const readout = _chunk3YDQLQH2cjs.describeTransform.call(void 0, g);
6012
+ const g = _chunk32MMQYCQcjs.placementGeometry.call(void 0, layer);
6013
+ const readout = _chunk32MMQYCQcjs.describeTransform.call(void 0, g);
6013
6014
  const stack = layer.smartFilters;
6014
6015
  return {
6015
6016
  layerId: layer.id,
@@ -6019,10 +6020,10 @@ var ImageEditorController = (_class10 = class {
6019
6020
  kind: c.kind,
6020
6021
  width: c.width,
6021
6022
  height: c.height,
6022
- decoded: _chunk3YDQLQH2cjs.isContentsDecoded.call(void 0, c),
6023
+ decoded: _chunk32MMQYCQcjs.isContentsDecoded.call(void 0, c),
6023
6024
  fileType: _nullishCoalesce(_optionalChain([c, 'access', _191 => _191.file, 'optionalAccess', _192 => _192.type]), () => ( null)),
6024
6025
  linkedPath: _nullishCoalesce(_optionalChain([c, 'access', _193 => _193.linked, 'optionalAccess', _194 => _194.path]), () => ( null)),
6025
- instances: _chunk3YDQLQH2cjs.instancesOf.call(void 0, this.state.layers, c.id),
6026
+ instances: _chunk32MMQYCQcjs.instancesOf.call(void 0, this.state.layers, c.id),
6026
6027
  layerCount: c.document ? _chunkHGTDMKNEcjs.flattenLayers.call(void 0, c.document.layers).length : 0
6027
6028
  },
6028
6029
  placement: {
@@ -6034,8 +6035,8 @@ var ImageEditorController = (_class10 = class {
6034
6035
  scaleY: readout.scaleY,
6035
6036
  rotate: readout.rotate,
6036
6037
  skewX: readout.skewX,
6037
- center: _chunk3YDQLQH2cjs.anchorPoint.call(void 0, g, "center"),
6038
- bounds: _chunk3YDQLQH2cjs.transformedBox.call(void 0, g)
6038
+ center: _chunk32MMQYCQcjs.anchorPoint.call(void 0, g, "center"),
6039
+ bounds: _chunk32MMQYCQcjs.transformedBox.call(void 0, g)
6039
6040
  },
6040
6041
  smartFilters: {
6041
6042
  enabled: _nullishCoalesce(_optionalChain([stack, 'optionalAccess', _195 => _195.enabled]), () => ( true)),
@@ -6052,7 +6053,7 @@ var ImageEditorController = (_class10 = class {
6052
6053
  * change. Returns the new placement summary.
6053
6054
  */
6054
6055
  setSmartObjectPlacement(id, placement, commitToHistory = true) {
6055
- const res = _chunk3YDQLQH2cjs.setSmartPlacement.call(void 0, this.state.layers, id, placement, this.canvasSize);
6056
+ const res = _chunk32MMQYCQcjs.setSmartPlacement.call(void 0, this.state.layers, id, placement, this.canvasSize);
6056
6057
  this.commitLayers(res.layers, void 0, commitToHistory);
6057
6058
  return { ...this.getSmartObject(id).placement, masksMoved: res.masksMoved };
6058
6059
  }
@@ -6065,23 +6066,23 @@ var ImageEditorController = (_class10 = class {
6065
6066
  * nothing is relative to the current transform.
6066
6067
  */
6067
6068
  setSmartObjectTransform(id, spec) {
6068
- const layer = _chunk3YDQLQH2cjs.requireSmartObject.call(void 0, this.state.layers, id);
6069
- const g = _chunk3YDQLQH2cjs.placementGeometry.call(void 0, layer);
6069
+ const layer = _chunk32MMQYCQcjs.requireSmartObject.call(void 0, this.state.layers, id);
6070
+ const g = _chunk32MMQYCQcjs.placementGeometry.call(void 0, layer);
6070
6071
  const numeric = ["scaleX", "scaleY", "rotate", "skewX", "skewY", "x", "y"].filter((k) => spec[k] !== void 0);
6071
6072
  const ways = [spec.corners !== void 0, spec.matrix !== void 0, numeric.length > 0].filter(Boolean).length;
6072
- if (ways > 1) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("Give the transform only one way: corners, matrix, or the numbers (scaleX, scaleY, rotate, skewX, skewY, x, y).");
6073
+ if (ways > 1) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("Give the transform only one way: corners, matrix, or the numbers (scaleX, scaleY, rotate, skewX, skewY, x, y).");
6073
6074
  let corners = g.corners;
6074
6075
  if (spec.corners) corners = spec.corners;
6075
6076
  else if (spec.matrix) {
6076
- if (!(Array.isArray(spec.matrix) && spec.matrix.length === 6 && spec.matrix.every(Number.isFinite))) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("matrix must be six finite numbers [a, b, c, d, e, f] (x' = a\xB7x + c\xB7y + e, y' = b\xB7x + d\xB7y + f).");
6077
+ if (!(Array.isArray(spec.matrix) && spec.matrix.length === 6 && spec.matrix.every(Number.isFinite))) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("matrix must be six finite numbers [a, b, c, d, e, f] (x' = a\xB7x + c\xB7y + e, y' = b\xB7x + d\xB7y + f).");
6077
6078
  const [a, b, c, d] = spec.matrix;
6078
- if (Math.abs(a * d - b * c) < 1e-9) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("matrix is singular (it collapses the contents to a line); a\xB7d \u2212 b\xB7c must not be 0.");
6079
- corners = _chunk3YDQLQH2cjs.cornersFromMatrix.call(void 0, g.box, spec.matrix);
6079
+ if (Math.abs(a * d - b * c) < 1e-9) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("matrix is singular (it collapses the contents to a line); a\xB7d \u2212 b\xB7c must not be 0.");
6080
+ corners = _chunk32MMQYCQcjs.cornersFromMatrix.call(void 0, g.box, spec.matrix);
6080
6081
  } else if (numeric.length) {
6081
- if (spec.scaleX === 0 || spec.scaleY === 0) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("scaleX and scaleY must not be 0 (that collapses the contents to a line).");
6082
- for (const k of numeric) if (!Number.isFinite(spec[k])) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`${k} must be a finite number.`);
6083
- const now = _chunk3YDQLQH2cjs.describeTransform.call(void 0, g);
6084
- const centre = _chunk3YDQLQH2cjs.anchorPoint.call(void 0, g, "center");
6082
+ if (spec.scaleX === 0 || spec.scaleY === 0) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("scaleX and scaleY must not be 0 (that collapses the contents to a line).");
6083
+ for (const k of numeric) if (!Number.isFinite(spec[k])) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`${k} must be a finite number.`);
6084
+ const now = _chunk32MMQYCQcjs.describeTransform.call(void 0, g);
6085
+ const centre = _chunk32MMQYCQcjs.anchorPoint.call(void 0, g, "center");
6085
6086
  const params = {
6086
6087
  scaleX: _nullishCoalesce(spec.scaleX, () => ( (now.affine ? now.scaleX : 100))),
6087
6088
  scaleY: _nullishCoalesce(spec.scaleY, () => ( (now.affine ? now.scaleY : 100))),
@@ -6089,20 +6090,20 @@ var ImageEditorController = (_class10 = class {
6089
6090
  skewX: _nullishCoalesce(spec.skewX, () => ( (now.affine ? now.skewX : 0))),
6090
6091
  skewY: _nullishCoalesce(spec.skewY, () => ( 0))
6091
6092
  };
6092
- const m = _chunk3YDQLQH2cjs.matrixFromParams.call(void 0, g.box, { ...params, reference: "center" });
6093
+ const m = _chunk32MMQYCQcjs.matrixFromParams.call(void 0, g.box, { ...params, reference: "center" });
6093
6094
  const cx = g.box.width / 2;
6094
6095
  const cy = g.box.height / 2;
6095
6096
  const to = { x: _nullishCoalesce(spec.x, () => ( centre.x)), y: _nullishCoalesce(spec.y, () => ( centre.y)) };
6096
- corners = _chunk3YDQLQH2cjs.cornersFromMatrix.call(void 0, g.box, _chunkQMI5HZWAcjs.multiplyMatrices.call(void 0, m, _chunkQMI5HZWAcjs.translateMatrix.call(void 0, to.x - cx, to.y - cy)));
6097
+ corners = _chunk32MMQYCQcjs.cornersFromMatrix.call(void 0, g.box, _chunk236TKNURcjs.multiplyMatrices.call(void 0, m, _chunk236TKNURcjs.translateMatrix.call(void 0, to.x - cx, to.y - cy)));
6097
6098
  }
6098
6099
  let warp = _nullishCoalesce(layer.placement.warp, () => ( null));
6099
6100
  if (spec.warp === null) warp = null;
6100
6101
  else if (spec.warp) {
6101
6102
  if ("style" in spec.warp) {
6102
- if (!_chunkQMI5HZWAcjs.WARP_STYLES.includes(spec.warp.style)) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`Unknown warp style "${String(spec.warp.style)}". Styles: ${_chunkQMI5HZWAcjs.WARP_STYLES.join(", ")}.`);
6103
- warp = _chunk3YDQLQH2cjs.presetWarp.call(void 0, g.box, spec.warp);
6103
+ if (!_chunk236TKNURcjs.WARP_STYLES.includes(spec.warp.style)) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`Unknown warp style "${String(spec.warp.style)}". Styles: ${_chunk236TKNURcjs.WARP_STYLES.join(", ")}.`);
6104
+ warp = _chunk32MMQYCQcjs.presetWarp.call(void 0, g.box, spec.warp);
6104
6105
  } else {
6105
- if (!_chunk3YDQLQH2cjs.isValidWarp.call(void 0, spec.warp)) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("mesh must have us and vs (knots from 0 to 1, increasing) and (3\xB7columns + 1) \xD7 (3\xB7rows + 1) finite points in contents pixels, row by row.");
6106
+ if (!_chunk32MMQYCQcjs.isValidWarp.call(void 0, spec.warp)) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("mesh must have us and vs (knots from 0 to 1, increasing) and (3\xB7columns + 1) \xD7 (3\xB7rows + 1) finite points in contents pixels, row by row.");
6106
6107
  warp = spec.warp;
6107
6108
  }
6108
6109
  }
@@ -6116,16 +6117,16 @@ var ImageEditorController = (_class10 = class {
6116
6117
  * the layers that changed.
6117
6118
  */
6118
6119
  replaceSmartObjectContents(id, source) {
6119
- const layer = _chunk3YDQLQH2cjs.requireSmartObject.call(void 0, this.state.layers, id);
6120
+ const layer = _chunk32MMQYCQcjs.requireSmartObject.call(void 0, this.state.layers, id);
6120
6121
  let contents;
6121
6122
  if ("contents" in source) contents = source.contents;
6122
- else if ("pixels" in source) contents = _chunk3YDQLQH2cjs.rasterContents.call(void 0, source.pixels, _nullishCoalesce(source.name, () => ( layer.contents.name.replace(/\.\w+$/, ".png"))));
6123
+ else if ("pixels" in source) contents = _chunk32MMQYCQcjs.rasterContents.call(void 0, source.pixels, _nullishCoalesce(source.name, () => ( layer.contents.name.replace(/\.\w+$/, ".png"))));
6123
6124
  else {
6124
- const psd = _chunk3YDQLQH2cjs.importPsd.call(void 0, source.psd, { newId: () => _chunk3YDQLQH2cjs.newLayerId.call(void 0, ) });
6125
- contents = _chunk3YDQLQH2cjs.documentContents.call(void 0, { layers: psd.layers, globalLight: psd.globalLight, patterns: psd.patterns.length ? psd.patterns : void 0 }, psd.width, psd.height, _nullishCoalesce(source.name, () => ( `${layer.name || "Contents"}.psb`)));
6125
+ const psd = _chunk32MMQYCQcjs.importPsd.call(void 0, source.psd, { newId: () => _chunk32MMQYCQcjs.newLayerId.call(void 0, ) });
6126
+ contents = _chunk32MMQYCQcjs.documentContents.call(void 0, { layers: psd.layers, globalLight: psd.globalLight, patterns: psd.patterns.length ? psd.patterns : void 0 }, psd.width, psd.height, _nullishCoalesce(source.name, () => ( `${layer.name || "Contents"}.psb`)));
6126
6127
  contents.file = { bytes: source.psd.slice(), type: psd.info.psb ? "psb" : "psd" };
6127
6128
  }
6128
- const res = _chunk3YDQLQH2cjs.replaceContents.call(void 0, this.state.layers, layer.contents.id, contents, this.canvasSize);
6129
+ const res = _chunk32MMQYCQcjs.replaceContents.call(void 0, this.state.layers, layer.contents.id, contents, this.canvasSize);
6129
6130
  this.commitLayers(res.layers);
6130
6131
  return { contentsId: layer.contents.id, width: contents.width, height: contents.height, layerIds: res.ids };
6131
6132
  }
@@ -6140,16 +6141,16 @@ var ImageEditorController = (_class10 = class {
6140
6141
  * and bytes.
6141
6142
  */
6142
6143
  exportSmartObjectContents(id) {
6143
- const layer = _chunk3YDQLQH2cjs.requireSmartObject.call(void 0, this.state.layers, id);
6144
+ const layer = _chunk32MMQYCQcjs.requireSmartObject.call(void 0, this.state.layers, id);
6144
6145
  const c = layer.contents;
6145
6146
  const base = c.name.replace(/\.\w+$/, "") || "Contents";
6146
6147
  if (c.file) {
6147
- const mime = { psd: "image/vnd.adobe.photoshop", psb: "image/vnd.adobe.photoshop", pdf: "application/pdf", ..._chunk3YDQLQH2cjs.BROWSER_IMAGE_TYPES };
6148
+ const mime = { psd: "image/vnd.adobe.photoshop", psb: "image/vnd.adobe.photoshop", pdf: "application/pdf", ..._chunk32MMQYCQcjs.BROWSER_IMAGE_TYPES };
6148
6149
  const ext = c.file.type.toLowerCase();
6149
6150
  return { name: /\.\w+$/.test(c.name) ? c.name : `${base}.${ext}`, mimeType: _nullishCoalesce(mime[ext], () => ( "application/octet-stream")), bytes: c.file.bytes };
6150
6151
  }
6151
- if (!_chunk3YDQLQH2cjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`The contents of "${layer.name || id}" are not available here.`);
6152
- const f = _chunk3YDQLQH2cjs.smartContentsFile.call(void 0, c);
6152
+ if (!_chunk32MMQYCQcjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`The contents of "${layer.name || id}" are not available here.`);
6153
+ const f = _chunk32MMQYCQcjs.smartContentsFile.call(void 0, c);
6153
6154
  return { name: f.name, mimeType: f.name.endsWith(".png") ? "image/png" : "image/vnd.adobe.photoshop", bytes: f.bytes };
6154
6155
  }
6155
6156
  /**
@@ -6158,7 +6159,7 @@ var ImageEditorController = (_class10 = class {
6158
6159
  * undo step. Returns the copy's id.
6159
6160
  */
6160
6161
  copySmartObject(id, linked = false, name) {
6161
- const res = _chunk3YDQLQH2cjs.copySmartObject.call(void 0, this.state.layers, id, linked, name);
6162
+ const res = _chunk32MMQYCQcjs.copySmartObject.call(void 0, this.state.layers, id, linked, name);
6162
6163
  this.commitLayers(res.layers, () => {
6163
6164
  this.state.activeLayerId = res.layer.id;
6164
6165
  this.state.activeTarget = "pixels";
@@ -6167,31 +6168,31 @@ var ImageEditorController = (_class10 = class {
6167
6168
  }
6168
6169
  /** Adds a smart filter (`develop` or `blur`, with `blend` and `opacity`) at `index` (default the top), as one undo step. */
6169
6170
  addSmartFilter(id, filter, index) {
6170
- const res = _chunk3YDQLQH2cjs.addSmartFilter.call(void 0, this.state.layers, id, _chunk3YDQLQH2cjs.normalizeSmartFilter.call(void 0, filter), this.canvasSize, index);
6171
+ const res = _chunk32MMQYCQcjs.addSmartFilter.call(void 0, this.state.layers, id, _chunk32MMQYCQcjs.normalizeSmartFilter.call(void 0, filter), this.canvasSize, index);
6171
6172
  this.commitLayers(res.layers);
6172
6173
  return res.filter;
6173
6174
  }
6174
6175
  /** Changes one smart filter (one undo step, or none with `commitToHistory = false` during a drag). */
6175
6176
  updateSmartFilter(id, filterId, changes, commitToHistory = true) {
6176
- const res = _chunk3YDQLQH2cjs.updateSmartFilter.call(void 0, this.state.layers, id, filterId, changes, this.canvasSize);
6177
+ const res = _chunk32MMQYCQcjs.updateSmartFilter.call(void 0, this.state.layers, id, filterId, changes, this.canvasSize);
6177
6178
  this.commitLayers(res.layers, void 0, commitToHistory);
6178
6179
  return res.filter;
6179
6180
  }
6180
6181
  /** Removes one smart filter (one undo step). Returns the remaining filters. */
6181
6182
  removeSmartFilter(id, filterId) {
6182
- const res = _chunk3YDQLQH2cjs.removeSmartFilter.call(void 0, this.state.layers, id, filterId, this.canvasSize);
6183
+ const res = _chunk32MMQYCQcjs.removeSmartFilter.call(void 0, this.state.layers, id, filterId, this.canvasSize);
6183
6184
  this.commitLayers(res.layers);
6184
6185
  return _nullishCoalesce(_optionalChain([res, 'access', _198 => _198.layer, 'access', _199 => _199.smartFilters, 'optionalAccess', _200 => _200.filters]), () => ( []));
6185
6186
  }
6186
6187
  /** Moves one smart filter to `index` (0 = bottom, applied first), as one undo step. Returns the filters. */
6187
6188
  moveSmartFilter(id, filterId, index) {
6188
- const res = _chunk3YDQLQH2cjs.moveSmartFilter.call(void 0, this.state.layers, id, filterId, index, this.canvasSize);
6189
+ const res = _chunk32MMQYCQcjs.moveSmartFilter.call(void 0, this.state.layers, id, filterId, index, this.canvasSize);
6189
6190
  this.commitLayers(res.layers);
6190
6191
  return _nullishCoalesce(_optionalChain([res, 'access', _201 => _201.layer, 'access', _202 => _202.smartFilters, 'optionalAccess', _203 => _203.filters]), () => ( []));
6191
6192
  }
6192
6193
  /** Turns a smart object's whole filter stack on or off (one undo step). */
6193
6194
  setSmartFiltersEnabled(id, enabled) {
6194
- const res = _chunk3YDQLQH2cjs.setSmartFiltersEnabled.call(void 0, this.state.layers, id, enabled, this.canvasSize);
6195
+ const res = _chunk32MMQYCQcjs.setSmartFiltersEnabled.call(void 0, this.state.layers, id, enabled, this.canvasSize);
6195
6196
  this.commitLayers(res.layers);
6196
6197
  return _nullishCoalesce(_optionalChain([res, 'access', _204 => _204.layer, 'access', _205 => _205.smartFilters, 'optionalAccess', _206 => _206.enabled]), () => ( true));
6197
6198
  }
@@ -6201,21 +6202,21 @@ var ImageEditorController = (_class10 = class {
6201
6202
  * Painting it targets channel `filter-mask`. Returns the mask, or `null` when removed.
6202
6203
  */
6203
6204
  setSmartFilterMask(id, from, props = {}, commitToHistory = true) {
6204
- const layer = _chunk3YDQLQH2cjs.requireSmartObject.call(void 0, this.state.layers, id);
6205
+ const layer = _chunk32MMQYCQcjs.requireSmartObject.call(void 0, this.state.layers, id);
6205
6206
  let mask;
6206
6207
  if (from === "none") mask = null;
6207
6208
  else if (from === "keep") {
6208
- if (!_optionalChain([layer, 'access', _207 => _207.smartFilters, 'optionalAccess', _208 => _208.mask])) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`Smart object "${layer.name || id}" has no filter mask; add one with from reveal-all, hide-all or selection.`);
6209
+ if (!_optionalChain([layer, 'access', _207 => _207.smartFilters, 'optionalAccess', _208 => _208.mask])) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`Smart object "${layer.name || id}" has no filter mask; add one with from reveal-all, hide-all or selection.`);
6209
6210
  mask = withMaskProps(layer.smartFilters.mask, props);
6210
6211
  } else if (from === "selection") {
6211
6212
  const sel = this.state.selection;
6212
- if (!_optionalChain([sel, 'optionalAccess', _209 => _209.bounds])) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
6213
+ if (!_optionalChain([sel, 'optionalAccess', _209 => _209.bounds])) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
6213
6214
  mask = this.maskFromSelection(sel, props);
6214
6215
  } else {
6215
6216
  const v = from === "reveal-all" ? 255 : 0;
6216
6217
  mask = withMaskProps({ surface: _chunkCWM3CUUXcjs.emptySurface.call(void 0, 1, v), defaultValue: v }, props);
6217
6218
  }
6218
- const res = _chunk3YDQLQH2cjs.setSmartFilterMask.call(void 0, this.state.layers, id, mask, this.canvasSize);
6219
+ const res = _chunk32MMQYCQcjs.setSmartFilterMask.call(void 0, this.state.layers, id, mask, this.canvasSize);
6219
6220
  this.commitLayers(res.layers, () => {
6220
6221
  if (this.state.activeLayerId !== id) return;
6221
6222
  if (mask && from !== "keep") this.state.activeTarget = "filter-mask";
@@ -6231,14 +6232,14 @@ var ImageEditorController = (_class10 = class {
6231
6232
  async prepareSmartObjects() {
6232
6233
  const pending = /* @__PURE__ */ new Map();
6233
6234
  for (const l of _chunkHGTDMKNEcjs.flattenLayers.call(void 0, this.state.layers)) {
6234
- if (l.type === "smart" && !_chunk3YDQLQH2cjs.isContentsDecoded.call(void 0, l.contents) && l.contents.file && _chunk3YDQLQH2cjs.BROWSER_IMAGE_TYPES[l.contents.file.type]) pending.set(l.contents.id, l.contents);
6235
+ if (l.type === "smart" && !_chunk32MMQYCQcjs.isContentsDecoded.call(void 0, l.contents) && l.contents.file && _chunk32MMQYCQcjs.BROWSER_IMAGE_TYPES[l.contents.file.type]) pending.set(l.contents.id, l.contents);
6235
6236
  }
6236
6237
  const left = [];
6237
6238
  for (const [cid, c] of pending) {
6238
6239
  try {
6239
- const url = `data:${_chunk3YDQLQH2cjs.BROWSER_IMAGE_TYPES[c.file.type]};base64,${_chunkCWM3CUUXcjs.bytesToBase64.call(void 0, c.file.bytes)}`;
6240
+ const url = `data:${_chunk32MMQYCQcjs.BROWSER_IMAGE_TYPES[c.file.type]};base64,${_chunkCWM3CUUXcjs.bytesToBase64.call(void 0, c.file.bytes)}`;
6240
6241
  const px2 = await this.decodeImage(url);
6241
- const decoded = { ...c, kind: "raster", raster: _chunk3YDQLQH2cjs.rasterContents.call(void 0, px2, c.name, cid).raster, width: px2.width, height: px2.height };
6242
+ const decoded = { ...c, kind: "raster", raster: _chunk32MMQYCQcjs.rasterContents.call(void 0, px2, c.name, cid).raster, width: px2.width, height: px2.height };
6242
6243
  const swap = (layers) => {
6243
6244
  let out = layers;
6244
6245
  for (const l of _chunkHGTDMKNEcjs.flattenLayers.call(void 0, layers)) if (l.type === "smart" && l.contents.id === cid) out = _chunkHGTDMKNEcjs.mapLayer.call(void 0, out, l.id, (x) => ({ ...x, contents: decoded }));
@@ -6266,10 +6267,10 @@ var ImageEditorController = (_class10 = class {
6266
6267
  * Contents can nest. Returns the contents' size and layer ids.
6267
6268
  */
6268
6269
  editSmartObjectContents(id) {
6269
- if (this.getFreeTransform()) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("A Free Transform is open; commit or cancel it first.");
6270
- const layer = _chunk3YDQLQH2cjs.requireSmartObject.call(void 0, this.state.layers, id);
6270
+ if (this.getFreeTransform()) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("A Free Transform is open; commit or cancel it first.");
6271
+ const layer = _chunk32MMQYCQcjs.requireSmartObject.call(void 0, this.state.layers, id);
6271
6272
  const c = layer.contents;
6272
- if (!_chunk3YDQLQH2cjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`The contents of "${layer.name || id}" are a ${_nullishCoalesce(_optionalChain([c, 'access', _213 => _213.file, 'optionalAccess', _214 => _214.type]), () => ( "file"))} that could not be decoded here; run prepareSmartObjects() in a browser first.`);
6273
+ if (!_chunk32MMQYCQcjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`The contents of "${layer.name || id}" are a ${_nullishCoalesce(_optionalChain([c, 'access', _213 => _213.file, 'optionalAccess', _214 => _214.type]), () => ( "file"))} that could not be decoded here; run prepareSmartObjects() in a browser first.`);
6273
6274
  const saved = {
6274
6275
  state: { ...this.state },
6275
6276
  undo: this.undoStack,
@@ -6280,7 +6281,7 @@ var ImageEditorController = (_class10 = class {
6280
6281
  samplePixelsOverride: this.samplePixelsOverride,
6281
6282
  psdResolution: this.psdResolution
6282
6283
  };
6283
- const layers = c.kind === "document" ? c.document.layers : [{ type: "pixel", id: _chunk3YDQLQH2cjs.newLayerId.call(void 0, ), name: "Layer 0", visible: true, opacity: 1, blend: "normal", surface: c.raster, offset: { x: 0, y: 0 } }];
6284
+ const layers = c.kind === "document" ? c.document.layers : [{ type: "pixel", id: _chunk32MMQYCQcjs.newLayerId.call(void 0, ), name: "Layer 0", visible: true, opacity: 1, blend: "normal", surface: c.raster, offset: { x: 0, y: 0 } }];
6284
6285
  this.contentsStack.push({ layerId: layer.id, contentsId: c.id, name: layer.name || c.name, saved });
6285
6286
  const s = this.state;
6286
6287
  this.state = {
@@ -6288,7 +6289,7 @@ var ImageEditorController = (_class10 = class {
6288
6289
  sourceUrl: null,
6289
6290
  imageDimensions: { width: c.width, height: c.height },
6290
6291
  crop: null,
6291
- transform: { ..._chunk3YDQLQH2cjs.DEFAULT_TRANSFORM_VALUES },
6292
+ transform: { ..._chunk32MMQYCQcjs.DEFAULT_TRANSFORM_VALUES },
6292
6293
  layers,
6293
6294
  activeLayerId: layers.length ? layers[layers.length - 1].id : null,
6294
6295
  activeTarget: "pixels",
@@ -6321,7 +6322,7 @@ var ImageEditorController = (_class10 = class {
6321
6322
  */
6322
6323
  closeSmartObjectContents(save = true) {
6323
6324
  const top = this.contentsStack.pop();
6324
- if (!top) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("No smart object contents are open; open them with edit_smart_object_contents.");
6325
+ if (!top) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("No smart object contents are open; open them with edit_smart_object_contents.");
6325
6326
  if (_optionalChain([this, 'access', _220 => _220.openTransform, 'optionalAccess', _221 => _221.isOpen])) this.openTransform.cancel();
6326
6327
  this.openTransform = null;
6327
6328
  const edited = this.state;
@@ -6335,10 +6336,10 @@ var ImageEditorController = (_class10 = class {
6335
6336
  const plain3 = _optionalChain([only, 'optionalAccess', _224 => _224.type]) === "pixel" && only.visible && only.opacity === 1 && only.blend === "normal" && !only.mask && !only.effects && !_optionalChain([only, 'access', _225 => _225.filters, 'optionalAccess', _226 => _226.length]) && !only.clipped && (_nullishCoalesce(only.fillOpacity, () => ( 1))) === 1 && only.source !== "document";
6336
6337
  if (_optionalChain([old, 'optionalAccess', _227 => _227.kind]) === "raster" && plain3) {
6337
6338
  const px2 = _chunkCWM3CUUXcjs.readRegion.call(void 0, only.surface, { x: -only.offset.x, y: -only.offset.y, width, height });
6338
- next = _chunk3YDQLQH2cjs.rasterContents.call(void 0, { width, height, data: px2 }, old.name, old.id);
6339
+ next = _chunk32MMQYCQcjs.rasterContents.call(void 0, { width, height, data: px2 }, old.name, old.id);
6339
6340
  } else {
6340
6341
  const doc = { layers: edited.layers, globalLight: edited.globalLight, patterns: edited.patterns };
6341
- next = _chunk3YDQLQH2cjs.documentContents.call(void 0, doc, width, height, _optionalChain([old, 'optionalAccess', _228 => _228.kind]) === "document" ? old.name : `${(_nullishCoalesce(_optionalChain([old, 'optionalAccess', _229 => _229.name]), () => ( "Contents"))).replace(/\.\w+$/, "")}.psb`, top.contentsId);
6342
+ next = _chunk32MMQYCQcjs.documentContents.call(void 0, doc, width, height, _optionalChain([old, 'optionalAccess', _228 => _228.kind]) === "document" ? old.name : `${(_nullishCoalesce(_optionalChain([old, 'optionalAccess', _229 => _229.name]), () => ( "Contents"))).replace(/\.\w+$/, "")}.psb`, top.contentsId);
6342
6343
  }
6343
6344
  }
6344
6345
  const saved = top.saved;
@@ -6357,7 +6358,7 @@ var ImageEditorController = (_class10 = class {
6357
6358
  this.notify();
6358
6359
  return { layerId: top.layerId, changed: false, layerIds: [] };
6359
6360
  }
6360
- const res = _chunk3YDQLQH2cjs.replaceContents.call(void 0, this.state.layers, top.contentsId, next, this.canvasSize);
6361
+ const res = _chunk32MMQYCQcjs.replaceContents.call(void 0, this.state.layers, top.contentsId, next, this.canvasSize);
6361
6362
  this.commitLayers(res.layers);
6362
6363
  return { layerId: top.layerId, changed: true, layerIds: res.ids };
6363
6364
  }
@@ -6372,35 +6373,35 @@ var ImageEditorController = (_class10 = class {
6372
6373
  // --- Layer effects ---
6373
6374
  /** A layer's effects (an empty, enabled list when it has none). */
6374
6375
  getLayerEffects(id) {
6375
- return _chunk3YDQLQH2cjs.layerEffectsOf.call(void 0, _chunk3YDQLQH2cjs.requireLayer.call(void 0, this.state.layers, id).layer);
6376
+ return _chunk32MMQYCQcjs.layerEffectsOf.call(void 0, _chunk32MMQYCQcjs.requireLayer.call(void 0, this.state.layers, id).layer);
6376
6377
  }
6377
6378
  /**
6378
6379
  * Adds an effect of `kind` with Photoshop's defaults and `params` applied (one undo step), at
6379
6380
  * `index` in the layer's effect list (default the end). Returns the new effect and the effects.
6380
6381
  */
6381
6382
  addLayerEffect(id, kind, params = {}, index) {
6382
- const res = _chunk3YDQLQH2cjs.addLayerEffect.call(void 0, this.state.layers, id, kind, params, index);
6383
+ const res = _chunk32MMQYCQcjs.addLayerEffect.call(void 0, this.state.layers, id, kind, params, index);
6383
6384
  this.commitLayers(res.layers);
6384
6385
  return { effect: res.effect, effects: this.getLayerEffects(id) };
6385
6386
  }
6386
6387
  /** Changes one effect (one undo step, or none with `commitToHistory = false` during a drag). Returns the effects. */
6387
6388
  updateLayerEffect(id, effectId, changes, commitToHistory = true) {
6388
- this.commitLayers(_chunk3YDQLQH2cjs.updateLayerEffect.call(void 0, this.state.layers, id, effectId, changes), void 0, commitToHistory);
6389
+ this.commitLayers(_chunk32MMQYCQcjs.updateLayerEffect.call(void 0, this.state.layers, id, effectId, changes), void 0, commitToHistory);
6389
6390
  return this.getLayerEffects(id);
6390
6391
  }
6391
6392
  /** Removes one effect (one undo step). Returns the remaining effects. */
6392
6393
  removeLayerEffect(id, effectId) {
6393
- this.commitLayers(_chunk3YDQLQH2cjs.removeLayerEffect.call(void 0, this.state.layers, id, effectId));
6394
+ this.commitLayers(_chunk32MMQYCQcjs.removeLayerEffect.call(void 0, this.state.layers, id, effectId));
6394
6395
  return this.getLayerEffects(id);
6395
6396
  }
6396
6397
  /** Turns a layer's effects on or off as a whole and, when given, sets Scale Effects (one undo step). */
6397
6398
  setLayerEffectsEnabled(id, enabled, scale, commitToHistory = true) {
6398
- this.commitLayers(_chunk3YDQLQH2cjs.setLayerEffectsEnabled.call(void 0, this.state.layers, id, enabled, scale), void 0, commitToHistory);
6399
+ this.commitLayers(_chunk32MMQYCQcjs.setLayerEffectsEnabled.call(void 0, this.state.layers, id, enabled, scale), void 0, commitToHistory);
6399
6400
  return this.getLayerEffects(id);
6400
6401
  }
6401
6402
  /** Replaces a layer's effects (one undo step; `null` removes them). Returns the effects. */
6402
6403
  setLayerEffects(id, effects, commitToHistory = true) {
6403
- this.commitLayers(_chunk3YDQLQH2cjs.setLayerEffects.call(void 0, this.state.layers, id, effects), void 0, commitToHistory);
6404
+ this.commitLayers(_chunk32MMQYCQcjs.setLayerEffects.call(void 0, this.state.layers, id, effects), void 0, commitToHistory);
6404
6405
  return this.getLayerEffects(id);
6405
6406
  }
6406
6407
  __init86() {this.patternIds = /* @__PURE__ */ new WeakMap()}
@@ -6426,8 +6427,8 @@ var ImageEditorController = (_class10 = class {
6426
6427
  /** Sets the global light (one undo step). `angle` -360..360°, `altitude` 0..90°. Returns it. */
6427
6428
  setGlobalLight(light, commitToHistory = true) {
6428
6429
  const next = { ...this.getGlobalLight(), ...light };
6429
- if (!(Number.isFinite(next.angle) && next.angle >= -360 && next.angle <= 360)) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`angle must be from -360 to 360 degrees, got ${next.angle}.`);
6430
- if (!(Number.isFinite(next.altitude) && next.altitude >= 0 && next.altitude <= 90)) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`altitude must be from 0 to 90 degrees, got ${next.altitude}.`);
6430
+ if (!(Number.isFinite(next.angle) && next.angle >= -360 && next.angle <= 360)) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`angle must be from -360 to 360 degrees, got ${next.angle}.`);
6431
+ if (!(Number.isFinite(next.altitude) && next.altitude >= 0 && next.altitude <= 90)) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`altitude must be from 0 to 90 degrees, got ${next.altitude}.`);
6431
6432
  if (commitToHistory) this.recordHistory();
6432
6433
  if (next.angle === _chunkHGTDMKNEcjs.DEFAULT_GLOBAL_LIGHT.angle && next.altitude === _chunkHGTDMKNEcjs.DEFAULT_GLOBAL_LIGHT.altitude) delete this.state.globalLight;
6433
6434
  else this.state.globalLight = next;
@@ -6438,16 +6439,16 @@ var ImageEditorController = (_class10 = class {
6438
6439
  async compositeToSurface(layers, rect) {
6439
6440
  const { width, height } = this.naturalSize;
6440
6441
  if (_chunkHGTDMKNEcjs.flattenLayers.call(void 0, layers).some((l) => l.type === "annotation" && l.visible) && !this.renderer.canRasterize()) {
6441
- throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("Merging annotation layers needs a canvas (a browser); hide or delete them first, or merge in the browser.");
6442
+ throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("Merging annotation layers needs a canvas (a browser); hide or delete them first, or merge in the browser.");
6442
6443
  }
6443
6444
  await this.renderer.prepareLayerAssets(layers, width, height);
6444
6445
  const sources = this.renderer.compositorSources(width, height);
6445
6446
  const depth = this.bitDepth;
6446
6447
  if (depth !== 8) {
6447
- const samples = _chunkHGTDMKNEcjs.workingToSamples.call(void 0, _chunk3YDQLQH2cjs.compositeDeep.call(void 0, layers, rect, sources, depth), depth);
6448
+ const samples = _chunkHGTDMKNEcjs.workingToSamples.call(void 0, _chunk32MMQYCQcjs.compositeDeep.call(void 0, layers, rect, sources, depth), depth);
6448
6449
  return _chunkCWM3CUUXcjs.surfaceFromDeepPixels.call(void 0, { width: rect.width, height: rect.height, data: samples }, 4, rect.x, rect.y);
6449
6450
  }
6450
- const data = new (0, _chunk3YDQLQH2cjs.LayerCompositor)().composite(layers, rect, sources);
6451
+ const data = new (0, _chunk32MMQYCQcjs.LayerCompositor)().composite(layers, rect, sources);
6451
6452
  return _chunkCWM3CUUXcjs.surfaceFromPixels.call(void 0, { width: rect.width, height: rect.height, data }, 4, rect.x, rect.y);
6452
6453
  }
6453
6454
  /**
@@ -6460,22 +6461,22 @@ var ImageEditorController = (_class10 = class {
6460
6461
  const r = _nullishCoalesce(rect, () => ( { x: 0, y: 0, width, height }));
6461
6462
  const depth = this.bitDepth;
6462
6463
  if (depth === 8) return { width: r.width, height: r.height, depth: 16, data: _chunkCWM3CUUXcjs.to16From8.call(void 0, this.compositePixels(r).data) };
6463
- const data = _chunkHGTDMKNEcjs.workingToSamples.call(void 0, _chunk3YDQLQH2cjs.compositeDeep.call(void 0, this.state.layers, r, this.compositorSources(), depth), depth);
6464
+ const data = _chunkHGTDMKNEcjs.workingToSamples.call(void 0, _chunk32MMQYCQcjs.compositeDeep.call(void 0, this.state.layers, r, this.compositorSources(), depth), depth);
6464
6465
  return { width: r.width, height: r.height, depth, data };
6465
6466
  }
6466
6467
  /** Document bounds a layer can paint into (pixel content, annotations, or the canvas for the rest). */
6467
6468
  paintBounds(layer) {
6468
6469
  const { width, height } = this.naturalSize;
6469
6470
  const canvas = { x: 0, y: 0, width, height };
6470
- if (_chunk3YDQLQH2cjs.hasSurface.call(void 0, layer)) return _nullishCoalesce(this.getLayerBounds(layer.id), () => ( { x: 0, y: 0, width: 0, height: 0 }));
6471
+ if (_chunk32MMQYCQcjs.hasSurface.call(void 0, layer)) return _nullishCoalesce(this.getLayerBounds(layer.id), () => ( { x: 0, y: 0, width: 0, height: 0 }));
6471
6472
  if (layer.type === "annotation") {
6472
- const b = _chunk3YDQLQH2cjs.getAnnotationBounds.call(void 0, layer.annotation);
6473
+ const b = _chunk32MMQYCQcjs.getAnnotationBounds.call(void 0, layer.annotation);
6473
6474
  const pad = 4 + ("strokeWidth" in layer.annotation ? layer.annotation.strokeWidth : 0);
6474
6475
  return coveringRect({ x: b.x - pad, y: b.y - pad, width: b.width + 2 * pad, height: b.height + 2 * pad });
6475
6476
  }
6476
6477
  if (layer.type === "group") {
6477
6478
  let r = null;
6478
- for (const c of layer.children) r = _chunk3YDQLQH2cjs.unionRect.call(void 0, r, this.paintBounds(c));
6479
+ for (const c of layer.children) r = _chunk32MMQYCQcjs.unionRect.call(void 0, r, this.paintBounds(c));
6479
6480
  return _nullishCoalesce(r, () => ( canvas));
6480
6481
  }
6481
6482
  return canvas;
@@ -6486,16 +6487,16 @@ var ImageEditorController = (_class10 = class {
6486
6487
  * Returns the merged id.
6487
6488
  */
6488
6489
  async mergeDown(id) {
6489
- const loc = _chunk3YDQLQH2cjs.requireLayer.call(void 0, this.state.layers, id);
6490
+ const loc = _chunk32MMQYCQcjs.requireLayer.call(void 0, this.state.layers, id);
6490
6491
  const upper = loc.layer;
6491
6492
  const siblings = loc.parent ? loc.parent.children : this.state.layers;
6492
6493
  const lower = siblings[loc.index - 1];
6493
- if (!lower) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`Layer "${upper.name || id}" is the bottom of its group; there is nothing below to merge into.`);
6494
- if (lower.type !== "pixel") throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`Merge Down needs a pixel layer below; "${lower.name || lower.id}" is a ${lower.type} layer. Move the layer or merge into another one.`);
6495
- if (!upper.visible) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`Layer "${upper.name || id}" is hidden; show it or delete it instead of merging.`);
6496
- _chunk3YDQLQH2cjs.requireUnlocked.call(void 0, upper, "all", "merge it");
6497
- _chunk3YDQLQH2cjs.requireUnlocked.call(void 0, lower, "pixels", "merge into it");
6498
- let rect = _nullishCoalesce(_chunk3YDQLQH2cjs.unionRect.call(void 0, this.paintBounds(lower), upper.type === "adjustment" ? null : this.paintBounds(upper)), () => ( { x: 0, y: 0, width: 1, height: 1 }));
6494
+ if (!lower) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`Layer "${upper.name || id}" is the bottom of its group; there is nothing below to merge into.`);
6495
+ if (lower.type !== "pixel") throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`Merge Down needs a pixel layer below; "${lower.name || lower.id}" is a ${lower.type} layer. Move the layer or merge into another one.`);
6496
+ if (!upper.visible) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`Layer "${upper.name || id}" is hidden; show it or delete it instead of merging.`);
6497
+ _chunk32MMQYCQcjs.requireUnlocked.call(void 0, upper, "all", "merge it");
6498
+ _chunk32MMQYCQcjs.requireUnlocked.call(void 0, lower, "pixels", "merge into it");
6499
+ let rect = _nullishCoalesce(_chunk32MMQYCQcjs.unionRect.call(void 0, this.paintBounds(lower), upper.type === "adjustment" ? null : this.paintBounds(upper)), () => ( { x: 0, y: 0, width: 1, height: 1 }));
6499
6500
  const reach = Math.max(_chunkHGTDMKNEcjs.effectsMargin.call(void 0, lower.effects), upper.type === "adjustment" ? 0 : _chunkHGTDMKNEcjs.effectsMargin.call(void 0, upper.effects));
6500
6501
  if (reach) rect = { x: rect.x - reach, y: rect.y - reach, width: rect.width + 2 * reach, height: rect.height + 2 * reach };
6501
6502
  const base = { ...lower, blend: "normal", opacity: 1 };
@@ -6521,12 +6522,12 @@ var ImageEditorController = (_class10 = class {
6521
6522
  */
6522
6523
  async mergeVisible() {
6523
6524
  const visible = this.state.layers.filter((l) => l.visible);
6524
- if (!visible.length) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("No layer is visible.");
6525
+ if (!visible.length) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("No layer is visible.");
6525
6526
  const { width, height } = this.naturalSize;
6526
6527
  const surface = await this.compositeToSurface(visible, { x: 0, y: 0, width, height });
6527
6528
  const merged = {
6528
6529
  type: "pixel",
6529
- id: _chunk3YDQLQH2cjs.newLayerId.call(void 0, ),
6530
+ id: _chunk32MMQYCQcjs.newLayerId.call(void 0, ),
6530
6531
  name: "Merged",
6531
6532
  visible: true,
6532
6533
  opacity: 1,
@@ -6550,8 +6551,8 @@ var ImageEditorController = (_class10 = class {
6550
6551
  const surface = await this.compositeToSurface(this.state.layers, { x: 0, y: 0, width, height });
6551
6552
  const bg = {
6552
6553
  type: "pixel",
6553
- id: _chunk3YDQLQH2cjs.BACKGROUND_LAYER_ID,
6554
- name: _chunk3YDQLQH2cjs.BACKGROUND_LAYER_NAME,
6554
+ id: _chunk32MMQYCQcjs.BACKGROUND_LAYER_ID,
6555
+ name: _chunk32MMQYCQcjs.BACKGROUND_LAYER_NAME,
6555
6556
  visible: true,
6556
6557
  opacity: 1,
6557
6558
  blend: "normal",
@@ -6578,7 +6579,7 @@ var ImageEditorController = (_class10 = class {
6578
6579
  const k = Math.min(1, side / Math.max(width, height));
6579
6580
  const tw = Math.max(1, Math.round(width * k));
6580
6581
  const th = Math.max(1, Math.round(height * k));
6581
- const surface = options.mask ? layer.mask && !layer.mask.source ? layer.mask.surface : null : _chunk3YDQLQH2cjs.hasSurface.call(void 0, layer) ? this.surfaceOf(layer) : null;
6582
+ const surface = options.mask ? layer.mask && !layer.mask.source ? layer.mask.surface : null : _chunk32MMQYCQcjs.hasSurface.call(void 0, layer) ? this.surfaceOf(layer) : null;
6582
6583
  if (!surface) return null;
6583
6584
  const ox = layer.type === "pixel" ? layer.offset.x : 0;
6584
6585
  const oy = layer.type === "pixel" ? layer.offset.y : 0;
@@ -6674,7 +6675,7 @@ var ImageEditorController = (_class10 = class {
6674
6675
  * pixels. The next stroke fixes the offset from its first point. View state, no undo.
6675
6676
  */
6676
6677
  setCloneSource(point) {
6677
- if (point && (!Number.isFinite(point.x) || !Number.isFinite(point.y))) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("The clone source needs finite x and y (document pixels).");
6678
+ if (point && (!Number.isFinite(point.x) || !Number.isFinite(point.y))) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("The clone source needs finite x and y (document pixels).");
6678
6679
  const source = point ? { x: Math.round(point.x), y: Math.round(point.y), offset: null } : null;
6679
6680
  this.state.paint = { ...this.state.paint, cloneSource: source };
6680
6681
  this.notify();
@@ -6690,9 +6691,9 @@ var ImageEditorController = (_class10 = class {
6690
6691
  const next = t ? { ...cur, ...t } : { ..._chunk7NW46N7Icjs.IDENTITY_CLONE_TRANSFORM };
6691
6692
  for (const k of ["scaleX", "scaleY"]) {
6692
6693
  const v = next[k];
6693
- if (!Number.isFinite(v) || Math.abs(v) < 0.01 || Math.abs(v) > 10) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`${k} must be a scale factor between 0.01 and 10 in size (negative flips), not ${String(v)}.`);
6694
+ if (!Number.isFinite(v) || Math.abs(v) < 0.01 || Math.abs(v) > 10) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`${k} must be a scale factor between 0.01 and 10 in size (negative flips), not ${String(v)}.`);
6694
6695
  }
6695
- if (!Number.isFinite(next.rotate)) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("rotate must be a number of degrees.");
6696
+ if (!Number.isFinite(next.rotate)) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("rotate must be a number of degrees.");
6696
6697
  next.rotate = ((next.rotate + 180) % 360 + 360) % 360 - 180;
6697
6698
  this.state.paint = { ...this.state.paint, cloneTransform: next };
6698
6699
  this.notify();
@@ -6710,28 +6711,28 @@ var ImageEditorController = (_class10 = class {
6710
6711
  /** Resolves and validates what a stroke, fill or clear paints into. */
6711
6712
  paintTarget(layerId, channel, action) {
6712
6713
  const id = _nullishCoalesce(layerId, () => ( this.state.activeLayerId));
6713
- if (!id) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`No layer given and none is active; pass layerId (see list_layers) to ${action}.`, `Pick a layer to ${action} on in the Layers panel.`);
6714
- const layer = _chunk3YDQLQH2cjs.requireLayer.call(void 0, this.state.layers, id).layer;
6714
+ if (!id) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`No layer given and none is active; pass layerId (see list_layers) to ${action}.`, `Pick a layer to ${action} on in the Layers panel.`);
6715
+ const layer = _chunk32MMQYCQcjs.requireLayer.call(void 0, this.state.layers, id).layer;
6715
6716
  const name = layer.name || id;
6716
6717
  const ch = _nullishCoalesce(channel, () => ( (id === this.state.activeLayerId ? this.state.activeTarget : "pixels")));
6717
6718
  if (ch === "mask") {
6718
- if (!layer.mask) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`Layer "${name}" has no mask to ${action}; add one with add_layer_mask, or target pixels.`, `Layer "${name}" has no mask; add a mask or ${action} on its pixels.`);
6719
- if (layer.mask.source) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`Layer "${name}" has a depth mask, which is generated, not painted.`);
6720
- _chunk3YDQLQH2cjs.requireUnlocked.call(void 0, layer, "all", action);
6719
+ if (!layer.mask) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`Layer "${name}" has no mask to ${action}; add one with add_layer_mask, or target pixels.`, `Layer "${name}" has no mask; add a mask or ${action} on its pixels.`);
6720
+ if (layer.mask.source) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`Layer "${name}" has a depth mask, which is generated, not painted.`);
6721
+ _chunk32MMQYCQcjs.requireUnlocked.call(void 0, layer, "all", action);
6721
6722
  } else if (ch === "filter-mask") {
6722
6723
  if (layer.type !== "smart" || !_optionalChain([layer, 'access', _237 => _237.smartFilters, 'optionalAccess', _238 => _238.mask])) {
6723
- throw new (0, _chunk3YDQLQH2cjs.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}.`);
6724
+ throw new (0, _chunk32MMQYCQcjs.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}.`);
6724
6725
  }
6725
- if (!_chunk3YDQLQH2cjs.isContentsDecoded.call(void 0, layer.contents)) throw new (0, _chunk3YDQLQH2cjs.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.`);
6726
- _chunk3YDQLQH2cjs.requireUnlocked.call(void 0, layer, "all", action);
6726
+ if (!_chunk32MMQYCQcjs.isContentsDecoded.call(void 0, layer.contents)) throw new (0, _chunk32MMQYCQcjs.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.`);
6727
+ _chunk32MMQYCQcjs.requireUnlocked.call(void 0, layer, "all", action);
6727
6728
  } else {
6728
- if (layer.type === "smart") throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`Layer "${name}" is a smart object; its pixels come from its contents. Rasterize it (rasterize_smart_object), edit its contents (edit_smart_object_contents), or ${action} on its mask or filter mask.`, `"${name}" is a smart object; rasterize it or edit its contents to ${action} on it.`);
6729
- if (layer.type === "shape") throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`Layer "${name}" is a shape layer; its pixels are drawn from its paths. Rasterize it first (rasterize_layer), or ${action} on its mask (channel mask).`, `"${name}" is a shape layer; rasterize it to ${action} on it.`);
6730
- if (layer.type === "type") throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`Layer "${name}" is a type layer; its pixels are drawn from its text. Rasterize it first (rasterize_layer), or ${action} on its mask (channel mask).`, `"${name}" is a type layer; rasterize it to ${action} on it.`);
6731
- if (layer.type !== "pixel") throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`Layer "${name}" is a ${layer.type} layer; ${action} on a pixel layer, or on this layer's mask (channel mask).`, `"${name}" is not a pixel layer; pick a pixel layer to ${action} on.`);
6732
- _chunk3YDQLQH2cjs.requireUnlocked.call(void 0, layer, "pixels", action);
6729
+ if (layer.type === "smart") throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`Layer "${name}" is a smart object; its pixels come from its contents. Rasterize it (rasterize_smart_object), edit its contents (edit_smart_object_contents), or ${action} on its mask or filter mask.`, `"${name}" is a smart object; rasterize it or edit its contents to ${action} on it.`);
6730
+ if (layer.type === "shape") throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`Layer "${name}" is a shape layer; its pixels are drawn from its paths. Rasterize it first (rasterize_layer), or ${action} on its mask (channel mask).`, `"${name}" is a shape layer; rasterize it to ${action} on it.`);
6731
+ if (layer.type === "type") throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`Layer "${name}" is a type layer; its pixels are drawn from its text. Rasterize it first (rasterize_layer), or ${action} on its mask (channel mask).`, `"${name}" is a type layer; rasterize it to ${action} on it.`);
6732
+ if (layer.type !== "pixel") throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`Layer "${name}" is a ${layer.type} layer; ${action} on a pixel layer, or on this layer's mask (channel mask).`, `"${name}" is not a pixel layer; pick a pixel layer to ${action} on.`);
6733
+ _chunk32MMQYCQcjs.requireUnlocked.call(void 0, layer, "pixels", action);
6733
6734
  }
6734
- if (!layer.visible) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`Layer "${name}" is hidden; show it before you ${action}.`);
6735
+ if (!layer.visible) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`Layer "${name}" is hidden; show it before you ${action}.`);
6735
6736
  const offset = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
6736
6737
  const surface = ch === "mask" ? layer.mask.surface : ch === "filter-mask" ? layer.smartFilters.mask.surface : this.surfaceOf(layer);
6737
6738
  const lockTransparency = ch === "pixels" && Boolean(_optionalChain([layer, 'access', _239 => _239.locks, 'optionalAccess', _240 => _240.transparency]));
@@ -6740,7 +6741,7 @@ var ImageEditorController = (_class10 = class {
6740
6741
  /** The layer with its pixels (or mask) replaced by `surface`. */
6741
6742
  withSurface(layer, channel, surface) {
6742
6743
  if (channel === "mask") return { ...layer, mask: { ...layer.mask, surface } };
6743
- if (channel === "filter-mask") return _chunk3YDQLQH2cjs.withFilterMaskSurface.call(void 0, layer, surface, this.canvasSize);
6744
+ if (channel === "filter-mask") return _chunk32MMQYCQcjs.withFilterMaskSurface.call(void 0, layer, surface, this.canvasSize);
6744
6745
  const next = { ...layer, surface };
6745
6746
  delete next.source;
6746
6747
  return next;
@@ -6753,10 +6754,10 @@ var ImageEditorController = (_class10 = class {
6753
6754
  */
6754
6755
  beginStroke(init = {}) {
6755
6756
  const tool = _nullishCoalesce(init.tool, () => ( "brush"));
6756
- if (!STROKE_TOOLS.includes(tool)) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`Unknown paint tool "${String(tool)}"; use one of ${STROKE_TOOLS.join(", ")}.`);
6757
+ if (!STROKE_TOOLS.includes(tool)) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`Unknown paint tool "${String(tool)}"; use one of ${STROKE_TOOLS.join(", ")}.`);
6757
6758
  const target = this.paintTarget(init.layerId, init.channel, tool === "eraser" ? "erase" : isRetouchTool(tool) ? "retouch" : "paint");
6758
6759
  if (tool === "mixer" && target.channel !== "pixels") {
6759
- throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("The Mixer Brush paints colour on pixels, not on masks; target pixels (channel pixels), or paint the mask with the brush.", "The Mixer Brush paints on pixels, not masks; target the layer's pixels, or paint the mask with the Brush.");
6760
+ throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("The Mixer Brush paints colour on pixels, not on masks; target pixels (channel pixels), or paint the mask with the brush.", "The Mixer Brush paints on pixels, not masks; target the layer's pixels, or paint the mask with the Brush.");
6760
6761
  }
6761
6762
  const brush = _chunkEBDCRTZIcjs.normalizeBrush.call(void 0, { ...this.state.paint.brush, ..._nullishCoalesce(init.brush, () => ( {})) });
6762
6763
  let strokePaint = null;
@@ -6790,7 +6791,7 @@ var ImageEditorController = (_class10 = class {
6790
6791
  retouchStroke(tool, init, brush, target, apply) {
6791
6792
  const settings = _chunk7NW46N7Icjs.normalizeRetouch.call(void 0, _nullishCoalesce(init.retouch, () => ( {})), this.state.paint.retouch);
6792
6793
  const mask = target.channel !== "pixels";
6793
- if (tool === "sponge" && mask) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("The Sponge changes saturation, and a mask has none; target pixels (channel pixels), or use dodge or burn on the mask.");
6794
+ if (tool === "sponge" && mask) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("The Sponge changes saturation, and a mask has none; target pixels (channel pixels), or use dodge or burn on the mask.");
6794
6795
  if (tool === "smudge") return { kind: "dabs", create: (pixels) => new (0, _chunk7NW46N7Icjs.RetouchDabStroke)(brush, pixels, _chunk7NW46N7Icjs.smudgeEffect.call(void 0, brush, settings.strength)) };
6795
6796
  if (tool === "sponge") return { kind: "dabs", create: (pixels) => new (0, _chunk7NW46N7Icjs.RetouchDabStroke)(brush, pixels, _chunk7NW46N7Icjs.spongeEffect.call(void 0, brush, settings.spongeMode === "saturate", settings.vibrance)) };
6796
6797
  const retouchApply = {
@@ -6829,11 +6830,11 @@ var ImageEditorController = (_class10 = class {
6829
6830
  if (tool === "history") {
6830
6831
  const steps = settings.historySteps;
6831
6832
  const entry = steps > 0 ? _nullishCoalesce(this.undoStack[this.undoStack.length - steps], () => ( this.undoStack[0])) : this.undoStack[0];
6832
- if (!entry) throw new (0, _chunk3YDQLQH2cjs.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.");
6833
+ if (!entry) throw new (0, _chunk32MMQYCQcjs.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.");
6833
6834
  const then = _optionalChain([_chunkHGTDMKNEcjs.findLayer.call(void 0, entry.layers, target.id), 'optionalAccess', _245 => _245.layer]);
6834
- if (!then) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`Layer "${target.id}" did not exist ${steps > 0 ? `${steps} steps back` : "in the oldest state"}; choose fewer history steps (historySteps).`);
6835
+ if (!then) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`Layer "${target.id}" did not exist ${steps > 0 ? `${steps} steps back` : "in the oldest state"}; choose fewer history steps (historySteps).`);
6835
6836
  const surface = target.channel === "mask" ? _optionalChain([then, 'access', _246 => _246.mask, 'optionalAccess', _247 => _247.surface]) : then.type === "pixel" ? then.surface : void 0;
6836
- if (!surface) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`Layer "${target.id}" had no ${target.channel === "mask" ? "mask" : "pixels"} in that state.`);
6837
+ if (!surface) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`Layer "${target.id}" had no ${target.channel === "mask" ? "mask" : "pixels"} in that state.`);
6837
6838
  const offset2 = then.type === "pixel" ? then.offset : { x: 0, y: 0 };
6838
6839
  const depth = !mask && this.bitDepth !== 8 ? this.bitDepth : null;
6839
6840
  const source2 = depth ? new (0, _chunk7NW46N7Icjs.TilePixelSource)((tx, ty) => workTileOf(surface.tiles.get(_chunkCWM3CUUXcjs.tileKey.call(void 0, tx, ty))), 4, offset2) : this.surfaceSource(surface, offset2);
@@ -6878,7 +6879,7 @@ var ImageEditorController = (_class10 = class {
6878
6879
  }
6879
6880
  if (init.source) this.setCloneSource(init.source);
6880
6881
  const cs = this.state.paint.cloneSource;
6881
- if (!cs) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`The ${tool === "clone" ? "Clone Stamp" : "Healing Brush"} needs a source point; Alt-click the canvas, call set_clone_source, or pass source { x, y }.`);
6882
+ if (!cs) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`The ${tool === "clone" ? "Clone Stamp" : "Healing Brush"} needs a source point; Alt-click the canvas, call set_clone_source, or pass source { x, y }.`);
6882
6883
  let offset = { x: 0, y: 0 };
6883
6884
  let first = { x: 0, y: 0 };
6884
6885
  const xf = this.state.paint.cloneTransform;
@@ -6915,7 +6916,7 @@ var ImageEditorController = (_class10 = class {
6915
6916
  const sources = this.compositorSources();
6916
6917
  if (depth) {
6917
6918
  return new (0, _chunk7NW46N7Icjs.TilePixelSource)((tx, ty) => {
6918
- const w = _chunk3YDQLQH2cjs.compositeDeep.call(void 0, layers, { x: tx * _chunkCWM3CUUXcjs.TILE, y: ty * _chunkCWM3CUUXcjs.TILE, width: _chunkCWM3CUUXcjs.TILE, height: _chunkCWM3CUUXcjs.TILE }, sources, depth);
6919
+ const w = _chunk32MMQYCQcjs.compositeDeep.call(void 0, layers, { x: tx * _chunkCWM3CUUXcjs.TILE, y: ty * _chunkCWM3CUUXcjs.TILE, width: _chunkCWM3CUUXcjs.TILE, height: _chunkCWM3CUUXcjs.TILE }, sources, depth);
6919
6920
  for (let i = 0; i < w.length; i += 4) {
6920
6921
  if (depth === 32) for (let c = 0; c < 3; c++) w[i + c] = _chunkCWM3CUUXcjs.srgbEncode.call(void 0, w[i + c]);
6921
6922
  for (let c = 0; c < 4; c++) w[i + c] *= 255;
@@ -6923,7 +6924,7 @@ var ImageEditorController = (_class10 = class {
6923
6924
  return w;
6924
6925
  }, 4);
6925
6926
  }
6926
- const compositor = new (0, _chunk3YDQLQH2cjs.LayerCompositor)();
6927
+ const compositor = new (0, _chunk32MMQYCQcjs.LayerCompositor)();
6927
6928
  return new (0, _chunk7NW46N7Icjs.TilePixelSource)((tx, ty) => compositor.tile(layers, tx, ty, sources), 4);
6928
6929
  }
6929
6930
  /** A Mixer Brush stroke's start: the settings, and the load (refilled when asked or set to). */
@@ -6973,9 +6974,9 @@ var ImageEditorController = (_class10 = class {
6973
6974
  * document bounds and the number of dabs.
6974
6975
  */
6975
6976
  paintStroke(init) {
6976
- if (!Array.isArray(init.points) || !init.points.length) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("points must hold at least one { x, y } point.");
6977
+ if (!Array.isArray(init.points) || !init.points.length) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("points must hold at least one { x, y } point.");
6977
6978
  for (const p of init.points) {
6978
- if (!Number.isFinite(_optionalChain([p, 'optionalAccess', _252 => _252.x])) || !Number.isFinite(_optionalChain([p, 'optionalAccess', _253 => _253.y]))) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("Every point needs finite x and y (document pixels).");
6979
+ if (!Number.isFinite(_optionalChain([p, 'optionalAccess', _252 => _252.x])) || !Number.isFinite(_optionalChain([p, 'optionalAccess', _253 => _253.y]))) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("Every point needs finite x and y (document pixels).");
6979
6980
  }
6980
6981
  const session = this.beginStroke(init);
6981
6982
  session.push(init.points);
@@ -7001,8 +7002,8 @@ var ImageEditorController = (_class10 = class {
7001
7002
  const target = this.paintTarget(options.layerId, options.channel, mode === "paint" ? "fill" : "clear");
7002
7003
  const { width, height } = this.naturalSize;
7003
7004
  const opacity = _nullishCoalesce(options.opacity, () => ( 1));
7004
- if (!(opacity >= 0 && opacity <= 1)) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("opacity must be from 0 to 1.");
7005
- const blend = _nullishCoalesce(_chunk3YDQLQH2cjs.parseBlend.call(void 0, options.blend), () => ( "normal"));
7005
+ if (!(opacity >= 0 && opacity <= 1)) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("opacity must be from 0 to 1.");
7006
+ const blend = _nullishCoalesce(_chunk32MMQYCQcjs.parseBlend.call(void 0, options.blend), () => ( "normal"));
7006
7007
  const sel = options.useSelection !== false && _optionalChain([this, 'access', _254 => _254.state, 'access', _255 => _255.selection, 'optionalAccess', _256 => _256.bounds]) ? this.state.selection : null;
7007
7008
  const region = _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _257 => _257.bounds]), () => ( { x: 0, y: 0, width, height }));
7008
7009
  const coverage = new (0, _chunkEBDCRTZIcjs.CoverageMap)();
@@ -7038,7 +7039,7 @@ var ImageEditorController = (_class10 = class {
7038
7039
  // --- Adjustments ---
7039
7040
  /** The pixel layer the base sliders edit: the active pixel layer, else the Background. */
7040
7041
  developLayer() {
7041
- return _chunk3YDQLQH2cjs.developTarget.call(void 0, this.state.layers, this.state.activeLayerId);
7042
+ return _chunk32MMQYCQcjs.developTarget.call(void 0, this.state.layers, this.state.activeLayerId);
7042
7043
  }
7043
7044
  /**
7044
7045
  * Sets base adjustment values as one undo step (unless `commitToHistory` is false). The base
@@ -7064,7 +7065,7 @@ var ImageEditorController = (_class10 = class {
7064
7065
  this.state.outputOpacity = Math.min(1, Math.max(0, partial.opacity));
7065
7066
  }
7066
7067
  if ("layers" in partial) {
7067
- layers = this.replaceAdjustmentNodes(layers, _chunk3YDQLQH2cjs.normalizeAdjustmentLayers.call(void 0, partial.layers));
7068
+ layers = this.replaceAdjustmentNodes(layers, _chunk32MMQYCQcjs.normalizeAdjustmentLayers.call(void 0, partial.layers));
7068
7069
  }
7069
7070
  this.state.layers = layers;
7070
7071
  this.notify();
@@ -7072,7 +7073,7 @@ var ImageEditorController = (_class10 = class {
7072
7073
  /** True when the adjustments use an older rendering process than {@link LATEST_PROCESS_VERSION}. */
7073
7074
  get isProcessOutdated() {
7074
7075
  this.syncViews();
7075
- return _chunk3YDQLQH2cjs.normalizeProcessVersion.call(void 0, this.state.adjustments.process) < _chunk3YDQLQH2cjs.LATEST_PROCESS_VERSION;
7076
+ return _chunk32MMQYCQcjs.normalizeProcessVersion.call(void 0, this.state.adjustments.process) < _chunk32MMQYCQcjs.LATEST_PROCESS_VERSION;
7076
7077
  }
7077
7078
  /**
7078
7079
  * Update to Current Process: re-interprets the current adjustment values with the latest
@@ -7080,7 +7081,7 @@ var ImageEditorController = (_class10 = class {
7080
7081
  */
7081
7082
  upgradeProcess() {
7082
7083
  if (!this.isProcessOutdated) return false;
7083
- this.setAdjustments({ process: _chunk3YDQLQH2cjs.LATEST_PROCESS_VERSION });
7084
+ this.setAdjustments({ process: _chunk32MMQYCQcjs.LATEST_PROCESS_VERSION });
7084
7085
  return true;
7085
7086
  }
7086
7087
  /** Resets the base sliders (latest process). Adjustment layers are kept; see `clearAdjustmentLayers`. */
@@ -7091,7 +7092,7 @@ var ImageEditorController = (_class10 = class {
7091
7092
  this.state.layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0,
7092
7093
  this.state.layers,
7093
7094
  target.id,
7094
- (l) => withBlur(withDevelop(l, { ...DEFAULT_ADJUSTMENTS, process: _chunk3YDQLQH2cjs.LATEST_PROCESS_VERSION }), 0)
7095
+ (l) => withBlur(withDevelop(l, { ...DEFAULT_ADJUSTMENTS, process: _chunk32MMQYCQcjs.LATEST_PROCESS_VERSION }), 0)
7095
7096
  );
7096
7097
  }
7097
7098
  delete this.state.legacyOutputBlur;
@@ -7155,7 +7156,7 @@ var ImageEditorController = (_class10 = class {
7155
7156
  const existing = new Set(this.adjustmentNodes(out).map((n) => n.id));
7156
7157
  for (const l of next) {
7157
7158
  if (existing.has(l.id)) continue;
7158
- out = this.placeLayer(out, _chunk3YDQLQH2cjs.adjustmentNodeFromLegacy.call(void 0, l, width, height), { adjustmentIndex: Infinity });
7159
+ out = this.placeLayer(out, _chunk32MMQYCQcjs.adjustmentNodeFromLegacy.call(void 0, l, width, height), { adjustmentIndex: Infinity });
7159
7160
  }
7160
7161
  const order = next.map((l) => l.id);
7161
7162
  for (let to = 0; to < order.length; to++) out = this.moveAdjustmentNode(out, order[to], to);
@@ -7170,7 +7171,7 @@ var ImageEditorController = (_class10 = class {
7170
7171
  addAdjustmentLayer(init, index) {
7171
7172
  const spec = typeof init === "string" ? { kind: init } : init;
7172
7173
  const ids = new Set(_chunkHGTDMKNEcjs.flattenLayers.call(void 0, this.state.layers).map((l) => l.id));
7173
- const layer = _chunk3YDQLQH2cjs.createAdjustmentLayer.call(void 0, spec.kind, {
7174
+ const layer = _chunk32MMQYCQcjs.createAdjustmentLayer.call(void 0, spec.kind, {
7174
7175
  id: spec.id && !ids.has(spec.id) ? spec.id : void 0,
7175
7176
  name: spec.name,
7176
7177
  params: spec.params,
@@ -7179,10 +7180,10 @@ var ImageEditorController = (_class10 = class {
7179
7180
  blend: spec.blend,
7180
7181
  mask: _nullishCoalesce(spec.mask, () => ( void 0))
7181
7182
  });
7182
- while (ids.has(layer.id)) layer.id = _chunk3YDQLQH2cjs.newLayerId.call(void 0, "adj");
7183
+ while (ids.has(layer.id)) layer.id = _chunk32MMQYCQcjs.newLayerId.call(void 0, "adj");
7183
7184
  const { width, height } = this.naturalSize;
7184
7185
  this.recordHistory();
7185
- const node = _chunk3YDQLQH2cjs.adjustmentNodeFromLegacy.call(void 0, layer, width, height);
7186
+ const node = _chunk32MMQYCQcjs.adjustmentNodeFromLegacy.call(void 0, layer, width, height);
7186
7187
  const positioned = Boolean(spec.aboveId || spec.parentId);
7187
7188
  this.state.layers = this.placeLayer(this.state.layers, node, {
7188
7189
  aboveId: spec.aboveId,
@@ -7202,7 +7203,7 @@ var ImageEditorController = (_class10 = class {
7202
7203
  if (!loc || loc.layer.type !== "adjustment") return false;
7203
7204
  const { width, height } = this.naturalSize;
7204
7205
  const node = loc.layer;
7205
- const merged = _chunk3YDQLQH2cjs.normalizeAdjustmentLayer.call(void 0, {
7206
+ const merged = _chunk32MMQYCQcjs.normalizeAdjustmentLayer.call(void 0, {
7206
7207
  id: node.id,
7207
7208
  kind: node.kind,
7208
7209
  enabled: _nullishCoalesce(update.enabled, () => ( node.visible)),
@@ -7222,7 +7223,7 @@ var ImageEditorController = (_class10 = class {
7222
7223
  params: merged.params
7223
7224
  };
7224
7225
  if (update.mask !== void 0) {
7225
- const mask = update.mask ? _chunk3YDQLQH2cjs.rasterMaskFromLegacy.call(void 0, update.mask, width, height) : null;
7226
+ const mask = update.mask ? _chunk32MMQYCQcjs.rasterMaskFromLegacy.call(void 0, update.mask, width, height) : null;
7226
7227
  if (mask) next.mask = mask;
7227
7228
  else delete next.mask;
7228
7229
  }
@@ -7238,7 +7239,7 @@ var ImageEditorController = (_class10 = class {
7238
7239
  const prev = this.state.layers;
7239
7240
  this.state.layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0, prev, id, () => null);
7240
7241
  if (this.state.activeLayerId === id) {
7241
- this.state.activeLayerId = _chunk3YDQLQH2cjs.activeLayerAfterRemoval.call(void 0, prev, this.state.layers, id);
7242
+ this.state.activeLayerId = _chunk32MMQYCQcjs.activeLayerAfterRemoval.call(void 0, prev, this.state.layers, id);
7242
7243
  this.state.activeTarget = "pixels";
7243
7244
  }
7244
7245
  this.notify();
@@ -7284,7 +7285,7 @@ var ImageEditorController = (_class10 = class {
7284
7285
  this.state.layers = layers;
7285
7286
  const active = this.state.activeLayerId;
7286
7287
  if (active && nodes.some((n) => n.id === active)) {
7287
- this.state.activeLayerId = _chunk3YDQLQH2cjs.activeLayerAfterRemoval.call(void 0, prev, layers, active);
7288
+ this.state.activeLayerId = _chunk32MMQYCQcjs.activeLayerAfterRemoval.call(void 0, prev, layers, active);
7288
7289
  this.state.activeTarget = "pixels";
7289
7290
  }
7290
7291
  this.notify();
@@ -7308,14 +7309,14 @@ var ImageEditorController = (_class10 = class {
7308
7309
  resizeCanvas(options) {
7309
7310
  const { width, height, anchor = "center" } = options;
7310
7311
  if (!Number.isFinite(width) || width < 1 || !Number.isFinite(height) || height < 1) {
7311
- throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("Canvas width and height must be numbers at least 1 pixel.");
7312
+ throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("Canvas width and height must be numbers at least 1 pixel.");
7312
7313
  }
7313
7314
  const targetWidth = Math.round(width);
7314
7315
  const targetHeight = Math.round(height);
7315
7316
  const prev = this.naturalSize;
7316
7317
  if (prev.width === targetWidth && prev.height === targetHeight) return;
7317
7318
  this.recordHistory();
7318
- const [fx, fy] = _chunk3YDQLQH2cjs.ANCHOR_FRACTION[anchor];
7319
+ const [fx, fy] = _chunk32MMQYCQcjs.ANCHOR_FRACTION[anchor];
7319
7320
  const dx = Math.round((targetWidth - prev.width) * fx);
7320
7321
  const dy = Math.round((targetHeight - prev.height) * fy);
7321
7322
  this.state.layers = this.state.layers.map((l) => {
@@ -7351,10 +7352,10 @@ var ImageEditorController = (_class10 = class {
7351
7352
  }
7352
7353
  }
7353
7354
  this.state.selection = normalizeSelection(
7354
- _chunk3YDQLQH2cjs.createSelectionMask.call(void 0, targetWidth, targetHeight, nextData)
7355
+ _chunk32MMQYCQcjs.createSelectionMask.call(void 0, targetWidth, targetHeight, nextData)
7355
7356
  );
7356
7357
  }
7357
- this.state.layers = this.state.layers.map((l) => _chunk3YDQLQH2cjs.translateLayer.call(void 0, l, dx, dy));
7358
+ this.state.layers = this.state.layers.map((l) => _chunk32MMQYCQcjs.translateLayer.call(void 0, l, dx, dy));
7358
7359
  this.docRevision++;
7359
7360
  this.notify();
7360
7361
  }
@@ -7379,8 +7380,8 @@ var ImageEditorController = (_class10 = class {
7379
7380
  const { width, height } = this.naturalSize;
7380
7381
  let next = null;
7381
7382
  if (mask) {
7382
- const sized = mask.width === width && mask.height === height ? mask : _chunk3YDQLQH2cjs.resizeSelection.call(void 0, mask, width, height);
7383
- next = _chunk3YDQLQH2cjs.combineSelections.call(void 0, this.state.selection, sized, mode);
7383
+ const sized = mask.width === width && mask.height === height ? mask : _chunk32MMQYCQcjs.resizeSelection.call(void 0, mask, width, height);
7384
+ next = _chunk32MMQYCQcjs.combineSelections.call(void 0, this.state.selection, sized, mode);
7384
7385
  } else if (mode !== "replace") {
7385
7386
  return false;
7386
7387
  }
@@ -7394,7 +7395,7 @@ var ImageEditorController = (_class10 = class {
7394
7395
  /** Select › All. */
7395
7396
  selectAll() {
7396
7397
  const { width, height } = this.naturalSize;
7397
- return this.setSelection(_chunk3YDQLQH2cjs.fullSelection.call(void 0, width, height));
7398
+ return this.setSelection(_chunk32MMQYCQcjs.fullSelection.call(void 0, width, height));
7398
7399
  }
7399
7400
  /** Select › Deselect. */
7400
7401
  deselect() {
@@ -7403,11 +7404,11 @@ var ImageEditorController = (_class10 = class {
7403
7404
  /** Select › Inverse (with nothing selected, selects everything). */
7404
7405
  invertSelection() {
7405
7406
  const { width, height } = this.naturalSize;
7406
- const current = _nullishCoalesce(this.state.selection, () => ( _chunk3YDQLQH2cjs.createSelectionMask.call(void 0, width, height)));
7407
- return this.setSelection(_chunk3YDQLQH2cjs.invertSelection.call(void 0, current));
7407
+ const current = _nullishCoalesce(this.state.selection, () => ( _chunk32MMQYCQcjs.createSelectionMask.call(void 0, width, height)));
7408
+ return this.setSelection(_chunk32MMQYCQcjs.invertSelection.call(void 0, current));
7408
7409
  }
7409
7410
  shapeCommand(mask, options) {
7410
- const shaped = options.feather && options.feather > 0 ? _chunk3YDQLQH2cjs.modifySelection.call(void 0, mask, "feather", options.feather) : mask;
7411
+ const shaped = options.feather && options.feather > 0 ? _chunk32MMQYCQcjs.modifySelection.call(void 0, mask, "feather", options.feather) : mask;
7411
7412
  return this.setSelection(shaped, _nullishCoalesce(options.mode, () => ( "replace")));
7412
7413
  }
7413
7414
  /** Rectangular marquee in natural image pixels. */
@@ -7461,11 +7462,11 @@ var ImageEditorController = (_class10 = class {
7461
7462
  if (!this.samplePixelsOverride && !options.pixels) this.samplePixels = null;
7462
7463
  return null;
7463
7464
  }
7464
- const legacy = _chunk3YDQLQH2cjs.legacyView.call(void 0, this.stack(), width, height, null).exact;
7465
+ const legacy = _chunk32MMQYCQcjs.legacyView.call(void 0, this.stack(), width, height, null).exact;
7465
7466
  if (options.sample === "active-layer") {
7466
7467
  const layer = this.getActiveLayer();
7467
7468
  if (!layer || layer.type !== "pixel") {
7468
- throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("Sampling the active layer needs an active pixel layer; select one, or sample the composite.");
7469
+ throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("Sampling the active layer needs an active pixel layer; select one, or sample the composite.");
7469
7470
  }
7470
7471
  const surface = layer.source === "document" && options.pixels ? _chunkCWM3CUUXcjs.surfaceFromPixels.call(void 0, options.pixels, 4) : this.surfaceOf(layer);
7471
7472
  return { width, height, data: _chunkCWM3CUUXcjs.readRegion.call(void 0, surface, { x: -layer.offset.x, y: -layer.offset.y, width, height }) };
@@ -7474,7 +7475,7 @@ var ImageEditorController = (_class10 = class {
7474
7475
  this.syncViews();
7475
7476
  if (legacy && !options.pixels) {
7476
7477
  const copy = { width: base.width, height: base.height, data: new Uint8ClampedArray(base.data) };
7477
- _chunk3YDQLQH2cjs.applyAdjustments.call(void 0, copy, _chunk3YDQLQH2cjs.legacyView.call(void 0, this.stack(), width, height, null).adjustments);
7478
+ _chunk32MMQYCQcjs.applyAdjustments.call(void 0, copy, _chunk32MMQYCQcjs.legacyView.call(void 0, this.stack(), width, height, null).adjustments);
7478
7479
  return copy;
7479
7480
  }
7480
7481
  const pixels = options.pixels;
@@ -7486,7 +7487,7 @@ var ImageEditorController = (_class10 = class {
7486
7487
  };
7487
7488
  const stack = withoutAnnotations(this.state.layers);
7488
7489
  const layers = options.sampleMerged ? stack : pixelsOnly(stack);
7489
- const data = new (0, _chunk3YDQLQH2cjs.LayerCompositor)().composite(layers, { x: 0, y: 0, width, height }, sources);
7490
+ const data = new (0, _chunk32MMQYCQcjs.LayerCompositor)().composite(layers, { x: 0, y: 0, width, height }, sources);
7490
7491
  return { width, height, data };
7491
7492
  }
7492
7493
  async requirePixels(options) {
@@ -7513,7 +7514,7 @@ var ImageEditorController = (_class10 = class {
7513
7514
  modifySelection(op, radius) {
7514
7515
  const sel = this.state.selection;
7515
7516
  if (!_optionalChain([sel, 'optionalAccess', _271 => _271.bounds])) return false;
7516
- return this.setSelection(_chunk3YDQLQH2cjs.modifySelection.call(void 0, sel, op, radius));
7517
+ return this.setSelection(_chunk32MMQYCQcjs.modifySelection.call(void 0, sel, op, radius));
7517
7518
  }
7518
7519
  /**
7519
7520
  * Refine Edge: snaps the selection (e.g. a coarse AI mask loaded with `loadSelectionFromImage`)
@@ -7544,7 +7545,7 @@ var ImageEditorController = (_class10 = class {
7544
7545
  } else {
7545
7546
  pixels = source;
7546
7547
  }
7547
- this.setSelection(_chunk3YDQLQH2cjs.selectionFromPixels.call(void 0, pixels, options), _nullishCoalesce(options.mode, () => ( "replace")));
7548
+ this.setSelection(_chunk32MMQYCQcjs.selectionFromPixels.call(void 0, pixels, options), _nullishCoalesce(options.mode, () => ( "replace")));
7548
7549
  return this.getSelection();
7549
7550
  }
7550
7551
  /** Quick Mask view (tints the unselected area). View state: no undo step. */
@@ -7556,7 +7557,7 @@ var ImageEditorController = (_class10 = class {
7556
7557
  // --- Layer masks ---
7557
7558
  maskFromSelection(sel, props = {}) {
7558
7559
  const { width, height } = this.naturalSize;
7559
- const sized = sel.width === width && sel.height === height ? sel : _chunk3YDQLQH2cjs.resizeSelection.call(void 0, sel, width, height);
7560
+ const sized = sel.width === width && sel.height === height ? sel : _chunk32MMQYCQcjs.resizeSelection.call(void 0, sel, width, height);
7560
7561
  const mask = { surface: _chunkCWM3CUUXcjs.surfaceFromPixels.call(void 0, { width, height, data: sized.data }, 1, 0, 0, 0), defaultValue: 0 };
7561
7562
  return withMaskProps(mask, props);
7562
7563
  }
@@ -7602,7 +7603,7 @@ var ImageEditorController = (_class10 = class {
7602
7603
  const ox = layer.type === "pixel" ? layer.offset.x : 0;
7603
7604
  const oy = layer.type === "pixel" ? layer.offset.y : 0;
7604
7605
  const data = _chunkCWM3CUUXcjs.readRegion.call(void 0, layer.mask.surface, { x: -ox, y: -oy, width, height });
7605
- const sel = _chunk3YDQLQH2cjs.createSelectionMask.call(void 0, width, height, new Uint8Array(data.buffer, data.byteOffset, data.length));
7606
+ const sel = _chunk32MMQYCQcjs.createSelectionMask.call(void 0, width, height, new Uint8Array(data.buffer, data.byteOffset, data.length));
7606
7607
  return this.setSelection(sel, mode);
7607
7608
  }
7608
7609
  // --- Histogram ---
@@ -7632,9 +7633,9 @@ var ImageEditorController = (_class10 = class {
7632
7633
  merged.depthRange = [...merged.depthRange];
7633
7634
  this.state.layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0, this.state.layers, target.id, (l) => {
7634
7635
  const next = { ...l };
7635
- if (_chunk3YDQLQH2cjs.isDefaultDepthMask.call(void 0, merged)) {
7636
+ if (_chunk32MMQYCQcjs.isDefaultDepthMask.call(void 0, merged)) {
7636
7637
  if (_optionalChain([next, 'access', _277 => _277.mask, 'optionalAccess', _278 => _278.source])) delete next.mask;
7637
- } else next.mask = _chunk3YDQLQH2cjs.depthRasterMask.call(void 0, merged);
7638
+ } else next.mask = _chunk32MMQYCQcjs.depthRasterMask.call(void 0, merged);
7638
7639
  return next;
7639
7640
  });
7640
7641
  }
@@ -7655,7 +7656,7 @@ var ImageEditorController = (_class10 = class {
7655
7656
  // --- Annotations & Layers ---
7656
7657
  /** The layer showing annotation `id`: an annotation layer, or a shape layer migrated from it. */
7657
7658
  annotationLayer(id) {
7658
- return _chunkHGTDMKNEcjs.flattenLayers.call(void 0, this.state.layers).find((l) => (l.type === "annotation" || l.type === "shape" || l.type === "type") && _optionalChain([_chunk3YDQLQH2cjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _281 => _281.id]) === id);
7659
+ return _chunkHGTDMKNEcjs.flattenLayers.call(void 0, this.state.layers).find((l) => (l.type === "annotation" || l.type === "shape" || l.type === "type") && _optionalChain([_chunk32MMQYCQcjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _281 => _281.id]) === id);
7659
7660
  }
7660
7661
  /** What migrating an annotation needs: the canvas size, patterns and the text shaper. */
7661
7662
  annotationEnv() {
@@ -7671,7 +7672,7 @@ var ImageEditorController = (_class10 = class {
7671
7672
  this.recordHistory();
7672
7673
  const id = `ann_${Date.now()}_${Math.random().toString(36).slice(2, 7)}`;
7673
7674
  const fullAnnotation = { ...annotation, id };
7674
- const layer = _chunk3YDQLQH2cjs.annotationLayerFor.call(void 0, fullAnnotation, this.annotationEnv());
7675
+ const layer = _chunk32MMQYCQcjs.annotationLayerFor.call(void 0, fullAnnotation, this.annotationEnv());
7675
7676
  const loc = placement.aboveId ? _chunkHGTDMKNEcjs.findLayer.call(void 0, this.state.layers, placement.aboveId) : null;
7676
7677
  this.state.layers = loc ? _chunkHGTDMKNEcjs.insertLayer.call(void 0, this.state.layers, layer, _nullishCoalesce(_optionalChain([loc, 'access', _282 => _282.parent, 'optionalAccess', _283 => _283.id]), () => ( null)), loc.index + 1) : _chunkHGTDMKNEcjs.insertLayer.call(void 0, this.state.layers, layer, null);
7677
7678
  this.state.selectedAnnotationId = id;
@@ -7683,17 +7684,17 @@ var ImageEditorController = (_class10 = class {
7683
7684
  this.recordHistory();
7684
7685
  }
7685
7686
  const layer = this.annotationLayer(id);
7686
- const current = layer ? _chunk3YDQLQH2cjs.annotationOfLayer.call(void 0, layer) : null;
7687
+ const current = layer ? _chunk32MMQYCQcjs.annotationOfLayer.call(void 0, layer) : null;
7687
7688
  if (layer && current) {
7688
7689
  const annotation = { ...current, ...partial, id };
7689
- const name = layer.name === _chunk3YDQLQH2cjs.annotationLayerName.call(void 0, current) ? _chunk3YDQLQH2cjs.annotationLayerName.call(void 0, annotation) : layer.name;
7690
+ const name = layer.name === _chunk32MMQYCQcjs.annotationLayerName.call(void 0, current) ? _chunk32MMQYCQcjs.annotationLayerName.call(void 0, annotation) : layer.name;
7690
7691
  this.state.layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0, this.state.layers, layer.id, () => this.layerForAnnotation(layer, annotation, name));
7691
7692
  }
7692
7693
  this.notify();
7693
7694
  }
7694
7695
  /** `layer` (an annotation, or a shape or type layer migrated from one) showing `annotation` instead, keeping its other properties. */
7695
7696
  layerForAnnotation(layer, annotation, name) {
7696
- const fresh = _chunk3YDQLQH2cjs.annotationLayerFor.call(void 0, annotation, this.annotationEnv());
7697
+ const fresh = _chunk32MMQYCQcjs.annotationLayerFor.call(void 0, annotation, this.annotationEnv());
7697
7698
  const keep = { id: layer.id, visible: layer.visible, opacity: layer.opacity };
7698
7699
  for (const k of ["clipped", "mask", "locks", "effects"]) if (layer[k] !== void 0) keep[k] = layer[k];
7699
7700
  if (fresh.type !== "annotation" && layer.type !== "annotation" && layer.fillOpacity !== void 0) keep.fillOpacity = layer.fillOpacity;
@@ -7980,8 +7981,8 @@ var ImageEditorController = (_class10 = class {
7980
7981
  return;
7981
7982
  }
7982
7983
  const target = this.developLayer();
7983
- if (!target) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("There is no pixel layer to mask.");
7984
- _chunk3YDQLQH2cjs.requireUnlocked.call(void 0, target, "all", "mask it");
7984
+ if (!target) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("There is no pixel layer to mask.");
7985
+ _chunk32MMQYCQcjs.requireUnlocked.call(void 0, target, "all", "mask it");
7985
7986
  const { width, height } = this.naturalSize;
7986
7987
  let px2 = await this.decodeImage(newDataUrl);
7987
7988
  if (px2.width !== width || px2.height !== height) px2 = resizePixels(px2, width, height);
@@ -7989,14 +7990,14 @@ var ImageEditorController = (_class10 = class {
7989
7990
  for (let p = 0; p < alpha.length; p++) alpha[p] = px2.data[p * 4 + 3];
7990
7991
  let surface = _chunkCWM3CUUXcjs.surfaceFromPixels.call(void 0, { width, height, data: alpha }, 1, 0, 0, 0);
7991
7992
  if (target.offset.x || target.offset.y) surface = _chunkCWM3CUUXcjs.translateSurface.call(void 0, surface, -target.offset.x, -target.offset.y);
7992
- this.commitLayers(_chunk3YDQLQH2cjs.setLayerMask.call(void 0, this.state.layers, target.id, { surface, defaultValue: 0 }));
7993
+ this.commitLayers(_chunk32MMQYCQcjs.setLayerMask.call(void 0, this.state.layers, target.id, { surface, defaultValue: 0 }));
7993
7994
  return target.id;
7994
7995
  }
7995
7996
  // --- Type layers ---
7996
7997
 
7997
7998
  /** The shaper that lays out and draws type layers (`null` when there is none here). */
7998
7999
  getTextShaper() {
7999
- if (this.textShaperValue === void 0) this.textShaperValue = _chunkQMI5HZWAcjs.createCanvasTextShaper.call(void 0, { createCanvas: (w, h) => this.renderer.createCanvas(w, h) });
8000
+ if (this.textShaperValue === void 0) this.textShaperValue = _chunk236TKNURcjs.createCanvasTextShaper.call(void 0, { createCanvas: (w, h) => this.renderer.createCanvas(w, h) });
8000
8001
  return this.textShaperValue;
8001
8002
  }
8002
8003
  /** Sets the text shaper (fonts) type layers lay out and draw with; existing layers redraw on their next edit. */
@@ -8013,7 +8014,7 @@ var ImageEditorController = (_class10 = class {
8013
8014
  return _nullishCoalesce(_optionalChain([this, 'access', _290 => _290.getTextShaper, 'call', _291 => _291(), 'optionalAccess', _292 => _292.families, 'optionalCall', _293 => _293()]), () => ( ["sans-serif", "serif", "monospace"]));
8014
8015
  }
8015
8016
  typeInfo(id) {
8016
- const layer = _chunk3YDQLQH2cjs.requireTypeLayer.call(void 0, this.state.layers, id);
8017
+ const layer = _chunk32MMQYCQcjs.requireTypeLayer.call(void 0, this.state.layers, id);
8017
8018
  const ranges = (runs) => {
8018
8019
  let at = 0;
8019
8020
  return runs.map((r) => {
@@ -8026,7 +8027,7 @@ var ImageEditorController = (_class10 = class {
8026
8027
  let lines = [];
8027
8028
  let missing = _nullishCoalesce(layer.missingFonts, () => ( []));
8028
8029
  if (shaper) {
8029
- const layout = _chunkQMI5HZWAcjs.layoutText.call(void 0, layer, shaper);
8030
+ const layout = _chunk236TKNURcjs.layoutText.call(void 0, layer, shaper);
8030
8031
  const r = (n) => Math.round(n * 1e3) / 1e3;
8031
8032
  lines = layout.lines.map((l) => ({ start: l.start, end: l.end, baseline: r(l.baseline), width: r(l.width) }));
8032
8033
  if (layer.rendering === "stored") missing = layout.missingFonts;
@@ -8056,25 +8057,25 @@ var ImageEditorController = (_class10 = class {
8056
8057
  * text wrapped in `box`. Refused without a text shaper. Returns its id.
8057
8058
  */
8058
8059
  addTextLayer(init) {
8059
- const text = _chunk3YDQLQH2cjs.normalizeText.call(void 0, init.text);
8060
- if (!Number.isFinite(init.x) || !Number.isFinite(init.y)) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("x and y must be numbers (document pixels).");
8061
- const style = _chunk3YDQLQH2cjs.patchTextStyle.call(void 0, { ..._chunkQMI5HZWAcjs.DEFAULT_TEXT_STYLE, color: this.state.paint.foreground }, _nullishCoalesce(init.style, () => ( {})));
8062
- const paragraph = _chunk3YDQLQH2cjs.patchParagraphStyle.call(void 0, {}, _nullishCoalesce(init.paragraph, () => ( {})));
8060
+ const text = _chunk32MMQYCQcjs.normalizeText.call(void 0, init.text);
8061
+ if (!Number.isFinite(init.x) || !Number.isFinite(init.y)) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("x and y must be numbers (document pixels).");
8062
+ const style = _chunk32MMQYCQcjs.patchTextStyle.call(void 0, { ..._chunk236TKNURcjs.DEFAULT_TEXT_STYLE, color: this.state.paint.foreground }, _nullishCoalesce(init.style, () => ( {})));
8063
+ const paragraph = _chunk32MMQYCQcjs.patchParagraphStyle.call(void 0, {}, _nullishCoalesce(init.paragraph, () => ( {})));
8063
8064
  let frame = { kind: "point" };
8064
8065
  if (init.box) {
8065
8066
  const { width, height } = init.box;
8066
- if (!(Number.isFinite(width) && width >= 1 && Number.isFinite(height) && height >= 1)) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("box.width and box.height must be at least 1 pixel.");
8067
+ if (!(Number.isFinite(width) && width >= 1 && Number.isFinite(height) && height >= 1)) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("box.width and box.height must be at least 1 pixel.");
8067
8068
  frame = { kind: "box", width, height };
8068
8069
  }
8069
- if (init.rotation !== void 0 && !Number.isFinite(init.rotation)) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("rotation must be a number of degrees.");
8070
- if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("opacity must be between 0 and 1.");
8071
- if (init.blend !== void 0 && !_chunkCWM3CUUXcjs.isBlendMode.call(void 0, init.blend)) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`Unknown blend mode "${String(init.blend)}".`);
8070
+ if (init.rotation !== void 0 && !Number.isFinite(init.rotation)) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("rotation must be a number of degrees.");
8071
+ if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("opacity must be between 0 and 1.");
8072
+ if (init.blend !== void 0 && !_chunkCWM3CUUXcjs.isBlendMode.call(void 0, init.blend)) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`Unknown blend mode "${String(init.blend)}".`);
8072
8073
  const t = [1, 0, 0, 1, init.x, init.y];
8073
- const transform = init.rotation ? _chunkQMI5HZWAcjs.multiplyMatrices.call(void 0, t, _chunkQMI5HZWAcjs.rotateMatrix.call(void 0, init.rotation, { x: init.x, y: init.y })) : t;
8074
- const layer = _chunk3YDQLQH2cjs.createTypeLayer.call(void 0, { text, runs: [{ length: text.length, style }], paragraphs: [{ length: text.length, style: paragraph }], frame, transform, name: _nullishCoalesce(init.name, () => ( _chunk3YDQLQH2cjs.typeLayerName.call(void 0, text))) }, this.textEnv());
8074
+ const transform = init.rotation ? _chunk236TKNURcjs.multiplyMatrices.call(void 0, t, _chunk236TKNURcjs.rotateMatrix.call(void 0, init.rotation, { x: init.x, y: init.y })) : t;
8075
+ const layer = _chunk32MMQYCQcjs.createTypeLayer.call(void 0, { text, runs: [{ length: text.length, style }], paragraphs: [{ length: text.length, style: paragraph }], frame, transform, name: _nullishCoalesce(init.name, () => ( _chunk32MMQYCQcjs.typeLayerName.call(void 0, text))) }, this.textEnv());
8075
8076
  if (init.opacity !== void 0) layer.opacity = init.opacity;
8076
8077
  if (init.blend !== void 0) layer.blend = init.blend;
8077
- const next = _chunk3YDQLQH2cjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
8078
+ const next = _chunk32MMQYCQcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
8078
8079
  this.commitLayers(next, () => {
8079
8080
  this.state.activeLayerId = layer.id;
8080
8081
  this.state.activeTarget = "pixels";
@@ -8086,28 +8087,28 @@ var ImageEditorController = (_class10 = class {
8086
8087
  * `start`. One undo step unless `commitToHistory` is false (typing). Returns the layer.
8087
8088
  */
8088
8089
  setText(id, text, range = {}, commitToHistory = true) {
8089
- const layer = _chunk3YDQLQH2cjs.requireTypeLayer.call(void 0, this.state.layers, id);
8090
- const insert = _chunk3YDQLQH2cjs.normalizeText.call(void 0, text);
8091
- const [start, end] = _chunk3YDQLQH2cjs.textRange.call(void 0, layer.text, range.start, range.end);
8092
- const { layers } = _chunk3YDQLQH2cjs.updateTypeLayer.call(void 0, this.state.layers, id, (l) => _chunk3YDQLQH2cjs.replaceTextRange.call(void 0, l, start, end, insert), this.textEnv(), "edit its text");
8090
+ const layer = _chunk32MMQYCQcjs.requireTypeLayer.call(void 0, this.state.layers, id);
8091
+ const insert = _chunk32MMQYCQcjs.normalizeText.call(void 0, text);
8092
+ const [start, end] = _chunk32MMQYCQcjs.textRange.call(void 0, layer.text, range.start, range.end);
8093
+ const { layers } = _chunk32MMQYCQcjs.updateTypeLayer.call(void 0, this.state.layers, id, (l) => _chunk32MMQYCQcjs.replaceTextRange.call(void 0, l, start, end, insert), this.textEnv(), "edit its text");
8093
8094
  this.commitLayers(layers, void 0, commitToHistory);
8094
8095
  return this.typeInfo(id);
8095
8096
  }
8096
8097
  /** Sets character style fields over [start, end) (default all), one undo step. Returns the layer. */
8097
8098
  setTextStyle(id, style, range = {}, commitToHistory = true) {
8098
- const layer = _chunk3YDQLQH2cjs.requireTypeLayer.call(void 0, this.state.layers, id);
8099
- const [start, end] = _chunk3YDQLQH2cjs.textRange.call(void 0, layer.text, range.start, range.end);
8100
- if (!Object.keys(style).length) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("Give at least one style field to set.");
8101
- _chunk3YDQLQH2cjs.patchTextStyle.call(void 0, _chunkQMI5HZWAcjs.DEFAULT_TEXT_STYLE, style);
8102
- const { layers } = _chunk3YDQLQH2cjs.updateTypeLayer.call(void 0,
8099
+ const layer = _chunk32MMQYCQcjs.requireTypeLayer.call(void 0, this.state.layers, id);
8100
+ const [start, end] = _chunk32MMQYCQcjs.textRange.call(void 0, layer.text, range.start, range.end);
8101
+ if (!Object.keys(style).length) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("Give at least one style field to set.");
8102
+ _chunk32MMQYCQcjs.patchTextStyle.call(void 0, _chunk236TKNURcjs.DEFAULT_TEXT_STYLE, style);
8103
+ const { layers } = _chunk32MMQYCQcjs.updateTypeLayer.call(void 0,
8103
8104
  this.state.layers,
8104
8105
  id,
8105
8106
  (l) => {
8106
8107
  if (start === end) {
8107
- if (l.text.length) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("The range is empty; give start < end (or leave both out for the whole text).");
8108
- return { runs: [{ length: 0, style: _chunk3YDQLQH2cjs.patchTextStyle.call(void 0, _chunkQMI5HZWAcjs.styleAt.call(void 0, l.runs, 0, _chunkQMI5HZWAcjs.DEFAULT_TEXT_STYLE), style) }] };
8108
+ if (l.text.length) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("The range is empty; give start < end (or leave both out for the whole text).");
8109
+ return { runs: [{ length: 0, style: _chunk32MMQYCQcjs.patchTextStyle.call(void 0, _chunk236TKNURcjs.styleAt.call(void 0, l.runs, 0, _chunk236TKNURcjs.DEFAULT_TEXT_STYLE), style) }] };
8109
8110
  }
8110
- return { runs: _chunkQMI5HZWAcjs.restyleRange.call(void 0, l.runs, start, end, (s) => _chunk3YDQLQH2cjs.patchTextStyle.call(void 0, s, style)) };
8111
+ return { runs: _chunk236TKNURcjs.restyleRange.call(void 0, l.runs, start, end, (s) => _chunk32MMQYCQcjs.patchTextStyle.call(void 0, s, style)) };
8111
8112
  },
8112
8113
  this.textEnv(),
8113
8114
  "restyle its text"
@@ -8117,11 +8118,11 @@ var ImageEditorController = (_class10 = class {
8117
8118
  }
8118
8119
  /** Sets paragraph style fields on every paragraph that [start, end) touches (default all), one undo step. */
8119
8120
  setParagraphStyle(id, style, range = {}, commitToHistory = true) {
8120
- const layer = _chunk3YDQLQH2cjs.requireTypeLayer.call(void 0, this.state.layers, id);
8121
- const [start, end] = _chunk3YDQLQH2cjs.textRange.call(void 0, layer.text, range.start, range.end);
8122
- if (!Object.keys(style).length) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("Give at least one paragraph field to set.");
8123
- _chunk3YDQLQH2cjs.patchParagraphStyle.call(void 0, {}, style);
8124
- const { layers } = _chunk3YDQLQH2cjs.updateTypeLayer.call(void 0,
8121
+ const layer = _chunk32MMQYCQcjs.requireTypeLayer.call(void 0, this.state.layers, id);
8122
+ const [start, end] = _chunk32MMQYCQcjs.textRange.call(void 0, layer.text, range.start, range.end);
8123
+ if (!Object.keys(style).length) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("Give at least one paragraph field to set.");
8124
+ _chunk32MMQYCQcjs.patchParagraphStyle.call(void 0, {}, style);
8125
+ const { layers } = _chunk32MMQYCQcjs.updateTypeLayer.call(void 0,
8125
8126
  this.state.layers,
8126
8127
  id,
8127
8128
  (l) => {
@@ -8130,7 +8131,7 @@ var ImageEditorController = (_class10 = class {
8130
8131
  const a = at;
8131
8132
  at += p.length;
8132
8133
  const touches = a < end && at > start || start === end && start >= a && (start < at || at === l.text.length);
8133
- return touches || !l.text.length ? { length: p.length, style: _chunk3YDQLQH2cjs.patchParagraphStyle.call(void 0, p.style, style) } : p;
8134
+ return touches || !l.text.length ? { length: p.length, style: _chunk32MMQYCQcjs.patchParagraphStyle.call(void 0, p.style, style) } : p;
8134
8135
  });
8135
8136
  return { paragraphs };
8136
8137
  },
@@ -8146,21 +8147,21 @@ var ImageEditorController = (_class10 = class {
8146
8147
  * paragraph. Also resizes a box. One undo step.
8147
8148
  */
8148
8149
  setTextFrame(id, frame, commitToHistory = true) {
8149
- const layer = _chunk3YDQLQH2cjs.requireTypeLayer.call(void 0, this.state.layers, id);
8150
- if (frame.kind === "box" && !(Number.isFinite(frame.width) && frame.width >= 1 && Number.isFinite(frame.height) && frame.height >= 1)) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("width and height must be at least 1 pixel.");
8151
- if (frame.kind !== "box" && frame.kind !== "point") throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("kind must be point or box.");
8150
+ const layer = _chunk32MMQYCQcjs.requireTypeLayer.call(void 0, this.state.layers, id);
8151
+ if (frame.kind === "box" && !(Number.isFinite(frame.width) && frame.width >= 1 && Number.isFinite(frame.height) && frame.height >= 1)) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("width and height must be at least 1 pixel.");
8152
+ if (frame.kind !== "box" && frame.kind !== "point") throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("kind must be point or box.");
8152
8153
  const shaper = this.getTextShaper();
8153
- const { layers } = _chunk3YDQLQH2cjs.updateTypeLayer.call(void 0,
8154
+ const { layers } = _chunk32MMQYCQcjs.updateTypeLayer.call(void 0,
8154
8155
  this.state.layers,
8155
8156
  id,
8156
8157
  (l) => {
8157
8158
  if (frame.kind === "box" && l.frame.kind === "box") return { frame: { kind: "box", width: frame.width, height: frame.height } };
8158
- if (!shaper) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("Changing between point and paragraph text needs a text shaper to measure the text.");
8159
- const lines = _chunkQMI5HZWAcjs.layoutText.call(void 0, l, shaper).lines;
8159
+ if (!shaper) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("Changing between point and paragraph text needs a text shaper to measure the text.");
8160
+ const lines = _chunk236TKNURcjs.layoutText.call(void 0, l, shaper).lines;
8160
8161
  const first = lines[0];
8161
8162
  const dx = frame.kind === "box" ? first ? first.x : 0 : 0;
8162
8163
  const dy = frame.kind === "box" ? first ? first.baseline - first.ascent : 0 : first ? first.baseline : 0;
8163
- const m = _chunk3YDQLQH2cjs.textMatrix.call(void 0, l);
8164
+ const m = _chunk32MMQYCQcjs.textMatrix.call(void 0, l);
8164
8165
  const shifted = [m[0], m[1], m[2], m[3], m[0] * dx + m[2] * dy + m[4], m[1] * dx + m[3] * dy + m[5]];
8165
8166
  const nextFrame = frame.kind === "box" ? { kind: "box", width: frame.width, height: frame.height } : { kind: "point" };
8166
8167
  return { frame: nextFrame, transform: shifted };
@@ -8177,21 +8178,21 @@ var ImageEditorController = (_class10 = class {
8177
8178
  * `warnings` says when other colours were dropped. One undo step.
8178
8179
  */
8179
8180
  convertTextToShape(id) {
8180
- const layer = _chunk3YDQLQH2cjs.requireTypeLayer.call(void 0, this.state.layers, id);
8181
- _chunk3YDQLQH2cjs.requireUnlocked.call(void 0, layer, "all", "convert it");
8181
+ const layer = _chunk32MMQYCQcjs.requireTypeLayer.call(void 0, this.state.layers, id);
8182
+ _chunk32MMQYCQcjs.requireUnlocked.call(void 0, layer, "all", "convert it");
8182
8183
  const shaper = this.getTextShaper();
8183
- if (!shaper) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("Convert to Shape needs a text shaper that gives glyph outlines; none is set here.");
8184
- const parts = _chunk3YDQLQH2cjs.textOutlines.call(void 0, layer, shaper);
8185
- const subpaths = parts.flatMap((p) => _chunkQMI5HZWAcjs.bezierToSubpaths.call(void 0, p.path));
8186
- if (!subpaths.length) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("The text draws nothing (it is empty or only spaces), so there is no shape to make.");
8184
+ if (!shaper) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("Convert to Shape needs a text shaper that gives glyph outlines; none is set here.");
8185
+ const parts = _chunk32MMQYCQcjs.textOutlines.call(void 0, layer, shaper);
8186
+ const subpaths = parts.flatMap((p) => _chunk236TKNURcjs.bezierToSubpaths.call(void 0, p.path));
8187
+ if (!subpaths.length) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("The text draws nothing (it is empty or only spaces), so there is no shape to make.");
8187
8188
  const warnings = [];
8188
8189
  const colors = new Set(layer.runs.filter((r) => r.length > 0).map((r) => `${r.style.color}/${_nullishCoalesce(r.style.opacity, () => ( 1))}`));
8189
8190
  if (colors.size > 1) warnings.push("The text had several colours; the shape takes the first one.");
8190
- const missing = _chunkQMI5HZWAcjs.layoutText.call(void 0, layer, shaper).missingFonts;
8191
+ const missing = _chunk236TKNURcjs.layoutText.call(void 0, layer, shaper).missingFonts;
8191
8192
  if (missing.length) warnings.push(`Missing fonts were drawn with a fallback: ${missing.join(", ")}.`);
8192
- const first = _nullishCoalesce(_optionalChain([layer, 'access', _294 => _294.runs, 'access', _295 => _295.find, 'call', _296 => _296((r) => r.length > 0), 'optionalAccess', _297 => _297.style]), () => ( _chunkQMI5HZWAcjs.DEFAULT_TEXT_STYLE));
8193
+ const first = _nullishCoalesce(_optionalChain([layer, 'access', _294 => _294.runs, 'access', _295 => _295.find, 'call', _296 => _296((r) => r.length > 0), 'optionalAccess', _297 => _297.style]), () => ( _chunk236TKNURcjs.DEFAULT_TEXT_STYLE));
8193
8194
  const fill = first.opacity !== void 0 && first.opacity !== 1 ? { type: "color", color: first.color, opacity: first.opacity } : { type: "color", color: first.color };
8194
- const shape = _chunk3YDQLQH2cjs.createShapeLayer.call(void 0, { components: [{ op: "combine", subpaths }], fill, stroke: null, name: layer.name }, this.shapeEnv(), layer.id);
8195
+ const shape = _chunk32MMQYCQcjs.createShapeLayer.call(void 0, { components: [{ op: "combine", subpaths }], fill, stroke: null, name: layer.name }, this.shapeEnv(), layer.id);
8195
8196
  const keep = { visible: layer.visible, opacity: layer.opacity, blend: layer.blend };
8196
8197
  for (const k of ["clipped", "mask", "locks", "effects", "fillOpacity"]) if (layer[k] !== void 0) keep[k] = layer[k];
8197
8198
  this.commitLayers(_chunkHGTDMKNEcjs.mapLayer.call(void 0, this.state.layers, id, () => ({ ...shape, ...keep })));
@@ -8199,23 +8200,23 @@ var ImageEditorController = (_class10 = class {
8199
8200
  }
8200
8201
  /** The layout of a type layer (lines, characters, bounds in text space), or `null` without a shaper. */
8201
8202
  getTextLayout(id) {
8202
- const layer = _chunk3YDQLQH2cjs.requireTypeLayer.call(void 0, this.state.layers, id);
8203
+ const layer = _chunk32MMQYCQcjs.requireTypeLayer.call(void 0, this.state.layers, id);
8203
8204
  const shaper = this.getTextShaper();
8204
- return shaper ? _chunkQMI5HZWAcjs.layoutText.call(void 0, layer, shaper) : null;
8205
+ return shaper ? _chunk236TKNURcjs.layoutText.call(void 0, layer, shaper) : null;
8205
8206
  }
8206
8207
  /** The text index nearest a document point (for clicks on a type layer). */
8207
8208
  textIndexAt(id, point) {
8208
- const layer = _chunk3YDQLQH2cjs.requireTypeLayer.call(void 0, this.state.layers, id);
8209
+ const layer = _chunk32MMQYCQcjs.requireTypeLayer.call(void 0, this.state.layers, id);
8209
8210
  const layout = this.getTextLayout(id);
8210
- return layout ? _chunkQMI5HZWAcjs.textIndexAt.call(void 0, layout, _chunk3YDQLQH2cjs.toTextSpace.call(void 0, layer, point)) : layer.text.length;
8211
+ return layout ? _chunk236TKNURcjs.textIndexAt.call(void 0, layout, _chunk32MMQYCQcjs.toTextSpace.call(void 0, layer, point)) : layer.text.length;
8211
8212
  }
8212
8213
  /** The caret at text index `index` as a document-space segment (top to bottom), for drawing it. */
8213
8214
  textCaret(id, index) {
8214
- const layer = _chunk3YDQLQH2cjs.requireTypeLayer.call(void 0, this.state.layers, id);
8215
+ const layer = _chunk32MMQYCQcjs.requireTypeLayer.call(void 0, this.state.layers, id);
8215
8216
  const layout = this.getTextLayout(id);
8216
8217
  if (!layout) return null;
8217
- const c = _chunkQMI5HZWAcjs.caretAt.call(void 0, layout, Math.max(0, Math.min(layer.text.length, index)));
8218
- const m = _chunk3YDQLQH2cjs.textMatrix.call(void 0, layer);
8218
+ const c = _chunk236TKNURcjs.caretAt.call(void 0, layout, Math.max(0, Math.min(layer.text.length, index)));
8219
+ const m = _chunk32MMQYCQcjs.textMatrix.call(void 0, layer);
8219
8220
  const at = (x, y) => ({ x: m[0] * x + m[2] * y + m[4], y: m[1] * x + m[3] * y + m[5] });
8220
8221
  return { top: at(c.x, c.top), bottom: at(c.x, c.bottom), line: c.line };
8221
8222
  }
@@ -8226,14 +8227,14 @@ var ImageEditorController = (_class10 = class {
8226
8227
  }
8227
8228
  /** One component from tool or UI input (validated). */
8228
8229
  componentFrom(spec, path) {
8229
- const op = _chunk3YDQLQH2cjs.requireOperation.call(void 0, spec.op, `${path}op`);
8230
- if (spec.shape !== void 0 && spec.subpaths !== void 0) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`Give ${path}shape or ${path}subpaths, not both.`);
8231
- if (spec.shape !== void 0) return _chunk3YDQLQH2cjs.liveComponent.call(void 0, _chunk3YDQLQH2cjs.normalizeLiveShape.call(void 0, spec.shape, `${path}shape`), op);
8232
- if (spec.subpaths !== void 0) return { op, subpaths: _chunk3YDQLQH2cjs.normalizeSubpaths.call(void 0, spec.subpaths, `${path}subpaths`) };
8233
- throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`${path}shape (a live shape: { kind: rect | ellipse | polygon | star | line, \u2026 }) or ${path}subpaths (anchors or SVG path data) is required.`);
8230
+ const op = _chunk32MMQYCQcjs.requireOperation.call(void 0, spec.op, `${path}op`);
8231
+ if (spec.shape !== void 0 && spec.subpaths !== void 0) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`Give ${path}shape or ${path}subpaths, not both.`);
8232
+ if (spec.shape !== void 0) return _chunk32MMQYCQcjs.liveComponent.call(void 0, _chunk32MMQYCQcjs.normalizeLiveShape.call(void 0, spec.shape, `${path}shape`), op);
8233
+ if (spec.subpaths !== void 0) return { op, subpaths: _chunk32MMQYCQcjs.normalizeSubpaths.call(void 0, spec.subpaths, `${path}subpaths`) };
8234
+ throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`${path}shape (a live shape: { kind: rect | ellipse | polygon | star | line, \u2026 }) or ${path}subpaths (anchors or SVG path data) is required.`);
8234
8235
  }
8235
8236
  shapeInfo(id) {
8236
- const layer = _chunk3YDQLQH2cjs.requireShapeLayer.call(void 0, this.state.layers, id);
8237
+ const layer = _chunk32MMQYCQcjs.requireShapeLayer.call(void 0, this.state.layers, id);
8237
8238
  const r = (n) => Math.round(n * 1e3) / 1e3;
8238
8239
  const box = (b) => b ? { x: r(b.x), y: r(b.y), width: r(b.width), height: r(b.height) } : null;
8239
8240
  const info = {
@@ -8243,13 +8244,13 @@ var ImageEditorController = (_class10 = class {
8243
8244
  index,
8244
8245
  op: c.op,
8245
8246
  live: c.live ? JSON.parse(JSON.stringify(c.live)) : null,
8246
- subpaths: _chunkQMI5HZWAcjs.roundSubpaths.call(void 0, c.subpaths),
8247
- bounds: box(_chunk3YDQLQH2cjs.shapeGeometryBounds.call(void 0, { components: [c] }))
8247
+ subpaths: _chunk236TKNURcjs.roundSubpaths.call(void 0, c.subpaths),
8248
+ bounds: box(_chunk32MMQYCQcjs.shapeGeometryBounds.call(void 0, { components: [c] }))
8248
8249
  })),
8249
8250
  fillRule: _nullishCoalesce(layer.fillRule, () => ( "nonzero")),
8250
8251
  fill: layer.fill ? JSON.parse(JSON.stringify(layer.fill)) : null,
8251
8252
  stroke: layer.stroke ? JSON.parse(JSON.stringify(layer.stroke)) : null,
8252
- geometryBounds: box(_chunk3YDQLQH2cjs.shapeGeometryBounds.call(void 0, layer)),
8253
+ geometryBounds: box(_chunk32MMQYCQcjs.shapeGeometryBounds.call(void 0, layer)),
8253
8254
  bounds: this.getLayerBounds(id)
8254
8255
  };
8255
8256
  if (layer.annotation) info.annotationId = layer.annotation.id;
@@ -8266,17 +8267,17 @@ var ImageEditorController = (_class10 = class {
8266
8267
  */
8267
8268
  addShapeLayer(init) {
8268
8269
  const specs = _optionalChain([init, 'access', _302 => _302.components, 'optionalAccess', _303 => _303.length]) ? init.components : [init];
8269
- if (_optionalChain([init, 'access', _304 => _304.components, 'optionalAccess', _305 => _305.length]) && (init.shape !== void 0 || init.subpaths !== void 0)) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("Give components, or shape / subpaths, not both.");
8270
+ if (_optionalChain([init, 'access', _304 => _304.components, 'optionalAccess', _305 => _305.length]) && (init.shape !== void 0 || init.subpaths !== void 0)) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("Give components, or shape / subpaths, not both.");
8270
8271
  const components = specs.map((c, i) => this.componentFrom(c, _optionalChain([init, 'access', _306 => _306.components, 'optionalAccess', _307 => _307.length]) ? `components[${i}].` : ""));
8271
- const stroke = init.stroke ? _chunk3YDQLQH2cjs.normalizeShapeStroke.call(void 0, init.stroke, "stroke") : null;
8272
+ const stroke = init.stroke ? _chunk32MMQYCQcjs.normalizeShapeStroke.call(void 0, init.stroke, "stroke") : null;
8272
8273
  const openOnly = components.every((c) => !c.live && c.subpaths.every((sp) => !sp.closed));
8273
- const fill = init.fill === void 0 ? stroke && openOnly ? null : _chunk3YDQLQH2cjs.normalizeShapePaint.call(void 0, this.state.paint.foreground, "fill") : init.fill === null ? null : _chunk3YDQLQH2cjs.normalizeShapePaint.call(void 0, init.fill, "fill");
8274
- if (!fill && !stroke) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("A shape with neither fill nor stroke draws nothing; give fill or stroke.");
8275
- if (init.fillRule !== void 0 && init.fillRule !== "nonzero" && init.fillRule !== "evenodd") throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("fillRule must be nonzero or evenodd.");
8276
- if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("opacity must be between 0 and 1.");
8277
- if (init.blend !== void 0 && !_chunkCWM3CUUXcjs.isBlendMode.call(void 0, init.blend)) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`Unknown blend mode "${String(init.blend)}".`);
8278
- const layer = _chunk3YDQLQH2cjs.createShapeLayer.call(void 0, { components, fill, stroke, fillRule: init.fillRule, name: init.name, opacity: init.opacity, blend: init.blend }, this.shapeEnv());
8279
- const next = _chunk3YDQLQH2cjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
8274
+ const fill = init.fill === void 0 ? stroke && openOnly ? null : _chunk32MMQYCQcjs.normalizeShapePaint.call(void 0, this.state.paint.foreground, "fill") : init.fill === null ? null : _chunk32MMQYCQcjs.normalizeShapePaint.call(void 0, init.fill, "fill");
8275
+ if (!fill && !stroke) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("A shape with neither fill nor stroke draws nothing; give fill or stroke.");
8276
+ if (init.fillRule !== void 0 && init.fillRule !== "nonzero" && init.fillRule !== "evenodd") throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("fillRule must be nonzero or evenodd.");
8277
+ if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("opacity must be between 0 and 1.");
8278
+ if (init.blend !== void 0 && !_chunkCWM3CUUXcjs.isBlendMode.call(void 0, init.blend)) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`Unknown blend mode "${String(init.blend)}".`);
8279
+ const layer = _chunk32MMQYCQcjs.createShapeLayer.call(void 0, { components, fill, stroke, fillRule: init.fillRule, name: init.name, opacity: init.opacity, blend: init.blend }, this.shapeEnv());
8280
+ const next = _chunk32MMQYCQcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
8280
8281
  this.commitLayers(next, () => {
8281
8282
  this.state.activeLayerId = layer.id;
8282
8283
  this.state.activeTarget = "pixels";
@@ -8289,18 +8290,18 @@ var ImageEditorController = (_class10 = class {
8289
8290
  * only those settings of the current stroke. Returns the shape.
8290
8291
  */
8291
8292
  setShapeStyle(id, changes, commitToHistory = true) {
8292
- const layer = _chunk3YDQLQH2cjs.requireShapeLayer.call(void 0, this.state.layers, id);
8293
- const fill = changes.fill === void 0 ? layer.fill : changes.fill === null ? null : _chunk3YDQLQH2cjs.normalizeShapePaint.call(void 0, changes.fill, "fill");
8294
- const stroke = changes.stroke === void 0 ? layer.stroke : changes.stroke === null ? null : _chunk3YDQLQH2cjs.normalizeShapeStroke.call(void 0, changes.stroke, "stroke", layer.stroke);
8295
- if (changes.fillRule !== void 0 && changes.fillRule !== "nonzero" && changes.fillRule !== "evenodd") throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("fillRule must be nonzero or evenodd.");
8293
+ const layer = _chunk32MMQYCQcjs.requireShapeLayer.call(void 0, this.state.layers, id);
8294
+ const fill = changes.fill === void 0 ? layer.fill : changes.fill === null ? null : _chunk32MMQYCQcjs.normalizeShapePaint.call(void 0, changes.fill, "fill");
8295
+ const stroke = changes.stroke === void 0 ? layer.stroke : changes.stroke === null ? null : _chunk32MMQYCQcjs.normalizeShapeStroke.call(void 0, changes.stroke, "stroke", layer.stroke);
8296
+ if (changes.fillRule !== void 0 && changes.fillRule !== "nonzero" && changes.fillRule !== "evenodd") throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("fillRule must be nonzero or evenodd.");
8296
8297
  const fillRule = _nullishCoalesce(_nullishCoalesce(changes.fillRule, () => ( layer.fillRule)), () => ( "nonzero"));
8297
- const { layers } = _chunk3YDQLQH2cjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ fill, stroke, fillRule: fillRule === "nonzero" ? void 0 : fillRule }), this.shapeEnv(), "restyle it");
8298
+ const { layers } = _chunk32MMQYCQcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ fill, stroke, fillRule: fillRule === "nonzero" ? void 0 : fillRule }), this.shapeEnv(), "restyle it");
8298
8299
  this.commitLayers(layers, void 0, commitToHistory);
8299
8300
  return this.shapeInfo(id);
8300
8301
  }
8301
8302
  componentIndex(layer, index) {
8302
8303
  if (!Number.isInteger(index) || index < 0 || index >= layer.components.length) {
8303
- throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`componentIndex must be 0..${layer.components.length - 1} (get_shape_layer lists the components), got ${String(index)}.`);
8304
+ throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`componentIndex must be 0..${layer.components.length - 1} (get_shape_layer lists the components), got ${String(index)}.`);
8304
8305
  }
8305
8306
  return index;
8306
8307
  }
@@ -8310,36 +8311,36 @@ var ImageEditorController = (_class10 = class {
8310
8311
  * the live shape) or its operation. Returns the shape.
8311
8312
  */
8312
8313
  setShapeComponent(id, index, change, commitToHistory = true) {
8313
- const layer = _chunk3YDQLQH2cjs.requireShapeLayer.call(void 0, this.state.layers, id);
8314
+ const layer = _chunk32MMQYCQcjs.requireShapeLayer.call(void 0, this.state.layers, id);
8314
8315
  const i = this.componentIndex(layer, index);
8315
8316
  const current = layer.components[i];
8316
8317
  let shape = change.shape;
8317
8318
  if (shape && current.live && shape.kind === void 0) shape = { ...current.live, ...shape };
8318
8319
  else if (shape && current.live && shape.kind === current.live.kind) shape = { ...current.live, ...shape };
8319
- const next = shape !== void 0 || change.subpaths !== void 0 ? this.componentFrom({ ...change, shape, op: _nullishCoalesce(change.op, () => ( current.op)) }, "") : { ...current, op: _chunk3YDQLQH2cjs.requireOperation.call(void 0, change.op) };
8320
+ const next = shape !== void 0 || change.subpaths !== void 0 ? this.componentFrom({ ...change, shape, op: _nullishCoalesce(change.op, () => ( current.op)) }, "") : { ...current, op: _chunk32MMQYCQcjs.requireOperation.call(void 0, change.op) };
8320
8321
  const components = layer.components.map((c, k) => k === i ? next : c);
8321
- const { layers } = _chunk3YDQLQH2cjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
8322
+ const { layers } = _chunk32MMQYCQcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
8322
8323
  this.commitLayers(layers, void 0, commitToHistory);
8323
8324
  return this.shapeInfo(id);
8324
8325
  }
8325
8326
  /** Adds a component to a shape (path operations), on top unless `index` is given (one undo step). Returns the shape. */
8326
8327
  addShapeComponent(id, spec, index) {
8327
- const layer = _chunk3YDQLQH2cjs.requireShapeLayer.call(void 0, this.state.layers, id);
8328
+ const layer = _chunk32MMQYCQcjs.requireShapeLayer.call(void 0, this.state.layers, id);
8328
8329
  const c = this.componentFrom(spec, "");
8329
8330
  const at = index === void 0 ? layer.components.length : index;
8330
- if (!Number.isInteger(at) || at < 0 || at > layer.components.length) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`index must be 0..${layer.components.length}, got ${String(index)}.`);
8331
+ if (!Number.isInteger(at) || at < 0 || at > layer.components.length) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`index must be 0..${layer.components.length}, got ${String(index)}.`);
8331
8332
  const components = [...layer.components.slice(0, at), c, ...layer.components.slice(at)];
8332
- const { layers } = _chunk3YDQLQH2cjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
8333
+ const { layers } = _chunk32MMQYCQcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
8333
8334
  this.commitLayers(layers);
8334
8335
  return this.shapeInfo(id);
8335
8336
  }
8336
8337
  /** Removes one component of a shape (one undo step); the last one cannot go (delete the layer instead). Returns the shape. */
8337
8338
  removeShapeComponent(id, index) {
8338
- const layer = _chunk3YDQLQH2cjs.requireShapeLayer.call(void 0, this.state.layers, id);
8339
+ const layer = _chunk32MMQYCQcjs.requireShapeLayer.call(void 0, this.state.layers, id);
8339
8340
  const i = this.componentIndex(layer, index);
8340
- if (layer.components.length === 1) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("This is the shape's only component; delete the layer instead (delete_layer).");
8341
+ if (layer.components.length === 1) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("This is the shape's only component; delete the layer instead (delete_layer).");
8341
8342
  const components = layer.components.filter((_, k) => k !== i);
8342
- const { layers } = _chunk3YDQLQH2cjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
8343
+ const { layers } = _chunk32MMQYCQcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
8343
8344
  this.commitLayers(layers);
8344
8345
  return this.shapeInfo(id);
8345
8346
  }
@@ -8348,10 +8349,10 @@ var ImageEditorController = (_class10 = class {
8348
8349
  * shapes become paths), as one undo step. Returns the shape.
8349
8350
  */
8350
8351
  mergeShapeComponents(id) {
8351
- const layer = _chunk3YDQLQH2cjs.requireShapeLayer.call(void 0, this.state.layers, id);
8352
- if (layer.components.length < 2) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("The shape has one component; there is nothing to merge.");
8353
- const components = _chunk3YDQLQH2cjs.mergeShapeComponents.call(void 0, layer.components, layer.fillRule);
8354
- const { layers } = _chunk3YDQLQH2cjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components, fillRule: void 0 }), this.shapeEnv(), "edit its path");
8352
+ const layer = _chunk32MMQYCQcjs.requireShapeLayer.call(void 0, this.state.layers, id);
8353
+ if (layer.components.length < 2) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("The shape has one component; there is nothing to merge.");
8354
+ const components = _chunk32MMQYCQcjs.mergeShapeComponents.call(void 0, layer.components, layer.fillRule);
8355
+ const { layers } = _chunk32MMQYCQcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components, fillRule: void 0 }), this.shapeEnv(), "edit its path");
8355
8356
  this.commitLayers(layers);
8356
8357
  return this.shapeInfo(id);
8357
8358
  }
@@ -8361,8 +8362,8 @@ var ImageEditorController = (_class10 = class {
8361
8362
  * step. Returns the layer id.
8362
8363
  */
8363
8364
  async rasterizeLayer(id) {
8364
- const layer = _chunk3YDQLQH2cjs.requireLayer.call(void 0, this.state.layers, id).layer;
8365
- _chunk3YDQLQH2cjs.requireUnlocked.call(void 0, layer, "all", "rasterize it");
8365
+ const layer = _chunk32MMQYCQcjs.requireLayer.call(void 0, this.state.layers, id).layer;
8366
+ _chunk32MMQYCQcjs.requireUnlocked.call(void 0, layer, "all", "rasterize it");
8366
8367
  const { width, height } = this.naturalSize;
8367
8368
  const canvas = { x: 0, y: 0, width, height };
8368
8369
  let next;
@@ -8378,8 +8379,8 @@ var ImageEditorController = (_class10 = class {
8378
8379
  if (layer.locks) next.locks = layer.locks;
8379
8380
  if (this.state.selectedAnnotationId === layer.annotation.id) this.state.selectedAnnotationId = null;
8380
8381
  } else if (layer.type === "pixel") {
8381
- if (!_optionalChain([layer, 'access', _308 => _308.filters, 'optionalAccess', _309 => _309.length])) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`Layer "${layer.name || id}" is already pixels with no filters to bake.`);
8382
- _chunk3YDQLQH2cjs.requireUnlocked.call(void 0, layer, "pixels", "rasterize it");
8382
+ if (!_optionalChain([layer, 'access', _308 => _308.filters, 'optionalAccess', _309 => _309.length])) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`Layer "${layer.name || id}" is already pixels with no filters to bake.`);
8383
+ _chunk32MMQYCQcjs.requireUnlocked.call(void 0, layer, "pixels", "rasterize it");
8383
8384
  const spatial = layer.filters.some((f) => f.enabled && f.kind === "blur");
8384
8385
  const content = { ...layer, visible: true, opacity: 1, blend: "normal" };
8385
8386
  delete content.mask;
@@ -8396,10 +8397,10 @@ var ImageEditorController = (_class10 = class {
8396
8397
  } else if (layer.type === "smart") {
8397
8398
  return this.rasterizeSmartObject(id);
8398
8399
  } else if (layer.type === "shape" || layer.type === "type") {
8399
- next = layer.type === "shape" ? _chunk3YDQLQH2cjs.shapeAsPixelLayer.call(void 0, layer) : _chunk3YDQLQH2cjs.typeAsPixelLayer.call(void 0, layer);
8400
+ next = layer.type === "shape" ? _chunk32MMQYCQcjs.shapeAsPixelLayer.call(void 0, layer) : _chunk32MMQYCQcjs.typeAsPixelLayer.call(void 0, layer);
8400
8401
  if (this.state.selectedAnnotationId && this.state.selectedAnnotationId === _optionalChain([layer, 'access', _310 => _310.annotation, 'optionalAccess', _311 => _311.id])) this.state.selectedAnnotationId = null;
8401
8402
  } else {
8402
- throw new (0, _chunk3YDQLQH2cjs.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.`);
8403
+ throw new (0, _chunk32MMQYCQcjs.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.`);
8403
8404
  }
8404
8405
  this.commitLayers(_chunkHGTDMKNEcjs.mapLayer.call(void 0, this.state.layers, id, () => next));
8405
8406
  return id;
@@ -8424,7 +8425,7 @@ var ImageEditorController = (_class10 = class {
8424
8425
  setColorMode(mode, options = {}) {
8425
8426
  let next;
8426
8427
  if (mode === "rgb") {
8427
- if (options.profile !== void 0) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("An RGB document takes no CMYK profile; use assign_profile for its working space.");
8428
+ if (options.profile !== void 0) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("An RGB document takes no CMYK profile; use assign_profile for its working space.");
8428
8429
  next = null;
8429
8430
  } else if (mode === "lab") next = { mode: "lab" };
8430
8431
  else if (mode === "cmyk") {
@@ -8432,14 +8433,14 @@ var ImageEditorController = (_class10 = class {
8432
8433
  try {
8433
8434
  doc = documentProfile(_nullishCoalesce(options.profile, () => ( "coated-cmyk")));
8434
8435
  } catch (e) {
8435
- throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
8436
+ throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
8436
8437
  }
8437
8438
  const cs = resolveProfile(doc).colorSpace;
8438
- if (cs !== "cmyk") throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`CMYK mode needs a CMYK profile; "${doc.name}" is ${cs.toUpperCase()}.`);
8439
+ if (cs !== "cmyk") throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`CMYK mode needs a CMYK profile; "${doc.name}" is ${cs.toUpperCase()}.`);
8439
8440
  const intent = _nullishCoalesce(options.intent, () => ( "relative"));
8440
- if (!_chunkBROJYMWUcjs.INTENTS.includes(intent)) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkBROJYMWUcjs.INTENTS.join(", ")}.`);
8441
+ if (!_chunkBROJYMWUcjs.INTENTS.includes(intent)) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkBROJYMWUcjs.INTENTS.join(", ")}.`);
8441
8442
  next = { mode: "cmyk", profile: doc, intent };
8442
- } else throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`Unknown colour mode "${String(mode)}"; use rgb, cmyk or lab.`);
8443
+ } else throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`Unknown colour mode "${String(mode)}"; use rgb, cmyk or lab.`);
8443
8444
  this.recordHistory();
8444
8445
  if (next) this.state.colorMode = next;
8445
8446
  else delete this.state.colorMode;
@@ -8452,10 +8453,10 @@ var ImageEditorController = (_class10 = class {
8452
8453
  try {
8453
8454
  doc = documentProfile(profile);
8454
8455
  } catch (e) {
8455
- throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
8456
+ throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
8456
8457
  }
8457
8458
  const cs = resolveProfile(doc).colorSpace;
8458
- if (cs !== "rgb") throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`${action} needs an RGB profile; "${doc.name}" is ${cs.toUpperCase()}. The document is RGB: soft-proof CMYK with set_proof_setup, or export to it.`);
8459
+ if (cs !== "rgb") throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`${action} needs an RGB profile; "${doc.name}" is ${cs.toUpperCase()}. The document is RGB: soft-proof CMYK with set_proof_setup, or export to it.`);
8459
8460
  return doc;
8460
8461
  }
8461
8462
  /**
@@ -8481,7 +8482,7 @@ var ImageEditorController = (_class10 = class {
8481
8482
  convertToProfile(profile, options = {}) {
8482
8483
  const doc = this.rgbProfileArg(profile, "Convert to Profile");
8483
8484
  const intent = _nullishCoalesce(options.intent, () => ( "relative"));
8484
- if (!_chunkBROJYMWUcjs.INTENTS.includes(intent)) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkBROJYMWUcjs.INTENTS.join(", ")}.`);
8485
+ if (!_chunkBROJYMWUcjs.INTENTS.includes(intent)) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkBROJYMWUcjs.INTENTS.join(", ")}.`);
8485
8486
  const t = _chunkBROJYMWUcjs.Transform.create(resolveProfile(this.state.colorProfile), resolveProfile(doc), { intent, bpc: _nullishCoalesce(options.bpc, () => ( true)) });
8486
8487
  const converted = [];
8487
8488
  const unconverted = [];
@@ -8511,11 +8512,11 @@ var ImageEditorController = (_class10 = class {
8511
8512
  else if (l.type === "pixel") next2 = { ...next2, surface: convertSurfaceColors(this.surfaceOf(l), t), source: void 0 };
8512
8513
  else if (l.type === "shape") {
8513
8514
  const s = next2;
8514
- next2 = _chunk3YDQLQH2cjs.rerenderShape.call(void 0, { ...s, fill: convertColorFields(s.fill, hex), stroke: convertColorFields(s.stroke, hex), ...s.annotation ? { annotation: convertColorFields(s.annotation, hex) } : {} }, shapeEnv);
8515
+ next2 = _chunk32MMQYCQcjs.rerenderShape.call(void 0, { ...s, fill: convertColorFields(s.fill, hex), stroke: convertColorFields(s.stroke, hex), ...s.annotation ? { annotation: convertColorFields(s.annotation, hex) } : {} }, shapeEnv);
8515
8516
  } else if (l.type === "type") {
8516
8517
  const recoloured = { ...next2, runs: convertColorFields(l.runs, hex) };
8517
8518
  try {
8518
- next2 = _chunk3YDQLQH2cjs.rerenderText.call(void 0, recoloured, textEnv);
8519
+ next2 = _chunk32MMQYCQcjs.rerenderText.call(void 0, recoloured, textEnv);
8519
8520
  } catch (e29) {
8520
8521
  next2 = { ...recoloured, surface: convertSurfaceColors(l.surface, t) };
8521
8522
  }
@@ -8545,12 +8546,12 @@ var ImageEditorController = (_class10 = class {
8545
8546
  try {
8546
8547
  doc = documentProfile(setup.profile);
8547
8548
  } catch (e) {
8548
- throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
8549
+ throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
8549
8550
  }
8550
8551
  const intent = _nullishCoalesce(setup.intent, () => ( DEFAULT_PROOF.intent));
8551
- if (!_chunkBROJYMWUcjs.INTENTS.includes(intent)) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkBROJYMWUcjs.INTENTS.join(", ")}.`);
8552
+ if (!_chunkBROJYMWUcjs.INTENTS.includes(intent)) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkBROJYMWUcjs.INTENTS.join(", ")}.`);
8552
8553
  const next = { ...DEFAULT_PROOF, ...setup, intent, profile: doc };
8553
- if (!_chunkBROJYMWUcjs.canBeDestination.call(void 0, resolveProfile(doc))) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`"${doc.name}" describes a source only, so colours cannot be proofed through it.`);
8554
+ if (!_chunkBROJYMWUcjs.canBeDestination.call(void 0, resolveProfile(doc))) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`"${doc.name}" describes a source only, so colours cannot be proofed through it.`);
8554
8555
  this.state.proofSetup = next;
8555
8556
  this.notify();
8556
8557
  return next;
@@ -8567,14 +8568,14 @@ var ImageEditorController = (_class10 = class {
8567
8568
  src = options.from !== void 0 ? resolveProfile(documentProfile(options.from)) : resolveProfile(this.state.colorProfile);
8568
8569
  dst = resolveProfile(documentProfile(to));
8569
8570
  } catch (e) {
8570
- throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
8571
+ throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
8571
8572
  }
8572
- if (src.colorSpace !== "rgb") throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("Colours are given as #rrggbb, so the source profile must be RGB.");
8573
+ if (src.colorSpace !== "rgb") throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("Colours are given as #rrggbb, so the source profile must be RGB.");
8573
8574
  const t = _chunkBROJYMWUcjs.Transform.create(src, dst, { intent: _nullishCoalesce(options.intent, () => ( "relative")), bpc: _nullishCoalesce(options.bpc, () => ( true)) });
8574
8575
  const toLab = _chunkBROJYMWUcjs.Transform.create(src, _chunkBROJYMWUcjs.builtinProfile.call(void 0, "lab-d50"), { intent: "relative", bpc: false });
8575
8576
  return colors.map((input) => {
8576
8577
  const m = /^#?([0-9a-f]{6})$/i.exec(input.trim());
8577
- if (!m) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`Invalid colour "${input}"; use #rrggbb.`);
8578
+ if (!m) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`Invalid colour "${input}"; use #rrggbb.`);
8578
8579
  const n = parseInt(m[1], 16);
8579
8580
  const rgb = [(n >> 16 & 255) / 255, (n >> 8 & 255) / 255, (n & 255) / 255];
8580
8581
  const out = new Float32Array(16);
@@ -8600,7 +8601,7 @@ var ImageEditorController = (_class10 = class {
8600
8601
  * the ids of the layers whose pixels changed.
8601
8602
  */
8602
8603
  setBitDepth(depth) {
8603
- if (!_chunkCWM3CUUXcjs.isBitDepth.call(void 0, depth)) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`Bit depth must be 8, 16 or 32, not ${String(depth)}.`);
8604
+ if (!_chunkCWM3CUUXcjs.isBitDepth.call(void 0, depth)) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`Bit depth must be 8, 16 or 32, not ${String(depth)}.`);
8604
8605
  const changed = [];
8605
8606
  const withMask = (l) => {
8606
8607
  const m = l.mask;
@@ -8649,7 +8650,7 @@ var ImageEditorController = (_class10 = class {
8649
8650
  * Throws `PsdError` for files that cannot be read at all.
8650
8651
  */
8651
8652
  loadPsd(bytes) {
8652
- const result = _chunk3YDQLQH2cjs.importPsd.call(void 0, bytes, { newId: () => _chunk3YDQLQH2cjs.newLayerId.call(void 0, ) });
8653
+ const result = _chunk32MMQYCQcjs.importPsd.call(void 0, bytes, { newId: () => _chunk32MMQYCQcjs.newLayerId.call(void 0, ) });
8653
8654
  this.abandonContents();
8654
8655
  this.recordHistory();
8655
8656
  const s = this.state;
@@ -8659,12 +8660,12 @@ var ImageEditorController = (_class10 = class {
8659
8660
  if (!this.samplePixelsOverride) this.samplePixels = null;
8660
8661
  s.layers = this.checkPsdFonts(result);
8661
8662
  s.crop = null;
8662
- s.transform = { ..._chunk3YDQLQH2cjs.DEFAULT_TRANSFORM_VALUES };
8663
+ s.transform = { ..._chunk32MMQYCQcjs.DEFAULT_TRANSFORM_VALUES };
8663
8664
  s.outputOpacity = 1;
8664
8665
  delete s.legacyOutputBlur;
8665
8666
  s.selection = null;
8666
8667
  s.selectedAnnotationId = null;
8667
- s.activeLayerId = _chunk3YDQLQH2cjs.defaultActiveLayerId.call(void 0, s.layers);
8668
+ s.activeLayerId = _chunk32MMQYCQcjs.defaultActiveLayerId.call(void 0, s.layers);
8668
8669
  s.activeTarget = "pixels";
8669
8670
  this.psdResolution = result.resolution;
8670
8671
  if (result.patterns.length) s.patterns = result.patterns;
@@ -8709,7 +8710,7 @@ var ImageEditorController = (_class10 = class {
8709
8710
  let layers = result.layers;
8710
8711
  const missing = /* @__PURE__ */ new Map();
8711
8712
  for (const l of types) {
8712
- const fonts = shaper ? _chunkQMI5HZWAcjs.layoutText.call(void 0, l, shaper).missingFonts : [...new Set(l.runs.map((r) => r.style.fontFamily))];
8713
+ const fonts = shaper ? _chunk236TKNURcjs.layoutText.call(void 0, l, shaper).missingFonts : [...new Set(l.runs.map((r) => r.style.fontFamily))];
8713
8714
  if (!fonts.length) continue;
8714
8715
  layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0, layers, l.id, () => ({ ...l, missingFonts: fonts }));
8715
8716
  for (const f of fonts) missing.set(f, [..._nullishCoalesce(missing.get(f), () => ( [])), l.name]);
@@ -8737,7 +8738,7 @@ var ImageEditorController = (_class10 = class {
8737
8738
  const canRasterize = this.renderer.canRasterize();
8738
8739
  await this.renderer.prepareLayerAssets(this.state.layers, width, height);
8739
8740
  const sources = this.renderer.compositorSources(width, height);
8740
- const compositor = new (0, _chunk3YDQLQH2cjs.LayerCompositor)();
8741
+ const compositor = new (0, _chunk32MMQYCQcjs.LayerCompositor)();
8741
8742
  const bakeMask = (layer) => {
8742
8743
  const mask = layer.mask;
8743
8744
  if (!_optionalChain([mask, 'optionalAccess', _322 => _322.source])) return mask;
@@ -8819,7 +8820,7 @@ var ImageEditorController = (_class10 = class {
8819
8820
  out.surface = this.surfaceOf(layer);
8820
8821
  delete out.source;
8821
8822
  }
8822
- const active = _nullishCoalesce(_optionalChain([layer, 'access', _326 => _326.filters, 'optionalAccess', _327 => _327.filter, 'call', _328 => _328(_chunk3YDQLQH2cjs.isActiveFilter)]), () => ( []));
8823
+ const active = _nullishCoalesce(_optionalChain([layer, 'access', _326 => _326.filters, 'optionalAccess', _327 => _327.filter, 'call', _328 => _328(_chunk32MMQYCQcjs.isActiveFilter)]), () => ( []));
8823
8824
  if (active.length) {
8824
8825
  add2("Layer filters (develop, blur) were baked into the pixels", layer.name);
8825
8826
  const content = { ...out, visible: true, opacity: 1, blend: "normal" };
@@ -8852,8 +8853,8 @@ var ImageEditorController = (_class10 = class {
8852
8853
  const color = this.psdColorOptions(warnings);
8853
8854
  if (color.colorMode && this.bitDepth === 32) warnings.push(`${color.colorMode.toUpperCase()} files are written at 16 bits per channel at most; the 32-bit samples were converted (colour above 1 clipped).`);
8854
8855
  const depth = color.colorMode && this.bitDepth === 32 ? 16 : this.bitDepth;
8855
- const mergedDeep = depth === 8 ? void 0 : _chunkHGTDMKNEcjs.workingToSamples.call(void 0, _chunk3YDQLQH2cjs.compositeDeep.call(void 0, prepared, canvas, sources, depth), depth);
8856
- const result = _chunk3YDQLQH2cjs.exportPsd.call(void 0, { width, height, layers: prepared, merged, mergedDeep, resolution: this.psdResolution, patterns: this.state.patterns, globalLight: this.state.globalLight, depth, ...color });
8856
+ const mergedDeep = depth === 8 ? void 0 : _chunkHGTDMKNEcjs.workingToSamples.call(void 0, _chunk32MMQYCQcjs.compositeDeep.call(void 0, prepared, canvas, sources, depth), depth);
8857
+ const result = _chunk32MMQYCQcjs.exportPsd.call(void 0, { width, height, layers: prepared, merged, mergedDeep, resolution: this.psdResolution, patterns: this.state.patterns, globalLight: this.state.globalLight, depth, ...color });
8857
8858
  warnings.push(...result.warnings);
8858
8859
  return { bytes: result.bytes, warnings, psb: result.psb, width, height };
8859
8860
  }
@@ -8869,13 +8870,13 @@ var ImageEditorController = (_class10 = class {
8869
8870
  if (!this.samplePixelsOverride) this.samplePixels = null;
8870
8871
  if (this.state.selection && (sx !== 1 || sy !== 1)) {
8871
8872
  this.state.selection = normalizeSelection(
8872
- _chunk3YDQLQH2cjs.resizeSelection.call(void 0, this.state.selection, Math.round(next.dimensions.width), Math.round(next.dimensions.height))
8873
+ _chunk32MMQYCQcjs.resizeSelection.call(void 0, this.state.selection, Math.round(next.dimensions.width), Math.round(next.dimensions.height))
8873
8874
  );
8874
8875
  }
8875
8876
  let layers = this.state.layers;
8876
8877
  if (sx !== 1 || sy !== 1) {
8877
8878
  if (this.state.crop) {
8878
- this.state.crop = _chunk3YDQLQH2cjs.clampCropToImage.call(void 0,
8879
+ this.state.crop = _chunk32MMQYCQcjs.clampCropToImage.call(void 0,
8879
8880
  {
8880
8881
  x: Math.round(this.state.crop.x * sx),
8881
8882
  y: Math.round(this.state.crop.y * sy),
@@ -8894,17 +8895,17 @@ var ImageEditorController = (_class10 = class {
8894
8895
  } else if (l.type === "shape") {
8895
8896
  const a = l.annotation;
8896
8897
  const scaled = a ? scaleAnnotation(a, sx, sy) : null;
8897
- const fromAnnotation = scaled ? _chunk3YDQLQH2cjs.shapeFromAnnotation.call(void 0, scaled) : null;
8898
+ const fromAnnotation = scaled ? _chunk32MMQYCQcjs.shapeFromAnnotation.call(void 0, scaled) : null;
8898
8899
  const m = [sx, 0, 0, sy, 0, 0];
8899
- const components = _nullishCoalesce(_optionalChain([fromAnnotation, 'optionalAccess', _336 => _336.components]), () => ( _chunk3YDQLQH2cjs.transformShapeComponents.call(void 0, l.components, (p) => ({ x: p.x * sx, y: p.y * sy }), m)));
8900
+ const components = _nullishCoalesce(_optionalChain([fromAnnotation, 'optionalAccess', _336 => _336.components]), () => ( _chunk32MMQYCQcjs.transformShapeComponents.call(void 0, l.components, (p) => ({ x: p.x * sx, y: p.y * sy }), m)));
8900
8901
  const moved = { ...l, components, ...fromAnnotation ? { fill: fromAnnotation.fill, stroke: fromAnnotation.stroke } : {} };
8901
8902
  if (scaled && fromAnnotation) moved.annotation = scaled;
8902
8903
  else delete moved.annotation;
8903
- layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0, layers, l.id, () => _chunk3YDQLQH2cjs.rerenderShape.call(void 0, moved, env));
8904
+ layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0, layers, l.id, () => _chunk32MMQYCQcjs.rerenderShape.call(void 0, moved, env));
8904
8905
  }
8905
8906
  }
8906
8907
  }
8907
- const bg = _chunk3YDQLQH2cjs.developTarget.call(void 0, layers, null);
8908
+ const bg = _chunk32MMQYCQcjs.developTarget.call(void 0, layers, null);
8908
8909
  if (bg && bg.source !== "document") layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0, layers, bg.id, () => ({ ...bg, source: "document" }));
8909
8910
  if (clearAnnotations) {
8910
8911
  for (const l of _chunkHGTDMKNEcjs.flattenLayers.call(void 0, layers)) if (l.type === "annotation" || (l.type === "shape" || l.type === "type") && l.annotation) layers = _chunkHGTDMKNEcjs.mapLayer.call(void 0, layers, l.id, () => null);
@@ -8925,7 +8926,7 @@ var ImageEditorController = (_class10 = class {
8925
8926
  let out;
8926
8927
  try {
8927
8928
  out = this.serializeState();
8928
- if (_optionalChain([this, 'access', _340 => _340.state, 'access', _341 => _341.selection, 'optionalAccess', _342 => _342.bounds])) out.selection = _chunk3YDQLQH2cjs.serializeSelection.call(void 0, this.state.selection);
8929
+ if (_optionalChain([this, 'access', _340 => _340.state, 'access', _341 => _341.selection, 'optionalAccess', _342 => _342.bounds])) out.selection = _chunk32MMQYCQcjs.serializeSelection.call(void 0, this.state.selection);
8929
8930
  } finally {
8930
8931
  if (root) {
8931
8932
  this.state = current;
@@ -8933,8 +8934,8 @@ var ImageEditorController = (_class10 = class {
8933
8934
  this.viewKey = [];
8934
8935
  }
8935
8936
  }
8936
- if (!options || out.version !== _chunk3YDQLQH2cjs.LAYERED_SCHEMA_VERSION) return options ? Promise.resolve(out) : out;
8937
- return _chunk3YDQLQH2cjs.serializeLayersExternal.call(void 0, this.rootLayers(), options.store).then(({ layers, assets, smartContents }) => smartContents ? { ...out, layers, assets, smartContents } : { ...out, layers, assets });
8937
+ if (!options || out.version !== _chunk32MMQYCQcjs.LAYERED_SCHEMA_VERSION) return options ? Promise.resolve(out) : out;
8938
+ return _chunk32MMQYCQcjs.serializeLayersExternal.call(void 0, this.rootLayers(), options.store).then(({ layers, assets, smartContents }) => smartContents ? { ...out, layers, assets, smartContents } : { ...out, layers, assets });
8938
8939
  }
8939
8940
  /**
8940
8941
  * Loads a stored state whose v3 assets may live in an asset store (references other than data
@@ -8942,12 +8943,12 @@ var ImageEditorController = (_class10 = class {
8942
8943
  * out and listed in `lastLoadProblems`.
8943
8944
  */
8944
8945
  async loadJSONAsync(data, options = {}) {
8945
- if (data.version !== _chunk3YDQLQH2cjs.LAYERED_SCHEMA_VERSION || !data.assets) {
8946
+ if (data.version !== _chunk32MMQYCQcjs.LAYERED_SCHEMA_VERSION || !data.assets) {
8946
8947
  this.loadJSON(data);
8947
8948
  return;
8948
8949
  }
8949
8950
  const problems = [];
8950
- const assets = await _chunk3YDQLQH2cjs.resolveExternalAssets.call(void 0, data.assets, options.store, problems);
8951
+ const assets = await _chunk32MMQYCQcjs.resolveExternalAssets.call(void 0, data.assets, options.store, problems);
8951
8952
  this.loadJSON({ ...data, assets });
8952
8953
  this.lastLoadProblems = [...problems, ...this.lastLoadProblems];
8953
8954
  }
@@ -8959,7 +8960,7 @@ var ImageEditorController = (_class10 = class {
8959
8960
  let selection = null;
8960
8961
  if (data.selection) {
8961
8962
  try {
8962
- selection = normalizeSelection(_chunk3YDQLQH2cjs.deserializeSelection.call(void 0, data.selection));
8963
+ selection = normalizeSelection(_chunk32MMQYCQcjs.deserializeSelection.call(void 0, data.selection));
8963
8964
  } catch (e30) {
8964
8965
  selection = null;
8965
8966
  }
@@ -8977,8 +8978,8 @@ var ImageEditorController = (_class10 = class {
8977
8978
  if (isLayered(data)) {
8978
8979
  const problems = [];
8979
8980
  const canvas = typeof data.width === "number" && data.width > 0 && typeof data.height === "number" && data.height > 0 ? { width: data.width, height: data.height } : this.naturalSize;
8980
- const storedPatterns = _chunk3YDQLQH2cjs.deserializePatterns.call(void 0, data.patterns, []);
8981
- s.layers = _chunk3YDQLQH2cjs.deserializeLayers.call(void 0, data.layers, {
8981
+ const storedPatterns = _chunk32MMQYCQcjs.deserializePatterns.call(void 0, data.patterns, []);
8982
+ s.layers = _chunk32MMQYCQcjs.deserializeLayers.call(void 0, data.layers, {
8982
8983
  assets: _nullishCoalesce(data.assets, () => ( {})),
8983
8984
  problems,
8984
8985
  smartContents: Array.isArray(data.smartContents) ? data.smartContents : [],
@@ -8992,11 +8993,11 @@ var ImageEditorController = (_class10 = class {
8992
8993
  s.outputOpacity = data.opacity;
8993
8994
  if (typeof data.legacyOutputBlur === "number" && data.legacyOutputBlur >= 0) s.legacyOutputBlur = data.legacyOutputBlur;
8994
8995
  else delete s.legacyOutputBlur;
8995
- s.activeLayerId = data.activeLayerId && _chunkHGTDMKNEcjs.findLayer.call(void 0, s.layers, data.activeLayerId) ? data.activeLayerId : _chunk3YDQLQH2cjs.defaultActiveLayerId.call(void 0, s.layers);
8996
+ s.activeLayerId = data.activeLayerId && _chunkHGTDMKNEcjs.findLayer.call(void 0, s.layers, data.activeLayerId) ? data.activeLayerId : _chunk32MMQYCQcjs.defaultActiveLayerId.call(void 0, s.layers);
8996
8997
  const light = data.globalLight;
8997
8998
  if (light && Number.isFinite(light.angle) && Number.isFinite(light.altitude)) s.globalLight = { angle: light.angle, altitude: Math.min(90, Math.max(0, light.altitude)) };
8998
8999
  else delete s.globalLight;
8999
- const patterns = _chunk3YDQLQH2cjs.deserializePatterns.call(void 0, data.patterns, problems);
9000
+ const patterns = _chunk32MMQYCQcjs.deserializePatterns.call(void 0, data.patterns, problems);
9000
9001
  if (patterns.length) s.patterns = patterns;
9001
9002
  else delete s.patterns;
9002
9003
  if (data.bitDepth === 16 || data.bitDepth === 32) s.bitDepth = data.bitDepth;
@@ -9012,14 +9013,14 @@ var ImageEditorController = (_class10 = class {
9012
9013
  }
9013
9014
  } else {
9014
9015
  const { width, height } = this.naturalSize;
9015
- const stack = _chunk3YDQLQH2cjs.layersFromLegacy.call(void 0, data, width, height);
9016
+ const stack = _chunk32MMQYCQcjs.layersFromLegacy.call(void 0, data, width, height);
9016
9017
  s.layers = stack.layers;
9017
9018
  s.outputOpacity = stack.outputOpacity;
9018
9019
  if (stack.legacyOutputBlur !== void 0) s.legacyOutputBlur = stack.legacyOutputBlur;
9019
9020
  else delete s.legacyOutputBlur;
9020
9021
  s.crop = data.crop ? { ...data.crop } : null;
9021
9022
  s.transform = { ...data.transform };
9022
- s.activeLayerId = _chunk3YDQLQH2cjs.defaultActiveLayerId.call(void 0, s.layers);
9023
+ s.activeLayerId = _chunk32MMQYCQcjs.defaultActiveLayerId.call(void 0, s.layers);
9023
9024
  delete s.globalLight;
9024
9025
  delete s.patterns;
9025
9026
  delete s.bitDepth;
@@ -9033,7 +9034,7 @@ var ImageEditorController = (_class10 = class {
9033
9034
  }
9034
9035
  serializeState() {
9035
9036
  const { width, height } = this.naturalSize;
9036
- const view = _chunk3YDQLQH2cjs.legacyView.call(void 0, this.stack(), width, height, null);
9037
+ const view = _chunk32MMQYCQcjs.legacyView.call(void 0, this.stack(), width, height, null);
9037
9038
  if (view.exact && !this.state.globalLight && !_optionalChain([this, 'access', _343 => _343.state, 'access', _344 => _344.patterns, 'optionalAccess', _345 => _345.length]) && this.bitDepth === 8 && !this.state.colorProfile && !this.state.colorMode) {
9038
9039
  return {
9039
9040
  // States without adjustment layers keep schema 1, so they round-trip unchanged.
@@ -9048,9 +9049,9 @@ var ImageEditorController = (_class10 = class {
9048
9049
  annotations: JSON.parse(JSON.stringify(view.annotations))
9049
9050
  };
9050
9051
  }
9051
- const { layers, assets, smartContents } = _chunk3YDQLQH2cjs.serializeLayers.call(void 0, this.state.layers);
9052
+ const { layers, assets, smartContents } = _chunk32MMQYCQcjs.serializeLayers.call(void 0, this.state.layers);
9052
9053
  const out = {
9053
- version: _chunk3YDQLQH2cjs.LAYERED_SCHEMA_VERSION,
9054
+ version: _chunk32MMQYCQcjs.LAYERED_SCHEMA_VERSION,
9054
9055
  width,
9055
9056
  height,
9056
9057
  layers,
@@ -9062,7 +9063,7 @@ var ImageEditorController = (_class10 = class {
9062
9063
  };
9063
9064
  if (this.state.legacyOutputBlur !== void 0) out.legacyOutputBlur = this.state.legacyOutputBlur;
9064
9065
  if (this.state.globalLight) out.globalLight = { ...this.state.globalLight };
9065
- if (_optionalChain([this, 'access', _349 => _349.state, 'access', _350 => _350.patterns, 'optionalAccess', _351 => _351.length])) out.patterns = _chunk3YDQLQH2cjs.serializePatterns.call(void 0, this.state.patterns);
9066
+ if (_optionalChain([this, 'access', _349 => _349.state, 'access', _350 => _350.patterns, 'optionalAccess', _351 => _351.length])) out.patterns = _chunk32MMQYCQcjs.serializePatterns.call(void 0, this.state.patterns);
9066
9067
  if (smartContents) out.smartContents = smartContents;
9067
9068
  if (this.state.bitDepth === 16 || this.state.bitDepth === 32) out.bitDepth = this.state.bitDepth;
9068
9069
  if (this.state.colorProfile) out.colorProfile = serializeColorProfile(this.state.colorProfile);
@@ -9074,7 +9075,7 @@ function serializeAdjustments(adjustments) {
9074
9075
  const out = { ...adjustments };
9075
9076
  if (_optionalChain([out, 'access', _352 => _352.layers, 'optionalAccess', _353 => _353.length])) out.layers = JSON.parse(JSON.stringify(out.layers));
9076
9077
  else delete out.layers;
9077
- if (_chunk3YDQLQH2cjs.normalizeProcessVersion.call(void 0, out.process) === _chunk3YDQLQH2cjs.LEGACY_PROCESS_VERSION) {
9078
+ if (_chunk32MMQYCQcjs.normalizeProcessVersion.call(void 0, out.process) === _chunk32MMQYCQcjs.LEGACY_PROCESS_VERSION) {
9078
9079
  delete out.process;
9079
9080
  if (!out.tint) delete out.tint;
9080
9081
  }
@@ -9085,7 +9086,7 @@ function withDevelop(layer, partial) {
9085
9086
  let i = filters.findIndex((f) => f.kind === "develop");
9086
9087
  if (i === -1) {
9087
9088
  filters.unshift({
9088
- id: layer.source === "document" ? _chunk3YDQLQH2cjs.DEVELOP_FILTER_ID : _chunk3YDQLQH2cjs.newLayerId.call(void 0, "flt"),
9089
+ id: layer.source === "document" ? _chunk32MMQYCQcjs.DEVELOP_FILTER_ID : _chunk32MMQYCQcjs.newLayerId.call(void 0, "flt"),
9089
9090
  kind: "develop",
9090
9091
  enabled: true,
9091
9092
  brightness: 0,
@@ -9094,7 +9095,7 @@ function withDevelop(layer, partial) {
9094
9095
  exposure: 0,
9095
9096
  temperature: 0,
9096
9097
  tint: 0,
9097
- process: _chunk3YDQLQH2cjs.LATEST_PROCESS_VERSION
9098
+ process: _chunk32MMQYCQcjs.LATEST_PROCESS_VERSION
9098
9099
  });
9099
9100
  i = 0;
9100
9101
  }
@@ -9103,7 +9104,7 @@ function withDevelop(layer, partial) {
9103
9104
  const v = partial[k];
9104
9105
  if (typeof v === "number" && Number.isFinite(v)) next[k] = v;
9105
9106
  }
9106
- if ("process" in partial) next.process = _chunk3YDQLQH2cjs.normalizeProcessVersion.call(void 0, partial.process);
9107
+ if ("process" in partial) next.process = _chunk32MMQYCQcjs.normalizeProcessVersion.call(void 0, partial.process);
9107
9108
  filters[i] = next;
9108
9109
  return { ...layer, filters };
9109
9110
  }
@@ -9112,7 +9113,7 @@ function withBlur(layer, radius) {
9112
9113
  const filters = (_nullishCoalesce(layer.filters, () => ( []))).filter((f) => f.kind !== "blur");
9113
9114
  if (radius > 0) {
9114
9115
  filters.push({
9115
- id: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _357 => _357.id]), () => ( (layer.source === "document" ? _chunk3YDQLQH2cjs.BLUR_FILTER_ID : _chunk3YDQLQH2cjs.newLayerId.call(void 0, "flt")))),
9116
+ id: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _357 => _357.id]), () => ( (layer.source === "document" ? _chunk32MMQYCQcjs.BLUR_FILTER_ID : _chunk32MMQYCQcjs.newLayerId.call(void 0, "flt")))),
9116
9117
  kind: "blur",
9117
9118
  enabled: true,
9118
9119
  radius
@@ -9136,7 +9137,7 @@ function mergeAdjustmentNode(node, update, width, height) {
9136
9137
  if (!update.mask) delete next.mask;
9137
9138
  else {
9138
9139
  const current = node.mask && !node.mask.source ? node.mask : null;
9139
- const memo = current ? _chunk3YDQLQH2cjs.legacyMaskOf.call(void 0, current, width, height) : null;
9140
+ const memo = current ? _chunk32MMQYCQcjs.legacyMaskOf.call(void 0, current, width, height) : null;
9140
9141
  if (current && memo && memo.width === update.mask.width && memo.height === update.mask.height && memo.rle === update.mask.rle) {
9141
9142
  next.mask = withMaskProps(current, {
9142
9143
  density: _nullishCoalesce(update.mask.density, () => ( 1)),
@@ -9144,7 +9145,7 @@ function mergeAdjustmentNode(node, update, width, height) {
9144
9145
  enabled: update.mask.enabled !== false
9145
9146
  });
9146
9147
  } else {
9147
- const m = _chunk3YDQLQH2cjs.rasterMaskFromLegacy.call(void 0, update.mask, width, height);
9148
+ const m = _chunk32MMQYCQcjs.rasterMaskFromLegacy.call(void 0, update.mask, width, height);
9148
9149
  if (m) next.mask = m;
9149
9150
  else delete next.mask;
9150
9151
  }
@@ -9183,7 +9184,7 @@ function resizeLegacyMasks(layers, from, to) {
9183
9184
  for (const l of _chunkHGTDMKNEcjs.flattenLayers.call(void 0, layers)) {
9184
9185
  if (l.type !== "adjustment" || !l.mask || l.mask.source) continue;
9185
9186
  const old = l.mask;
9186
- const mask = _chunk3YDQLQH2cjs.rasterMaskFromLegacy.call(void 0, _chunk3YDQLQH2cjs.legacyMaskOf.call(void 0, old, fw, fh), tw, th);
9187
+ const mask = _chunk32MMQYCQcjs.rasterMaskFromLegacy.call(void 0, _chunk32MMQYCQcjs.legacyMaskOf.call(void 0, old, fw, fh), tw, th);
9187
9188
  if (!mask) continue;
9188
9189
  out = _chunkHGTDMKNEcjs.mapLayer.call(void 0, out, l.id, (n) => ({ ...n, mask: { ...mask, density: old.density, feather: old.feather, enabled: old.enabled } }));
9189
9190
  }
@@ -9279,12 +9280,12 @@ function withoutAnnotations(layers) {
9279
9280
  function parseColor(value) {
9280
9281
  if (Array.isArray(value)) {
9281
9282
  if (value.length < 3 || value.length > 4 || !value.every((v) => typeof v === "number" && v >= 0 && v <= 255)) {
9282
- throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("A colour array is [r, g, b] or [r, g, b, a] with values 0..255.");
9283
+ throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("A colour array is [r, g, b] or [r, g, b, a] with values 0..255.");
9283
9284
  }
9284
9285
  return [Math.round(value[0]), Math.round(value[1]), Math.round(value[2]), Math.round(_nullishCoalesce(value[3], () => ( 255)))];
9285
9286
  }
9286
9287
  const m = /^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i.exec(String(value).trim());
9287
- if (!m) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`Invalid colour "${value}"; use #rrggbb or #rrggbbaa.`);
9288
+ if (!m) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`Invalid colour "${value}"; use #rrggbb or #rrggbbaa.`);
9288
9289
  let hex = m[1];
9289
9290
  if (hex.length === 3) hex = hex.split("").map((c) => c + c).join("");
9290
9291
  const n = (i) => parseInt(hex.slice(i, i + 2), 16);
@@ -9294,7 +9295,7 @@ function readImagePaint(raw) {
9294
9295
  try {
9295
9296
  return _chunkEBDCRTZIcjs.parsePaintSource.call(void 0, raw);
9296
9297
  } catch (e) {
9297
- if (e instanceof _chunkEBDCRTZIcjs.PaintSourceError) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(e.message);
9298
+ if (e instanceof _chunkEBDCRTZIcjs.PaintSourceError) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(e.message);
9298
9299
  throw e;
9299
9300
  }
9300
9301
  }
@@ -9485,7 +9486,7 @@ function loadImageEditorDocument(input) {
9485
9486
  // Optional: only present when something was selected when saving.
9486
9487
  selection: {
9487
9488
  parse: (value) => {
9488
- const mask = _chunk3YDQLQH2cjs.deserializeSelection.call(void 0, value);
9489
+ const mask = _chunk32MMQYCQcjs.deserializeSelection.call(void 0, value);
9489
9490
  const v = value;
9490
9491
  return { width: mask.width, height: mask.height, rle: v.rle };
9491
9492
  },
@@ -9573,7 +9574,7 @@ function loadLayeredDocument(doc) {
9573
9574
  },
9574
9575
  selection: {
9575
9576
  parse: (value) => {
9576
- const mask = _chunk3YDQLQH2cjs.deserializeSelection.call(void 0, value);
9577
+ const mask = _chunk32MMQYCQcjs.deserializeSelection.call(void 0, value);
9577
9578
  const v = value;
9578
9579
  return { width: mask.width, height: mask.height, rle: v.rle };
9579
9580
  },
@@ -10085,14 +10086,14 @@ function describeSelection(mask) {
10085
10086
  // src/image-editor/selection-tools.ts
10086
10087
  var modeSchema = {
10087
10088
  type: "string",
10088
- enum: [..._chunk3YDQLQH2cjs.SELECTION_MODES],
10089
+ enum: [..._chunk32MMQYCQcjs.SELECTION_MODES],
10089
10090
  description: "How the result combines with the current selection (default replace)."
10090
10091
  };
10091
10092
  var num2 = (v, d) => typeof v === "number" && Number.isFinite(v) ? v : d;
10092
10093
  function summary(controller) {
10093
10094
  const sel = controller.getSelection();
10094
10095
  const { width, height } = controller.getState().imageDimensions;
10095
- const area = _chunk3YDQLQH2cjs.selectionArea.call(void 0, sel);
10096
+ const area = _chunk32MMQYCQcjs.selectionArea.call(void 0, sel);
10096
10097
  return {
10097
10098
  empty: !sel,
10098
10099
  bounds: _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _369 => _369.bounds]), () => ( null)),
@@ -10138,7 +10139,7 @@ function createImageSelectionTools(controller) {
10138
10139
  },
10139
10140
  annotations: writeAnnotations("Select a region", true),
10140
10141
  handler: ({ shape, x, y, width, height, mode, feather }) => {
10141
- const opts = { mode: _chunk3YDQLQH2cjs.parseSelectionMode.call(void 0, mode), feather: num2(feather, 0) };
10142
+ const opts = { mode: _chunk32MMQYCQcjs.parseSelectionMode.call(void 0, mode), feather: num2(feather, 0) };
10142
10143
  switch (shape) {
10143
10144
  case "all":
10144
10145
  controller.selectAll();
@@ -10191,7 +10192,7 @@ function createImageSelectionTools(controller) {
10191
10192
  annotations: writeAnnotations("Select by colour", true),
10192
10193
  handler: async ({ x, y, color, tolerance, contiguous, fuzziness, sampleMerged, sample, mode }) => {
10193
10194
  const common = {
10194
- mode: _chunk3YDQLQH2cjs.parseSelectionMode.call(void 0, mode),
10195
+ mode: _chunk32MMQYCQcjs.parseSelectionMode.call(void 0, mode),
10195
10196
  sampleMerged: sampleMerged === true,
10196
10197
  sample: _nullishCoalesce(sample, () => ( "composite"))
10197
10198
  };
@@ -10212,7 +10213,7 @@ function createImageSelectionTools(controller) {
10212
10213
  inputSchema: {
10213
10214
  type: "object",
10214
10215
  properties: {
10215
- op: { type: "string", enum: [..._chunk3YDQLQH2cjs.SELECTION_MODIFY_OPS], description: "How to modify the selection." },
10216
+ op: { type: "string", enum: [..._chunk32MMQYCQcjs.SELECTION_MODIFY_OPS], description: "How to modify the selection." },
10216
10217
  radius: { type: "number", minimum: 0, maximum: 500, description: "Radius in pixels." }
10217
10218
  },
10218
10219
  required: ["op", "radius"],
@@ -10220,7 +10221,7 @@ function createImageSelectionTools(controller) {
10220
10221
  },
10221
10222
  annotations: writeAnnotations("Modify the selection"),
10222
10223
  handler: ({ op, radius }) => {
10223
- if (!_chunk3YDQLQH2cjs.SELECTION_MODIFY_OPS.includes(op)) throw new Error(`Unknown op "${String(op)}".`);
10224
+ if (!_chunk32MMQYCQcjs.SELECTION_MODIFY_OPS.includes(op)) throw new Error(`Unknown op "${String(op)}".`);
10224
10225
  if (!controller.getSelection()) throw new Error("Nothing is selected.");
10225
10226
  controller.modifySelection(op, Math.min(500, Math.max(0, num2(radius, 0))));
10226
10227
  return summary(controller);
@@ -10264,7 +10265,7 @@ function createImageSelectionTools(controller) {
10264
10265
  type: "object",
10265
10266
  properties: {
10266
10267
  layerId: { type: "string", description: "Existing adjustment layer to mask." },
10267
- kind: { type: "string", enum: _chunk3YDQLQH2cjs.ADJUSTMENT_KINDS.map((k) => k.kind), description: "Kind of a new layer to add and mask (instead of layerId)." },
10268
+ kind: { type: "string", enum: _chunk32MMQYCQcjs.ADJUSTMENT_KINDS.map((k) => k.kind), description: "Kind of a new layer to add and mask (instead of layerId)." },
10268
10269
  params: { type: "object", description: "Parameters for the new layer (see list_controls)." },
10269
10270
  density: { type: "number", minimum: 0, maximum: 1, description: "Mask density 0-1." },
10270
10271
  feather: { type: "number", minimum: 0, maximum: 1e3, description: "Mask feather in pixels." }
@@ -10284,11 +10285,11 @@ function createImageSelectionTools(controller) {
10284
10285
  if (!controller.getAdjustmentLayer(layerId)) throw new Error(`No adjustment layer "${layerId}".`);
10285
10286
  controller.applySelectionAsLayerMask(layerId, props);
10286
10287
  id = layerId;
10287
- } else if (_chunk3YDQLQH2cjs.isAdjustmentKind.call(void 0, kind)) {
10288
+ } else if (_chunk32MMQYCQcjs.isAdjustmentKind.call(void 0, kind)) {
10288
10289
  id = controller.addAdjustmentLayer({
10289
10290
  kind,
10290
10291
  params,
10291
- mask: _chunk3YDQLQH2cjs.layerMaskFromSelection.call(void 0, sel, props)
10292
+ mask: _chunk32MMQYCQcjs.layerMaskFromSelection.call(void 0, sel, props)
10292
10293
  });
10293
10294
  } else {
10294
10295
  throw new Error("Pass layerId (an existing layer) or kind (a new adjustment layer).");
@@ -10425,11 +10426,11 @@ function createImageEditTools(controller) {
10425
10426
  const geometry2 = () => {
10426
10427
  const s = controller.getState();
10427
10428
  const region = _nullishCoalesce(s.crop, () => ( { x: 0, y: 0, ...s.imageDimensions }));
10428
- const out = _chunk3YDQLQH2cjs.getRotatedSize.call(void 0, region.width, region.height, s.transform);
10429
+ const out = _chunk32MMQYCQcjs.getRotatedSize.call(void 0, region.width, region.height, s.transform);
10429
10430
  return {
10430
10431
  image: { ...s.imageDimensions },
10431
10432
  crop: s.crop ? { ...s.crop } : null,
10432
- rotation: _chunk3YDQLQH2cjs.normalizeAngle.call(void 0, s.transform.rotate),
10433
+ rotation: _chunk32MMQYCQcjs.normalizeAngle.call(void 0, s.transform.rotate),
10433
10434
  flipH: s.transform.flipH,
10434
10435
  flipV: s.transform.flipV,
10435
10436
  output: { width: Math.round(out.width), height: Math.round(out.height) }
@@ -10664,7 +10665,7 @@ function describeLayer(layer, activeId, boundsOf) {
10664
10665
  const out = {
10665
10666
  id: layer.id,
10666
10667
  type: layer.type,
10667
- name: layer.name || (layer.type === "adjustment" ? _chunk3YDQLQH2cjs.adjustmentKindLabel.call(void 0, layer.kind) : ""),
10668
+ name: layer.name || (layer.type === "adjustment" ? _chunk32MMQYCQcjs.adjustmentKindLabel.call(void 0, layer.kind) : ""),
10668
10669
  visible: layer.visible,
10669
10670
  opacity: round3(layer.opacity),
10670
10671
  blend: layer.blend,
@@ -10753,8 +10754,8 @@ function createImageLayerTools(controller) {
10753
10754
  };
10754
10755
  };
10755
10756
  const exists = (id, what = "layerId") => {
10756
- if (typeof id !== "string" || !id) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`${what} is required (a layer id from list_layers).`);
10757
- _chunk3YDQLQH2cjs.requireLayer.call(void 0, controller.getLayers(), id);
10757
+ if (typeof id !== "string" || !id) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`${what} is required (a layer id from list_layers).`);
10758
+ _chunk32MMQYCQcjs.requireLayer.call(void 0, controller.getLayers(), id);
10758
10759
  return id;
10759
10760
  };
10760
10761
  const listLayers = {
@@ -10790,7 +10791,7 @@ function createImageLayerTools(controller) {
10790
10791
  handler: ({ layerId, target }) => {
10791
10792
  const id = exists(layerId);
10792
10793
  const layer = controller.getLayer(id);
10793
- if (target === "mask" && !layer.mask) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask; add one with add_layer_mask.`);
10794
+ if (target === "mask" && !layer.mask) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask; add one with add_layer_mask.`);
10794
10795
  controller.setActiveLayer(id, _nullishCoalesce(target, () => ( "pixels")));
10795
10796
  return { layer: describe(id), activeTarget: controller.getState().activeTarget };
10796
10797
  }
@@ -10815,7 +10816,7 @@ function createImageLayerTools(controller) {
10815
10816
  },
10816
10817
  annotations: { title: "Add a pixel layer", ...WRITE2 },
10817
10818
  handler: async (args) => {
10818
- if (args.color !== void 0 && args.image !== void 0) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("Give color or image, not both.");
10819
+ if (args.color !== void 0 && args.image !== void 0) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("Give color or image, not both.");
10819
10820
  for (const k of ["aboveId", "belowId", "parentId"]) if (args[k] !== void 0) exists(args[k], k);
10820
10821
  const init = {
10821
10822
  name: args.name,
@@ -10905,7 +10906,7 @@ function createImageLayerTools(controller) {
10905
10906
  const id = exists(args.layerId);
10906
10907
  const props = {};
10907
10908
  for (const k of ["name", "visible", "opacity", "fillOpacity", "blend", "clipped", "locks", "collapsed"]) if (args[k] !== void 0) props[k] = args[k];
10908
- if (!Object.keys(props).length) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("Give at least one property to change.");
10909
+ if (!Object.keys(props).length) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("Give at least one property to change.");
10909
10910
  controller.setLayerProperties(id, props);
10910
10911
  return { layer: describe(id) };
10911
10912
  }
@@ -10999,8 +11000,8 @@ function createImageLayerTools(controller) {
10999
11000
  annotations: { title: "Move a layer's pixels", ...WRITE2 },
11000
11001
  handler: ({ layerId, x, y, dx, dy }) => {
11001
11002
  const id = exists(layerId);
11002
- if ([x, y, dx, dy].every((v) => v === void 0)) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("Give x and y, or dx and dy.");
11003
- if ((x !== void 0 || y !== void 0) && (dx !== void 0 || dy !== void 0)) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("Give x / y or dx / dy, not both.");
11003
+ if ([x, y, dx, dy].every((v) => v === void 0)) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("Give x and y, or dx and dy.");
11004
+ if ((x !== void 0 || y !== void 0) && (dx !== void 0 || dy !== void 0)) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("Give x / y or dx / dy, not both.");
11004
11005
  return { layerId: id, ...controller.offsetLayer(id, { x, y, dx, dy }) };
11005
11006
  }
11006
11007
  };
@@ -11072,7 +11073,7 @@ function createImageLayerTools(controller) {
11072
11073
  annotations: { title: "Set layer mask properties", ...WRITE_IDEMPOTENT2 },
11073
11074
  handler: ({ layerId, density, feather, enabled, linked }) => {
11074
11075
  const id = exists(layerId);
11075
- if ([density, feather, enabled, linked].every((v) => v === void 0)) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("Give density, feather, enabled or linked.");
11076
+ if ([density, feather, enabled, linked].every((v) => v === void 0)) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("Give density, feather, enabled or linked.");
11076
11077
  const mask = controller.setLayerMaskProps(id, {
11077
11078
  density,
11078
11079
  feather,
@@ -11155,7 +11156,7 @@ function createImageLayerTools(controller) {
11155
11156
  handler: (args) => {
11156
11157
  const id = exists(args.layerId);
11157
11158
  const changes = filterValues(args);
11158
- if (!Object.keys(changes).length) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("Give at least one value to change.");
11159
+ if (!Object.keys(changes).length) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("Give at least one value to change.");
11159
11160
  return { layerId: id, filters: controller.updateLayerFilter(id, args.filterId, changes) };
11160
11161
  }
11161
11162
  };
@@ -11419,8 +11420,8 @@ function describeLayerEffects(effects) {
11419
11420
  }
11420
11421
  function createImageEffectTools(controller) {
11421
11422
  const layerArg = (id) => {
11422
- if (typeof id !== "string" || !id) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("layerId is required (a layer id from list_layers).");
11423
- _chunk3YDQLQH2cjs.requireLayer.call(void 0, controller.getLayers(), id);
11423
+ if (typeof id !== "string" || !id) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("layerId is required (a layer id from list_layers).");
11424
+ _chunk32MMQYCQcjs.requireLayer.call(void 0, controller.getLayers(), id);
11424
11425
  return id;
11425
11426
  };
11426
11427
  const result = (layerId, extra = {}) => ({ layerId, ...extra, ...describeLayerEffects(controller.getLayerEffects(layerId)) });
@@ -11451,7 +11452,7 @@ function createImageEffectTools(controller) {
11451
11452
  annotations: { title: "Add a layer effect", ...WRITE3 },
11452
11453
  handler: ({ layerId, kind, settings, index }) => {
11453
11454
  const id = layerArg(layerId);
11454
- if (!_chunkHGTDMKNEcjs.isLayerEffectKind.call(void 0, kind)) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`kind must be one of ${_chunkHGTDMKNEcjs.LAYER_EFFECT_KINDS.join(", ")}.`);
11455
+ if (!_chunkHGTDMKNEcjs.isLayerEffectKind.call(void 0, kind)) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`kind must be one of ${_chunkHGTDMKNEcjs.LAYER_EFFECT_KINDS.join(", ")}.`);
11455
11456
  const { effect } = controller.addLayerEffect(id, kind, _nullishCoalesce(settings, () => ( {})), index);
11456
11457
  return result(id, { effectId: effect.id });
11457
11458
  }
@@ -11471,7 +11472,7 @@ function createImageEffectTools(controller) {
11471
11472
  handler: ({ layerId, effectId, settings }) => {
11472
11473
  const id = layerArg(layerId);
11473
11474
  const changes = _nullishCoalesce(settings, () => ( {}));
11474
- if (!Object.keys(changes).length) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("Give at least one setting to change.");
11475
+ if (!Object.keys(changes).length) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("Give at least one setting to change.");
11475
11476
  controller.updateLayerEffect(id, effectId, changes);
11476
11477
  return result(id);
11477
11478
  }
@@ -11523,7 +11524,7 @@ function createImageEffectTools(controller) {
11523
11524
  },
11524
11525
  annotations: { title: "Set the global light", ...WRITE_IDEMPOTENT3 },
11525
11526
  handler: ({ angle, altitude }) => {
11526
- if (angle === void 0 && altitude === void 0) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("Give angle, altitude or both.");
11527
+ if (angle === void 0 && altitude === void 0) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("Give angle, altitude or both.");
11527
11528
  const next = {};
11528
11529
  if (angle !== void 0) next.angle = angle;
11529
11530
  if (altitude !== void 0) next.altitude = altitude;
@@ -11736,7 +11737,7 @@ var PaintGesture = (_class11 = class {
11736
11737
  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.`);
11737
11738
  if (_optionalChain([layer, 'access', _383 => _383.locks, 'optionalAccess', _384 => _384.all]) || _optionalChain([layer, 'access', _385 => _385.locks, 'optionalAccess', _386 => _386.position])) throw new Error(`Layer "${layer.name}" has its position locked.`);
11738
11739
  const origin = layer.type === "pixel" ? { ...layer.offset } : layer.type === "smart" ? { ...layer.placement.corners[0] } : (() => {
11739
- const b = _chunk3YDQLQH2cjs.shapeGeometryBounds.call(void 0, layer);
11740
+ const b = _chunk32MMQYCQcjs.shapeGeometryBounds.call(void 0, layer);
11740
11741
  return b ? { x: b.x, y: b.y } : { x: 0, y: 0 };
11741
11742
  })();
11742
11743
  this.move = { id: layer.id, start: { x: sample.x, y: sample.y }, origin, moved: false };
@@ -11752,7 +11753,7 @@ var PaintGesture = (_class11 = class {
11752
11753
  return null;
11753
11754
  }
11754
11755
  } catch (err) {
11755
- this.error = _chunk3YDQLQH2cjs.userErrorMessage.call(void 0, err);
11756
+ this.error = _chunk32MMQYCQcjs.userErrorMessage.call(void 0, err);
11756
11757
  this.stroke = null;
11757
11758
  this.move = null;
11758
11759
  }
@@ -11774,7 +11775,7 @@ var PaintGesture = (_class11 = class {
11774
11775
  this.controller.offsetLayer(m.id, { x, y }, !m.moved);
11775
11776
  m.moved = true;
11776
11777
  } catch (err) {
11777
- this.error = _chunk3YDQLQH2cjs.userErrorMessage.call(void 0, err);
11778
+ this.error = _chunk32MMQYCQcjs.userErrorMessage.call(void 0, err);
11778
11779
  this.move = null;
11779
11780
  }
11780
11781
  }
@@ -11784,7 +11785,7 @@ var PaintGesture = (_class11 = class {
11784
11785
  try {
11785
11786
  this.stroke.end();
11786
11787
  } catch (err) {
11787
- this.error = _chunk3YDQLQH2cjs.userErrorMessage.call(void 0, err);
11788
+ this.error = _chunk32MMQYCQcjs.userErrorMessage.call(void 0, err);
11788
11789
  }
11789
11790
  }
11790
11791
  this.stroke = null;
@@ -11894,9 +11895,9 @@ function createImagePaintTools(controller) {
11894
11895
  annotations: { title: "Paint a brush stroke", ...WRITE4 },
11895
11896
  handler: (args) => {
11896
11897
  const tool = args.tool;
11897
- if (args.mixer !== void 0 && tool !== "mixer") throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)('mixer settings apply to the Mixer Brush only; pass tool "mixer", or drop mixer.');
11898
- if (args.paint !== void 0 && (_nullishCoalesce(tool, () => ( "brush"))) !== "brush") throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)('paint applies to the brush only (the eraser removes paint; the Mixer Brush loads color); drop paint or use tool "brush".');
11899
- if (args.paint !== void 0 && args.color !== void 0) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("Give color or paint, not both.");
11898
+ if (args.mixer !== void 0 && tool !== "mixer") throw new (0, _chunk32MMQYCQcjs.LayerOperationError)('mixer settings apply to the Mixer Brush only; pass tool "mixer", or drop mixer.');
11899
+ if (args.paint !== void 0 && (_nullishCoalesce(tool, () => ( "brush"))) !== "brush") throw new (0, _chunk32MMQYCQcjs.LayerOperationError)('paint applies to the brush only (the eraser removes paint; the Mixer Brush loads color); drop paint or use tool "brush".');
11900
+ if (args.paint !== void 0 && args.color !== void 0) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("Give color or paint, not both.");
11900
11901
  const result = controller.paintStroke({
11901
11902
  tool,
11902
11903
  points: args.points,
@@ -12027,7 +12028,7 @@ function profileArg(v) {
12027
12028
  try {
12028
12029
  return _chunkCWM3CUUXcjs.base64ToBytes.call(void 0, s.slice(4));
12029
12030
  } catch (e32) {
12030
- throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("The icc: value is not valid base64.");
12031
+ throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("The icc: value is not valid base64.");
12031
12032
  }
12032
12033
  }
12033
12034
  return s;
@@ -12092,10 +12093,10 @@ function createImageColorTools(controller) {
12092
12093
  annotations: { title: "Set up soft proofing", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
12093
12094
  handler: (args) => {
12094
12095
  if (args.off === true) {
12095
- if (args.profile !== void 0) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("Give either off true or a profile, not both.");
12096
+ if (args.profile !== void 0) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("Give either off true or a profile, not both.");
12096
12097
  return controller.setProofSetup(null);
12097
12098
  }
12098
- if (args.profile === void 0) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("Pass the profile to proof with (e.g. coated-cmyk), or off true.");
12099
+ if (args.profile === void 0) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("Pass the profile to proof with (e.g. coated-cmyk), or off true.");
12099
12100
  const s = controller.setProofSetup({
12100
12101
  profile: profileArg(args.profile),
12101
12102
  ...args.intent !== void 0 ? { intent: args.intent } : {},
@@ -12147,7 +12148,7 @@ function createImageColorTools(controller) {
12147
12148
  },
12148
12149
  annotations: { title: "Set the colour mode", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
12149
12150
  handler: (args) => {
12150
- if (args.mode !== "cmyk" && (args.profile !== void 0 || args.intent !== void 0)) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("profile and intent apply to CMYK mode only.");
12151
+ if (args.mode !== "cmyk" && (args.profile !== void 0 || args.intent !== void 0)) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("profile and intent apply to CMYK mode only.");
12151
12152
  return controller.setColorMode(args.mode, {
12152
12153
  ...args.profile !== void 0 ? { profile: profileArg(args.profile) } : {},
12153
12154
  ...args.intent !== void 0 ? { intent: args.intent } : {}
@@ -12212,7 +12213,7 @@ function checkSource(controller, source) {
12212
12213
  const p = source;
12213
12214
  const { width, height } = controller.getState().imageDimensions;
12214
12215
  if (!(p.x >= 0 && p.y >= 0 && p.x < width && p.y < height)) {
12215
- throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`source (${p.x}, ${p.y}) is outside the ${width} \xD7 ${height} canvas; pick a point on the image to sample.`);
12216
+ throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`source (${p.x}, ${p.y}) is outside the ${width} \xD7 ${height} canvas; pick a point on the image to sample.`);
12216
12217
  }
12217
12218
  return p;
12218
12219
  }
@@ -12452,10 +12453,10 @@ function createImageRetouchTools(controller) {
12452
12453
  annotations: { title: "Set the clone source", ...WRITE5, idempotentHint: true },
12453
12454
  handler: (args) => {
12454
12455
  if (args.clear === true) {
12455
- if (args.x !== void 0 || args.y !== void 0) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("Give either clear true or x and y, not both.");
12456
+ if (args.x !== void 0 || args.y !== void 0) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("Give either clear true or x and y, not both.");
12456
12457
  return controller.setCloneSource(null);
12457
12458
  }
12458
- if (typeof args.x !== "number" || typeof args.y !== "number") throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("Pass x and y (document pixels) for the source point, or clear true to remove it.");
12459
+ if (typeof args.x !== "number" || typeof args.y !== "number") throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("Pass x and y (document pixels) for the source point, or clear true to remove it.");
12459
12460
  return controller.setCloneSource(checkSource(controller, { x: args.x, y: args.y }));
12460
12461
  }
12461
12462
  };
@@ -12478,7 +12479,7 @@ function createImageRetouchTools(controller) {
12478
12479
  annotations: { title: "Transform the clone source", ...WRITE5, idempotentHint: false },
12479
12480
  handler: (args) => {
12480
12481
  if (args.reset === true) {
12481
- if (Object.keys(args).some((k) => k !== "reset")) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("Give either reset true or transform values, not both.");
12482
+ if (Object.keys(args).some((k) => k !== "reset")) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("Give either reset true or transform values, not both.");
12482
12483
  return controller.setCloneTransform(null);
12483
12484
  }
12484
12485
  const cur = controller.getState().paint.cloneTransform;
@@ -12488,7 +12489,7 @@ function createImageRetouchTools(controller) {
12488
12489
  if (args.rotate !== void 0) next.rotate = args.rotate;
12489
12490
  if (args.flipHorizontal === true) next.scaleX = -(_nullishCoalesce(next.scaleX, () => ( cur.scaleX)));
12490
12491
  if (args.flipVertical === true) next.scaleY = -(_nullishCoalesce(next.scaleY, () => ( cur.scaleY)));
12491
- if (!Object.keys(next).length) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("Pass scaleX, scaleY, rotate, flipHorizontal or flipVertical, or reset true.");
12492
+ if (!Object.keys(next).length) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("Pass scaleX, scaleY, rotate, flipHorizontal or flipVertical, or reset true.");
12492
12493
  return controller.setCloneTransform(next);
12493
12494
  }
12494
12495
  };
@@ -12509,11 +12510,11 @@ var DATA = {
12509
12510
  description: "The PSD or PSB file as base64 (a `data:` URL prefix is accepted)."
12510
12511
  };
12511
12512
  function psdBytesFromBase64(data) {
12512
- if (typeof data !== "string" || !data.trim()) throw new (0, _chunk3YDQLQH2cjs.PsdError)("data is required: the PSD file as base64.");
12513
+ if (typeof data !== "string" || !data.trim()) throw new (0, _chunk32MMQYCQcjs.PsdError)("data is required: the PSD file as base64.");
12513
12514
  const body = data.trim().replace(/^data:[^,]*;base64,/i, "");
12514
- if (!/^[A-Za-z0-9+/=_\s-]+$/.test(body)) throw new (0, _chunk3YDQLQH2cjs.PsdError)("data is not base64; send the PSD file bytes base64-encoded.");
12515
+ if (!/^[A-Za-z0-9+/=_\s-]+$/.test(body)) throw new (0, _chunk32MMQYCQcjs.PsdError)("data is not base64; send the PSD file bytes base64-encoded.");
12515
12516
  const bytes = _chunkCWM3CUUXcjs.base64ToBytes.call(void 0, body);
12516
- if (bytes.length < 26) throw new (0, _chunk3YDQLQH2cjs.PsdError)(`data decodes to ${bytes.length} bytes, too short for a PSD (at least 26).`);
12517
+ if (bytes.length < 26) throw new (0, _chunk32MMQYCQcjs.PsdError)(`data decodes to ${bytes.length} bytes, too short for a PSD (at least 26).`);
12517
12518
  return bytes;
12518
12519
  }
12519
12520
  function createImagePsdTools(controller) {
@@ -12524,7 +12525,7 @@ function createImagePsdTools(controller) {
12524
12525
  inputSchema: { type: "object", properties: { data: DATA }, required: ["data"], additionalProperties: false },
12525
12526
  annotations: { title: "Inspect a PSD", ...READ7 },
12526
12527
  handler: ({ data }) => {
12527
- const res = _chunk3YDQLQH2cjs.importPsd.call(void 0, psdBytesFromBase64(data), { skipPixels: true });
12528
+ const res = _chunk32MMQYCQcjs.importPsd.call(void 0, psdBytesFromBase64(data), { skipPixels: true });
12528
12529
  return {
12529
12530
  width: res.width,
12530
12531
  height: res.height,
@@ -12611,7 +12612,7 @@ var GEOMETRY = {
12611
12612
  dy: { type: "number", description: "Move down after scaling and rotating, in document pixels (default 0)." },
12612
12613
  reference: {
12613
12614
  description: "Fixed point of scale, skew and rotate: an anchor of the frame (top-left, top, top-right, left, center, right, bottom-left, bottom, bottom-right; default center) or a document point {x, y}.",
12614
- anyOf: [{ type: "string", enum: _chunk3YDQLQH2cjs.TRANSFORM_ANCHORS }, POINT]
12615
+ anyOf: [{ type: "string", enum: _chunk32MMQYCQcjs.TRANSFORM_ANCHORS }, POINT]
12615
12616
  },
12616
12617
  matrix: {
12617
12618
  type: "array",
@@ -12632,14 +12633,14 @@ var NUMERIC = ["scaleX", "scaleY", "rotate", "skewX", "skewY", "dx", "dy", "refe
12632
12633
  function geometryFrom(args) {
12633
12634
  const numeric = NUMERIC.filter((k) => args[k] !== void 0);
12634
12635
  const ways = [numeric.length > 0, args.matrix !== void 0, args.corners !== void 0].filter(Boolean).length;
12635
- if (ways === 0) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("Give the transform one way: numeric fields (scaleX, scaleY, rotate, skewX, skewY, dx, dy, reference), matrix, or corners.");
12636
- if (ways > 1) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("Give the transform only one way: numeric fields, matrix or corners, not a mix.");
12636
+ if (ways === 0) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("Give the transform one way: numeric fields (scaleX, scaleY, rotate, skewX, skewY, dx, dy, reference), matrix, or corners.");
12637
+ if (ways > 1) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("Give the transform only one way: numeric fields, matrix or corners, not a mix.");
12637
12638
  if (args.matrix !== void 0) return { matrix: args.matrix };
12638
12639
  if (args.corners !== void 0) return { corners: args.corners };
12639
12640
  const params = {};
12640
12641
  for (const k of NUMERIC) if (args[k] !== void 0) params[k] = args[k];
12641
- if (params.scaleX === 0 || params.scaleY === 0) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("scaleX and scaleY must not be 0 (that collapses the layer to a line).");
12642
- if (typeof params.reference === "string" && !_chunk3YDQLQH2cjs.isTransformAnchor.call(void 0, params.reference)) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`Unknown reference "${params.reference}". Use ${_chunk3YDQLQH2cjs.TRANSFORM_ANCHORS.join(", ")} or {x, y}.`);
12642
+ if (params.scaleX === 0 || params.scaleY === 0) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("scaleX and scaleY must not be 0 (that collapses the layer to a line).");
12643
+ if (typeof params.reference === "string" && !_chunk32MMQYCQcjs.isTransformAnchor.call(void 0, params.reference)) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`Unknown reference "${params.reference}". Use ${_chunk32MMQYCQcjs.TRANSFORM_ANCHORS.join(", ")} or {x, y}.`);
12643
12644
  return { params };
12644
12645
  }
12645
12646
  function targetFrom(args) {
@@ -12688,15 +12689,15 @@ function createImageTransformTools(controller) {
12688
12689
  moved: [...s.moves],
12689
12690
  frame: { ...s.box },
12690
12691
  corners: s.startGeometry.corners.map(roundPoint),
12691
- center: roundPoint(_chunk3YDQLQH2cjs.anchorPoint.call(void 0, s.startGeometry, "center"))
12692
+ center: roundPoint(_chunk32MMQYCQcjs.anchorPoint.call(void 0, s.startGeometry, "center"))
12692
12693
  };
12693
12694
  if (s.smartObject) out.smartObject = true;
12694
12695
  s.cancel();
12695
12696
  if (args.meshColumns !== void 0) {
12696
12697
  const cols = args.meshColumns;
12697
12698
  const rows = _nullishCoalesce(args.meshRows, () => ( cols));
12698
- const mesh = _chunkQMI5HZWAcjs.identityWarpMesh.call(void 0, s.box, cols, rows);
12699
- out.mesh = { columns: cols, rows, pointsPerRow: _chunkQMI5HZWAcjs.warpMeshColumns.call(void 0, mesh), pointRows: _chunkQMI5HZWAcjs.warpMeshRows.call(void 0, mesh), points: mesh.points.map(roundPoint) };
12699
+ const mesh = _chunk236TKNURcjs.identityWarpMesh.call(void 0, s.box, cols, rows);
12700
+ out.mesh = { columns: cols, rows, pointsPerRow: _chunk236TKNURcjs.warpMeshColumns.call(void 0, mesh), pointRows: _chunk236TKNURcjs.warpMeshRows.call(void 0, mesh), points: mesh.points.map(roundPoint) };
12700
12701
  }
12701
12702
  return out;
12702
12703
  }
@@ -12721,7 +12722,7 @@ function createImageTransformTools(controller) {
12721
12722
  type: "object",
12722
12723
  properties: {
12723
12724
  ...TARGET3,
12724
- style: { type: "string", enum: _chunkQMI5HZWAcjs.WARP_STYLES, description: "Preset warp (Photoshop\u2019s menu): arc, arcLower, arcUpper, arch, bulge, shellLower, shellUpper, flag, wave, fish, rise, fisheye, inflate, squeeze, twist." },
12725
+ style: { type: "string", enum: _chunk236TKNURcjs.WARP_STYLES, description: "Preset warp (Photoshop\u2019s menu): arc, arcLower, arcUpper, arch, bulge, shellLower, shellUpper, flag, wave, fish, rise, fisheye, inflate, squeeze, twist." },
12725
12726
  bend: { type: "number", minimum: -100, maximum: 100, description: "Preset bend in percent, \u2212100..100 (default 50)." },
12726
12727
  horizontal: { type: "number", minimum: -100, maximum: 100, description: "Preset horizontal distortion in percent, \u2212100..100 (default 0)." },
12727
12728
  vertical: { type: "number", minimum: -100, maximum: 100, description: "Preset vertical distortion in percent, \u2212100..100 (default 0)." },
@@ -12743,11 +12744,11 @@ function createImageTransformTools(controller) {
12743
12744
  annotations: { title: "Warp a layer", ...WRITE6 },
12744
12745
  handler: (args) => {
12745
12746
  const hasPreset = ["style", "bend", "horizontal", "vertical", "orientation"].some((k) => args[k] !== void 0);
12746
- if (hasPreset && args.mesh !== void 0) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("Give a preset (style, bend, horizontal, vertical, orientation) or a mesh, not both.");
12747
- if (!hasPreset && args.mesh === void 0) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("Give a preset style or a mesh.");
12747
+ if (hasPreset && args.mesh !== void 0) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("Give a preset (style, bend, horizontal, vertical, orientation) or a mesh, not both.");
12748
+ if (!hasPreset && args.mesh === void 0) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("Give a preset style or a mesh.");
12748
12749
  let warp;
12749
12750
  if (hasPreset) {
12750
- if (args.style === void 0) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`style is required with a preset. Styles: ${_chunkQMI5HZWAcjs.WARP_STYLES.join(", ")}.`);
12751
+ if (args.style === void 0) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`style is required with a preset. Styles: ${_chunk236TKNURcjs.WARP_STYLES.join(", ")}.`);
12751
12752
  warp = {
12752
12753
  style: args.style,
12753
12754
  bend: _nullishCoalesce(args.bend, () => ( 50)),
@@ -12758,7 +12759,7 @@ function createImageTransformTools(controller) {
12758
12759
  } else {
12759
12760
  const m = args.mesh;
12760
12761
  const want = (3 * m.columns + 1) * (3 * m.rows + 1);
12761
- if (m.points.length !== want) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`A ${m.columns} \xD7 ${m.rows} mesh needs (3\xB7${m.columns} + 1) \xD7 (3\xB7${m.rows} + 1) = ${want} points, got ${m.points.length}.`);
12762
+ if (m.points.length !== want) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`A ${m.columns} \xD7 ${m.rows} mesh needs (3\xB7${m.columns} + 1) \xD7 (3\xB7${m.rows} + 1) = ${want} points, got ${m.points.length}.`);
12762
12763
  const knots = (n) => Array.from({ length: n + 1 }, (_, i) => i / n);
12763
12764
  warp = { us: knots(m.columns), vs: knots(m.rows), points: m.points.map((p) => ({ x: p.x, y: p.y })) };
12764
12765
  }
@@ -12853,13 +12854,13 @@ function settingsFrom(args) {
12853
12854
  return out;
12854
12855
  }
12855
12856
  function imageArg(image) {
12856
- if (typeof image !== "string" || !image.trim()) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("image is required: a PNG as a data URL or base64 (other formats need a browser).");
12857
+ if (typeof image !== "string" || !image.trim()) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("image is required: a PNG as a data URL or base64 (other formats need a browser).");
12857
12858
  return image.trim();
12858
12859
  }
12859
12860
  function createImageSmartObjectTools(controller) {
12860
12861
  const smartId = (id) => {
12861
- if (typeof id !== "string" || !id) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("layerId is required (a smart object id from list_layers).");
12862
- _chunk3YDQLQH2cjs.requireSmartObject.call(void 0, controller.getLayers(), id);
12862
+ if (typeof id !== "string" || !id) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("layerId is required (a smart object id from list_layers).");
12863
+ _chunk32MMQYCQcjs.requireSmartObject.call(void 0, controller.getLayers(), id);
12863
12864
  return id;
12864
12865
  };
12865
12866
  const info = (id) => {
@@ -12896,7 +12897,7 @@ function createImageSmartObjectTools(controller) {
12896
12897
  },
12897
12898
  annotations: { title: "Convert to Smart Object", ...WRITE7 },
12898
12899
  handler: ({ layerIds, name }) => {
12899
- for (const id2 of _nullishCoalesce(layerIds, () => ( []))) _chunk3YDQLQH2cjs.requireLayer.call(void 0, controller.getLayers(), id2);
12900
+ for (const id2 of _nullishCoalesce(layerIds, () => ( []))) _chunk32MMQYCQcjs.requireLayer.call(void 0, controller.getLayers(), id2);
12900
12901
  const id = controller.convertToSmartObject(layerIds, { name });
12901
12902
  return { layer: layerSummary(id), smartObject: info(id) };
12902
12903
  }
@@ -12933,7 +12934,7 @@ function createImageSmartObjectTools(controller) {
12933
12934
  {
12934
12935
  type: "object",
12935
12936
  properties: {
12936
- style: { type: "string", enum: _chunkQMI5HZWAcjs.WARP_STYLES, description: "Preset (Photoshop\u2019s menu)." },
12937
+ style: { type: "string", enum: _chunk236TKNURcjs.WARP_STYLES, description: "Preset (Photoshop\u2019s menu)." },
12937
12938
  bend: { type: "number", minimum: -100, maximum: 100, description: "Bend in percent (default 50)." },
12938
12939
  horizontal: { type: "number", minimum: -100, maximum: 100, description: "Horizontal distortion in percent (default 0)." },
12939
12940
  vertical: { type: "number", minimum: -100, maximum: 100, description: "Vertical distortion in percent (default 0)." },
@@ -12969,12 +12970,12 @@ function createImageSmartObjectTools(controller) {
12969
12970
  else if (w) {
12970
12971
  const m = w;
12971
12972
  const want = (3 * m.columns + 1) * (3 * m.rows + 1);
12972
- if (m.points.length !== want) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`A ${m.columns} \xD7 ${m.rows} mesh needs (3\xB7${m.columns} + 1) \xD7 (3\xB7${m.rows} + 1) = ${want} points, got ${m.points.length}.`);
12973
+ if (m.points.length !== want) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`A ${m.columns} \xD7 ${m.rows} mesh needs (3\xB7${m.columns} + 1) \xD7 (3\xB7${m.rows} + 1) = ${want} points, got ${m.points.length}.`);
12973
12974
  const knots = (n) => Array.from({ length: n + 1 }, (_, i) => i / n);
12974
12975
  warp = { us: knots(m.columns), vs: knots(m.rows), points: m.points.map((p) => ({ x: p.x, y: p.y })) };
12975
12976
  }
12976
12977
  const keys = ["corners", "matrix", "scaleX", "scaleY", "rotate", "skewX", "skewY", "x", "y", "warp", "interpolation"];
12977
- if (!keys.some((k) => args[k] !== void 0)) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`Give something to set: ${keys.join(", ")}.`);
12978
+ if (!keys.some((k) => args[k] !== void 0)) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`Give something to set: ${keys.join(", ")}.`);
12978
12979
  const res = controller.setSmartObjectTransform(id, {
12979
12980
  corners: args.corners,
12980
12981
  matrix: args.matrix,
@@ -13099,7 +13100,7 @@ function createImageSmartObjectTools(controller) {
13099
13100
  handler: (args) => {
13100
13101
  const id = smartId(args.layerId);
13101
13102
  const changes = settingsFrom(args);
13102
- if (!Object.keys(changes).length) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("Give at least one value to change.");
13103
+ if (!Object.keys(changes).length) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("Give at least one value to change.");
13103
13104
  const filter = controller.updateSmartFilter(id, args.filterId, changes);
13104
13105
  return { layerId: id, filter, smartFilters: info(id).smartFilters };
13105
13106
  }
@@ -13420,8 +13421,8 @@ function geometry(args) {
13420
13421
  }
13421
13422
  function createImageShapeTools(controller) {
13422
13423
  const shapeId = (id) => {
13423
- if (typeof id !== "string" || !id) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("layerId is required (a shape layer id from list_layers).");
13424
- _chunk3YDQLQH2cjs.requireShapeLayer.call(void 0, controller.getLayers(), id);
13424
+ if (typeof id !== "string" || !id) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("layerId is required (a shape layer id from list_layers).");
13425
+ _chunk32MMQYCQcjs.requireShapeLayer.call(void 0, controller.getLayers(), id);
13425
13426
  return id;
13426
13427
  };
13427
13428
  const layerSummary = (id) => {
@@ -13496,7 +13497,7 @@ function createImageShapeTools(controller) {
13496
13497
  annotations: { title: "Restyle a shape", ...WRITE_IDEMPOTENT5 },
13497
13498
  handler: ({ layerId, fill, stroke, fillRule }) => {
13498
13499
  const id = shapeId(layerId);
13499
- if (fill === void 0 && stroke === void 0 && fillRule === void 0) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("Give fill, stroke or fillRule to change.");
13500
+ if (fill === void 0 && stroke === void 0 && fillRule === void 0) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("Give fill, stroke or fillRule to change.");
13500
13501
  return controller.setShapeStyle(id, { fill, stroke, fillRule });
13501
13502
  }
13502
13503
  };
@@ -13545,7 +13546,7 @@ function createImageShapeTools(controller) {
13545
13546
  handler: ({ layerId, componentIndex, ...rest }) => {
13546
13547
  const id = shapeId(layerId);
13547
13548
  const change = geometry(rest);
13548
- if (change.shape === void 0 && change.subpaths === void 0 && change.op === void 0) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("Give shape, subpaths or op to change.");
13549
+ if (change.shape === void 0 && change.subpaths === void 0 && change.op === void 0) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("Give shape, subpaths or op to change.");
13549
13550
  return controller.setShapeComponent(id, componentIndex, change);
13550
13551
  }
13551
13552
  };
@@ -13619,8 +13620,8 @@ function pick2(args, keys) {
13619
13620
  }
13620
13621
  function createImageTypeTools(controller) {
13621
13622
  const typeId = (id) => {
13622
- if (typeof id !== "string" || !id) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("layerId is required (a type layer id from list_layers).");
13623
- _chunk3YDQLQH2cjs.requireTypeLayer.call(void 0, controller.getLayers(), id);
13623
+ if (typeof id !== "string" || !id) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("layerId is required (a type layer id from list_layers).");
13624
+ _chunk32MMQYCQcjs.requireTypeLayer.call(void 0, controller.getLayers(), id);
13624
13625
  return id;
13625
13626
  };
13626
13627
  const layerSummary = (id) => {
@@ -13700,7 +13701,7 @@ function createImageTypeTools(controller) {
13700
13701
  annotations: { title: "Style a range of text", ...WRITE_IDEMPOTENT6 },
13701
13702
  handler: (args) => {
13702
13703
  const style = pick2(args, Object.keys(STYLE));
13703
- if (!Object.keys(style).length) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`Give at least one style field: ${Object.keys(STYLE).join(", ")}.`);
13704
+ if (!Object.keys(style).length) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`Give at least one style field: ${Object.keys(STYLE).join(", ")}.`);
13704
13705
  return controller.setTextStyle(typeId(args.layerId), style, range(args));
13705
13706
  }
13706
13707
  };
@@ -13712,7 +13713,7 @@ function createImageTypeTools(controller) {
13712
13713
  annotations: { title: "Style paragraphs", ...WRITE_IDEMPOTENT6 },
13713
13714
  handler: (args) => {
13714
13715
  const style = pick2(args, Object.keys(PARAGRAPH));
13715
- if (!Object.keys(style).length) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)(`Give at least one paragraph field: ${Object.keys(PARAGRAPH).join(", ")}.`);
13716
+ if (!Object.keys(style).length) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)(`Give at least one paragraph field: ${Object.keys(PARAGRAPH).join(", ")}.`);
13716
13717
  return controller.setParagraphStyle(typeId(args.layerId), style, range(args));
13717
13718
  }
13718
13719
  };
@@ -13734,7 +13735,7 @@ function createImageTypeTools(controller) {
13734
13735
  annotations: { title: "Point or paragraph text", ...WRITE_IDEMPOTENT6 },
13735
13736
  handler: ({ layerId, kind, width, height }) => {
13736
13737
  const id = typeId(layerId);
13737
- if (kind === "box" && (width === void 0 || height === void 0)) throw new (0, _chunk3YDQLQH2cjs.LayerOperationError)("kind box needs width and height in pixels.");
13738
+ if (kind === "box" && (width === void 0 || height === void 0)) throw new (0, _chunk32MMQYCQcjs.LayerOperationError)("kind box needs width and height in pixels.");
13738
13739
  return controller.setTextFrame(id, kind === "box" ? { kind: "box", width, height } : { kind: "point" });
13739
13740
  }
13740
13741
  };
@@ -13756,7 +13757,7 @@ function createImageTypeTools(controller) {
13756
13757
  var LAYER_PATH = /^layers\.([^.]+)\.(.+)$/;
13757
13758
  function adjustmentsSummary(adjustments) {
13758
13759
  return {
13759
- process: _chunk3YDQLQH2cjs.normalizeProcessVersion.call(void 0, adjustments.process),
13760
+ process: _chunk32MMQYCQcjs.normalizeProcessVersion.call(void 0, adjustments.process),
13760
13761
  values: readAdjustmentControls(adjustments),
13761
13762
  layers: (_nullishCoalesce(adjustments.layers, () => ( []))).map((l) => JSON.parse(JSON.stringify(l)))
13762
13763
  };
@@ -13799,7 +13800,7 @@ function createImageEditorToolProvider(controller, options = {}) {
13799
13800
  default: def,
13800
13801
  ...requiresProcess ? { requiresProcess } : {}
13801
13802
  })),
13802
- layerKinds: _chunk3YDQLQH2cjs.ADJUSTMENT_KINDS.map(({ kind, label }) => ({
13803
+ layerKinds: _chunk32MMQYCQcjs.ADJUSTMENT_KINDS.map(({ kind, label }) => ({
13803
13804
  kind,
13804
13805
  label,
13805
13806
  controls: [...ADJUSTMENT_LAYER_CONTROLS[kind], ADJUSTMENT_LAYER_OPACITY_CONTROL].map(({ id, label: l, min, max, step, default: def }) => ({
@@ -13885,7 +13886,7 @@ function createImageEditorToolProvider(controller, options = {}) {
13885
13886
  const result = { applied, clamped };
13886
13887
  if (typeof label === "string" && label) result.label = label;
13887
13888
  const notes = [];
13888
- if ("tint" in applied && _chunk3YDQLQH2cjs.normalizeProcessVersion.call(void 0, controller.getState().adjustments.process) < 2) {
13889
+ if ("tint" in applied && _chunk32MMQYCQcjs.normalizeProcessVersion.call(void 0, controller.getState().adjustments.process) < 2) {
13889
13890
  notes.push("Tint has no effect on process 1 edits.");
13890
13891
  }
13891
13892
  if (notes.length) result.notes = notes;
@@ -13895,11 +13896,11 @@ function createImageEditorToolProvider(controller, options = {}) {
13895
13896
  const addLayer = {
13896
13897
  name: "add_adjustment_layer",
13897
13898
  title: "Add an adjustment layer",
13898
- description: "Adds a non-destructive adjustment layer on top of the stack (one undoable step) and returns it. Kinds: " + _chunk3YDQLQH2cjs.ADJUSTMENT_KINDS.map((k) => k.kind).join(", ") + ". Omitted params are neutral.",
13899
+ description: "Adds a non-destructive adjustment layer on top of the stack (one undoable step) and returns it. Kinds: " + _chunk32MMQYCQcjs.ADJUSTMENT_KINDS.map((k) => k.kind).join(", ") + ". Omitted params are neutral.",
13899
13900
  inputSchema: {
13900
13901
  type: "object",
13901
13902
  properties: {
13902
- kind: { type: "string", enum: _chunk3YDQLQH2cjs.ADJUSTMENT_KINDS.map((k) => k.kind), description: "Adjustment kind." },
13903
+ kind: { type: "string", enum: _chunk32MMQYCQcjs.ADJUSTMENT_KINDS.map((k) => k.kind), description: "Adjustment kind." },
13903
13904
  params: { type: "object", description: "Initial parameters (see list_controls); merged with neutral defaults." },
13904
13905
  opacity: { type: "number", minimum: 0, maximum: 1, description: "Layer opacity 0-1 (default 1)." },
13905
13906
  blend: { type: "string", enum: _chunkCWM3CUUXcjs.BLEND_MODES.map((m) => m.id), description: "Blend mode (default normal)." },
@@ -13918,7 +13919,7 @@ function createImageEditorToolProvider(controller, options = {}) {
13918
13919
  openWorldHint: false
13919
13920
  },
13920
13921
  handler: ({ kind, params, opacity, blend, name, aboveId, parentId }) => {
13921
- if (!_chunk3YDQLQH2cjs.isAdjustmentKind.call(void 0, kind)) throw new Error(`Unknown adjustment kind "${kind}".`);
13922
+ if (!_chunk32MMQYCQcjs.isAdjustmentKind.call(void 0, kind)) throw new Error(`Unknown adjustment kind "${kind}".`);
13922
13923
  if (blend !== void 0 && !_chunkCWM3CUUXcjs.isBlendMode.call(void 0, blend)) throw new Error(`Unknown blend mode "${blend}".`);
13923
13924
  if (aboveId !== void 0 && parentId !== void 0) throw new Error("Give aboveId or parentId, not both.");
13924
13925
  for (const ref of [aboveId, parentId]) {
@@ -14015,7 +14016,7 @@ function boxToCurvePoint(x, y, width, height) {
14015
14016
  return { input: clampLevel(x / (width || 1) * 255), output: clampLevel((height - y) / (height || 1) * 255) };
14016
14017
  }
14017
14018
  function curveSvgPath(points, width, height, samples = 64) {
14018
- const lut = _chunk3YDQLQH2cjs.curveLutFromLevels.call(void 0, points);
14019
+ const lut = _chunk32MMQYCQcjs.curveLutFromLevels.call(void 0, points);
14019
14020
  const n = lut.length - 1;
14020
14021
  let d = "";
14021
14022
  for (let i = 0; i <= samples; i++) {
@@ -14323,7 +14324,7 @@ function layerPanelRows(layers, activeId) {
14323
14324
  }
14324
14325
  function layerLabel(layer) {
14325
14326
  if (layer.name) return layer.name;
14326
- if (layer.type === "adjustment") return _chunk3YDQLQH2cjs.adjustmentKindLabel.call(void 0, layer.kind);
14327
+ if (layer.type === "adjustment") return _chunk32MMQYCQcjs.adjustmentKindLabel.call(void 0, layer.kind);
14327
14328
  return layer.type === "group" ? "Group" : "Layer";
14328
14329
  }
14329
14330
  function layerBadge(layer) {
@@ -14543,7 +14544,7 @@ function newLayerOptions(_controller) {
14543
14544
  { id: "shape-ellipse", label: "Ellipse Shape", icon: "circle", group: "Shapes" },
14544
14545
  { id: "group", label: "Group Folder", icon: "folder", group: "Basic" }
14545
14546
  ];
14546
- for (const { kind, label } of _chunk3YDQLQH2cjs.ADJUSTMENT_KINDS) {
14547
+ for (const { kind, label } of _chunk32MMQYCQcjs.ADJUSTMENT_KINDS) {
14547
14548
  options.push({
14548
14549
  id: `adjustment-${kind}`,
14549
14550
  label,
@@ -14609,7 +14610,7 @@ async function addLayerOfKind(controller, id, init) {
14609
14610
  }
14610
14611
  if (id.startsWith("adjustment-")) {
14611
14612
  const kind = id.slice("adjustment-".length);
14612
- if (_chunk3YDQLQH2cjs.isAdjustmentKind.call(void 0, kind)) {
14613
+ if (_chunk32MMQYCQcjs.isAdjustmentKind.call(void 0, kind)) {
14613
14614
  return controller.addAdjustmentLayer({
14614
14615
  kind,
14615
14616
  ...init
@@ -14632,7 +14633,7 @@ function layerPanels(layer) {
14632
14633
  panels.push({ id: "paint", title: "Brush Options" });
14633
14634
  panels.push({ id: "effects", title: "Layer Effects" });
14634
14635
  } else if (layer.type === "adjustment") {
14635
- panels.push({ id: "adjustment", title: _chunk3YDQLQH2cjs.adjustmentKindLabel.call(void 0, layer.kind) });
14636
+ panels.push({ id: "adjustment", title: _chunk32MMQYCQcjs.adjustmentKindLabel.call(void 0, layer.kind) });
14636
14637
  } else if (layer.type === "type") {
14637
14638
  panels.push({ id: "type", title: "Typography" });
14638
14639
  panels.push({ id: "effects", title: "Layer Effects" });
@@ -14908,7 +14909,7 @@ var FREE_TRANSFORM_MODE_OPTIONS = [
14908
14909
  ];
14909
14910
  var WARP_STYLE_OPTIONS = [
14910
14911
  { id: "custom", label: "Custom" },
14911
- ..._chunkQMI5HZWAcjs.WARP_STYLES.map((id) => ({ id, label: _chunkQMI5HZWAcjs.WARP_STYLE_LABELS[id] }))
14912
+ ..._chunk236TKNURcjs.WARP_STYLES.map((id) => ({ id, label: _chunk236TKNURcjs.WARP_STYLE_LABELS[id] }))
14912
14913
  ];
14913
14914
  var WARP_GRID_OPTIONS = [
14914
14915
  { id: "1x1", label: "Default", columns: 1, rows: 1 },
@@ -15090,7 +15091,7 @@ var FreeTransformTool = (_class13 = class {
15090
15091
  setMode(mode) {
15091
15092
  this.modeValue = mode;
15092
15093
  const s = this.session;
15093
- if (mode === "warp" && s && !this.mesh) this.mesh = _chunkQMI5HZWAcjs.identityWarpMesh.call(void 0, s.box, this.warpSettings.columns, this.warpSettings.rows);
15094
+ if (mode === "warp" && s && !this.mesh) this.mesh = _chunk236TKNURcjs.identityWarpMesh.call(void 0, s.box, this.warpSettings.columns, this.warpSettings.rows);
15094
15095
  this.changed();
15095
15096
  }
15096
15097
  /** The Warp options bar's settings. */
@@ -15112,13 +15113,13 @@ var FreeTransformTool = (_class13 = class {
15112
15113
  this.modeValue = "warp";
15113
15114
  const next = { ...this.warpSettings, ...changes };
15114
15115
  this.warpSettings = next;
15115
- let mesh = _nullishCoalesce(this.mesh, () => ( _chunkQMI5HZWAcjs.identityWarpMesh.call(void 0, s.box, next.columns, next.rows)));
15116
+ let mesh = _nullishCoalesce(this.mesh, () => ( _chunk236TKNURcjs.identityWarpMesh.call(void 0, s.box, next.columns, next.rows)));
15116
15117
  if (next.style !== "custom" && ("style" in changes || "bend" in changes || "horizontal" in changes || "vertical" in changes || "orientation" in changes)) {
15117
15118
  const preset = { style: next.style, bend: next.bend, horizontal: next.horizontal, vertical: next.vertical, orientation: next.orientation };
15118
- mesh = _nullishCoalesce(_chunkQMI5HZWAcjs.warpPresetMesh.call(void 0, preset, s.box), () => ( _chunkQMI5HZWAcjs.identityWarpMesh.call(void 0, s.box)));
15119
- mesh = _chunkQMI5HZWAcjs.resizeWarpMesh.call(void 0, mesh, next.columns, next.rows);
15119
+ mesh = _nullishCoalesce(_chunk236TKNURcjs.warpPresetMesh.call(void 0, preset, s.box), () => ( _chunk236TKNURcjs.identityWarpMesh.call(void 0, s.box)));
15120
+ mesh = _chunk236TKNURcjs.resizeWarpMesh.call(void 0, mesh, next.columns, next.rows);
15120
15121
  }
15121
- if ("columns" in changes || "rows" in changes) mesh = _chunkQMI5HZWAcjs.resizeWarpMesh.call(void 0, mesh, next.columns, next.rows);
15122
+ if ("columns" in changes || "rows" in changes) mesh = _chunk236TKNURcjs.resizeWarpMesh.call(void 0, mesh, next.columns, next.rows);
15122
15123
  this.mesh = mesh;
15123
15124
  this.changed();
15124
15125
  this.preview();
@@ -15165,11 +15166,11 @@ var FreeTransformTool = (_class13 = class {
15165
15166
  const m = this.mesh;
15166
15167
  const at = (p) => _nullishCoalesce(_chunkQT26RHKKcjs.applyHomography.call(void 0, h, p), () => ( p));
15167
15168
  const pts = m.points.map(at);
15168
- const edit = _chunkQMI5HZWAcjs.warpMeshEditPoints.call(void 0, m);
15169
+ const edit = _chunk236TKNURcjs.warpMeshEditPoints.call(void 0, m);
15169
15170
  out.handles = [];
15170
- out.outline = _chunkQMI5HZWAcjs.warpMeshGridCurves.call(void 0, { ...m, points: pts }).length ? this.meshOutline(pts, m) : out.outline;
15171
+ out.outline = _chunk236TKNURcjs.warpMeshGridCurves.call(void 0, { ...m, points: pts }).length ? this.meshOutline(pts, m) : out.outline;
15171
15172
  out.warp = {
15172
- curves: _chunkQMI5HZWAcjs.warpMeshGridCurves.call(void 0, { ...m, points: pts }),
15173
+ curves: _chunk236TKNURcjs.warpMeshGridCurves.call(void 0, { ...m, points: pts }),
15173
15174
  anchors: edit.anchors.map((i) => pts[i]),
15174
15175
  handles: edit.handles.map((e) => ({ point: pts[e.index], anchor: pts[e.anchor] }))
15175
15176
  };
@@ -15193,7 +15194,7 @@ var FreeTransformTool = (_class13 = class {
15193
15194
  if (!o) return null;
15194
15195
  if (this.modeValue === "warp" && this.mesh) {
15195
15196
  const h = this.homography();
15196
- const edit = _chunkQMI5HZWAcjs.warpMeshEditPoints.call(void 0, this.mesh);
15197
+ const edit = _chunk236TKNURcjs.warpMeshEditPoints.call(void 0, this.mesh);
15197
15198
  let best2 = -1;
15198
15199
  let bestD2 = tolerance;
15199
15200
  for (const i of [...edit.anchors, ...edit.handles.map((e) => e.index)]) {
@@ -15242,7 +15243,7 @@ var FreeTransformTool = (_class13 = class {
15242
15243
  if (this.modeValue === "warp" && this.mesh && handle === "inside") {
15243
15244
  const q = this.toFrame(p, this.corners);
15244
15245
  if (q) {
15245
- const r = _chunkQMI5HZWAcjs.warpMeshParamAt.call(void 0, this.mesh, q);
15246
+ const r = _chunk236TKNURcjs.warpMeshParamAt.call(void 0, this.mesh, q);
15246
15247
  st = { s: r.s, t: r.t };
15247
15248
  }
15248
15249
  }
@@ -15275,8 +15276,8 @@ var FreeTransformTool = (_class13 = class {
15275
15276
  if (!a || !b) return;
15276
15277
  const delta = { x: b.x - a.x, y: b.y - a.y };
15277
15278
  const i = meshIndex(d.handle);
15278
- if (i >= 0) this.mesh = _chunkQMI5HZWAcjs.dragWarpMeshPoint.call(void 0, d.mesh, i, delta);
15279
- else if (d.handle === "inside" && d.st) this.mesh = _chunkQMI5HZWAcjs.pullWarpMesh.call(void 0, d.mesh, d.st.s, d.st.t, delta);
15279
+ if (i >= 0) this.mesh = _chunk236TKNURcjs.dragWarpMeshPoint.call(void 0, d.mesh, i, delta);
15280
+ else if (d.handle === "inside" && d.st) this.mesh = _chunk236TKNURcjs.pullWarpMesh.call(void 0, d.mesh, d.st.s, d.st.t, delta);
15280
15281
  else return;
15281
15282
  this.warpSettings = { ...this.warpSettings, style: "custom" };
15282
15283
  this.changed();
@@ -15400,7 +15401,7 @@ var FreeTransformTool = (_class13 = class {
15400
15401
  bar() {
15401
15402
  const s = this.session;
15402
15403
  if (!s || !this.corners) return null;
15403
- const read = _chunk3YDQLQH2cjs.describeTransform.call(void 0, { box: s.box, corners: this.corners }, this.refBox);
15404
+ const read = _chunk32MMQYCQcjs.describeTransform.call(void 0, { box: s.box, corners: this.corners }, this.refBox);
15404
15405
  return {
15405
15406
  affine: read.affine,
15406
15407
  x: _nullishCoalesce(this.typed.x, () => ( read.x)),
@@ -15425,7 +15426,7 @@ var FreeTransformTool = (_class13 = class {
15425
15426
  this.changed();
15426
15427
  return;
15427
15428
  }
15428
- const m = _chunk3YDQLQH2cjs.matrixFromParams.call(void 0, s.box, {
15429
+ const m = _chunk32MMQYCQcjs.matrixFromParams.call(void 0, s.box, {
15429
15430
  scaleX: next.scaleX,
15430
15431
  scaleY: next.scaleY,
15431
15432
  rotate: next.rotate,
@@ -15435,7 +15436,7 @@ var FreeTransformTool = (_class13 = class {
15435
15436
  dx: next.x - this.refBox.x,
15436
15437
  dy: next.y - this.refBox.y
15437
15438
  });
15438
- this.setCorners(_chunk3YDQLQH2cjs.cornersFromMatrix.call(void 0, s.box, m));
15439
+ this.setCorners(_chunk32MMQYCQcjs.cornersFromMatrix.call(void 0, s.box, m));
15439
15440
  this.typed = { scaleX: next.scaleX, scaleY: next.scaleY, rotate: next.rotate, skewX: next.skewX, skewY: next.skewY, x: next.x, y: next.y };
15440
15441
  this.changed();
15441
15442
  }
@@ -16601,4 +16602,4 @@ function createImageEditorDocument(controller, options = {}) {
16601
16602
 
16602
16603
 
16603
16604
 
16604
- exports.ADJUSTMENT_KEYS = _chunk3YDQLQH2cjs.ADJUSTMENT_KEYS; exports.ADJUSTMENT_KINDS = _chunk3YDQLQH2cjs.ADJUSTMENT_KINDS; exports.ADJUSTMENT_LAYER_CONTROLS = ADJUSTMENT_LAYER_CONTROLS; exports.ADJUSTMENT_LAYER_OPACITY_CONTROL = ADJUSTMENT_LAYER_OPACITY_CONTROL; exports.ADJUSTMENT_LUT_SIZE = _chunk3YDQLQH2cjs.ADJUSTMENT_LUT_SIZE; exports.ANCHOR_FRACTION = _chunk3YDQLQH2cjs.ANCHOR_FRACTION; exports.AS_SHOT_KELVIN = _chunk3YDQLQH2cjs.AS_SHOT_KELVIN; exports.BACKGROUND_LAYER_ID = _chunk3YDQLQH2cjs.BACKGROUND_LAYER_ID; exports.BACKGROUND_LAYER_NAME = _chunk3YDQLQH2cjs.BACKGROUND_LAYER_NAME; exports.BIT_DEPTHS = _chunkCWM3CUUXcjs.BIT_DEPTHS; exports.BIT_DEPTH_OPTIONS = BIT_DEPTH_OPTIONS; exports.BLEND_MODES = _chunkCWM3CUUXcjs.BLEND_MODES; exports.BLUR_FILTER_ID = _chunk3YDQLQH2cjs.BLUR_FILTER_ID; exports.BODY_SCATTER = _chunkGNK7SESQcjs.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 = _chunkEBDCRTZIcjs.BrushstrokeCache; exports.CANVAS_SIZE_PRESETS = CANVAS_SIZE_PRESETS; exports.CLONE_TRANSFORM_CONTROLS = CLONE_TRANSFORM_CONTROLS; exports.COLOR_MODE_OPTIONS = COLOR_MODE_OPTIONS; exports.CoverageMap = _chunkEBDCRTZIcjs.CoverageMap; exports.D50 = _chunk3YDQLQH2cjs.D50; exports.D65 = _chunk3YDQLQH2cjs.D65; exports.DEFAULT_ADJUSTMENTS = DEFAULT_ADJUSTMENTS; exports.DEFAULT_AUTO_LEADING = _chunkQMI5HZWAcjs.DEFAULT_AUTO_LEADING; exports.DEFAULT_BLENDER = _chunkEBDCRTZIcjs.DEFAULT_BLENDER; exports.DEFAULT_BRUSH = _chunkEBDCRTZIcjs.DEFAULT_BRUSH; exports.DEFAULT_CANVAS_VIEWPORT = DEFAULT_CANVAS_VIEWPORT; exports.DEFAULT_DEPTH_MASK = DEFAULT_DEPTH_MASK; exports.DEFAULT_FLOW = _chunkGNK7SESQcjs.DEFAULT_FLOW; exports.DEFAULT_GLOBAL_LIGHT = _chunkHGTDMKNEcjs.DEFAULT_GLOBAL_LIGHT; exports.DEFAULT_MITER_LIMIT = _chunk3YDQLQH2cjs.DEFAULT_MITER_LIMIT; exports.DEFAULT_MIXER = _chunkEBDCRTZIcjs.DEFAULT_MIXER; exports.DEFAULT_PAINT_GRADIENT = _chunkEBDCRTZIcjs.DEFAULT_PAINT_GRADIENT; exports.DEFAULT_PAINT_GRADIENT_MAPPING = _chunkEBDCRTZIcjs.DEFAULT_PAINT_GRADIENT_MAPPING; exports.DEFAULT_PROOF = DEFAULT_PROOF; exports.DEFAULT_REFINE_EDGE_PARAMS = DEFAULT_REFINE_EDGE_PARAMS; exports.DEFAULT_RETOUCH = _chunk7NW46N7Icjs.DEFAULT_RETOUCH; exports.DEFAULT_SELECTION_TOOL_OPTIONS = DEFAULT_SELECTION_TOOL_OPTIONS; exports.DEFAULT_SHAPE_TOOL_OPTIONS = DEFAULT_SHAPE_TOOL_OPTIONS; exports.DEFAULT_SMUDGE = _chunkEBDCRTZIcjs.DEFAULT_SMUDGE; exports.DEFAULT_TEXT_STYLE = _chunkQMI5HZWAcjs.DEFAULT_TEXT_STYLE; exports.DEFAULT_TRANSFORM = DEFAULT_TRANSFORM; exports.DEFAULT_TYPE_TOOL_OPTIONS = DEFAULT_TYPE_TOOL_OPTIONS; exports.DEFAULT_WET_PAPER = _chunkGNK7SESQcjs.DEFAULT_WET_PAPER; exports.DEFAULT_WET_PARAMS = _chunkGNK7SESQcjs.DEFAULT_WET_PARAMS; exports.DEPTH_MASK_CONTROLS = DEPTH_MASK_CONTROLS; exports.DEVELOP_FILTER_ID = _chunk3YDQLQH2cjs.DEVELOP_FILTER_ID; exports.DIRECT_GAUSSIAN_MAX_SIGMA = _chunkHGTDMKNEcjs.DIRECT_GAUSSIAN_MAX_SIGMA; exports.DRY_EPS = _chunkGNK7SESQcjs.DRY_EPS; exports.DabWalker = _chunkEBDCRTZIcjs.DabWalker; exports.EMPTY_DISTANCE = _chunk3YDQLQH2cjs.EMPTY_DISTANCE; exports.EMPTY_MIXER_LOAD = _chunkEBDCRTZIcjs.EMPTY_MIXER_LOAD; exports.EX = _chunkGNK7SESQcjs.EX; exports.EY = _chunkGNK7SESQcjs.EY; exports.FLAG_ALIVE = _chunkGNK7SESQcjs.FLAG_ALIVE; exports.FLAG_BOTTOM = _chunkGNK7SESQcjs.FLAG_BOTTOM; exports.FLAG_LEFT = _chunkGNK7SESQcjs.FLAG_LEFT; exports.FLAG_RIGHT = _chunkGNK7SESQcjs.FLAG_RIGHT; exports.FLAG_TOP = _chunkGNK7SESQcjs.FLAG_TOP; exports.FLAG_WET = _chunkGNK7SESQcjs.FLAG_WET; exports.FLAT = _chunkGNK7SESQcjs.FLAT; exports.FREE_INTERVAL = _chunkGNK7SESQcjs.FREE_INTERVAL; exports.FREE_TRANSFORM_CONTENTS = FREE_TRANSFORM_CONTENTS; exports.FREE_TRANSFORM_FIELDS = FREE_TRANSFORM_FIELDS; exports.FREE_TRANSFORM_MODES = _chunk3YDQLQH2cjs.FREE_TRANSFORM_MODES; exports.FREE_TRANSFORM_MODE_OPTIONS = FREE_TRANSFORM_MODE_OPTIONS; exports.FreeTransformSession = FreeTransformSession; exports.FreeTransformTool = FreeTransformTool; exports.GRAIN_PATTERNS = _chunkEBDCRTZIcjs.GRAIN_PATTERNS; exports.GRAIN_TILE = _chunkEBDCRTZIcjs.GRAIN_TILE; exports.GUIDED_FILTER_EPS = GUIDED_FILTER_EPS; exports.HIDE = _chunkGNK7SESQcjs.HIDE; exports.HISTOGRAM_BINS = HISTOGRAM_BINS; exports.HUE_RANGE_LABELS = _chunk3YDQLQH2cjs.HUE_RANGE_LABELS; exports.IDENTITY_CLONE_TRANSFORM = _chunk7NW46N7Icjs.IDENTITY_CLONE_TRANSFORM; exports.IDENTITY_MATRIX3 = _chunk3YDQLQH2cjs.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.INTENTS = _chunkBROJYMWUcjs.INTENTS; exports.INTENT_OPTIONS = INTENT_OPTIONS; exports.INTERPOLATIONS = _chunkHGTDMKNEcjs.INTERPOLATIONS; exports.ImageEditorController = ImageEditorController; exports.ImageEditorRenderer = ImageEditorRenderer; exports.ImageEffectsEngine = ImageEffectsEngine; exports.LATEST_PROCESS_VERSION = _chunk3YDQLQH2cjs.LATEST_PROCESS_VERSION; exports.LAYERED_SCHEMA_VERSION = _chunk3YDQLQH2cjs.LAYERED_SCHEMA_VERSION; exports.LAYER_EFFECT_KINDS = _chunkHGTDMKNEcjs.LAYER_EFFECT_KINDS; exports.LAYER_EFFECT_MENU = LAYER_EFFECT_MENU; exports.LEGACY_PROCESS_VERSION = _chunk3YDQLQH2cjs.LEGACY_PROCESS_VERSION; exports.LIVE_SHAPE_KINDS = _chunk3YDQLQH2cjs.LIVE_SHAPE_KINDS; exports.LUMA_709 = _chunk3YDQLQH2cjs.LUMA_709; exports.LayerCompositor = _chunk3YDQLQH2cjs.LayerCompositor; exports.LayerEffectError = _chunkHGTDMKNEcjs.LayerEffectError; exports.LayerOperationError = _chunk3YDQLQH2cjs.LayerOperationError; exports.MAX_BATCH = _chunkGNK7SESQcjs.MAX_BATCH; exports.MAX_BRUSH_SIZE = _chunkEBDCRTZIcjs.MAX_BRUSH_SIZE; exports.MAX_CANVAS_BACKING_SIDE = MAX_CANVAS_BACKING_SIDE; exports.MAX_EFFECT_REACH = _chunkHGTDMKNEcjs.MAX_EFFECT_REACH; exports.MAX_KELVIN = _chunk3YDQLQH2cjs.MAX_KELVIN; exports.MAX_TILT_ACCEL = _chunkGNK7SESQcjs.MAX_TILT_ACCEL; exports.MAX_TRANSFORM_PIXELS = _chunkHGTDMKNEcjs.MAX_TRANSFORM_PIXELS; exports.MAX_WET_LANES = _chunkGNK7SESQcjs.MAX_WET_LANES; exports.MAX_WET_SLOTS = _chunkGNK7SESQcjs.MAX_WET_SLOTS; exports.MIN_KELVIN = _chunk3YDQLQH2cjs.MIN_KELVIN; exports.MIRED_PER_TEMPERATURE_UNIT = _chunk3YDQLQH2cjs.MIRED_PER_TEMPERATURE_UNIT; exports.MIXER_DRAIN = _chunkEBDCRTZIcjs.MIXER_DRAIN; exports.MIXER_MIXING_OPTIONS = MIXER_MIXING_OPTIONS; exports.MIXER_OPTION_CONTROLS = MIXER_OPTION_CONTROLS; exports.MIXER_PICKUP_RATE = _chunkEBDCRTZIcjs.MIXER_PICKUP_RATE; exports.MIXING_MODELS = _chunkEBDCRTZIcjs.MIXING_MODELS; exports.MixerStroke = _chunkEBDCRTZIcjs.MixerStroke; exports.OPP = _chunkGNK7SESQcjs.OPP; exports.PAINTERLY_BLEND_MODES = _chunkCWM3CUUXcjs.PAINTERLY_BLEND_MODES; exports.PAINT_COLOR_JSON_SCHEMA = _chunkEBDCRTZIcjs.PAINT_COLOR_JSON_SCHEMA; exports.PAINT_GRADIENT_FULL_SPEED = _chunkEBDCRTZIcjs.PAINT_GRADIENT_FULL_SPEED; exports.PAINT_GRADIENT_JSON_SCHEMA = _chunkEBDCRTZIcjs.PAINT_GRADIENT_JSON_SCHEMA; exports.PAINT_GRADIENT_KIT = _chunkEBDCRTZIcjs.PAINT_GRADIENT_KIT; exports.PAINT_GRADIENT_MAPPINGS = _chunkEBDCRTZIcjs.PAINT_GRADIENT_MAPPINGS; exports.PAINT_GRADIENT_MAPPING_LABELS = _chunkEBDCRTZIcjs.PAINT_GRADIENT_MAPPING_LABELS; exports.PAINT_GRADIENT_PRESETS = _chunkEBDCRTZIcjs.PAINT_GRADIENT_PRESETS; exports.PAINT_GRADIENT_REPEATS = _chunkEBDCRTZIcjs.PAINT_GRADIENT_REPEATS; exports.PAINT_GRADIENT_REPEAT_LABELS = _chunkEBDCRTZIcjs.PAINT_GRADIENT_REPEAT_LABELS; exports.PAINT_GRADIENT_SPACES = _chunkEBDCRTZIcjs.PAINT_GRADIENT_SPACES; exports.PAINT_GRADIENT_SPACE_LABELS = _chunkEBDCRTZIcjs.PAINT_GRADIENT_SPACE_LABELS; exports.PAINT_SOURCE_JSON_SCHEMA = _chunkEBDCRTZIcjs.PAINT_SOURCE_JSON_SCHEMA; exports.PAINT_TOOLS = PAINT_TOOLS; exports.PAPER_CAPACITY = _chunkGNK7SESQcjs.PAPER_CAPACITY; exports.PARAGRAPH_STYLE_FIELDS = _chunk3YDQLQH2cjs.PARAGRAPH_STYLE_FIELDS; exports.PARAM = _chunkGNK7SESQcjs.PARAM; exports.PARAM_FLOATS = _chunkGNK7SESQcjs.PARAM_FLOATS; exports.PATTERN_BLOCK_KEYS = _chunk3YDQLQH2cjs.PATTERN_BLOCK_KEYS; exports.PIGMENT_BANDS = _chunkCWM3CUUXcjs.PIGMENT_BANDS; exports.PIGMENT_CHANNELS = _chunkGNK7SESQcjs.PIGMENT_CHANNELS; exports.PIGMENT_LAMBDA_MIN = _chunkCWM3CUUXcjs.PIGMENT_LAMBDA_MIN; exports.PIGMENT_LAMBDA_STEP = _chunkCWM3CUUXcjs.PIGMENT_LAMBDA_STEP; exports.PIGMENT_UNIT = _chunkGNK7SESQcjs.PIGMENT_UNIT; exports.PIGMENT_WAVELENGTHS = _chunkCWM3CUUXcjs.PIGMENT_WAVELENGTHS; exports.PLANE = _chunkGNK7SESQcjs.PLANE; exports.PLANE_BYTES = _chunkGNK7SESQcjs.PLANE_BYTES; exports.PROOF_PROFILE_OPTIONS = PROOF_PROFILE_OPTIONS; exports.PSD_BLEND_KEYS = _chunk3YDQLQH2cjs.PSD_BLEND_KEYS; exports.PSD_FILE_ACCEPT = PSD_FILE_ACCEPT; exports.P_D0 = _chunkGNK7SESQcjs.P_D0; exports.P_EDGE = _chunkGNK7SESQcjs.P_EDGE; exports.P_FX = _chunkGNK7SESQcjs.P_FX; exports.P_FY = _chunkGNK7SESQcjs.P_FY; exports.P_H = _chunkGNK7SESQcjs.P_H; exports.P_P0 = _chunkGNK7SESQcjs.P_P0; exports.P_RHO = _chunkGNK7SESQcjs.P_RHO; exports.P_SW = _chunkGNK7SESQcjs.P_SW; exports.P_UX = _chunkGNK7SESQcjs.P_UX; exports.P_UY = _chunkGNK7SESQcjs.P_UY; exports.PaintExchange = _chunkEBDCRTZIcjs.PaintExchange; exports.PaintGesture = PaintGesture; exports.PaintGradientSampler = _chunkEBDCRTZIcjs.PaintGradientSampler; exports.PaintSourceError = _chunkEBDCRTZIcjs.PaintSourceError; exports.PaintStrokeSession = PaintStrokeSession; exports.PaperGrain = _chunkEBDCRTZIcjs.PaperGrain; exports.PatternPlacement = _chunkHGTDMKNEcjs.PatternPlacement; exports.PatternTile = _chunkHGTDMKNEcjs.PatternTile; exports.PsdError = _chunk3YDQLQH2cjs.PsdError; exports.REFINE_EDGE_CONTROLS = REFINE_EDGE_CONTROLS; exports.RETOUCH_CHOICES = RETOUCH_CHOICES; exports.RETOUCH_OPTION_CONTROLS = RETOUCH_OPTION_CONTROLS; exports.RETOUCH_SAMPLES = _chunk7NW46N7Icjs.RETOUCH_SAMPLES; exports.RETOUCH_TOGGLES = RETOUCH_TOGGLES; exports.RETOUCH_TOOLS = RETOUCH_TOOLS; exports.RegionPixelSource = _chunk7NW46N7Icjs.RegionPixelSource; exports.RetouchDabStroke = _chunk7NW46N7Icjs.RetouchDabStroke; exports.SELECTION_MODES = _chunk3YDQLQH2cjs.SELECTION_MODES; exports.SELECTION_MODE_LABELS = SELECTION_MODE_LABELS; exports.SELECTION_MODIFY_OPS = _chunk3YDQLQH2cjs.SELECTION_MODIFY_OPS; exports.SELECTION_TOOLS = SELECTION_TOOLS; exports.SET_PLANES = _chunkGNK7SESQcjs.SET_PLANES; exports.SHADOW_AMBIENT = _chunkCWM3CUUXcjs.SHADOW_AMBIENT; exports.SHAPE_KIND_LABELS = SHAPE_KIND_LABELS; exports.SHAPE_OPERATIONS = _chunk3YDQLQH2cjs.SHAPE_OPERATIONS; exports.SHAPE_RENDER_MARGIN = _chunk3YDQLQH2cjs.SHAPE_RENDER_MARGIN; exports.SLOT_BYTES = _chunkGNK7SESQcjs.SLOT_BYTES; exports.SLOT_PLANES = _chunkGNK7SESQcjs.SLOT_PLANES; exports.SLOT_SIDE = _chunkGNK7SESQcjs.SLOT_SIDE; exports.SMART_RENDER_MARGIN = _chunk3YDQLQH2cjs.SMART_RENDER_MARGIN; exports.SPOT_HEAL_TYPES = _chunk7NW46N7Icjs.SPOT_HEAL_TYPES; exports.SRGB_TO_LINEAR = _chunkGNK7SESQcjs.SRGB_TO_LINEAR; exports.STRIP = _chunkGNK7SESQcjs.STRIP; exports.SUPPORTED_ADJUSTMENT_KEYS = _chunk3YDQLQH2cjs.SUPPORTED_ADJUSTMENT_KEYS; exports.SelectionGesture = SelectionGesture; exports.ShapeDrawGesture = ShapeDrawGesture; exports.SmudgeTip = _chunkEBDCRTZIcjs.SmudgeTip; exports.StrokeCoverage = _chunkEBDCRTZIcjs.StrokeCoverage; exports.SurfaceDraft = _chunkCWM3CUUXcjs.SurfaceDraft; exports.TEXT_ALIGNS = _chunk3YDQLQH2cjs.TEXT_ALIGNS; exports.TEXT_RENDER_MARGIN = _chunk3YDQLQH2cjs.TEXT_RENDER_MARGIN; exports.TEXT_STYLE_FIELDS = _chunk3YDQLQH2cjs.TEXT_STYLE_FIELDS; exports.TILE = _chunkCWM3CUUXcjs.TILE; exports.TILE_SHIFT = _chunkCWM3CUUXcjs.TILE_SHIFT; exports.TINT_SCALE = _chunk3YDQLQH2cjs.TINT_SCALE; exports.TIP_GRADIENT_STEPS = _chunkEBDCRTZIcjs.TIP_GRADIENT_STEPS; exports.TONE_LUT_SIZE = _chunk3YDQLQH2cjs.TONE_LUT_SIZE; exports.TONE_RANGES = _chunk7NW46N7Icjs.TONE_RANGES; exports.TONE_RANGE_PRESETS = TONE_RANGE_PRESETS; exports.TRANSFORM_ANCHORS = _chunk3YDQLQH2cjs.TRANSFORM_ANCHORS; exports.TextEditSession = TextEditSession; exports.TileMedium = _chunkEBDCRTZIcjs.TileMedium; exports.TilePixelSource = _chunk7NW46N7Icjs.TilePixelSource; exports.TileableNoise = _chunkEBDCRTZIcjs.TileableNoise; exports.TiledSurface = _chunkCWM3CUUXcjs.TiledSurface; exports.TransformTooLargeError = _chunkHGTDMKNEcjs.TransformTooLargeError; exports.TransformedPixelSource = _chunk7NW46N7Icjs.TransformedPixelSource; exports.TypeToolGesture = TypeToolGesture; exports.U_MAX = _chunkGNK7SESQcjs.U_MAX; exports.VIBRANCE_GREY = _chunk3YDQLQH2cjs.VIBRANCE_GREY; exports.W9 = _chunkGNK7SESQcjs.W9; exports.WARP_GRID_OPTIONS = WARP_GRID_OPTIONS; exports.WARP_STYLES = _chunkQMI5HZWAcjs.WARP_STYLES; exports.WARP_STYLE_LABELS = _chunkQMI5HZWAcjs.WARP_STYLE_LABELS; exports.WARP_STYLE_OPTIONS = WARP_STYLE_OPTIONS; exports.WET_FLOW_KINDS = _chunkGNK7SESQcjs.WET_FLOW_KINDS; exports.WET_PARAM_KEYS = _chunkGNK7SESQcjs.WET_PARAM_KEYS; exports.WET_TILE = _chunkGNK7SESQcjs.WET_TILE; exports.WGSL_HALO = _chunkGNK7SESQcjs.WGSL_HALO; exports.WGSL_SHADE = _chunkGNK7SESQcjs.WGSL_SHADE; exports.WGSL_STEP = _chunkGNK7SESQcjs.WGSL_STEP; exports.WORKING_SPACE_OPTIONS = WORKING_SPACE_OPTIONS; exports.WetGpuEngine = _chunkGNK7SESQcjs.WetGpuEngine; exports.WetMedium = _chunkGNK7SESQcjs.WetMedium; exports.WetWorkerPool = _chunkGNK7SESQcjs.WetWorkerPool; exports.WetWorld = _chunkGNK7SESQcjs.WetWorld; exports.WetWorldError = _chunkGNK7SESQcjs.WetWorldError; exports.XYZ_D50_TO_SRGB = _chunk3YDQLQH2cjs.XYZ_D50_TO_SRGB; exports.ZlibError = _chunkXFM3OCHUcjs.ZlibError; exports.activeAdjustmentLayers = _chunk3YDQLQH2cjs.activeAdjustmentLayers; exports.activeEffectSmartFilters = _chunk3YDQLQH2cjs.activeEffectSmartFilters; exports.activeLayerAfterRemoval = _chunk3YDQLQH2cjs.activeLayerAfterRemoval; exports.activeSmartFilters = _chunk3YDQLQH2cjs.activeSmartFilters; exports.addLayerEffect = _chunk3YDQLQH2cjs.addLayerEffect; exports.addLayerFilter = _chunk3YDQLQH2cjs.addLayerFilter; exports.addLayerOfKind = addLayerOfKind; exports.addPaintGradientStop = _chunkEBDCRTZIcjs.addPaintGradientStop; exports.addSmartFilter = _chunk3YDQLQH2cjs.addSmartFilter; exports.addToHistogram = addToHistogram; exports.adjustmentKindLabel = _chunk3YDQLQH2cjs.adjustmentKindLabel; exports.adjustmentLayersKey = _chunk3YDQLQH2cjs.adjustmentLayersKey; exports.adjustmentNodeAsLayer = _chunk3YDQLQH2cjs.adjustmentNodeAsLayer; exports.adjustmentNodeFromLegacy = _chunk3YDQLQH2cjs.adjustmentNodeFromLegacy; exports.adler32 = _chunkXFM3OCHUcjs.adler32; exports.agentDragDraft = agentDragDraft; exports.anchorPoint = _chunk3YDQLQH2cjs.anchorPoint; exports.annotationBlend = _chunk3YDQLQH2cjs.annotationBlend; exports.annotationLayerFor = _chunk3YDQLQH2cjs.annotationLayerFor; exports.annotationLayerName = _chunk3YDQLQH2cjs.annotationLayerName; exports.annotationOfLayer = _chunk3YDQLQH2cjs.annotationOfLayer; exports.annotationOfShape = _chunk3YDQLQH2cjs.annotationOfShape; exports.annotationOfType = _chunk3YDQLQH2cjs.annotationOfType; exports.applyAdjustmentLayers = _chunk3YDQLQH2cjs.applyAdjustmentLayers; exports.applyAdjustmentLayersFloat = _chunk3YDQLQH2cjs.applyAdjustmentLayersFloat; exports.applyAdjustments = _chunk3YDQLQH2cjs.applyAdjustments; exports.applyBoxBlur = _chunk3YDQLQH2cjs.applyBoxBlur; exports.applyBoxBlurFloat = _chunk3YDQLQH2cjs.applyBoxBlurFloat; exports.applyDepthMask = _chunk3YDQLQH2cjs.applyDepthMask; exports.applyHomography = _chunkQT26RHKKcjs.applyHomography; exports.applyImageProjectionToContext = _chunk3YDQLQH2cjs.applyImageProjectionToContext; exports.applyLegacyAdjustments = _chunk3YDQLQH2cjs.applyLegacyAdjustments; exports.applyLegacyFloat = _chunk3YDQLQH2cjs.applyLegacyFloat; exports.applyMatrix3 = _chunk3YDQLQH2cjs.applyMatrix3; exports.applyOutputStage = applyOutputStage; exports.applyParams = _chunk3YDQLQH2cjs.applyParams; exports.applyProcess2Adjustments = _chunk3YDQLQH2cjs.applyProcess2Adjustments; exports.applyProcess2Float = _chunk3YDQLQH2cjs.applyProcess2Float; exports.applyRegionBlur = applyRegionBlur; exports.applyRegionMosaic = applyRegionMosaic; exports.applyRetouchToTile = _chunk7NW46N7Icjs.applyRetouchToTile; exports.applyShapeOptions = applyShapeOptions; exports.applySmartFilters = _chunk3YDQLQH2cjs.applySmartFilters; exports.applyStrokeToDeepTile = _chunkEBDCRTZIcjs.applyStrokeToDeepTile; exports.applyStrokeToTile = _chunkEBDCRTZIcjs.applyStrokeToTile; exports.applyToneToDeepTile = _chunk7NW46N7Icjs.applyToneToDeepTile; exports.backgroundLayer = _chunk3YDQLQH2cjs.backgroundLayer; exports.base64ToBytes = _chunkCWM3CUUXcjs.base64ToBytes; exports.baseProjection = baseProjection; exports.bestOffset = _chunk7NW46N7Icjs.bestOffset; exports.blackWhiteGray = _chunk3YDQLQH2cjs.blackWhiteGray; exports.blendChannel = _chunkCWM3CUUXcjs.blendChannel; exports.blendImageData = _chunkCWM3CUUXcjs.blendImageData; exports.blendLum = _chunkCWM3CUUXcjs.blendLum; exports.blendPixel = _chunkCWM3CUUXcjs.blendPixel; exports.blendRadius = _chunkEBDCRTZIcjs.blendRadius; exports.blendRgb = _chunkCWM3CUUXcjs.blendRgb; exports.blendTile = _chunkHGTDMKNEcjs.blendTile; exports.blenderDab = _chunkEBDCRTZIcjs.blenderDab; exports.blurFilter = _chunk3YDQLQH2cjs.blurFilter; exports.borderCoverage = _chunk3YDQLQH2cjs.borderCoverage; exports.boxBlurPixels = _chunk7NW46N7Icjs.boxBlurPixels; exports.boxFrameHit = boxFrameHit; exports.boxFrameOverlay = boxFrameOverlay; exports.boxMean = boxMean; exports.boxPointOf = _chunk3YDQLQH2cjs.boxPointOf; exports.boxQuad = _chunkQT26RHKKcjs.boxQuad; exports.boxToCurvePoint = boxToCurvePoint; exports.bradfordAdaptation = _chunk3YDQLQH2cjs.bradfordAdaptation; exports.brushstrokeDataUrl = _chunkEBDCRTZIcjs.brushstrokeDataUrl; exports.brushstrokeKey = _chunkEBDCRTZIcjs.brushstrokeKey; exports.brushstrokeSamples = _chunkEBDCRTZIcjs.brushstrokeSamples; exports.brushstrokeScaleBucket = _chunkYQGCPL5Xcjs.brushstrokeScaleBucket; exports.brushstrokeStrokeOptions = _chunkEBDCRTZIcjs.brushstrokeStrokeOptions; exports.brushstrokeToCanvas = _chunkEBDCRTZIcjs.brushstrokeToCanvas; exports.buildLayerMaskPlanes = _chunk3YDQLQH2cjs.buildLayerMaskPlanes; exports.buildToneLut = _chunk3YDQLQH2cjs.buildToneLut; exports.builtinPattern = _chunkHGTDMKNEcjs.builtinPattern; exports.builtinPatternIds = _chunkHGTDMKNEcjs.builtinPatternIds; exports.bytesToBase64 = _chunkCWM3CUUXcjs.bytesToBase64; exports.calculateCropDrag = _chunk3YDQLQH2cjs.calculateCropDrag; exports.canShareMemory = _chunkGNK7SESQcjs.canShareMemory; exports.canvasCompositeOperation = _chunkCWM3CUUXcjs.canvasCompositeOperation; exports.canvasToImagePoint = _chunk3YDQLQH2cjs.canvasToImagePoint; exports.caretAt = _chunkQMI5HZWAcjs.caretAt; exports.changedTiles = _chunkHGTDMKNEcjs.changedTiles; exports.checkImageEffectPlace = checkImageEffectPlace; exports.clampControlValue = clampControlValue; exports.clampCropToImage = _chunk3YDQLQH2cjs.clampCropToImage; exports.cleanMixer = _chunkEBDCRTZIcjs.cleanMixer; exports.cloneSamplePoint = _chunk7NW46N7Icjs.cloneSamplePoint; exports.cloneSourceLabel = cloneSourceLabel; exports.cloneTransformView = cloneTransformView; exports.collectTiles = _chunkCWM3CUUXcjs.collectTiles; exports.colorBalanceChannel = _chunk3YDQLQH2cjs.colorBalanceChannel; exports.colorModePlanes = colorModePlanes; exports.colorModePlanes16 = colorModePlanes16; exports.colorPanelView = colorPanelView; exports.colorRange = colorRange; exports.combineSelections = _chunk3YDQLQH2cjs.combineSelections; exports.compileAdjustmentLayer = _chunk3YDQLQH2cjs.compileAdjustmentLayer; exports.componentPath = _chunk3YDQLQH2cjs.componentPath; exports.compositeDeep = _chunk3YDQLQH2cjs.compositeDeep; exports.compositeSurfaceOver = _chunkHGTDMKNEcjs.compositeSurfaceOver; exports.computeHistogram = computeHistogram; exports.computeSelectionBounds = _chunk3YDQLQH2cjs.computeSelectionBounds; exports.contentAwareFill = _chunk7NW46N7Icjs.contentAwareFill; exports.contentBounds = _chunkCWM3CUUXcjs.contentBounds; exports.contentsBox = _chunk3YDQLQH2cjs.contentsBox; exports.contentsSurface = _chunk3YDQLQH2cjs.contentsSurface; exports.contractCoverage = _chunk3YDQLQH2cjs.contractCoverage; exports.controlPosition = controlPosition; exports.controlTrackBackground = controlTrackBackground; exports.convertColorFields = convertColorFields; exports.convertHex = convertHex; exports.convertSurfaceColors = convertSurfaceColors; exports.convertSurfaceDepth = _chunkCWM3CUUXcjs.convertSurfaceDepth; exports.convertToSmartObject = _chunk3YDQLQH2cjs.convertToSmartObject; exports.copySmartObject = _chunk3YDQLQH2cjs.copySmartObject; exports.cornersFromMatrix = _chunk3YDQLQH2cjs.cornersFromMatrix; exports.coverageTileCoord = _chunkEBDCRTZIcjs.coverageTileCoord; exports.coverageToByte = _chunk3YDQLQH2cjs.coverageToByte; exports.coveringRect = coveringRect; exports.createAdjustmentLayer = _chunk3YDQLQH2cjs.createAdjustmentLayer; exports.createBlenderScratch = _chunkEBDCRTZIcjs.createBlenderScratch; exports.createCanvasTextShaper = _chunkQMI5HZWAcjs.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.createImageSelectionTools = createImageSelectionTools; exports.createImageShapeTools = createImageShapeTools; exports.createImageSmartObjectTools = createImageSmartObjectTools; exports.createImageTransformTools = createImageTransformTools; exports.createImageTypeTools = createImageTypeTools; exports.createMetricTextShaper = _chunkQMI5HZWAcjs.createMetricTextShaper; exports.createOutlineTextShaper = _chunkQMI5HZWAcjs.createOutlineTextShaper; exports.createPigment = _chunkCWM3CUUXcjs.createPigment; exports.createPigmentTools = _chunkGNK7SESQcjs.createPigmentTools; exports.createSelectionMask = _chunk3YDQLQH2cjs.createSelectionMask; exports.createShapeLayer = _chunk3YDQLQH2cjs.createShapeLayer; exports.createTypeLayer = _chunk3YDQLQH2cjs.createTypeLayer; exports.createWetGpuEngine = _chunkGNK7SESQcjs.createWetGpuEngine; exports.cssFont = _chunkQMI5HZWAcjs.cssFont; exports.cssFontFamily = _chunkQMI5HZWAcjs.cssFontFamily; exports.curveLut = _chunkHGTDMKNEcjs.curveLut; exports.curveLutFromLevels = _chunk3YDQLQH2cjs.curveLutFromLevels; exports.curvePointToBox = curvePointToBox; exports.curveSvgPath = curveSvgPath; exports.dabCoverage = _chunkEBDCRTZIcjs.dabCoverage; exports.dabRect = _chunkEBDCRTZIcjs.dabRect; exports.decodeDeepSurface = _chunk3YDQLQH2cjs.decodeDeepSurface; exports.decodeLayerChannel = _chunk3YDQLQH2cjs.decodeLayerChannel; exports.decodeLayerMask = _chunk3YDQLQH2cjs.decodeLayerMask; exports.decodeMergedImage = _chunk3YDQLQH2cjs.decodeMergedImage; exports.decodePlanes = _chunk3YDQLQH2cjs.decodePlanes; exports.decodePng = _chunkCWM3CUUXcjs.decodePng; exports.decodePngDataUrl = _chunk3YDQLQH2cjs.decodePngDataUrl; exports.decodeSelectionRle = _chunk3YDQLQH2cjs.decodeSelectionRle; exports.deepBytes = _chunkCWM3CUUXcjs.deepBytes; exports.deepTile = _chunkCWM3CUUXcjs.deepTile; exports.defaultActiveLayerId = _chunk3YDQLQH2cjs.defaultActiveLayerId; exports.defaultAdjustmentParams = _chunk3YDQLQH2cjs.defaultAdjustmentParams; exports.defaultEffectGradient = _chunkHGTDMKNEcjs.defaultEffectGradient; exports.defaultLayerEffect = _chunkHGTDMKNEcjs.defaultLayerEffect; exports.defaultShapeName = _chunk3YDQLQH2cjs.defaultShapeName; exports.deflate = _chunkXFM3OCHUcjs.deflate; exports.deflateRaw = _chunkXFM3OCHUcjs.deflateRaw; exports.depthMaskAlpha = _chunk3YDQLQH2cjs.depthMaskAlpha; exports.depthOf = _chunkCWM3CUUXcjs.depthOf; exports.depthRasterMask = _chunk3YDQLQH2cjs.depthRasterMask; exports.describeLayer = describeLayer; exports.describeLayerEffects = describeLayerEffects; exports.describeSelection = describeSelection; exports.describeTransform = _chunk3YDQLQH2cjs.describeTransform; exports.deserializeColorMode = deserializeColorMode; exports.deserializeColorProfile = deserializeColorProfile; exports.deserializeEffects = _chunk3YDQLQH2cjs.deserializeEffects; exports.deserializeLayer = _chunk3YDQLQH2cjs.deserializeLayer; exports.deserializeLayers = _chunk3YDQLQH2cjs.deserializeLayers; exports.deserializePatterns = _chunk3YDQLQH2cjs.deserializePatterns; exports.deserializeSelection = _chunk3YDQLQH2cjs.deserializeSelection; exports.developFilter = _chunk3YDQLQH2cjs.developFilter; exports.developFromAdjustments = _chunk3YDQLQH2cjs.developFromAdjustments; exports.developTarget = _chunk3YDQLQH2cjs.developTarget; exports.dexp = _chunkGNK7SESQcjs.dexp; exports.dilateMask = _chunk7NW46N7Icjs.dilateMask; exports.displayTransform = displayTransform; exports.distanceTransform = _chunk3YDQLQH2cjs.distanceTransform; exports.dlog = _chunkGNK7SESQcjs.dlog; exports.documentContents = _chunk3YDQLQH2cjs.documentContents; exports.documentProfile = documentProfile; exports.dodgeBurn = _chunk7NW46N7Icjs.dodgeBurn; exports.dodgeBurnCurve = _chunk7NW46N7Icjs.dodgeBurnCurve; exports.downloadPsd = downloadPsd; exports.dpow = _chunkGNK7SESQcjs.dpow; exports.dragWarpMeshPoint = _chunkQMI5HZWAcjs.dragWarpMeshPoint; exports.dropPlacement = dropPlacement; exports.dropZone = dropZone; exports.dsincos = _chunkGNK7SESQcjs.dsincos; exports.duplicateLayer = _chunk3YDQLQH2cjs.duplicateLayer; exports.edgeBits = _chunkGNK7SESQcjs.edgeBits; exports.edgeWidth = edgeWidth; exports.effectColorHex = _chunkHGTDMKNEcjs.effectColorHex; exports.effectControlChange = effectControlChange; exports.effectPixelsToSurface = effectPixelsToSurface; exports.effectReach = _chunkHGTDMKNEcjs.effectReach; exports.effectiveProof = effectiveProof; exports.effectsFingerprint = _chunkHGTDMKNEcjs.effectsFingerprint; exports.effectsMargin = _chunkHGTDMKNEcjs.effectsMargin; exports.effectsScale = _chunkHGTDMKNEcjs.effectsScale; exports.ellipsePoints = ellipsePoints; exports.ellipseSelection = ellipseSelection; exports.emptyHistogram = emptyHistogram; exports.emptySurface = _chunkCWM3CUUXcjs.emptySurface; exports.encodeDeepSurface = _chunk3YDQLQH2cjs.encodeDeepSurface; exports.encodePng = _chunkCWM3CUUXcjs.encodePng; exports.encodeRle = _chunk3YDQLQH2cjs.encodeRle; exports.encodeSelectionRle = _chunk3YDQLQH2cjs.encodeSelectionRle; exports.encodeSurface = _chunk3YDQLQH2cjs.encodeSurface; exports.evalWarpMesh = _chunkQMI5HZWAcjs.evalWarpMesh; exports.evaluateAdjustmentLayers = _chunk3YDQLQH2cjs.evaluateAdjustmentLayers; exports.exchangeRates = _chunkEBDCRTZIcjs.exchangeRates; exports.expNeg = _chunkGNK7SESQcjs.expNeg; exports.expandCoverage = _chunk3YDQLQH2cjs.expandCoverage; exports.exportPsd = _chunk3YDQLQH2cjs.exportPsd; exports.extractNormalizedLayerItems = extractNormalizedLayerItems; exports.featherCoverage = _chunk3YDQLQH2cjs.featherCoverage; exports.fillRect = _chunkCWM3CUUXcjs.fillRect; exports.filmPixel = _chunkGNK7SESQcjs.filmPixel; exports.filmReflectance = _chunkGNK7SESQcjs.filmReflectance; exports.filterMaskCoverage = _chunk3YDQLQH2cjs.filterMaskCoverage; exports.findAdjustmentControl = findAdjustmentControl; exports.findLayer = _chunkHGTDMKNEcjs.findLayer; exports.findLayerControl = findLayerControl; exports.findWebGpu = _chunkGNK7SESQcjs.findWebGpu; exports.finishTile = _chunkCWM3CUUXcjs.finishTile; exports.fitParagraphRuns = _chunkQMI5HZWAcjs.fitParagraphRuns; exports.fitRuns = _chunkQMI5HZWAcjs.fitRuns; exports.flattenLayers = _chunkHGTDMKNEcjs.flattenLayers; exports.flattenPath = _chunk3YDQLQH2cjs.flattenPath; exports.flipCorners = _chunk3YDQLQH2cjs.flipCorners; exports.flowField = _chunkGNK7SESQcjs.flowField; exports.fontOf = _chunkQMI5HZWAcjs.fontOf; exports.formatControlValue = formatControlValue; exports.fullSelection = _chunk3YDQLQH2cjs.fullSelection; exports.gaussianBlur = _chunkHGTDMKNEcjs.gaussianBlur; exports.geometryHomography = _chunk3YDQLQH2cjs.geometryHomography; exports.getAnnotationBounds = _chunk3YDQLQH2cjs.getAnnotationBounds; exports.getControlPath = getControlPath; exports.getCropCursor = _chunk3YDQLQH2cjs.getCropCursor; exports.getRotatedSize = _chunk3YDQLQH2cjs.getRotatedSize; exports.getViewportMetrics = _chunk3YDQLQH2cjs.getViewportMetrics; exports.getViewportProjection = _chunk3YDQLQH2cjs.getViewportProjection; exports.globalImageCache = globalImageCache; exports.gradientDabColor = _chunkEBDCRTZIcjs.gradientDabColor; exports.grainCatch = _chunkEBDCRTZIcjs.grainCatch; exports.grainHeights = _chunkEBDCRTZIcjs.grainHeights; exports.greyMorphology = _chunk3YDQLQH2cjs.greyMorphology; exports.groupLayers = _chunk3YDQLQH2cjs.groupLayers; exports.guidePlanes = guidePlanes; exports.guidedFilterColor = guidedFilterColor; exports.handlePaintShortcut = handlePaintShortcut; exports.hasActiveEffects = _chunkHGTDMKNEcjs.hasActiveEffects; exports.hasResampledLegacyMask = _chunk3YDQLQH2cjs.hasResampledLegacyMask; exports.hasSurface = _chunk3YDQLQH2cjs.hasSurface; exports.hasWarp = _chunk3YDQLQH2cjs.hasWarp; exports.hash2 = _chunkEBDCRTZIcjs.hash2; exports.hashMaskContent = _chunk3YDQLQH2cjs.hashMaskContent; exports.hashNoise = _chunkHGTDMKNEcjs.hashNoise; exports.healPixels = _chunk7NW46N7Icjs.healPixels; exports.hexToPaintRgb = _chunkEBDCRTZIcjs.hexToPaintRgb; exports.hexToRgb = _chunk3YDQLQH2cjs.hexToRgb; exports.histogramPath = histogramPath; exports.hitTestAnnotation = _chunk3YDQLQH2cjs.hitTestAnnotation; exports.hitTestCrop = _chunk3YDQLQH2cjs.hitTestCrop; exports.hitTestCurvePoint = hitTestCurvePoint; exports.homographyFromAffine = _chunkQT26RHKKcjs.homographyFromAffine; exports.homographyFromPoints = _chunkQT26RHKKcjs.homographyFromPoints; exports.hslToRgb = _chunk3YDQLQH2cjs.hslToRgb; exports.hueRange = hueRange; exports.hueRangeTables = _chunk3YDQLQH2cjs.hueRangeTables; exports.hueRangeWeight = _chunk3YDQLQH2cjs.hueRangeWeight; exports.hueSaturation = _chunk3YDQLQH2cjs.hueSaturation; exports.identityCurve = _chunk3YDQLQH2cjs.identityCurve; exports.identityLevels = _chunk3YDQLQH2cjs.identityLevels; exports.identityTransform = _chunk3YDQLQH2cjs.identityTransform; exports.identityWarpMesh = _chunkQMI5HZWAcjs.identityWarpMesh; exports.imageEditorStateMigrations = imageEditorStateMigrations; exports.imageLayerAppliedEffects = imageLayerAppliedEffects; exports.imagePlaybackPanel = imagePlaybackPanel; exports.imageToCanvasPoint = _chunk3YDQLQH2cjs.imageToCanvasPoint; exports.importPsd = _chunk3YDQLQH2cjs.importPsd; exports.inflate = _chunkXFM3OCHUcjs.inflate; exports.inflateRaw = _chunkXFM3OCHUcjs.inflateRaw; exports.insertCurvePoint = insertCurvePoint; exports.insertLayer = _chunkHGTDMKNEcjs.insertLayer; exports.instancesOf = _chunk3YDQLQH2cjs.instancesOf; exports.invertHomography = _chunkQT26RHKKcjs.invertHomography; exports.invertMatrix3 = _chunk3YDQLQH2cjs.invertMatrix3; exports.invertSelection = _chunk3YDQLQH2cjs.invertSelection; exports.isActiveFilter = _chunk3YDQLQH2cjs.isActiveFilter; exports.isAdjustmentKind = _chunk3YDQLQH2cjs.isAdjustmentKind; exports.isBitDepth = _chunkCWM3CUUXcjs.isBitDepth; exports.isBlendMode = _chunkCWM3CUUXcjs.isBlendMode; exports.isBrushstrokeBrush = _chunkEBDCRTZIcjs.isBrushstrokeBrush; exports.isContentsDecoded = _chunk3YDQLQH2cjs.isContentsDecoded; exports.isDefaultDepthMask = _chunk3YDQLQH2cjs.isDefaultDepthMask; exports.isGradientPaint = _chunkEBDCRTZIcjs.isGradientPaint; exports.isIdentityCloneTransform = _chunk7NW46N7Icjs.isIdentityCloneTransform; exports.isIdentityTransform = _chunk3YDQLQH2cjs.isIdentityTransform; exports.isInterpolation = _chunkHGTDMKNEcjs.isInterpolation; exports.isLayerEffectKind = _chunkHGTDMKNEcjs.isLayerEffectKind; exports.isLayerLocked = _chunkHGTDMKNEcjs.isLayerLocked; exports.isLegacyShape = _chunk3YDQLQH2cjs.isLegacyShape; exports.isPaintTool = isPaintTool; exports.isPaintableLayer = _chunk3YDQLQH2cjs.isPaintableLayer; exports.isPainterlyBlendMode = _chunkCWM3CUUXcjs.isPainterlyBlendMode; exports.isPng = _chunkCWM3CUUXcjs.isPng; exports.isQuarterTurn = isQuarterTurn; exports.isQuarterTurnSwapped = _chunk3YDQLQH2cjs.isQuarterTurnSwapped; exports.isRenderedLayer = _chunk3YDQLQH2cjs.isRenderedLayer; exports.isRetouchPaintTool = isRetouchPaintTool; exports.isRetouchTool = isRetouchTool; exports.isSelectionEmpty = _chunk3YDQLQH2cjs.isSelectionEmpty; exports.isSelectionMode = _chunk3YDQLQH2cjs.isSelectionMode; exports.isSeparableBlendMode = _chunkCWM3CUUXcjs.isSeparableBlendMode; exports.isSmartSurfaceIncomplete = _chunk3YDQLQH2cjs.isSmartSurfaceIncomplete; exports.isSpatialFilter = _chunk3YDQLQH2cjs.isSpatialFilter; exports.isSrgb = isSrgb; exports.isTransformAnchor = _chunk3YDQLQH2cjs.isTransformAnchor; exports.isValidWarp = _chunk3YDQLQH2cjs.isValidWarp; exports.keepDeepSamples = _chunkCWM3CUUXcjs.keepDeepSamples; exports.kelvinToTemperature = _chunk3YDQLQH2cjs.kelvinToTemperature; exports.keysWeight = _chunkHGTDMKNEcjs.keysWeight; exports.latticeViscosity = _chunkGNK7SESQcjs.latticeViscosity; exports.layerBadge = layerBadge; exports.layerEffectControls = layerEffectControls; exports.layerEffectFields = _chunkHGTDMKNEcjs.layerEffectFields; exports.layerEffectLabel = _chunkHGTDMKNEcjs.layerEffectLabel; exports.layerEffectsBadge = layerEffectsBadge; exports.layerEffectsOf = _chunk3YDQLQH2cjs.layerEffectsOf; exports.layerEffectsPanel = layerEffectsPanel; exports.layerHasThumbnail = layerHasThumbnail; exports.layerLabel = layerLabel; exports.layerMaskCoverage = _chunk3YDQLQH2cjs.layerMaskCoverage; exports.layerMaskFromSelection = _chunk3YDQLQH2cjs.layerMaskFromSelection; exports.layerMaskKey = _chunk3YDQLQH2cjs.layerMaskKey; exports.layerMenu = layerMenu; exports.layerName = _chunk3YDQLQH2cjs.layerName; exports.layerPanelRows = layerPanelRows; exports.layerPanels = layerPanels; exports.layerTree = _chunk3YDQLQH2cjs.layerTree; exports.layerTypeLabel = _chunk3YDQLQH2cjs.layerTypeLabel; exports.layerWarning = layerWarning; exports.layersFromLegacy = _chunk3YDQLQH2cjs.layersFromLegacy; exports.layoutText = _chunkQMI5HZWAcjs.layoutText; exports.legacyAdjustmentLayer = _chunk3YDQLQH2cjs.legacyAdjustmentLayer; exports.legacyMaskOf = _chunk3YDQLQH2cjs.legacyMaskOf; exports.legacyView = _chunk3YDQLQH2cjs.legacyView; exports.lerpPigment = _chunkCWM3CUUXcjs.lerpPigment; exports.lerpPigmentInto = _chunkCWM3CUUXcjs.lerpPigmentInto; exports.levelsValue = _chunk3YDQLQH2cjs.levelsValue; exports.linearSrgbToXy = _chunk3YDQLQH2cjs.linearSrgbToXy; exports.linearToSrgb = _chunk3YDQLQH2cjs.linearToSrgb; exports.linearToSrgb8 = _chunkGNK7SESQcjs.linearToSrgb8; exports.liveComponent = _chunk3YDQLQH2cjs.liveComponent; exports.liveShapeForDrag = liveShapeForDrag; exports.liveShapeSubpaths = _chunk3YDQLQH2cjs.liveShapeSubpaths; exports.loadImageEditorDocument = loadImageEditorDocument; exports.loadMixer = _chunkEBDCRTZIcjs.loadMixer; exports.loadOpenTypeFont = _chunk5UEFNX24cjs.loadOpenTypeFont; exports.loadWetKernel = _chunkGNK7SESQcjs.loadWetKernel; exports.luma = _chunk7NW46N7Icjs.luma; exports.magicWand = magicWand; exports.mapCropHandle = _chunk3YDQLQH2cjs.mapCropHandle; exports.mapLayer = _chunkHGTDMKNEcjs.mapLayer; exports.mapSubpaths = _chunk3YDQLQH2cjs.mapSubpaths; exports.maskBounds = _chunk7NW46N7Icjs.maskBounds; exports.maskSummary = maskSummary; exports.matrixFromCorners = _chunk3YDQLQH2cjs.matrixFromCorners; exports.matrixFromParams = _chunk3YDQLQH2cjs.matrixFromParams; exports.measureCanvasViewport = measureCanvasViewport; exports.membraneFill = _chunk7NW46N7Icjs.membraneFill; exports.mergeLayerEffect = _chunkHGTDMKNEcjs.mergeLayerEffect; exports.mergeShapeComponents = _chunk3YDQLQH2cjs.mergeShapeComponents; exports.migrateSerializedImageEditorState = migrateSerializedImageEditorState; exports.migrateToLayeredState = migrateToLayeredState; exports.mix32 = _chunkEBDCRTZIcjs.mix32; exports.mixPigment8 = _chunkCWM3CUUXcjs.mixPigment8; exports.mixPigmentRgb = _chunkCWM3CUUXcjs.mixPigmentRgb; exports.mixPigments = _chunkCWM3CUUXcjs.mixPigments; exports.mixerLoadResult = mixerLoadResult; exports.mixerRates = _chunkEBDCRTZIcjs.mixerRates; exports.modifySelection = _chunk3YDQLQH2cjs.modifySelection; exports.moveCurvePoint = moveCurvePoint; exports.moveLayer = _chunk3YDQLQH2cjs.moveLayer; exports.moveSmartFilter = _chunk3YDQLQH2cjs.moveSmartFilter; exports.mulMatrix3 = _chunk3YDQLQH2cjs.mulMatrix3; exports.needsLegacyBase = needsLegacyBase; exports.neutralHueRange = _chunk3YDQLQH2cjs.neutralHueRange; exports.newContentsId = _chunk3YDQLQH2cjs.newContentsId; exports.newEffectId = _chunkHGTDMKNEcjs.newEffectId; exports.newLayerId = _chunk3YDQLQH2cjs.newLayerId; exports.newLayerOptions = newLayerOptions; exports.normalizeAdjustmentLayer = _chunk3YDQLQH2cjs.normalizeAdjustmentLayer; exports.normalizeAdjustmentLayers = _chunk3YDQLQH2cjs.normalizeAdjustmentLayers; exports.normalizeAngle = _chunk3YDQLQH2cjs.normalizeAngle; exports.normalizeBlendMode = _chunkCWM3CUUXcjs.normalizeBlendMode; exports.normalizeBlender = _chunkEBDCRTZIcjs.normalizeBlender; exports.normalizeBrush = _chunkEBDCRTZIcjs.normalizeBrush; exports.normalizeFilter = _chunk3YDQLQH2cjs.normalizeFilter; exports.normalizeFlow = _chunkGNK7SESQcjs.normalizeFlow; exports.normalizeHexColor = _chunkEBDCRTZIcjs.normalizeHexColor; exports.normalizeLayerEffects = _chunkHGTDMKNEcjs.normalizeLayerEffects; exports.normalizeLayerMask = _chunk3YDQLQH2cjs.normalizeLayerMask; exports.normalizeLiveShape = _chunk3YDQLQH2cjs.normalizeLiveShape; exports.normalizeMixer = _chunkEBDCRTZIcjs.normalizeMixer; exports.normalizePlacement = _chunk3YDQLQH2cjs.normalizePlacement; exports.normalizeProcessVersion = _chunk3YDQLQH2cjs.normalizeProcessVersion; exports.normalizeRect = normalizeRect; exports.normalizeRefineEdgeParams = normalizeRefineEdgeParams; exports.normalizeRetouch = _chunk7NW46N7Icjs.normalizeRetouch; exports.normalizeShapePaint = _chunk3YDQLQH2cjs.normalizeShapePaint; exports.normalizeShapeStroke = _chunk3YDQLQH2cjs.normalizeShapeStroke; exports.normalizeSmartFilter = _chunk3YDQLQH2cjs.normalizeSmartFilter; exports.normalizeSmudge = _chunkEBDCRTZIcjs.normalizeSmudge; exports.normalizeStoredAdjustments = normalizeStoredAdjustments; exports.normalizeSubpaths = _chunk3YDQLQH2cjs.normalizeSubpaths; exports.normalizeText = _chunk3YDQLQH2cjs.normalizeText; exports.normalizeTilt = _chunkGNK7SESQcjs.normalizeTilt; exports.normalizeWetParams = _chunkGNK7SESQcjs.normalizeWetParams; exports.offsetLayer = _chunk3YDQLQH2cjs.offsetLayer; exports.offsetShape = _chunk3YDQLQH2cjs.offsetShape; exports.offsetSmartObject = _chunk3YDQLQH2cjs.offsetSmartObject; exports.openPsdFile = openPsdFile; exports.packRgba = _chunkCWM3CUUXcjs.packRgba; exports.packWetParams = _chunkGNK7SESQcjs.packWetParams; exports.paintGradientMappingFor = _chunkEBDCRTZIcjs.paintGradientMappingFor; exports.paintPathStroke = _chunkEBDCRTZIcjs.paintPathStroke; exports.paintSourceColor = _chunkEBDCRTZIcjs.paintSourceColor; exports.paintSourceCss = _chunkEBDCRTZIcjs.paintSourceCss; exports.paragraphRanges = _chunkQMI5HZWAcjs.paragraphRanges; exports.parseAdjustmentBlock = _chunk3YDQLQH2cjs.parseAdjustmentBlock; exports.parseBlend = _chunk3YDQLQH2cjs.parseBlend; exports.parseColor = parseColor; exports.parseCssColor = _chunkA2IS7EHEcjs.parseCssColor; exports.parseDataUrl = _chunkCWM3CUUXcjs.parseDataUrl; exports.parseEffectColor = _chunkHGTDMKNEcjs.parseEffectColor; exports.parseLfx2 = _chunk3YDQLQH2cjs.parseLfx2; exports.parseLrfx = _chunk3YDQLQH2cjs.parseLrfx; exports.parseOpenTypeFont = _chunk5UEFNX24cjs.parseOpenTypeFont; exports.parsePaintSource = _chunkEBDCRTZIcjs.parsePaintSource; exports.parsePatternBlock = _chunk3YDQLQH2cjs.parsePatternBlock; exports.parseSelectionMode = _chunk3YDQLQH2cjs.parseSelectionMode; exports.parseVersionedDescriptor = _chunk3YDQLQH2cjs.parseVersionedDescriptor; exports.patchParagraphStyle = _chunk3YDQLQH2cjs.patchParagraphStyle; exports.patchTextStyle = _chunk3YDQLQH2cjs.patchTextStyle; exports.pathStrokeCoverage = _chunkEBDCRTZIcjs.pathStrokeCoverage; exports.pathStrokeDabs = _chunkEBDCRTZIcjs.pathStrokeDabs; exports.perDabStrength = _chunk7NW46N7Icjs.perDabStrength; exports.photoFilterMatrix = _chunk3YDQLQH2cjs.photoFilterMatrix; exports.pigment8 = _chunkCWM3CUUXcjs.pigment8; exports.pigmentColor = _chunkGNK7SESQcjs.pigmentColor; exports.pigmentOf = _chunkGNK7SESQcjs.pigmentOf; exports.pixelLayerBounds = _chunk3YDQLQH2cjs.pixelLayerBounds; exports.pixelLayers = _chunk3YDQLQH2cjs.pixelLayers; exports.pixelPigment = _chunkGNK7SESQcjs.pixelPigment; exports.placeContents = _chunk3YDQLQH2cjs.placeContents; exports.placeLayer = _chunk3YDQLQH2cjs.placeLayer; exports.placementAt = _chunk3YDQLQH2cjs.placementAt; exports.placementBounds = _chunk3YDQLQH2cjs.placementBounds; exports.placementGeometry = _chunk3YDQLQH2cjs.placementGeometry; exports.planImageToolPlayback = planImageToolPlayback; exports.pngDataUrl = _chunkCWM3CUUXcjs.pngDataUrl; exports.pointerPressure = _chunkGNK7SESQcjs.pointerPressure; exports.pointerStrokeSample = _chunkGNK7SESQcjs.pointerStrokeSample; exports.pointerStrokeSamples = _chunkGNK7SESQcjs.pointerStrokeSamples; exports.polygonCoverage = polygonCoverage; exports.polygonSelection = polygonSelection; exports.posterizeValue = _chunk3YDQLQH2cjs.posterizeValue; exports.presetWarp = _chunk3YDQLQH2cjs.presetWarp; exports.previewStep = previewStep; exports.profileBytes = profileBytes; exports.projectImagePoint = _chunk3YDQLQH2cjs.projectImagePoint; exports.projectImageRect = _chunk3YDQLQH2cjs.projectImageRect; exports.projectMaskCoverage = _chunk3YDQLQH2cjs.projectMaskCoverage; exports.projectQuarterTurn = projectQuarterTurn; exports.proxyOf = _chunkCWM3CUUXcjs.proxyOf; exports.psdBytesFromBase64 = psdBytesFromBase64; exports.psdFileName = psdFileName; exports.psdPatternToEffectPattern = _chunk3YDQLQH2cjs.psdPatternToEffectPattern; exports.psdToLayers = _chunk3YDQLQH2cjs.psdToLayers; exports.pullWarpMesh = _chunkQMI5HZWAcjs.pullWarpMesh; exports.put255 = _chunkEBDCRTZIcjs.put255; exports.quadFrameOverlay = quadFrameOverlay; exports.quickMaskPixels = quickMaskPixels; exports.rand01 = _chunkEBDCRTZIcjs.rand01; exports.randSigned = _chunkEBDCRTZIcjs.randSigned; exports.rangeLightness = _chunk3YDQLQH2cjs.rangeLightness; exports.rasterContents = _chunk3YDQLQH2cjs.rasterContents; exports.rasterMaskFromLegacy = _chunk3YDQLQH2cjs.rasterMaskFromLegacy; exports.rasterizeCoverage = _chunk3YDQLQH2cjs.rasterizeCoverage; exports.rasterizeDab = _chunkEBDCRTZIcjs.rasterizeDab; exports.rasterizeSmartObject = _chunk3YDQLQH2cjs.rasterizeSmartObject; exports.readAdjustmentControls = readAdjustmentControls; exports.readDeepRegion = _chunkCWM3CUUXcjs.readDeepRegion; exports.readPaintSource = _chunkEBDCRTZIcjs.readPaintSource; exports.readPixel = _chunkCWM3CUUXcjs.readPixel; exports.readPsd = _chunk3YDQLQH2cjs.readPsd; exports.readRegion = _chunkCWM3CUUXcjs.readRegion; exports.readSourceRegion = _chunk7NW46N7Icjs.readSourceRegion; exports.rectSelection = rectSelection; exports.rectToQuad = _chunkQT26RHKKcjs.rectToQuad; exports.reduceSurface = _chunkHGTDMKNEcjs.reduceSurface; exports.referencePoint = _chunk3YDQLQH2cjs.referencePoint; exports.refineCoverage = refineCoverage; exports.refineEdgeHalo = refineEdgeHalo; exports.refineSelection = refineSelection; exports.reflectanceToRgb = _chunkCWM3CUUXcjs.reflectanceToRgb; exports.removeAlpha = _chunk3YDQLQH2cjs.removeAlpha; exports.removeCurvePoint = removeCurvePoint; exports.removeLayer = _chunk3YDQLQH2cjs.removeLayer; exports.removeLayerEffect = _chunk3YDQLQH2cjs.removeLayerEffect; exports.removeLayerFilter = _chunk3YDQLQH2cjs.removeLayerFilter; exports.removePaintGradientStop = _chunkEBDCRTZIcjs.removePaintGradientStop; exports.removeSmartFilter = _chunk3YDQLQH2cjs.removeSmartFilter; exports.renderBrushstroke = _chunkEBDCRTZIcjs.renderBrushstroke; exports.renderLayerEffects = _chunkHGTDMKNEcjs.renderLayerEffects; exports.renderLayeredBase = renderLayeredBase; exports.renderShape = _chunk3YDQLQH2cjs.renderShape; exports.renderShapeRect = _chunk3YDQLQH2cjs.renderShapeRect; exports.renderSmartObject = _chunk3YDQLQH2cjs.renderSmartObject; exports.renderText = _chunk3YDQLQH2cjs.renderText; exports.replaceContents = _chunk3YDQLQH2cjs.replaceContents; exports.replaceTextRange = _chunk3YDQLQH2cjs.replaceTextRange; exports.requireLayer = _chunk3YDQLQH2cjs.requireLayer; exports.requireOperation = _chunk3YDQLQH2cjs.requireOperation; exports.requireShapeLayer = _chunk3YDQLQH2cjs.requireShapeLayer; exports.requireSmartObject = _chunk3YDQLQH2cjs.requireSmartObject; exports.requireTypeLayer = _chunk3YDQLQH2cjs.requireTypeLayer; exports.requireUnlocked = _chunk3YDQLQH2cjs.requireUnlocked; exports.rerender = _chunk3YDQLQH2cjs.rerender; exports.rerenderShape = _chunk3YDQLQH2cjs.rerenderShape; exports.rerenderText = _chunk3YDQLQH2cjs.rerenderText; exports.resizePixels = resizePixels; exports.resizeSelection = _chunk3YDQLQH2cjs.resizeSelection; exports.resizeWarpMesh = _chunkQMI5HZWAcjs.resizeWarpMesh; exports.resolveExternalAssets = _chunk3YDQLQH2cjs.resolveExternalAssets; exports.resolveMosaicRegionBounds = resolveMosaicRegionBounds; exports.resolvePaintGradient = _chunkEBDCRTZIcjs.resolvePaintGradient; exports.resolveProfile = resolveProfile; exports.restyleRange = _chunkQMI5HZWAcjs.restyleRange; exports.retouchFilter = _chunk7NW46N7Icjs.retouchFilter; exports.reversePaintGradient = _chunkEBDCRTZIcjs.reversePaintGradient; exports.rgbToGray = _chunk3YDQLQH2cjs.rgbToGray; exports.rgbToHsl = _chunk3YDQLQH2cjs.rgbToHsl; exports.rgbToReflectance = _chunkCWM3CUUXcjs.rgbToReflectance; exports.rgbUnitToHex = rgbUnitToHex; exports.rgbaViewOfGrey = _chunk7NW46N7Icjs.rgbaViewOfGrey; exports.runLayerFilters = _chunk3YDQLQH2cjs.runLayerFilters; exports.runLayerFiltersFloat = _chunk3YDQLQH2cjs.runLayerFiltersFloat; exports.runLayerMenuAction = runLayerMenuAction; exports.sameCanvasViewport = sameCanvasViewport; exports.sampleLut = _chunk3YDQLQH2cjs.sampleLut; exports.sampleToneLut = _chunk3YDQLQH2cjs.sampleToneLut; exports.saturationOf = _chunk7NW46N7Icjs.saturationOf; exports.scaleLayerEffect = _chunkHGTDMKNEcjs.scaleLayerEffect; exports.scalePaintGradient = _chunkEBDCRTZIcjs.scalePaintGradient; exports.seamlessClone = _chunk7NW46N7Icjs.seamlessClone; exports.seedFromString = _chunkEBDCRTZIcjs.seedFromString; exports.selectionArea = _chunk3YDQLQH2cjs.selectionArea; exports.selectionFromCoverage = _chunk3YDQLQH2cjs.selectionFromCoverage; exports.selectionFromPixels = _chunk3YDQLQH2cjs.selectionFromPixels; exports.selectionModeFromModifiers = selectionModeFromModifiers; exports.selectionOutline = selectionOutline; exports.selectionToCoverage = _chunk3YDQLQH2cjs.selectionToCoverage; exports.selectionToPixels = _chunk3YDQLQH2cjs.selectionToPixels; exports.selectionValueAt = _chunk3YDQLQH2cjs.selectionValueAt; exports.serializeColorMode = serializeColorMode; exports.serializeColorProfile = serializeColorProfile; exports.serializeContents = _chunk3YDQLQH2cjs.serializeContents; exports.serializeEffects = _chunk3YDQLQH2cjs.serializeEffects; exports.serializeLayer = _chunk3YDQLQH2cjs.serializeLayer; exports.serializeLayers = _chunk3YDQLQH2cjs.serializeLayers; exports.serializeLayersExternal = _chunk3YDQLQH2cjs.serializeLayersExternal; exports.serializePatterns = _chunk3YDQLQH2cjs.serializePatterns; exports.serializeSelection = _chunk3YDQLQH2cjs.serializeSelection; exports.setCloneTransformValue = setCloneTransformValue; exports.setControlPath = setControlPath; exports.setLayerEffects = _chunk3YDQLQH2cjs.setLayerEffects; exports.setLayerEffectsEnabled = _chunk3YDQLQH2cjs.setLayerEffectsEnabled; exports.setLayerMask = _chunk3YDQLQH2cjs.setLayerMask; exports.setLayerProperties = _chunk3YDQLQH2cjs.setLayerProperties; exports.setLum = _chunkCWM3CUUXcjs.setLum; exports.setPigmentColor = _chunkCWM3CUUXcjs.setPigmentColor; exports.setRetouchChoice = setRetouchChoice; exports.setSmartFilterMask = _chunk3YDQLQH2cjs.setSmartFilterMask; exports.setSmartFiltersEnabled = _chunk3YDQLQH2cjs.setSmartFiltersEnabled; exports.setSmartPlacement = _chunk3YDQLQH2cjs.setSmartPlacement; exports.shadeTile = _chunkGNK7SESQcjs.shadeTile; exports.shapeAsPixelLayer = _chunk3YDQLQH2cjs.shapeAsPixelLayer; exports.shapeFromAnnotation = _chunk3YDQLQH2cjs.shapeFromAnnotation; exports.shapeGeometryBounds = _chunk3YDQLQH2cjs.shapeGeometryBounds; exports.shapeLayers = _chunk3YDQLQH2cjs.shapeLayers; exports.shapeOutline = _chunk3YDQLQH2cjs.shapeOutline; exports.shapeRenderClip = _chunk3YDQLQH2cjs.shapeRenderClip; exports.shiftCoverage = _chunk3YDQLQH2cjs.shiftCoverage; exports.smartFilterRows = smartFilterRows; exports.smartObjectLayers = _chunk3YDQLQH2cjs.smartObjectLayers; exports.smoothCoverage = _chunk3YDQLQH2cjs.smoothCoverage; exports.smoothPoints = _chunkEBDCRTZIcjs.smoothPoints; exports.smudgeEffect = _chunk7NW46N7Icjs.smudgeEffect; exports.solidPaint = _chunkEBDCRTZIcjs.solidPaint; exports.solidSurface = _chunkCWM3CUUXcjs.solidSurface; exports.solveMembrane = _chunk7NW46N7Icjs.solveMembrane; exports.spliceRuns = _chunkQMI5HZWAcjs.spliceRuns; exports.splitOverlayAnnotations = splitOverlayAnnotations; exports.sponge = _chunk7NW46N7Icjs.sponge; exports.spongeEffect = _chunk7NW46N7Icjs.spongeEffect; exports.spotHealPixels = _chunk7NW46N7Icjs.spotHealPixels; exports.spotHealWindow = _chunk7NW46N7Icjs.spotHealWindow; exports.srgb8ToLab = srgb8ToLab; exports.srgbByteToLinear = _chunkGNK7SESQcjs.srgbByteToLinear; exports.srgbDecode = _chunkCWM3CUUXcjs.srgbDecode; exports.srgbEncode = _chunkCWM3CUUXcjs.srgbEncode; exports.srgbToLinear = _chunk3YDQLQH2cjs.srgbToLinear; exports.standardBlendMode = _chunkCWM3CUUXcjs.standardBlendMode; exports.stepSlotTs = _chunkGNK7SESQcjs.stepSlotTs; exports.strokeGrainCatch = _chunkEBDCRTZIcjs.strokeGrainCatch; exports.styleAt = _chunkQMI5HZWAcjs.styleAt; exports.sumHistograms = sumHistograms; exports.surfaceBytes = _chunkCWM3CUUXcjs.surfaceBytes; exports.surfaceDepth = _chunkCWM3CUUXcjs.surfaceDepth; exports.surfaceFromDeepPixels = _chunkCWM3CUUXcjs.surfaceFromDeepPixels; exports.surfaceFromPixels = _chunkCWM3CUUXcjs.surfaceFromPixels; exports.surfacesEqual = _chunkCWM3CUUXcjs.surfacesEqual; exports.tempTintToXy = _chunk3YDQLQH2cjs.tempTintToXy; exports.temperatureToKelvin = _chunk3YDQLQH2cjs.temperatureToKelvin; exports.textIndexAt = _chunkQMI5HZWAcjs.textIndexAt; exports.textMatrix = _chunk3YDQLQH2cjs.textMatrix; exports.textOutlines = _chunk3YDQLQH2cjs.textOutlines; exports.textRange = _chunk3YDQLQH2cjs.textRange; exports.tileCoord = _chunkCWM3CUUXcjs.tileCoord; exports.tileKey = _chunkCWM3CUUXcjs.tileKey; exports.tileRect = _chunkCWM3CUUXcjs.tileRect; exports.tileSamples = _chunkCWM3CUUXcjs.tileSamples; exports.tileSamples16 = _chunkCWM3CUUXcjs.tileSamples16; exports.tileSamples32 = _chunkCWM3CUUXcjs.tileSamples32; exports.tilesInRect = _chunkCWM3CUUXcjs.tilesInRect; exports.tipFalloff = _chunkEBDCRTZIcjs.tipFalloff; exports.tipReach = _chunkEBDCRTZIcjs.tipReach; exports.tipShape = _chunkEBDCRTZIcjs.tipShape; exports.to16From32 = _chunkCWM3CUUXcjs.to16From32; exports.to16From8 = _chunkCWM3CUUXcjs.to16From8; exports.to32From16 = _chunkCWM3CUUXcjs.to32From16; exports.to32From8 = _chunkCWM3CUUXcjs.to32From8; exports.to8From16 = _chunkCWM3CUUXcjs.to8From16; exports.to8From32 = _chunkCWM3CUUXcjs.to8From32; exports.toHex = toHex; exports.toTextSpace = _chunk3YDQLQH2cjs.toTextSpace; exports.toneCurve = _chunk3YDQLQH2cjs.toneCurve; exports.toneLuts = _chunk3YDQLQH2cjs.toneLuts; exports.toneOf = _chunk7NW46N7Icjs.toneOf; exports.toneRange = toneRange; exports.transformHomography = _chunk3YDQLQH2cjs.transformHomography; exports.transformMap = _chunk3YDQLQH2cjs.transformMap; exports.transformShapeComponents = _chunk3YDQLQH2cjs.transformShapeComponents; exports.transformSurface = _chunkHGTDMKNEcjs.transformSurface; exports.transformTypeLayer = _chunk3YDQLQH2cjs.transformTypeLayer; exports.transformedBounds = _chunkHGTDMKNEcjs.transformedBounds; exports.transformedBox = _chunk3YDQLQH2cjs.transformedBox; exports.transformedPoint = _chunk3YDQLQH2cjs.transformedPoint; exports.translateLayer = _chunk3YDQLQH2cjs.translateLayer; exports.translateSurface = _chunkCWM3CUUXcjs.translateSurface; exports.typeAsPixelLayer = _chunk3YDQLQH2cjs.typeAsPixelLayer; exports.typeFrame = _chunk3YDQLQH2cjs.typeFrame; exports.typeFromAnnotation = _chunk3YDQLQH2cjs.typeFromAnnotation; exports.typeLayerAt = typeLayerAt; exports.typeLayerName = _chunk3YDQLQH2cjs.typeLayerName; exports.ungroupLayer = _chunk3YDQLQH2cjs.ungroupLayer; exports.uniformTile = _chunkCWM3CUUXcjs.uniformTile; exports.unionRect = _chunk3YDQLQH2cjs.unionRect; exports.unprojectCanvasPoint = _chunk3YDQLQH2cjs.unprojectCanvasPoint; exports.updateLayerEffect = _chunk3YDQLQH2cjs.updateLayerEffect; exports.updateLayerFilter = _chunk3YDQLQH2cjs.updateLayerFilter; exports.updateLayerMaskProps = _chunk3YDQLQH2cjs.updateLayerMaskProps; exports.updatePaintGradientStop = _chunkEBDCRTZIcjs.updatePaintGradientStop; exports.updateShapeLayer = _chunk3YDQLQH2cjs.updateShapeLayer; exports.updateSmartFilter = _chunk3YDQLQH2cjs.updateSmartFilter; exports.updateTypeLayer = _chunk3YDQLQH2cjs.updateTypeLayer; exports.userErrorMessage = _chunk3YDQLQH2cjs.userErrorMessage; exports.uvToXy = _chunk3YDQLQH2cjs.uvToXy; exports.validateEffectGradient = _chunkHGTDMKNEcjs.validateEffectGradient; exports.validateLayerEffect = _chunkHGTDMKNEcjs.validateLayerEffect; exports.validateLayerEffects = _chunkHGTDMKNEcjs.validateLayerEffects; exports.versionedDescriptorBytes = _chunk3YDQLQH2cjs.versionedDescriptorBytes; exports.vibranceLinear = _chunk3YDQLQH2cjs.vibranceLinear; exports.vibrancePixel = _chunk3YDQLQH2cjs.vibrancePixel; exports.walkDabs = _chunkEBDCRTZIcjs.walkDabs; exports.warpMeshEditPoints = _chunkQMI5HZWAcjs.warpMeshEditPoints; exports.warpMeshGridCurves = _chunkQMI5HZWAcjs.warpMeshGridCurves; exports.warpMeshParamAt = _chunkQMI5HZWAcjs.warpMeshParamAt; exports.warpPresetMesh = _chunkQMI5HZWAcjs.warpPresetMesh; exports.warpSurface = _chunkHGTDMKNEcjs.warpSurface; exports.watchCanvasViewport = watchCanvasViewport; exports.wbMatrix = _chunk3YDQLQH2cjs.wbMatrix; exports.wetGpuSupport = _chunkGNK7SESQcjs.wetGpuSupport; exports.wetSimdSupported = _chunkGNK7SESQcjs.wetSimdSupported; exports.wetSupport = _chunkGNK7SESQcjs.wetSupport; exports.whiteBalanceFromSample = _chunk3YDQLQH2cjs.whiteBalanceFromSample; exports.whiteBalanceMatrix = _chunk3YDQLQH2cjs.whiteBalanceMatrix; exports.withFilterMaskSurface = _chunk3YDQLQH2cjs.withFilterMaskSurface; exports.withImagePlayback = withImagePlayback; exports.withNewIds = _chunk3YDQLQH2cjs.withNewIds; exports.writeAdjustmentBlock = _chunk3YDQLQH2cjs.writeAdjustmentBlock; exports.writeDeepRegion = _chunkCWM3CUUXcjs.writeDeepRegion; exports.writeLfx2 = _chunk3YDQLQH2cjs.writeLfx2; exports.writePatternBlock = _chunk3YDQLQH2cjs.writePatternBlock; exports.writePsd = _chunk3YDQLQH2cjs.writePsd; exports.writeRegion = _chunkCWM3CUUXcjs.writeRegion; exports.xyToTempTint = _chunk3YDQLQH2cjs.xyToTempTint; exports.xyToUv = _chunk3YDQLQH2cjs.xyToUv;
16605
+ exports.ADJUSTMENT_KEYS = _chunk32MMQYCQcjs.ADJUSTMENT_KEYS; exports.ADJUSTMENT_KINDS = _chunk32MMQYCQcjs.ADJUSTMENT_KINDS; exports.ADJUSTMENT_LAYER_CONTROLS = ADJUSTMENT_LAYER_CONTROLS; exports.ADJUSTMENT_LAYER_OPACITY_CONTROL = ADJUSTMENT_LAYER_OPACITY_CONTROL; exports.ADJUSTMENT_LUT_SIZE = _chunk32MMQYCQcjs.ADJUSTMENT_LUT_SIZE; exports.ANCHOR_FRACTION = _chunk32MMQYCQcjs.ANCHOR_FRACTION; exports.AS_SHOT_KELVIN = _chunk32MMQYCQcjs.AS_SHOT_KELVIN; exports.BACKGROUND_LAYER_ID = _chunk32MMQYCQcjs.BACKGROUND_LAYER_ID; exports.BACKGROUND_LAYER_NAME = _chunk32MMQYCQcjs.BACKGROUND_LAYER_NAME; exports.BIT_DEPTHS = _chunkCWM3CUUXcjs.BIT_DEPTHS; exports.BIT_DEPTH_OPTIONS = BIT_DEPTH_OPTIONS; exports.BLEND_MODES = _chunkCWM3CUUXcjs.BLEND_MODES; exports.BLUR_FILTER_ID = _chunk32MMQYCQcjs.BLUR_FILTER_ID; exports.BODY_SCATTER = _chunkGNK7SESQcjs.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 = _chunkEBDCRTZIcjs.BrushstrokeCache; exports.CANVAS_SIZE_PRESETS = CANVAS_SIZE_PRESETS; exports.CLONE_TRANSFORM_CONTROLS = CLONE_TRANSFORM_CONTROLS; exports.COLOR_MODE_OPTIONS = COLOR_MODE_OPTIONS; exports.CoverageMap = _chunkEBDCRTZIcjs.CoverageMap; exports.D50 = _chunk32MMQYCQcjs.D50; exports.D65 = _chunk32MMQYCQcjs.D65; exports.DEFAULT_ADJUSTMENTS = DEFAULT_ADJUSTMENTS; exports.DEFAULT_AUTO_LEADING = _chunk236TKNURcjs.DEFAULT_AUTO_LEADING; exports.DEFAULT_BLENDER = _chunkEBDCRTZIcjs.DEFAULT_BLENDER; exports.DEFAULT_BRUSH = _chunkEBDCRTZIcjs.DEFAULT_BRUSH; exports.DEFAULT_CANVAS_VIEWPORT = DEFAULT_CANVAS_VIEWPORT; exports.DEFAULT_DEPTH_MASK = DEFAULT_DEPTH_MASK; exports.DEFAULT_FLOW = _chunkGNK7SESQcjs.DEFAULT_FLOW; exports.DEFAULT_GLOBAL_LIGHT = _chunkHGTDMKNEcjs.DEFAULT_GLOBAL_LIGHT; exports.DEFAULT_MITER_LIMIT = _chunk32MMQYCQcjs.DEFAULT_MITER_LIMIT; exports.DEFAULT_MIXER = _chunkEBDCRTZIcjs.DEFAULT_MIXER; exports.DEFAULT_PAINT_GRADIENT = _chunkEBDCRTZIcjs.DEFAULT_PAINT_GRADIENT; exports.DEFAULT_PAINT_GRADIENT_MAPPING = _chunkEBDCRTZIcjs.DEFAULT_PAINT_GRADIENT_MAPPING; exports.DEFAULT_PROOF = DEFAULT_PROOF; exports.DEFAULT_REFINE_EDGE_PARAMS = DEFAULT_REFINE_EDGE_PARAMS; exports.DEFAULT_RETOUCH = _chunk7NW46N7Icjs.DEFAULT_RETOUCH; exports.DEFAULT_SELECTION_TOOL_OPTIONS = DEFAULT_SELECTION_TOOL_OPTIONS; exports.DEFAULT_SHAPE_TOOL_OPTIONS = DEFAULT_SHAPE_TOOL_OPTIONS; exports.DEFAULT_SMUDGE = _chunkEBDCRTZIcjs.DEFAULT_SMUDGE; exports.DEFAULT_TEXT_STYLE = _chunk236TKNURcjs.DEFAULT_TEXT_STYLE; exports.DEFAULT_TRANSFORM = DEFAULT_TRANSFORM; exports.DEFAULT_TYPE_TOOL_OPTIONS = DEFAULT_TYPE_TOOL_OPTIONS; exports.DEFAULT_WET_PAPER = _chunkGNK7SESQcjs.DEFAULT_WET_PAPER; exports.DEFAULT_WET_PARAMS = _chunkGNK7SESQcjs.DEFAULT_WET_PARAMS; exports.DEPTH_MASK_CONTROLS = DEPTH_MASK_CONTROLS; exports.DEVELOP_FILTER_ID = _chunk32MMQYCQcjs.DEVELOP_FILTER_ID; exports.DIRECT_GAUSSIAN_MAX_SIGMA = _chunkHGTDMKNEcjs.DIRECT_GAUSSIAN_MAX_SIGMA; exports.DRY_EPS = _chunkGNK7SESQcjs.DRY_EPS; exports.DabWalker = _chunkEBDCRTZIcjs.DabWalker; exports.EMPTY_DISTANCE = _chunk32MMQYCQcjs.EMPTY_DISTANCE; exports.EMPTY_MIXER_LOAD = _chunkEBDCRTZIcjs.EMPTY_MIXER_LOAD; exports.EX = _chunkGNK7SESQcjs.EX; exports.EY = _chunkGNK7SESQcjs.EY; exports.FLAG_ALIVE = _chunkGNK7SESQcjs.FLAG_ALIVE; exports.FLAG_BOTTOM = _chunkGNK7SESQcjs.FLAG_BOTTOM; exports.FLAG_LEFT = _chunkGNK7SESQcjs.FLAG_LEFT; exports.FLAG_RIGHT = _chunkGNK7SESQcjs.FLAG_RIGHT; exports.FLAG_TOP = _chunkGNK7SESQcjs.FLAG_TOP; exports.FLAG_WET = _chunkGNK7SESQcjs.FLAG_WET; exports.FLAT = _chunkGNK7SESQcjs.FLAT; exports.FREE_INTERVAL = _chunkGNK7SESQcjs.FREE_INTERVAL; exports.FREE_TRANSFORM_CONTENTS = FREE_TRANSFORM_CONTENTS; exports.FREE_TRANSFORM_FIELDS = FREE_TRANSFORM_FIELDS; exports.FREE_TRANSFORM_MODES = _chunk32MMQYCQcjs.FREE_TRANSFORM_MODES; exports.FREE_TRANSFORM_MODE_OPTIONS = FREE_TRANSFORM_MODE_OPTIONS; exports.FreeTransformSession = FreeTransformSession; exports.FreeTransformTool = FreeTransformTool; exports.GRAIN_PATTERNS = _chunkEBDCRTZIcjs.GRAIN_PATTERNS; exports.GRAIN_TILE = _chunkEBDCRTZIcjs.GRAIN_TILE; exports.GUIDED_FILTER_EPS = GUIDED_FILTER_EPS; exports.HIDE = _chunkGNK7SESQcjs.HIDE; exports.HISTOGRAM_BINS = HISTOGRAM_BINS; exports.HUE_RANGE_LABELS = _chunk32MMQYCQcjs.HUE_RANGE_LABELS; exports.IDENTITY_CLONE_TRANSFORM = _chunk7NW46N7Icjs.IDENTITY_CLONE_TRANSFORM; exports.IDENTITY_MATRIX3 = _chunk32MMQYCQcjs.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.INTENTS = _chunkBROJYMWUcjs.INTENTS; exports.INTENT_OPTIONS = INTENT_OPTIONS; exports.INTERPOLATIONS = _chunkHGTDMKNEcjs.INTERPOLATIONS; exports.ImageEditorController = ImageEditorController; exports.ImageEditorRenderer = ImageEditorRenderer; exports.ImageEffectsEngine = ImageEffectsEngine; exports.LATEST_PROCESS_VERSION = _chunk32MMQYCQcjs.LATEST_PROCESS_VERSION; exports.LAYERED_SCHEMA_VERSION = _chunk32MMQYCQcjs.LAYERED_SCHEMA_VERSION; exports.LAYER_EFFECT_KINDS = _chunkHGTDMKNEcjs.LAYER_EFFECT_KINDS; exports.LAYER_EFFECT_MENU = LAYER_EFFECT_MENU; exports.LEGACY_PROCESS_VERSION = _chunk32MMQYCQcjs.LEGACY_PROCESS_VERSION; exports.LIVE_SHAPE_KINDS = _chunk32MMQYCQcjs.LIVE_SHAPE_KINDS; exports.LUMA_709 = _chunk32MMQYCQcjs.LUMA_709; exports.LayerCompositor = _chunk32MMQYCQcjs.LayerCompositor; exports.LayerEffectError = _chunkHGTDMKNEcjs.LayerEffectError; exports.LayerOperationError = _chunk32MMQYCQcjs.LayerOperationError; exports.MAX_BATCH = _chunkGNK7SESQcjs.MAX_BATCH; exports.MAX_BRUSH_SIZE = _chunkEBDCRTZIcjs.MAX_BRUSH_SIZE; exports.MAX_CANVAS_BACKING_SIDE = MAX_CANVAS_BACKING_SIDE; exports.MAX_EFFECT_REACH = _chunkHGTDMKNEcjs.MAX_EFFECT_REACH; exports.MAX_KELVIN = _chunk32MMQYCQcjs.MAX_KELVIN; exports.MAX_TILT_ACCEL = _chunkGNK7SESQcjs.MAX_TILT_ACCEL; exports.MAX_TRANSFORM_PIXELS = _chunkHGTDMKNEcjs.MAX_TRANSFORM_PIXELS; exports.MAX_WET_LANES = _chunkGNK7SESQcjs.MAX_WET_LANES; exports.MAX_WET_SLOTS = _chunkGNK7SESQcjs.MAX_WET_SLOTS; exports.MIN_KELVIN = _chunk32MMQYCQcjs.MIN_KELVIN; exports.MIRED_PER_TEMPERATURE_UNIT = _chunk32MMQYCQcjs.MIRED_PER_TEMPERATURE_UNIT; exports.MIXER_DRAIN = _chunkEBDCRTZIcjs.MIXER_DRAIN; exports.MIXER_MIXING_OPTIONS = MIXER_MIXING_OPTIONS; exports.MIXER_OPTION_CONTROLS = MIXER_OPTION_CONTROLS; exports.MIXER_PICKUP_RATE = _chunkEBDCRTZIcjs.MIXER_PICKUP_RATE; exports.MIXING_MODELS = _chunkEBDCRTZIcjs.MIXING_MODELS; exports.MixerStroke = _chunkEBDCRTZIcjs.MixerStroke; exports.OPP = _chunkGNK7SESQcjs.OPP; exports.PAINTERLY_BLEND_MODES = _chunkCWM3CUUXcjs.PAINTERLY_BLEND_MODES; exports.PAINT_COLOR_JSON_SCHEMA = _chunkEBDCRTZIcjs.PAINT_COLOR_JSON_SCHEMA; exports.PAINT_GRADIENT_FULL_SPEED = _chunkEBDCRTZIcjs.PAINT_GRADIENT_FULL_SPEED; exports.PAINT_GRADIENT_JSON_SCHEMA = _chunkEBDCRTZIcjs.PAINT_GRADIENT_JSON_SCHEMA; exports.PAINT_GRADIENT_KIT = _chunkEBDCRTZIcjs.PAINT_GRADIENT_KIT; exports.PAINT_GRADIENT_MAPPINGS = _chunkEBDCRTZIcjs.PAINT_GRADIENT_MAPPINGS; exports.PAINT_GRADIENT_MAPPING_LABELS = _chunkEBDCRTZIcjs.PAINT_GRADIENT_MAPPING_LABELS; exports.PAINT_GRADIENT_PRESETS = _chunkEBDCRTZIcjs.PAINT_GRADIENT_PRESETS; exports.PAINT_GRADIENT_REPEATS = _chunkEBDCRTZIcjs.PAINT_GRADIENT_REPEATS; exports.PAINT_GRADIENT_REPEAT_LABELS = _chunkEBDCRTZIcjs.PAINT_GRADIENT_REPEAT_LABELS; exports.PAINT_GRADIENT_SPACES = _chunkEBDCRTZIcjs.PAINT_GRADIENT_SPACES; exports.PAINT_GRADIENT_SPACE_LABELS = _chunkEBDCRTZIcjs.PAINT_GRADIENT_SPACE_LABELS; exports.PAINT_SOURCE_JSON_SCHEMA = _chunkEBDCRTZIcjs.PAINT_SOURCE_JSON_SCHEMA; exports.PAINT_TOOLS = PAINT_TOOLS; exports.PAPER_CAPACITY = _chunkGNK7SESQcjs.PAPER_CAPACITY; exports.PARAGRAPH_STYLE_FIELDS = _chunk32MMQYCQcjs.PARAGRAPH_STYLE_FIELDS; exports.PARAM = _chunkGNK7SESQcjs.PARAM; exports.PARAM_FLOATS = _chunkGNK7SESQcjs.PARAM_FLOATS; exports.PATTERN_BLOCK_KEYS = _chunk32MMQYCQcjs.PATTERN_BLOCK_KEYS; exports.PIGMENT_BANDS = _chunkCWM3CUUXcjs.PIGMENT_BANDS; exports.PIGMENT_CHANNELS = _chunkGNK7SESQcjs.PIGMENT_CHANNELS; exports.PIGMENT_LAMBDA_MIN = _chunkCWM3CUUXcjs.PIGMENT_LAMBDA_MIN; exports.PIGMENT_LAMBDA_STEP = _chunkCWM3CUUXcjs.PIGMENT_LAMBDA_STEP; exports.PIGMENT_UNIT = _chunkGNK7SESQcjs.PIGMENT_UNIT; exports.PIGMENT_WAVELENGTHS = _chunkCWM3CUUXcjs.PIGMENT_WAVELENGTHS; exports.PLANE = _chunkGNK7SESQcjs.PLANE; exports.PLANE_BYTES = _chunkGNK7SESQcjs.PLANE_BYTES; exports.PROOF_PROFILE_OPTIONS = PROOF_PROFILE_OPTIONS; exports.PSD_BLEND_KEYS = _chunk32MMQYCQcjs.PSD_BLEND_KEYS; exports.PSD_FILE_ACCEPT = PSD_FILE_ACCEPT; exports.P_D0 = _chunkGNK7SESQcjs.P_D0; exports.P_EDGE = _chunkGNK7SESQcjs.P_EDGE; exports.P_FX = _chunkGNK7SESQcjs.P_FX; exports.P_FY = _chunkGNK7SESQcjs.P_FY; exports.P_H = _chunkGNK7SESQcjs.P_H; exports.P_P0 = _chunkGNK7SESQcjs.P_P0; exports.P_RHO = _chunkGNK7SESQcjs.P_RHO; exports.P_SW = _chunkGNK7SESQcjs.P_SW; exports.P_UX = _chunkGNK7SESQcjs.P_UX; exports.P_UY = _chunkGNK7SESQcjs.P_UY; exports.PaintExchange = _chunkEBDCRTZIcjs.PaintExchange; exports.PaintGesture = PaintGesture; exports.PaintGradientSampler = _chunkEBDCRTZIcjs.PaintGradientSampler; exports.PaintSourceError = _chunkEBDCRTZIcjs.PaintSourceError; exports.PaintStrokeSession = PaintStrokeSession; exports.PaperGrain = _chunkEBDCRTZIcjs.PaperGrain; exports.PatternPlacement = _chunkHGTDMKNEcjs.PatternPlacement; exports.PatternTile = _chunkHGTDMKNEcjs.PatternTile; exports.PsdError = _chunk32MMQYCQcjs.PsdError; exports.REFINE_EDGE_CONTROLS = REFINE_EDGE_CONTROLS; exports.RETOUCH_CHOICES = RETOUCH_CHOICES; exports.RETOUCH_OPTION_CONTROLS = RETOUCH_OPTION_CONTROLS; exports.RETOUCH_SAMPLES = _chunk7NW46N7Icjs.RETOUCH_SAMPLES; exports.RETOUCH_TOGGLES = RETOUCH_TOGGLES; exports.RETOUCH_TOOLS = RETOUCH_TOOLS; exports.RegionPixelSource = _chunk7NW46N7Icjs.RegionPixelSource; exports.RetouchDabStroke = _chunk7NW46N7Icjs.RetouchDabStroke; exports.SELECTION_MODES = _chunk32MMQYCQcjs.SELECTION_MODES; exports.SELECTION_MODE_LABELS = SELECTION_MODE_LABELS; exports.SELECTION_MODIFY_OPS = _chunk32MMQYCQcjs.SELECTION_MODIFY_OPS; exports.SELECTION_TOOLS = SELECTION_TOOLS; exports.SET_PLANES = _chunkGNK7SESQcjs.SET_PLANES; exports.SHADOW_AMBIENT = _chunkCWM3CUUXcjs.SHADOW_AMBIENT; exports.SHAPE_KIND_LABELS = SHAPE_KIND_LABELS; exports.SHAPE_OPERATIONS = _chunk32MMQYCQcjs.SHAPE_OPERATIONS; exports.SHAPE_RENDER_MARGIN = _chunk32MMQYCQcjs.SHAPE_RENDER_MARGIN; exports.SLOT_BYTES = _chunkGNK7SESQcjs.SLOT_BYTES; exports.SLOT_PLANES = _chunkGNK7SESQcjs.SLOT_PLANES; exports.SLOT_SIDE = _chunkGNK7SESQcjs.SLOT_SIDE; exports.SMART_RENDER_MARGIN = _chunk32MMQYCQcjs.SMART_RENDER_MARGIN; exports.SPOT_HEAL_TYPES = _chunk7NW46N7Icjs.SPOT_HEAL_TYPES; exports.SRGB_TO_LINEAR = _chunkGNK7SESQcjs.SRGB_TO_LINEAR; exports.STRIP = _chunkGNK7SESQcjs.STRIP; exports.SUPPORTED_ADJUSTMENT_KEYS = _chunk32MMQYCQcjs.SUPPORTED_ADJUSTMENT_KEYS; exports.SelectionGesture = SelectionGesture; exports.ShapeDrawGesture = ShapeDrawGesture; exports.SmudgeTip = _chunkEBDCRTZIcjs.SmudgeTip; exports.StrokeCoverage = _chunkEBDCRTZIcjs.StrokeCoverage; exports.SurfaceDraft = _chunkCWM3CUUXcjs.SurfaceDraft; exports.TEXT_ALIGNS = _chunk32MMQYCQcjs.TEXT_ALIGNS; exports.TEXT_RENDER_MARGIN = _chunk32MMQYCQcjs.TEXT_RENDER_MARGIN; exports.TEXT_STYLE_FIELDS = _chunk32MMQYCQcjs.TEXT_STYLE_FIELDS; exports.TILE = _chunkCWM3CUUXcjs.TILE; exports.TILE_SHIFT = _chunkCWM3CUUXcjs.TILE_SHIFT; exports.TINT_SCALE = _chunk32MMQYCQcjs.TINT_SCALE; exports.TIP_GRADIENT_STEPS = _chunkEBDCRTZIcjs.TIP_GRADIENT_STEPS; exports.TONE_LUT_SIZE = _chunk32MMQYCQcjs.TONE_LUT_SIZE; exports.TONE_RANGES = _chunk7NW46N7Icjs.TONE_RANGES; exports.TONE_RANGE_PRESETS = TONE_RANGE_PRESETS; exports.TRANSFORM_ANCHORS = _chunk32MMQYCQcjs.TRANSFORM_ANCHORS; exports.TextEditSession = TextEditSession; exports.TileMedium = _chunkEBDCRTZIcjs.TileMedium; exports.TilePixelSource = _chunk7NW46N7Icjs.TilePixelSource; exports.TileableNoise = _chunkEBDCRTZIcjs.TileableNoise; exports.TiledSurface = _chunkCWM3CUUXcjs.TiledSurface; exports.TransformTooLargeError = _chunkHGTDMKNEcjs.TransformTooLargeError; exports.TransformedPixelSource = _chunk7NW46N7Icjs.TransformedPixelSource; exports.TypeToolGesture = TypeToolGesture; exports.U_MAX = _chunkGNK7SESQcjs.U_MAX; exports.VIBRANCE_GREY = _chunk32MMQYCQcjs.VIBRANCE_GREY; exports.W9 = _chunkGNK7SESQcjs.W9; exports.WARP_GRID_OPTIONS = WARP_GRID_OPTIONS; exports.WARP_STYLES = _chunk236TKNURcjs.WARP_STYLES; exports.WARP_STYLE_LABELS = _chunk236TKNURcjs.WARP_STYLE_LABELS; exports.WARP_STYLE_OPTIONS = WARP_STYLE_OPTIONS; exports.WET_FLOW_KINDS = _chunkGNK7SESQcjs.WET_FLOW_KINDS; exports.WET_PARAM_KEYS = _chunkGNK7SESQcjs.WET_PARAM_KEYS; exports.WET_TILE = _chunkGNK7SESQcjs.WET_TILE; exports.WGSL_HALO = _chunkGNK7SESQcjs.WGSL_HALO; exports.WGSL_SHADE = _chunkGNK7SESQcjs.WGSL_SHADE; exports.WGSL_STEP = _chunkGNK7SESQcjs.WGSL_STEP; exports.WORKING_SPACE_OPTIONS = WORKING_SPACE_OPTIONS; exports.WetGpuEngine = _chunkGNK7SESQcjs.WetGpuEngine; exports.WetMedium = _chunkGNK7SESQcjs.WetMedium; exports.WetWorkerPool = _chunkGNK7SESQcjs.WetWorkerPool; exports.WetWorld = _chunkGNK7SESQcjs.WetWorld; exports.WetWorldError = _chunkGNK7SESQcjs.WetWorldError; exports.XYZ_D50_TO_SRGB = _chunk32MMQYCQcjs.XYZ_D50_TO_SRGB; exports.ZlibError = _chunkXFM3OCHUcjs.ZlibError; exports.activeAdjustmentLayers = _chunk32MMQYCQcjs.activeAdjustmentLayers; exports.activeEffectSmartFilters = _chunk32MMQYCQcjs.activeEffectSmartFilters; exports.activeLayerAfterRemoval = _chunk32MMQYCQcjs.activeLayerAfterRemoval; exports.activeSmartFilters = _chunk32MMQYCQcjs.activeSmartFilters; exports.addLayerEffect = _chunk32MMQYCQcjs.addLayerEffect; exports.addLayerFilter = _chunk32MMQYCQcjs.addLayerFilter; exports.addLayerOfKind = addLayerOfKind; exports.addPaintGradientStop = _chunkEBDCRTZIcjs.addPaintGradientStop; exports.addSmartFilter = _chunk32MMQYCQcjs.addSmartFilter; exports.addToHistogram = addToHistogram; exports.adjustmentKindLabel = _chunk32MMQYCQcjs.adjustmentKindLabel; exports.adjustmentLayersKey = _chunk32MMQYCQcjs.adjustmentLayersKey; exports.adjustmentNodeAsLayer = _chunk32MMQYCQcjs.adjustmentNodeAsLayer; exports.adjustmentNodeFromLegacy = _chunk32MMQYCQcjs.adjustmentNodeFromLegacy; exports.adler32 = _chunkXFM3OCHUcjs.adler32; exports.agentDragDraft = agentDragDraft; exports.anchorPoint = _chunk32MMQYCQcjs.anchorPoint; exports.annotationBlend = _chunk32MMQYCQcjs.annotationBlend; exports.annotationLayerFor = _chunk32MMQYCQcjs.annotationLayerFor; exports.annotationLayerName = _chunk32MMQYCQcjs.annotationLayerName; exports.annotationOfLayer = _chunk32MMQYCQcjs.annotationOfLayer; exports.annotationOfShape = _chunk32MMQYCQcjs.annotationOfShape; exports.annotationOfType = _chunk32MMQYCQcjs.annotationOfType; exports.applyAdjustmentLayers = _chunk32MMQYCQcjs.applyAdjustmentLayers; exports.applyAdjustmentLayersFloat = _chunk32MMQYCQcjs.applyAdjustmentLayersFloat; exports.applyAdjustments = _chunk32MMQYCQcjs.applyAdjustments; exports.applyBoxBlur = _chunk32MMQYCQcjs.applyBoxBlur; exports.applyBoxBlurFloat = _chunk32MMQYCQcjs.applyBoxBlurFloat; exports.applyDepthMask = _chunk32MMQYCQcjs.applyDepthMask; exports.applyHomography = _chunkQT26RHKKcjs.applyHomography; exports.applyImageProjectionToContext = _chunk32MMQYCQcjs.applyImageProjectionToContext; exports.applyLegacyAdjustments = _chunk32MMQYCQcjs.applyLegacyAdjustments; exports.applyLegacyFloat = _chunk32MMQYCQcjs.applyLegacyFloat; exports.applyMatrix3 = _chunk32MMQYCQcjs.applyMatrix3; exports.applyOutputStage = applyOutputStage; exports.applyParams = _chunk32MMQYCQcjs.applyParams; exports.applyProcess2Adjustments = _chunk32MMQYCQcjs.applyProcess2Adjustments; exports.applyProcess2Float = _chunk32MMQYCQcjs.applyProcess2Float; exports.applyRegionBlur = applyRegionBlur; exports.applyRegionMosaic = applyRegionMosaic; exports.applyRetouchToTile = _chunk7NW46N7Icjs.applyRetouchToTile; exports.applyShapeOptions = applyShapeOptions; exports.applySmartFilters = _chunk32MMQYCQcjs.applySmartFilters; exports.applyStrokeToDeepTile = _chunkEBDCRTZIcjs.applyStrokeToDeepTile; exports.applyStrokeToTile = _chunkEBDCRTZIcjs.applyStrokeToTile; exports.applyToneToDeepTile = _chunk7NW46N7Icjs.applyToneToDeepTile; exports.backgroundLayer = _chunk32MMQYCQcjs.backgroundLayer; exports.base64ToBytes = _chunkCWM3CUUXcjs.base64ToBytes; exports.baseProjection = baseProjection; exports.bestOffset = _chunk7NW46N7Icjs.bestOffset; exports.blackWhiteGray = _chunk32MMQYCQcjs.blackWhiteGray; exports.blendChannel = _chunkCWM3CUUXcjs.blendChannel; exports.blendImageData = _chunkCWM3CUUXcjs.blendImageData; exports.blendLum = _chunkCWM3CUUXcjs.blendLum; exports.blendPixel = _chunkCWM3CUUXcjs.blendPixel; exports.blendRadius = _chunkEBDCRTZIcjs.blendRadius; exports.blendRgb = _chunkCWM3CUUXcjs.blendRgb; exports.blendTile = _chunkHGTDMKNEcjs.blendTile; exports.blenderDab = _chunkEBDCRTZIcjs.blenderDab; exports.blurFilter = _chunk32MMQYCQcjs.blurFilter; exports.borderCoverage = _chunk32MMQYCQcjs.borderCoverage; exports.boxBlurPixels = _chunk7NW46N7Icjs.boxBlurPixels; exports.boxFrameHit = boxFrameHit; exports.boxFrameOverlay = boxFrameOverlay; exports.boxMean = boxMean; exports.boxPointOf = _chunk32MMQYCQcjs.boxPointOf; exports.boxQuad = _chunkQT26RHKKcjs.boxQuad; exports.boxToCurvePoint = boxToCurvePoint; exports.bradfordAdaptation = _chunk32MMQYCQcjs.bradfordAdaptation; exports.brushstrokeDataUrl = _chunkEBDCRTZIcjs.brushstrokeDataUrl; exports.brushstrokeKey = _chunkEBDCRTZIcjs.brushstrokeKey; exports.brushstrokeSamples = _chunkEBDCRTZIcjs.brushstrokeSamples; exports.brushstrokeScaleBucket = _chunkYQGCPL5Xcjs.brushstrokeScaleBucket; exports.brushstrokeStrokeOptions = _chunkEBDCRTZIcjs.brushstrokeStrokeOptions; exports.brushstrokeToCanvas = _chunkEBDCRTZIcjs.brushstrokeToCanvas; exports.buildLayerMaskPlanes = _chunk32MMQYCQcjs.buildLayerMaskPlanes; exports.buildToneLut = _chunk32MMQYCQcjs.buildToneLut; exports.builtinPattern = _chunkHGTDMKNEcjs.builtinPattern; exports.builtinPatternIds = _chunkHGTDMKNEcjs.builtinPatternIds; exports.bytesToBase64 = _chunkCWM3CUUXcjs.bytesToBase64; exports.calculateCropDrag = _chunk32MMQYCQcjs.calculateCropDrag; exports.canShareMemory = _chunkGNK7SESQcjs.canShareMemory; exports.canvasCompositeOperation = _chunkCWM3CUUXcjs.canvasCompositeOperation; exports.canvasToImagePoint = _chunk32MMQYCQcjs.canvasToImagePoint; exports.caretAt = _chunk236TKNURcjs.caretAt; exports.changedTiles = _chunkHGTDMKNEcjs.changedTiles; exports.checkImageEffectPlace = checkImageEffectPlace; exports.clampControlValue = clampControlValue; exports.clampCropToImage = _chunk32MMQYCQcjs.clampCropToImage; exports.cleanMixer = _chunkEBDCRTZIcjs.cleanMixer; exports.cloneSamplePoint = _chunk7NW46N7Icjs.cloneSamplePoint; exports.cloneSourceLabel = cloneSourceLabel; exports.cloneTransformView = cloneTransformView; exports.collectTiles = _chunkCWM3CUUXcjs.collectTiles; exports.colorBalanceChannel = _chunk32MMQYCQcjs.colorBalanceChannel; exports.colorModePlanes = colorModePlanes; exports.colorModePlanes16 = colorModePlanes16; exports.colorPanelView = colorPanelView; exports.colorRange = colorRange; exports.combineSelections = _chunk32MMQYCQcjs.combineSelections; exports.compileAdjustmentLayer = _chunk32MMQYCQcjs.compileAdjustmentLayer; exports.componentPath = _chunk32MMQYCQcjs.componentPath; exports.compositeDeep = _chunk32MMQYCQcjs.compositeDeep; exports.compositeSurfaceOver = _chunkHGTDMKNEcjs.compositeSurfaceOver; exports.computeHistogram = computeHistogram; exports.computeSelectionBounds = _chunk32MMQYCQcjs.computeSelectionBounds; exports.contentAwareFill = _chunk7NW46N7Icjs.contentAwareFill; exports.contentBounds = _chunkCWM3CUUXcjs.contentBounds; exports.contentsBox = _chunk32MMQYCQcjs.contentsBox; exports.contentsSurface = _chunk32MMQYCQcjs.contentsSurface; exports.contractCoverage = _chunk32MMQYCQcjs.contractCoverage; exports.controlPosition = controlPosition; exports.controlTrackBackground = controlTrackBackground; exports.convertColorFields = convertColorFields; exports.convertHex = convertHex; exports.convertSurfaceColors = convertSurfaceColors; exports.convertSurfaceDepth = _chunkCWM3CUUXcjs.convertSurfaceDepth; exports.convertToSmartObject = _chunk32MMQYCQcjs.convertToSmartObject; exports.copySmartObject = _chunk32MMQYCQcjs.copySmartObject; exports.cornersFromMatrix = _chunk32MMQYCQcjs.cornersFromMatrix; exports.coverageTileCoord = _chunkEBDCRTZIcjs.coverageTileCoord; exports.coverageToByte = _chunk32MMQYCQcjs.coverageToByte; exports.coveringRect = coveringRect; exports.createAdjustmentLayer = _chunk32MMQYCQcjs.createAdjustmentLayer; exports.createBlenderScratch = _chunkEBDCRTZIcjs.createBlenderScratch; exports.createCanvasTextShaper = _chunk236TKNURcjs.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.createImageSelectionTools = createImageSelectionTools; exports.createImageShapeTools = createImageShapeTools; exports.createImageSmartObjectTools = createImageSmartObjectTools; exports.createImageTransformTools = createImageTransformTools; exports.createImageTypeTools = createImageTypeTools; exports.createMetricTextShaper = _chunk236TKNURcjs.createMetricTextShaper; exports.createOutlineTextShaper = _chunk236TKNURcjs.createOutlineTextShaper; exports.createPigment = _chunkCWM3CUUXcjs.createPigment; exports.createPigmentTools = _chunkGNK7SESQcjs.createPigmentTools; exports.createSelectionMask = _chunk32MMQYCQcjs.createSelectionMask; exports.createShapeLayer = _chunk32MMQYCQcjs.createShapeLayer; exports.createTypeLayer = _chunk32MMQYCQcjs.createTypeLayer; exports.createWetGpuEngine = _chunkGNK7SESQcjs.createWetGpuEngine; exports.cssFont = _chunk236TKNURcjs.cssFont; exports.cssFontFamily = _chunk236TKNURcjs.cssFontFamily; exports.curveLut = _chunkHGTDMKNEcjs.curveLut; exports.curveLutFromLevels = _chunk32MMQYCQcjs.curveLutFromLevels; exports.curvePointToBox = curvePointToBox; exports.curveSvgPath = curveSvgPath; exports.dabCoverage = _chunkEBDCRTZIcjs.dabCoverage; exports.dabRect = _chunkEBDCRTZIcjs.dabRect; exports.decodeDeepSurface = _chunk32MMQYCQcjs.decodeDeepSurface; exports.decodeLayerChannel = _chunk32MMQYCQcjs.decodeLayerChannel; exports.decodeLayerMask = _chunk32MMQYCQcjs.decodeLayerMask; exports.decodeMergedImage = _chunk32MMQYCQcjs.decodeMergedImage; exports.decodePlanes = _chunk32MMQYCQcjs.decodePlanes; exports.decodePng = _chunkCWM3CUUXcjs.decodePng; exports.decodePngDataUrl = _chunk32MMQYCQcjs.decodePngDataUrl; exports.decodeSelectionRle = _chunk32MMQYCQcjs.decodeSelectionRle; exports.deepBytes = _chunkCWM3CUUXcjs.deepBytes; exports.deepTile = _chunkCWM3CUUXcjs.deepTile; exports.defaultActiveLayerId = _chunk32MMQYCQcjs.defaultActiveLayerId; exports.defaultAdjustmentParams = _chunk32MMQYCQcjs.defaultAdjustmentParams; exports.defaultEffectGradient = _chunkHGTDMKNEcjs.defaultEffectGradient; exports.defaultLayerEffect = _chunkHGTDMKNEcjs.defaultLayerEffect; exports.defaultShapeName = _chunk32MMQYCQcjs.defaultShapeName; exports.deflate = _chunkXFM3OCHUcjs.deflate; exports.deflateRaw = _chunkXFM3OCHUcjs.deflateRaw; exports.depthMaskAlpha = _chunk32MMQYCQcjs.depthMaskAlpha; exports.depthOf = _chunkCWM3CUUXcjs.depthOf; exports.depthRasterMask = _chunk32MMQYCQcjs.depthRasterMask; exports.describeLayer = describeLayer; exports.describeLayerEffects = describeLayerEffects; exports.describeSelection = describeSelection; exports.describeTransform = _chunk32MMQYCQcjs.describeTransform; exports.deserializeColorMode = deserializeColorMode; exports.deserializeColorProfile = deserializeColorProfile; exports.deserializeEffects = _chunk32MMQYCQcjs.deserializeEffects; exports.deserializeLayer = _chunk32MMQYCQcjs.deserializeLayer; exports.deserializeLayers = _chunk32MMQYCQcjs.deserializeLayers; exports.deserializePatterns = _chunk32MMQYCQcjs.deserializePatterns; exports.deserializeSelection = _chunk32MMQYCQcjs.deserializeSelection; exports.developFilter = _chunk32MMQYCQcjs.developFilter; exports.developFromAdjustments = _chunk32MMQYCQcjs.developFromAdjustments; exports.developTarget = _chunk32MMQYCQcjs.developTarget; exports.dexp = _chunkGNK7SESQcjs.dexp; exports.dilateMask = _chunk7NW46N7Icjs.dilateMask; exports.displayTransform = displayTransform; exports.distanceTransform = _chunk32MMQYCQcjs.distanceTransform; exports.dlog = _chunkGNK7SESQcjs.dlog; exports.documentContents = _chunk32MMQYCQcjs.documentContents; exports.documentProfile = documentProfile; exports.dodgeBurn = _chunk7NW46N7Icjs.dodgeBurn; exports.dodgeBurnCurve = _chunk7NW46N7Icjs.dodgeBurnCurve; exports.downloadPsd = downloadPsd; exports.dpow = _chunkGNK7SESQcjs.dpow; exports.dragWarpMeshPoint = _chunk236TKNURcjs.dragWarpMeshPoint; exports.dropPlacement = dropPlacement; exports.dropZone = dropZone; exports.dsincos = _chunkGNK7SESQcjs.dsincos; exports.duplicateLayer = _chunk32MMQYCQcjs.duplicateLayer; exports.edgeBits = _chunkGNK7SESQcjs.edgeBits; exports.edgeWidth = edgeWidth; exports.effectColorHex = _chunkHGTDMKNEcjs.effectColorHex; exports.effectControlChange = effectControlChange; exports.effectPixelsToSurface = effectPixelsToSurface; exports.effectReach = _chunkHGTDMKNEcjs.effectReach; exports.effectiveProof = effectiveProof; exports.effectsFingerprint = _chunkHGTDMKNEcjs.effectsFingerprint; exports.effectsMargin = _chunkHGTDMKNEcjs.effectsMargin; exports.effectsScale = _chunkHGTDMKNEcjs.effectsScale; exports.ellipsePoints = ellipsePoints; exports.ellipseSelection = ellipseSelection; exports.emptyHistogram = emptyHistogram; exports.emptySurface = _chunkCWM3CUUXcjs.emptySurface; exports.encodeDeepSurface = _chunk32MMQYCQcjs.encodeDeepSurface; exports.encodePng = _chunkCWM3CUUXcjs.encodePng; exports.encodeRle = _chunk32MMQYCQcjs.encodeRle; exports.encodeSelectionRle = _chunk32MMQYCQcjs.encodeSelectionRle; exports.encodeSurface = _chunk32MMQYCQcjs.encodeSurface; exports.evalWarpMesh = _chunk236TKNURcjs.evalWarpMesh; exports.evaluateAdjustmentLayers = _chunk32MMQYCQcjs.evaluateAdjustmentLayers; exports.exchangeRates = _chunkEBDCRTZIcjs.exchangeRates; exports.expNeg = _chunkGNK7SESQcjs.expNeg; exports.expandCoverage = _chunk32MMQYCQcjs.expandCoverage; exports.exportPsd = _chunk32MMQYCQcjs.exportPsd; exports.extractNormalizedLayerItems = extractNormalizedLayerItems; exports.featherCoverage = _chunk32MMQYCQcjs.featherCoverage; exports.fillRect = _chunkCWM3CUUXcjs.fillRect; exports.filmPixel = _chunkGNK7SESQcjs.filmPixel; exports.filmReflectance = _chunkGNK7SESQcjs.filmReflectance; exports.filterMaskCoverage = _chunk32MMQYCQcjs.filterMaskCoverage; exports.findAdjustmentControl = findAdjustmentControl; exports.findLayer = _chunkHGTDMKNEcjs.findLayer; exports.findLayerControl = findLayerControl; exports.findWebGpu = _chunkGNK7SESQcjs.findWebGpu; exports.finishTile = _chunkCWM3CUUXcjs.finishTile; exports.fitParagraphRuns = _chunk236TKNURcjs.fitParagraphRuns; exports.fitRuns = _chunk236TKNURcjs.fitRuns; exports.flattenLayers = _chunkHGTDMKNEcjs.flattenLayers; exports.flattenPath = _chunk32MMQYCQcjs.flattenPath; exports.flipCorners = _chunk32MMQYCQcjs.flipCorners; exports.flowField = _chunkGNK7SESQcjs.flowField; exports.fontOf = _chunk236TKNURcjs.fontOf; exports.formatControlValue = formatControlValue; exports.fullSelection = _chunk32MMQYCQcjs.fullSelection; exports.gaussianBlur = _chunkHGTDMKNEcjs.gaussianBlur; exports.geometryHomography = _chunk32MMQYCQcjs.geometryHomography; exports.getAnnotationBounds = _chunk32MMQYCQcjs.getAnnotationBounds; exports.getControlPath = getControlPath; exports.getCropCursor = _chunk32MMQYCQcjs.getCropCursor; exports.getRotatedSize = _chunk32MMQYCQcjs.getRotatedSize; exports.getViewportMetrics = _chunk32MMQYCQcjs.getViewportMetrics; exports.getViewportProjection = _chunk32MMQYCQcjs.getViewportProjection; exports.globalImageCache = globalImageCache; exports.gradientDabColor = _chunkEBDCRTZIcjs.gradientDabColor; exports.grainCatch = _chunkEBDCRTZIcjs.grainCatch; exports.grainHeights = _chunkEBDCRTZIcjs.grainHeights; exports.greyMorphology = _chunk32MMQYCQcjs.greyMorphology; exports.groupLayers = _chunk32MMQYCQcjs.groupLayers; exports.guidePlanes = guidePlanes; exports.guidedFilterColor = guidedFilterColor; exports.handlePaintShortcut = handlePaintShortcut; exports.hasActiveEffects = _chunkHGTDMKNEcjs.hasActiveEffects; exports.hasResampledLegacyMask = _chunk32MMQYCQcjs.hasResampledLegacyMask; exports.hasSurface = _chunk32MMQYCQcjs.hasSurface; exports.hasWarp = _chunk32MMQYCQcjs.hasWarp; exports.hash2 = _chunkEBDCRTZIcjs.hash2; exports.hashMaskContent = _chunk32MMQYCQcjs.hashMaskContent; exports.hashNoise = _chunkHGTDMKNEcjs.hashNoise; exports.healPixels = _chunk7NW46N7Icjs.healPixels; exports.hexToPaintRgb = _chunkEBDCRTZIcjs.hexToPaintRgb; exports.hexToRgb = _chunk32MMQYCQcjs.hexToRgb; exports.histogramPath = histogramPath; exports.hitTestAnnotation = _chunk32MMQYCQcjs.hitTestAnnotation; exports.hitTestCrop = _chunk32MMQYCQcjs.hitTestCrop; exports.hitTestCurvePoint = hitTestCurvePoint; exports.homographyFromAffine = _chunkQT26RHKKcjs.homographyFromAffine; exports.homographyFromPoints = _chunkQT26RHKKcjs.homographyFromPoints; exports.hslToRgb = _chunk32MMQYCQcjs.hslToRgb; exports.hueRange = hueRange; exports.hueRangeTables = _chunk32MMQYCQcjs.hueRangeTables; exports.hueRangeWeight = _chunk32MMQYCQcjs.hueRangeWeight; exports.hueSaturation = _chunk32MMQYCQcjs.hueSaturation; exports.identityCurve = _chunk32MMQYCQcjs.identityCurve; exports.identityLevels = _chunk32MMQYCQcjs.identityLevels; exports.identityTransform = _chunk32MMQYCQcjs.identityTransform; exports.identityWarpMesh = _chunk236TKNURcjs.identityWarpMesh; exports.imageEditorStateMigrations = imageEditorStateMigrations; exports.imageLayerAppliedEffects = imageLayerAppliedEffects; exports.imagePlaybackPanel = imagePlaybackPanel; exports.imageToCanvasPoint = _chunk32MMQYCQcjs.imageToCanvasPoint; exports.importPsd = _chunk32MMQYCQcjs.importPsd; exports.inflate = _chunkXFM3OCHUcjs.inflate; exports.inflateRaw = _chunkXFM3OCHUcjs.inflateRaw; exports.insertCurvePoint = insertCurvePoint; exports.insertLayer = _chunkHGTDMKNEcjs.insertLayer; exports.instancesOf = _chunk32MMQYCQcjs.instancesOf; exports.invertHomography = _chunkQT26RHKKcjs.invertHomography; exports.invertMatrix3 = _chunk32MMQYCQcjs.invertMatrix3; exports.invertSelection = _chunk32MMQYCQcjs.invertSelection; exports.isActiveFilter = _chunk32MMQYCQcjs.isActiveFilter; exports.isAdjustmentKind = _chunk32MMQYCQcjs.isAdjustmentKind; exports.isBitDepth = _chunkCWM3CUUXcjs.isBitDepth; exports.isBlendMode = _chunkCWM3CUUXcjs.isBlendMode; exports.isBrushstrokeBrush = _chunkEBDCRTZIcjs.isBrushstrokeBrush; exports.isContentsDecoded = _chunk32MMQYCQcjs.isContentsDecoded; exports.isDefaultDepthMask = _chunk32MMQYCQcjs.isDefaultDepthMask; exports.isGradientPaint = _chunkEBDCRTZIcjs.isGradientPaint; exports.isIdentityCloneTransform = _chunk7NW46N7Icjs.isIdentityCloneTransform; exports.isIdentityTransform = _chunk32MMQYCQcjs.isIdentityTransform; exports.isInterpolation = _chunkHGTDMKNEcjs.isInterpolation; exports.isLayerEffectKind = _chunkHGTDMKNEcjs.isLayerEffectKind; exports.isLayerLocked = _chunkHGTDMKNEcjs.isLayerLocked; exports.isLegacyShape = _chunk32MMQYCQcjs.isLegacyShape; exports.isPaintTool = isPaintTool; exports.isPaintableLayer = _chunk32MMQYCQcjs.isPaintableLayer; exports.isPainterlyBlendMode = _chunkCWM3CUUXcjs.isPainterlyBlendMode; exports.isPng = _chunkCWM3CUUXcjs.isPng; exports.isQuarterTurn = isQuarterTurn; exports.isQuarterTurnSwapped = _chunk32MMQYCQcjs.isQuarterTurnSwapped; exports.isRenderedLayer = _chunk32MMQYCQcjs.isRenderedLayer; exports.isRetouchPaintTool = isRetouchPaintTool; exports.isRetouchTool = isRetouchTool; exports.isSelectionEmpty = _chunk32MMQYCQcjs.isSelectionEmpty; exports.isSelectionMode = _chunk32MMQYCQcjs.isSelectionMode; exports.isSeparableBlendMode = _chunkCWM3CUUXcjs.isSeparableBlendMode; exports.isSmartSurfaceIncomplete = _chunk32MMQYCQcjs.isSmartSurfaceIncomplete; exports.isSpatialFilter = _chunk32MMQYCQcjs.isSpatialFilter; exports.isSrgb = isSrgb; exports.isTransformAnchor = _chunk32MMQYCQcjs.isTransformAnchor; exports.isValidWarp = _chunk32MMQYCQcjs.isValidWarp; exports.keepDeepSamples = _chunkCWM3CUUXcjs.keepDeepSamples; exports.kelvinToTemperature = _chunk32MMQYCQcjs.kelvinToTemperature; exports.keysWeight = _chunkHGTDMKNEcjs.keysWeight; exports.latticeViscosity = _chunkGNK7SESQcjs.latticeViscosity; exports.layerBadge = layerBadge; exports.layerEffectControls = layerEffectControls; exports.layerEffectFields = _chunkHGTDMKNEcjs.layerEffectFields; exports.layerEffectLabel = _chunkHGTDMKNEcjs.layerEffectLabel; exports.layerEffectsBadge = layerEffectsBadge; exports.layerEffectsOf = _chunk32MMQYCQcjs.layerEffectsOf; exports.layerEffectsPanel = layerEffectsPanel; exports.layerHasThumbnail = layerHasThumbnail; exports.layerLabel = layerLabel; exports.layerMaskCoverage = _chunk32MMQYCQcjs.layerMaskCoverage; exports.layerMaskFromSelection = _chunk32MMQYCQcjs.layerMaskFromSelection; exports.layerMaskKey = _chunk32MMQYCQcjs.layerMaskKey; exports.layerMenu = layerMenu; exports.layerName = _chunk32MMQYCQcjs.layerName; exports.layerPanelRows = layerPanelRows; exports.layerPanels = layerPanels; exports.layerTree = _chunk32MMQYCQcjs.layerTree; exports.layerTypeLabel = _chunk32MMQYCQcjs.layerTypeLabel; exports.layerWarning = layerWarning; exports.layersFromLegacy = _chunk32MMQYCQcjs.layersFromLegacy; exports.layoutText = _chunk236TKNURcjs.layoutText; exports.legacyAdjustmentLayer = _chunk32MMQYCQcjs.legacyAdjustmentLayer; exports.legacyMaskOf = _chunk32MMQYCQcjs.legacyMaskOf; exports.legacyView = _chunk32MMQYCQcjs.legacyView; exports.lerpPigment = _chunkCWM3CUUXcjs.lerpPigment; exports.lerpPigmentInto = _chunkCWM3CUUXcjs.lerpPigmentInto; exports.levelsValue = _chunk32MMQYCQcjs.levelsValue; exports.linearSrgbToXy = _chunk32MMQYCQcjs.linearSrgbToXy; exports.linearToSrgb = _chunk32MMQYCQcjs.linearToSrgb; exports.linearToSrgb8 = _chunkGNK7SESQcjs.linearToSrgb8; exports.liveComponent = _chunk32MMQYCQcjs.liveComponent; exports.liveShapeForDrag = liveShapeForDrag; exports.liveShapeSubpaths = _chunk32MMQYCQcjs.liveShapeSubpaths; exports.loadImageEditorDocument = loadImageEditorDocument; exports.loadMixer = _chunkEBDCRTZIcjs.loadMixer; exports.loadOpenTypeFont = _chunk5UEFNX24cjs.loadOpenTypeFont; exports.loadWetKernel = _chunkGNK7SESQcjs.loadWetKernel; exports.luma = _chunk7NW46N7Icjs.luma; exports.magicWand = magicWand; exports.mapCropHandle = _chunk32MMQYCQcjs.mapCropHandle; exports.mapLayer = _chunkHGTDMKNEcjs.mapLayer; exports.mapSubpaths = _chunk32MMQYCQcjs.mapSubpaths; exports.maskBounds = _chunk7NW46N7Icjs.maskBounds; exports.maskSummary = maskSummary; exports.matrixFromCorners = _chunk32MMQYCQcjs.matrixFromCorners; exports.matrixFromParams = _chunk32MMQYCQcjs.matrixFromParams; exports.measureCanvasViewport = measureCanvasViewport; exports.membraneFill = _chunk7NW46N7Icjs.membraneFill; exports.mergeLayerEffect = _chunkHGTDMKNEcjs.mergeLayerEffect; exports.mergeShapeComponents = _chunk32MMQYCQcjs.mergeShapeComponents; exports.migrateSerializedImageEditorState = migrateSerializedImageEditorState; exports.migrateToLayeredState = migrateToLayeredState; exports.mix32 = _chunkEBDCRTZIcjs.mix32; exports.mixPigment8 = _chunkCWM3CUUXcjs.mixPigment8; exports.mixPigmentRgb = _chunkCWM3CUUXcjs.mixPigmentRgb; exports.mixPigments = _chunkCWM3CUUXcjs.mixPigments; exports.mixerLoadResult = mixerLoadResult; exports.mixerRates = _chunkEBDCRTZIcjs.mixerRates; exports.modifySelection = _chunk32MMQYCQcjs.modifySelection; exports.moveCurvePoint = moveCurvePoint; exports.moveLayer = _chunk32MMQYCQcjs.moveLayer; exports.moveSmartFilter = _chunk32MMQYCQcjs.moveSmartFilter; exports.mulMatrix3 = _chunk32MMQYCQcjs.mulMatrix3; exports.needsLegacyBase = needsLegacyBase; exports.neutralHueRange = _chunk32MMQYCQcjs.neutralHueRange; exports.newContentsId = _chunk32MMQYCQcjs.newContentsId; exports.newEffectId = _chunkHGTDMKNEcjs.newEffectId; exports.newLayerId = _chunk32MMQYCQcjs.newLayerId; exports.newLayerOptions = newLayerOptions; exports.normalizeAdjustmentLayer = _chunk32MMQYCQcjs.normalizeAdjustmentLayer; exports.normalizeAdjustmentLayers = _chunk32MMQYCQcjs.normalizeAdjustmentLayers; exports.normalizeAngle = _chunk32MMQYCQcjs.normalizeAngle; exports.normalizeBlendMode = _chunkCWM3CUUXcjs.normalizeBlendMode; exports.normalizeBlender = _chunkEBDCRTZIcjs.normalizeBlender; exports.normalizeBrush = _chunkEBDCRTZIcjs.normalizeBrush; exports.normalizeFilter = _chunk32MMQYCQcjs.normalizeFilter; exports.normalizeFlow = _chunkGNK7SESQcjs.normalizeFlow; exports.normalizeHexColor = _chunkEBDCRTZIcjs.normalizeHexColor; exports.normalizeLayerEffects = _chunkHGTDMKNEcjs.normalizeLayerEffects; exports.normalizeLayerMask = _chunk32MMQYCQcjs.normalizeLayerMask; exports.normalizeLiveShape = _chunk32MMQYCQcjs.normalizeLiveShape; exports.normalizeMixer = _chunkEBDCRTZIcjs.normalizeMixer; exports.normalizePlacement = _chunk32MMQYCQcjs.normalizePlacement; exports.normalizeProcessVersion = _chunk32MMQYCQcjs.normalizeProcessVersion; exports.normalizeRect = normalizeRect; exports.normalizeRefineEdgeParams = normalizeRefineEdgeParams; exports.normalizeRetouch = _chunk7NW46N7Icjs.normalizeRetouch; exports.normalizeShapePaint = _chunk32MMQYCQcjs.normalizeShapePaint; exports.normalizeShapeStroke = _chunk32MMQYCQcjs.normalizeShapeStroke; exports.normalizeSmartFilter = _chunk32MMQYCQcjs.normalizeSmartFilter; exports.normalizeSmudge = _chunkEBDCRTZIcjs.normalizeSmudge; exports.normalizeStoredAdjustments = normalizeStoredAdjustments; exports.normalizeSubpaths = _chunk32MMQYCQcjs.normalizeSubpaths; exports.normalizeText = _chunk32MMQYCQcjs.normalizeText; exports.normalizeTilt = _chunkGNK7SESQcjs.normalizeTilt; exports.normalizeWetParams = _chunkGNK7SESQcjs.normalizeWetParams; exports.offsetLayer = _chunk32MMQYCQcjs.offsetLayer; exports.offsetShape = _chunk32MMQYCQcjs.offsetShape; exports.offsetSmartObject = _chunk32MMQYCQcjs.offsetSmartObject; exports.openPsdFile = openPsdFile; exports.packRgba = _chunkCWM3CUUXcjs.packRgba; exports.packWetParams = _chunkGNK7SESQcjs.packWetParams; exports.paintGradientMappingFor = _chunkEBDCRTZIcjs.paintGradientMappingFor; exports.paintPathStroke = _chunkEBDCRTZIcjs.paintPathStroke; exports.paintSourceColor = _chunkEBDCRTZIcjs.paintSourceColor; exports.paintSourceCss = _chunkEBDCRTZIcjs.paintSourceCss; exports.paragraphRanges = _chunk236TKNURcjs.paragraphRanges; exports.parseAdjustmentBlock = _chunk32MMQYCQcjs.parseAdjustmentBlock; exports.parseBlend = _chunk32MMQYCQcjs.parseBlend; exports.parseColor = parseColor; exports.parseCssColor = _chunkA2IS7EHEcjs.parseCssColor; exports.parseDataUrl = _chunkCWM3CUUXcjs.parseDataUrl; exports.parseEffectColor = _chunkHGTDMKNEcjs.parseEffectColor; exports.parseLfx2 = _chunk32MMQYCQcjs.parseLfx2; exports.parseLrfx = _chunk32MMQYCQcjs.parseLrfx; exports.parseOpenTypeFont = _chunk5UEFNX24cjs.parseOpenTypeFont; exports.parsePaintSource = _chunkEBDCRTZIcjs.parsePaintSource; exports.parsePatternBlock = _chunk32MMQYCQcjs.parsePatternBlock; exports.parseSelectionMode = _chunk32MMQYCQcjs.parseSelectionMode; exports.parseVersionedDescriptor = _chunk32MMQYCQcjs.parseVersionedDescriptor; exports.patchParagraphStyle = _chunk32MMQYCQcjs.patchParagraphStyle; exports.patchTextStyle = _chunk32MMQYCQcjs.patchTextStyle; exports.pathStrokeCoverage = _chunkEBDCRTZIcjs.pathStrokeCoverage; exports.pathStrokeDabs = _chunkEBDCRTZIcjs.pathStrokeDabs; exports.perDabStrength = _chunk7NW46N7Icjs.perDabStrength; exports.photoFilterMatrix = _chunk32MMQYCQcjs.photoFilterMatrix; exports.pigment8 = _chunkCWM3CUUXcjs.pigment8; exports.pigmentColor = _chunkGNK7SESQcjs.pigmentColor; exports.pigmentOf = _chunkGNK7SESQcjs.pigmentOf; exports.pixelLayerBounds = _chunk32MMQYCQcjs.pixelLayerBounds; exports.pixelLayers = _chunk32MMQYCQcjs.pixelLayers; exports.pixelPigment = _chunkGNK7SESQcjs.pixelPigment; exports.placeContents = _chunk32MMQYCQcjs.placeContents; exports.placeLayer = _chunk32MMQYCQcjs.placeLayer; exports.placementAt = _chunk32MMQYCQcjs.placementAt; exports.placementBounds = _chunk32MMQYCQcjs.placementBounds; exports.placementGeometry = _chunk32MMQYCQcjs.placementGeometry; exports.planImageToolPlayback = planImageToolPlayback; exports.pngDataUrl = _chunkCWM3CUUXcjs.pngDataUrl; exports.pointerPressure = _chunkGNK7SESQcjs.pointerPressure; exports.pointerStrokeSample = _chunkGNK7SESQcjs.pointerStrokeSample; exports.pointerStrokeSamples = _chunkGNK7SESQcjs.pointerStrokeSamples; exports.polygonCoverage = polygonCoverage; exports.polygonSelection = polygonSelection; exports.posterizeValue = _chunk32MMQYCQcjs.posterizeValue; exports.presetWarp = _chunk32MMQYCQcjs.presetWarp; exports.previewStep = previewStep; exports.profileBytes = profileBytes; exports.projectImagePoint = _chunk32MMQYCQcjs.projectImagePoint; exports.projectImageRect = _chunk32MMQYCQcjs.projectImageRect; exports.projectMaskCoverage = _chunk32MMQYCQcjs.projectMaskCoverage; exports.projectQuarterTurn = projectQuarterTurn; exports.proxyOf = _chunkCWM3CUUXcjs.proxyOf; exports.psdBytesFromBase64 = psdBytesFromBase64; exports.psdFileName = psdFileName; exports.psdPatternToEffectPattern = _chunk32MMQYCQcjs.psdPatternToEffectPattern; exports.psdToLayers = _chunk32MMQYCQcjs.psdToLayers; exports.pullWarpMesh = _chunk236TKNURcjs.pullWarpMesh; exports.put255 = _chunkEBDCRTZIcjs.put255; exports.quadFrameOverlay = quadFrameOverlay; exports.quickMaskPixels = quickMaskPixels; exports.rand01 = _chunkEBDCRTZIcjs.rand01; exports.randSigned = _chunkEBDCRTZIcjs.randSigned; exports.rangeLightness = _chunk32MMQYCQcjs.rangeLightness; exports.rasterContents = _chunk32MMQYCQcjs.rasterContents; exports.rasterMaskFromLegacy = _chunk32MMQYCQcjs.rasterMaskFromLegacy; exports.rasterizeCoverage = _chunk32MMQYCQcjs.rasterizeCoverage; exports.rasterizeDab = _chunkEBDCRTZIcjs.rasterizeDab; exports.rasterizeSmartObject = _chunk32MMQYCQcjs.rasterizeSmartObject; exports.readAdjustmentControls = readAdjustmentControls; exports.readDeepRegion = _chunkCWM3CUUXcjs.readDeepRegion; exports.readPaintSource = _chunkEBDCRTZIcjs.readPaintSource; exports.readPixel = _chunkCWM3CUUXcjs.readPixel; exports.readPsd = _chunk32MMQYCQcjs.readPsd; exports.readRegion = _chunkCWM3CUUXcjs.readRegion; exports.readSourceRegion = _chunk7NW46N7Icjs.readSourceRegion; exports.rectSelection = rectSelection; exports.rectToQuad = _chunkQT26RHKKcjs.rectToQuad; exports.reduceSurface = _chunkHGTDMKNEcjs.reduceSurface; exports.referencePoint = _chunk32MMQYCQcjs.referencePoint; exports.refineCoverage = refineCoverage; exports.refineEdgeHalo = refineEdgeHalo; exports.refineSelection = refineSelection; exports.reflectanceToRgb = _chunkCWM3CUUXcjs.reflectanceToRgb; exports.removeAlpha = _chunk32MMQYCQcjs.removeAlpha; exports.removeCurvePoint = removeCurvePoint; exports.removeLayer = _chunk32MMQYCQcjs.removeLayer; exports.removeLayerEffect = _chunk32MMQYCQcjs.removeLayerEffect; exports.removeLayerFilter = _chunk32MMQYCQcjs.removeLayerFilter; exports.removePaintGradientStop = _chunkEBDCRTZIcjs.removePaintGradientStop; exports.removeSmartFilter = _chunk32MMQYCQcjs.removeSmartFilter; exports.renderBrushstroke = _chunkEBDCRTZIcjs.renderBrushstroke; exports.renderLayerEffects = _chunkHGTDMKNEcjs.renderLayerEffects; exports.renderLayeredBase = renderLayeredBase; exports.renderShape = _chunk32MMQYCQcjs.renderShape; exports.renderShapeRect = _chunk32MMQYCQcjs.renderShapeRect; exports.renderSmartObject = _chunk32MMQYCQcjs.renderSmartObject; exports.renderText = _chunk32MMQYCQcjs.renderText; exports.replaceContents = _chunk32MMQYCQcjs.replaceContents; exports.replaceTextRange = _chunk32MMQYCQcjs.replaceTextRange; exports.requireLayer = _chunk32MMQYCQcjs.requireLayer; exports.requireOperation = _chunk32MMQYCQcjs.requireOperation; exports.requireShapeLayer = _chunk32MMQYCQcjs.requireShapeLayer; exports.requireSmartObject = _chunk32MMQYCQcjs.requireSmartObject; exports.requireTypeLayer = _chunk32MMQYCQcjs.requireTypeLayer; exports.requireUnlocked = _chunk32MMQYCQcjs.requireUnlocked; exports.rerender = _chunk32MMQYCQcjs.rerender; exports.rerenderShape = _chunk32MMQYCQcjs.rerenderShape; exports.rerenderText = _chunk32MMQYCQcjs.rerenderText; exports.resizePixels = resizePixels; exports.resizeSelection = _chunk32MMQYCQcjs.resizeSelection; exports.resizeWarpMesh = _chunk236TKNURcjs.resizeWarpMesh; exports.resolveExternalAssets = _chunk32MMQYCQcjs.resolveExternalAssets; exports.resolveMosaicRegionBounds = resolveMosaicRegionBounds; exports.resolvePaintGradient = _chunkEBDCRTZIcjs.resolvePaintGradient; exports.resolveProfile = resolveProfile; exports.restyleRange = _chunk236TKNURcjs.restyleRange; exports.retouchFilter = _chunk7NW46N7Icjs.retouchFilter; exports.reversePaintGradient = _chunkEBDCRTZIcjs.reversePaintGradient; exports.rgbToGray = _chunk32MMQYCQcjs.rgbToGray; exports.rgbToHsl = _chunk32MMQYCQcjs.rgbToHsl; exports.rgbToReflectance = _chunkCWM3CUUXcjs.rgbToReflectance; exports.rgbUnitToHex = rgbUnitToHex; exports.rgbaViewOfGrey = _chunk7NW46N7Icjs.rgbaViewOfGrey; exports.runLayerFilters = _chunk32MMQYCQcjs.runLayerFilters; exports.runLayerFiltersFloat = _chunk32MMQYCQcjs.runLayerFiltersFloat; exports.runLayerMenuAction = runLayerMenuAction; exports.sameCanvasViewport = sameCanvasViewport; exports.sampleLut = _chunk32MMQYCQcjs.sampleLut; exports.sampleToneLut = _chunk32MMQYCQcjs.sampleToneLut; exports.saturationOf = _chunk7NW46N7Icjs.saturationOf; exports.scaleLayerEffect = _chunkHGTDMKNEcjs.scaleLayerEffect; exports.scalePaintGradient = _chunkEBDCRTZIcjs.scalePaintGradient; exports.seamlessClone = _chunk7NW46N7Icjs.seamlessClone; exports.seedFromString = _chunkEBDCRTZIcjs.seedFromString; exports.selectionArea = _chunk32MMQYCQcjs.selectionArea; exports.selectionFromCoverage = _chunk32MMQYCQcjs.selectionFromCoverage; exports.selectionFromPixels = _chunk32MMQYCQcjs.selectionFromPixels; exports.selectionModeFromModifiers = selectionModeFromModifiers; exports.selectionOutline = selectionOutline; exports.selectionToCoverage = _chunk32MMQYCQcjs.selectionToCoverage; exports.selectionToPixels = _chunk32MMQYCQcjs.selectionToPixels; exports.selectionValueAt = _chunk32MMQYCQcjs.selectionValueAt; exports.serializeColorMode = serializeColorMode; exports.serializeColorProfile = serializeColorProfile; exports.serializeContents = _chunk32MMQYCQcjs.serializeContents; exports.serializeEffects = _chunk32MMQYCQcjs.serializeEffects; exports.serializeLayer = _chunk32MMQYCQcjs.serializeLayer; exports.serializeLayers = _chunk32MMQYCQcjs.serializeLayers; exports.serializeLayersExternal = _chunk32MMQYCQcjs.serializeLayersExternal; exports.serializePatterns = _chunk32MMQYCQcjs.serializePatterns; exports.serializeSelection = _chunk32MMQYCQcjs.serializeSelection; exports.setCloneTransformValue = setCloneTransformValue; exports.setControlPath = setControlPath; exports.setLayerEffects = _chunk32MMQYCQcjs.setLayerEffects; exports.setLayerEffectsEnabled = _chunk32MMQYCQcjs.setLayerEffectsEnabled; exports.setLayerMask = _chunk32MMQYCQcjs.setLayerMask; exports.setLayerProperties = _chunk32MMQYCQcjs.setLayerProperties; exports.setLum = _chunkCWM3CUUXcjs.setLum; exports.setPigmentColor = _chunkCWM3CUUXcjs.setPigmentColor; exports.setRetouchChoice = setRetouchChoice; exports.setSmartFilterMask = _chunk32MMQYCQcjs.setSmartFilterMask; exports.setSmartFiltersEnabled = _chunk32MMQYCQcjs.setSmartFiltersEnabled; exports.setSmartPlacement = _chunk32MMQYCQcjs.setSmartPlacement; exports.shadeTile = _chunkGNK7SESQcjs.shadeTile; exports.shapeAsPixelLayer = _chunk32MMQYCQcjs.shapeAsPixelLayer; exports.shapeFromAnnotation = _chunk32MMQYCQcjs.shapeFromAnnotation; exports.shapeGeometryBounds = _chunk32MMQYCQcjs.shapeGeometryBounds; exports.shapeLayers = _chunk32MMQYCQcjs.shapeLayers; exports.shapeOutline = _chunk32MMQYCQcjs.shapeOutline; exports.shapeRenderClip = _chunk32MMQYCQcjs.shapeRenderClip; exports.shiftCoverage = _chunk32MMQYCQcjs.shiftCoverage; exports.smartFilterRows = smartFilterRows; exports.smartObjectLayers = _chunk32MMQYCQcjs.smartObjectLayers; exports.smoothCoverage = _chunk32MMQYCQcjs.smoothCoverage; exports.smoothPoints = _chunkEBDCRTZIcjs.smoothPoints; exports.smudgeEffect = _chunk7NW46N7Icjs.smudgeEffect; exports.solidPaint = _chunkEBDCRTZIcjs.solidPaint; exports.solidSurface = _chunkCWM3CUUXcjs.solidSurface; exports.solveMembrane = _chunk7NW46N7Icjs.solveMembrane; exports.spliceRuns = _chunk236TKNURcjs.spliceRuns; exports.splitOverlayAnnotations = splitOverlayAnnotations; exports.sponge = _chunk7NW46N7Icjs.sponge; exports.spongeEffect = _chunk7NW46N7Icjs.spongeEffect; exports.spotHealPixels = _chunk7NW46N7Icjs.spotHealPixels; exports.spotHealWindow = _chunk7NW46N7Icjs.spotHealWindow; exports.srgb8ToLab = srgb8ToLab; exports.srgbByteToLinear = _chunkGNK7SESQcjs.srgbByteToLinear; exports.srgbDecode = _chunkCWM3CUUXcjs.srgbDecode; exports.srgbEncode = _chunkCWM3CUUXcjs.srgbEncode; exports.srgbToLinear = _chunk32MMQYCQcjs.srgbToLinear; exports.standardBlendMode = _chunkCWM3CUUXcjs.standardBlendMode; exports.stepSlotTs = _chunkGNK7SESQcjs.stepSlotTs; exports.strokeGrainCatch = _chunkEBDCRTZIcjs.strokeGrainCatch; exports.styleAt = _chunk236TKNURcjs.styleAt; exports.sumHistograms = sumHistograms; exports.surfaceBytes = _chunkCWM3CUUXcjs.surfaceBytes; exports.surfaceDepth = _chunkCWM3CUUXcjs.surfaceDepth; exports.surfaceFromDeepPixels = _chunkCWM3CUUXcjs.surfaceFromDeepPixels; exports.surfaceFromPixels = _chunkCWM3CUUXcjs.surfaceFromPixels; exports.surfacesEqual = _chunkCWM3CUUXcjs.surfacesEqual; exports.tempTintToXy = _chunk32MMQYCQcjs.tempTintToXy; exports.temperatureToKelvin = _chunk32MMQYCQcjs.temperatureToKelvin; exports.textIndexAt = _chunk236TKNURcjs.textIndexAt; exports.textMatrix = _chunk32MMQYCQcjs.textMatrix; exports.textOutlines = _chunk32MMQYCQcjs.textOutlines; exports.textRange = _chunk32MMQYCQcjs.textRange; exports.tileCoord = _chunkCWM3CUUXcjs.tileCoord; exports.tileKey = _chunkCWM3CUUXcjs.tileKey; exports.tileRect = _chunkCWM3CUUXcjs.tileRect; exports.tileSamples = _chunkCWM3CUUXcjs.tileSamples; exports.tileSamples16 = _chunkCWM3CUUXcjs.tileSamples16; exports.tileSamples32 = _chunkCWM3CUUXcjs.tileSamples32; exports.tilesInRect = _chunkCWM3CUUXcjs.tilesInRect; exports.tipFalloff = _chunkEBDCRTZIcjs.tipFalloff; exports.tipReach = _chunkEBDCRTZIcjs.tipReach; exports.tipShape = _chunkEBDCRTZIcjs.tipShape; exports.to16From32 = _chunkCWM3CUUXcjs.to16From32; exports.to16From8 = _chunkCWM3CUUXcjs.to16From8; exports.to32From16 = _chunkCWM3CUUXcjs.to32From16; exports.to32From8 = _chunkCWM3CUUXcjs.to32From8; exports.to8From16 = _chunkCWM3CUUXcjs.to8From16; exports.to8From32 = _chunkCWM3CUUXcjs.to8From32; exports.toHex = toHex; exports.toTextSpace = _chunk32MMQYCQcjs.toTextSpace; exports.toneCurve = _chunk32MMQYCQcjs.toneCurve; exports.toneLuts = _chunk32MMQYCQcjs.toneLuts; exports.toneOf = _chunk7NW46N7Icjs.toneOf; exports.toneRange = toneRange; exports.transformHomography = _chunk32MMQYCQcjs.transformHomography; exports.transformMap = _chunk32MMQYCQcjs.transformMap; exports.transformShapeComponents = _chunk32MMQYCQcjs.transformShapeComponents; exports.transformSurface = _chunkHGTDMKNEcjs.transformSurface; exports.transformTypeLayer = _chunk32MMQYCQcjs.transformTypeLayer; exports.transformedBounds = _chunkHGTDMKNEcjs.transformedBounds; exports.transformedBox = _chunk32MMQYCQcjs.transformedBox; exports.transformedPoint = _chunk32MMQYCQcjs.transformedPoint; exports.translateLayer = _chunk32MMQYCQcjs.translateLayer; exports.translateSurface = _chunkCWM3CUUXcjs.translateSurface; exports.typeAsPixelLayer = _chunk32MMQYCQcjs.typeAsPixelLayer; exports.typeFrame = _chunk32MMQYCQcjs.typeFrame; exports.typeFromAnnotation = _chunk32MMQYCQcjs.typeFromAnnotation; exports.typeLayerAt = typeLayerAt; exports.typeLayerName = _chunk32MMQYCQcjs.typeLayerName; exports.ungroupLayer = _chunk32MMQYCQcjs.ungroupLayer; exports.uniformTile = _chunkCWM3CUUXcjs.uniformTile; exports.unionRect = _chunk32MMQYCQcjs.unionRect; exports.unprojectCanvasPoint = _chunk32MMQYCQcjs.unprojectCanvasPoint; exports.updateLayerEffect = _chunk32MMQYCQcjs.updateLayerEffect; exports.updateLayerFilter = _chunk32MMQYCQcjs.updateLayerFilter; exports.updateLayerMaskProps = _chunk32MMQYCQcjs.updateLayerMaskProps; exports.updatePaintGradientStop = _chunkEBDCRTZIcjs.updatePaintGradientStop; exports.updateShapeLayer = _chunk32MMQYCQcjs.updateShapeLayer; exports.updateSmartFilter = _chunk32MMQYCQcjs.updateSmartFilter; exports.updateTypeLayer = _chunk32MMQYCQcjs.updateTypeLayer; exports.userErrorMessage = _chunk32MMQYCQcjs.userErrorMessage; exports.uvToXy = _chunk32MMQYCQcjs.uvToXy; exports.validateEffectGradient = _chunkHGTDMKNEcjs.validateEffectGradient; exports.validateLayerEffect = _chunkHGTDMKNEcjs.validateLayerEffect; exports.validateLayerEffects = _chunkHGTDMKNEcjs.validateLayerEffects; exports.versionedDescriptorBytes = _chunk32MMQYCQcjs.versionedDescriptorBytes; exports.vibranceLinear = _chunk32MMQYCQcjs.vibranceLinear; exports.vibrancePixel = _chunk32MMQYCQcjs.vibrancePixel; exports.walkDabs = _chunkEBDCRTZIcjs.walkDabs; exports.warpMeshEditPoints = _chunk236TKNURcjs.warpMeshEditPoints; exports.warpMeshGridCurves = _chunk236TKNURcjs.warpMeshGridCurves; exports.warpMeshParamAt = _chunk236TKNURcjs.warpMeshParamAt; exports.warpPresetMesh = _chunk236TKNURcjs.warpPresetMesh; exports.warpSurface = _chunkHGTDMKNEcjs.warpSurface; exports.watchCanvasViewport = watchCanvasViewport; exports.wbMatrix = _chunk32MMQYCQcjs.wbMatrix; exports.wetGpuSupport = _chunkGNK7SESQcjs.wetGpuSupport; exports.wetSimdSupported = _chunkGNK7SESQcjs.wetSimdSupported; exports.wetSupport = _chunkGNK7SESQcjs.wetSupport; exports.whiteBalanceFromSample = _chunk32MMQYCQcjs.whiteBalanceFromSample; exports.whiteBalanceMatrix = _chunk32MMQYCQcjs.whiteBalanceMatrix; exports.withFilterMaskSurface = _chunk32MMQYCQcjs.withFilterMaskSurface; exports.withImagePlayback = withImagePlayback; exports.withNewIds = _chunk32MMQYCQcjs.withNewIds; exports.writeAdjustmentBlock = _chunk32MMQYCQcjs.writeAdjustmentBlock; exports.writeDeepRegion = _chunkCWM3CUUXcjs.writeDeepRegion; exports.writeLfx2 = _chunk32MMQYCQcjs.writeLfx2; exports.writePatternBlock = _chunk32MMQYCQcjs.writePatternBlock; exports.writePsd = _chunk32MMQYCQcjs.writePsd; exports.writeRegion = _chunkCWM3CUUXcjs.writeRegion; exports.xyToTempTint = _chunk32MMQYCQcjs.xyToTempTint; exports.xyToUv = _chunk32MMQYCQcjs.xyToUv;