@pixerate/editor 0.137.0 → 0.139.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 (127) hide show
  1. package/dist/agent/index.cjs +2 -2
  2. package/dist/agent/index.d.cts +3 -3
  3. package/dist/agent/index.d.ts +3 -3
  4. package/dist/agent/index.js +1 -1
  5. package/dist/animation-editor/index.cjs +57 -57
  6. package/dist/animation-editor/index.d.cts +6 -5
  7. package/dist/animation-editor/index.d.ts +6 -5
  8. package/dist/animation-editor/index.js +4 -4
  9. package/dist/{arrange-CKXK_hf7.d.cts → arrange-j_mLiFMO.d.cts} +1 -1
  10. package/dist/{arrange-BUREmgD9.d.ts → arrange-q5HQvnnB.d.ts} +1 -1
  11. package/dist/{bezier-Dywv3Bw8.d.ts → bezier-B6cK8SR6.d.ts} +2 -2
  12. package/dist/{bezier-CZ2AhjID.d.cts → bezier-CEJ8Uw4O.d.cts} +2 -2
  13. package/dist/{brushTypes-C7N3EBK7.d.cts → brushTypes-MX5UVs_m.d.cts} +27 -2
  14. package/dist/{brushTypes-C7N3EBK7.d.ts → brushTypes-MX5UVs_m.d.ts} +27 -2
  15. package/dist/{brushes-DJmUbIgz.d.ts → brushes-CQpL7_Lc.d.ts} +2 -107
  16. package/dist/{brushes-CnvZSYYU.d.cts → brushes-aEnjqoji.d.cts} +2 -107
  17. package/dist/{brushstrokeRender-IMFY3FF6.cjs → brushstrokeRender-PP6NTF6M.cjs} +52 -24
  18. package/dist/brushstrokeRender-PP6NTF6M.cjs.map +1 -0
  19. package/dist/{brushstrokeRender-2FAXA3XC.js → brushstrokeRender-QGEYJ4OZ.js} +40 -12
  20. package/dist/brushstrokeRender-QGEYJ4OZ.js.map +1 -0
  21. package/dist/{builtins-Cc-bH-3U.d.cts → builtins-BakDiKWf.d.cts} +3 -2
  22. package/dist/{builtins-ZU1GJnUA.d.ts → builtins-CE33vyv2.d.ts} +3 -2
  23. package/dist/canvas/index.cjs +16 -9
  24. package/dist/canvas/index.cjs.map +1 -1
  25. package/dist/canvas/index.d.cts +60 -14
  26. package/dist/canvas/index.d.ts +60 -14
  27. package/dist/canvas/index.js +10 -3
  28. package/dist/canvas/index.js.map +1 -1
  29. package/dist/{chunk-PRSRYHQD.cjs → chunk-3QHPFSQM.cjs} +36 -36
  30. package/dist/{chunk-PRSRYHQD.cjs.map → chunk-3QHPFSQM.cjs.map} +1 -1
  31. package/dist/{chunk-QBWEH3IM.cjs → chunk-3T5O225T.cjs} +391 -76
  32. package/dist/chunk-3T5O225T.cjs.map +1 -0
  33. package/dist/{chunk-EQQMGO42.js → chunk-C2J7GOMJ.js} +18 -5
  34. package/dist/chunk-C2J7GOMJ.js.map +1 -0
  35. package/dist/{chunk-2XS6LTUP.cjs → chunk-C46AZEBE.cjs} +104 -339
  36. package/dist/chunk-C46AZEBE.cjs.map +1 -0
  37. package/dist/{chunk-HUO3TI4C.js → chunk-CPSMARTX.js} +6 -241
  38. package/dist/chunk-CPSMARTX.js.map +1 -0
  39. package/dist/{chunk-KEENUAFN.cjs → chunk-DLLUOVQX.cjs} +18 -5
  40. package/dist/chunk-DLLUOVQX.cjs.map +1 -0
  41. package/dist/{chunk-LSXXAJG3.js → chunk-J7DSKTKB.js} +5 -4
  42. package/dist/chunk-J7DSKTKB.js.map +1 -0
  43. package/dist/{chunk-6S6362D2.js → chunk-NI6RORDS.js} +2 -2
  44. package/dist/{chunk-XN2NBLV5.cjs → chunk-PMEHFHSP.cjs} +82 -82
  45. package/dist/{chunk-XN2NBLV5.cjs.map → chunk-PMEHFHSP.cjs.map} +1 -1
  46. package/dist/{chunk-5FSRTP6E.js → chunk-PQFVLOMR.js} +319 -4
  47. package/dist/chunk-PQFVLOMR.js.map +1 -0
  48. package/dist/{chunk-OIBIRXRG.js → chunk-PSPLRQL6.js} +2 -2
  49. package/dist/{chunk-SYT2TLQF.js → chunk-QEIN6JQO.js} +2 -2
  50. package/dist/{chunk-3D77LOBM.js → chunk-TJBYBSTN.js} +51 -6
  51. package/dist/chunk-TJBYBSTN.js.map +1 -0
  52. package/dist/{chunk-DFSZO2B5.cjs → chunk-UFL5N4DK.cjs} +5 -4
  53. package/dist/chunk-UFL5N4DK.cjs.map +1 -0
  54. package/dist/{chunk-TLCTTQFF.cjs → chunk-VEHVXRJU.cjs} +17 -17
  55. package/dist/{chunk-TLCTTQFF.cjs.map → chunk-VEHVXRJU.cjs.map} +1 -1
  56. package/dist/{chunk-5OOIUXNJ.cjs → chunk-XFXHA5MU.cjs} +55 -10
  57. package/dist/chunk-XFXHA5MU.cjs.map +1 -0
  58. package/dist/commands/index.cjs +2 -2
  59. package/dist/commands/index.d.cts +3 -3
  60. package/dist/commands/index.d.ts +3 -3
  61. package/dist/commands/index.js +1 -1
  62. package/dist/effects/index.d.cts +5 -4
  63. package/dist/effects/index.d.ts +5 -4
  64. package/dist/{export-DwnZ_hvQ.d.ts → export-0ZaTK__4.d.ts} +4 -4
  65. package/dist/{export-41rL6Cne.d.ts → export-C45v6MYq.d.ts} +1 -1
  66. package/dist/{export-CyJdfP_Z.d.cts → export-D-7WCDJ9.d.cts} +4 -4
  67. package/dist/{export-D9mXp05Q.d.cts → export-DSdCfd6O.d.cts} +1 -1
  68. package/dist/grain-BWmGZxP4.d.cts +58 -0
  69. package/dist/grain-BWmGZxP4.d.ts +58 -0
  70. package/dist/{helpers-v6GMazzg.d.cts → helpers-Cavy1TB7.d.cts} +21 -1
  71. package/dist/{helpers-C-RgeyvH.d.ts → helpers-LZQ4cpg4.d.ts} +21 -1
  72. package/dist/image-editor/index.cjs +695 -677
  73. package/dist/image-editor/index.cjs.map +1 -1
  74. package/dist/image-editor/index.d.cts +12 -11
  75. package/dist/image-editor/index.d.ts +12 -11
  76. package/dist/image-editor/index.js +23 -5
  77. package/dist/image-editor/index.js.map +1 -1
  78. package/dist/{opentype-KR_jj6b_.d.cts → opentype-BpIJhGpj.d.cts} +1 -1
  79. package/dist/{opentype-a1KAW-qs.d.ts → opentype-CyxDScVz.d.ts} +1 -1
  80. package/dist/paint/index.cjs +21 -3
  81. package/dist/paint/index.cjs.map +1 -1
  82. package/dist/paint/index.d.cts +72 -5
  83. package/dist/paint/index.d.ts +72 -5
  84. package/dist/paint/index.js +20 -2
  85. package/dist/paint-editor/index.cjs +171 -171
  86. package/dist/paint-editor/index.cjs.map +1 -1
  87. package/dist/paint-editor/index.d.cts +77 -29
  88. package/dist/paint-editor/index.d.ts +77 -29
  89. package/dist/paint-editor/index.js +12 -12
  90. package/dist/{pathfinder-BHS4vQNm.d.cts → pathfinder-BMQEcS0k.d.cts} +2 -2
  91. package/dist/{pathfinder-BVvTIBMo.d.ts → pathfinder-CQIxubuP.d.ts} +2 -2
  92. package/dist/{pool-CZQOrSXZ.d.ts → pool-Cynuj89K.d.ts} +1 -1
  93. package/dist/{pool-FjZZmZ80.d.cts → pool-DedjxDKo.d.cts} +1 -1
  94. package/dist/{rand-8xbUb6ur.d.ts → rand-COS4_E1g.d.ts} +17 -1
  95. package/dist/{rand-Cw9VLrVC.d.cts → rand-D1JqpR-p.d.cts} +17 -1
  96. package/dist/{svg-DTb40ICU.d.cts → svg-RcixtBFR.d.cts} +2 -2
  97. package/dist/{svg-CSz3mzkw.d.ts → svg-nWBJEpnk.d.ts} +2 -2
  98. package/dist/{tools-Ca0kI1qo.d.cts → tools-CL82d7nw.d.cts} +1 -1
  99. package/dist/{tools-B0wXP5cF.d.ts → tools-DrxgDnXY.d.ts} +1 -1
  100. package/dist/vector/index.cjs +995 -955
  101. package/dist/vector/index.cjs.map +1 -1
  102. package/dist/vector/index.d.cts +44 -18
  103. package/dist/vector/index.d.ts +44 -18
  104. package/dist/vector/index.js +55 -15
  105. package/dist/vector/index.js.map +1 -1
  106. package/dist/video-editor/index.d.cts +5 -4
  107. package/dist/video-editor/index.d.ts +5 -4
  108. package/dist/{warp-DTOp0lON.d.cts → warp-CHi_P_G6.d.cts} +1 -1
  109. package/dist/{warp-pd7hrH4T.d.ts → warp-CPaHULUL.d.ts} +1 -1
  110. package/package.json +1 -1
  111. package/skills/pixerate-canvas/SKILL.md +12 -5
  112. package/skills/pixerate-vector/SKILL.md +4 -2
  113. package/dist/brushstrokeRender-2FAXA3XC.js.map +0 -1
  114. package/dist/brushstrokeRender-IMFY3FF6.cjs.map +0 -1
  115. package/dist/chunk-2XS6LTUP.cjs.map +0 -1
  116. package/dist/chunk-3D77LOBM.js.map +0 -1
  117. package/dist/chunk-5FSRTP6E.js.map +0 -1
  118. package/dist/chunk-5OOIUXNJ.cjs.map +0 -1
  119. package/dist/chunk-DFSZO2B5.cjs.map +0 -1
  120. package/dist/chunk-EQQMGO42.js.map +0 -1
  121. package/dist/chunk-HUO3TI4C.js.map +0 -1
  122. package/dist/chunk-KEENUAFN.cjs.map +0 -1
  123. package/dist/chunk-LSXXAJG3.js.map +0 -1
  124. package/dist/chunk-QBWEH3IM.cjs.map +0 -1
  125. /package/dist/{chunk-6S6362D2.js.map → chunk-NI6RORDS.js.map} +0 -0
  126. /package/dist/{chunk-OIBIRXRG.js.map → chunk-PSPLRQL6.js.map} +0 -0
  127. /package/dist/{chunk-SYT2TLQF.js.map → chunk-QEIN6JQO.js.map} +0 -0
@@ -363,7 +363,7 @@ var _chunk2OJACTPRcjs = require('../chunk-2OJACTPR.cjs');
363
363
 
364
364
 
365
365
 
366
- var _chunkXN2NBLV5cjs = require('../chunk-XN2NBLV5.cjs');
366
+ var _chunkPMEHFHSPcjs = require('../chunk-PMEHFHSP.cjs');
367
367
 
368
368
 
369
369
  var _chunk2YQONY6Gcjs = require('../chunk-2YQONY6G.cjs');
@@ -475,7 +475,7 @@ var _chunkMUUXNRU4cjs = require('../chunk-MUUXNRU4.cjs');
475
475
 
476
476
 
477
477
 
478
- var _chunkTLCTTQFFcjs = require('../chunk-TLCTTQFF.cjs');
478
+ var _chunkVEHVXRJUcjs = require('../chunk-VEHVXRJU.cjs');
479
479
 
480
480
 
481
481
 
@@ -621,8 +621,8 @@ var _chunkG5NMLUVFcjs = require('../chunk-G5NMLUVF.cjs');
621
621
 
622
622
 
623
623
 
624
- var _chunk5OOIUXNJcjs = require('../chunk-5OOIUXNJ.cjs');
625
- require('../chunk-2XS6LTUP.cjs');
624
+ var _chunkXFXHA5MUcjs = require('../chunk-XFXHA5MU.cjs');
625
+ require('../chunk-C46AZEBE.cjs');
626
626
  require('../chunk-Q6OUXEK3.cjs');
627
627
  require('../chunk-BJTCSLF6.cjs');
628
628
  require('../chunk-IZ4WRXZA.cjs');
@@ -722,7 +722,16 @@ require('../chunk-RIWPYSKU.cjs');
722
722
 
723
723
 
724
724
 
725
- var _chunkQBWEH3IMcjs = require('../chunk-QBWEH3IM.cjs');
725
+
726
+
727
+
728
+
729
+
730
+
731
+
732
+
733
+
734
+ var _chunk3T5O225Tcjs = require('../chunk-3T5O225T.cjs');
726
735
 
727
736
 
728
737
 
@@ -928,7 +937,7 @@ function quickMaskPixels(mask, style = {}) {
928
937
 
929
938
  // src/image-editor/layers/render.ts
930
939
  function isQuarterTurn(rotate) {
931
- return _chunkXN2NBLV5cjs.normalizeAngle.call(void 0, rotate) % 90 === 0;
940
+ return _chunkPMEHFHSPcjs.normalizeAngle.call(void 0, rotate) % 90 === 0;
932
941
  }
933
942
  function isIntegerRect(r) {
934
943
  return Number.isInteger(r.x) && Number.isInteger(r.y) && Number.isInteger(r.width) && Number.isInteger(r.height);
@@ -936,7 +945,7 @@ function isIntegerRect(r) {
936
945
  function baseProjection(region, transform, baseW, baseH) {
937
946
  return {
938
947
  region,
939
- angle: _chunkXN2NBLV5cjs.normalizeAngle.call(void 0, transform.rotate),
948
+ angle: _chunkPMEHFHSPcjs.normalizeAngle.call(void 0, transform.rotate),
940
949
  flipH: transform.flipH,
941
950
  flipV: transform.flipV,
942
951
  scale: 1,
@@ -945,14 +954,14 @@ function baseProjection(region, transform, baseW, baseH) {
945
954
  };
946
955
  }
947
956
  function projectQuarterTurn(src, srcRect, region, transform) {
948
- const rotated = _chunkXN2NBLV5cjs.getRotatedSize.call(void 0, region.width, region.height, transform);
957
+ const rotated = _chunkPMEHFHSPcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
949
958
  const w = Math.max(1, Math.round(rotated.width));
950
959
  const h = Math.max(1, Math.round(rotated.height));
951
960
  const out = new Uint8ClampedArray(w * h * 4);
952
961
  const p = baseProjection(region, transform, w, h);
953
- const o = _chunkXN2NBLV5cjs.unprojectCanvasPoint.call(void 0, { x: 0.5, y: 0.5 }, p);
954
- const ox = _chunkXN2NBLV5cjs.unprojectCanvasPoint.call(void 0, { x: 1.5, y: 0.5 }, p);
955
- const oy = _chunkXN2NBLV5cjs.unprojectCanvasPoint.call(void 0, { x: 0.5, y: 1.5 }, p);
962
+ const o = _chunkPMEHFHSPcjs.unprojectCanvasPoint.call(void 0, { x: 0.5, y: 0.5 }, p);
963
+ const ox = _chunkPMEHFHSPcjs.unprojectCanvasPoint.call(void 0, { x: 1.5, y: 0.5 }, p);
964
+ const oy = _chunkPMEHFHSPcjs.unprojectCanvasPoint.call(void 0, { x: 0.5, y: 1.5 }, p);
956
965
  const ux = Math.round(ox.x - o.x);
957
966
  const vx = Math.round(ox.y - o.y);
958
967
  const uy = Math.round(oy.x - o.x);
@@ -981,23 +990,23 @@ function applyOutputStage(img, opacity, legacyOutputBlur) {
981
990
  const d = img.data;
982
991
  for (let i = 3; i < d.length; i += 4) d[i] = d[i] * opacity;
983
992
  }
984
- if (legacyOutputBlur && legacyOutputBlur > 0) _chunkXN2NBLV5cjs.applyBoxBlur.call(void 0, img, Math.min(Math.round(legacyOutputBlur), 40));
993
+ if (legacyOutputBlur && legacyOutputBlur > 0) _chunkPMEHFHSPcjs.applyBoxBlur.call(void 0, img, Math.min(Math.round(legacyOutputBlur), 40));
985
994
  }
986
995
  function needsLegacyBase(input) {
987
996
  const { stack, region, canvas, transform } = input;
988
- if (!_chunkXN2NBLV5cjs.isLegacyShape.call(void 0, stack)) return false;
997
+ if (!_chunkPMEHFHSPcjs.isLegacyShape.call(void 0, stack)) return false;
989
998
  const bg = stack.layers[0];
990
999
  if (!isQuarterTurn(transform.rotate) || !isIntegerRect(region)) return true;
991
1000
  if (_optionalChain([bg, 'access', _2 => _2.mask, 'optionalAccess', _3 => _3.source, 'optionalAccess', _4 => _4.enabled]) && bg.mask.source.maskSource) return true;
992
1001
  if (stack.outputOpacity < 1) return true;
993
- const blur = _chunkXN2NBLV5cjs.blurFilter.call(void 0, bg);
1002
+ const blur = _chunkPMEHFHSPcjs.blurFilter.call(void 0, bg);
994
1003
  if (blur && blur.enabled && blur.radius > 0) {
995
1004
  const full = region.x === 0 && region.y === 0 && region.width === canvas.width && region.height === canvas.height;
996
- const angle = _chunkXN2NBLV5cjs.normalizeAngle.call(void 0, transform.rotate);
1005
+ const angle = _chunkPMEHFHSPcjs.normalizeAngle.call(void 0, transform.rotate);
997
1006
  if (!full || angle === 90 || angle === 270) return true;
998
1007
  }
999
1008
  if ((_nullishCoalesce(stack.legacyOutputBlur, () => ( 0))) > 0 && !input.sourceOpaque) return true;
1000
- if (_chunkXN2NBLV5cjs.hasResampledLegacyMask.call(void 0, stack.layers, canvas.width, canvas.height)) return true;
1009
+ if (_chunkPMEHFHSPcjs.hasResampledLegacyMask.call(void 0, stack.layers, canvas.width, canvas.height)) return true;
1001
1010
  return false;
1002
1011
  }
1003
1012
  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;
@@ -1029,7 +1038,7 @@ function coveringRect(region) {
1029
1038
  const y = Math.floor(region.y);
1030
1039
  return { x, y, width: Math.ceil(region.x + region.width) - x, height: Math.ceil(region.y + region.height) - y };
1031
1040
  }
1032
- function renderLayeredBase(stack, region, transform, sources, compositor = new (0, _chunkXN2NBLV5cjs.LayerCompositor)()) {
1041
+ function renderLayeredBase(stack, region, transform, sources, compositor = new (0, _chunkPMEHFHSPcjs.LayerCompositor)()) {
1033
1042
  if (!isQuarterTurn(transform.rotate) || !isIntegerRect(region)) {
1034
1043
  throw new Error("renderLayeredBase needs an integer region and a quarter-turn rotation.");
1035
1044
  }
@@ -1163,8 +1172,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1163
1172
  * The viewport's compositor. It only ever composites the viewport's stack, so its tile cache can
1164
1173
  * trust dirty rectangles; exports use `exportCompositor`.
1165
1174
  */
1166
- __init8() {this.compositor = new (0, _chunkXN2NBLV5cjs.LayerCompositor)()}
1167
- __init9() {this.exportCompositor = new (0, _chunkXN2NBLV5cjs.LayerCompositor)({ maxCacheBytes: 64 * 1024 * 1024 })}
1175
+ __init8() {this.compositor = new (0, _chunkPMEHFHSPcjs.LayerCompositor)()}
1176
+ __init9() {this.exportCompositor = new (0, _chunkPMEHFHSPcjs.LayerCompositor)({ maxCacheBytes: 64 * 1024 * 1024 })}
1168
1177
  /** How the host resolves layer pixels (set by the controller). */
1169
1178
 
1170
1179
  /**
@@ -1241,9 +1250,9 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1241
1250
  return;
1242
1251
  }
1243
1252
  const isActivelyCropping = Boolean(options.showCropOverlay || state.activeTool === "crop");
1244
- const projection = _chunkXN2NBLV5cjs.getViewportProjection.call(void 0, geoState, vpWidth, vpHeight, isActivelyCropping);
1253
+ const projection = _chunkPMEHFHSPcjs.getViewportProjection.call(void 0, geoState, vpWidth, vpHeight, isActivelyCropping);
1245
1254
  const { region } = projection;
1246
- const rotated = _chunkXN2NBLV5cjs.getRotatedSize.call(void 0, region.width, region.height, transform);
1255
+ const rotated = _chunkPMEHFHSPcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
1247
1256
  const route = this.chooseRoute(state, region, naturalWidth, naturalHeight);
1248
1257
  let overlay = annotations;
1249
1258
  if (route === "legacy") {
@@ -1253,8 +1262,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1253
1262
  `${naturalWidth}x${naturalHeight}`,
1254
1263
  `${region.x},${region.y},${region.width},${region.height}`,
1255
1264
  `${projection.angle},${transform.flipH},${transform.flipV}`,
1256
- `${adjustments.brightness},${adjustments.contrast},${adjustments.saturation},${adjustments.exposure},${adjustments.temperature},${_nullishCoalesce(adjustments.tint, () => ( 0))},${adjustments.blur},${adjustments.opacity},p${_chunkXN2NBLV5cjs.normalizeProcessVersion.call(void 0, adjustments.process)}`,
1257
- _chunkXN2NBLV5cjs.adjustmentLayersKey.call(void 0, adjustments.layers),
1265
+ `${adjustments.brightness},${adjustments.contrast},${adjustments.saturation},${adjustments.exposure},${adjustments.temperature},${_nullishCoalesce(adjustments.tint, () => ( 0))},${adjustments.blur},${adjustments.opacity},p${_chunkPMEHFHSPcjs.normalizeProcessVersion.call(void 0, adjustments.process)}`,
1266
+ _chunkPMEHFHSPcjs.adjustmentLayersKey.call(void 0, adjustments.layers),
1258
1267
  `${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}`,
1259
1268
  `d${this.displayKey}`
1260
1269
  ].join("|");
@@ -1288,7 +1297,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1288
1297
  }
1289
1298
  if (overlay.length > 0 || options.draftAnnotation) {
1290
1299
  ctx.save();
1291
- _chunkXN2NBLV5cjs.applyImageProjectionToContext.call(void 0, ctx, projection);
1300
+ _chunkPMEHFHSPcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
1292
1301
  ctx.beginPath();
1293
1302
  ctx.rect(region.x, region.y, region.width, region.height);
1294
1303
  ctx.clip();
@@ -1311,7 +1320,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1311
1320
  if (_optionalChain([state, 'access', _15 => _15.selection, 'optionalAccess', _16 => _16.bounds]) && display !== "none" || _optionalChain([options, 'access', _17 => _17.draftSelectionPath, 'optionalAccess', _18 => _18.length])) {
1312
1321
  ctx.save();
1313
1322
  try {
1314
- _chunkXN2NBLV5cjs.applyImageProjectionToContext.call(void 0, ctx, projection);
1323
+ _chunkPMEHFHSPcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
1315
1324
  ctx.beginPath();
1316
1325
  ctx.rect(region.x, region.y, region.width, region.height);
1317
1326
  ctx.clip();
@@ -1326,7 +1335,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1326
1335
  const b = options.brushCursor;
1327
1336
  ctx.save();
1328
1337
  try {
1329
- _chunkXN2NBLV5cjs.applyImageProjectionToContext.call(void 0, ctx, projection);
1338
+ _chunkPMEHFHSPcjs.applyImageProjectionToContext.call(void 0, ctx, projection);
1330
1339
  const px2 = 1 / (projection.scale || 1);
1331
1340
  ctx.beginPath();
1332
1341
  ctx.arc(b.x, b.y, Math.max(px2, b.diameter / 2), 0, Math.PI * 2);
@@ -1341,7 +1350,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1341
1350
  ctx.restore();
1342
1351
  }
1343
1352
  if (options.cloneSourceMarker) {
1344
- const m = _chunkXN2NBLV5cjs.projectImagePoint.call(void 0, options.cloneSourceMarker, projection);
1353
+ const m = _chunkPMEHFHSPcjs.projectImagePoint.call(void 0, options.cloneSourceMarker, projection);
1345
1354
  ctx.save();
1346
1355
  try {
1347
1356
  const r = 7;
@@ -1365,7 +1374,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1365
1374
  const t = options.textEdit;
1366
1375
  ctx.save();
1367
1376
  try {
1368
- const scr = (p) => _chunkXN2NBLV5cjs.projectImagePoint.call(void 0, p, projection);
1377
+ const scr = (p) => _chunkPMEHFHSPcjs.projectImagePoint.call(void 0, p, projection);
1369
1378
  const poly = (pts) => {
1370
1379
  ctx.beginPath();
1371
1380
  pts.map(scr).forEach((p, i) => i ? ctx.lineTo(p.x, p.y) : ctx.moveTo(p.x, p.y));
@@ -1404,7 +1413,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1404
1413
  const t = options.freeTransform;
1405
1414
  ctx.save();
1406
1415
  try {
1407
- const scr = (p) => _chunkXN2NBLV5cjs.projectImagePoint.call(void 0, p, projection);
1416
+ const scr = (p) => _chunkPMEHFHSPcjs.projectImagePoint.call(void 0, p, projection);
1408
1417
  ctx.beginPath();
1409
1418
  if (t.warp) {
1410
1419
  for (const c of t.warp.curves) {
@@ -1462,7 +1471,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1462
1471
  }
1463
1472
  if (isActivelyCropping) {
1464
1473
  const activeCrop = options.draftCrop !== void 0 && options.draftCrop !== null ? options.draftCrop : _nullishCoalesce(crop, () => ( { x: 0, y: 0, width: naturalWidth, height: naturalHeight }));
1465
- this.drawCropOverlay(ctx, _chunkXN2NBLV5cjs.getViewportMetrics.call(void 0, geoState, vpWidth, vpHeight, true, activeCrop));
1474
+ this.drawCropOverlay(ctx, _chunkPMEHFHSPcjs.getViewportMetrics.call(void 0, geoState, vpWidth, vpHeight, true, activeCrop));
1466
1475
  }
1467
1476
  }
1468
1477
  /**
@@ -1471,7 +1480,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1471
1480
  */
1472
1481
  async renderBaseImage(img, naturalWidth, naturalHeight, region, transform, state, onPixels) {
1473
1482
  const { adjustments, depthMask } = state;
1474
- const rotated = _chunkXN2NBLV5cjs.getRotatedSize.call(void 0, region.width, region.height, transform);
1483
+ const rotated = _chunkPMEHFHSPcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
1475
1484
  const baseW = Math.max(1, Math.round(rotated.width));
1476
1485
  const baseH = Math.max(1, Math.round(rotated.height));
1477
1486
  const baseCanvas = this.createCanvas(baseW, baseH);
@@ -1479,7 +1488,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1479
1488
  if (!baseCtx) return baseCanvas;
1480
1489
  const projection = getBaseProjection(region, transform, baseW, baseH);
1481
1490
  baseCtx.save();
1482
- _chunkXN2NBLV5cjs.applyImageProjectionToContext.call(void 0, baseCtx, projection);
1491
+ _chunkPMEHFHSPcjs.applyImageProjectionToContext.call(void 0, baseCtx, projection);
1483
1492
  baseCtx.drawImage(
1484
1493
  img,
1485
1494
  region.x,
@@ -1494,8 +1503,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1494
1503
  baseCtx.restore();
1495
1504
  const imageData = baseCtx.getImageData(0, 0, baseW, baseH);
1496
1505
  if (imageData) {
1497
- const layerMasks = _chunkXN2NBLV5cjs.buildLayerMaskPlanes.call(void 0, adjustments.layers, naturalWidth, naturalHeight, projection, baseW, baseH);
1498
- _chunkXN2NBLV5cjs.applyAdjustments.call(void 0, imageData, adjustments, layerMasks ? { layerMasks } : {});
1506
+ const layerMasks = _chunkPMEHFHSPcjs.buildLayerMaskPlanes.call(void 0, adjustments.layers, naturalWidth, naturalHeight, projection, baseW, baseH);
1507
+ _chunkPMEHFHSPcjs.applyAdjustments.call(void 0, imageData, adjustments, layerMasks ? { layerMasks } : {});
1499
1508
  if (depthMask.enabled && depthMask.maskSource) {
1500
1509
  try {
1501
1510
  const maskImg = await this.imageCache.get(depthMask.maskSource);
@@ -1506,7 +1515,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1506
1515
  const maskCtx = maskCanvas.getContext("2d");
1507
1516
  if (maskCtx) {
1508
1517
  maskCtx.save();
1509
- _chunkXN2NBLV5cjs.applyImageProjectionToContext.call(void 0, maskCtx, projection);
1518
+ _chunkPMEHFHSPcjs.applyImageProjectionToContext.call(void 0, maskCtx, projection);
1510
1519
  maskCtx.drawImage(
1511
1520
  maskImg,
1512
1521
  region.x * sx,
@@ -1521,7 +1530,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1521
1530
  maskCtx.restore();
1522
1531
  const maskData = maskCtx.getImageData(0, 0, baseW, baseH);
1523
1532
  if (maskData) {
1524
- _chunkXN2NBLV5cjs.applyDepthMask.call(void 0, imageData, maskData, depthMask);
1533
+ _chunkPMEHFHSPcjs.applyDepthMask.call(void 0, imageData, maskData, depthMask);
1525
1534
  }
1526
1535
  }
1527
1536
  } catch (e8) {
@@ -1540,7 +1549,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1540
1549
  else if (this.baseRoute === "layers") route = "layers";
1541
1550
  else {
1542
1551
  const stack = { layers: state.layers, outputOpacity: _nullishCoalesce(state.outputOpacity, () => ( 1)), legacyOutputBlur: state.legacyOutputBlur };
1543
- const shaped = this.baseRoute === "legacy" && _chunkXN2NBLV5cjs.isLegacyShape.call(void 0, stack);
1552
+ const shaped = this.baseRoute === "legacy" && _chunkPMEHFHSPcjs.isLegacyShape.call(void 0, stack);
1544
1553
  route = shaped || needsLegacyBase({
1545
1554
  stack,
1546
1555
  region,
@@ -1675,17 +1684,17 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1675
1684
  if (!comp) return null;
1676
1685
  const opacity = _nullishCoalesce(state.outputOpacity, () => ( 1));
1677
1686
  const blur = _nullishCoalesce(state.legacyOutputBlur, () => ( 0));
1678
- const rotated = _chunkXN2NBLV5cjs.getRotatedSize.call(void 0, region.width, region.height, transform);
1687
+ const rotated = _chunkPMEHFHSPcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
1679
1688
  const baseW = Math.max(1, Math.round(rotated.width));
1680
1689
  const baseH = Math.max(1, Math.round(rotated.height));
1681
- const key = `${this.displayKey}:${comp.version}|${region.x},${region.y},${region.width},${region.height}|${_chunkXN2NBLV5cjs.normalizeAngle.call(void 0, transform.rotate)},${transform.flipH},${transform.flipV}|${opacity}|${blur}`;
1690
+ const key = `${this.displayKey}:${comp.version}|${region.x},${region.y},${region.width},${region.height}|${_chunkPMEHFHSPcjs.normalizeAngle.call(void 0, transform.rotate)},${transform.flipH},${transform.flipV}|${opacity}|${blur}`;
1682
1691
  if (this.cachedPostCanvas && this.cachedPostKey === key) return { canvas: this.cachedPostCanvas, histogram: this.cachedPostHistogram };
1683
1692
  const canvas = this.cachedPostCanvas && this.cachedPostCanvas.width === baseW && this.cachedPostCanvas.height === baseH ? this.cachedPostCanvas : this.createCanvas(baseW, baseH);
1684
1693
  const ctx = canvas.getContext("2d");
1685
1694
  if (!ctx) return null;
1686
1695
  ctx.clearRect(0, 0, baseW, baseH);
1687
1696
  ctx.save();
1688
- _chunkXN2NBLV5cjs.applyImageProjectionToContext.call(void 0, ctx, baseProjection(region, transform, baseW, baseH));
1697
+ _chunkPMEHFHSPcjs.applyImageProjectionToContext.call(void 0, ctx, baseProjection(region, transform, baseW, baseH));
1689
1698
  ctx.beginPath();
1690
1699
  ctx.rect(region.x, region.y, region.width, region.height);
1691
1700
  ctx.clip();
@@ -1957,7 +1966,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1957
1966
  ctx.strokeStyle = "#3b82f6";
1958
1967
  ctx.lineWidth = 1.5;
1959
1968
  ctx.setLineDash([4, 4]);
1960
- const bounds = _chunkXN2NBLV5cjs.getAnnotationBounds.call(void 0, ann);
1969
+ const bounds = _chunkPMEHFHSPcjs.getAnnotationBounds.call(void 0, ann);
1961
1970
  const pad = 4;
1962
1971
  ctx.strokeRect(bounds.x - pad, bounds.y - pad, bounds.width + pad * 2, bounds.height + pad * 2);
1963
1972
  ctx.fillStyle = "#ffffff";
@@ -1978,7 +1987,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
1978
1987
  }
1979
1988
  /** @deprecated Use the standalone `getAnnotationBounds` from the geometry module. */
1980
1989
  getAnnotationBounds(ann) {
1981
- return _chunkXN2NBLV5cjs.getAnnotationBounds.call(void 0, ann);
1990
+ return _chunkPMEHFHSPcjs.getAnnotationBounds.call(void 0, ann);
1982
1991
  }
1983
1992
  /**
1984
1993
  * Draws a rule-of-thirds crop grid overlay. All rectangles come from
@@ -2060,8 +2069,8 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
2060
2069
  }
2061
2070
  const { width: naturalWidth, height: naturalHeight } = getSourceSize(img);
2062
2071
  const { crop, transform, annotations } = state;
2063
- const region = crop ? _chunkXN2NBLV5cjs.clampCropToImage.call(void 0, crop, naturalWidth, naturalHeight) : { x: 0, y: 0, width: naturalWidth, height: naturalHeight };
2064
- const rotated = _chunkXN2NBLV5cjs.getRotatedSize.call(void 0, region.width, region.height, transform);
2072
+ const region = crop ? _chunkPMEHFHSPcjs.clampCropToImage.call(void 0, crop, naturalWidth, naturalHeight) : { x: 0, y: 0, width: naturalWidth, height: naturalHeight };
2073
+ const rotated = _chunkPMEHFHSPcjs.getRotatedSize.call(void 0, region.width, region.height, transform);
2065
2074
  const baseW = Math.max(1, Math.round(rotated.width));
2066
2075
  const baseH = Math.max(1, Math.round(rotated.height));
2067
2076
  const exportW = options.width || baseW;
@@ -2090,7 +2099,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
2090
2099
  const bctx = baseCanvas.getContext("2d");
2091
2100
  if (bctx) {
2092
2101
  bctx.save();
2093
- _chunkXN2NBLV5cjs.applyImageProjectionToContext.call(void 0, bctx, baseProjection(region, transform, baseW, baseH));
2102
+ _chunkPMEHFHSPcjs.applyImageProjectionToContext.call(void 0, bctx, baseProjection(region, transform, baseW, baseH));
2094
2103
  bctx.beginPath();
2095
2104
  bctx.rect(region.x, region.y, region.width, region.height);
2096
2105
  bctx.clip();
@@ -2103,7 +2112,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
2103
2112
  if (options.includeAnnotations !== false && overlay.length > 0) {
2104
2113
  ctx.save();
2105
2114
  ctx.scale(exportW / baseW, exportH / baseH);
2106
- _chunkXN2NBLV5cjs.applyImageProjectionToContext.call(void 0, ctx, getBaseProjection(region, transform, baseW, baseH));
2115
+ _chunkPMEHFHSPcjs.applyImageProjectionToContext.call(void 0, ctx, getBaseProjection(region, transform, baseW, baseH));
2107
2116
  for (const ann of overlay) {
2108
2117
  await this.drawAnnotation(ctx, ann);
2109
2118
  }
@@ -2193,7 +2202,7 @@ var ImageEditorRenderer = (_class2 = class {constructor() { _class2.prototype.__
2193
2202
  case "rect":
2194
2203
  case "image":
2195
2204
  case "text": {
2196
- const b = _chunkXN2NBLV5cjs.getAnnotationBounds.call(void 0, ann);
2205
+ const b = _chunkPMEHFHSPcjs.getAnnotationBounds.call(void 0, ann);
2197
2206
  ctx.fillRect(b.x, b.y, b.width, b.height);
2198
2207
  break;
2199
2208
  }
@@ -2213,7 +2222,7 @@ function getSourceSize(img, fallbackW = 800, fallbackH = 600) {
2213
2222
  function getBaseProjection(region, transform, baseW, baseH) {
2214
2223
  return {
2215
2224
  region,
2216
- angle: _chunkXN2NBLV5cjs.normalizeAngle.call(void 0, transform.rotate),
2225
+ angle: _chunkPMEHFHSPcjs.normalizeAngle.call(void 0, transform.rotate),
2217
2226
  flipH: transform.flipH,
2218
2227
  flipV: transform.flipV,
2219
2228
  scale: 1,
@@ -2317,8 +2326,8 @@ function polygonCoverage(points, width, height, antiAlias = true) {
2317
2326
  }
2318
2327
  function toMask(width, height, coverage) {
2319
2328
  const out = new Uint8Array(coverage.length);
2320
- for (let i = 0; i < out.length; i++) out[i] = _chunkXN2NBLV5cjs.coverageToByte.call(void 0, coverage[i]);
2321
- return _chunkXN2NBLV5cjs.createSelectionMask.call(void 0, width, height, out);
2329
+ for (let i = 0; i < out.length; i++) out[i] = _chunkPMEHFHSPcjs.coverageToByte.call(void 0, coverage[i]);
2330
+ return _chunkPMEHFHSPcjs.createSelectionMask.call(void 0, width, height, out);
2322
2331
  }
2323
2332
  function polygonSelection(width, height, points, options = {}) {
2324
2333
  return toMask(width, height, polygonCoverage(points, width, height, _nullishCoalesce(options.antiAlias, () => ( true))));
@@ -2445,7 +2454,7 @@ function magicWand(pixels, seed, options = {}) {
2445
2454
  const { width: w, height: h } = pixels;
2446
2455
  const sx = Math.floor(seed.x);
2447
2456
  const sy = Math.floor(seed.y);
2448
- if (!(sx >= 0 && sy >= 0 && sx < w && sy < h)) return _chunkXN2NBLV5cjs.createSelectionMask.call(void 0, w, h);
2457
+ if (!(sx >= 0 && sy >= 0 && sx < w && sy < h)) return _chunkPMEHFHSPcjs.createSelectionMask.call(void 0, w, h);
2449
2458
  const similar = similarity(pixels, sy * w + sx, _nullishCoalesce(options.tolerance, () => ( 32)), _nullishCoalesce(options.distance, () => ( "rgb")));
2450
2459
  const marks = new Uint8Array(n);
2451
2460
  let bx0 = w;
@@ -2493,9 +2502,9 @@ function magicWand(pixels, seed, options = {}) {
2493
2502
  }
2494
2503
  }
2495
2504
  }
2496
- if (bx1 < 0) return _chunkXN2NBLV5cjs.createSelectionMask.call(void 0, w, h);
2497
- if (!(_nullishCoalesce(options.antiAlias, () => ( true)))) return _chunkXN2NBLV5cjs.createSelectionMask.call(void 0, w, h, marks);
2498
- return _chunkXN2NBLV5cjs.createSelectionMask.call(void 0,
2505
+ if (bx1 < 0) return _chunkPMEHFHSPcjs.createSelectionMask.call(void 0, w, h);
2506
+ if (!(_nullishCoalesce(options.antiAlias, () => ( true)))) return _chunkPMEHFHSPcjs.createSelectionMask.call(void 0, w, h, marks);
2507
+ return _chunkPMEHFHSPcjs.createSelectionMask.call(void 0,
2499
2508
  w,
2500
2509
  h,
2501
2510
  antialiasMarks(marks, w, h, Math.max(0, bx0 - 1), Math.max(0, by0 - 1), Math.min(w, bx1 + 2), Math.min(h, by1 + 2))
@@ -2517,7 +2526,7 @@ function colorRange(pixels, samples, options = {}) {
2517
2526
  const parsed = samples.map((s) => ({ c: sampleColor(s.color), at: s.at }));
2518
2527
  const radius = options.localized !== void 0 ? Math.max(1, options.localized) : void 0;
2519
2528
  const out = new Uint8Array(n);
2520
- if (!parsed.length) return _chunkXN2NBLV5cjs.createSelectionMask.call(void 0, w, h, out);
2529
+ if (!parsed.length) return _chunkPMEHFHSPcjs.createSelectionMask.call(void 0, w, h, out);
2521
2530
  for (let i = 0; i < n; i++) {
2522
2531
  const p = i * 4;
2523
2532
  if (data[p + 3] <= 0) continue;
@@ -2533,9 +2542,9 @@ function colorRange(pixels, samples, options = {}) {
2533
2542
  }
2534
2543
  if (k > best) best = k;
2535
2544
  }
2536
- out[i] = _chunkXN2NBLV5cjs.coverageToByte.call(void 0, best);
2545
+ out[i] = _chunkPMEHFHSPcjs.coverageToByte.call(void 0, best);
2537
2546
  }
2538
- return _chunkXN2NBLV5cjs.createSelectionMask.call(void 0, w, h, out);
2547
+ return _chunkPMEHFHSPcjs.createSelectionMask.call(void 0, w, h, out);
2539
2548
  }
2540
2549
  var TONE_RANGE_PRESETS = {
2541
2550
  shadows: [0, 65],
@@ -2553,9 +2562,9 @@ function toneRange(pixels, range, falloff = 20) {
2553
2562
  if (d[p + 3] <= 0) continue;
2554
2563
  const l = Math.min(255, Math.max(0, 0.299 * d[p] + 0.587 * d[p + 1] + 0.114 * d[p + 2]));
2555
2564
  const outside = l < lo ? lo - l : l > hi ? l - hi : 0;
2556
- out[i] = _chunkXN2NBLV5cjs.coverageToByte.call(void 0, 1 - outside / ramp);
2565
+ out[i] = _chunkPMEHFHSPcjs.coverageToByte.call(void 0, 1 - outside / ramp);
2557
2566
  }
2558
- return _chunkXN2NBLV5cjs.createSelectionMask.call(void 0, pixels.width, pixels.height, out);
2567
+ return _chunkPMEHFHSPcjs.createSelectionMask.call(void 0, pixels.width, pixels.height, out);
2559
2568
  }
2560
2569
  function hueRange(pixels, center) {
2561
2570
  const n = checkPixels(pixels);
@@ -2578,9 +2587,9 @@ function hueRange(pixels, center) {
2578
2587
  hue *= 60;
2579
2588
  let dh = ((hue - center) % 360 + 360) % 360;
2580
2589
  dh = Math.min(dh, 360 - dh);
2581
- out[i] = _chunkXN2NBLV5cjs.coverageToByte.call(void 0, Math.min(1, Math.max(0, 1 - dh / 60)) * chroma * (2 - mx));
2590
+ out[i] = _chunkPMEHFHSPcjs.coverageToByte.call(void 0, Math.min(1, Math.max(0, 1 - dh / 60)) * chroma * (2 - mx));
2582
2591
  }
2583
- return _chunkXN2NBLV5cjs.createSelectionMask.call(void 0, pixels.width, pixels.height, out);
2592
+ return _chunkPMEHFHSPcjs.createSelectionMask.call(void 0, pixels.width, pixels.height, out);
2584
2593
  }
2585
2594
 
2586
2595
  // src/image-editor/selection/refine.ts
@@ -2714,9 +2723,9 @@ function edgeWidth(guide, w, h, r) {
2714
2723
  g[yy * w + xx] = Math.sqrt(gx * gx + gy * gy);
2715
2724
  }
2716
2725
  }
2717
- const gm = _chunkXN2NBLV5cjs.greyMorphology.call(void 0, g, w, h, r, true);
2718
- const hi = _chunkXN2NBLV5cjs.greyMorphology.call(void 0, y, w, h, r, true);
2719
- const lo = _chunkXN2NBLV5cjs.greyMorphology.call(void 0, y, w, h, r, false);
2726
+ const gm = _chunkPMEHFHSPcjs.greyMorphology.call(void 0, g, w, h, r, true);
2727
+ const hi = _chunkPMEHFHSPcjs.greyMorphology.call(void 0, y, w, h, r, true);
2728
+ const lo = _chunkPMEHFHSPcjs.greyMorphology.call(void 0, y, w, h, r, false);
2720
2729
  const out = new Float32Array(n);
2721
2730
  for (let i = 0; i < n; i++) out[i] = (hi[i] - lo[i]) / Math.max(gm[i], 1e-4);
2722
2731
  return out;
@@ -2740,7 +2749,7 @@ function refineCoverage(guide, m, w, h, params = {}) {
2740
2749
  }
2741
2750
  }
2742
2751
  if (any) {
2743
- const dist = _chunkXN2NBLV5cjs.distanceTransform.call(void 0, boundary, w, h);
2752
+ const dist = _chunkPMEHFHSPcjs.distanceTransform.call(void 0, boundary, w, h);
2744
2753
  const r = gfRadius(p);
2745
2754
  const q = guidedFilterColor(guide, m, w, h, r);
2746
2755
  const widths = p.smartRadius ? edgeWidth(guide, w, h, r) : null;
@@ -2766,7 +2775,7 @@ function refineCoverage(guide, m, w, h, params = {}) {
2766
2775
  for (let i = 0; i < a.length; i++) a[i] = Math.min(1, Math.max(0, (a[i] - 0.5) * gain + 0.5));
2767
2776
  }
2768
2777
  const amount = shiftAmount(p);
2769
- if (Math.abs(amount) >= 1e-4) a = _chunkXN2NBLV5cjs.shiftCoverage.call(void 0, a, w, h, amount);
2778
+ if (Math.abs(amount) >= 1e-4) a = _chunkPMEHFHSPcjs.shiftCoverage.call(void 0, a, w, h, amount);
2770
2779
  return a;
2771
2780
  }
2772
2781
  function guidePlanes(pixels, win) {
@@ -2810,9 +2819,9 @@ function refineSelection(pixels, mask, params = {}) {
2810
2819
  const out = new Uint8Array(mask.width * mask.height);
2811
2820
  for (let y = 0; y < wh; y++) {
2812
2821
  const dst = (y0 + y) * mask.width + x0;
2813
- for (let x = 0; x < ww; x++) out[dst + x] = _chunkXN2NBLV5cjs.coverageToByte.call(void 0, refined[y * ww + x]);
2822
+ for (let x = 0; x < ww; x++) out[dst + x] = _chunkPMEHFHSPcjs.coverageToByte.call(void 0, refined[y * ww + x]);
2814
2823
  }
2815
- return _chunkXN2NBLV5cjs.createSelectionMask.call(void 0, mask.width, mask.height, out);
2824
+ return _chunkPMEHFHSPcjs.createSelectionMask.call(void 0, mask.width, mask.height, out);
2816
2825
  }
2817
2826
 
2818
2827
  // src/image-editor/effects.ts
@@ -2982,7 +2991,7 @@ var ImageEffectsEngine = (_class4 = class {
2982
2991
  // src/image-editor/free-transform.ts
2983
2992
  var FREE_TRANSFORM_CONTENTS = ["auto", "layer", "selection", "selection-copy", "selection-outline"];
2984
2993
  var fail = (message) => {
2985
- throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(message);
2994
+ throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(message);
2986
2995
  };
2987
2996
  var T = (x, y) => [1, 0, x, 0, 1, y, 0, 0, 1];
2988
2997
  function previewStep(scale) {
@@ -3091,7 +3100,7 @@ var FreeTransformSession = (_class5 = class {
3091
3100
  } else {
3092
3101
  const id = _nullishCoalesce(init.layerId, () => ( host.activeLayerId()));
3093
3102
  if (!id) fail("No layer given and none is active; pass layerId (see list_layers).");
3094
- const layer = _chunkXN2NBLV5cjs.requireLayer.call(void 0, layers, id).layer;
3103
+ const layer = _chunkPMEHFHSPcjs.requireLayer.call(void 0, layers, id).layer;
3095
3104
  this.layerId = layer.id;
3096
3105
  const mask = layer.mask && !layer.mask.source ? layer.mask : void 0;
3097
3106
  const channel = _nullishCoalesce(init.channel, () => ( (layer.id === host.activeLayerId() ? host.activeTarget() : "pixels")));
@@ -3102,20 +3111,20 @@ var FreeTransformSession = (_class5 = class {
3102
3111
  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.`);
3103
3112
  if (!layer.visible && content !== "selection-copy") fail(`Layer "${layer.name || id}" is hidden; show it before you transform it.`);
3104
3113
  if (content !== "selection-copy") {
3105
- _chunkXN2NBLV5cjs.requireUnlocked.call(void 0, layer, "position", "transform it");
3106
- if (!maskAlone) _chunkXN2NBLV5cjs.requireUnlocked.call(void 0, layer, "pixels", "transform it");
3114
+ _chunkPMEHFHSPcjs.requireUnlocked.call(void 0, layer, "position", "transform it");
3115
+ if (!maskAlone) _chunkPMEHFHSPcjs.requireUnlocked.call(void 0, layer, "pixels", "transform it");
3107
3116
  }
3108
3117
  const o = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
3109
3118
  const pixels = layer.type === "pixel" ? host.pixelsOf(layer) : null;
3110
3119
  if (layer.type === "smart" && !maskAlone) {
3111
3120
  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).`);
3112
- if (!_chunkXN2NBLV5cjs.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.`);
3121
+ if (!_chunkPMEHFHSPcjs.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.`);
3113
3122
  this.smart = layer;
3114
3123
  this.smartObject = true;
3115
- this.startGeometry = _chunkXN2NBLV5cjs.placementGeometry.call(void 0, layer);
3124
+ this.startGeometry = _chunkPMEHFHSPcjs.placementGeometry.call(void 0, layer);
3116
3125
  if (init.interpolation === void 0 && layer.placement.interpolation) this.interp = layer.placement.interpolation;
3117
3126
  this.startInterp = this.interp;
3118
- this.box = _chunkXN2NBLV5cjs.contentsBox.call(void 0, layer.contents);
3127
+ this.box = _chunkPMEHFHSPcjs.contentsBox.call(void 0, layer.contents);
3119
3128
  this.moves = mask && linked ? ["pixels", "mask"] : ["pixels"];
3120
3129
  this.geometryValue = this.startGeometry;
3121
3130
  this.shown = this.startLayers;
@@ -3123,8 +3132,8 @@ var FreeTransformSession = (_class5 = class {
3123
3132
  }
3124
3133
  if (layer.type === "type" && !maskAlone) {
3125
3134
  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).`);
3126
- const frame = _chunkXN2NBLV5cjs.typeFrame.call(void 0, layer, host.textEnv().shaper);
3127
- const m = _chunkXN2NBLV5cjs.textMatrix.call(void 0, layer);
3135
+ const frame = _chunkPMEHFHSPcjs.typeFrame.call(void 0, layer, host.textEnv().shaper);
3136
+ const m = _chunkPMEHFHSPcjs.textMatrix.call(void 0, layer);
3128
3137
  const at = (x, y) => ({ x: m[0] * x + m[2] * y + m[4], y: m[1] * x + m[3] * y + m[5] });
3129
3138
  this.typeTarget = layer;
3130
3139
  this.typeLayer = true;
@@ -3143,7 +3152,7 @@ var FreeTransformSession = (_class5 = class {
3143
3152
  }
3144
3153
  if (layer.type === "shape" && !maskAlone) {
3145
3154
  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).`);
3146
- const g = _chunkXN2NBLV5cjs.shapeGeometryBounds.call(void 0, layer);
3155
+ const g = _chunkPMEHFHSPcjs.shapeGeometryBounds.call(void 0, layer);
3147
3156
  if (!g) fail(`Shape layer "${layer.name || id}" has no path to transform.`);
3148
3157
  const w = Math.max(g.width, 1);
3149
3158
  const h = Math.max(g.height, 1);
@@ -3191,7 +3200,7 @@ var FreeTransformSession = (_class5 = class {
3191
3200
  if (box) {
3192
3201
  const copy = {
3193
3202
  type: "pixel",
3194
- id: _chunkXN2NBLV5cjs.newLayerId.call(void 0, ),
3203
+ id: _chunkPMEHFHSPcjs.newLayerId.call(void 0, ),
3195
3204
  name: `${layer.name || "Layer"} copy`,
3196
3205
  visible: true,
3197
3206
  opacity: 1,
@@ -3215,7 +3224,7 @@ var FreeTransformSession = (_class5 = class {
3215
3224
  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).");
3216
3225
  this.box = box;
3217
3226
  this.moves = moves;
3218
- this.startGeometry = _chunkXN2NBLV5cjs.identityTransform.call(void 0, box);
3227
+ this.startGeometry = _chunkPMEHFHSPcjs.identityTransform.call(void 0, box);
3219
3228
  this.startInterp = this.interp;
3220
3229
  this.geometryValue = this.startGeometry;
3221
3230
  this.shown = this.startLayers;
@@ -3293,8 +3302,8 @@ var FreeTransformSession = (_class5 = class {
3293
3302
  warp: changes.warp === void 0 ? _nullishCoalesce(this.geometryValue.warp, () => ( null)) : changes.warp
3294
3303
  };
3295
3304
  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.");
3296
- if (!_chunkXN2NBLV5cjs.transformMap.call(void 0, next)) fail("These corners fold the frame over itself or through the horizon; keep the quad convex.");
3297
- if (this.typeTarget && (_chunkXN2NBLV5cjs.hasWarp.call(void 0, next) || !_chunkXN2NBLV5cjs.matrixFromCorners.call(void 0, next.box, next.corners))) {
3305
+ if (!_chunkPMEHFHSPcjs.transformMap.call(void 0, next)) fail("These corners fold the frame over itself or through the horizon; keep the quad convex.");
3306
+ if (this.typeTarget && (_chunkPMEHFHSPcjs.hasWarp.call(void 0, next) || !_chunkPMEHFHSPcjs.matrixFromCorners.call(void 0, next.box, next.corners))) {
3298
3307
  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.");
3299
3308
  }
3300
3309
  this.geometryValue = next;
@@ -3306,10 +3315,10 @@ var FreeTransformSession = (_class5 = class {
3306
3315
  if (this.smart) return { layers: this.resampleSmart(final, preview), selection: this.startSelection };
3307
3316
  if (this.typeTarget) return { layers: this.resampleType(), selection: this.startSelection };
3308
3317
  const g = this.geometryValue;
3309
- const identity = _chunkXN2NBLV5cjs.isIdentityTransform.call(void 0, g);
3310
- const warp = _chunkXN2NBLV5cjs.hasWarp.call(void 0, g);
3311
- const h = warp ? null : _chunkXN2NBLV5cjs.geometryHomography.call(void 0, g);
3312
- const f = warp ? _chunkXN2NBLV5cjs.transformMap.call(void 0, g) : null;
3318
+ const identity = _chunkPMEHFHSPcjs.isIdentityTransform.call(void 0, g);
3319
+ const warp = _chunkPMEHFHSPcjs.hasWarp.call(void 0, g);
3320
+ const h = warp ? null : _chunkPMEHFHSPcjs.geometryHomography.call(void 0, g);
3321
+ const f = warp ? _chunkPMEHFHSPcjs.transformMap.call(void 0, g) : null;
3313
3322
  const step = final ? 1 : previewStep(preview.scale);
3314
3323
  const interpolation = final ? this.interp : this.interp === "nearest" ? "nearest" : "bilinear";
3315
3324
  let layers = this.startLayers;
@@ -3353,7 +3362,7 @@ var FreeTransformSession = (_class5 = class {
3353
3362
  if (part.what === "selection") {
3354
3363
  const { width, height } = this.host.canvas();
3355
3364
  const data = new Uint8Array(_chunkO7LUD7MHcjs.readRegion.call(void 0, result, { x: 0, y: 0, width, height }).buffer);
3356
- const next = _chunkXN2NBLV5cjs.createSelectionMask.call(void 0, width, height, data);
3365
+ const next = _chunkPMEHFHSPcjs.createSelectionMask.call(void 0, width, height, data);
3357
3366
  selection = next.bounds ? next : null;
3358
3367
  } else if (part.what === "pixels") {
3359
3368
  layers = _chunkAEAAN4ADcjs.mapLayer.call(void 0, layers, targetId, (l) => {
@@ -3375,14 +3384,14 @@ var FreeTransformSession = (_class5 = class {
3375
3384
  resampleShape(final, preview, warpMap, h) {
3376
3385
  const layer = this.shape;
3377
3386
  let components = layer.components;
3378
- if (!_chunkXN2NBLV5cjs.isIdentityTransform.call(void 0, this.geometryValue)) {
3387
+ if (!_chunkPMEHFHSPcjs.isIdentityTransform.call(void 0, this.geometryValue)) {
3379
3388
  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;
3380
3389
  const map = _nullishCoalesce(warpMap, () => ( ((p) => h ? _chunkMUUXNRU4cjs.applyHomography.call(void 0, h, p) : p)));
3381
- components = _chunkXN2NBLV5cjs.transformShapeComponents.call(void 0, layer.components, (p) => _nullishCoalesce(map(p), () => ( p)), affine);
3390
+ components = _chunkPMEHFHSPcjs.transformShapeComponents.call(void 0, layer.components, (p) => _nullishCoalesce(map(p), () => ( p)), affine);
3382
3391
  }
3383
3392
  const moved = { ...layer, components };
3384
3393
  delete moved.annotation;
3385
- const surface = _chunkXN2NBLV5cjs.renderShape.call(void 0, moved, this.host.shapeEnv(), final ? {} : { clip: preview.clip });
3394
+ const surface = _chunkPMEHFHSPcjs.renderShape.call(void 0, moved, this.host.shapeEnv(), final ? {} : { clip: preview.clip });
3386
3395
  return _chunkAEAAN4ADcjs.mapLayer.call(void 0, this.startLayers, layer.id, () => ({ ...moved, surface }));
3387
3396
  }
3388
3397
  /**
@@ -3392,13 +3401,13 @@ var FreeTransformSession = (_class5 = class {
3392
3401
  resampleType() {
3393
3402
  const layer = this.typeTarget;
3394
3403
  const g = this.geometryValue;
3395
- if (_chunkXN2NBLV5cjs.hasWarp.call(void 0, g)) fail("Type layers cannot be warped here; rasterize the layer first (rasterize_layer), or transform it with scale, rotate and skew.");
3396
- const m = _chunkXN2NBLV5cjs.matrixFromCorners.call(void 0, g.box, g.corners);
3404
+ if (_chunkPMEHFHSPcjs.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.");
3405
+ const m = _chunkPMEHFHSPcjs.matrixFromCorners.call(void 0, g.box, g.corners);
3397
3406
  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.");
3398
3407
  const next = { ...layer, transform: m };
3399
3408
  delete next.annotation;
3400
- let layers = _chunkAEAAN4ADcjs.mapLayer.call(void 0, this.startLayers, layer.id, () => _chunkXN2NBLV5cjs.rerenderText.call(void 0, next, this.host.textEnv()));
3401
- const change = _chunkMUUXNRU4cjs.multiplyHomographies.call(void 0, _chunkMUUXNRU4cjs.homographyFromAffine.call(void 0, _chunk5OOIUXNJcjs.invertMatrix.call(void 0, _chunkXN2NBLV5cjs.textMatrix.call(void 0, layer))), _chunkMUUXNRU4cjs.homographyFromAffine.call(void 0, m));
3409
+ let layers = _chunkAEAAN4ADcjs.mapLayer.call(void 0, this.startLayers, layer.id, () => _chunkPMEHFHSPcjs.rerenderText.call(void 0, next, this.host.textEnv()));
3410
+ const change = _chunkMUUXNRU4cjs.multiplyHomographies.call(void 0, _chunkMUUXNRU4cjs.homographyFromAffine.call(void 0, _chunkXFXHA5MUcjs.invertMatrix.call(void 0, _chunkPMEHFHSPcjs.textMatrix.call(void 0, layer))), _chunkMUUXNRU4cjs.homographyFromAffine.call(void 0, m));
3402
3411
  for (const part of this.parts) {
3403
3412
  if (part.what !== "mask") continue;
3404
3413
  const surface = _chunkAEAAN4ADcjs.transformSurface.call(void 0, part.moving, change, { interpolation: this.interp === "nearest" ? "nearest" : "bilinear" });
@@ -3414,12 +3423,12 @@ var FreeTransformSession = (_class5 = class {
3414
3423
  const canvas = this.host.canvas();
3415
3424
  try {
3416
3425
  if (final) {
3417
- const res = _chunkXN2NBLV5cjs.setSmartPlacement.call(void 0, this.startLayers, layer.id, placement, canvas);
3426
+ const res = _chunkPMEHFHSPcjs.setSmartPlacement.call(void 0, this.startLayers, layer.id, placement, canvas);
3418
3427
  this.smartMasksMoved = res.masksMoved;
3419
3428
  return res.layers;
3420
3429
  }
3421
3430
  const step = previewStep(preview.scale);
3422
- const surface = _chunkXN2NBLV5cjs.renderSmartObject.call(void 0, { ...layer, placement }, canvas, { step, clip: preview.clip, skipFilters: true, reduced: this.smartReduced });
3431
+ const surface = _chunkPMEHFHSPcjs.renderSmartObject.call(void 0, { ...layer, placement }, canvas, { step, clip: preview.clip, skipFilters: true, reduced: this.smartReduced });
3423
3432
  return _chunkAEAAN4ADcjs.mapLayer.call(void 0, this.startLayers, layer.id, (l) => ({ ...l, placement, surface }));
3424
3433
  } catch (e) {
3425
3434
  if (e instanceof _chunkAEAAN4ADcjs.TransformTooLargeError) fail(e.message);
@@ -3429,10 +3438,10 @@ var FreeTransformSession = (_class5 = class {
3429
3438
  /** Whether the geometry (or the interpolation of a smart object) differs from where it started. */
3430
3439
  isChanged() {
3431
3440
  const g = this.geometryValue;
3432
- if (!this.smart && !this.typeTarget) return !_chunkXN2NBLV5cjs.isIdentityTransform.call(void 0, g);
3441
+ if (!this.smart && !this.typeTarget) return !_chunkPMEHFHSPcjs.isIdentityTransform.call(void 0, g);
3433
3442
  const a = this.startGeometry;
3434
3443
  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);
3435
- const warp = (w, box) => w && _chunkXN2NBLV5cjs.hasWarp.call(void 0, { box, corners: a.corners, warp: w }) ? JSON.stringify(w) : "";
3444
+ const warp = (w, box) => w && _chunkPMEHFHSPcjs.hasWarp.call(void 0, { box, corners: a.corners, warp: w }) ? JSON.stringify(w) : "";
3436
3445
  return !same || warp(g.warp, g.box) !== warp(a.warp, a.box) || this.interp !== this.startInterp;
3437
3446
  }
3438
3447
  render(preview) {
@@ -3692,7 +3701,7 @@ function convertSurfaceColors(surface, t) {
3692
3701
  }
3693
3702
 
3694
3703
  // src/image-editor/controller.ts
3695
- var IMAGE_EDITOR_SCHEMA_VERSION = _chunkXN2NBLV5cjs.LAYERED_SCHEMA_VERSION;
3704
+ var IMAGE_EDITOR_SCHEMA_VERSION = _chunkPMEHFHSPcjs.LAYERED_SCHEMA_VERSION;
3696
3705
  var RETOUCH_TOOLS = ["clone", "heal", "spot-heal", "smudge", "dodge", "burn", "sponge", "blur", "sharpen", "history"];
3697
3706
  var isRetouchTool = (tool) => RETOUCH_TOOLS.includes(tool);
3698
3707
  var STROKE_TOOLS = ["brush", "eraser", "mixer", ...RETOUCH_TOOLS];
@@ -3706,14 +3715,14 @@ function paintCoverageInto(base, coverage, apply, rects, depth = null) {
3706
3715
  done.add(key);
3707
3716
  if (depth) {
3708
3717
  const ch = base.channels;
3709
- const d = _chunkQBWEH3IMcjs.applyStrokeToDeepTile.call(void 0, coverage, _chunkO7LUD7MHcjs.tileSamples.call(void 0, base.tiles.get(key), ch, depth, base.defaultValue), t.tx, t.ty, apply, { channels: ch });
3718
+ const d = _chunk3T5O225Tcjs.applyStrokeToDeepTile.call(void 0, coverage, _chunkO7LUD7MHcjs.tileSamples.call(void 0, base.tiles.get(key), ch, depth, base.defaultValue), t.tx, t.ty, apply, { channels: ch });
3710
3719
  const tile2 = _chunkO7LUD7MHcjs.deepTile.call(void 0, d, ch, base.defaultValue);
3711
3720
  if (tile2) tiles.set(key, tile2);
3712
3721
  else tiles.delete(key);
3713
3722
  continue;
3714
3723
  }
3715
3724
  const src = _nullishCoalesce(_optionalChain([base, 'access', _77 => _77.tiles, 'access', _78 => _78.get, 'call', _79 => _79(key), 'optionalAccess', _80 => _80.data]), () => ( defaultTile(base)));
3716
- const data = _chunkQBWEH3IMcjs.applyStrokeToTile.call(void 0, coverage, src, base.channels, t.tx, t.ty, apply);
3725
+ const data = _chunk3T5O225Tcjs.applyStrokeToTile.call(void 0, coverage, src, base.channels, t.tx, t.ty, apply);
3717
3726
  const tile = _chunkO7LUD7MHcjs.finishTile.call(void 0, data, base.channels, base.defaultValue);
3718
3727
  if (tile) tiles.set(key, tile);
3719
3728
  else tiles.delete(key);
@@ -3731,13 +3740,13 @@ var PaintStrokeSession = (_class6 = class {
3731
3740
  this.controller = controller;
3732
3741
  this.target = target;
3733
3742
  this.apply = apply;
3734
- const coverage = stroke instanceof _chunkQBWEH3IMcjs.StrokeCoverage || "kind" in stroke && stroke.kind === "coverage";
3735
- this.deep = depth && coverage && (target.surface.channels === 4 || stroke instanceof _chunkQBWEH3IMcjs.StrokeCoverage) ? depth : null;
3743
+ const coverage = stroke instanceof _chunk3T5O225Tcjs.StrokeCoverage || "kind" in stroke && stroke.kind === "coverage";
3744
+ this.deep = depth && coverage && (target.surface.channels === 4 || stroke instanceof _chunk3T5O225Tcjs.StrokeCoverage) ? depth : null;
3736
3745
  this.dabDeep = depth && !coverage && target.surface.channels === 4 ? depth : null;
3737
3746
  this.before = controller._captureForStroke();
3738
3747
  this.base = target.surface;
3739
3748
  this.live = new Map(this.base.tiles);
3740
- if (stroke instanceof _chunkQBWEH3IMcjs.StrokeCoverage) {
3749
+ if (stroke instanceof _chunk3T5O225Tcjs.StrokeCoverage) {
3741
3750
  this.stroke = stroke;
3742
3751
  this.mixer = null;
3743
3752
  } else if ("kind" in stroke && stroke.kind === "coverage") {
@@ -3748,7 +3757,7 @@ var PaintStrokeSession = (_class6 = class {
3748
3757
  this.stroke = null;
3749
3758
  this.retouch = stroke;
3750
3759
  if (this.base.channels === 1) {
3751
- const view = _chunkTLCTTQFFcjs.rgbaViewOfGrey.call(void 0, this.mixerPixels());
3760
+ const view = _chunkVEHVXRJUcjs.rgbaViewOfGrey.call(void 0, this.mixerPixels());
3752
3761
  this.mixer = stroke.create(view.target);
3753
3762
  this.flushView = view.flush;
3754
3763
  } else this.mixer = stroke.create(this.mixerPixels());
@@ -3795,7 +3804,7 @@ var PaintStrokeSession = (_class6 = class {
3795
3804
  retouchDeepTile(key, tx, ty, paint, options) {
3796
3805
  const r = this.retouch;
3797
3806
  const read = this.readWork(key);
3798
- const out = _chunkTLCTTQFFcjs.applyRetouchToTile.call(void 0, this.stroke.coverage, _nullishCoalesce(read, () => ( new Float32Array(_chunkO7LUD7MHcjs.TILE * _chunkO7LUD7MHcjs.TILE * 4))), 4, tx, ty, paint, r.apply, options);
3807
+ const out = _chunkVEHVXRJUcjs.applyRetouchToTile.call(void 0, this.stroke.coverage, _nullishCoalesce(read, () => ( new Float32Array(_chunkO7LUD7MHcjs.TILE * _chunkO7LUD7MHcjs.TILE * 4))), 4, tx, ty, paint, r.apply, options);
3799
3808
  this.work.set(key, out);
3800
3809
  const d = deepOfWorkTile(out, this.deep, read, this.base.tiles.get(key));
3801
3810
  this.liveDeep.set(key, d);
@@ -3805,8 +3814,8 @@ var PaintStrokeSession = (_class6 = class {
3805
3814
  /** The new tile of a coverage stroke over the pre-stroke tile `src`. */
3806
3815
  compositeTile(src, tx, ty, options = {}, paint) {
3807
3816
  const r = this.retouch;
3808
- if (r && r.kind === "coverage") return _chunkTLCTTQFFcjs.applyRetouchToTile.call(void 0, this.stroke.coverage, src, this.base.channels, tx, ty, _nullishCoalesce(paint, () => ( r.paint())), r.apply, options);
3809
- return _chunkQBWEH3IMcjs.applyStrokeToTile.call(void 0, this.stroke.coverage, src, this.base.channels, tx, ty, this.apply, options);
3817
+ if (r && r.kind === "coverage") return _chunkVEHVXRJUcjs.applyRetouchToTile.call(void 0, this.stroke.coverage, src, this.base.channels, tx, ty, _nullishCoalesce(paint, () => ( r.paint())), r.apply, options);
3818
+ return _chunk3T5O225Tcjs.applyStrokeToTile.call(void 0, this.stroke.coverage, src, this.base.channels, tx, ty, this.apply, options);
3810
3819
  }
3811
3820
  /** The live pixels a mixer stroke reads and writes; base tiles are copied on first write. */
3812
3821
  mixerPixels() {
@@ -3886,7 +3895,7 @@ var PaintStrokeSession = (_class6 = class {
3886
3895
  for (const t of _chunkO7LUD7MHcjs.tilesInRect.call(void 0, { x: r.x - this.apply.offset.x, y: r.y - this.apply.offset.y, width: r.width, height: r.height })) {
3887
3896
  const key = _chunkO7LUD7MHcjs.tileKey.call(void 0, t.tx, t.ty);
3888
3897
  const cur = regions.get(key);
3889
- regions.set(key, { tx: t.tx, ty: t.ty, r: cur ? _chunkXN2NBLV5cjs.unionRect.call(void 0, cur.r, r) : r });
3898
+ regions.set(key, { tx: t.tx, ty: t.ty, r: cur ? _chunkPMEHFHSPcjs.unionRect.call(void 0, cur.r, r) : r });
3890
3899
  }
3891
3900
  }
3892
3901
  for (const [key, { tx, ty, r }] of regions) {
@@ -3903,7 +3912,7 @@ var PaintStrokeSession = (_class6 = class {
3903
3912
  const prev2 = this.touched.has(key) ? this.liveDeep.get(key) : void 0;
3904
3913
  this.touched.add(key);
3905
3914
  const opts = prev2 ? { into: prev2, region: r, channels: ch } : { channels: ch };
3906
- const d = _optionalChain([rt, 'optionalAccess', _98 => _98.kind]) === "coverage" && _optionalChain([paint, 'optionalAccess', _99 => _99.kind]) === "tone" ? _chunkTLCTTQFFcjs.applyToneToDeepTile.call(void 0, stroke.coverage, src2, tx, ty, paint.tone, rt.apply, opts) : _chunkQBWEH3IMcjs.applyStrokeToDeepTile.call(void 0, stroke.coverage, src2, tx, ty, this.apply, opts);
3915
+ const d = _optionalChain([rt, 'optionalAccess', _98 => _98.kind]) === "coverage" && _optionalChain([paint, 'optionalAccess', _99 => _99.kind]) === "tone" ? _chunkVEHVXRJUcjs.applyToneToDeepTile.call(void 0, stroke.coverage, src2, tx, ty, paint.tone, rt.apply, opts) : _chunk3T5O225Tcjs.applyStrokeToDeepTile.call(void 0, stroke.coverage, src2, tx, ty, this.apply, opts);
3907
3916
  this.liveDeep.set(key, d);
3908
3917
  this.live.set(key, { data: _chunkO7LUD7MHcjs.proxyOf.call(void 0, d, ch), uniform: null, deep: d });
3909
3918
  continue;
@@ -3918,7 +3927,7 @@ var PaintStrokeSession = (_class6 = class {
3918
3927
  }
3919
3928
  /** Finishes the stroke (one undo step) and returns what changed. */
3920
3929
  end() {
3921
- if (this.closed) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("This stroke has already ended.");
3930
+ if (this.closed) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("This stroke has already ended.");
3922
3931
  const last = _nullishCoalesce(this.last, () => ( void 0));
3923
3932
  const rects = this.mixer ? this.mixer.finish(last) : this.stroke.finish(last);
3924
3933
  _optionalChain([this, 'access', _109 => _109.flushView, 'optionalCall', _110 => _110()]);
@@ -4054,20 +4063,20 @@ function sameTile(a, b) {
4054
4063
  for (let i = 0; i < a.data.length; i++) if (a.data[i] !== b.data[i]) return false;
4055
4064
  return true;
4056
4065
  }
4057
- var DEFAULT_ADJUSTMENTS = _chunkXN2NBLV5cjs.DEFAULT_ADJUSTMENTS_VALUES;
4066
+ var DEFAULT_ADJUSTMENTS = _chunkPMEHFHSPcjs.DEFAULT_ADJUSTMENTS_VALUES;
4058
4067
  function normalizeStoredAdjustments(stored) {
4059
4068
  if (!stored) return { ...DEFAULT_ADJUSTMENTS };
4060
4069
  const out = {
4061
4070
  ...DEFAULT_ADJUSTMENTS,
4062
4071
  ...stored,
4063
- process: _chunkXN2NBLV5cjs.normalizeProcessVersion.call(void 0, stored.process)
4072
+ process: _chunkPMEHFHSPcjs.normalizeProcessVersion.call(void 0, stored.process)
4064
4073
  };
4065
- const layers = _chunkXN2NBLV5cjs.normalizeAdjustmentLayers.call(void 0, stored.layers);
4074
+ const layers = _chunkPMEHFHSPcjs.normalizeAdjustmentLayers.call(void 0, stored.layers);
4066
4075
  if (layers.length) out.layers = layers;
4067
4076
  else delete out.layers;
4068
4077
  return out;
4069
4078
  }
4070
- var isLayered = (data) => Boolean(data && data.version === _chunkXN2NBLV5cjs.LAYERED_SCHEMA_VERSION && Array.isArray(data.layers));
4079
+ var isLayered = (data) => Boolean(data && data.version === _chunkPMEHFHSPcjs.LAYERED_SCHEMA_VERSION && Array.isArray(data.layers));
4071
4080
  function migrateSerializedImageEditorState(data) {
4072
4081
  if (isLayered(data)) {
4073
4082
  const out = {
@@ -4099,10 +4108,10 @@ function migrateSerializedImageEditorState(data) {
4099
4108
  function migrateToLayeredState(data, size) {
4100
4109
  const clean = migrateSerializedImageEditorState(data);
4101
4110
  if (isLayered(clean)) return clean;
4102
- const stack = _chunkXN2NBLV5cjs.layersFromLegacy.call(void 0, clean, Math.round(size.width), Math.round(size.height));
4103
- const { layers, assets } = _chunkXN2NBLV5cjs.serializeLayers.call(void 0, stack.layers);
4111
+ const stack = _chunkPMEHFHSPcjs.layersFromLegacy.call(void 0, clean, Math.round(size.width), Math.round(size.height));
4112
+ const { layers, assets } = _chunkPMEHFHSPcjs.serializeLayers.call(void 0, stack.layers);
4104
4113
  const out = {
4105
- version: _chunkXN2NBLV5cjs.LAYERED_SCHEMA_VERSION,
4114
+ version: _chunkPMEHFHSPcjs.LAYERED_SCHEMA_VERSION,
4106
4115
  width: Math.round(size.width),
4107
4116
  height: Math.round(size.height),
4108
4117
  layers,
@@ -4116,8 +4125,8 @@ function migrateToLayeredState(data, size) {
4116
4125
  if (clean.selection) out.selection = clean.selection;
4117
4126
  return out;
4118
4127
  }
4119
- var DEFAULT_TRANSFORM = _chunkXN2NBLV5cjs.DEFAULT_TRANSFORM_VALUES;
4120
- var DEFAULT_DEPTH_MASK = _chunkXN2NBLV5cjs.DEFAULT_DEPTH_MASK_VALUES;
4128
+ var DEFAULT_TRANSFORM = _chunkPMEHFHSPcjs.DEFAULT_TRANSFORM_VALUES;
4129
+ var DEFAULT_DEPTH_MASK = _chunkPMEHFHSPcjs.DEFAULT_DEPTH_MASK_VALUES;
4121
4130
  var DEVELOP_KEYS = ["brightness", "contrast", "saturation", "exposure", "temperature", "tint"];
4122
4131
  var ImageEditorController = (_class7 = class {
4123
4132
 
@@ -4140,7 +4149,7 @@ var ImageEditorController = (_class7 = class {
4140
4149
  __init62() {this.sourceSurfaces = /* @__PURE__ */ new WeakMap()}
4141
4150
  __init63() {this.viewKey = []}
4142
4151
  /** For `compositePixels` and mask evaluation (the renderer keeps its own for the viewport). */
4143
- __init64() {this.compositor = new (0, _chunkXN2NBLV5cjs.LayerCompositor)()}
4152
+ __init64() {this.compositor = new (0, _chunkPMEHFHSPcjs.LayerCompositor)()}
4144
4153
  /** The effects provider slot (see `setEffectsProvider`). */
4145
4154
  __init65() {this.effects = new (0, _chunkJODTP4DPcjs.EffectsSlot)()}
4146
4155
  /** Renders provider effects: effect smart filter results and effect layers. */
@@ -4184,7 +4193,7 @@ var ImageEditorController = (_class7 = class {
4184
4193
  activeLayerId: null,
4185
4194
  activeTarget: "pixels",
4186
4195
  outputOpacity: 1,
4187
- paint: { brush: { ..._chunkQBWEH3IMcjs.DEFAULT_BRUSH }, foreground: "#000000", background: "#ffffff", paint: { type: "color", color: "#000000" }, mixer: { ..._chunkQBWEH3IMcjs.DEFAULT_MIXER }, mixerLoad: _chunkQBWEH3IMcjs.EMPTY_MIXER_LOAD, retouch: { ..._chunkTLCTTQFFcjs.DEFAULT_RETOUCH }, cloneSource: null, cloneTransform: { ..._chunkTLCTTQFFcjs.IDENTITY_CLONE_TRANSFORM } },
4196
+ paint: { brush: { ..._chunk3T5O225Tcjs.DEFAULT_BRUSH }, foreground: "#000000", background: "#ffffff", paint: { type: "color", color: "#000000" }, mixer: { ..._chunk3T5O225Tcjs.DEFAULT_MIXER }, mixerLoad: _chunk3T5O225Tcjs.EMPTY_MIXER_LOAD, retouch: { ..._chunkVEHVXRJUcjs.DEFAULT_RETOUCH }, cloneSource: null, cloneTransform: { ..._chunkVEHVXRJUcjs.IDENTITY_CLONE_TRANSFORM } },
4188
4197
  fit: _nullishCoalesce(options.fit, () => ( "margin"))
4189
4198
  };
4190
4199
  if (options.image instanceof Object && "width" in options.image) {
@@ -4198,7 +4207,7 @@ var ImageEditorController = (_class7 = class {
4198
4207
  this.applyStored(_nullishCoalesce(options.initialState, () => ( {})));
4199
4208
  if (_optionalChain([options, 'access', _126 => _126.initialState, 'optionalAccess', _127 => _127.selection])) {
4200
4209
  try {
4201
- this.state.selection = normalizeSelection(_chunkXN2NBLV5cjs.deserializeSelection.call(void 0, options.initialState.selection));
4210
+ this.state.selection = normalizeSelection(_chunkPMEHFHSPcjs.deserializeSelection.call(void 0, options.initialState.selection));
4202
4211
  } catch (e15) {
4203
4212
  }
4204
4213
  }
@@ -4310,10 +4319,10 @@ var ImageEditorController = (_class7 = class {
4310
4319
  if (l.type === "group") {
4311
4320
  const children = walk(l.children);
4312
4321
  if (children !== l.children) next2 = { ...l, children };
4313
- } else if (l.type === "smart" && _optionalChain([l, 'access', _130 => _130.smartFilters, 'optionalAccess', _131 => _131.filters, 'access', _132 => _132.some, 'call', _133 => _133((f) => f.kind === "effect")]) && (all || _chunkXN2NBLV5cjs.isSmartSurfaceIncomplete.call(void 0, l.surface))) {
4322
+ } else if (l.type === "smart" && _optionalChain([l, 'access', _130 => _130.smartFilters, 'optionalAccess', _131 => _131.filters, 'access', _132 => _132.some, 'call', _133 => _133((f) => f.kind === "effect")]) && (all || _chunkPMEHFHSPcjs.isSmartSurfaceIncomplete.call(void 0, l.surface))) {
4314
4323
  try {
4315
- const r = _chunkXN2NBLV5cjs.rerender.call(void 0, l, canvas);
4316
- if (all || !_chunkXN2NBLV5cjs.isSmartSurfaceIncomplete.call(void 0, r.surface)) next2 = r;
4324
+ const r = _chunkPMEHFHSPcjs.rerender.call(void 0, l, canvas);
4325
+ if (all || !_chunkPMEHFHSPcjs.isSmartSurfaceIncomplete.call(void 0, r.surface)) next2 = r;
4317
4326
  } catch (e17) {
4318
4327
  }
4319
4328
  }
@@ -4369,19 +4378,19 @@ var ImageEditorController = (_class7 = class {
4369
4378
  const d = await this.describeEffect(effect, "filter");
4370
4379
  const values = _chunkJODTP4DPcjs.resolveEffectValues.call(void 0, d, options.values);
4371
4380
  const found = _chunkAEAAN4ADcjs.findLayer.call(void 0, this.state.layers, layerId);
4372
- if (!found) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`There is no layer "${layerId}"; call list_layers for the layer ids.`);
4381
+ if (!found) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`There is no layer "${layerId}"; call list_layers for the layer ids.`);
4373
4382
  let layers = this.state.layers;
4374
4383
  let id = layerId;
4375
4384
  let converted = false;
4376
4385
  if (found.layer.type !== "smart") {
4377
- if (found.layer.type === "adjustment" || found.layer.type === "annotation") throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`Layer "${found.layer.name || layerId}" is ${found.layer.type === "adjustment" ? "an adjustment layer" : "an annotation"}, which has no pixels to filter; apply the effect to a pixel layer or smart object.`);
4378
- const res2 = _chunkXN2NBLV5cjs.convertToSmartObject.call(void 0, layers, [layerId], this.canvasSize, { surfaceOf: (l) => this.surfaceOf(l) });
4386
+ if (found.layer.type === "adjustment" || found.layer.type === "annotation") throw new (0, _chunkPMEHFHSPcjs.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.`);
4387
+ const res2 = _chunkPMEHFHSPcjs.convertToSmartObject.call(void 0, layers, [layerId], this.canvasSize, { surfaceOf: (l) => this.surfaceOf(l) });
4379
4388
  layers = res2.layers;
4380
4389
  id = res2.layer.id;
4381
4390
  converted = true;
4382
4391
  }
4383
- const filter = _chunkXN2NBLV5cjs.normalizeSmartFilter.call(void 0, { kind: "effect", effect: d.id, provider: this.effects.require().id, name: d.name, values, enabled: options.enabled !== false, blend: options.blend, opacity: options.opacity });
4384
- const res = _chunkXN2NBLV5cjs.addSmartFilter.call(void 0, layers, id, filter, this.canvasSize, options.index);
4392
+ const filter = _chunkPMEHFHSPcjs.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 });
4393
+ const res = _chunkPMEHFHSPcjs.addSmartFilter.call(void 0, layers, id, filter, this.canvasSize, options.index);
4385
4394
  this.commitLayers(res.layers);
4386
4395
  return { layerId: id, filter: res.filter, converted };
4387
4396
  }
@@ -4392,9 +4401,9 @@ var ImageEditorController = (_class7 = class {
4392
4401
  * false, during a drag).
4393
4402
  */
4394
4403
  async updateEffectFilter(layerId, filterId, changes, commitToHistory = true) {
4395
- const layer = _chunkXN2NBLV5cjs.requireSmartObject.call(void 0, this.state.layers, layerId);
4404
+ const layer = _chunkPMEHFHSPcjs.requireSmartObject.call(void 0, this.state.layers, layerId);
4396
4405
  const was = _optionalChain([layer, 'access', _134 => _134.smartFilters, 'optionalAccess', _135 => _135.filters, 'access', _136 => _136.find, 'call', _137 => _137((f) => f.id === filterId)]);
4397
- if (!was || was.kind !== "effect") throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`Smart object "${layer.name || layerId}" has no effect filter "${filterId}"; its filters are ${(_nullishCoalesce(_optionalChain([layer, 'access', _138 => _138.smartFilters, 'optionalAccess', _139 => _139.filters]), () => ( []))).map((f) => `${f.id} (${f.kind === "effect" ? _nullishCoalesce(f.name, () => ( f.effect)) : f.kind})`).join(", ") || "none"}.`);
4406
+ if (!was || was.kind !== "effect") throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Smart object "${layer.name || layerId}" has no effect filter "${filterId}"; its filters are ${(_nullishCoalesce(_optionalChain([layer, 'access', _138 => _138.smartFilters, 'optionalAccess', _139 => _139.filters]), () => ( []))).map((f) => `${f.id} (${f.kind === "effect" ? _nullishCoalesce(f.name, () => ( f.effect)) : f.kind})`).join(", ") || "none"}.`);
4398
4407
  const update = {};
4399
4408
  if (changes.values) {
4400
4409
  const d = await this.describeEffect(was.effect);
@@ -4403,15 +4412,15 @@ var ImageEditorController = (_class7 = class {
4403
4412
  for (const [k, v] of Object.entries(changes.values)) {
4404
4413
  if (v !== null) given[k] = v;
4405
4414
  else if (k in d.controls.properties) base[k] = d.defaults[k];
4406
- else throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`"${k}" is not a control of "${d.id}"; its controls are ${Object.keys(d.controls.properties).join(", ")}.`);
4415
+ else throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`"${k}" is not a control of "${d.id}"; its controls are ${Object.keys(d.controls.properties).join(", ")}.`);
4407
4416
  }
4408
4417
  update.values = { ...base, ..._chunkJODTP4DPcjs.resolveEffectValues.call(void 0, { ...d, defaults: base }, given) };
4409
4418
  }
4410
4419
  for (const k of ["enabled", "blend", "opacity"]) if (changes[k] !== void 0) update[k] = changes[k];
4411
- let res = _chunkXN2NBLV5cjs.updateSmartFilter.call(void 0, this.state.layers, layerId, filterId, update, this.canvasSize);
4412
- if (changes.index !== void 0) res = { ...res, layers: _chunkXN2NBLV5cjs.moveSmartFilter.call(void 0, res.layers, layerId, filterId, changes.index, this.canvasSize).layers };
4420
+ let res = _chunkPMEHFHSPcjs.updateSmartFilter.call(void 0, this.state.layers, layerId, filterId, update, this.canvasSize);
4421
+ if (changes.index !== void 0) res = { ...res, layers: _chunkPMEHFHSPcjs.moveSmartFilter.call(void 0, res.layers, layerId, filterId, changes.index, this.canvasSize).layers };
4413
4422
  this.commitLayers(res.layers, void 0, commitToHistory);
4414
- return _chunkXN2NBLV5cjs.requireSmartObject.call(void 0, this.state.layers, layerId).smartFilters.filters.find((f) => f.id === filterId);
4423
+ return _chunkPMEHFHSPcjs.requireSmartObject.call(void 0, this.state.layers, layerId).smartFilters.filters.find((f) => f.id === filterId);
4415
4424
  }
4416
4425
  /**
4417
4426
  * Adds an effect layer: a pixel layer drawn by a provider generator, overlay or title effect at
@@ -4423,12 +4432,12 @@ var ImageEditorController = (_class7 = class {
4423
4432
  const values = _chunkJODTP4DPcjs.resolveEffectValues.call(void 0, d, options.values);
4424
4433
  const { width, height } = this.naturalSize;
4425
4434
  const pixels = await this.effectsEngine.renderLayer(d.id, values, { width, height, depth: this.bitDepth, time: options.time });
4426
- const blend = _chunkXN2NBLV5cjs.parseBlend.call(void 0, options.blend);
4427
- if (options.opacity !== void 0 && !(options.opacity >= 0 && options.opacity <= 1)) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("opacity must be from 0 to 1.");
4435
+ const blend = _chunkPMEHFHSPcjs.parseBlend.call(void 0, options.blend);
4436
+ if (options.opacity !== void 0 && !(options.opacity >= 0 && options.opacity <= 1)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("opacity must be from 0 to 1.");
4428
4437
  const ids = new Set(_chunkAEAAN4ADcjs.flattenLayers.call(void 0, this.state.layers).map((l) => l.id));
4429
4438
  const layer = {
4430
4439
  type: "pixel",
4431
- id: options.id && !ids.has(options.id) ? options.id : _chunkXN2NBLV5cjs.newLayerId.call(void 0, ),
4440
+ id: options.id && !ids.has(options.id) ? options.id : _chunkPMEHFHSPcjs.newLayerId.call(void 0, ),
4432
4441
  name: _optionalChain([options, 'access', _140 => _140.name, 'optionalAccess', _141 => _141.trim, 'call', _142 => _142()]) || d.name,
4433
4442
  visible: true,
4434
4443
  opacity: _nullishCoalesce(options.opacity, () => ( 1)),
@@ -4437,7 +4446,7 @@ var ImageEditorController = (_class7 = class {
4437
4446
  offset: { x: 0, y: 0 },
4438
4447
  generator: { effect: d.id, provider: this.effects.require().id, name: d.name, values, ...options.time ? { time: options.time } : {} }
4439
4448
  };
4440
- const next = _chunkXN2NBLV5cjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(options));
4449
+ const next = _chunkPMEHFHSPcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(options));
4441
4450
  this.commitLayers(next, () => {
4442
4451
  this.state.activeLayerId = layer.id;
4443
4452
  this.state.activeTarget = "pixels";
@@ -4452,8 +4461,8 @@ var ImageEditorController = (_class7 = class {
4452
4461
  async updateEffectLayer(layerId, changes, commitToHistory = true) {
4453
4462
  const found = _chunkAEAAN4ADcjs.findLayer.call(void 0, this.state.layers, layerId);
4454
4463
  const layer = _optionalChain([found, 'optionalAccess', _143 => _143.layer]);
4455
- if (!layer || layer.type !== "pixel" || !layer.generator) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`"${layerId}" is not an effect layer; add one with add_effect_layer.`);
4456
- _chunkXN2NBLV5cjs.requireUnlocked.call(void 0, layer, "pixels", "draw its effect again");
4464
+ if (!layer || layer.type !== "pixel" || !layer.generator) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`"${layerId}" is not an effect layer; add one with add_effect_layer.`);
4465
+ _chunkPMEHFHSPcjs.requireUnlocked.call(void 0, layer, "pixels", "draw its effect again");
4457
4466
  const g = layer.generator;
4458
4467
  const d = await this.describeEffect(g.effect);
4459
4468
  const base = { ...g.values };
@@ -4461,7 +4470,7 @@ var ImageEditorController = (_class7 = class {
4461
4470
  for (const [k, v] of Object.entries(_nullishCoalesce(changes.values, () => ( {})))) {
4462
4471
  if (v !== null) given[k] = v;
4463
4472
  else if (k in d.controls.properties) base[k] = d.defaults[k];
4464
- else throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`"${k}" is not a control of "${d.id}"; its controls are ${Object.keys(d.controls.properties).join(", ")}.`);
4473
+ else throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`"${k}" is not a control of "${d.id}"; its controls are ${Object.keys(d.controls.properties).join(", ")}.`);
4465
4474
  }
4466
4475
  const values = { ...base, ..._chunkJODTP4DPcjs.resolveEffectValues.call(void 0, { ...d, defaults: base }, given) };
4467
4476
  const time = _nullishCoalesce(_nullishCoalesce(changes.time, () => ( g.time)), () => ( 0));
@@ -4476,7 +4485,7 @@ var ImageEditorController = (_class7 = class {
4476
4485
  /** Turns an effect layer into a plain pixel layer keeping its pixels (one undo step). */
4477
4486
  rasterizeEffectLayer(layerId) {
4478
4487
  const found = _chunkAEAAN4ADcjs.findLayer.call(void 0, this.state.layers, layerId);
4479
- if (!found || found.layer.type !== "pixel" || !found.layer.generator) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`"${layerId}" is not an effect layer.`);
4488
+ if (!found || found.layer.type !== "pixel" || !found.layer.generator) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`"${layerId}" is not an effect layer.`);
4480
4489
  this.commitLayers(
4481
4490
  _chunkAEAAN4ADcjs.mapLayer.call(void 0, this.state.layers, layerId, (l) => {
4482
4491
  const { generator: _g, ...rest } = l;
@@ -4504,7 +4513,7 @@ var ImageEditorController = (_class7 = class {
4504
4513
  if (key.length === this.viewKey.length && key.every((v, i) => v === this.viewKey[i])) return;
4505
4514
  this.viewKey = key;
4506
4515
  const { width, height } = this.naturalSize;
4507
- const view = _chunkXN2NBLV5cjs.legacyView.call(void 0, this.stack(), width, height, s.activeLayerId);
4516
+ const view = _chunkPMEHFHSPcjs.legacyView.call(void 0, this.stack(), width, height, s.activeLayerId);
4508
4517
  s.adjustments = view.adjustments;
4509
4518
  s.depthMask = view.depthMask;
4510
4519
  s.annotations = view.annotations;
@@ -4658,7 +4667,7 @@ var ImageEditorController = (_class7 = class {
4658
4667
  applyCropPreset(ratio) {
4659
4668
  this.recordHistory();
4660
4669
  const { width, height } = this.state.imageDimensions;
4661
- if (ratio && _chunkXN2NBLV5cjs.isQuarterTurnSwapped.call(void 0, this.state.transform)) {
4670
+ if (ratio && _chunkPMEHFHSPcjs.isQuarterTurnSwapped.call(void 0, this.state.transform)) {
4662
4671
  ratio = 1 / ratio;
4663
4672
  }
4664
4673
  if (!ratio) {
@@ -4740,7 +4749,7 @@ var ImageEditorController = (_class7 = class {
4740
4749
  */
4741
4750
  getLayerPixels(id) {
4742
4751
  const layer = this.getLayer(id);
4743
- if (!layer || !_chunkXN2NBLV5cjs.hasSurface.call(void 0, layer)) return null;
4752
+ if (!layer || !_chunkPMEHFHSPcjs.hasSurface.call(void 0, layer)) return null;
4744
4753
  const surface = this.surfaceOf(layer);
4745
4754
  const b = _chunkO7LUD7MHcjs.contentBounds.call(void 0, surface);
4746
4755
  if (!b) return null;
@@ -4753,7 +4762,7 @@ var ImageEditorController = (_class7 = class {
4753
4762
  */
4754
4763
  getLayerBounds(id) {
4755
4764
  const layer = this.getLayer(id);
4756
- if (!layer || !_chunkXN2NBLV5cjs.hasSurface.call(void 0, layer)) return null;
4765
+ if (!layer || !_chunkPMEHFHSPcjs.hasSurface.call(void 0, layer)) return null;
4757
4766
  const surface = this.surfaceOf(layer);
4758
4767
  let b = this.boundsCache.get(surface);
4759
4768
  if (b === void 0) {
@@ -4768,9 +4777,9 @@ var ImageEditorController = (_class7 = class {
4768
4777
  */
4769
4778
  getLayerDataURL(id) {
4770
4779
  const layer = this.getLayer(id);
4771
- if (!layer || !_chunkXN2NBLV5cjs.hasSurface.call(void 0, layer)) return null;
4780
+ if (!layer || !_chunkPMEHFHSPcjs.hasSurface.call(void 0, layer)) return null;
4772
4781
  const surface = this.surfaceOf(layer);
4773
- const enc = _chunkXN2NBLV5cjs.encodeSurface.call(void 0, surface);
4782
+ const enc = _chunkPMEHFHSPcjs.encodeSurface.call(void 0, surface);
4774
4783
  return enc ? enc.url : null;
4775
4784
  }
4776
4785
  /**
@@ -4912,19 +4921,19 @@ var ImageEditorController = (_class7 = class {
4912
4921
  if (init.pixels) {
4913
4922
  const px2 = init.pixels;
4914
4923
  if (!(px2.width > 0 && px2.height > 0) || px2.data.length < px2.width * px2.height * 4) {
4915
- throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("pixels must be RGBA with width \xD7 height \xD7 4 bytes.");
4924
+ throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("pixels must be RGBA with width \xD7 height \xD7 4 bytes.");
4916
4925
  }
4917
4926
  surface = _chunkO7LUD7MHcjs.surfaceFromPixels.call(void 0, px2, 4);
4918
4927
  } else if (init.color !== void 0) {
4919
4928
  const c = parseColor(init.color);
4920
4929
  surface = _chunkO7LUD7MHcjs.solidSurface.call(void 0, 4, { x: 0, y: 0, width, height }, _chunkO7LUD7MHcjs.packRgba.call(void 0, c[0], c[1], c[2], c[3]));
4921
4930
  }
4922
- const blend = _chunkXN2NBLV5cjs.parseBlend.call(void 0, init.blend);
4923
- if (init.opacity !== void 0 && !(init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("opacity must be from 0 to 1.");
4931
+ const blend = _chunkPMEHFHSPcjs.parseBlend.call(void 0, init.blend);
4932
+ if (init.opacity !== void 0 && !(init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("opacity must be from 0 to 1.");
4924
4933
  const ids = new Set(_chunkAEAAN4ADcjs.flattenLayers.call(void 0, this.state.layers).map((l) => l.id));
4925
4934
  const layer = {
4926
4935
  type: "pixel",
4927
- id: init.id && !ids.has(init.id) ? init.id : _chunkXN2NBLV5cjs.newLayerId.call(void 0, ),
4936
+ id: init.id && !ids.has(init.id) ? init.id : _chunkPMEHFHSPcjs.newLayerId.call(void 0, ),
4928
4937
  name: _optionalChain([init, 'access', _155 => _155.name, 'optionalAccess', _156 => _156.trim, 'call', _157 => _157()]) || this.nextLayerName(),
4929
4938
  visible: _nullishCoalesce(init.visible, () => ( true)),
4930
4939
  opacity: _nullishCoalesce(init.opacity, () => ( 1)),
@@ -4933,7 +4942,7 @@ var ImageEditorController = (_class7 = class {
4933
4942
  offset: { x: Math.round(_nullishCoalesce(init.x, () => ( 0))), y: Math.round(_nullishCoalesce(init.y, () => ( 0))) }
4934
4943
  };
4935
4944
  if (init.fillOpacity !== void 0 && init.fillOpacity !== 1) layer.fillOpacity = init.fillOpacity;
4936
- const next = _chunkXN2NBLV5cjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
4945
+ const next = _chunkPMEHFHSPcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
4937
4946
  this.commitLayers(next, () => {
4938
4947
  this.state.activeLayerId = layer.id;
4939
4948
  this.state.activeTarget = "pixels";
@@ -4973,12 +4982,12 @@ var ImageEditorController = (_class7 = class {
4973
4982
  try {
4974
4983
  img = await this.renderer.imageCache.get(src);
4975
4984
  } catch (e22) {
4976
- throw new (0, _chunkXN2NBLV5cjs.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.");
4985
+ throw new (0, _chunkPMEHFHSPcjs.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.");
4977
4986
  }
4978
4987
  const w = img.naturalWidth || img.width;
4979
4988
  const h = img.naturalHeight || img.height;
4980
4989
  const ctx = this.renderer.createCanvas(w, h).getContext("2d");
4981
- if (!ctx || typeof ctx.getImageData !== "function") throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("Decoding this image needs a canvas; pass a PNG instead.");
4990
+ if (!ctx || typeof ctx.getImageData !== "function") throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Decoding this image needs a canvas; pass a PNG instead.");
4982
4991
  ctx.drawImage(img, 0, 0, w, h);
4983
4992
  const data = ctx.getImageData(0, 0, w, h);
4984
4993
  return { width: w, height: h, data: data.data };
@@ -4991,7 +5000,7 @@ var ImageEditorController = (_class7 = class {
4991
5000
  }
4992
5001
  /** Duplicates a layer (with its children) directly above it, as one undo step. Returns the copy's id. */
4993
5002
  duplicateLayer(id, name) {
4994
- const res = _chunkXN2NBLV5cjs.duplicateLayer.call(void 0, this.state.layers, id, name);
5003
+ const res = _chunkPMEHFHSPcjs.duplicateLayer.call(void 0, this.state.layers, id, name);
4995
5004
  this.commitLayers(res.layers, () => {
4996
5005
  this.state.activeLayerId = res.id;
4997
5006
  });
@@ -4999,16 +5008,16 @@ var ImageEditorController = (_class7 = class {
4999
5008
  }
5000
5009
  /** Deletes a layer (refused when locked), as one undo step. */
5001
5010
  removeLayer(id) {
5002
- const next = _chunkXN2NBLV5cjs.removeLayer.call(void 0, this.state.layers, id);
5011
+ const next = _chunkPMEHFHSPcjs.removeLayer.call(void 0, this.state.layers, id);
5003
5012
  this.commitLayers(next, () => {
5004
- if (this.state.selectedAnnotationId && !_chunkAEAAN4ADcjs.flattenLayers.call(void 0, next).some((l) => _optionalChain([_chunkXN2NBLV5cjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _159 => _159.id]) === this.state.selectedAnnotationId)) {
5013
+ if (this.state.selectedAnnotationId && !_chunkAEAAN4ADcjs.flattenLayers.call(void 0, next).some((l) => _optionalChain([_chunkPMEHFHSPcjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _159 => _159.id]) === this.state.selectedAnnotationId)) {
5005
5014
  this.state.selectedAnnotationId = null;
5006
5015
  }
5007
5016
  });
5008
5017
  }
5009
5018
  /** Moves a layer above / below another, or into a group, as one undo step. Returns its new parent and index. */
5010
5019
  moveLayer(id, placement) {
5011
- const next = _chunkXN2NBLV5cjs.moveLayer.call(void 0, this.state.layers, id, placement);
5020
+ const next = _chunkPMEHFHSPcjs.moveLayer.call(void 0, this.state.layers, id, placement);
5012
5021
  const loc = _chunkAEAAN4ADcjs.findLayer.call(void 0, next, id);
5013
5022
  if (next === this.state.layers) return { parentId: _nullishCoalesce(_optionalChain([loc, 'access', _160 => _160.parent, 'optionalAccess', _161 => _161.id]), () => ( null)), index: loc.index };
5014
5023
  this.commitLayers(next);
@@ -5019,23 +5028,23 @@ var ImageEditorController = (_class7 = class {
5019
5028
  * one undo step (`commitToHistory = false` for the moves of a slider drag). Returns the layer.
5020
5029
  */
5021
5030
  setLayerProperties(id, props, commitToHistory = true) {
5022
- const next = _chunkXN2NBLV5cjs.setLayerProperties.call(void 0, this.state.layers, id, props);
5031
+ const next = _chunkPMEHFHSPcjs.setLayerProperties.call(void 0, this.state.layers, id, props);
5023
5032
  this.commitLayers(next, void 0, commitToHistory);
5024
5033
  return _chunkAEAAN4ADcjs.findLayer.call(void 0, next, id).layer;
5025
5034
  }
5026
5035
  /** Adds an empty pass-through group above the active layer (or at `placement`) and makes it active. Returns its id. */
5027
5036
  addGroup(init = {}) {
5028
- const blend = init.blend === void 0 ? "pass-through" : _chunkXN2NBLV5cjs.parseBlend.call(void 0, init.blend, true);
5037
+ const blend = init.blend === void 0 ? "pass-through" : _chunkPMEHFHSPcjs.parseBlend.call(void 0, init.blend, true);
5029
5038
  const group = {
5030
5039
  type: "group",
5031
- id: _chunkXN2NBLV5cjs.newLayerId.call(void 0, "group"),
5040
+ id: _chunkPMEHFHSPcjs.newLayerId.call(void 0, "group"),
5032
5041
  name: _optionalChain([init, 'access', _164 => _164.name, 'optionalAccess', _165 => _165.trim, 'call', _166 => _166()]) || "Group",
5033
5042
  visible: true,
5034
5043
  opacity: 1,
5035
5044
  blend,
5036
5045
  children: []
5037
5046
  };
5038
- const next = _chunkXN2NBLV5cjs.placeLayer.call(void 0, this.state.layers, group, this.newLayerPlacement(init));
5047
+ const next = _chunkPMEHFHSPcjs.placeLayer.call(void 0, this.state.layers, group, this.newLayerPlacement(init));
5039
5048
  this.commitLayers(next, () => {
5040
5049
  this.state.activeLayerId = group.id;
5041
5050
  this.state.activeTarget = "pixels";
@@ -5044,7 +5053,7 @@ var ImageEditorController = (_class7 = class {
5044
5053
  }
5045
5054
  /** Puts sibling layers into a new group (one undo step). Returns the group id. */
5046
5055
  groupLayers(ids, name) {
5047
- const res = _chunkXN2NBLV5cjs.groupLayers.call(void 0, this.state.layers, ids, name);
5056
+ const res = _chunkPMEHFHSPcjs.groupLayers.call(void 0, this.state.layers, ids, name);
5048
5057
  this.commitLayers(res.layers, () => {
5049
5058
  this.state.activeLayerId = res.id;
5050
5059
  });
@@ -5052,7 +5061,7 @@ var ImageEditorController = (_class7 = class {
5052
5061
  }
5053
5062
  /** Replaces a group by its children (one undo step). Returns the child ids, bottom to top. */
5054
5063
  ungroupLayer(id) {
5055
- const res = _chunkXN2NBLV5cjs.ungroupLayer.call(void 0, this.state.layers, id);
5064
+ const res = _chunkPMEHFHSPcjs.ungroupLayer.call(void 0, this.state.layers, id);
5056
5065
  this.commitLayers(res.layers);
5057
5066
  return res.ids;
5058
5067
  }
@@ -5061,38 +5070,38 @@ var ImageEditorController = (_class7 = class {
5061
5070
  * (`commitToHistory = false` for the moves of a drag). Returns the offset and document bounds.
5062
5071
  */
5063
5072
  offsetLayer(id, move, commitToHistory = true) {
5064
- const layer = _chunkXN2NBLV5cjs.requireLayer.call(void 0, this.state.layers, id).layer;
5073
+ const layer = _chunkPMEHFHSPcjs.requireLayer.call(void 0, this.state.layers, id).layer;
5065
5074
  if (layer.type === "smart") {
5066
5075
  const tl = layer.placement.corners[0];
5067
5076
  const dx = move.x !== void 0 ? move.x - tl.x : _nullishCoalesce(move.dx, () => ( 0));
5068
5077
  const dy = move.y !== void 0 ? move.y - tl.y : _nullishCoalesce(move.dy, () => ( 0));
5069
- if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("x and y must be numbers.");
5070
- this.commitLayers(_chunkXN2NBLV5cjs.offsetSmartObject.call(void 0, this.state.layers, id, dx, dy, this.canvasSize), void 0, commitToHistory);
5078
+ if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("x and y must be numbers.");
5079
+ this.commitLayers(_chunkPMEHFHSPcjs.offsetSmartObject.call(void 0, this.state.layers, id, dx, dy, this.canvasSize), void 0, commitToHistory);
5071
5080
  const moved = _chunkAEAAN4ADcjs.findLayer.call(void 0, this.state.layers, id).layer;
5072
5081
  return { offset: { x: Math.round(moved.placement.corners[0].x), y: Math.round(moved.placement.corners[0].y) }, bounds: this.getLayerBounds(id) };
5073
5082
  }
5074
5083
  if (layer.type === "shape") {
5075
- const g = _nullishCoalesce(_chunkXN2NBLV5cjs.shapeGeometryBounds.call(void 0, layer), () => ( { x: 0, y: 0 }));
5084
+ const g = _nullishCoalesce(_chunkPMEHFHSPcjs.shapeGeometryBounds.call(void 0, layer), () => ( { x: 0, y: 0 }));
5076
5085
  const dx = move.x !== void 0 ? move.x - g.x : _nullishCoalesce(move.dx, () => ( 0));
5077
5086
  const dy = move.y !== void 0 ? move.y - g.y : _nullishCoalesce(move.dy, () => ( 0));
5078
- if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("x and y must be numbers.");
5079
- _chunkXN2NBLV5cjs.requireUnlocked.call(void 0, layer, "position", "move it");
5080
- let moved = _chunkXN2NBLV5cjs.offsetShape.call(void 0, layer, dx, dy, this.shapeEnv());
5087
+ if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("x and y must be numbers.");
5088
+ _chunkPMEHFHSPcjs.requireUnlocked.call(void 0, layer, "position", "move it");
5089
+ let moved = _chunkPMEHFHSPcjs.offsetShape.call(void 0, layer, dx, dy, this.shapeEnv());
5081
5090
  const mask = layer.mask;
5082
5091
  if (mask && mask.linked !== false && !mask.source && (Math.round(dx) || Math.round(dy))) moved = { ...moved, mask: { ...mask, surface: _chunkO7LUD7MHcjs.translateSurface.call(void 0, mask.surface, Math.round(dx), Math.round(dy)) } };
5083
5092
  this.commitLayers(_chunkAEAAN4ADcjs.mapLayer.call(void 0, this.state.layers, id, () => moved), void 0, commitToHistory);
5084
- const b = _nullishCoalesce(_chunkXN2NBLV5cjs.shapeGeometryBounds.call(void 0, moved), () => ( { x: 0, y: 0 }));
5093
+ const b = _nullishCoalesce(_chunkPMEHFHSPcjs.shapeGeometryBounds.call(void 0, moved), () => ( { x: 0, y: 0 }));
5085
5094
  return { offset: { x: Math.round(b.x), y: Math.round(b.y) }, bounds: this.getLayerBounds(id) };
5086
5095
  }
5087
5096
  if (layer.type === "type") {
5088
5097
  const m = _nullishCoalesce(layer.transform, () => ( [1, 0, 0, 1, 0, 0]));
5089
5098
  const dx = move.x !== void 0 ? move.x - m[4] : _nullishCoalesce(move.dx, () => ( 0));
5090
5099
  const dy = move.y !== void 0 ? move.y - m[5] : _nullishCoalesce(move.dy, () => ( 0));
5091
- if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("x and y must be numbers.");
5092
- _chunkXN2NBLV5cjs.requireUnlocked.call(void 0, layer, "position", "move it");
5100
+ if (!Number.isFinite(dx) || !Number.isFinite(dy)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("x and y must be numbers.");
5101
+ _chunkPMEHFHSPcjs.requireUnlocked.call(void 0, layer, "position", "move it");
5093
5102
  const mx = Math.round(dx);
5094
5103
  const my = Math.round(dy);
5095
- let moved = { ..._chunkXN2NBLV5cjs.transformTypeLayer.call(void 0, layer, [1, 0, 0, 1, mx, my]), surface: _chunkO7LUD7MHcjs.translateSurface.call(void 0, layer.surface, mx, my) };
5104
+ let moved = { ..._chunkPMEHFHSPcjs.transformTypeLayer.call(void 0, layer, [1, 0, 0, 1, mx, my]), surface: _chunkO7LUD7MHcjs.translateSurface.call(void 0, layer.surface, mx, my) };
5096
5105
  const mask = layer.mask;
5097
5106
  if (mask && mask.linked !== false && !mask.source && (mx || my)) moved = { ...moved, mask: { ...mask, surface: _chunkO7LUD7MHcjs.translateSurface.call(void 0, mask.surface, mx, my) } };
5098
5107
  this.commitLayers(_chunkAEAAN4ADcjs.mapLayer.call(void 0, this.state.layers, id, () => moved), void 0, commitToHistory);
@@ -5102,7 +5111,7 @@ var ImageEditorController = (_class7 = class {
5102
5111
  const current = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
5103
5112
  const x = _nullishCoalesce(move.x, () => ( current.x + (_nullishCoalesce(move.dx, () => ( 0)))));
5104
5113
  const y = _nullishCoalesce(move.y, () => ( current.y + (_nullishCoalesce(move.dy, () => ( 0)))));
5105
- const next = _chunkXN2NBLV5cjs.offsetLayer.call(void 0, this.state.layers, id, { x, y });
5114
+ const next = _chunkPMEHFHSPcjs.offsetLayer.call(void 0, this.state.layers, id, { x, y });
5106
5115
  this.commitLayers(next, void 0, commitToHistory);
5107
5116
  return { offset: { x: Math.round(x), y: Math.round(y) }, bounds: this.getLayerBounds(id) };
5108
5117
  }
@@ -5112,11 +5121,11 @@ var ImageEditorController = (_class7 = class {
5112
5121
  * target when the layer is active.
5113
5122
  */
5114
5123
  addLayerMask(id, from = "reveal-all", props = {}) {
5115
- const layer = _chunkXN2NBLV5cjs.requireLayer.call(void 0, this.state.layers, id).layer;
5124
+ const layer = _chunkPMEHFHSPcjs.requireLayer.call(void 0, this.state.layers, id).layer;
5116
5125
  let mask;
5117
5126
  if (from === "selection") {
5118
5127
  const sel = this.state.selection;
5119
- if (!_optionalChain([sel, 'optionalAccess', _167 => _167.bounds])) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
5128
+ if (!_optionalChain([sel, 'optionalAccess', _167 => _167.bounds])) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
5120
5129
  mask = this.maskFromSelection(sel, props);
5121
5130
  if (layer.type === "pixel" && (layer.offset.x || layer.offset.y)) {
5122
5131
  mask = { ...mask, surface: _chunkO7LUD7MHcjs.translateSurface.call(void 0, mask.surface, -layer.offset.x, -layer.offset.y) };
@@ -5125,7 +5134,7 @@ var ImageEditorController = (_class7 = class {
5125
5134
  const v = from === "reveal-all" ? 255 : 0;
5126
5135
  mask = withMaskProps({ surface: _chunkO7LUD7MHcjs.emptySurface.call(void 0, 1, v), defaultValue: v }, props);
5127
5136
  }
5128
- const next = _chunkXN2NBLV5cjs.setLayerMask.call(void 0, this.state.layers, id, mask);
5137
+ const next = _chunkPMEHFHSPcjs.setLayerMask.call(void 0, this.state.layers, id, mask);
5129
5138
  this.commitLayers(next, () => {
5130
5139
  if (this.state.activeLayerId === id) this.state.activeTarget = "mask";
5131
5140
  });
@@ -5133,18 +5142,18 @@ var ImageEditorController = (_class7 = class {
5133
5142
  }
5134
5143
  /** Removes a layer's mask (one undo step). */
5135
5144
  removeLayerMask(id) {
5136
- const layer = _chunkXN2NBLV5cjs.requireLayer.call(void 0, this.state.layers, id).layer;
5137
- if (!layer.mask) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask.`);
5138
- this.commitLayers(_chunkXN2NBLV5cjs.setLayerMask.call(void 0, this.state.layers, id, null), () => {
5145
+ const layer = _chunkPMEHFHSPcjs.requireLayer.call(void 0, this.state.layers, id).layer;
5146
+ if (!layer.mask) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask.`);
5147
+ this.commitLayers(_chunkPMEHFHSPcjs.setLayerMask.call(void 0, this.state.layers, id, null), () => {
5139
5148
  if (this.state.activeLayerId === id) this.state.activeTarget = "pixels";
5140
5149
  });
5141
5150
  }
5142
5151
  /** Changes any layer mask's density, feather, enabled or linked flag (pixels kept). Returns the mask. */
5143
5152
  setLayerMaskProps(id, props, commitToHistory = true) {
5144
- const layer = _chunkXN2NBLV5cjs.requireLayer.call(void 0, this.state.layers, id).layer;
5145
- if (!layer.mask) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask; add one with add_layer_mask.`);
5153
+ const layer = _chunkPMEHFHSPcjs.requireLayer.call(void 0, this.state.layers, id).layer;
5154
+ if (!layer.mask) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask; add one with add_layer_mask.`);
5146
5155
  const mask = withMaskProps(layer.mask, props);
5147
- this.commitLayers(_chunkXN2NBLV5cjs.setLayerMask.call(void 0, this.state.layers, id, mask), void 0, commitToHistory);
5156
+ this.commitLayers(_chunkPMEHFHSPcjs.setLayerMask.call(void 0, this.state.layers, id, mask), void 0, commitToHistory);
5148
5157
  return mask;
5149
5158
  }
5150
5159
  /**
@@ -5152,11 +5161,11 @@ var ImageEditorController = (_class7 = class {
5152
5161
  * the depth map) and removes the mask, as one undo step.
5153
5162
  */
5154
5163
  async applyLayerMask(id) {
5155
- const loc = _chunkXN2NBLV5cjs.requireLayer.call(void 0, this.state.layers, id);
5164
+ const loc = _chunkPMEHFHSPcjs.requireLayer.call(void 0, this.state.layers, id);
5156
5165
  const layer = loc.layer;
5157
- if (layer.type !== "pixel") throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`Only a pixel layer's mask can be applied to its pixels; "${id}" is a ${layer.type} layer. Remove the mask or keep it.`);
5158
- if (!layer.mask) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask.`);
5159
- _chunkXN2NBLV5cjs.requireUnlocked.call(void 0, layer, "pixels", "apply its mask");
5166
+ if (layer.type !== "pixel") throw new (0, _chunkPMEHFHSPcjs.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.`);
5167
+ if (!layer.mask) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask.`);
5168
+ _chunkPMEHFHSPcjs.requireUnlocked.call(void 0, layer, "pixels", "apply its mask");
5160
5169
  const { width, height } = this.naturalSize;
5161
5170
  await this.renderer.prepareLayerAssets([layer], width, height);
5162
5171
  const sources = this.renderer.compositorSources(width, height);
@@ -5189,13 +5198,13 @@ var ImageEditorController = (_class7 = class {
5189
5198
  */
5190
5199
  layerViaCopy(options = {}) {
5191
5200
  const id = _nullishCoalesce(options.layerId, () => ( this.state.activeLayerId));
5192
- if (!id) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("No layer given and none is active; pass layerId (see list_layers).");
5193
- const loc = _chunkXN2NBLV5cjs.requireLayer.call(void 0, this.state.layers, id);
5201
+ if (!id) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("No layer given and none is active; pass layerId (see list_layers).");
5202
+ const loc = _chunkPMEHFHSPcjs.requireLayer.call(void 0, this.state.layers, id);
5194
5203
  const layer = loc.layer;
5195
- if (layer.type !== "pixel") throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`Layer via copy needs a pixel layer; "${id}" is a ${layer.type} layer.`);
5204
+ if (layer.type !== "pixel") throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Layer via copy needs a pixel layer; "${id}" is a ${layer.type} layer.`);
5196
5205
  const sel = this.state.selection;
5197
- if (!_optionalChain([sel, 'optionalAccess', _168 => _168.bounds])) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("Nothing is selected; select the pixels to copy first.");
5198
- if (options.cut) _chunkXN2NBLV5cjs.requireUnlocked.call(void 0, layer, "pixels", "cut from it");
5206
+ if (!_optionalChain([sel, 'optionalAccess', _168 => _168.bounds])) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Nothing is selected; select the pixels to copy first.");
5207
+ if (options.cut) _chunkPMEHFHSPcjs.requireUnlocked.call(void 0, layer, "pixels", "cut from it");
5199
5208
  const surface = this.surfaceOf(layer);
5200
5209
  const sb = sel.bounds;
5201
5210
  const src = { x: sb.x - layer.offset.x, y: sb.y - layer.offset.y, width: sb.width, height: sb.height };
@@ -5211,7 +5220,7 @@ var ImageEditorController = (_class7 = class {
5211
5220
  }
5212
5221
  const copy = {
5213
5222
  type: "pixel",
5214
- id: _chunkXN2NBLV5cjs.newLayerId.call(void 0, ),
5223
+ id: _chunkPMEHFHSPcjs.newLayerId.call(void 0, ),
5215
5224
  name: _optionalChain([options, 'access', _169 => _169.name, 'optionalAccess', _170 => _170.trim, 'call', _171 => _171()]) || `${layer.name || "Layer"} ${options.cut ? "cut" : "copy"}`,
5216
5225
  visible: true,
5217
5226
  opacity: 1,
@@ -5284,7 +5293,7 @@ var ImageEditorController = (_class7 = class {
5284
5293
  * Refused while another transform is open.
5285
5294
  */
5286
5295
  beginFreeTransform(init = {}) {
5287
- if (this.getFreeTransform()) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("A Free Transform is already open; commit or cancel it first.");
5296
+ if (this.getFreeTransform()) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("A Free Transform is already open; commit or cancel it first.");
5288
5297
  const session = new FreeTransformSession(this.transformHost(), init);
5289
5298
  this.openTransform = session;
5290
5299
  this.notify();
@@ -5298,26 +5307,26 @@ var ImageEditorController = (_class7 = class {
5298
5307
  */
5299
5308
  transformLayer(spec) {
5300
5309
  const given = [spec.matrix, spec.corners, spec.params].filter((v) => v !== void 0).length;
5301
- if (given > 1) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("Give only one of matrix, corners and params.");
5302
- if (!given && spec.warp === void 0) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("Give matrix, corners or params (or a warp).");
5310
+ if (given > 1) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Give only one of matrix, corners and params.");
5311
+ if (!given && spec.warp === void 0) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Give matrix, corners or params (or a warp).");
5303
5312
  if (spec.matrix && !(Array.isArray(spec.matrix) && spec.matrix.length === 6 && spec.matrix.every(Number.isFinite))) {
5304
- throw new (0, _chunkXN2NBLV5cjs.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).");
5313
+ throw new (0, _chunkPMEHFHSPcjs.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).");
5305
5314
  }
5306
5315
  if (spec.matrix) {
5307
5316
  const [a, b, c, d] = spec.matrix;
5308
- if (Math.abs(a * d - b * c) < 1e-9) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("matrix is singular (it collapses the layer to a line); its determinant a\xB7d \u2212 b\xB7c must not be 0.");
5317
+ if (Math.abs(a * d - b * c) < 1e-9) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("matrix is singular (it collapses the layer to a line); its determinant a\xB7d \u2212 b\xB7c must not be 0.");
5309
5318
  }
5310
5319
  const session = this.beginFreeTransform(spec);
5311
5320
  try {
5312
5321
  const g = session.startGeometry;
5313
- const corners = spec.matrix ? g.corners.map((p) => _chunk5OOIUXNJcjs.applyMatrix.call(void 0, spec.matrix, p)) : spec.corners ? spec.corners : spec.params ? _chunkXN2NBLV5cjs.applyParams.call(void 0, g, spec.params) : g.corners;
5322
+ const corners = spec.matrix ? g.corners.map((p) => _chunkXFXHA5MUcjs.applyMatrix.call(void 0, spec.matrix, p)) : spec.corners ? spec.corners : spec.params ? _chunkPMEHFHSPcjs.applyParams.call(void 0, g, spec.params) : g.corners;
5314
5323
  let warp = spec.warp === void 0 ? _nullishCoalesce(g.warp, () => ( null)) : null;
5315
5324
  if (spec.warp) {
5316
5325
  if ("style" in spec.warp) {
5317
- if (!_chunk5OOIUXNJcjs.WARP_STYLES.includes(spec.warp.style)) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`Unknown warp style "${String(spec.warp.style)}". Styles: ${_chunk5OOIUXNJcjs.WARP_STYLES.join(", ")}.`);
5318
- warp = _chunkXN2NBLV5cjs.presetWarp.call(void 0, session.box, spec.warp);
5326
+ if (!_chunkXFXHA5MUcjs.WARP_STYLES.includes(spec.warp.style)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Unknown warp style "${String(spec.warp.style)}". Styles: ${_chunkXFXHA5MUcjs.WARP_STYLES.join(", ")}.`);
5327
+ warp = _chunkPMEHFHSPcjs.presetWarp.call(void 0, session.box, spec.warp);
5319
5328
  } else {
5320
- if (!_chunkXN2NBLV5cjs.isValidWarp.call(void 0, spec.warp)) throw new (0, _chunkXN2NBLV5cjs.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.");
5329
+ if (!_chunkPMEHFHSPcjs.isValidWarp.call(void 0, spec.warp)) throw new (0, _chunkPMEHFHSPcjs.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.");
5321
5330
  warp = spec.warp;
5322
5331
  }
5323
5332
  }
@@ -5330,10 +5339,10 @@ var ImageEditorController = (_class7 = class {
5330
5339
  }
5331
5340
  /** Flips the layer (or its selected pixels, or the outline) about the frame's centre, exactly (one undo step). */
5332
5341
  flipLayer(axis, init = {}) {
5333
- if (axis !== "horizontal" && axis !== "vertical") throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`axis must be horizontal or vertical, got "${String(axis)}".`);
5342
+ if (axis !== "horizontal" && axis !== "vertical") throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`axis must be horizontal or vertical, got "${String(axis)}".`);
5334
5343
  const session = this.beginFreeTransform({ interpolation: "nearest", ...init });
5335
5344
  try {
5336
- session.update({ corners: _chunkXN2NBLV5cjs.flipCorners.call(void 0, session.startGeometry, axis) }, false);
5345
+ session.update({ corners: _chunkPMEHFHSPcjs.flipCorners.call(void 0, session.startGeometry, axis) }, false);
5337
5346
  return session.commit();
5338
5347
  } catch (e) {
5339
5348
  session.cancel();
@@ -5345,16 +5354,16 @@ var ImageEditorController = (_class7 = class {
5345
5354
  * centre, snapped so pixels land on whole pixels: exact, no resampling (one undo step).
5346
5355
  */
5347
5356
  rotateLayer90(turn, init = {}) {
5348
- if (turn !== 90 && turn !== -90 && turn !== 180) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`turn must be 90, -90 or 180, got ${String(turn)}.`);
5357
+ if (turn !== 90 && turn !== -90 && turn !== 180) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`turn must be 90, -90 or 180, got ${String(turn)}.`);
5349
5358
  const session = this.beginFreeTransform({ interpolation: "nearest", ...init });
5350
5359
  try {
5351
- const b = session.smartObject || session.typeLayer ? _nullishCoalesce(_chunkXN2NBLV5cjs.transformedBox.call(void 0, session.startGeometry), () => ( session.box)) : session.box;
5360
+ const b = session.smartObject || session.typeLayer ? _nullishCoalesce(_chunkPMEHFHSPcjs.transformedBox.call(void 0, session.startGeometry), () => ( session.box)) : session.box;
5352
5361
  const cx = b.x + b.width / 2;
5353
5362
  const cy = b.y + b.height / 2;
5354
5363
  const ox = turn === 180 ? 0 : Math.round(cx - b.height / 2) - (cx - b.height / 2);
5355
5364
  const oy = turn === 180 ? 0 : Math.round(cy - b.width / 2) - (cy - b.width / 2);
5356
5365
  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];
5357
- session.update({ corners: session.startGeometry.corners.map((p) => _chunk5OOIUXNJcjs.applyMatrix.call(void 0, m, p)) }, false);
5366
+ session.update({ corners: session.startGeometry.corners.map((p) => _chunkXFXHA5MUcjs.applyMatrix.call(void 0, m, p)) }, false);
5358
5367
  return session.commit();
5359
5368
  } catch (e) {
5360
5369
  session.cancel();
@@ -5363,20 +5372,20 @@ var ImageEditorController = (_class7 = class {
5363
5372
  }
5364
5373
  /** Adds a `develop` or `blur` filter to a pixel layer (one undo step). Returns the layer's filters. */
5365
5374
  addLayerFilter(id, filter) {
5366
- const f = _chunkXN2NBLV5cjs.normalizeFilter.call(void 0, filter);
5367
- const next = _chunkXN2NBLV5cjs.addLayerFilter.call(void 0, this.state.layers, id, f);
5375
+ const f = _chunkPMEHFHSPcjs.normalizeFilter.call(void 0, filter);
5376
+ const next = _chunkPMEHFHSPcjs.addLayerFilter.call(void 0, this.state.layers, id, f);
5368
5377
  this.commitLayers(next);
5369
5378
  return _nullishCoalesce(_chunkAEAAN4ADcjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
5370
5379
  }
5371
5380
  /** Changes one filter (one undo step, or none with `commitToHistory = false` during a drag). Returns the filters. */
5372
5381
  updateLayerFilter(id, filterId, changes, commitToHistory = true) {
5373
- const next = _chunkXN2NBLV5cjs.updateLayerFilter.call(void 0, this.state.layers, id, filterId, changes);
5382
+ const next = _chunkPMEHFHSPcjs.updateLayerFilter.call(void 0, this.state.layers, id, filterId, changes);
5374
5383
  this.commitLayers(next, void 0, commitToHistory);
5375
5384
  return _nullishCoalesce(_chunkAEAAN4ADcjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
5376
5385
  }
5377
5386
  /** Removes one filter (one undo step). Returns the remaining filters. */
5378
5387
  removeLayerFilter(id, filterId) {
5379
- const next = _chunkXN2NBLV5cjs.removeLayerFilter.call(void 0, this.state.layers, id, filterId);
5388
+ const next = _chunkPMEHFHSPcjs.removeLayerFilter.call(void 0, this.state.layers, id, filterId);
5380
5389
  this.commitLayers(next);
5381
5390
  return _nullishCoalesce(_chunkAEAAN4ADcjs.findLayer.call(void 0, next, id).layer.filters, () => ( []));
5382
5391
  }
@@ -5392,8 +5401,8 @@ var ImageEditorController = (_class7 = class {
5392
5401
  */
5393
5402
  convertToSmartObject(ids, options = {}) {
5394
5403
  const list = _optionalChain([ids, 'optionalAccess', _177 => _177.length]) ? ids : this.state.activeLayerId ? [this.state.activeLayerId] : [];
5395
- if (!list.length) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("No layers given and none is active; pass layerIds (see list_layers).");
5396
- const res = _chunkXN2NBLV5cjs.convertToSmartObject.call(void 0, this.state.layers, list, this.canvasSize, { surfaceOf: (l) => this.surfaceOf(l), name: options.name });
5404
+ if (!list.length) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("No layers given and none is active; pass layerIds (see list_layers).");
5405
+ const res = _chunkPMEHFHSPcjs.convertToSmartObject.call(void 0, this.state.layers, list, this.canvasSize, { surfaceOf: (l) => this.surfaceOf(l), name: options.name });
5397
5406
  this.commitLayers(res.layers, () => {
5398
5407
  this.state.activeLayerId = res.layer.id;
5399
5408
  this.state.activeTarget = "pixels";
@@ -5402,7 +5411,7 @@ var ImageEditorController = (_class7 = class {
5402
5411
  }
5403
5412
  /** Layer › Smart Objects › Rasterize (one undo step): the smart object becomes a pixel layer holding what it renders. */
5404
5413
  rasterizeSmartObject(id) {
5405
- const res = _chunkXN2NBLV5cjs.rasterizeSmartObject.call(void 0, this.state.layers, id);
5414
+ const res = _chunkPMEHFHSPcjs.rasterizeSmartObject.call(void 0, this.state.layers, id);
5406
5415
  this.commitLayers(res.layers, () => {
5407
5416
  if (this.state.activeLayerId === id && this.state.activeTarget === "filter-mask") this.state.activeTarget = "pixels";
5408
5417
  });
@@ -5410,10 +5419,10 @@ var ImageEditorController = (_class7 = class {
5410
5419
  }
5411
5420
  /** A smart object's contents, placement and smart filters as plain data (see `SmartObjectInfo`). */
5412
5421
  getSmartObject(id) {
5413
- const layer = _chunkXN2NBLV5cjs.requireSmartObject.call(void 0, this.state.layers, id);
5422
+ const layer = _chunkPMEHFHSPcjs.requireSmartObject.call(void 0, this.state.layers, id);
5414
5423
  const c = layer.contents;
5415
- const g = _chunkXN2NBLV5cjs.placementGeometry.call(void 0, layer);
5416
- const readout = _chunkXN2NBLV5cjs.describeTransform.call(void 0, g);
5424
+ const g = _chunkPMEHFHSPcjs.placementGeometry.call(void 0, layer);
5425
+ const readout = _chunkPMEHFHSPcjs.describeTransform.call(void 0, g);
5417
5426
  const stack = layer.smartFilters;
5418
5427
  return {
5419
5428
  layerId: layer.id,
@@ -5423,10 +5432,10 @@ var ImageEditorController = (_class7 = class {
5423
5432
  kind: c.kind,
5424
5433
  width: c.width,
5425
5434
  height: c.height,
5426
- decoded: _chunkXN2NBLV5cjs.isContentsDecoded.call(void 0, c),
5435
+ decoded: _chunkPMEHFHSPcjs.isContentsDecoded.call(void 0, c),
5427
5436
  fileType: _nullishCoalesce(_optionalChain([c, 'access', _178 => _178.file, 'optionalAccess', _179 => _179.type]), () => ( null)),
5428
5437
  linkedPath: _nullishCoalesce(_optionalChain([c, 'access', _180 => _180.linked, 'optionalAccess', _181 => _181.path]), () => ( null)),
5429
- instances: _chunkXN2NBLV5cjs.instancesOf.call(void 0, this.state.layers, c.id),
5438
+ instances: _chunkPMEHFHSPcjs.instancesOf.call(void 0, this.state.layers, c.id),
5430
5439
  layerCount: c.document ? _chunkAEAAN4ADcjs.flattenLayers.call(void 0, c.document.layers).length : 0
5431
5440
  },
5432
5441
  placement: {
@@ -5438,8 +5447,8 @@ var ImageEditorController = (_class7 = class {
5438
5447
  scaleY: readout.scaleY,
5439
5448
  rotate: readout.rotate,
5440
5449
  skewX: readout.skewX,
5441
- center: _chunkXN2NBLV5cjs.anchorPoint.call(void 0, g, "center"),
5442
- bounds: _chunkXN2NBLV5cjs.transformedBox.call(void 0, g)
5450
+ center: _chunkPMEHFHSPcjs.anchorPoint.call(void 0, g, "center"),
5451
+ bounds: _chunkPMEHFHSPcjs.transformedBox.call(void 0, g)
5443
5452
  },
5444
5453
  smartFilters: {
5445
5454
  enabled: _nullishCoalesce(_optionalChain([stack, 'optionalAccess', _182 => _182.enabled]), () => ( true)),
@@ -5456,7 +5465,7 @@ var ImageEditorController = (_class7 = class {
5456
5465
  * change. Returns the new placement summary.
5457
5466
  */
5458
5467
  setSmartObjectPlacement(id, placement, commitToHistory = true) {
5459
- const res = _chunkXN2NBLV5cjs.setSmartPlacement.call(void 0, this.state.layers, id, placement, this.canvasSize);
5468
+ const res = _chunkPMEHFHSPcjs.setSmartPlacement.call(void 0, this.state.layers, id, placement, this.canvasSize);
5460
5469
  this.commitLayers(res.layers, void 0, commitToHistory);
5461
5470
  return { ...this.getSmartObject(id).placement, masksMoved: res.masksMoved };
5462
5471
  }
@@ -5469,23 +5478,23 @@ var ImageEditorController = (_class7 = class {
5469
5478
  * nothing is relative to the current transform.
5470
5479
  */
5471
5480
  setSmartObjectTransform(id, spec) {
5472
- const layer = _chunkXN2NBLV5cjs.requireSmartObject.call(void 0, this.state.layers, id);
5473
- const g = _chunkXN2NBLV5cjs.placementGeometry.call(void 0, layer);
5481
+ const layer = _chunkPMEHFHSPcjs.requireSmartObject.call(void 0, this.state.layers, id);
5482
+ const g = _chunkPMEHFHSPcjs.placementGeometry.call(void 0, layer);
5474
5483
  const numeric = ["scaleX", "scaleY", "rotate", "skewX", "skewY", "x", "y"].filter((k) => spec[k] !== void 0);
5475
5484
  const ways = [spec.corners !== void 0, spec.matrix !== void 0, numeric.length > 0].filter(Boolean).length;
5476
- if (ways > 1) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("Give the transform only one way: corners, matrix, or the numbers (scaleX, scaleY, rotate, skewX, skewY, x, y).");
5485
+ if (ways > 1) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Give the transform only one way: corners, matrix, or the numbers (scaleX, scaleY, rotate, skewX, skewY, x, y).");
5477
5486
  let corners = g.corners;
5478
5487
  if (spec.corners) corners = spec.corners;
5479
5488
  else if (spec.matrix) {
5480
- if (!(Array.isArray(spec.matrix) && spec.matrix.length === 6 && spec.matrix.every(Number.isFinite))) throw new (0, _chunkXN2NBLV5cjs.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).");
5489
+ if (!(Array.isArray(spec.matrix) && spec.matrix.length === 6 && spec.matrix.every(Number.isFinite))) throw new (0, _chunkPMEHFHSPcjs.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).");
5481
5490
  const [a, b, c, d] = spec.matrix;
5482
- if (Math.abs(a * d - b * c) < 1e-9) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("matrix is singular (it collapses the contents to a line); a\xB7d \u2212 b\xB7c must not be 0.");
5483
- corners = _chunkXN2NBLV5cjs.cornersFromMatrix.call(void 0, g.box, spec.matrix);
5491
+ if (Math.abs(a * d - b * c) < 1e-9) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("matrix is singular (it collapses the contents to a line); a\xB7d \u2212 b\xB7c must not be 0.");
5492
+ corners = _chunkPMEHFHSPcjs.cornersFromMatrix.call(void 0, g.box, spec.matrix);
5484
5493
  } else if (numeric.length) {
5485
- if (spec.scaleX === 0 || spec.scaleY === 0) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("scaleX and scaleY must not be 0 (that collapses the contents to a line).");
5486
- for (const k of numeric) if (!Number.isFinite(spec[k])) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`${k} must be a finite number.`);
5487
- const now = _chunkXN2NBLV5cjs.describeTransform.call(void 0, g);
5488
- const centre = _chunkXN2NBLV5cjs.anchorPoint.call(void 0, g, "center");
5494
+ if (spec.scaleX === 0 || spec.scaleY === 0) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("scaleX and scaleY must not be 0 (that collapses the contents to a line).");
5495
+ for (const k of numeric) if (!Number.isFinite(spec[k])) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`${k} must be a finite number.`);
5496
+ const now = _chunkPMEHFHSPcjs.describeTransform.call(void 0, g);
5497
+ const centre = _chunkPMEHFHSPcjs.anchorPoint.call(void 0, g, "center");
5489
5498
  const params = {
5490
5499
  scaleX: _nullishCoalesce(spec.scaleX, () => ( (now.affine ? now.scaleX : 100))),
5491
5500
  scaleY: _nullishCoalesce(spec.scaleY, () => ( (now.affine ? now.scaleY : 100))),
@@ -5493,20 +5502,20 @@ var ImageEditorController = (_class7 = class {
5493
5502
  skewX: _nullishCoalesce(spec.skewX, () => ( (now.affine ? now.skewX : 0))),
5494
5503
  skewY: _nullishCoalesce(spec.skewY, () => ( 0))
5495
5504
  };
5496
- const m = _chunkXN2NBLV5cjs.matrixFromParams.call(void 0, g.box, { ...params, reference: "center" });
5505
+ const m = _chunkPMEHFHSPcjs.matrixFromParams.call(void 0, g.box, { ...params, reference: "center" });
5497
5506
  const cx = g.box.width / 2;
5498
5507
  const cy = g.box.height / 2;
5499
5508
  const to = { x: _nullishCoalesce(spec.x, () => ( centre.x)), y: _nullishCoalesce(spec.y, () => ( centre.y)) };
5500
- corners = _chunkXN2NBLV5cjs.cornersFromMatrix.call(void 0, g.box, _chunk5OOIUXNJcjs.multiplyMatrices.call(void 0, m, _chunk5OOIUXNJcjs.translateMatrix.call(void 0, to.x - cx, to.y - cy)));
5509
+ corners = _chunkPMEHFHSPcjs.cornersFromMatrix.call(void 0, g.box, _chunkXFXHA5MUcjs.multiplyMatrices.call(void 0, m, _chunkXFXHA5MUcjs.translateMatrix.call(void 0, to.x - cx, to.y - cy)));
5501
5510
  }
5502
5511
  let warp = _nullishCoalesce(layer.placement.warp, () => ( null));
5503
5512
  if (spec.warp === null) warp = null;
5504
5513
  else if (spec.warp) {
5505
5514
  if ("style" in spec.warp) {
5506
- if (!_chunk5OOIUXNJcjs.WARP_STYLES.includes(spec.warp.style)) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`Unknown warp style "${String(spec.warp.style)}". Styles: ${_chunk5OOIUXNJcjs.WARP_STYLES.join(", ")}.`);
5507
- warp = _chunkXN2NBLV5cjs.presetWarp.call(void 0, g.box, spec.warp);
5515
+ if (!_chunkXFXHA5MUcjs.WARP_STYLES.includes(spec.warp.style)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Unknown warp style "${String(spec.warp.style)}". Styles: ${_chunkXFXHA5MUcjs.WARP_STYLES.join(", ")}.`);
5516
+ warp = _chunkPMEHFHSPcjs.presetWarp.call(void 0, g.box, spec.warp);
5508
5517
  } else {
5509
- if (!_chunkXN2NBLV5cjs.isValidWarp.call(void 0, spec.warp)) throw new (0, _chunkXN2NBLV5cjs.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.");
5518
+ if (!_chunkPMEHFHSPcjs.isValidWarp.call(void 0, spec.warp)) throw new (0, _chunkPMEHFHSPcjs.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.");
5510
5519
  warp = spec.warp;
5511
5520
  }
5512
5521
  }
@@ -5520,16 +5529,16 @@ var ImageEditorController = (_class7 = class {
5520
5529
  * the layers that changed.
5521
5530
  */
5522
5531
  replaceSmartObjectContents(id, source) {
5523
- const layer = _chunkXN2NBLV5cjs.requireSmartObject.call(void 0, this.state.layers, id);
5532
+ const layer = _chunkPMEHFHSPcjs.requireSmartObject.call(void 0, this.state.layers, id);
5524
5533
  let contents;
5525
5534
  if ("contents" in source) contents = source.contents;
5526
- else if ("pixels" in source) contents = _chunkXN2NBLV5cjs.rasterContents.call(void 0, source.pixels, _nullishCoalesce(source.name, () => ( layer.contents.name.replace(/\.\w+$/, ".png"))));
5535
+ else if ("pixels" in source) contents = _chunkPMEHFHSPcjs.rasterContents.call(void 0, source.pixels, _nullishCoalesce(source.name, () => ( layer.contents.name.replace(/\.\w+$/, ".png"))));
5527
5536
  else {
5528
- const psd = _chunkXN2NBLV5cjs.importPsd.call(void 0, source.psd, { newId: () => _chunkXN2NBLV5cjs.newLayerId.call(void 0, ) });
5529
- contents = _chunkXN2NBLV5cjs.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`)));
5537
+ const psd = _chunkPMEHFHSPcjs.importPsd.call(void 0, source.psd, { newId: () => _chunkPMEHFHSPcjs.newLayerId.call(void 0, ) });
5538
+ contents = _chunkPMEHFHSPcjs.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`)));
5530
5539
  contents.file = { bytes: source.psd.slice(), type: psd.info.psb ? "psb" : "psd" };
5531
5540
  }
5532
- const res = _chunkXN2NBLV5cjs.replaceContents.call(void 0, this.state.layers, layer.contents.id, contents, this.canvasSize);
5541
+ const res = _chunkPMEHFHSPcjs.replaceContents.call(void 0, this.state.layers, layer.contents.id, contents, this.canvasSize);
5533
5542
  this.commitLayers(res.layers);
5534
5543
  return { contentsId: layer.contents.id, width: contents.width, height: contents.height, layerIds: res.ids };
5535
5544
  }
@@ -5544,16 +5553,16 @@ var ImageEditorController = (_class7 = class {
5544
5553
  * and bytes.
5545
5554
  */
5546
5555
  exportSmartObjectContents(id) {
5547
- const layer = _chunkXN2NBLV5cjs.requireSmartObject.call(void 0, this.state.layers, id);
5556
+ const layer = _chunkPMEHFHSPcjs.requireSmartObject.call(void 0, this.state.layers, id);
5548
5557
  const c = layer.contents;
5549
5558
  const base = c.name.replace(/\.\w+$/, "") || "Contents";
5550
5559
  if (c.file) {
5551
- const mime = { psd: "image/vnd.adobe.photoshop", psb: "image/vnd.adobe.photoshop", pdf: "application/pdf", ..._chunkXN2NBLV5cjs.BROWSER_IMAGE_TYPES };
5560
+ const mime = { psd: "image/vnd.adobe.photoshop", psb: "image/vnd.adobe.photoshop", pdf: "application/pdf", ..._chunkPMEHFHSPcjs.BROWSER_IMAGE_TYPES };
5552
5561
  const ext = c.file.type.toLowerCase();
5553
5562
  return { name: /\.\w+$/.test(c.name) ? c.name : `${base}.${ext}`, mimeType: _nullishCoalesce(mime[ext], () => ( "application/octet-stream")), bytes: c.file.bytes };
5554
5563
  }
5555
- if (!_chunkXN2NBLV5cjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`The contents of "${layer.name || id}" are not available here.`);
5556
- const f = _chunkXN2NBLV5cjs.smartContentsFile.call(void 0, c);
5564
+ if (!_chunkPMEHFHSPcjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`The contents of "${layer.name || id}" are not available here.`);
5565
+ const f = _chunkPMEHFHSPcjs.smartContentsFile.call(void 0, c);
5557
5566
  return { name: f.name, mimeType: f.name.endsWith(".png") ? "image/png" : "image/vnd.adobe.photoshop", bytes: f.bytes };
5558
5567
  }
5559
5568
  /**
@@ -5562,7 +5571,7 @@ var ImageEditorController = (_class7 = class {
5562
5571
  * undo step. Returns the copy's id.
5563
5572
  */
5564
5573
  copySmartObject(id, linked = false, name) {
5565
- const res = _chunkXN2NBLV5cjs.copySmartObject.call(void 0, this.state.layers, id, linked, name);
5574
+ const res = _chunkPMEHFHSPcjs.copySmartObject.call(void 0, this.state.layers, id, linked, name);
5566
5575
  this.commitLayers(res.layers, () => {
5567
5576
  this.state.activeLayerId = res.layer.id;
5568
5577
  this.state.activeTarget = "pixels";
@@ -5571,31 +5580,31 @@ var ImageEditorController = (_class7 = class {
5571
5580
  }
5572
5581
  /** Adds a smart filter (`develop` or `blur`, with `blend` and `opacity`) at `index` (default the top), as one undo step. */
5573
5582
  addSmartFilter(id, filter, index) {
5574
- const res = _chunkXN2NBLV5cjs.addSmartFilter.call(void 0, this.state.layers, id, _chunkXN2NBLV5cjs.normalizeSmartFilter.call(void 0, filter), this.canvasSize, index);
5583
+ const res = _chunkPMEHFHSPcjs.addSmartFilter.call(void 0, this.state.layers, id, _chunkPMEHFHSPcjs.normalizeSmartFilter.call(void 0, filter), this.canvasSize, index);
5575
5584
  this.commitLayers(res.layers);
5576
5585
  return res.filter;
5577
5586
  }
5578
5587
  /** Changes one smart filter (one undo step, or none with `commitToHistory = false` during a drag). */
5579
5588
  updateSmartFilter(id, filterId, changes, commitToHistory = true) {
5580
- const res = _chunkXN2NBLV5cjs.updateSmartFilter.call(void 0, this.state.layers, id, filterId, changes, this.canvasSize);
5589
+ const res = _chunkPMEHFHSPcjs.updateSmartFilter.call(void 0, this.state.layers, id, filterId, changes, this.canvasSize);
5581
5590
  this.commitLayers(res.layers, void 0, commitToHistory);
5582
5591
  return res.filter;
5583
5592
  }
5584
5593
  /** Removes one smart filter (one undo step). Returns the remaining filters. */
5585
5594
  removeSmartFilter(id, filterId) {
5586
- const res = _chunkXN2NBLV5cjs.removeSmartFilter.call(void 0, this.state.layers, id, filterId, this.canvasSize);
5595
+ const res = _chunkPMEHFHSPcjs.removeSmartFilter.call(void 0, this.state.layers, id, filterId, this.canvasSize);
5587
5596
  this.commitLayers(res.layers);
5588
5597
  return _nullishCoalesce(_optionalChain([res, 'access', _185 => _185.layer, 'access', _186 => _186.smartFilters, 'optionalAccess', _187 => _187.filters]), () => ( []));
5589
5598
  }
5590
5599
  /** Moves one smart filter to `index` (0 = bottom, applied first), as one undo step. Returns the filters. */
5591
5600
  moveSmartFilter(id, filterId, index) {
5592
- const res = _chunkXN2NBLV5cjs.moveSmartFilter.call(void 0, this.state.layers, id, filterId, index, this.canvasSize);
5601
+ const res = _chunkPMEHFHSPcjs.moveSmartFilter.call(void 0, this.state.layers, id, filterId, index, this.canvasSize);
5593
5602
  this.commitLayers(res.layers);
5594
5603
  return _nullishCoalesce(_optionalChain([res, 'access', _188 => _188.layer, 'access', _189 => _189.smartFilters, 'optionalAccess', _190 => _190.filters]), () => ( []));
5595
5604
  }
5596
5605
  /** Turns a smart object's whole filter stack on or off (one undo step). */
5597
5606
  setSmartFiltersEnabled(id, enabled) {
5598
- const res = _chunkXN2NBLV5cjs.setSmartFiltersEnabled.call(void 0, this.state.layers, id, enabled, this.canvasSize);
5607
+ const res = _chunkPMEHFHSPcjs.setSmartFiltersEnabled.call(void 0, this.state.layers, id, enabled, this.canvasSize);
5599
5608
  this.commitLayers(res.layers);
5600
5609
  return _nullishCoalesce(_optionalChain([res, 'access', _191 => _191.layer, 'access', _192 => _192.smartFilters, 'optionalAccess', _193 => _193.enabled]), () => ( true));
5601
5610
  }
@@ -5605,21 +5614,21 @@ var ImageEditorController = (_class7 = class {
5605
5614
  * Painting it targets channel `filter-mask`. Returns the mask, or `null` when removed.
5606
5615
  */
5607
5616
  setSmartFilterMask(id, from, props = {}, commitToHistory = true) {
5608
- const layer = _chunkXN2NBLV5cjs.requireSmartObject.call(void 0, this.state.layers, id);
5617
+ const layer = _chunkPMEHFHSPcjs.requireSmartObject.call(void 0, this.state.layers, id);
5609
5618
  let mask;
5610
5619
  if (from === "none") mask = null;
5611
5620
  else if (from === "keep") {
5612
- if (!_optionalChain([layer, 'access', _194 => _194.smartFilters, 'optionalAccess', _195 => _195.mask])) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`Smart object "${layer.name || id}" has no filter mask; add one with from reveal-all, hide-all or selection.`);
5621
+ if (!_optionalChain([layer, 'access', _194 => _194.smartFilters, 'optionalAccess', _195 => _195.mask])) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Smart object "${layer.name || id}" has no filter mask; add one with from reveal-all, hide-all or selection.`);
5613
5622
  mask = withMaskProps(layer.smartFilters.mask, props);
5614
5623
  } else if (from === "selection") {
5615
5624
  const sel = this.state.selection;
5616
- if (!_optionalChain([sel, 'optionalAccess', _196 => _196.bounds])) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
5625
+ if (!_optionalChain([sel, 'optionalAccess', _196 => _196.bounds])) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Nothing is selected; select first, or use reveal-all / hide-all.");
5617
5626
  mask = this.maskFromSelection(sel, props);
5618
5627
  } else {
5619
5628
  const v = from === "reveal-all" ? 255 : 0;
5620
5629
  mask = withMaskProps({ surface: _chunkO7LUD7MHcjs.emptySurface.call(void 0, 1, v), defaultValue: v }, props);
5621
5630
  }
5622
- const res = _chunkXN2NBLV5cjs.setSmartFilterMask.call(void 0, this.state.layers, id, mask, this.canvasSize);
5631
+ const res = _chunkPMEHFHSPcjs.setSmartFilterMask.call(void 0, this.state.layers, id, mask, this.canvasSize);
5623
5632
  this.commitLayers(res.layers, () => {
5624
5633
  if (this.state.activeLayerId !== id) return;
5625
5634
  if (mask && from !== "keep") this.state.activeTarget = "filter-mask";
@@ -5635,14 +5644,14 @@ var ImageEditorController = (_class7 = class {
5635
5644
  async prepareSmartObjects() {
5636
5645
  const pending = /* @__PURE__ */ new Map();
5637
5646
  for (const l of _chunkAEAAN4ADcjs.flattenLayers.call(void 0, this.state.layers)) {
5638
- if (l.type === "smart" && !_chunkXN2NBLV5cjs.isContentsDecoded.call(void 0, l.contents) && l.contents.file && _chunkXN2NBLV5cjs.BROWSER_IMAGE_TYPES[l.contents.file.type]) pending.set(l.contents.id, l.contents);
5647
+ if (l.type === "smart" && !_chunkPMEHFHSPcjs.isContentsDecoded.call(void 0, l.contents) && l.contents.file && _chunkPMEHFHSPcjs.BROWSER_IMAGE_TYPES[l.contents.file.type]) pending.set(l.contents.id, l.contents);
5639
5648
  }
5640
5649
  const left = [];
5641
5650
  for (const [cid, c] of pending) {
5642
5651
  try {
5643
- const url = `data:${_chunkXN2NBLV5cjs.BROWSER_IMAGE_TYPES[c.file.type]};base64,${_chunkO7LUD7MHcjs.bytesToBase64.call(void 0, c.file.bytes)}`;
5652
+ const url = `data:${_chunkPMEHFHSPcjs.BROWSER_IMAGE_TYPES[c.file.type]};base64,${_chunkO7LUD7MHcjs.bytesToBase64.call(void 0, c.file.bytes)}`;
5644
5653
  const px2 = await this.decodeImage(url);
5645
- const decoded = { ...c, kind: "raster", raster: _chunkXN2NBLV5cjs.rasterContents.call(void 0, px2, c.name, cid).raster, width: px2.width, height: px2.height };
5654
+ const decoded = { ...c, kind: "raster", raster: _chunkPMEHFHSPcjs.rasterContents.call(void 0, px2, c.name, cid).raster, width: px2.width, height: px2.height };
5646
5655
  const swap = (layers) => {
5647
5656
  let out = layers;
5648
5657
  for (const l of _chunkAEAAN4ADcjs.flattenLayers.call(void 0, layers)) if (l.type === "smart" && l.contents.id === cid) out = _chunkAEAAN4ADcjs.mapLayer.call(void 0, out, l.id, (x) => ({ ...x, contents: decoded }));
@@ -5670,10 +5679,10 @@ var ImageEditorController = (_class7 = class {
5670
5679
  * Contents can nest. Returns the contents' size and layer ids.
5671
5680
  */
5672
5681
  editSmartObjectContents(id) {
5673
- if (this.getFreeTransform()) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("A Free Transform is open; commit or cancel it first.");
5674
- const layer = _chunkXN2NBLV5cjs.requireSmartObject.call(void 0, this.state.layers, id);
5682
+ if (this.getFreeTransform()) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("A Free Transform is open; commit or cancel it first.");
5683
+ const layer = _chunkPMEHFHSPcjs.requireSmartObject.call(void 0, this.state.layers, id);
5675
5684
  const c = layer.contents;
5676
- if (!_chunkXN2NBLV5cjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`The contents of "${layer.name || id}" are a ${_nullishCoalesce(_optionalChain([c, 'access', _200 => _200.file, 'optionalAccess', _201 => _201.type]), () => ( "file"))} that could not be decoded here; run prepareSmartObjects() in a browser first.`);
5685
+ if (!_chunkPMEHFHSPcjs.isContentsDecoded.call(void 0, c)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`The contents of "${layer.name || id}" are a ${_nullishCoalesce(_optionalChain([c, 'access', _200 => _200.file, 'optionalAccess', _201 => _201.type]), () => ( "file"))} that could not be decoded here; run prepareSmartObjects() in a browser first.`);
5677
5686
  const saved = {
5678
5687
  state: { ...this.state },
5679
5688
  undo: this.undoStack,
@@ -5684,7 +5693,7 @@ var ImageEditorController = (_class7 = class {
5684
5693
  samplePixelsOverride: this.samplePixelsOverride,
5685
5694
  psdResolution: this.psdResolution
5686
5695
  };
5687
- const layers = c.kind === "document" ? c.document.layers : [{ type: "pixel", id: _chunkXN2NBLV5cjs.newLayerId.call(void 0, ), name: "Layer 0", visible: true, opacity: 1, blend: "normal", surface: c.raster, offset: { x: 0, y: 0 } }];
5696
+ const layers = c.kind === "document" ? c.document.layers : [{ type: "pixel", id: _chunkPMEHFHSPcjs.newLayerId.call(void 0, ), name: "Layer 0", visible: true, opacity: 1, blend: "normal", surface: c.raster, offset: { x: 0, y: 0 } }];
5688
5697
  this.contentsStack.push({ layerId: layer.id, contentsId: c.id, name: layer.name || c.name, saved });
5689
5698
  const s = this.state;
5690
5699
  this.state = {
@@ -5692,7 +5701,7 @@ var ImageEditorController = (_class7 = class {
5692
5701
  sourceUrl: null,
5693
5702
  imageDimensions: { width: c.width, height: c.height },
5694
5703
  crop: null,
5695
- transform: { ..._chunkXN2NBLV5cjs.DEFAULT_TRANSFORM_VALUES },
5704
+ transform: { ..._chunkPMEHFHSPcjs.DEFAULT_TRANSFORM_VALUES },
5696
5705
  layers,
5697
5706
  activeLayerId: layers.length ? layers[layers.length - 1].id : null,
5698
5707
  activeTarget: "pixels",
@@ -5725,7 +5734,7 @@ var ImageEditorController = (_class7 = class {
5725
5734
  */
5726
5735
  closeSmartObjectContents(save = true) {
5727
5736
  const top = this.contentsStack.pop();
5728
- if (!top) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("No smart object contents are open; open them with edit_smart_object_contents.");
5737
+ if (!top) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("No smart object contents are open; open them with edit_smart_object_contents.");
5729
5738
  if (_optionalChain([this, 'access', _207 => _207.openTransform, 'optionalAccess', _208 => _208.isOpen])) this.openTransform.cancel();
5730
5739
  this.openTransform = null;
5731
5740
  const edited = this.state;
@@ -5739,10 +5748,10 @@ var ImageEditorController = (_class7 = class {
5739
5748
  const plain3 = _optionalChain([only, 'optionalAccess', _211 => _211.type]) === "pixel" && only.visible && only.opacity === 1 && only.blend === "normal" && !only.mask && !only.effects && !_optionalChain([only, 'access', _212 => _212.filters, 'optionalAccess', _213 => _213.length]) && !only.clipped && (_nullishCoalesce(only.fillOpacity, () => ( 1))) === 1 && only.source !== "document";
5740
5749
  if (_optionalChain([old, 'optionalAccess', _214 => _214.kind]) === "raster" && plain3) {
5741
5750
  const px2 = _chunkO7LUD7MHcjs.readRegion.call(void 0, only.surface, { x: -only.offset.x, y: -only.offset.y, width, height });
5742
- next = _chunkXN2NBLV5cjs.rasterContents.call(void 0, { width, height, data: px2 }, old.name, old.id);
5751
+ next = _chunkPMEHFHSPcjs.rasterContents.call(void 0, { width, height, data: px2 }, old.name, old.id);
5743
5752
  } else {
5744
5753
  const doc = { layers: edited.layers, globalLight: edited.globalLight, patterns: edited.patterns };
5745
- next = _chunkXN2NBLV5cjs.documentContents.call(void 0, doc, width, height, _optionalChain([old, 'optionalAccess', _215 => _215.kind]) === "document" ? old.name : `${(_nullishCoalesce(_optionalChain([old, 'optionalAccess', _216 => _216.name]), () => ( "Contents"))).replace(/\.\w+$/, "")}.psb`, top.contentsId);
5754
+ next = _chunkPMEHFHSPcjs.documentContents.call(void 0, doc, width, height, _optionalChain([old, 'optionalAccess', _215 => _215.kind]) === "document" ? old.name : `${(_nullishCoalesce(_optionalChain([old, 'optionalAccess', _216 => _216.name]), () => ( "Contents"))).replace(/\.\w+$/, "")}.psb`, top.contentsId);
5746
5755
  }
5747
5756
  }
5748
5757
  const saved = top.saved;
@@ -5761,7 +5770,7 @@ var ImageEditorController = (_class7 = class {
5761
5770
  this.notify();
5762
5771
  return { layerId: top.layerId, changed: false, layerIds: [] };
5763
5772
  }
5764
- const res = _chunkXN2NBLV5cjs.replaceContents.call(void 0, this.state.layers, top.contentsId, next, this.canvasSize);
5773
+ const res = _chunkPMEHFHSPcjs.replaceContents.call(void 0, this.state.layers, top.contentsId, next, this.canvasSize);
5765
5774
  this.commitLayers(res.layers);
5766
5775
  return { layerId: top.layerId, changed: true, layerIds: res.ids };
5767
5776
  }
@@ -5776,35 +5785,35 @@ var ImageEditorController = (_class7 = class {
5776
5785
  // --- Layer effects ---
5777
5786
  /** A layer's effects (an empty, enabled list when it has none). */
5778
5787
  getLayerEffects(id) {
5779
- return _chunkXN2NBLV5cjs.layerEffectsOf.call(void 0, _chunkXN2NBLV5cjs.requireLayer.call(void 0, this.state.layers, id).layer);
5788
+ return _chunkPMEHFHSPcjs.layerEffectsOf.call(void 0, _chunkPMEHFHSPcjs.requireLayer.call(void 0, this.state.layers, id).layer);
5780
5789
  }
5781
5790
  /**
5782
5791
  * Adds an effect of `kind` with Photoshop's defaults and `params` applied (one undo step), at
5783
5792
  * `index` in the layer's effect list (default the end). Returns the new effect and the effects.
5784
5793
  */
5785
5794
  addLayerEffect(id, kind, params = {}, index) {
5786
- const res = _chunkXN2NBLV5cjs.addLayerEffect.call(void 0, this.state.layers, id, kind, params, index);
5795
+ const res = _chunkPMEHFHSPcjs.addLayerEffect.call(void 0, this.state.layers, id, kind, params, index);
5787
5796
  this.commitLayers(res.layers);
5788
5797
  return { effect: res.effect, effects: this.getLayerEffects(id) };
5789
5798
  }
5790
5799
  /** Changes one effect (one undo step, or none with `commitToHistory = false` during a drag). Returns the effects. */
5791
5800
  updateLayerEffect(id, effectId, changes, commitToHistory = true) {
5792
- this.commitLayers(_chunkXN2NBLV5cjs.updateLayerEffect.call(void 0, this.state.layers, id, effectId, changes), void 0, commitToHistory);
5801
+ this.commitLayers(_chunkPMEHFHSPcjs.updateLayerEffect.call(void 0, this.state.layers, id, effectId, changes), void 0, commitToHistory);
5793
5802
  return this.getLayerEffects(id);
5794
5803
  }
5795
5804
  /** Removes one effect (one undo step). Returns the remaining effects. */
5796
5805
  removeLayerEffect(id, effectId) {
5797
- this.commitLayers(_chunkXN2NBLV5cjs.removeLayerEffect.call(void 0, this.state.layers, id, effectId));
5806
+ this.commitLayers(_chunkPMEHFHSPcjs.removeLayerEffect.call(void 0, this.state.layers, id, effectId));
5798
5807
  return this.getLayerEffects(id);
5799
5808
  }
5800
5809
  /** Turns a layer's effects on or off as a whole and, when given, sets Scale Effects (one undo step). */
5801
5810
  setLayerEffectsEnabled(id, enabled, scale, commitToHistory = true) {
5802
- this.commitLayers(_chunkXN2NBLV5cjs.setLayerEffectsEnabled.call(void 0, this.state.layers, id, enabled, scale), void 0, commitToHistory);
5811
+ this.commitLayers(_chunkPMEHFHSPcjs.setLayerEffectsEnabled.call(void 0, this.state.layers, id, enabled, scale), void 0, commitToHistory);
5803
5812
  return this.getLayerEffects(id);
5804
5813
  }
5805
5814
  /** Replaces a layer's effects (one undo step; `null` removes them). Returns the effects. */
5806
5815
  setLayerEffects(id, effects, commitToHistory = true) {
5807
- this.commitLayers(_chunkXN2NBLV5cjs.setLayerEffects.call(void 0, this.state.layers, id, effects), void 0, commitToHistory);
5816
+ this.commitLayers(_chunkPMEHFHSPcjs.setLayerEffects.call(void 0, this.state.layers, id, effects), void 0, commitToHistory);
5808
5817
  return this.getLayerEffects(id);
5809
5818
  }
5810
5819
  __init76() {this.patternIds = /* @__PURE__ */ new WeakMap()}
@@ -5830,8 +5839,8 @@ var ImageEditorController = (_class7 = class {
5830
5839
  /** Sets the global light (one undo step). `angle` -360..360°, `altitude` 0..90°. Returns it. */
5831
5840
  setGlobalLight(light, commitToHistory = true) {
5832
5841
  const next = { ...this.getGlobalLight(), ...light };
5833
- if (!(Number.isFinite(next.angle) && next.angle >= -360 && next.angle <= 360)) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`angle must be from -360 to 360 degrees, got ${next.angle}.`);
5834
- if (!(Number.isFinite(next.altitude) && next.altitude >= 0 && next.altitude <= 90)) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`altitude must be from 0 to 90 degrees, got ${next.altitude}.`);
5842
+ if (!(Number.isFinite(next.angle) && next.angle >= -360 && next.angle <= 360)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`angle must be from -360 to 360 degrees, got ${next.angle}.`);
5843
+ if (!(Number.isFinite(next.altitude) && next.altitude >= 0 && next.altitude <= 90)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`altitude must be from 0 to 90 degrees, got ${next.altitude}.`);
5835
5844
  if (commitToHistory) this.recordHistory();
5836
5845
  if (next.angle === _chunkAEAAN4ADcjs.DEFAULT_GLOBAL_LIGHT.angle && next.altitude === _chunkAEAAN4ADcjs.DEFAULT_GLOBAL_LIGHT.altitude) delete this.state.globalLight;
5837
5846
  else this.state.globalLight = next;
@@ -5842,16 +5851,16 @@ var ImageEditorController = (_class7 = class {
5842
5851
  async compositeToSurface(layers, rect) {
5843
5852
  const { width, height } = this.naturalSize;
5844
5853
  if (_chunkAEAAN4ADcjs.flattenLayers.call(void 0, layers).some((l) => l.type === "annotation" && l.visible) && !this.renderer.canRasterize()) {
5845
- throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("Merging annotation layers needs a canvas (a browser); hide or delete them first, or merge in the browser.");
5854
+ throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Merging annotation layers needs a canvas (a browser); hide or delete them first, or merge in the browser.");
5846
5855
  }
5847
5856
  await this.renderer.prepareLayerAssets(layers, width, height);
5848
5857
  const sources = this.renderer.compositorSources(width, height);
5849
5858
  const depth = this.bitDepth;
5850
5859
  if (depth !== 8) {
5851
- const samples = _chunkAEAAN4ADcjs.workingToSamples.call(void 0, _chunkXN2NBLV5cjs.compositeDeep.call(void 0, layers, rect, sources, depth), depth);
5860
+ const samples = _chunkAEAAN4ADcjs.workingToSamples.call(void 0, _chunkPMEHFHSPcjs.compositeDeep.call(void 0, layers, rect, sources, depth), depth);
5852
5861
  return _chunkO7LUD7MHcjs.surfaceFromDeepPixels.call(void 0, { width: rect.width, height: rect.height, data: samples }, 4, rect.x, rect.y);
5853
5862
  }
5854
- const data = new (0, _chunkXN2NBLV5cjs.LayerCompositor)().composite(layers, rect, sources);
5863
+ const data = new (0, _chunkPMEHFHSPcjs.LayerCompositor)().composite(layers, rect, sources);
5855
5864
  return _chunkO7LUD7MHcjs.surfaceFromPixels.call(void 0, { width: rect.width, height: rect.height, data }, 4, rect.x, rect.y);
5856
5865
  }
5857
5866
  /**
@@ -5864,22 +5873,22 @@ var ImageEditorController = (_class7 = class {
5864
5873
  const r = _nullishCoalesce(rect, () => ( { x: 0, y: 0, width, height }));
5865
5874
  const depth = this.bitDepth;
5866
5875
  if (depth === 8) return { width: r.width, height: r.height, depth: 16, data: _chunkO7LUD7MHcjs.to16From8.call(void 0, this.compositePixels(r).data) };
5867
- const data = _chunkAEAAN4ADcjs.workingToSamples.call(void 0, _chunkXN2NBLV5cjs.compositeDeep.call(void 0, this.state.layers, r, this.compositorSources(), depth), depth);
5876
+ const data = _chunkAEAAN4ADcjs.workingToSamples.call(void 0, _chunkPMEHFHSPcjs.compositeDeep.call(void 0, this.state.layers, r, this.compositorSources(), depth), depth);
5868
5877
  return { width: r.width, height: r.height, depth, data };
5869
5878
  }
5870
5879
  /** Document bounds a layer can paint into (pixel content, annotations, or the canvas for the rest). */
5871
5880
  paintBounds(layer) {
5872
5881
  const { width, height } = this.naturalSize;
5873
5882
  const canvas = { x: 0, y: 0, width, height };
5874
- if (_chunkXN2NBLV5cjs.hasSurface.call(void 0, layer)) return _nullishCoalesce(this.getLayerBounds(layer.id), () => ( { x: 0, y: 0, width: 0, height: 0 }));
5883
+ if (_chunkPMEHFHSPcjs.hasSurface.call(void 0, layer)) return _nullishCoalesce(this.getLayerBounds(layer.id), () => ( { x: 0, y: 0, width: 0, height: 0 }));
5875
5884
  if (layer.type === "annotation") {
5876
- const b = _chunkXN2NBLV5cjs.getAnnotationBounds.call(void 0, layer.annotation);
5885
+ const b = _chunkPMEHFHSPcjs.getAnnotationBounds.call(void 0, layer.annotation);
5877
5886
  const pad = 4 + ("strokeWidth" in layer.annotation ? layer.annotation.strokeWidth : 0);
5878
5887
  return coveringRect({ x: b.x - pad, y: b.y - pad, width: b.width + 2 * pad, height: b.height + 2 * pad });
5879
5888
  }
5880
5889
  if (layer.type === "group") {
5881
5890
  let r = null;
5882
- for (const c of layer.children) r = _chunkXN2NBLV5cjs.unionRect.call(void 0, r, this.paintBounds(c));
5891
+ for (const c of layer.children) r = _chunkPMEHFHSPcjs.unionRect.call(void 0, r, this.paintBounds(c));
5883
5892
  return _nullishCoalesce(r, () => ( canvas));
5884
5893
  }
5885
5894
  return canvas;
@@ -5890,16 +5899,16 @@ var ImageEditorController = (_class7 = class {
5890
5899
  * Returns the merged id.
5891
5900
  */
5892
5901
  async mergeDown(id) {
5893
- const loc = _chunkXN2NBLV5cjs.requireLayer.call(void 0, this.state.layers, id);
5902
+ const loc = _chunkPMEHFHSPcjs.requireLayer.call(void 0, this.state.layers, id);
5894
5903
  const upper = loc.layer;
5895
5904
  const siblings = loc.parent ? loc.parent.children : this.state.layers;
5896
5905
  const lower = siblings[loc.index - 1];
5897
- if (!lower) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`Layer "${upper.name || id}" is the bottom of its group; there is nothing below to merge into.`);
5898
- if (lower.type !== "pixel") throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`Merge Down needs a pixel layer below; "${lower.name || lower.id}" is a ${lower.type} layer. Move the layer or merge into another one.`);
5899
- if (!upper.visible) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`Layer "${upper.name || id}" is hidden; show it or delete it instead of merging.`);
5900
- _chunkXN2NBLV5cjs.requireUnlocked.call(void 0, upper, "all", "merge it");
5901
- _chunkXN2NBLV5cjs.requireUnlocked.call(void 0, lower, "pixels", "merge into it");
5902
- let rect = _nullishCoalesce(_chunkXN2NBLV5cjs.unionRect.call(void 0, this.paintBounds(lower), upper.type === "adjustment" ? null : this.paintBounds(upper)), () => ( { x: 0, y: 0, width: 1, height: 1 }));
5906
+ if (!lower) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Layer "${upper.name || id}" is the bottom of its group; there is nothing below to merge into.`);
5907
+ if (lower.type !== "pixel") throw new (0, _chunkPMEHFHSPcjs.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.`);
5908
+ if (!upper.visible) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Layer "${upper.name || id}" is hidden; show it or delete it instead of merging.`);
5909
+ _chunkPMEHFHSPcjs.requireUnlocked.call(void 0, upper, "all", "merge it");
5910
+ _chunkPMEHFHSPcjs.requireUnlocked.call(void 0, lower, "pixels", "merge into it");
5911
+ let rect = _nullishCoalesce(_chunkPMEHFHSPcjs.unionRect.call(void 0, this.paintBounds(lower), upper.type === "adjustment" ? null : this.paintBounds(upper)), () => ( { x: 0, y: 0, width: 1, height: 1 }));
5903
5912
  const reach = Math.max(_chunkAEAAN4ADcjs.effectsMargin.call(void 0, lower.effects), upper.type === "adjustment" ? 0 : _chunkAEAAN4ADcjs.effectsMargin.call(void 0, upper.effects));
5904
5913
  if (reach) rect = { x: rect.x - reach, y: rect.y - reach, width: rect.width + 2 * reach, height: rect.height + 2 * reach };
5905
5914
  const base = { ...lower, blend: "normal", opacity: 1 };
@@ -5925,12 +5934,12 @@ var ImageEditorController = (_class7 = class {
5925
5934
  */
5926
5935
  async mergeVisible() {
5927
5936
  const visible = this.state.layers.filter((l) => l.visible);
5928
- if (!visible.length) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("No layer is visible.");
5937
+ if (!visible.length) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("No layer is visible.");
5929
5938
  const { width, height } = this.naturalSize;
5930
5939
  const surface = await this.compositeToSurface(visible, { x: 0, y: 0, width, height });
5931
5940
  const merged = {
5932
5941
  type: "pixel",
5933
- id: _chunkXN2NBLV5cjs.newLayerId.call(void 0, ),
5942
+ id: _chunkPMEHFHSPcjs.newLayerId.call(void 0, ),
5934
5943
  name: "Merged",
5935
5944
  visible: true,
5936
5945
  opacity: 1,
@@ -5954,8 +5963,8 @@ var ImageEditorController = (_class7 = class {
5954
5963
  const surface = await this.compositeToSurface(this.state.layers, { x: 0, y: 0, width, height });
5955
5964
  const bg = {
5956
5965
  type: "pixel",
5957
- id: _chunkXN2NBLV5cjs.BACKGROUND_LAYER_ID,
5958
- name: _chunkXN2NBLV5cjs.BACKGROUND_LAYER_NAME,
5966
+ id: _chunkPMEHFHSPcjs.BACKGROUND_LAYER_ID,
5967
+ name: _chunkPMEHFHSPcjs.BACKGROUND_LAYER_NAME,
5959
5968
  visible: true,
5960
5969
  opacity: 1,
5961
5970
  blend: "normal",
@@ -5982,7 +5991,7 @@ var ImageEditorController = (_class7 = class {
5982
5991
  const k = Math.min(1, side / Math.max(width, height));
5983
5992
  const tw = Math.max(1, Math.round(width * k));
5984
5993
  const th = Math.max(1, Math.round(height * k));
5985
- const surface = options.mask ? layer.mask && !layer.mask.source ? layer.mask.surface : null : _chunkXN2NBLV5cjs.hasSurface.call(void 0, layer) ? this.surfaceOf(layer) : null;
5994
+ const surface = options.mask ? layer.mask && !layer.mask.source ? layer.mask.surface : null : _chunkPMEHFHSPcjs.hasSurface.call(void 0, layer) ? this.surfaceOf(layer) : null;
5986
5995
  if (!surface) return null;
5987
5996
  const ox = layer.type === "pixel" ? layer.offset.x : 0;
5988
5997
  const oy = layer.type === "pixel" ? layer.offset.y : 0;
@@ -6024,7 +6033,7 @@ var ImageEditorController = (_class7 = class {
6024
6033
  /** Brush settings, colours and tool options of the paint tools (view state, no undo). */
6025
6034
  setPaintOptions(options) {
6026
6035
  const cur = this.state.paint;
6027
- const retouch = options.retouch ? _chunkTLCTTQFFcjs.normalizeRetouch.call(void 0, options.retouch, cur.retouch) : cur.retouch;
6036
+ const retouch = options.retouch ? _chunkVEHVXRJUcjs.normalizeRetouch.call(void 0, options.retouch, cur.retouch) : cur.retouch;
6028
6037
  const cloneSource = cur.cloneSource && retouch.aligned !== cur.retouch.aligned ? { ...cur.cloneSource, offset: null } : cur.cloneSource;
6029
6038
  let source = cur.paint;
6030
6039
  let foreground = options.foreground !== void 0 ? toHex(parseColor(options.foreground)) : cur.foreground;
@@ -6035,11 +6044,11 @@ var ImageEditorController = (_class7 = class {
6035
6044
  }
6036
6045
  if (source.type === "color" || options.foreground !== void 0) source = { type: "color", color: foreground };
6037
6046
  const next = {
6038
- brush: options.brush ? _chunkQBWEH3IMcjs.normalizeBrush.call(void 0, { ...cur.brush, ...options.brush }) : cur.brush,
6047
+ brush: options.brush ? _chunk3T5O225Tcjs.normalizeBrush.call(void 0, { ...cur.brush, ...options.brush }) : cur.brush,
6039
6048
  foreground,
6040
6049
  background: options.background !== void 0 ? toHex(parseColor(options.background)) : cur.background,
6041
6050
  paint: source,
6042
- mixer: options.mixer ? _chunkQBWEH3IMcjs.normalizeMixer.call(void 0, { ...cur.mixer, ...options.mixer }) : cur.mixer,
6051
+ mixer: options.mixer ? _chunk3T5O225Tcjs.normalizeMixer.call(void 0, { ...cur.mixer, ...options.mixer }) : cur.mixer,
6043
6052
  mixerLoad: cur.mixerLoad,
6044
6053
  retouch,
6045
6054
  cloneSource,
@@ -6055,30 +6064,30 @@ var ImageEditorController = (_class7 = class {
6055
6064
  */
6056
6065
  loadMixerBrush(color) {
6057
6066
  const c = parseColor(_nullishCoalesce(color, () => ( this.state.paint.foreground)));
6058
- const load = _chunkQBWEH3IMcjs.loadMixer.call(void 0, this.state.paint.mixerLoad, [c[0] / 255, c[1] / 255, c[2] / 255]);
6067
+ const load = _chunk3T5O225Tcjs.loadMixer.call(void 0, this.state.paint.mixerLoad, [c[0] / 255, c[1] / 255, c[2] / 255]);
6059
6068
  this.state.paint = { ...this.state.paint, mixerLoad: load };
6060
6069
  this.notify();
6061
6070
  return load;
6062
6071
  }
6063
6072
  /** Cleans the Mixer Brush: empties the pickup well (the reservoir is kept). Returns the brush load. */
6064
6073
  cleanMixerBrush() {
6065
- const load = _chunkQBWEH3IMcjs.cleanMixer.call(void 0, this.state.paint.mixerLoad);
6074
+ const load = _chunk3T5O225Tcjs.cleanMixer.call(void 0, this.state.paint.mixerLoad);
6066
6075
  this.state.paint = { ...this.state.paint, mixerLoad: load };
6067
6076
  this.notify();
6068
6077
  return load;
6069
6078
  }
6070
6079
  /** Empties the Mixer Brush entirely (no reservoir, nothing picked up). Returns the brush load. */
6071
6080
  emptyMixerBrush() {
6072
- this.state.paint = { ...this.state.paint, mixerLoad: _chunkQBWEH3IMcjs.EMPTY_MIXER_LOAD };
6081
+ this.state.paint = { ...this.state.paint, mixerLoad: _chunk3T5O225Tcjs.EMPTY_MIXER_LOAD };
6073
6082
  this.notify();
6074
- return _chunkQBWEH3IMcjs.EMPTY_MIXER_LOAD;
6083
+ return _chunk3T5O225Tcjs.EMPTY_MIXER_LOAD;
6075
6084
  }
6076
6085
  /**
6077
6086
  * Sets (Alt-click) or clears the Clone Stamp and Healing Brush source point, in document
6078
6087
  * pixels. The next stroke fixes the offset from its first point. View state, no undo.
6079
6088
  */
6080
6089
  setCloneSource(point) {
6081
- if (point && (!Number.isFinite(point.x) || !Number.isFinite(point.y))) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("The clone source needs finite x and y (document pixels).");
6090
+ if (point && (!Number.isFinite(point.x) || !Number.isFinite(point.y))) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("The clone source needs finite x and y (document pixels).");
6082
6091
  const source = point ? { x: Math.round(point.x), y: Math.round(point.y), offset: null } : null;
6083
6092
  this.state.paint = { ...this.state.paint, cloneSource: source };
6084
6093
  this.notify();
@@ -6091,12 +6100,12 @@ var ImageEditorController = (_class7 = class {
6091
6100
  */
6092
6101
  setCloneTransform(t) {
6093
6102
  const cur = this.state.paint.cloneTransform;
6094
- const next = t ? { ...cur, ...t } : { ..._chunkTLCTTQFFcjs.IDENTITY_CLONE_TRANSFORM };
6103
+ const next = t ? { ...cur, ...t } : { ..._chunkVEHVXRJUcjs.IDENTITY_CLONE_TRANSFORM };
6095
6104
  for (const k of ["scaleX", "scaleY"]) {
6096
6105
  const v = next[k];
6097
- if (!Number.isFinite(v) || Math.abs(v) < 0.01 || Math.abs(v) > 10) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`${k} must be a scale factor between 0.01 and 10 in size (negative flips), not ${String(v)}.`);
6106
+ if (!Number.isFinite(v) || Math.abs(v) < 0.01 || Math.abs(v) > 10) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`${k} must be a scale factor between 0.01 and 10 in size (negative flips), not ${String(v)}.`);
6098
6107
  }
6099
- if (!Number.isFinite(next.rotate)) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("rotate must be a number of degrees.");
6108
+ if (!Number.isFinite(next.rotate)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("rotate must be a number of degrees.");
6100
6109
  next.rotate = ((next.rotate + 180) % 360 + 360) % 360 - 180;
6101
6110
  this.state.paint = { ...this.state.paint, cloneTransform: next };
6102
6111
  this.notify();
@@ -6114,27 +6123,27 @@ var ImageEditorController = (_class7 = class {
6114
6123
  /** Resolves and validates what a stroke, fill or clear paints into. */
6115
6124
  paintTarget(layerId, channel, action) {
6116
6125
  const id = _nullishCoalesce(layerId, () => ( this.state.activeLayerId));
6117
- if (!id) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`No layer given and none is active; pass layerId (see list_layers) to ${action}.`);
6118
- const layer = _chunkXN2NBLV5cjs.requireLayer.call(void 0, this.state.layers, id).layer;
6126
+ if (!id) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`No layer given and none is active; pass layerId (see list_layers) to ${action}.`);
6127
+ const layer = _chunkPMEHFHSPcjs.requireLayer.call(void 0, this.state.layers, id).layer;
6119
6128
  const ch = _nullishCoalesce(channel, () => ( (id === this.state.activeLayerId ? this.state.activeTarget : "pixels")));
6120
6129
  if (ch === "mask") {
6121
- if (!layer.mask) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask to ${action}; add one with add_layer_mask, or target pixels.`);
6122
- if (layer.mask.source) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`Layer "${layer.name || id}" has a depth mask, which is generated, not painted.`);
6123
- _chunkXN2NBLV5cjs.requireUnlocked.call(void 0, layer, "all", action);
6130
+ if (!layer.mask) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask to ${action}; add one with add_layer_mask, or target pixels.`);
6131
+ if (layer.mask.source) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Layer "${layer.name || id}" has a depth mask, which is generated, not painted.`);
6132
+ _chunkPMEHFHSPcjs.requireUnlocked.call(void 0, layer, "all", action);
6124
6133
  } else if (ch === "filter-mask") {
6125
6134
  if (layer.type !== "smart" || !_optionalChain([layer, 'access', _224 => _224.smartFilters, 'optionalAccess', _225 => _225.mask])) {
6126
- throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`Layer "${layer.name || id}" has no smart filter mask to ${action}; add one with set_smart_filter_mask, or target pixels or mask.`);
6135
+ throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Layer "${layer.name || id}" has no smart filter mask to ${action}; add one with set_smart_filter_mask, or target pixels or mask.`);
6127
6136
  }
6128
- if (!_chunkXN2NBLV5cjs.isContentsDecoded.call(void 0, layer.contents)) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`The contents of "${layer.name || id}" are not decoded here, so its filter mask cannot be painted; run prepareSmartObjects() first.`);
6129
- _chunkXN2NBLV5cjs.requireUnlocked.call(void 0, layer, "all", action);
6137
+ if (!_chunkPMEHFHSPcjs.isContentsDecoded.call(void 0, layer.contents)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`The contents of "${layer.name || id}" are not decoded here, so its filter mask cannot be painted; run prepareSmartObjects() first.`);
6138
+ _chunkPMEHFHSPcjs.requireUnlocked.call(void 0, layer, "all", action);
6130
6139
  } else {
6131
- if (layer.type === "smart") throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`Layer "${layer.name || id}" is a smart object; its pixels come from its contents. Rasterize it (rasterize_smart_object), edit its contents (edit_smart_object_contents), or ${action} on its mask or filter mask.`);
6132
- if (layer.type === "shape") throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`Layer "${layer.name || id}" is a shape layer; its pixels are drawn from its paths. Rasterize it first (rasterize_layer), or ${action} on its mask (channel mask).`);
6133
- if (layer.type === "type") throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`Layer "${layer.name || id}" is a type layer; its pixels are drawn from its text. Rasterize it first (rasterize_layer), or ${action} on its mask (channel mask).`);
6134
- if (layer.type !== "pixel") throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`Layer "${layer.name || id}" is a ${layer.type} layer; ${action} on a pixel layer, or on this layer's mask (channel mask).`);
6135
- _chunkXN2NBLV5cjs.requireUnlocked.call(void 0, layer, "pixels", action);
6140
+ if (layer.type === "smart") throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Layer "${layer.name || id}" is a smart object; its pixels come from its contents. Rasterize it (rasterize_smart_object), edit its contents (edit_smart_object_contents), or ${action} on its mask or filter mask.`);
6141
+ if (layer.type === "shape") throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Layer "${layer.name || id}" is a shape layer; its pixels are drawn from its paths. Rasterize it first (rasterize_layer), or ${action} on its mask (channel mask).`);
6142
+ if (layer.type === "type") throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Layer "${layer.name || id}" is a type layer; its pixels are drawn from its text. Rasterize it first (rasterize_layer), or ${action} on its mask (channel mask).`);
6143
+ if (layer.type !== "pixel") throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Layer "${layer.name || id}" is a ${layer.type} layer; ${action} on a pixel layer, or on this layer's mask (channel mask).`);
6144
+ _chunkPMEHFHSPcjs.requireUnlocked.call(void 0, layer, "pixels", action);
6136
6145
  }
6137
- if (!layer.visible) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`Layer "${layer.name || id}" is hidden; show it before you ${action}.`);
6146
+ if (!layer.visible) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Layer "${layer.name || id}" is hidden; show it before you ${action}.`);
6138
6147
  const offset = layer.type === "pixel" ? layer.offset : { x: 0, y: 0 };
6139
6148
  const surface = ch === "mask" ? layer.mask.surface : ch === "filter-mask" ? layer.smartFilters.mask.surface : this.surfaceOf(layer);
6140
6149
  const lockTransparency = ch === "pixels" && Boolean(_optionalChain([layer, 'access', _226 => _226.locks, 'optionalAccess', _227 => _227.transparency]));
@@ -6143,7 +6152,7 @@ var ImageEditorController = (_class7 = class {
6143
6152
  /** The layer with its pixels (or mask) replaced by `surface`. */
6144
6153
  withSurface(layer, channel, surface) {
6145
6154
  if (channel === "mask") return { ...layer, mask: { ...layer.mask, surface } };
6146
- if (channel === "filter-mask") return _chunkXN2NBLV5cjs.withFilterMaskSurface.call(void 0, layer, surface, this.canvasSize);
6155
+ if (channel === "filter-mask") return _chunkPMEHFHSPcjs.withFilterMaskSurface.call(void 0, layer, surface, this.canvasSize);
6147
6156
  const next = { ...layer, surface };
6148
6157
  delete next.source;
6149
6158
  return next;
@@ -6156,12 +6165,12 @@ var ImageEditorController = (_class7 = class {
6156
6165
  */
6157
6166
  beginStroke(init = {}) {
6158
6167
  const tool = _nullishCoalesce(init.tool, () => ( "brush"));
6159
- if (!STROKE_TOOLS.includes(tool)) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`Unknown paint tool "${String(tool)}"; use one of ${STROKE_TOOLS.join(", ")}.`);
6168
+ if (!STROKE_TOOLS.includes(tool)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Unknown paint tool "${String(tool)}"; use one of ${STROKE_TOOLS.join(", ")}.`);
6160
6169
  const target = this.paintTarget(init.layerId, init.channel, tool === "eraser" ? "erase" : isRetouchTool(tool) ? "retouch" : "paint");
6161
6170
  if (tool === "mixer" && target.channel !== "pixels") {
6162
- throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("The Mixer Brush paints colour on pixels, not on masks; target pixels (channel pixels), or paint the mask with the brush.");
6171
+ throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("The Mixer Brush paints colour on pixels, not on masks; target pixels (channel pixels), or paint the mask with the brush.");
6163
6172
  }
6164
- const brush = _chunkQBWEH3IMcjs.normalizeBrush.call(void 0, { ...this.state.paint.brush, ..._nullishCoalesce(init.brush, () => ( {})) });
6173
+ const brush = _chunk3T5O225Tcjs.normalizeBrush.call(void 0, { ...this.state.paint.brush, ..._nullishCoalesce(init.brush, () => ( {})) });
6165
6174
  let strokePaint = null;
6166
6175
  if (init.paint !== void 0) {
6167
6176
  strokePaint = readImagePaint(init.paint);
@@ -6186,16 +6195,16 @@ var ImageEditorController = (_class7 = class {
6186
6195
  const depth = target.channel !== "filter-mask" && this.bitDepth !== 8 ? this.bitDepth : null;
6187
6196
  if (tool === "mixer") return new PaintStrokeSession(this, target, this.mixerStroke(init, brush), apply, depth);
6188
6197
  if (isRetouchTool(tool)) return new PaintStrokeSession(this, target, this.retouchStroke(tool, init, brush, target, apply), apply, depth);
6189
- const gradient = tool === "brush" && _optionalChain([strokePaint, 'optionalAccess', _231 => _231.type]) === "gradient" ? _chunkQBWEH3IMcjs.resolvePaintGradient.call(void 0, strokePaint, { paint: toHex(color), secondary: toHex(background) }) : null;
6190
- return new PaintStrokeSession(this, target, new (0, _chunkQBWEH3IMcjs.StrokeCoverage)(brush, gradient, _nullishCoalesce(init.seed, () => ( 0))), apply, depth);
6198
+ const gradient = tool === "brush" && _optionalChain([strokePaint, 'optionalAccess', _231 => _231.type]) === "gradient" ? _chunk3T5O225Tcjs.resolvePaintGradient.call(void 0, strokePaint, { paint: toHex(color), secondary: toHex(background) }) : null;
6199
+ return new PaintStrokeSession(this, target, new (0, _chunk3T5O225Tcjs.StrokeCoverage)(brush, gradient, _nullishCoalesce(init.seed, () => ( 0))), apply, depth);
6191
6200
  }
6192
6201
  /** A retouching stroke's start: its settings, what it samples and how it composites. */
6193
6202
  retouchStroke(tool, init, brush, target, apply) {
6194
- const settings = _chunkTLCTTQFFcjs.normalizeRetouch.call(void 0, _nullishCoalesce(init.retouch, () => ( {})), this.state.paint.retouch);
6203
+ const settings = _chunkVEHVXRJUcjs.normalizeRetouch.call(void 0, _nullishCoalesce(init.retouch, () => ( {})), this.state.paint.retouch);
6195
6204
  const mask = target.channel !== "pixels";
6196
- if (tool === "sponge" && mask) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("The Sponge changes saturation, and a mask has none; target pixels (channel pixels), or use dodge or burn on the mask.");
6197
- if (tool === "smudge") return { kind: "dabs", create: (pixels) => new (0, _chunkTLCTTQFFcjs.RetouchDabStroke)(brush, pixels, _chunkTLCTTQFFcjs.smudgeEffect.call(void 0, brush, settings.strength)) };
6198
- if (tool === "sponge") return { kind: "dabs", create: (pixels) => new (0, _chunkTLCTTQFFcjs.RetouchDabStroke)(brush, pixels, _chunkTLCTTQFFcjs.spongeEffect.call(void 0, brush, settings.spongeMode === "saturate", settings.vibrance)) };
6205
+ if (tool === "sponge" && mask) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("The Sponge changes saturation, and a mask has none; target pixels (channel pixels), or use dodge or burn on the mask.");
6206
+ if (tool === "smudge") return { kind: "dabs", create: (pixels) => new (0, _chunkVEHVXRJUcjs.RetouchDabStroke)(brush, pixels, _chunkVEHVXRJUcjs.smudgeEffect.call(void 0, brush, settings.strength)) };
6207
+ if (tool === "sponge") return { kind: "dabs", create: (pixels) => new (0, _chunkVEHVXRJUcjs.RetouchDabStroke)(brush, pixels, _chunkVEHVXRJUcjs.spongeEffect.call(void 0, brush, settings.spongeMode === "saturate", settings.vibrance)) };
6199
6208
  const retouchApply = {
6200
6209
  opacity: tool === "clone" || tool === "heal" || tool === "history" ? brush.opacity : tool === "blur" || tool === "sharpen" ? brush.opacity * settings.strength : 1,
6201
6210
  blend: tool === "clone" && !mask ? brush.blend : "normal",
@@ -6203,9 +6212,9 @@ var ImageEditorController = (_class7 = class {
6203
6212
  selection: apply.selection,
6204
6213
  offset: target.offset
6205
6214
  };
6206
- const coverage = new (0, _chunkQBWEH3IMcjs.StrokeCoverage)(brush);
6215
+ const coverage = new (0, _chunk3T5O225Tcjs.StrokeCoverage)(brush);
6207
6216
  if (tool === "dodge" || tool === "burn") {
6208
- const paint2 = { kind: "tone", tone: _chunkTLCTTQFFcjs.toneOf.call(void 0, tool, settings) };
6217
+ const paint2 = { kind: "tone", tone: _chunkVEHVXRJUcjs.toneOf.call(void 0, tool, settings) };
6209
6218
  return { kind: "coverage", coverage, apply: retouchApply, start: () => {
6210
6219
  }, paint: () => paint2 };
6211
6220
  }
@@ -6213,11 +6222,11 @@ var ImageEditorController = (_class7 = class {
6213
6222
  const n = target.surface.channels;
6214
6223
  const depth = !mask && this.bitDepth !== 8 ? this.bitDepth : null;
6215
6224
  const m = 6;
6216
- const filtered = new (0, _chunkTLCTTQFFcjs.TilePixelSource)(
6225
+ const filtered = new (0, _chunkVEHVXRJUcjs.TilePixelSource)(
6217
6226
  (tx, ty) => {
6218
6227
  const r = { x: tx * _chunkO7LUD7MHcjs.TILE - m, y: ty * _chunkO7LUD7MHcjs.TILE - m, width: _chunkO7LUD7MHcjs.TILE + 2 * m, height: _chunkO7LUD7MHcjs.TILE + 2 * m };
6219
6228
  const d = workRegionOf(target.surface, r, depth);
6220
- _chunkTLCTTQFFcjs.retouchFilter.call(void 0, d, r.width, r.height, n, tool, 2, 1.2);
6229
+ _chunkVEHVXRJUcjs.retouchFilter.call(void 0, d, r.width, r.height, n, tool, 2, 1.2);
6221
6230
  const out = new Float32Array(_chunkO7LUD7MHcjs.TILE * _chunkO7LUD7MHcjs.TILE * n);
6222
6231
  for (let y = 0; y < _chunkO7LUD7MHcjs.TILE; y++) out.set(d.subarray(((y + m) * r.width + m) * n, ((y + m) * r.width + m + _chunkO7LUD7MHcjs.TILE) * n), y * _chunkO7LUD7MHcjs.TILE * n);
6223
6232
  return out;
@@ -6232,21 +6241,21 @@ var ImageEditorController = (_class7 = class {
6232
6241
  if (tool === "history") {
6233
6242
  const steps = settings.historySteps;
6234
6243
  const entry = steps > 0 ? _nullishCoalesce(this.undoStack[this.undoStack.length - steps], () => ( this.undoStack[0])) : this.undoStack[0];
6235
- if (!entry) throw new (0, _chunkXN2NBLV5cjs.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.");
6244
+ if (!entry) throw new (0, _chunkPMEHFHSPcjs.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.");
6236
6245
  const then = _optionalChain([_chunkAEAAN4ADcjs.findLayer.call(void 0, entry.layers, target.id), 'optionalAccess', _232 => _232.layer]);
6237
- if (!then) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`Layer "${target.id}" did not exist ${steps > 0 ? `${steps} steps back` : "in the oldest state"}; choose fewer history steps (historySteps).`);
6246
+ if (!then) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Layer "${target.id}" did not exist ${steps > 0 ? `${steps} steps back` : "in the oldest state"}; choose fewer history steps (historySteps).`);
6238
6247
  const surface = target.channel === "mask" ? _optionalChain([then, 'access', _233 => _233.mask, 'optionalAccess', _234 => _234.surface]) : then.type === "pixel" ? then.surface : void 0;
6239
- if (!surface) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`Layer "${target.id}" had no ${target.channel === "mask" ? "mask" : "pixels"} in that state.`);
6248
+ if (!surface) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Layer "${target.id}" had no ${target.channel === "mask" ? "mask" : "pixels"} in that state.`);
6240
6249
  const offset2 = then.type === "pixel" ? then.offset : { x: 0, y: 0 };
6241
6250
  const depth = !mask && this.bitDepth !== 8 ? this.bitDepth : null;
6242
- const source2 = depth ? new (0, _chunkTLCTTQFFcjs.TilePixelSource)((tx, ty) => workTileOf(surface.tiles.get(_chunkO7LUD7MHcjs.tileKey.call(void 0, tx, ty))), 4, offset2) : this.surfaceSource(surface, offset2);
6251
+ const source2 = depth ? new (0, _chunkVEHVXRJUcjs.TilePixelSource)((tx, ty) => workTileOf(surface.tiles.get(_chunkO7LUD7MHcjs.tileKey.call(void 0, tx, ty))), 4, offset2) : this.surfaceSource(surface, offset2);
6243
6252
  const paint2 = { kind: "source", source: source2, dx: 0, dy: 0 };
6244
6253
  return { kind: "coverage", coverage, apply: retouchApply, start: () => {
6245
6254
  }, paint: () => paint2 };
6246
6255
  }
6247
6256
  const sample = mask ? "current" : settings.sample;
6248
6257
  const deep = !mask && this.bitDepth !== 8 ? this.bitDepth : null;
6249
- const own = deep ? new (0, _chunkTLCTTQFFcjs.TilePixelSource)((tx, ty) => workTileOf(target.surface.tiles.get(_chunkO7LUD7MHcjs.tileKey.call(void 0, tx, ty))), 4, target.offset) : this.surfaceSource(target.surface, target.offset);
6258
+ const own = deep ? new (0, _chunkVEHVXRJUcjs.TilePixelSource)((tx, ty) => workTileOf(target.surface.tiles.get(_chunkO7LUD7MHcjs.tileKey.call(void 0, tx, ty))), 4, target.offset) : this.surfaceSource(target.surface, target.offset);
6250
6259
  const source = sample === "current" ? own : this.compositeSource(sample === "all" ? null : target.id, deep);
6251
6260
  const pad = (r, m) => ({ x: r.x - m, y: r.y - m, width: r.width + 2 * m, height: r.height + 2 * m });
6252
6261
  const covered = (cov, r) => {
@@ -6267,25 +6276,25 @@ var ImageEditorController = (_class7 = class {
6267
6276
  paint: () => trail,
6268
6277
  finalPaint: (cov) => {
6269
6278
  if (!cov.bounds) return null;
6270
- const win = _chunkTLCTTQFFcjs.spotHealWindow.call(void 0, cov.bounds, { width, height });
6279
+ const win = _chunkVEHVXRJUcjs.spotHealWindow.call(void 0, cov.bounds, { width, height });
6271
6280
  if (win.width <= 0 || win.height <= 0) return null;
6272
- const img = _chunkTLCTTQFFcjs.readSourceRegion.call(void 0, source, win);
6281
+ const img = _chunkVEHVXRJUcjs.readSourceRegion.call(void 0, source, win);
6273
6282
  const hole = covered(cov, win);
6274
- const healed = _chunkTLCTTQFFcjs.spotHealPixels.call(void 0, win.width, win.height, img, hole, brush.size, settings.spotType, (off) => {
6283
+ const healed = _chunkVEHVXRJUcjs.spotHealPixels.call(void 0, win.width, win.height, img, hole, brush.size, settings.spotType, (off) => {
6275
6284
  patch = off ? { x: off[0], y: off[1] } : null;
6276
6285
  });
6277
- return { kind: "source", source: new (0, _chunkTLCTTQFFcjs.RegionPixelSource)(win, healed), dx: 0, dy: 0 };
6286
+ return { kind: "source", source: new (0, _chunkVEHVXRJUcjs.RegionPixelSource)(win, healed), dx: 0, dy: 0 };
6278
6287
  },
6279
6288
  result: () => ({ spotHeal: { offset: patch } })
6280
6289
  };
6281
6290
  }
6282
6291
  if (init.source) this.setCloneSource(init.source);
6283
6292
  const cs = this.state.paint.cloneSource;
6284
- if (!cs) throw new (0, _chunkXN2NBLV5cjs.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 }.`);
6293
+ if (!cs) throw new (0, _chunkPMEHFHSPcjs.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 }.`);
6285
6294
  let offset = { x: 0, y: 0 };
6286
6295
  let first = { x: 0, y: 0 };
6287
6296
  const xf = this.state.paint.cloneTransform;
6288
- const transformed = _chunkTLCTTQFFcjs.isIdentityCloneTransform.call(void 0, xf) ? null : new (0, _chunkTLCTTQFFcjs.TransformedPixelSource)(source, (x, y) => _chunkTLCTTQFFcjs.cloneSamplePoint.call(void 0, xf, cs, { x: cs.x - offset.x, y: cs.y - offset.y }, x, y));
6297
+ const transformed = _chunkVEHVXRJUcjs.isIdentityCloneTransform.call(void 0, xf) ? null : new (0, _chunkVEHVXRJUcjs.TransformedPixelSource)(source, (x, y) => _chunkVEHVXRJUcjs.cloneSamplePoint.call(void 0, xf, cs, { x: cs.x - offset.x, y: cs.y - offset.y }, x, y));
6289
6298
  const paint = () => transformed ? { kind: "source", source: transformed, dx: 0, dy: 0 } : { kind: "source", source, dx: offset.x, dy: offset.y };
6290
6299
  return {
6291
6300
  kind: "coverage",
@@ -6300,16 +6309,16 @@ var ImageEditorController = (_class7 = class {
6300
6309
  finalPaint: tool === "heal" ? (cov) => {
6301
6310
  if (!cov.bounds) return null;
6302
6311
  const g = pad(cov.bounds, 2);
6303
- const src = transformed ? _chunkTLCTTQFFcjs.readSourceRegion.call(void 0, transformed, g) : _chunkTLCTTQFFcjs.readSourceRegion.call(void 0, source, g, offset.x, offset.y);
6304
- const dst = _chunkTLCTTQFFcjs.readSourceRegion.call(void 0, source, g);
6305
- return { kind: "source", source: new (0, _chunkTLCTTQFFcjs.RegionPixelSource)(g, _chunkTLCTTQFFcjs.healPixels.call(void 0, g.width, g.height, src, dst, covered(cov, g))), dx: 0, dy: 0 };
6312
+ const src = transformed ? _chunkVEHVXRJUcjs.readSourceRegion.call(void 0, transformed, g) : _chunkVEHVXRJUcjs.readSourceRegion.call(void 0, source, g, offset.x, offset.y);
6313
+ const dst = _chunkVEHVXRJUcjs.readSourceRegion.call(void 0, source, g);
6314
+ return { kind: "source", source: new (0, _chunkVEHVXRJUcjs.RegionPixelSource)(g, _chunkVEHVXRJUcjs.healPixels.call(void 0, g.width, g.height, src, dst, covered(cov, g))), dx: 0, dy: 0 };
6306
6315
  } : void 0,
6307
6316
  result: () => ({ clone: { offset: { ...offset }, source: { x: first.x + offset.x, y: first.y + offset.y }, aligned: settings.aligned } })
6308
6317
  };
6309
6318
  }
6310
6319
  /** A pixel source over a surface (layer pixels or a mask) in layer space at `offset`. */
6311
6320
  surfaceSource(surface, offset) {
6312
- return new (0, _chunkTLCTTQFFcjs.TilePixelSource)((tx, ty) => _nullishCoalesce(_optionalChain([surface, 'access', _235 => _235.tiles, 'access', _236 => _236.get, 'call', _237 => _237(_chunkO7LUD7MHcjs.tileKey.call(void 0, tx, ty)), 'optionalAccess', _238 => _238.data]), () => ( (surface.defaultValue ? defaultTile(surface) : null))), surface.channels, offset);
6321
+ return new (0, _chunkVEHVXRJUcjs.TilePixelSource)((tx, ty) => _nullishCoalesce(_optionalChain([surface, 'access', _235 => _235.tiles, 'access', _236 => _236.get, 'call', _237 => _237(_chunkO7LUD7MHcjs.tileKey.call(void 0, tx, ty)), 'optionalAccess', _238 => _238.data]), () => ( (surface.defaultValue ? defaultTile(surface) : null))), surface.channels, offset);
6313
6322
  }
6314
6323
  /** A pixel source over the composite of the current layers (through `throughId` and below, or all of them), as it is now. */
6315
6324
  compositeSource(throughId, depth = null) {
@@ -6317,8 +6326,8 @@ var ImageEditorController = (_class7 = class {
6317
6326
  const layers = throughId ? layersThrough(stack, throughId) : stack;
6318
6327
  const sources = this.compositorSources();
6319
6328
  if (depth) {
6320
- return new (0, _chunkTLCTTQFFcjs.TilePixelSource)((tx, ty) => {
6321
- const w = _chunkXN2NBLV5cjs.compositeDeep.call(void 0, layers, { x: tx * _chunkO7LUD7MHcjs.TILE, y: ty * _chunkO7LUD7MHcjs.TILE, width: _chunkO7LUD7MHcjs.TILE, height: _chunkO7LUD7MHcjs.TILE }, sources, depth);
6329
+ return new (0, _chunkVEHVXRJUcjs.TilePixelSource)((tx, ty) => {
6330
+ const w = _chunkPMEHFHSPcjs.compositeDeep.call(void 0, layers, { x: tx * _chunkO7LUD7MHcjs.TILE, y: ty * _chunkO7LUD7MHcjs.TILE, width: _chunkO7LUD7MHcjs.TILE, height: _chunkO7LUD7MHcjs.TILE }, sources, depth);
6322
6331
  for (let i = 0; i < w.length; i += 4) {
6323
6332
  if (depth === 32) for (let c = 0; c < 3; c++) w[i + c] = _chunkO7LUD7MHcjs.srgbEncode.call(void 0, w[i + c]);
6324
6333
  for (let c = 0; c < 4; c++) w[i + c] *= 255;
@@ -6326,21 +6335,21 @@ var ImageEditorController = (_class7 = class {
6326
6335
  return w;
6327
6336
  }, 4);
6328
6337
  }
6329
- const compositor = new (0, _chunkXN2NBLV5cjs.LayerCompositor)();
6330
- return new (0, _chunkTLCTTQFFcjs.TilePixelSource)((tx, ty) => compositor.tile(layers, tx, ty, sources), 4);
6338
+ const compositor = new (0, _chunkPMEHFHSPcjs.LayerCompositor)();
6339
+ return new (0, _chunkVEHVXRJUcjs.TilePixelSource)((tx, ty) => compositor.tile(layers, tx, ty, sources), 4);
6331
6340
  }
6332
6341
  /** A Mixer Brush stroke's start: the settings, and the load (refilled when asked or set to). */
6333
6342
  mixerStroke(init, brush) {
6334
- const settings = _chunkQBWEH3IMcjs.normalizeMixer.call(void 0, { ...this.state.paint.mixer, ..._nullishCoalesce(init.mixer, () => ( {})) });
6343
+ const settings = _chunk3T5O225Tcjs.normalizeMixer.call(void 0, { ...this.state.paint.mixer, ..._nullishCoalesce(init.mixer, () => ( {})) });
6335
6344
  let load = this.state.paint.mixerLoad;
6336
6345
  if (init.color !== void 0 || settings.loadEachStroke) {
6337
6346
  const c = parseColor(_nullishCoalesce(init.color, () => ( this.state.paint.foreground)));
6338
- load = _chunkQBWEH3IMcjs.loadMixer.call(void 0, load, [c[0] / 255, c[1] / 255, c[2] / 255]);
6347
+ load = _chunk3T5O225Tcjs.loadMixer.call(void 0, load, [c[0] / 255, c[1] / 255, c[2] / 255]);
6339
6348
  }
6340
6349
  return {
6341
- create: (pixels) => new (0, _chunkQBWEH3IMcjs.MixerStroke)(brush, settings, load, pixels),
6350
+ create: (pixels) => new (0, _chunk3T5O225Tcjs.MixerStroke)(brush, settings, load, pixels),
6342
6351
  end: (after) => {
6343
- const next = settings.cleanEachStroke ? _chunkQBWEH3IMcjs.cleanMixer.call(void 0, after) : after;
6352
+ const next = settings.cleanEachStroke ? _chunk3T5O225Tcjs.cleanMixer.call(void 0, after) : after;
6344
6353
  this.state.paint = { ...this.state.paint, mixerLoad: next };
6345
6354
  return next;
6346
6355
  }
@@ -6376,9 +6385,9 @@ var ImageEditorController = (_class7 = class {
6376
6385
  * document bounds and the number of dabs.
6377
6386
  */
6378
6387
  paintStroke(init) {
6379
- if (!Array.isArray(init.points) || !init.points.length) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("points must hold at least one { x, y } point.");
6388
+ if (!Array.isArray(init.points) || !init.points.length) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("points must hold at least one { x, y } point.");
6380
6389
  for (const p of init.points) {
6381
- if (!Number.isFinite(_optionalChain([p, 'optionalAccess', _239 => _239.x])) || !Number.isFinite(_optionalChain([p, 'optionalAccess', _240 => _240.y]))) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("Every point needs finite x and y (document pixels).");
6390
+ if (!Number.isFinite(_optionalChain([p, 'optionalAccess', _239 => _239.x])) || !Number.isFinite(_optionalChain([p, 'optionalAccess', _240 => _240.y]))) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Every point needs finite x and y (document pixels).");
6382
6391
  }
6383
6392
  const session = this.beginStroke(init);
6384
6393
  session.push(init.points);
@@ -6404,11 +6413,11 @@ var ImageEditorController = (_class7 = class {
6404
6413
  const target = this.paintTarget(options.layerId, options.channel, mode === "paint" ? "fill" : "clear");
6405
6414
  const { width, height } = this.naturalSize;
6406
6415
  const opacity = _nullishCoalesce(options.opacity, () => ( 1));
6407
- if (!(opacity >= 0 && opacity <= 1)) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("opacity must be from 0 to 1.");
6408
- const blend = _nullishCoalesce(_chunkXN2NBLV5cjs.parseBlend.call(void 0, options.blend), () => ( "normal"));
6416
+ if (!(opacity >= 0 && opacity <= 1)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("opacity must be from 0 to 1.");
6417
+ const blend = _nullishCoalesce(_chunkPMEHFHSPcjs.parseBlend.call(void 0, options.blend), () => ( "normal"));
6409
6418
  const sel = options.useSelection !== false && _optionalChain([this, 'access', _241 => _241.state, 'access', _242 => _242.selection, 'optionalAccess', _243 => _243.bounds]) ? this.state.selection : null;
6410
6419
  const region = _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _244 => _244.bounds]), () => ( { x: 0, y: 0, width, height }));
6411
- const coverage = new (0, _chunkQBWEH3IMcjs.CoverageMap)();
6420
+ const coverage = new (0, _chunk3T5O225Tcjs.CoverageMap)();
6412
6421
  const ones = new Float32Array(region.width * region.height);
6413
6422
  if (sel) {
6414
6423
  for (let y = 0; y < region.height; y++) {
@@ -6441,7 +6450,7 @@ var ImageEditorController = (_class7 = class {
6441
6450
  // --- Adjustments ---
6442
6451
  /** The pixel layer the base sliders edit: the active pixel layer, else the Background. */
6443
6452
  developLayer() {
6444
- return _chunkXN2NBLV5cjs.developTarget.call(void 0, this.state.layers, this.state.activeLayerId);
6453
+ return _chunkPMEHFHSPcjs.developTarget.call(void 0, this.state.layers, this.state.activeLayerId);
6445
6454
  }
6446
6455
  /**
6447
6456
  * Sets base adjustment values as one undo step (unless `commitToHistory` is false). The base
@@ -6467,7 +6476,7 @@ var ImageEditorController = (_class7 = class {
6467
6476
  this.state.outputOpacity = Math.min(1, Math.max(0, partial.opacity));
6468
6477
  }
6469
6478
  if ("layers" in partial) {
6470
- layers = this.replaceAdjustmentNodes(layers, _chunkXN2NBLV5cjs.normalizeAdjustmentLayers.call(void 0, partial.layers));
6479
+ layers = this.replaceAdjustmentNodes(layers, _chunkPMEHFHSPcjs.normalizeAdjustmentLayers.call(void 0, partial.layers));
6471
6480
  }
6472
6481
  this.state.layers = layers;
6473
6482
  this.notify();
@@ -6475,7 +6484,7 @@ var ImageEditorController = (_class7 = class {
6475
6484
  /** True when the adjustments use an older rendering process than {@link LATEST_PROCESS_VERSION}. */
6476
6485
  get isProcessOutdated() {
6477
6486
  this.syncViews();
6478
- return _chunkXN2NBLV5cjs.normalizeProcessVersion.call(void 0, this.state.adjustments.process) < _chunkXN2NBLV5cjs.LATEST_PROCESS_VERSION;
6487
+ return _chunkPMEHFHSPcjs.normalizeProcessVersion.call(void 0, this.state.adjustments.process) < _chunkPMEHFHSPcjs.LATEST_PROCESS_VERSION;
6479
6488
  }
6480
6489
  /**
6481
6490
  * Update to Current Process: re-interprets the current adjustment values with the latest
@@ -6483,7 +6492,7 @@ var ImageEditorController = (_class7 = class {
6483
6492
  */
6484
6493
  upgradeProcess() {
6485
6494
  if (!this.isProcessOutdated) return false;
6486
- this.setAdjustments({ process: _chunkXN2NBLV5cjs.LATEST_PROCESS_VERSION });
6495
+ this.setAdjustments({ process: _chunkPMEHFHSPcjs.LATEST_PROCESS_VERSION });
6487
6496
  return true;
6488
6497
  }
6489
6498
  /** Resets the base sliders (latest process). Adjustment layers are kept; see `clearAdjustmentLayers`. */
@@ -6494,7 +6503,7 @@ var ImageEditorController = (_class7 = class {
6494
6503
  this.state.layers = _chunkAEAAN4ADcjs.mapLayer.call(void 0,
6495
6504
  this.state.layers,
6496
6505
  target.id,
6497
- (l) => withBlur(withDevelop(l, { ...DEFAULT_ADJUSTMENTS, process: _chunkXN2NBLV5cjs.LATEST_PROCESS_VERSION }), 0)
6506
+ (l) => withBlur(withDevelop(l, { ...DEFAULT_ADJUSTMENTS, process: _chunkPMEHFHSPcjs.LATEST_PROCESS_VERSION }), 0)
6498
6507
  );
6499
6508
  }
6500
6509
  delete this.state.legacyOutputBlur;
@@ -6558,7 +6567,7 @@ var ImageEditorController = (_class7 = class {
6558
6567
  const existing = new Set(this.adjustmentNodes(out).map((n) => n.id));
6559
6568
  for (const l of next) {
6560
6569
  if (existing.has(l.id)) continue;
6561
- out = this.placeLayer(out, _chunkXN2NBLV5cjs.adjustmentNodeFromLegacy.call(void 0, l, width, height), { adjustmentIndex: Infinity });
6570
+ out = this.placeLayer(out, _chunkPMEHFHSPcjs.adjustmentNodeFromLegacy.call(void 0, l, width, height), { adjustmentIndex: Infinity });
6562
6571
  }
6563
6572
  const order = next.map((l) => l.id);
6564
6573
  for (let to = 0; to < order.length; to++) out = this.moveAdjustmentNode(out, order[to], to);
@@ -6573,7 +6582,7 @@ var ImageEditorController = (_class7 = class {
6573
6582
  addAdjustmentLayer(init, index) {
6574
6583
  const spec = typeof init === "string" ? { kind: init } : init;
6575
6584
  const ids = new Set(_chunkAEAAN4ADcjs.flattenLayers.call(void 0, this.state.layers).map((l) => l.id));
6576
- const layer = _chunkXN2NBLV5cjs.createAdjustmentLayer.call(void 0, spec.kind, {
6585
+ const layer = _chunkPMEHFHSPcjs.createAdjustmentLayer.call(void 0, spec.kind, {
6577
6586
  id: spec.id && !ids.has(spec.id) ? spec.id : void 0,
6578
6587
  name: spec.name,
6579
6588
  params: spec.params,
@@ -6582,10 +6591,10 @@ var ImageEditorController = (_class7 = class {
6582
6591
  blend: spec.blend,
6583
6592
  mask: _nullishCoalesce(spec.mask, () => ( void 0))
6584
6593
  });
6585
- while (ids.has(layer.id)) layer.id = _chunkXN2NBLV5cjs.newLayerId.call(void 0, "adj");
6594
+ while (ids.has(layer.id)) layer.id = _chunkPMEHFHSPcjs.newLayerId.call(void 0, "adj");
6586
6595
  const { width, height } = this.naturalSize;
6587
6596
  this.recordHistory();
6588
- const node = _chunkXN2NBLV5cjs.adjustmentNodeFromLegacy.call(void 0, layer, width, height);
6597
+ const node = _chunkPMEHFHSPcjs.adjustmentNodeFromLegacy.call(void 0, layer, width, height);
6589
6598
  const positioned = Boolean(spec.aboveId || spec.parentId);
6590
6599
  this.state.layers = this.placeLayer(this.state.layers, node, {
6591
6600
  aboveId: spec.aboveId,
@@ -6605,7 +6614,7 @@ var ImageEditorController = (_class7 = class {
6605
6614
  if (!loc || loc.layer.type !== "adjustment") return false;
6606
6615
  const { width, height } = this.naturalSize;
6607
6616
  const node = loc.layer;
6608
- const merged = _chunkXN2NBLV5cjs.normalizeAdjustmentLayer.call(void 0, {
6617
+ const merged = _chunkPMEHFHSPcjs.normalizeAdjustmentLayer.call(void 0, {
6609
6618
  id: node.id,
6610
6619
  kind: node.kind,
6611
6620
  enabled: _nullishCoalesce(update.enabled, () => ( node.visible)),
@@ -6625,7 +6634,7 @@ var ImageEditorController = (_class7 = class {
6625
6634
  params: merged.params
6626
6635
  };
6627
6636
  if (update.mask !== void 0) {
6628
- const mask = update.mask ? _chunkXN2NBLV5cjs.rasterMaskFromLegacy.call(void 0, update.mask, width, height) : null;
6637
+ const mask = update.mask ? _chunkPMEHFHSPcjs.rasterMaskFromLegacy.call(void 0, update.mask, width, height) : null;
6629
6638
  if (mask) next.mask = mask;
6630
6639
  else delete next.mask;
6631
6640
  }
@@ -6712,8 +6721,8 @@ var ImageEditorController = (_class7 = class {
6712
6721
  const { width, height } = this.naturalSize;
6713
6722
  let next = null;
6714
6723
  if (mask) {
6715
- const sized = mask.width === width && mask.height === height ? mask : _chunkXN2NBLV5cjs.resizeSelection.call(void 0, mask, width, height);
6716
- next = _chunkXN2NBLV5cjs.combineSelections.call(void 0, this.state.selection, sized, mode);
6724
+ const sized = mask.width === width && mask.height === height ? mask : _chunkPMEHFHSPcjs.resizeSelection.call(void 0, mask, width, height);
6725
+ next = _chunkPMEHFHSPcjs.combineSelections.call(void 0, this.state.selection, sized, mode);
6717
6726
  } else if (mode !== "replace") {
6718
6727
  return false;
6719
6728
  }
@@ -6727,7 +6736,7 @@ var ImageEditorController = (_class7 = class {
6727
6736
  /** Select › All. */
6728
6737
  selectAll() {
6729
6738
  const { width, height } = this.naturalSize;
6730
- return this.setSelection(_chunkXN2NBLV5cjs.fullSelection.call(void 0, width, height));
6739
+ return this.setSelection(_chunkPMEHFHSPcjs.fullSelection.call(void 0, width, height));
6731
6740
  }
6732
6741
  /** Select › Deselect. */
6733
6742
  deselect() {
@@ -6736,11 +6745,11 @@ var ImageEditorController = (_class7 = class {
6736
6745
  /** Select › Inverse (with nothing selected, selects everything). */
6737
6746
  invertSelection() {
6738
6747
  const { width, height } = this.naturalSize;
6739
- const current = _nullishCoalesce(this.state.selection, () => ( _chunkXN2NBLV5cjs.createSelectionMask.call(void 0, width, height)));
6740
- return this.setSelection(_chunkXN2NBLV5cjs.invertSelection.call(void 0, current));
6748
+ const current = _nullishCoalesce(this.state.selection, () => ( _chunkPMEHFHSPcjs.createSelectionMask.call(void 0, width, height)));
6749
+ return this.setSelection(_chunkPMEHFHSPcjs.invertSelection.call(void 0, current));
6741
6750
  }
6742
6751
  shapeCommand(mask, options) {
6743
- const shaped = options.feather && options.feather > 0 ? _chunkXN2NBLV5cjs.modifySelection.call(void 0, mask, "feather", options.feather) : mask;
6752
+ const shaped = options.feather && options.feather > 0 ? _chunkPMEHFHSPcjs.modifySelection.call(void 0, mask, "feather", options.feather) : mask;
6744
6753
  return this.setSelection(shaped, _nullishCoalesce(options.mode, () => ( "replace")));
6745
6754
  }
6746
6755
  /** Rectangular marquee in natural image pixels. */
@@ -6794,11 +6803,11 @@ var ImageEditorController = (_class7 = class {
6794
6803
  if (!this.samplePixelsOverride && !options.pixels) this.samplePixels = null;
6795
6804
  return null;
6796
6805
  }
6797
- const legacy = _chunkXN2NBLV5cjs.legacyView.call(void 0, this.stack(), width, height, null).exact;
6806
+ const legacy = _chunkPMEHFHSPcjs.legacyView.call(void 0, this.stack(), width, height, null).exact;
6798
6807
  if (options.sample === "active-layer") {
6799
6808
  const layer = this.getActiveLayer();
6800
6809
  if (!layer || layer.type !== "pixel") {
6801
- throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("Sampling the active layer needs an active pixel layer; select one, or sample the composite.");
6810
+ throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Sampling the active layer needs an active pixel layer; select one, or sample the composite.");
6802
6811
  }
6803
6812
  const surface = layer.source === "document" && options.pixels ? _chunkO7LUD7MHcjs.surfaceFromPixels.call(void 0, options.pixels, 4) : this.surfaceOf(layer);
6804
6813
  return { width, height, data: _chunkO7LUD7MHcjs.readRegion.call(void 0, surface, { x: -layer.offset.x, y: -layer.offset.y, width, height }) };
@@ -6807,7 +6816,7 @@ var ImageEditorController = (_class7 = class {
6807
6816
  this.syncViews();
6808
6817
  if (legacy && !options.pixels) {
6809
6818
  const copy = { width: base.width, height: base.height, data: new Uint8ClampedArray(base.data) };
6810
- _chunkXN2NBLV5cjs.applyAdjustments.call(void 0, copy, _chunkXN2NBLV5cjs.legacyView.call(void 0, this.stack(), width, height, null).adjustments);
6819
+ _chunkPMEHFHSPcjs.applyAdjustments.call(void 0, copy, _chunkPMEHFHSPcjs.legacyView.call(void 0, this.stack(), width, height, null).adjustments);
6811
6820
  return copy;
6812
6821
  }
6813
6822
  const pixels = options.pixels;
@@ -6819,7 +6828,7 @@ var ImageEditorController = (_class7 = class {
6819
6828
  };
6820
6829
  const stack = withoutAnnotations(this.state.layers);
6821
6830
  const layers = options.sampleMerged ? stack : pixelsOnly(stack);
6822
- const data = new (0, _chunkXN2NBLV5cjs.LayerCompositor)().composite(layers, { x: 0, y: 0, width, height }, sources);
6831
+ const data = new (0, _chunkPMEHFHSPcjs.LayerCompositor)().composite(layers, { x: 0, y: 0, width, height }, sources);
6823
6832
  return { width, height, data };
6824
6833
  }
6825
6834
  async requirePixels(options) {
@@ -6846,7 +6855,7 @@ var ImageEditorController = (_class7 = class {
6846
6855
  modifySelection(op, radius) {
6847
6856
  const sel = this.state.selection;
6848
6857
  if (!_optionalChain([sel, 'optionalAccess', _258 => _258.bounds])) return false;
6849
- return this.setSelection(_chunkXN2NBLV5cjs.modifySelection.call(void 0, sel, op, radius));
6858
+ return this.setSelection(_chunkPMEHFHSPcjs.modifySelection.call(void 0, sel, op, radius));
6850
6859
  }
6851
6860
  /**
6852
6861
  * Refine Edge: snaps the selection (e.g. a coarse AI mask loaded with `loadSelectionFromImage`)
@@ -6877,7 +6886,7 @@ var ImageEditorController = (_class7 = class {
6877
6886
  } else {
6878
6887
  pixels = source;
6879
6888
  }
6880
- this.setSelection(_chunkXN2NBLV5cjs.selectionFromPixels.call(void 0, pixels, options), _nullishCoalesce(options.mode, () => ( "replace")));
6889
+ this.setSelection(_chunkPMEHFHSPcjs.selectionFromPixels.call(void 0, pixels, options), _nullishCoalesce(options.mode, () => ( "replace")));
6881
6890
  return this.getSelection();
6882
6891
  }
6883
6892
  /** Quick Mask view (tints the unselected area). View state: no undo step. */
@@ -6889,7 +6898,7 @@ var ImageEditorController = (_class7 = class {
6889
6898
  // --- Layer masks ---
6890
6899
  maskFromSelection(sel, props = {}) {
6891
6900
  const { width, height } = this.naturalSize;
6892
- const sized = sel.width === width && sel.height === height ? sel : _chunkXN2NBLV5cjs.resizeSelection.call(void 0, sel, width, height);
6901
+ const sized = sel.width === width && sel.height === height ? sel : _chunkPMEHFHSPcjs.resizeSelection.call(void 0, sel, width, height);
6893
6902
  const mask = { surface: _chunkO7LUD7MHcjs.surfaceFromPixels.call(void 0, { width, height, data: sized.data }, 1, 0, 0, 0), defaultValue: 0 };
6894
6903
  return withMaskProps(mask, props);
6895
6904
  }
@@ -6935,7 +6944,7 @@ var ImageEditorController = (_class7 = class {
6935
6944
  const ox = layer.type === "pixel" ? layer.offset.x : 0;
6936
6945
  const oy = layer.type === "pixel" ? layer.offset.y : 0;
6937
6946
  const data = _chunkO7LUD7MHcjs.readRegion.call(void 0, layer.mask.surface, { x: -ox, y: -oy, width, height });
6938
- const sel = _chunkXN2NBLV5cjs.createSelectionMask.call(void 0, width, height, new Uint8Array(data.buffer, data.byteOffset, data.length));
6947
+ const sel = _chunkPMEHFHSPcjs.createSelectionMask.call(void 0, width, height, new Uint8Array(data.buffer, data.byteOffset, data.length));
6939
6948
  return this.setSelection(sel, mode);
6940
6949
  }
6941
6950
  // --- Histogram ---
@@ -6965,9 +6974,9 @@ var ImageEditorController = (_class7 = class {
6965
6974
  merged.depthRange = [...merged.depthRange];
6966
6975
  this.state.layers = _chunkAEAAN4ADcjs.mapLayer.call(void 0, this.state.layers, target.id, (l) => {
6967
6976
  const next = { ...l };
6968
- if (_chunkXN2NBLV5cjs.isDefaultDepthMask.call(void 0, merged)) {
6977
+ if (_chunkPMEHFHSPcjs.isDefaultDepthMask.call(void 0, merged)) {
6969
6978
  if (_optionalChain([next, 'access', _264 => _264.mask, 'optionalAccess', _265 => _265.source])) delete next.mask;
6970
- } else next.mask = _chunkXN2NBLV5cjs.depthRasterMask.call(void 0, merged);
6979
+ } else next.mask = _chunkPMEHFHSPcjs.depthRasterMask.call(void 0, merged);
6971
6980
  return next;
6972
6981
  });
6973
6982
  }
@@ -6988,7 +6997,7 @@ var ImageEditorController = (_class7 = class {
6988
6997
  // --- Annotations & Layers ---
6989
6998
  /** The layer showing annotation `id`: an annotation layer, or a shape layer migrated from it. */
6990
6999
  annotationLayer(id) {
6991
- return _chunkAEAAN4ADcjs.flattenLayers.call(void 0, this.state.layers).find((l) => (l.type === "annotation" || l.type === "shape" || l.type === "type") && _optionalChain([_chunkXN2NBLV5cjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _268 => _268.id]) === id);
7000
+ return _chunkAEAAN4ADcjs.flattenLayers.call(void 0, this.state.layers).find((l) => (l.type === "annotation" || l.type === "shape" || l.type === "type") && _optionalChain([_chunkPMEHFHSPcjs.annotationOfLayer.call(void 0, l), 'optionalAccess', _268 => _268.id]) === id);
6992
7001
  }
6993
7002
  /** What migrating an annotation needs: the canvas size, patterns and the text shaper. */
6994
7003
  annotationEnv() {
@@ -7004,7 +7013,7 @@ var ImageEditorController = (_class7 = class {
7004
7013
  this.recordHistory();
7005
7014
  const id = `ann_${Date.now()}_${Math.random().toString(36).slice(2, 7)}`;
7006
7015
  const fullAnnotation = { ...annotation, id };
7007
- const layer = _chunkXN2NBLV5cjs.annotationLayerFor.call(void 0, fullAnnotation, this.annotationEnv());
7016
+ const layer = _chunkPMEHFHSPcjs.annotationLayerFor.call(void 0, fullAnnotation, this.annotationEnv());
7008
7017
  const loc = placement.aboveId ? _chunkAEAAN4ADcjs.findLayer.call(void 0, this.state.layers, placement.aboveId) : null;
7009
7018
  this.state.layers = loc ? _chunkAEAAN4ADcjs.insertLayer.call(void 0, this.state.layers, layer, _nullishCoalesce(_optionalChain([loc, 'access', _269 => _269.parent, 'optionalAccess', _270 => _270.id]), () => ( null)), loc.index + 1) : _chunkAEAAN4ADcjs.insertLayer.call(void 0, this.state.layers, layer, null);
7010
7019
  this.state.selectedAnnotationId = id;
@@ -7016,17 +7025,17 @@ var ImageEditorController = (_class7 = class {
7016
7025
  this.recordHistory();
7017
7026
  }
7018
7027
  const layer = this.annotationLayer(id);
7019
- const current = layer ? _chunkXN2NBLV5cjs.annotationOfLayer.call(void 0, layer) : null;
7028
+ const current = layer ? _chunkPMEHFHSPcjs.annotationOfLayer.call(void 0, layer) : null;
7020
7029
  if (layer && current) {
7021
7030
  const annotation = { ...current, ...partial, id };
7022
- const name = layer.name === _chunkXN2NBLV5cjs.annotationLayerName.call(void 0, current) ? _chunkXN2NBLV5cjs.annotationLayerName.call(void 0, annotation) : layer.name;
7031
+ const name = layer.name === _chunkPMEHFHSPcjs.annotationLayerName.call(void 0, current) ? _chunkPMEHFHSPcjs.annotationLayerName.call(void 0, annotation) : layer.name;
7023
7032
  this.state.layers = _chunkAEAAN4ADcjs.mapLayer.call(void 0, this.state.layers, layer.id, () => this.layerForAnnotation(layer, annotation, name));
7024
7033
  }
7025
7034
  this.notify();
7026
7035
  }
7027
7036
  /** `layer` (an annotation, or a shape or type layer migrated from one) showing `annotation` instead, keeping its other properties. */
7028
7037
  layerForAnnotation(layer, annotation, name) {
7029
- const fresh = _chunkXN2NBLV5cjs.annotationLayerFor.call(void 0, annotation, this.annotationEnv());
7038
+ const fresh = _chunkPMEHFHSPcjs.annotationLayerFor.call(void 0, annotation, this.annotationEnv());
7030
7039
  const keep = { id: layer.id, visible: layer.visible, opacity: layer.opacity };
7031
7040
  for (const k of ["clipped", "mask", "locks", "effects"]) if (layer[k] !== void 0) keep[k] = layer[k];
7032
7041
  if (fresh.type !== "annotation" && layer.type !== "annotation" && layer.fillOpacity !== void 0) keep.fillOpacity = layer.fillOpacity;
@@ -7114,7 +7123,7 @@ var ImageEditorController = (_class7 = class {
7114
7123
  const cs = s.paint.cloneSource;
7115
7124
  if (!cs) return null;
7116
7125
  if (cursor && cs.offset && s.paint.retouch.aligned) {
7117
- const [x, y] = _chunkTLCTTQFFcjs.cloneSamplePoint.call(void 0, s.paint.cloneTransform, cs, { x: cs.x - cs.offset.x, y: cs.y - cs.offset.y }, cursor.x, cursor.y);
7126
+ const [x, y] = _chunkVEHVXRJUcjs.cloneSamplePoint.call(void 0, s.paint.cloneTransform, cs, { x: cs.x - cs.offset.x, y: cs.y - cs.offset.y }, cursor.x, cursor.y);
7118
7127
  return { x, y };
7119
7128
  }
7120
7129
  return { x: cs.x, y: cs.y };
@@ -7313,8 +7322,8 @@ var ImageEditorController = (_class7 = class {
7313
7322
  return;
7314
7323
  }
7315
7324
  const target = this.developLayer();
7316
- if (!target) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("There is no pixel layer to mask.");
7317
- _chunkXN2NBLV5cjs.requireUnlocked.call(void 0, target, "all", "mask it");
7325
+ if (!target) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("There is no pixel layer to mask.");
7326
+ _chunkPMEHFHSPcjs.requireUnlocked.call(void 0, target, "all", "mask it");
7318
7327
  const { width, height } = this.naturalSize;
7319
7328
  let px2 = await this.decodeImage(newDataUrl);
7320
7329
  if (px2.width !== width || px2.height !== height) px2 = resizePixels(px2, width, height);
@@ -7322,14 +7331,14 @@ var ImageEditorController = (_class7 = class {
7322
7331
  for (let p = 0; p < alpha.length; p++) alpha[p] = px2.data[p * 4 + 3];
7323
7332
  let surface = _chunkO7LUD7MHcjs.surfaceFromPixels.call(void 0, { width, height, data: alpha }, 1, 0, 0, 0);
7324
7333
  if (target.offset.x || target.offset.y) surface = _chunkO7LUD7MHcjs.translateSurface.call(void 0, surface, -target.offset.x, -target.offset.y);
7325
- this.commitLayers(_chunkXN2NBLV5cjs.setLayerMask.call(void 0, this.state.layers, target.id, { surface, defaultValue: 0 }));
7334
+ this.commitLayers(_chunkPMEHFHSPcjs.setLayerMask.call(void 0, this.state.layers, target.id, { surface, defaultValue: 0 }));
7326
7335
  return target.id;
7327
7336
  }
7328
7337
  // --- Type layers ---
7329
7338
 
7330
7339
  /** The shaper that lays out and draws type layers (`null` when there is none here). */
7331
7340
  getTextShaper() {
7332
- if (this.textShaperValue === void 0) this.textShaperValue = _chunk5OOIUXNJcjs.createCanvasTextShaper.call(void 0, { createCanvas: (w, h) => this.renderer.createCanvas(w, h) });
7341
+ if (this.textShaperValue === void 0) this.textShaperValue = _chunkXFXHA5MUcjs.createCanvasTextShaper.call(void 0, { createCanvas: (w, h) => this.renderer.createCanvas(w, h) });
7333
7342
  return this.textShaperValue;
7334
7343
  }
7335
7344
  /** Sets the text shaper (fonts) type layers lay out and draw with; existing layers redraw on their next edit. */
@@ -7346,7 +7355,7 @@ var ImageEditorController = (_class7 = class {
7346
7355
  return _nullishCoalesce(_optionalChain([this, 'access', _277 => _277.getTextShaper, 'call', _278 => _278(), 'optionalAccess', _279 => _279.families, 'optionalCall', _280 => _280()]), () => ( ["sans-serif", "serif", "monospace"]));
7347
7356
  }
7348
7357
  typeInfo(id) {
7349
- const layer = _chunkXN2NBLV5cjs.requireTypeLayer.call(void 0, this.state.layers, id);
7358
+ const layer = _chunkPMEHFHSPcjs.requireTypeLayer.call(void 0, this.state.layers, id);
7350
7359
  const ranges = (runs) => {
7351
7360
  let at = 0;
7352
7361
  return runs.map((r) => {
@@ -7359,7 +7368,7 @@ var ImageEditorController = (_class7 = class {
7359
7368
  let lines = [];
7360
7369
  let missing = _nullishCoalesce(layer.missingFonts, () => ( []));
7361
7370
  if (shaper) {
7362
- const layout = _chunk5OOIUXNJcjs.layoutText.call(void 0, layer, shaper);
7371
+ const layout = _chunkXFXHA5MUcjs.layoutText.call(void 0, layer, shaper);
7363
7372
  const r = (n) => Math.round(n * 1e3) / 1e3;
7364
7373
  lines = layout.lines.map((l) => ({ start: l.start, end: l.end, baseline: r(l.baseline), width: r(l.width) }));
7365
7374
  if (layer.rendering === "stored") missing = layout.missingFonts;
@@ -7389,25 +7398,25 @@ var ImageEditorController = (_class7 = class {
7389
7398
  * text wrapped in `box`. Refused without a text shaper. Returns its id.
7390
7399
  */
7391
7400
  addTextLayer(init) {
7392
- const text = _chunkXN2NBLV5cjs.normalizeText.call(void 0, init.text);
7393
- if (!Number.isFinite(init.x) || !Number.isFinite(init.y)) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("x and y must be numbers (document pixels).");
7394
- const style = _chunkXN2NBLV5cjs.patchTextStyle.call(void 0, { ..._chunk5OOIUXNJcjs.DEFAULT_TEXT_STYLE, color: this.state.paint.foreground }, _nullishCoalesce(init.style, () => ( {})));
7395
- const paragraph = _chunkXN2NBLV5cjs.patchParagraphStyle.call(void 0, {}, _nullishCoalesce(init.paragraph, () => ( {})));
7401
+ const text = _chunkPMEHFHSPcjs.normalizeText.call(void 0, init.text);
7402
+ if (!Number.isFinite(init.x) || !Number.isFinite(init.y)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("x and y must be numbers (document pixels).");
7403
+ const style = _chunkPMEHFHSPcjs.patchTextStyle.call(void 0, { ..._chunkXFXHA5MUcjs.DEFAULT_TEXT_STYLE, color: this.state.paint.foreground }, _nullishCoalesce(init.style, () => ( {})));
7404
+ const paragraph = _chunkPMEHFHSPcjs.patchParagraphStyle.call(void 0, {}, _nullishCoalesce(init.paragraph, () => ( {})));
7396
7405
  let frame = { kind: "point" };
7397
7406
  if (init.box) {
7398
7407
  const { width, height } = init.box;
7399
- if (!(Number.isFinite(width) && width >= 1 && Number.isFinite(height) && height >= 1)) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("box.width and box.height must be at least 1 pixel.");
7408
+ if (!(Number.isFinite(width) && width >= 1 && Number.isFinite(height) && height >= 1)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("box.width and box.height must be at least 1 pixel.");
7400
7409
  frame = { kind: "box", width, height };
7401
7410
  }
7402
- if (init.rotation !== void 0 && !Number.isFinite(init.rotation)) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("rotation must be a number of degrees.");
7403
- if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("opacity must be between 0 and 1.");
7404
- if (init.blend !== void 0 && !_chunkO7LUD7MHcjs.isBlendMode.call(void 0, init.blend)) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`Unknown blend mode "${String(init.blend)}".`);
7411
+ if (init.rotation !== void 0 && !Number.isFinite(init.rotation)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("rotation must be a number of degrees.");
7412
+ if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("opacity must be between 0 and 1.");
7413
+ if (init.blend !== void 0 && !_chunkO7LUD7MHcjs.isBlendMode.call(void 0, init.blend)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Unknown blend mode "${String(init.blend)}".`);
7405
7414
  const t = [1, 0, 0, 1, init.x, init.y];
7406
- const transform = init.rotation ? _chunk5OOIUXNJcjs.multiplyMatrices.call(void 0, t, _chunk5OOIUXNJcjs.rotateMatrix.call(void 0, init.rotation, { x: init.x, y: init.y })) : t;
7407
- const layer = _chunkXN2NBLV5cjs.createTypeLayer.call(void 0, { text, runs: [{ length: text.length, style }], paragraphs: [{ length: text.length, style: paragraph }], frame, transform, name: _nullishCoalesce(init.name, () => ( _chunkXN2NBLV5cjs.typeLayerName.call(void 0, text))) }, this.textEnv());
7415
+ const transform = init.rotation ? _chunkXFXHA5MUcjs.multiplyMatrices.call(void 0, t, _chunkXFXHA5MUcjs.rotateMatrix.call(void 0, init.rotation, { x: init.x, y: init.y })) : t;
7416
+ const layer = _chunkPMEHFHSPcjs.createTypeLayer.call(void 0, { text, runs: [{ length: text.length, style }], paragraphs: [{ length: text.length, style: paragraph }], frame, transform, name: _nullishCoalesce(init.name, () => ( _chunkPMEHFHSPcjs.typeLayerName.call(void 0, text))) }, this.textEnv());
7408
7417
  if (init.opacity !== void 0) layer.opacity = init.opacity;
7409
7418
  if (init.blend !== void 0) layer.blend = init.blend;
7410
- const next = _chunkXN2NBLV5cjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
7419
+ const next = _chunkPMEHFHSPcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
7411
7420
  this.commitLayers(next, () => {
7412
7421
  this.state.activeLayerId = layer.id;
7413
7422
  this.state.activeTarget = "pixels";
@@ -7419,28 +7428,28 @@ var ImageEditorController = (_class7 = class {
7419
7428
  * `start`. One undo step unless `commitToHistory` is false (typing). Returns the layer.
7420
7429
  */
7421
7430
  setText(id, text, range = {}, commitToHistory = true) {
7422
- const layer = _chunkXN2NBLV5cjs.requireTypeLayer.call(void 0, this.state.layers, id);
7423
- const insert = _chunkXN2NBLV5cjs.normalizeText.call(void 0, text);
7424
- const [start, end] = _chunkXN2NBLV5cjs.textRange.call(void 0, layer.text, range.start, range.end);
7425
- const { layers } = _chunkXN2NBLV5cjs.updateTypeLayer.call(void 0, this.state.layers, id, (l) => _chunkXN2NBLV5cjs.replaceTextRange.call(void 0, l, start, end, insert), this.textEnv(), "edit its text");
7431
+ const layer = _chunkPMEHFHSPcjs.requireTypeLayer.call(void 0, this.state.layers, id);
7432
+ const insert = _chunkPMEHFHSPcjs.normalizeText.call(void 0, text);
7433
+ const [start, end] = _chunkPMEHFHSPcjs.textRange.call(void 0, layer.text, range.start, range.end);
7434
+ const { layers } = _chunkPMEHFHSPcjs.updateTypeLayer.call(void 0, this.state.layers, id, (l) => _chunkPMEHFHSPcjs.replaceTextRange.call(void 0, l, start, end, insert), this.textEnv(), "edit its text");
7426
7435
  this.commitLayers(layers, void 0, commitToHistory);
7427
7436
  return this.typeInfo(id);
7428
7437
  }
7429
7438
  /** Sets character style fields over [start, end) (default all), one undo step. Returns the layer. */
7430
7439
  setTextStyle(id, style, range = {}, commitToHistory = true) {
7431
- const layer = _chunkXN2NBLV5cjs.requireTypeLayer.call(void 0, this.state.layers, id);
7432
- const [start, end] = _chunkXN2NBLV5cjs.textRange.call(void 0, layer.text, range.start, range.end);
7433
- if (!Object.keys(style).length) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("Give at least one style field to set.");
7434
- _chunkXN2NBLV5cjs.patchTextStyle.call(void 0, _chunk5OOIUXNJcjs.DEFAULT_TEXT_STYLE, style);
7435
- const { layers } = _chunkXN2NBLV5cjs.updateTypeLayer.call(void 0,
7440
+ const layer = _chunkPMEHFHSPcjs.requireTypeLayer.call(void 0, this.state.layers, id);
7441
+ const [start, end] = _chunkPMEHFHSPcjs.textRange.call(void 0, layer.text, range.start, range.end);
7442
+ if (!Object.keys(style).length) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Give at least one style field to set.");
7443
+ _chunkPMEHFHSPcjs.patchTextStyle.call(void 0, _chunkXFXHA5MUcjs.DEFAULT_TEXT_STYLE, style);
7444
+ const { layers } = _chunkPMEHFHSPcjs.updateTypeLayer.call(void 0,
7436
7445
  this.state.layers,
7437
7446
  id,
7438
7447
  (l) => {
7439
7448
  if (start === end) {
7440
- if (l.text.length) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("The range is empty; give start < end (or leave both out for the whole text).");
7441
- return { runs: [{ length: 0, style: _chunkXN2NBLV5cjs.patchTextStyle.call(void 0, _chunk5OOIUXNJcjs.styleAt.call(void 0, l.runs, 0, _chunk5OOIUXNJcjs.DEFAULT_TEXT_STYLE), style) }] };
7449
+ if (l.text.length) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("The range is empty; give start < end (or leave both out for the whole text).");
7450
+ return { runs: [{ length: 0, style: _chunkPMEHFHSPcjs.patchTextStyle.call(void 0, _chunkXFXHA5MUcjs.styleAt.call(void 0, l.runs, 0, _chunkXFXHA5MUcjs.DEFAULT_TEXT_STYLE), style) }] };
7442
7451
  }
7443
- return { runs: _chunk5OOIUXNJcjs.restyleRange.call(void 0, l.runs, start, end, (s) => _chunkXN2NBLV5cjs.patchTextStyle.call(void 0, s, style)) };
7452
+ return { runs: _chunkXFXHA5MUcjs.restyleRange.call(void 0, l.runs, start, end, (s) => _chunkPMEHFHSPcjs.patchTextStyle.call(void 0, s, style)) };
7444
7453
  },
7445
7454
  this.textEnv(),
7446
7455
  "restyle its text"
@@ -7450,11 +7459,11 @@ var ImageEditorController = (_class7 = class {
7450
7459
  }
7451
7460
  /** Sets paragraph style fields on every paragraph that [start, end) touches (default all), one undo step. */
7452
7461
  setParagraphStyle(id, style, range = {}, commitToHistory = true) {
7453
- const layer = _chunkXN2NBLV5cjs.requireTypeLayer.call(void 0, this.state.layers, id);
7454
- const [start, end] = _chunkXN2NBLV5cjs.textRange.call(void 0, layer.text, range.start, range.end);
7455
- if (!Object.keys(style).length) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("Give at least one paragraph field to set.");
7456
- _chunkXN2NBLV5cjs.patchParagraphStyle.call(void 0, {}, style);
7457
- const { layers } = _chunkXN2NBLV5cjs.updateTypeLayer.call(void 0,
7462
+ const layer = _chunkPMEHFHSPcjs.requireTypeLayer.call(void 0, this.state.layers, id);
7463
+ const [start, end] = _chunkPMEHFHSPcjs.textRange.call(void 0, layer.text, range.start, range.end);
7464
+ if (!Object.keys(style).length) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Give at least one paragraph field to set.");
7465
+ _chunkPMEHFHSPcjs.patchParagraphStyle.call(void 0, {}, style);
7466
+ const { layers } = _chunkPMEHFHSPcjs.updateTypeLayer.call(void 0,
7458
7467
  this.state.layers,
7459
7468
  id,
7460
7469
  (l) => {
@@ -7463,7 +7472,7 @@ var ImageEditorController = (_class7 = class {
7463
7472
  const a = at;
7464
7473
  at += p.length;
7465
7474
  const touches = a < end && at > start || start === end && start >= a && (start < at || at === l.text.length);
7466
- return touches || !l.text.length ? { length: p.length, style: _chunkXN2NBLV5cjs.patchParagraphStyle.call(void 0, p.style, style) } : p;
7475
+ return touches || !l.text.length ? { length: p.length, style: _chunkPMEHFHSPcjs.patchParagraphStyle.call(void 0, p.style, style) } : p;
7467
7476
  });
7468
7477
  return { paragraphs };
7469
7478
  },
@@ -7479,21 +7488,21 @@ var ImageEditorController = (_class7 = class {
7479
7488
  * paragraph. Also resizes a box. One undo step.
7480
7489
  */
7481
7490
  setTextFrame(id, frame, commitToHistory = true) {
7482
- const layer = _chunkXN2NBLV5cjs.requireTypeLayer.call(void 0, this.state.layers, id);
7483
- if (frame.kind === "box" && !(Number.isFinite(frame.width) && frame.width >= 1 && Number.isFinite(frame.height) && frame.height >= 1)) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("width and height must be at least 1 pixel.");
7484
- if (frame.kind !== "box" && frame.kind !== "point") throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("kind must be point or box.");
7491
+ const layer = _chunkPMEHFHSPcjs.requireTypeLayer.call(void 0, this.state.layers, id);
7492
+ if (frame.kind === "box" && !(Number.isFinite(frame.width) && frame.width >= 1 && Number.isFinite(frame.height) && frame.height >= 1)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("width and height must be at least 1 pixel.");
7493
+ if (frame.kind !== "box" && frame.kind !== "point") throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("kind must be point or box.");
7485
7494
  const shaper = this.getTextShaper();
7486
- const { layers } = _chunkXN2NBLV5cjs.updateTypeLayer.call(void 0,
7495
+ const { layers } = _chunkPMEHFHSPcjs.updateTypeLayer.call(void 0,
7487
7496
  this.state.layers,
7488
7497
  id,
7489
7498
  (l) => {
7490
7499
  if (frame.kind === "box" && l.frame.kind === "box") return { frame: { kind: "box", width: frame.width, height: frame.height } };
7491
- if (!shaper) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("Changing between point and paragraph text needs a text shaper to measure the text.");
7492
- const lines = _chunk5OOIUXNJcjs.layoutText.call(void 0, l, shaper).lines;
7500
+ if (!shaper) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Changing between point and paragraph text needs a text shaper to measure the text.");
7501
+ const lines = _chunkXFXHA5MUcjs.layoutText.call(void 0, l, shaper).lines;
7493
7502
  const first = lines[0];
7494
7503
  const dx = frame.kind === "box" ? first ? first.x : 0 : 0;
7495
7504
  const dy = frame.kind === "box" ? first ? first.baseline - first.ascent : 0 : first ? first.baseline : 0;
7496
- const m = _chunkXN2NBLV5cjs.textMatrix.call(void 0, l);
7505
+ const m = _chunkPMEHFHSPcjs.textMatrix.call(void 0, l);
7497
7506
  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]];
7498
7507
  const nextFrame = frame.kind === "box" ? { kind: "box", width: frame.width, height: frame.height } : { kind: "point" };
7499
7508
  return { frame: nextFrame, transform: shifted };
@@ -7510,21 +7519,21 @@ var ImageEditorController = (_class7 = class {
7510
7519
  * `warnings` says when other colours were dropped. One undo step.
7511
7520
  */
7512
7521
  convertTextToShape(id) {
7513
- const layer = _chunkXN2NBLV5cjs.requireTypeLayer.call(void 0, this.state.layers, id);
7514
- _chunkXN2NBLV5cjs.requireUnlocked.call(void 0, layer, "all", "convert it");
7522
+ const layer = _chunkPMEHFHSPcjs.requireTypeLayer.call(void 0, this.state.layers, id);
7523
+ _chunkPMEHFHSPcjs.requireUnlocked.call(void 0, layer, "all", "convert it");
7515
7524
  const shaper = this.getTextShaper();
7516
- if (!shaper) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("Convert to Shape needs a text shaper that gives glyph outlines; none is set here.");
7517
- const parts = _chunkXN2NBLV5cjs.textOutlines.call(void 0, layer, shaper);
7518
- const subpaths = parts.flatMap((p) => _chunk5OOIUXNJcjs.bezierToSubpaths.call(void 0, p.path));
7519
- if (!subpaths.length) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("The text draws nothing (it is empty or only spaces), so there is no shape to make.");
7525
+ if (!shaper) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Convert to Shape needs a text shaper that gives glyph outlines; none is set here.");
7526
+ const parts = _chunkPMEHFHSPcjs.textOutlines.call(void 0, layer, shaper);
7527
+ const subpaths = parts.flatMap((p) => _chunkXFXHA5MUcjs.bezierToSubpaths.call(void 0, p.path));
7528
+ if (!subpaths.length) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("The text draws nothing (it is empty or only spaces), so there is no shape to make.");
7520
7529
  const warnings = [];
7521
7530
  const colors = new Set(layer.runs.filter((r) => r.length > 0).map((r) => `${r.style.color}/${_nullishCoalesce(r.style.opacity, () => ( 1))}`));
7522
7531
  if (colors.size > 1) warnings.push("The text had several colours; the shape takes the first one.");
7523
- const missing = _chunk5OOIUXNJcjs.layoutText.call(void 0, layer, shaper).missingFonts;
7532
+ const missing = _chunkXFXHA5MUcjs.layoutText.call(void 0, layer, shaper).missingFonts;
7524
7533
  if (missing.length) warnings.push(`Missing fonts were drawn with a fallback: ${missing.join(", ")}.`);
7525
- const first = _nullishCoalesce(_optionalChain([layer, 'access', _281 => _281.runs, 'access', _282 => _282.find, 'call', _283 => _283((r) => r.length > 0), 'optionalAccess', _284 => _284.style]), () => ( _chunk5OOIUXNJcjs.DEFAULT_TEXT_STYLE));
7534
+ const first = _nullishCoalesce(_optionalChain([layer, 'access', _281 => _281.runs, 'access', _282 => _282.find, 'call', _283 => _283((r) => r.length > 0), 'optionalAccess', _284 => _284.style]), () => ( _chunkXFXHA5MUcjs.DEFAULT_TEXT_STYLE));
7526
7535
  const fill = first.opacity !== void 0 && first.opacity !== 1 ? { type: "color", color: first.color, opacity: first.opacity } : { type: "color", color: first.color };
7527
- const shape = _chunkXN2NBLV5cjs.createShapeLayer.call(void 0, { components: [{ op: "combine", subpaths }], fill, stroke: null, name: layer.name }, this.shapeEnv(), layer.id);
7536
+ const shape = _chunkPMEHFHSPcjs.createShapeLayer.call(void 0, { components: [{ op: "combine", subpaths }], fill, stroke: null, name: layer.name }, this.shapeEnv(), layer.id);
7528
7537
  const keep = { visible: layer.visible, opacity: layer.opacity, blend: layer.blend };
7529
7538
  for (const k of ["clipped", "mask", "locks", "effects", "fillOpacity"]) if (layer[k] !== void 0) keep[k] = layer[k];
7530
7539
  this.commitLayers(_chunkAEAAN4ADcjs.mapLayer.call(void 0, this.state.layers, id, () => ({ ...shape, ...keep })));
@@ -7532,23 +7541,23 @@ var ImageEditorController = (_class7 = class {
7532
7541
  }
7533
7542
  /** The layout of a type layer (lines, characters, bounds in text space), or `null` without a shaper. */
7534
7543
  getTextLayout(id) {
7535
- const layer = _chunkXN2NBLV5cjs.requireTypeLayer.call(void 0, this.state.layers, id);
7544
+ const layer = _chunkPMEHFHSPcjs.requireTypeLayer.call(void 0, this.state.layers, id);
7536
7545
  const shaper = this.getTextShaper();
7537
- return shaper ? _chunk5OOIUXNJcjs.layoutText.call(void 0, layer, shaper) : null;
7546
+ return shaper ? _chunkXFXHA5MUcjs.layoutText.call(void 0, layer, shaper) : null;
7538
7547
  }
7539
7548
  /** The text index nearest a document point (for clicks on a type layer). */
7540
7549
  textIndexAt(id, point) {
7541
- const layer = _chunkXN2NBLV5cjs.requireTypeLayer.call(void 0, this.state.layers, id);
7550
+ const layer = _chunkPMEHFHSPcjs.requireTypeLayer.call(void 0, this.state.layers, id);
7542
7551
  const layout = this.getTextLayout(id);
7543
- return layout ? _chunk5OOIUXNJcjs.textIndexAt.call(void 0, layout, _chunkXN2NBLV5cjs.toTextSpace.call(void 0, layer, point)) : layer.text.length;
7552
+ return layout ? _chunkXFXHA5MUcjs.textIndexAt.call(void 0, layout, _chunkPMEHFHSPcjs.toTextSpace.call(void 0, layer, point)) : layer.text.length;
7544
7553
  }
7545
7554
  /** The caret at text index `index` as a document-space segment (top to bottom), for drawing it. */
7546
7555
  textCaret(id, index) {
7547
- const layer = _chunkXN2NBLV5cjs.requireTypeLayer.call(void 0, this.state.layers, id);
7556
+ const layer = _chunkPMEHFHSPcjs.requireTypeLayer.call(void 0, this.state.layers, id);
7548
7557
  const layout = this.getTextLayout(id);
7549
7558
  if (!layout) return null;
7550
- const c = _chunk5OOIUXNJcjs.caretAt.call(void 0, layout, Math.max(0, Math.min(layer.text.length, index)));
7551
- const m = _chunkXN2NBLV5cjs.textMatrix.call(void 0, layer);
7559
+ const c = _chunkXFXHA5MUcjs.caretAt.call(void 0, layout, Math.max(0, Math.min(layer.text.length, index)));
7560
+ const m = _chunkPMEHFHSPcjs.textMatrix.call(void 0, layer);
7552
7561
  const at = (x, y) => ({ x: m[0] * x + m[2] * y + m[4], y: m[1] * x + m[3] * y + m[5] });
7553
7562
  return { top: at(c.x, c.top), bottom: at(c.x, c.bottom), line: c.line };
7554
7563
  }
@@ -7559,14 +7568,14 @@ var ImageEditorController = (_class7 = class {
7559
7568
  }
7560
7569
  /** One component from tool or UI input (validated). */
7561
7570
  componentFrom(spec, path) {
7562
- const op = _chunkXN2NBLV5cjs.requireOperation.call(void 0, spec.op, `${path}op`);
7563
- if (spec.shape !== void 0 && spec.subpaths !== void 0) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`Give ${path}shape or ${path}subpaths, not both.`);
7564
- if (spec.shape !== void 0) return _chunkXN2NBLV5cjs.liveComponent.call(void 0, _chunkXN2NBLV5cjs.normalizeLiveShape.call(void 0, spec.shape, `${path}shape`), op);
7565
- if (spec.subpaths !== void 0) return { op, subpaths: _chunkXN2NBLV5cjs.normalizeSubpaths.call(void 0, spec.subpaths, `${path}subpaths`) };
7566
- throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`${path}shape (a live shape: { kind: rect | ellipse | polygon | star | line, \u2026 }) or ${path}subpaths (anchors or SVG path data) is required.`);
7571
+ const op = _chunkPMEHFHSPcjs.requireOperation.call(void 0, spec.op, `${path}op`);
7572
+ if (spec.shape !== void 0 && spec.subpaths !== void 0) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Give ${path}shape or ${path}subpaths, not both.`);
7573
+ if (spec.shape !== void 0) return _chunkPMEHFHSPcjs.liveComponent.call(void 0, _chunkPMEHFHSPcjs.normalizeLiveShape.call(void 0, spec.shape, `${path}shape`), op);
7574
+ if (spec.subpaths !== void 0) return { op, subpaths: _chunkPMEHFHSPcjs.normalizeSubpaths.call(void 0, spec.subpaths, `${path}subpaths`) };
7575
+ throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`${path}shape (a live shape: { kind: rect | ellipse | polygon | star | line, \u2026 }) or ${path}subpaths (anchors or SVG path data) is required.`);
7567
7576
  }
7568
7577
  shapeInfo(id) {
7569
- const layer = _chunkXN2NBLV5cjs.requireShapeLayer.call(void 0, this.state.layers, id);
7578
+ const layer = _chunkPMEHFHSPcjs.requireShapeLayer.call(void 0, this.state.layers, id);
7570
7579
  const r = (n) => Math.round(n * 1e3) / 1e3;
7571
7580
  const box = (b) => b ? { x: r(b.x), y: r(b.y), width: r(b.width), height: r(b.height) } : null;
7572
7581
  const info = {
@@ -7576,13 +7585,13 @@ var ImageEditorController = (_class7 = class {
7576
7585
  index,
7577
7586
  op: c.op,
7578
7587
  live: c.live ? JSON.parse(JSON.stringify(c.live)) : null,
7579
- subpaths: _chunk5OOIUXNJcjs.roundSubpaths.call(void 0, c.subpaths),
7580
- bounds: box(_chunkXN2NBLV5cjs.shapeGeometryBounds.call(void 0, { components: [c] }))
7588
+ subpaths: _chunkXFXHA5MUcjs.roundSubpaths.call(void 0, c.subpaths),
7589
+ bounds: box(_chunkPMEHFHSPcjs.shapeGeometryBounds.call(void 0, { components: [c] }))
7581
7590
  })),
7582
7591
  fillRule: _nullishCoalesce(layer.fillRule, () => ( "nonzero")),
7583
7592
  fill: layer.fill ? JSON.parse(JSON.stringify(layer.fill)) : null,
7584
7593
  stroke: layer.stroke ? JSON.parse(JSON.stringify(layer.stroke)) : null,
7585
- geometryBounds: box(_chunkXN2NBLV5cjs.shapeGeometryBounds.call(void 0, layer)),
7594
+ geometryBounds: box(_chunkPMEHFHSPcjs.shapeGeometryBounds.call(void 0, layer)),
7586
7595
  bounds: this.getLayerBounds(id)
7587
7596
  };
7588
7597
  if (layer.annotation) info.annotationId = layer.annotation.id;
@@ -7599,17 +7608,17 @@ var ImageEditorController = (_class7 = class {
7599
7608
  */
7600
7609
  addShapeLayer(init) {
7601
7610
  const specs = _optionalChain([init, 'access', _289 => _289.components, 'optionalAccess', _290 => _290.length]) ? init.components : [init];
7602
- if (_optionalChain([init, 'access', _291 => _291.components, 'optionalAccess', _292 => _292.length]) && (init.shape !== void 0 || init.subpaths !== void 0)) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("Give components, or shape / subpaths, not both.");
7611
+ if (_optionalChain([init, 'access', _291 => _291.components, 'optionalAccess', _292 => _292.length]) && (init.shape !== void 0 || init.subpaths !== void 0)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Give components, or shape / subpaths, not both.");
7603
7612
  const components = specs.map((c, i) => this.componentFrom(c, _optionalChain([init, 'access', _293 => _293.components, 'optionalAccess', _294 => _294.length]) ? `components[${i}].` : ""));
7604
- const stroke = init.stroke ? _chunkXN2NBLV5cjs.normalizeShapeStroke.call(void 0, init.stroke, "stroke") : null;
7613
+ const stroke = init.stroke ? _chunkPMEHFHSPcjs.normalizeShapeStroke.call(void 0, init.stroke, "stroke") : null;
7605
7614
  const openOnly = components.every((c) => !c.live && c.subpaths.every((sp) => !sp.closed));
7606
- const fill = init.fill === void 0 ? stroke && openOnly ? null : _chunkXN2NBLV5cjs.normalizeShapePaint.call(void 0, this.state.paint.foreground, "fill") : init.fill === null ? null : _chunkXN2NBLV5cjs.normalizeShapePaint.call(void 0, init.fill, "fill");
7607
- if (!fill && !stroke) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("A shape with neither fill nor stroke draws nothing; give fill or stroke.");
7608
- if (init.fillRule !== void 0 && init.fillRule !== "nonzero" && init.fillRule !== "evenodd") throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("fillRule must be nonzero or evenodd.");
7609
- if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("opacity must be between 0 and 1.");
7610
- if (init.blend !== void 0 && !_chunkO7LUD7MHcjs.isBlendMode.call(void 0, init.blend)) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`Unknown blend mode "${String(init.blend)}".`);
7611
- const layer = _chunkXN2NBLV5cjs.createShapeLayer.call(void 0, { components, fill, stroke, fillRule: init.fillRule, name: init.name, opacity: init.opacity, blend: init.blend }, this.shapeEnv());
7612
- const next = _chunkXN2NBLV5cjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
7615
+ const fill = init.fill === void 0 ? stroke && openOnly ? null : _chunkPMEHFHSPcjs.normalizeShapePaint.call(void 0, this.state.paint.foreground, "fill") : init.fill === null ? null : _chunkPMEHFHSPcjs.normalizeShapePaint.call(void 0, init.fill, "fill");
7616
+ if (!fill && !stroke) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("A shape with neither fill nor stroke draws nothing; give fill or stroke.");
7617
+ if (init.fillRule !== void 0 && init.fillRule !== "nonzero" && init.fillRule !== "evenodd") throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("fillRule must be nonzero or evenodd.");
7618
+ if (init.opacity !== void 0 && !(Number.isFinite(init.opacity) && init.opacity >= 0 && init.opacity <= 1)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("opacity must be between 0 and 1.");
7619
+ if (init.blend !== void 0 && !_chunkO7LUD7MHcjs.isBlendMode.call(void 0, init.blend)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Unknown blend mode "${String(init.blend)}".`);
7620
+ const layer = _chunkPMEHFHSPcjs.createShapeLayer.call(void 0, { components, fill, stroke, fillRule: init.fillRule, name: init.name, opacity: init.opacity, blend: init.blend }, this.shapeEnv());
7621
+ const next = _chunkPMEHFHSPcjs.placeLayer.call(void 0, this.state.layers, layer, this.newLayerPlacement(init));
7613
7622
  this.commitLayers(next, () => {
7614
7623
  this.state.activeLayerId = layer.id;
7615
7624
  this.state.activeTarget = "pixels";
@@ -7622,18 +7631,18 @@ var ImageEditorController = (_class7 = class {
7622
7631
  * only those settings of the current stroke. Returns the shape.
7623
7632
  */
7624
7633
  setShapeStyle(id, changes, commitToHistory = true) {
7625
- const layer = _chunkXN2NBLV5cjs.requireShapeLayer.call(void 0, this.state.layers, id);
7626
- const fill = changes.fill === void 0 ? layer.fill : changes.fill === null ? null : _chunkXN2NBLV5cjs.normalizeShapePaint.call(void 0, changes.fill, "fill");
7627
- const stroke = changes.stroke === void 0 ? layer.stroke : changes.stroke === null ? null : _chunkXN2NBLV5cjs.normalizeShapeStroke.call(void 0, changes.stroke, "stroke", layer.stroke);
7628
- if (changes.fillRule !== void 0 && changes.fillRule !== "nonzero" && changes.fillRule !== "evenodd") throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("fillRule must be nonzero or evenodd.");
7634
+ const layer = _chunkPMEHFHSPcjs.requireShapeLayer.call(void 0, this.state.layers, id);
7635
+ const fill = changes.fill === void 0 ? layer.fill : changes.fill === null ? null : _chunkPMEHFHSPcjs.normalizeShapePaint.call(void 0, changes.fill, "fill");
7636
+ const stroke = changes.stroke === void 0 ? layer.stroke : changes.stroke === null ? null : _chunkPMEHFHSPcjs.normalizeShapeStroke.call(void 0, changes.stroke, "stroke", layer.stroke);
7637
+ if (changes.fillRule !== void 0 && changes.fillRule !== "nonzero" && changes.fillRule !== "evenodd") throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("fillRule must be nonzero or evenodd.");
7629
7638
  const fillRule = _nullishCoalesce(_nullishCoalesce(changes.fillRule, () => ( layer.fillRule)), () => ( "nonzero"));
7630
- const { layers } = _chunkXN2NBLV5cjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ fill, stroke, fillRule: fillRule === "nonzero" ? void 0 : fillRule }), this.shapeEnv(), "restyle it");
7639
+ const { layers } = _chunkPMEHFHSPcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ fill, stroke, fillRule: fillRule === "nonzero" ? void 0 : fillRule }), this.shapeEnv(), "restyle it");
7631
7640
  this.commitLayers(layers, void 0, commitToHistory);
7632
7641
  return this.shapeInfo(id);
7633
7642
  }
7634
7643
  componentIndex(layer, index) {
7635
7644
  if (!Number.isInteger(index) || index < 0 || index >= layer.components.length) {
7636
- throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`componentIndex must be 0..${layer.components.length - 1} (get_shape_layer lists the components), got ${String(index)}.`);
7645
+ throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`componentIndex must be 0..${layer.components.length - 1} (get_shape_layer lists the components), got ${String(index)}.`);
7637
7646
  }
7638
7647
  return index;
7639
7648
  }
@@ -7643,36 +7652,36 @@ var ImageEditorController = (_class7 = class {
7643
7652
  * the live shape) or its operation. Returns the shape.
7644
7653
  */
7645
7654
  setShapeComponent(id, index, change, commitToHistory = true) {
7646
- const layer = _chunkXN2NBLV5cjs.requireShapeLayer.call(void 0, this.state.layers, id);
7655
+ const layer = _chunkPMEHFHSPcjs.requireShapeLayer.call(void 0, this.state.layers, id);
7647
7656
  const i = this.componentIndex(layer, index);
7648
7657
  const current = layer.components[i];
7649
7658
  let shape = change.shape;
7650
7659
  if (shape && current.live && shape.kind === void 0) shape = { ...current.live, ...shape };
7651
7660
  else if (shape && current.live && shape.kind === current.live.kind) shape = { ...current.live, ...shape };
7652
- const next = shape !== void 0 || change.subpaths !== void 0 ? this.componentFrom({ ...change, shape, op: _nullishCoalesce(change.op, () => ( current.op)) }, "") : { ...current, op: _chunkXN2NBLV5cjs.requireOperation.call(void 0, change.op) };
7661
+ const next = shape !== void 0 || change.subpaths !== void 0 ? this.componentFrom({ ...change, shape, op: _nullishCoalesce(change.op, () => ( current.op)) }, "") : { ...current, op: _chunkPMEHFHSPcjs.requireOperation.call(void 0, change.op) };
7653
7662
  const components = layer.components.map((c, k) => k === i ? next : c);
7654
- const { layers } = _chunkXN2NBLV5cjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
7663
+ const { layers } = _chunkPMEHFHSPcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
7655
7664
  this.commitLayers(layers, void 0, commitToHistory);
7656
7665
  return this.shapeInfo(id);
7657
7666
  }
7658
7667
  /** Adds a component to a shape (path operations), on top unless `index` is given (one undo step). Returns the shape. */
7659
7668
  addShapeComponent(id, spec, index) {
7660
- const layer = _chunkXN2NBLV5cjs.requireShapeLayer.call(void 0, this.state.layers, id);
7669
+ const layer = _chunkPMEHFHSPcjs.requireShapeLayer.call(void 0, this.state.layers, id);
7661
7670
  const c = this.componentFrom(spec, "");
7662
7671
  const at = index === void 0 ? layer.components.length : index;
7663
- if (!Number.isInteger(at) || at < 0 || at > layer.components.length) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`index must be 0..${layer.components.length}, got ${String(index)}.`);
7672
+ if (!Number.isInteger(at) || at < 0 || at > layer.components.length) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`index must be 0..${layer.components.length}, got ${String(index)}.`);
7664
7673
  const components = [...layer.components.slice(0, at), c, ...layer.components.slice(at)];
7665
- const { layers } = _chunkXN2NBLV5cjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
7674
+ const { layers } = _chunkPMEHFHSPcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
7666
7675
  this.commitLayers(layers);
7667
7676
  return this.shapeInfo(id);
7668
7677
  }
7669
7678
  /** Removes one component of a shape (one undo step); the last one cannot go (delete the layer instead). Returns the shape. */
7670
7679
  removeShapeComponent(id, index) {
7671
- const layer = _chunkXN2NBLV5cjs.requireShapeLayer.call(void 0, this.state.layers, id);
7680
+ const layer = _chunkPMEHFHSPcjs.requireShapeLayer.call(void 0, this.state.layers, id);
7672
7681
  const i = this.componentIndex(layer, index);
7673
- if (layer.components.length === 1) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("This is the shape's only component; delete the layer instead (delete_layer).");
7682
+ if (layer.components.length === 1) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("This is the shape's only component; delete the layer instead (delete_layer).");
7674
7683
  const components = layer.components.filter((_, k) => k !== i);
7675
- const { layers } = _chunkXN2NBLV5cjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
7684
+ const { layers } = _chunkPMEHFHSPcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components }), this.shapeEnv(), "edit its path");
7676
7685
  this.commitLayers(layers);
7677
7686
  return this.shapeInfo(id);
7678
7687
  }
@@ -7681,10 +7690,10 @@ var ImageEditorController = (_class7 = class {
7681
7690
  * shapes become paths), as one undo step. Returns the shape.
7682
7691
  */
7683
7692
  mergeShapeComponents(id) {
7684
- const layer = _chunkXN2NBLV5cjs.requireShapeLayer.call(void 0, this.state.layers, id);
7685
- if (layer.components.length < 2) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("The shape has one component; there is nothing to merge.");
7686
- const components = _chunkXN2NBLV5cjs.mergeShapeComponents.call(void 0, layer.components, layer.fillRule);
7687
- const { layers } = _chunkXN2NBLV5cjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components, fillRule: void 0 }), this.shapeEnv(), "edit its path");
7693
+ const layer = _chunkPMEHFHSPcjs.requireShapeLayer.call(void 0, this.state.layers, id);
7694
+ if (layer.components.length < 2) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("The shape has one component; there is nothing to merge.");
7695
+ const components = _chunkPMEHFHSPcjs.mergeShapeComponents.call(void 0, layer.components, layer.fillRule);
7696
+ const { layers } = _chunkPMEHFHSPcjs.updateShapeLayer.call(void 0, this.state.layers, id, () => ({ components, fillRule: void 0 }), this.shapeEnv(), "edit its path");
7688
7697
  this.commitLayers(layers);
7689
7698
  return this.shapeInfo(id);
7690
7699
  }
@@ -7694,8 +7703,8 @@ var ImageEditorController = (_class7 = class {
7694
7703
  * step. Returns the layer id.
7695
7704
  */
7696
7705
  async rasterizeLayer(id) {
7697
- const layer = _chunkXN2NBLV5cjs.requireLayer.call(void 0, this.state.layers, id).layer;
7698
- _chunkXN2NBLV5cjs.requireUnlocked.call(void 0, layer, "all", "rasterize it");
7706
+ const layer = _chunkPMEHFHSPcjs.requireLayer.call(void 0, this.state.layers, id).layer;
7707
+ _chunkPMEHFHSPcjs.requireUnlocked.call(void 0, layer, "all", "rasterize it");
7699
7708
  const { width, height } = this.naturalSize;
7700
7709
  const canvas = { x: 0, y: 0, width, height };
7701
7710
  let next;
@@ -7711,8 +7720,8 @@ var ImageEditorController = (_class7 = class {
7711
7720
  if (layer.locks) next.locks = layer.locks;
7712
7721
  if (this.state.selectedAnnotationId === layer.annotation.id) this.state.selectedAnnotationId = null;
7713
7722
  } else if (layer.type === "pixel") {
7714
- if (!_optionalChain([layer, 'access', _295 => _295.filters, 'optionalAccess', _296 => _296.length])) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`Layer "${layer.name || id}" is already pixels with no filters to bake.`);
7715
- _chunkXN2NBLV5cjs.requireUnlocked.call(void 0, layer, "pixels", "rasterize it");
7723
+ if (!_optionalChain([layer, 'access', _295 => _295.filters, 'optionalAccess', _296 => _296.length])) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Layer "${layer.name || id}" is already pixels with no filters to bake.`);
7724
+ _chunkPMEHFHSPcjs.requireUnlocked.call(void 0, layer, "pixels", "rasterize it");
7716
7725
  const spatial = layer.filters.some((f) => f.enabled && f.kind === "blur");
7717
7726
  const content = { ...layer, visible: true, opacity: 1, blend: "normal" };
7718
7727
  delete content.mask;
@@ -7729,10 +7738,10 @@ var ImageEditorController = (_class7 = class {
7729
7738
  } else if (layer.type === "smart") {
7730
7739
  return this.rasterizeSmartObject(id);
7731
7740
  } else if (layer.type === "shape" || layer.type === "type") {
7732
- next = layer.type === "shape" ? _chunkXN2NBLV5cjs.shapeAsPixelLayer.call(void 0, layer) : _chunkXN2NBLV5cjs.typeAsPixelLayer.call(void 0, layer);
7741
+ next = layer.type === "shape" ? _chunkPMEHFHSPcjs.shapeAsPixelLayer.call(void 0, layer) : _chunkPMEHFHSPcjs.typeAsPixelLayer.call(void 0, layer);
7733
7742
  if (this.state.selectedAnnotationId && this.state.selectedAnnotationId === _optionalChain([layer, 'access', _297 => _297.annotation, 'optionalAccess', _298 => _298.id])) this.state.selectedAnnotationId = null;
7734
7743
  } else {
7735
- throw new (0, _chunkXN2NBLV5cjs.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.`);
7744
+ throw new (0, _chunkPMEHFHSPcjs.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.`);
7736
7745
  }
7737
7746
  this.commitLayers(_chunkAEAAN4ADcjs.mapLayer.call(void 0, this.state.layers, id, () => next));
7738
7747
  return id;
@@ -7757,7 +7766,7 @@ var ImageEditorController = (_class7 = class {
7757
7766
  setColorMode(mode, options = {}) {
7758
7767
  let next;
7759
7768
  if (mode === "rgb") {
7760
- if (options.profile !== void 0) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("An RGB document takes no CMYK profile; use assign_profile for its working space.");
7769
+ if (options.profile !== void 0) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("An RGB document takes no CMYK profile; use assign_profile for its working space.");
7761
7770
  next = null;
7762
7771
  } else if (mode === "lab") next = { mode: "lab" };
7763
7772
  else if (mode === "cmyk") {
@@ -7765,14 +7774,14 @@ var ImageEditorController = (_class7 = class {
7765
7774
  try {
7766
7775
  doc = documentProfile(_nullishCoalesce(options.profile, () => ( "coated-cmyk")));
7767
7776
  } catch (e) {
7768
- throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
7777
+ throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
7769
7778
  }
7770
7779
  const cs = resolveProfile(doc).colorSpace;
7771
- if (cs !== "cmyk") throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`CMYK mode needs a CMYK profile; "${doc.name}" is ${cs.toUpperCase()}.`);
7780
+ if (cs !== "cmyk") throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`CMYK mode needs a CMYK profile; "${doc.name}" is ${cs.toUpperCase()}.`);
7772
7781
  const intent = _nullishCoalesce(options.intent, () => ( "relative"));
7773
- if (!_chunkG5NMLUVFcjs.INTENTS.includes(intent)) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkG5NMLUVFcjs.INTENTS.join(", ")}.`);
7782
+ if (!_chunkG5NMLUVFcjs.INTENTS.includes(intent)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkG5NMLUVFcjs.INTENTS.join(", ")}.`);
7774
7783
  next = { mode: "cmyk", profile: doc, intent };
7775
- } else throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`Unknown colour mode "${String(mode)}"; use rgb, cmyk or lab.`);
7784
+ } else throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Unknown colour mode "${String(mode)}"; use rgb, cmyk or lab.`);
7776
7785
  this.recordHistory();
7777
7786
  if (next) this.state.colorMode = next;
7778
7787
  else delete this.state.colorMode;
@@ -7785,10 +7794,10 @@ var ImageEditorController = (_class7 = class {
7785
7794
  try {
7786
7795
  doc = documentProfile(profile);
7787
7796
  } catch (e) {
7788
- throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
7797
+ throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
7789
7798
  }
7790
7799
  const cs = resolveProfile(doc).colorSpace;
7791
- if (cs !== "rgb") throw new (0, _chunkXN2NBLV5cjs.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.`);
7800
+ if (cs !== "rgb") throw new (0, _chunkPMEHFHSPcjs.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.`);
7792
7801
  return doc;
7793
7802
  }
7794
7803
  /**
@@ -7814,7 +7823,7 @@ var ImageEditorController = (_class7 = class {
7814
7823
  convertToProfile(profile, options = {}) {
7815
7824
  const doc = this.rgbProfileArg(profile, "Convert to Profile");
7816
7825
  const intent = _nullishCoalesce(options.intent, () => ( "relative"));
7817
- if (!_chunkG5NMLUVFcjs.INTENTS.includes(intent)) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkG5NMLUVFcjs.INTENTS.join(", ")}.`);
7826
+ if (!_chunkG5NMLUVFcjs.INTENTS.includes(intent)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkG5NMLUVFcjs.INTENTS.join(", ")}.`);
7818
7827
  const t = _chunkG5NMLUVFcjs.Transform.create(resolveProfile(this.state.colorProfile), resolveProfile(doc), { intent, bpc: _nullishCoalesce(options.bpc, () => ( true)) });
7819
7828
  const converted = [];
7820
7829
  const unconverted = [];
@@ -7844,11 +7853,11 @@ var ImageEditorController = (_class7 = class {
7844
7853
  else if (l.type === "pixel") next2 = { ...next2, surface: convertSurfaceColors(this.surfaceOf(l), t), source: void 0 };
7845
7854
  else if (l.type === "shape") {
7846
7855
  const s = next2;
7847
- next2 = _chunkXN2NBLV5cjs.rerenderShape.call(void 0, { ...s, fill: convertColorFields(s.fill, hex), stroke: convertColorFields(s.stroke, hex), ...s.annotation ? { annotation: convertColorFields(s.annotation, hex) } : {} }, shapeEnv);
7856
+ next2 = _chunkPMEHFHSPcjs.rerenderShape.call(void 0, { ...s, fill: convertColorFields(s.fill, hex), stroke: convertColorFields(s.stroke, hex), ...s.annotation ? { annotation: convertColorFields(s.annotation, hex) } : {} }, shapeEnv);
7848
7857
  } else if (l.type === "type") {
7849
7858
  const recoloured = { ...next2, runs: convertColorFields(l.runs, hex) };
7850
7859
  try {
7851
- next2 = _chunkXN2NBLV5cjs.rerenderText.call(void 0, recoloured, textEnv);
7860
+ next2 = _chunkPMEHFHSPcjs.rerenderText.call(void 0, recoloured, textEnv);
7852
7861
  } catch (e27) {
7853
7862
  next2 = { ...recoloured, surface: convertSurfaceColors(l.surface, t) };
7854
7863
  }
@@ -7878,12 +7887,12 @@ var ImageEditorController = (_class7 = class {
7878
7887
  try {
7879
7888
  doc = documentProfile(setup.profile);
7880
7889
  } catch (e) {
7881
- throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
7890
+ throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
7882
7891
  }
7883
7892
  const intent = _nullishCoalesce(setup.intent, () => ( DEFAULT_PROOF.intent));
7884
- if (!_chunkG5NMLUVFcjs.INTENTS.includes(intent)) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkG5NMLUVFcjs.INTENTS.join(", ")}.`);
7893
+ if (!_chunkG5NMLUVFcjs.INTENTS.includes(intent)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Unknown rendering intent "${String(intent)}"; use ${_chunkG5NMLUVFcjs.INTENTS.join(", ")}.`);
7885
7894
  const next = { ...DEFAULT_PROOF, ...setup, intent, profile: doc };
7886
- if (!_chunkG5NMLUVFcjs.canBeDestination.call(void 0, resolveProfile(doc))) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`"${doc.name}" describes a source only, so colours cannot be proofed through it.`);
7895
+ if (!_chunkG5NMLUVFcjs.canBeDestination.call(void 0, resolveProfile(doc))) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`"${doc.name}" describes a source only, so colours cannot be proofed through it.`);
7887
7896
  this.state.proofSetup = next;
7888
7897
  this.notify();
7889
7898
  return next;
@@ -7900,14 +7909,14 @@ var ImageEditorController = (_class7 = class {
7900
7909
  src = options.from !== void 0 ? resolveProfile(documentProfile(options.from)) : resolveProfile(this.state.colorProfile);
7901
7910
  dst = resolveProfile(documentProfile(to));
7902
7911
  } catch (e) {
7903
- throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
7912
+ throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(e instanceof Error ? e.message : String(e));
7904
7913
  }
7905
- if (src.colorSpace !== "rgb") throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("Colours are given as #rrggbb, so the source profile must be RGB.");
7914
+ if (src.colorSpace !== "rgb") throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Colours are given as #rrggbb, so the source profile must be RGB.");
7906
7915
  const t = _chunkG5NMLUVFcjs.Transform.create(src, dst, { intent: _nullishCoalesce(options.intent, () => ( "relative")), bpc: _nullishCoalesce(options.bpc, () => ( true)) });
7907
7916
  const toLab = _chunkG5NMLUVFcjs.Transform.create(src, _chunkG5NMLUVFcjs.builtinProfile.call(void 0, "lab-d50"), { intent: "relative", bpc: false });
7908
7917
  return colors.map((input) => {
7909
7918
  const m = /^#?([0-9a-f]{6})$/i.exec(input.trim());
7910
- if (!m) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`Invalid colour "${input}"; use #rrggbb.`);
7919
+ if (!m) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Invalid colour "${input}"; use #rrggbb.`);
7911
7920
  const n = parseInt(m[1], 16);
7912
7921
  const rgb = [(n >> 16 & 255) / 255, (n >> 8 & 255) / 255, (n & 255) / 255];
7913
7922
  const out = new Float32Array(16);
@@ -7933,7 +7942,7 @@ var ImageEditorController = (_class7 = class {
7933
7942
  * the ids of the layers whose pixels changed.
7934
7943
  */
7935
7944
  setBitDepth(depth) {
7936
- if (!_chunkO7LUD7MHcjs.isBitDepth.call(void 0, depth)) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`Bit depth must be 8, 16 or 32, not ${String(depth)}.`);
7945
+ if (!_chunkO7LUD7MHcjs.isBitDepth.call(void 0, depth)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Bit depth must be 8, 16 or 32, not ${String(depth)}.`);
7937
7946
  const changed = [];
7938
7947
  const withMask = (l) => {
7939
7948
  const m = l.mask;
@@ -7982,7 +7991,7 @@ var ImageEditorController = (_class7 = class {
7982
7991
  * Throws `PsdError` for files that cannot be read at all.
7983
7992
  */
7984
7993
  loadPsd(bytes) {
7985
- const result = _chunkXN2NBLV5cjs.importPsd.call(void 0, bytes, { newId: () => _chunkXN2NBLV5cjs.newLayerId.call(void 0, ) });
7994
+ const result = _chunkPMEHFHSPcjs.importPsd.call(void 0, bytes, { newId: () => _chunkPMEHFHSPcjs.newLayerId.call(void 0, ) });
7986
7995
  this.abandonContents();
7987
7996
  this.recordHistory();
7988
7997
  const s = this.state;
@@ -7992,7 +8001,7 @@ var ImageEditorController = (_class7 = class {
7992
8001
  if (!this.samplePixelsOverride) this.samplePixels = null;
7993
8002
  s.layers = this.checkPsdFonts(result);
7994
8003
  s.crop = null;
7995
- s.transform = { ..._chunkXN2NBLV5cjs.DEFAULT_TRANSFORM_VALUES };
8004
+ s.transform = { ..._chunkPMEHFHSPcjs.DEFAULT_TRANSFORM_VALUES };
7996
8005
  s.outputOpacity = 1;
7997
8006
  delete s.legacyOutputBlur;
7998
8007
  s.selection = null;
@@ -8043,7 +8052,7 @@ var ImageEditorController = (_class7 = class {
8043
8052
  let layers = result.layers;
8044
8053
  const missing = /* @__PURE__ */ new Map();
8045
8054
  for (const l of types) {
8046
- const fonts = shaper ? _chunk5OOIUXNJcjs.layoutText.call(void 0, l, shaper).missingFonts : [...new Set(l.runs.map((r) => r.style.fontFamily))];
8055
+ const fonts = shaper ? _chunkXFXHA5MUcjs.layoutText.call(void 0, l, shaper).missingFonts : [...new Set(l.runs.map((r) => r.style.fontFamily))];
8047
8056
  if (!fonts.length) continue;
8048
8057
  layers = _chunkAEAAN4ADcjs.mapLayer.call(void 0, layers, l.id, () => ({ ...l, missingFonts: fonts }));
8049
8058
  for (const f of fonts) missing.set(f, [..._nullishCoalesce(missing.get(f), () => ( [])), l.name]);
@@ -8071,7 +8080,7 @@ var ImageEditorController = (_class7 = class {
8071
8080
  const canRasterize = this.renderer.canRasterize();
8072
8081
  await this.renderer.prepareLayerAssets(this.state.layers, width, height);
8073
8082
  const sources = this.renderer.compositorSources(width, height);
8074
- const compositor = new (0, _chunkXN2NBLV5cjs.LayerCompositor)();
8083
+ const compositor = new (0, _chunkPMEHFHSPcjs.LayerCompositor)();
8075
8084
  const bakeMask = (layer) => {
8076
8085
  const mask = layer.mask;
8077
8086
  if (!_optionalChain([mask, 'optionalAccess', _309 => _309.source])) return mask;
@@ -8153,7 +8162,7 @@ var ImageEditorController = (_class7 = class {
8153
8162
  out.surface = this.surfaceOf(layer);
8154
8163
  delete out.source;
8155
8164
  }
8156
- const active = _nullishCoalesce(_optionalChain([layer, 'access', _313 => _313.filters, 'optionalAccess', _314 => _314.filter, 'call', _315 => _315(_chunkXN2NBLV5cjs.isActiveFilter)]), () => ( []));
8165
+ const active = _nullishCoalesce(_optionalChain([layer, 'access', _313 => _313.filters, 'optionalAccess', _314 => _314.filter, 'call', _315 => _315(_chunkPMEHFHSPcjs.isActiveFilter)]), () => ( []));
8157
8166
  if (active.length) {
8158
8167
  add2("Layer filters (develop, blur) were baked into the pixels", layer.name);
8159
8168
  const content = { ...out, visible: true, opacity: 1, blend: "normal" };
@@ -8186,8 +8195,8 @@ var ImageEditorController = (_class7 = class {
8186
8195
  const color = this.psdColorOptions(warnings);
8187
8196
  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).`);
8188
8197
  const depth = color.colorMode && this.bitDepth === 32 ? 16 : this.bitDepth;
8189
- const mergedDeep = depth === 8 ? void 0 : _chunkAEAAN4ADcjs.workingToSamples.call(void 0, _chunkXN2NBLV5cjs.compositeDeep.call(void 0, prepared, canvas, sources, depth), depth);
8190
- const result = _chunkXN2NBLV5cjs.exportPsd.call(void 0, { width, height, layers: prepared, merged, mergedDeep, resolution: this.psdResolution, patterns: this.state.patterns, globalLight: this.state.globalLight, depth, ...color });
8198
+ const mergedDeep = depth === 8 ? void 0 : _chunkAEAAN4ADcjs.workingToSamples.call(void 0, _chunkPMEHFHSPcjs.compositeDeep.call(void 0, prepared, canvas, sources, depth), depth);
8199
+ const result = _chunkPMEHFHSPcjs.exportPsd.call(void 0, { width, height, layers: prepared, merged, mergedDeep, resolution: this.psdResolution, patterns: this.state.patterns, globalLight: this.state.globalLight, depth, ...color });
8191
8200
  warnings.push(...result.warnings);
8192
8201
  return { bytes: result.bytes, warnings, psb: result.psb, width, height };
8193
8202
  }
@@ -8203,13 +8212,13 @@ var ImageEditorController = (_class7 = class {
8203
8212
  if (!this.samplePixelsOverride) this.samplePixels = null;
8204
8213
  if (this.state.selection && (sx !== 1 || sy !== 1)) {
8205
8214
  this.state.selection = normalizeSelection(
8206
- _chunkXN2NBLV5cjs.resizeSelection.call(void 0, this.state.selection, Math.round(next.dimensions.width), Math.round(next.dimensions.height))
8215
+ _chunkPMEHFHSPcjs.resizeSelection.call(void 0, this.state.selection, Math.round(next.dimensions.width), Math.round(next.dimensions.height))
8207
8216
  );
8208
8217
  }
8209
8218
  let layers = this.state.layers;
8210
8219
  if (sx !== 1 || sy !== 1) {
8211
8220
  if (this.state.crop) {
8212
- this.state.crop = _chunkXN2NBLV5cjs.clampCropToImage.call(void 0,
8221
+ this.state.crop = _chunkPMEHFHSPcjs.clampCropToImage.call(void 0,
8213
8222
  {
8214
8223
  x: Math.round(this.state.crop.x * sx),
8215
8224
  y: Math.round(this.state.crop.y * sy),
@@ -8228,17 +8237,17 @@ var ImageEditorController = (_class7 = class {
8228
8237
  } else if (l.type === "shape") {
8229
8238
  const a = l.annotation;
8230
8239
  const scaled = a ? scaleAnnotation(a, sx, sy) : null;
8231
- const fromAnnotation = scaled ? _chunkXN2NBLV5cjs.shapeFromAnnotation.call(void 0, scaled) : null;
8240
+ const fromAnnotation = scaled ? _chunkPMEHFHSPcjs.shapeFromAnnotation.call(void 0, scaled) : null;
8232
8241
  const m = [sx, 0, 0, sy, 0, 0];
8233
- const components = _nullishCoalesce(_optionalChain([fromAnnotation, 'optionalAccess', _323 => _323.components]), () => ( _chunkXN2NBLV5cjs.transformShapeComponents.call(void 0, l.components, (p) => ({ x: p.x * sx, y: p.y * sy }), m)));
8242
+ const components = _nullishCoalesce(_optionalChain([fromAnnotation, 'optionalAccess', _323 => _323.components]), () => ( _chunkPMEHFHSPcjs.transformShapeComponents.call(void 0, l.components, (p) => ({ x: p.x * sx, y: p.y * sy }), m)));
8234
8243
  const moved = { ...l, components, ...fromAnnotation ? { fill: fromAnnotation.fill, stroke: fromAnnotation.stroke } : {} };
8235
8244
  if (scaled && fromAnnotation) moved.annotation = scaled;
8236
8245
  else delete moved.annotation;
8237
- layers = _chunkAEAAN4ADcjs.mapLayer.call(void 0, layers, l.id, () => _chunkXN2NBLV5cjs.rerenderShape.call(void 0, moved, env));
8246
+ layers = _chunkAEAAN4ADcjs.mapLayer.call(void 0, layers, l.id, () => _chunkPMEHFHSPcjs.rerenderShape.call(void 0, moved, env));
8238
8247
  }
8239
8248
  }
8240
8249
  }
8241
- const bg = _chunkXN2NBLV5cjs.developTarget.call(void 0, layers, null);
8250
+ const bg = _chunkPMEHFHSPcjs.developTarget.call(void 0, layers, null);
8242
8251
  if (bg && bg.source !== "document") layers = _chunkAEAAN4ADcjs.mapLayer.call(void 0, layers, bg.id, () => ({ ...bg, source: "document" }));
8243
8252
  if (clearAnnotations) {
8244
8253
  for (const l of _chunkAEAAN4ADcjs.flattenLayers.call(void 0, layers)) if (l.type === "annotation" || (l.type === "shape" || l.type === "type") && l.annotation) layers = _chunkAEAAN4ADcjs.mapLayer.call(void 0, layers, l.id, () => null);
@@ -8259,7 +8268,7 @@ var ImageEditorController = (_class7 = class {
8259
8268
  let out;
8260
8269
  try {
8261
8270
  out = this.serializeState();
8262
- if (_optionalChain([this, 'access', _327 => _327.state, 'access', _328 => _328.selection, 'optionalAccess', _329 => _329.bounds])) out.selection = _chunkXN2NBLV5cjs.serializeSelection.call(void 0, this.state.selection);
8271
+ if (_optionalChain([this, 'access', _327 => _327.state, 'access', _328 => _328.selection, 'optionalAccess', _329 => _329.bounds])) out.selection = _chunkPMEHFHSPcjs.serializeSelection.call(void 0, this.state.selection);
8263
8272
  } finally {
8264
8273
  if (root) {
8265
8274
  this.state = current;
@@ -8267,8 +8276,8 @@ var ImageEditorController = (_class7 = class {
8267
8276
  this.viewKey = [];
8268
8277
  }
8269
8278
  }
8270
- if (!options || out.version !== _chunkXN2NBLV5cjs.LAYERED_SCHEMA_VERSION) return options ? Promise.resolve(out) : out;
8271
- return _chunkXN2NBLV5cjs.serializeLayersExternal.call(void 0, this.rootLayers(), options.store).then(({ layers, assets, smartContents }) => smartContents ? { ...out, layers, assets, smartContents } : { ...out, layers, assets });
8279
+ if (!options || out.version !== _chunkPMEHFHSPcjs.LAYERED_SCHEMA_VERSION) return options ? Promise.resolve(out) : out;
8280
+ return _chunkPMEHFHSPcjs.serializeLayersExternal.call(void 0, this.rootLayers(), options.store).then(({ layers, assets, smartContents }) => smartContents ? { ...out, layers, assets, smartContents } : { ...out, layers, assets });
8272
8281
  }
8273
8282
  /**
8274
8283
  * Loads a stored state whose v3 assets may live in an asset store (references other than data
@@ -8276,12 +8285,12 @@ var ImageEditorController = (_class7 = class {
8276
8285
  * out and listed in `lastLoadProblems`.
8277
8286
  */
8278
8287
  async loadJSONAsync(data, options = {}) {
8279
- if (data.version !== _chunkXN2NBLV5cjs.LAYERED_SCHEMA_VERSION || !data.assets) {
8288
+ if (data.version !== _chunkPMEHFHSPcjs.LAYERED_SCHEMA_VERSION || !data.assets) {
8280
8289
  this.loadJSON(data);
8281
8290
  return;
8282
8291
  }
8283
8292
  const problems = [];
8284
- const assets = await _chunkXN2NBLV5cjs.resolveExternalAssets.call(void 0, data.assets, options.store, problems);
8293
+ const assets = await _chunkPMEHFHSPcjs.resolveExternalAssets.call(void 0, data.assets, options.store, problems);
8285
8294
  this.loadJSON({ ...data, assets });
8286
8295
  this.lastLoadProblems = [...problems, ...this.lastLoadProblems];
8287
8296
  }
@@ -8293,7 +8302,7 @@ var ImageEditorController = (_class7 = class {
8293
8302
  let selection = null;
8294
8303
  if (data.selection) {
8295
8304
  try {
8296
- selection = normalizeSelection(_chunkXN2NBLV5cjs.deserializeSelection.call(void 0, data.selection));
8305
+ selection = normalizeSelection(_chunkPMEHFHSPcjs.deserializeSelection.call(void 0, data.selection));
8297
8306
  } catch (e28) {
8298
8307
  selection = null;
8299
8308
  }
@@ -8311,8 +8320,8 @@ var ImageEditorController = (_class7 = class {
8311
8320
  if (isLayered(data)) {
8312
8321
  const problems = [];
8313
8322
  const canvas = typeof data.width === "number" && data.width > 0 && typeof data.height === "number" && data.height > 0 ? { width: data.width, height: data.height } : this.naturalSize;
8314
- const storedPatterns = _chunkXN2NBLV5cjs.deserializePatterns.call(void 0, data.patterns, []);
8315
- s.layers = _chunkXN2NBLV5cjs.deserializeLayers.call(void 0, data.layers, {
8323
+ const storedPatterns = _chunkPMEHFHSPcjs.deserializePatterns.call(void 0, data.patterns, []);
8324
+ s.layers = _chunkPMEHFHSPcjs.deserializeLayers.call(void 0, data.layers, {
8316
8325
  assets: _nullishCoalesce(data.assets, () => ( {})),
8317
8326
  problems,
8318
8327
  smartContents: Array.isArray(data.smartContents) ? data.smartContents : [],
@@ -8330,7 +8339,7 @@ var ImageEditorController = (_class7 = class {
8330
8339
  const light = data.globalLight;
8331
8340
  if (light && Number.isFinite(light.angle) && Number.isFinite(light.altitude)) s.globalLight = { angle: light.angle, altitude: Math.min(90, Math.max(0, light.altitude)) };
8332
8341
  else delete s.globalLight;
8333
- const patterns = _chunkXN2NBLV5cjs.deserializePatterns.call(void 0, data.patterns, problems);
8342
+ const patterns = _chunkPMEHFHSPcjs.deserializePatterns.call(void 0, data.patterns, problems);
8334
8343
  if (patterns.length) s.patterns = patterns;
8335
8344
  else delete s.patterns;
8336
8345
  if (data.bitDepth === 16 || data.bitDepth === 32) s.bitDepth = data.bitDepth;
@@ -8346,7 +8355,7 @@ var ImageEditorController = (_class7 = class {
8346
8355
  }
8347
8356
  } else {
8348
8357
  const { width, height } = this.naturalSize;
8349
- const stack = _chunkXN2NBLV5cjs.layersFromLegacy.call(void 0, data, width, height);
8358
+ const stack = _chunkPMEHFHSPcjs.layersFromLegacy.call(void 0, data, width, height);
8350
8359
  s.layers = stack.layers;
8351
8360
  s.outputOpacity = stack.outputOpacity;
8352
8361
  if (stack.legacyOutputBlur !== void 0) s.legacyOutputBlur = stack.legacyOutputBlur;
@@ -8367,7 +8376,7 @@ var ImageEditorController = (_class7 = class {
8367
8376
  }
8368
8377
  serializeState() {
8369
8378
  const { width, height } = this.naturalSize;
8370
- const view = _chunkXN2NBLV5cjs.legacyView.call(void 0, this.stack(), width, height, null);
8379
+ const view = _chunkPMEHFHSPcjs.legacyView.call(void 0, this.stack(), width, height, null);
8371
8380
  if (view.exact && !this.state.globalLight && !_optionalChain([this, 'access', _330 => _330.state, 'access', _331 => _331.patterns, 'optionalAccess', _332 => _332.length]) && this.bitDepth === 8 && !this.state.colorProfile && !this.state.colorMode) {
8372
8381
  return {
8373
8382
  // States without adjustment layers keep schema 1, so they round-trip unchanged.
@@ -8382,9 +8391,9 @@ var ImageEditorController = (_class7 = class {
8382
8391
  annotations: JSON.parse(JSON.stringify(view.annotations))
8383
8392
  };
8384
8393
  }
8385
- const { layers, assets, smartContents } = _chunkXN2NBLV5cjs.serializeLayers.call(void 0, this.state.layers);
8394
+ const { layers, assets, smartContents } = _chunkPMEHFHSPcjs.serializeLayers.call(void 0, this.state.layers);
8386
8395
  const out = {
8387
- version: _chunkXN2NBLV5cjs.LAYERED_SCHEMA_VERSION,
8396
+ version: _chunkPMEHFHSPcjs.LAYERED_SCHEMA_VERSION,
8388
8397
  width,
8389
8398
  height,
8390
8399
  layers,
@@ -8396,7 +8405,7 @@ var ImageEditorController = (_class7 = class {
8396
8405
  };
8397
8406
  if (this.state.legacyOutputBlur !== void 0) out.legacyOutputBlur = this.state.legacyOutputBlur;
8398
8407
  if (this.state.globalLight) out.globalLight = { ...this.state.globalLight };
8399
- if (_optionalChain([this, 'access', _336 => _336.state, 'access', _337 => _337.patterns, 'optionalAccess', _338 => _338.length])) out.patterns = _chunkXN2NBLV5cjs.serializePatterns.call(void 0, this.state.patterns);
8408
+ if (_optionalChain([this, 'access', _336 => _336.state, 'access', _337 => _337.patterns, 'optionalAccess', _338 => _338.length])) out.patterns = _chunkPMEHFHSPcjs.serializePatterns.call(void 0, this.state.patterns);
8400
8409
  if (smartContents) out.smartContents = smartContents;
8401
8410
  if (this.state.bitDepth === 16 || this.state.bitDepth === 32) out.bitDepth = this.state.bitDepth;
8402
8411
  if (this.state.colorProfile) out.colorProfile = serializeColorProfile(this.state.colorProfile);
@@ -8408,7 +8417,7 @@ function serializeAdjustments(adjustments) {
8408
8417
  const out = { ...adjustments };
8409
8418
  if (_optionalChain([out, 'access', _339 => _339.layers, 'optionalAccess', _340 => _340.length])) out.layers = JSON.parse(JSON.stringify(out.layers));
8410
8419
  else delete out.layers;
8411
- if (_chunkXN2NBLV5cjs.normalizeProcessVersion.call(void 0, out.process) === _chunkXN2NBLV5cjs.LEGACY_PROCESS_VERSION) {
8420
+ if (_chunkPMEHFHSPcjs.normalizeProcessVersion.call(void 0, out.process) === _chunkPMEHFHSPcjs.LEGACY_PROCESS_VERSION) {
8412
8421
  delete out.process;
8413
8422
  if (!out.tint) delete out.tint;
8414
8423
  }
@@ -8419,7 +8428,7 @@ function withDevelop(layer, partial) {
8419
8428
  let i = filters.findIndex((f) => f.kind === "develop");
8420
8429
  if (i === -1) {
8421
8430
  filters.unshift({
8422
- id: layer.source === "document" ? _chunkXN2NBLV5cjs.DEVELOP_FILTER_ID : _chunkXN2NBLV5cjs.newLayerId.call(void 0, "flt"),
8431
+ id: layer.source === "document" ? _chunkPMEHFHSPcjs.DEVELOP_FILTER_ID : _chunkPMEHFHSPcjs.newLayerId.call(void 0, "flt"),
8423
8432
  kind: "develop",
8424
8433
  enabled: true,
8425
8434
  brightness: 0,
@@ -8428,7 +8437,7 @@ function withDevelop(layer, partial) {
8428
8437
  exposure: 0,
8429
8438
  temperature: 0,
8430
8439
  tint: 0,
8431
- process: _chunkXN2NBLV5cjs.LATEST_PROCESS_VERSION
8440
+ process: _chunkPMEHFHSPcjs.LATEST_PROCESS_VERSION
8432
8441
  });
8433
8442
  i = 0;
8434
8443
  }
@@ -8437,7 +8446,7 @@ function withDevelop(layer, partial) {
8437
8446
  const v = partial[k];
8438
8447
  if (typeof v === "number" && Number.isFinite(v)) next[k] = v;
8439
8448
  }
8440
- if ("process" in partial) next.process = _chunkXN2NBLV5cjs.normalizeProcessVersion.call(void 0, partial.process);
8449
+ if ("process" in partial) next.process = _chunkPMEHFHSPcjs.normalizeProcessVersion.call(void 0, partial.process);
8441
8450
  filters[i] = next;
8442
8451
  return { ...layer, filters };
8443
8452
  }
@@ -8446,7 +8455,7 @@ function withBlur(layer, radius) {
8446
8455
  const filters = (_nullishCoalesce(layer.filters, () => ( []))).filter((f) => f.kind !== "blur");
8447
8456
  if (radius > 0) {
8448
8457
  filters.push({
8449
- id: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _344 => _344.id]), () => ( (layer.source === "document" ? _chunkXN2NBLV5cjs.BLUR_FILTER_ID : _chunkXN2NBLV5cjs.newLayerId.call(void 0, "flt")))),
8458
+ id: _nullishCoalesce(_optionalChain([existing, 'optionalAccess', _344 => _344.id]), () => ( (layer.source === "document" ? _chunkPMEHFHSPcjs.BLUR_FILTER_ID : _chunkPMEHFHSPcjs.newLayerId.call(void 0, "flt")))),
8450
8459
  kind: "blur",
8451
8460
  enabled: true,
8452
8461
  radius
@@ -8470,7 +8479,7 @@ function mergeAdjustmentNode(node, update, width, height) {
8470
8479
  if (!update.mask) delete next.mask;
8471
8480
  else {
8472
8481
  const current = node.mask && !node.mask.source ? node.mask : null;
8473
- const memo = current ? _chunkXN2NBLV5cjs.legacyMaskOf.call(void 0, current, width, height) : null;
8482
+ const memo = current ? _chunkPMEHFHSPcjs.legacyMaskOf.call(void 0, current, width, height) : null;
8474
8483
  if (current && memo && memo.width === update.mask.width && memo.height === update.mask.height && memo.rle === update.mask.rle) {
8475
8484
  next.mask = withMaskProps(current, {
8476
8485
  density: _nullishCoalesce(update.mask.density, () => ( 1)),
@@ -8478,7 +8487,7 @@ function mergeAdjustmentNode(node, update, width, height) {
8478
8487
  enabled: update.mask.enabled !== false
8479
8488
  });
8480
8489
  } else {
8481
- const m = _chunkXN2NBLV5cjs.rasterMaskFromLegacy.call(void 0, update.mask, width, height);
8490
+ const m = _chunkPMEHFHSPcjs.rasterMaskFromLegacy.call(void 0, update.mask, width, height);
8482
8491
  if (m) next.mask = m;
8483
8492
  else delete next.mask;
8484
8493
  }
@@ -8517,7 +8526,7 @@ function resizeLegacyMasks(layers, from, to) {
8517
8526
  for (const l of _chunkAEAAN4ADcjs.flattenLayers.call(void 0, layers)) {
8518
8527
  if (l.type !== "adjustment" || !l.mask || l.mask.source) continue;
8519
8528
  const old = l.mask;
8520
- const mask = _chunkXN2NBLV5cjs.rasterMaskFromLegacy.call(void 0, _chunkXN2NBLV5cjs.legacyMaskOf.call(void 0, old, fw, fh), tw, th);
8529
+ const mask = _chunkPMEHFHSPcjs.rasterMaskFromLegacy.call(void 0, _chunkPMEHFHSPcjs.legacyMaskOf.call(void 0, old, fw, fh), tw, th);
8521
8530
  if (!mask) continue;
8522
8531
  out = _chunkAEAAN4ADcjs.mapLayer.call(void 0, out, l.id, (n) => ({ ...n, mask: { ...mask, density: old.density, feather: old.feather, enabled: old.enabled } }));
8523
8532
  }
@@ -8613,12 +8622,12 @@ function withoutAnnotations(layers) {
8613
8622
  function parseColor(value) {
8614
8623
  if (Array.isArray(value)) {
8615
8624
  if (value.length < 3 || value.length > 4 || !value.every((v) => typeof v === "number" && v >= 0 && v <= 255)) {
8616
- throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("A colour array is [r, g, b] or [r, g, b, a] with values 0..255.");
8625
+ throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("A colour array is [r, g, b] or [r, g, b, a] with values 0..255.");
8617
8626
  }
8618
8627
  return [Math.round(value[0]), Math.round(value[1]), Math.round(value[2]), Math.round(_nullishCoalesce(value[3], () => ( 255)))];
8619
8628
  }
8620
8629
  const m = /^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i.exec(String(value).trim());
8621
- if (!m) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`Invalid colour "${value}"; use #rrggbb or #rrggbbaa.`);
8630
+ if (!m) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Invalid colour "${value}"; use #rrggbb or #rrggbbaa.`);
8622
8631
  let hex = m[1];
8623
8632
  if (hex.length === 3) hex = hex.split("").map((c) => c + c).join("");
8624
8633
  const n = (i) => parseInt(hex.slice(i, i + 2), 16);
@@ -8626,9 +8635,9 @@ function parseColor(value) {
8626
8635
  }
8627
8636
  function readImagePaint(raw) {
8628
8637
  try {
8629
- return _chunkQBWEH3IMcjs.parsePaintSource.call(void 0, raw);
8638
+ return _chunk3T5O225Tcjs.parsePaintSource.call(void 0, raw);
8630
8639
  } catch (e) {
8631
- if (e instanceof _chunkQBWEH3IMcjs.PaintSourceError) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(e.message);
8640
+ if (e instanceof _chunk3T5O225Tcjs.PaintSourceError) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(e.message);
8632
8641
  throw e;
8633
8642
  }
8634
8643
  }
@@ -8776,7 +8785,7 @@ function loadImageEditorDocument(input) {
8776
8785
  // Optional: only present when something was selected when saving.
8777
8786
  selection: {
8778
8787
  parse: (value) => {
8779
- const mask = _chunkXN2NBLV5cjs.deserializeSelection.call(void 0, value);
8788
+ const mask = _chunkPMEHFHSPcjs.deserializeSelection.call(void 0, value);
8780
8789
  const v = value;
8781
8790
  return { width: mask.width, height: mask.height, rle: v.rle };
8782
8791
  },
@@ -8864,7 +8873,7 @@ function loadLayeredDocument(doc) {
8864
8873
  },
8865
8874
  selection: {
8866
8875
  parse: (value) => {
8867
- const mask = _chunkXN2NBLV5cjs.deserializeSelection.call(void 0, value);
8876
+ const mask = _chunkPMEHFHSPcjs.deserializeSelection.call(void 0, value);
8868
8877
  const v = value;
8869
8878
  return { width: mask.width, height: mask.height, rle: v.rle };
8870
8879
  },
@@ -9258,14 +9267,14 @@ function describeSelection(mask) {
9258
9267
  // src/image-editor/selection-tools.ts
9259
9268
  var modeSchema = {
9260
9269
  type: "string",
9261
- enum: [..._chunkXN2NBLV5cjs.SELECTION_MODES],
9270
+ enum: [..._chunkPMEHFHSPcjs.SELECTION_MODES],
9262
9271
  description: "How the result combines with the current selection (default replace)."
9263
9272
  };
9264
9273
  var num = (v, d) => typeof v === "number" && Number.isFinite(v) ? v : d;
9265
9274
  function summary(controller) {
9266
9275
  const sel = controller.getSelection();
9267
9276
  const { width, height } = controller.getState().imageDimensions;
9268
- const area = _chunkXN2NBLV5cjs.selectionArea.call(void 0, sel);
9277
+ const area = _chunkPMEHFHSPcjs.selectionArea.call(void 0, sel);
9269
9278
  return {
9270
9279
  empty: !sel,
9271
9280
  bounds: _nullishCoalesce(_optionalChain([sel, 'optionalAccess', _356 => _356.bounds]), () => ( null)),
@@ -9311,7 +9320,7 @@ function createImageSelectionTools(controller) {
9311
9320
  },
9312
9321
  annotations: writeAnnotations("Select a region", true),
9313
9322
  handler: ({ shape, x, y, width, height, mode, feather }) => {
9314
- const opts = { mode: _chunkXN2NBLV5cjs.parseSelectionMode.call(void 0, mode), feather: num(feather, 0) };
9323
+ const opts = { mode: _chunkPMEHFHSPcjs.parseSelectionMode.call(void 0, mode), feather: num(feather, 0) };
9315
9324
  switch (shape) {
9316
9325
  case "all":
9317
9326
  controller.selectAll();
@@ -9364,7 +9373,7 @@ function createImageSelectionTools(controller) {
9364
9373
  annotations: writeAnnotations("Select by colour", true),
9365
9374
  handler: async ({ x, y, color, tolerance, contiguous, fuzziness, sampleMerged, sample, mode }) => {
9366
9375
  const common = {
9367
- mode: _chunkXN2NBLV5cjs.parseSelectionMode.call(void 0, mode),
9376
+ mode: _chunkPMEHFHSPcjs.parseSelectionMode.call(void 0, mode),
9368
9377
  sampleMerged: sampleMerged === true,
9369
9378
  sample: _nullishCoalesce(sample, () => ( "composite"))
9370
9379
  };
@@ -9385,7 +9394,7 @@ function createImageSelectionTools(controller) {
9385
9394
  inputSchema: {
9386
9395
  type: "object",
9387
9396
  properties: {
9388
- op: { type: "string", enum: [..._chunkXN2NBLV5cjs.SELECTION_MODIFY_OPS], description: "How to modify the selection." },
9397
+ op: { type: "string", enum: [..._chunkPMEHFHSPcjs.SELECTION_MODIFY_OPS], description: "How to modify the selection." },
9389
9398
  radius: { type: "number", minimum: 0, maximum: 500, description: "Radius in pixels." }
9390
9399
  },
9391
9400
  required: ["op", "radius"],
@@ -9393,7 +9402,7 @@ function createImageSelectionTools(controller) {
9393
9402
  },
9394
9403
  annotations: writeAnnotations("Modify the selection"),
9395
9404
  handler: ({ op, radius }) => {
9396
- if (!_chunkXN2NBLV5cjs.SELECTION_MODIFY_OPS.includes(op)) throw new Error(`Unknown op "${String(op)}".`);
9405
+ if (!_chunkPMEHFHSPcjs.SELECTION_MODIFY_OPS.includes(op)) throw new Error(`Unknown op "${String(op)}".`);
9397
9406
  if (!controller.getSelection()) throw new Error("Nothing is selected.");
9398
9407
  controller.modifySelection(op, Math.min(500, Math.max(0, num(radius, 0))));
9399
9408
  return summary(controller);
@@ -9437,7 +9446,7 @@ function createImageSelectionTools(controller) {
9437
9446
  type: "object",
9438
9447
  properties: {
9439
9448
  layerId: { type: "string", description: "Existing adjustment layer to mask." },
9440
- kind: { type: "string", enum: _chunkXN2NBLV5cjs.ADJUSTMENT_KINDS.map((k) => k.kind), description: "Kind of a new layer to add and mask (instead of layerId)." },
9449
+ kind: { type: "string", enum: _chunkPMEHFHSPcjs.ADJUSTMENT_KINDS.map((k) => k.kind), description: "Kind of a new layer to add and mask (instead of layerId)." },
9441
9450
  params: { type: "object", description: "Parameters for the new layer (see list_controls)." },
9442
9451
  density: { type: "number", minimum: 0, maximum: 1, description: "Mask density 0-1." },
9443
9452
  feather: { type: "number", minimum: 0, maximum: 1e3, description: "Mask feather in pixels." }
@@ -9457,11 +9466,11 @@ function createImageSelectionTools(controller) {
9457
9466
  if (!controller.getAdjustmentLayer(layerId)) throw new Error(`No adjustment layer "${layerId}".`);
9458
9467
  controller.applySelectionAsLayerMask(layerId, props);
9459
9468
  id = layerId;
9460
- } else if (_chunkXN2NBLV5cjs.isAdjustmentKind.call(void 0, kind)) {
9469
+ } else if (_chunkPMEHFHSPcjs.isAdjustmentKind.call(void 0, kind)) {
9461
9470
  id = controller.addAdjustmentLayer({
9462
9471
  kind,
9463
9472
  params,
9464
- mask: _chunkXN2NBLV5cjs.layerMaskFromSelection.call(void 0, sel, props)
9473
+ mask: _chunkPMEHFHSPcjs.layerMaskFromSelection.call(void 0, sel, props)
9465
9474
  });
9466
9475
  } else {
9467
9476
  throw new Error("Pass layerId (an existing layer) or kind (a new adjustment layer).");
@@ -9598,11 +9607,11 @@ function createImageEditTools(controller) {
9598
9607
  const geometry2 = () => {
9599
9608
  const s = controller.getState();
9600
9609
  const region = _nullishCoalesce(s.crop, () => ( { x: 0, y: 0, ...s.imageDimensions }));
9601
- const out = _chunkXN2NBLV5cjs.getRotatedSize.call(void 0, region.width, region.height, s.transform);
9610
+ const out = _chunkPMEHFHSPcjs.getRotatedSize.call(void 0, region.width, region.height, s.transform);
9602
9611
  return {
9603
9612
  image: { ...s.imageDimensions },
9604
9613
  crop: s.crop ? { ...s.crop } : null,
9605
- rotation: _chunkXN2NBLV5cjs.normalizeAngle.call(void 0, s.transform.rotate),
9614
+ rotation: _chunkPMEHFHSPcjs.normalizeAngle.call(void 0, s.transform.rotate),
9606
9615
  flipH: s.transform.flipH,
9607
9616
  flipV: s.transform.flipV,
9608
9617
  output: { width: Math.round(out.width), height: Math.round(out.height) }
@@ -9837,7 +9846,7 @@ function describeLayer(layer, activeId, boundsOf) {
9837
9846
  const out = {
9838
9847
  id: layer.id,
9839
9848
  type: layer.type,
9840
- name: layer.name || (layer.type === "adjustment" ? _chunkXN2NBLV5cjs.adjustmentKindLabel.call(void 0, layer.kind) : ""),
9849
+ name: layer.name || (layer.type === "adjustment" ? _chunkPMEHFHSPcjs.adjustmentKindLabel.call(void 0, layer.kind) : ""),
9841
9850
  visible: layer.visible,
9842
9851
  opacity: round3(layer.opacity),
9843
9852
  blend: layer.blend,
@@ -9926,8 +9935,8 @@ function createImageLayerTools(controller) {
9926
9935
  };
9927
9936
  };
9928
9937
  const exists = (id, what = "layerId") => {
9929
- if (typeof id !== "string" || !id) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`${what} is required (a layer id from list_layers).`);
9930
- _chunkXN2NBLV5cjs.requireLayer.call(void 0, controller.getLayers(), id);
9938
+ if (typeof id !== "string" || !id) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`${what} is required (a layer id from list_layers).`);
9939
+ _chunkPMEHFHSPcjs.requireLayer.call(void 0, controller.getLayers(), id);
9931
9940
  return id;
9932
9941
  };
9933
9942
  const listLayers = {
@@ -9963,7 +9972,7 @@ function createImageLayerTools(controller) {
9963
9972
  handler: ({ layerId, target }) => {
9964
9973
  const id = exists(layerId);
9965
9974
  const layer = controller.getLayer(id);
9966
- if (target === "mask" && !layer.mask) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask; add one with add_layer_mask.`);
9975
+ if (target === "mask" && !layer.mask) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Layer "${layer.name || id}" has no mask; add one with add_layer_mask.`);
9967
9976
  controller.setActiveLayer(id, _nullishCoalesce(target, () => ( "pixels")));
9968
9977
  return { layer: describe(id), activeTarget: controller.getState().activeTarget };
9969
9978
  }
@@ -9988,7 +9997,7 @@ function createImageLayerTools(controller) {
9988
9997
  },
9989
9998
  annotations: { title: "Add a pixel layer", ...WRITE2 },
9990
9999
  handler: async (args) => {
9991
- if (args.color !== void 0 && args.image !== void 0) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("Give color or image, not both.");
10000
+ if (args.color !== void 0 && args.image !== void 0) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Give color or image, not both.");
9992
10001
  for (const k of ["aboveId", "belowId", "parentId"]) if (args[k] !== void 0) exists(args[k], k);
9993
10002
  const init = {
9994
10003
  name: args.name,
@@ -10078,7 +10087,7 @@ function createImageLayerTools(controller) {
10078
10087
  const id = exists(args.layerId);
10079
10088
  const props = {};
10080
10089
  for (const k of ["name", "visible", "opacity", "fillOpacity", "blend", "clipped", "locks", "collapsed"]) if (args[k] !== void 0) props[k] = args[k];
10081
- if (!Object.keys(props).length) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("Give at least one property to change.");
10090
+ if (!Object.keys(props).length) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Give at least one property to change.");
10082
10091
  controller.setLayerProperties(id, props);
10083
10092
  return { layer: describe(id) };
10084
10093
  }
@@ -10172,8 +10181,8 @@ function createImageLayerTools(controller) {
10172
10181
  annotations: { title: "Move a layer's pixels", ...WRITE2 },
10173
10182
  handler: ({ layerId, x, y, dx, dy }) => {
10174
10183
  const id = exists(layerId);
10175
- if ([x, y, dx, dy].every((v) => v === void 0)) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("Give x and y, or dx and dy.");
10176
- if ((x !== void 0 || y !== void 0) && (dx !== void 0 || dy !== void 0)) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("Give x / y or dx / dy, not both.");
10184
+ if ([x, y, dx, dy].every((v) => v === void 0)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Give x and y, or dx and dy.");
10185
+ if ((x !== void 0 || y !== void 0) && (dx !== void 0 || dy !== void 0)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Give x / y or dx / dy, not both.");
10177
10186
  return { layerId: id, ...controller.offsetLayer(id, { x, y, dx, dy }) };
10178
10187
  }
10179
10188
  };
@@ -10245,7 +10254,7 @@ function createImageLayerTools(controller) {
10245
10254
  annotations: { title: "Set layer mask properties", ...WRITE_IDEMPOTENT2 },
10246
10255
  handler: ({ layerId, density, feather, enabled, linked }) => {
10247
10256
  const id = exists(layerId);
10248
- if ([density, feather, enabled, linked].every((v) => v === void 0)) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("Give density, feather, enabled or linked.");
10257
+ if ([density, feather, enabled, linked].every((v) => v === void 0)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Give density, feather, enabled or linked.");
10249
10258
  const mask = controller.setLayerMaskProps(id, {
10250
10259
  density,
10251
10260
  feather,
@@ -10328,7 +10337,7 @@ function createImageLayerTools(controller) {
10328
10337
  handler: (args) => {
10329
10338
  const id = exists(args.layerId);
10330
10339
  const changes = filterValues(args);
10331
- if (!Object.keys(changes).length) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("Give at least one value to change.");
10340
+ if (!Object.keys(changes).length) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Give at least one value to change.");
10332
10341
  return { layerId: id, filters: controller.updateLayerFilter(id, args.filterId, changes) };
10333
10342
  }
10334
10343
  };
@@ -10592,8 +10601,8 @@ function describeLayerEffects(effects) {
10592
10601
  }
10593
10602
  function createImageEffectTools(controller) {
10594
10603
  const layerArg = (id) => {
10595
- if (typeof id !== "string" || !id) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("layerId is required (a layer id from list_layers).");
10596
- _chunkXN2NBLV5cjs.requireLayer.call(void 0, controller.getLayers(), id);
10604
+ if (typeof id !== "string" || !id) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("layerId is required (a layer id from list_layers).");
10605
+ _chunkPMEHFHSPcjs.requireLayer.call(void 0, controller.getLayers(), id);
10597
10606
  return id;
10598
10607
  };
10599
10608
  const result = (layerId, extra = {}) => ({ layerId, ...extra, ...describeLayerEffects(controller.getLayerEffects(layerId)) });
@@ -10624,7 +10633,7 @@ function createImageEffectTools(controller) {
10624
10633
  annotations: { title: "Add a layer effect", ...WRITE3 },
10625
10634
  handler: ({ layerId, kind, settings, index }) => {
10626
10635
  const id = layerArg(layerId);
10627
- if (!_chunkAEAAN4ADcjs.isLayerEffectKind.call(void 0, kind)) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`kind must be one of ${_chunkAEAAN4ADcjs.LAYER_EFFECT_KINDS.join(", ")}.`);
10636
+ if (!_chunkAEAAN4ADcjs.isLayerEffectKind.call(void 0, kind)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`kind must be one of ${_chunkAEAAN4ADcjs.LAYER_EFFECT_KINDS.join(", ")}.`);
10628
10637
  const { effect } = controller.addLayerEffect(id, kind, _nullishCoalesce(settings, () => ( {})), index);
10629
10638
  return result(id, { effectId: effect.id });
10630
10639
  }
@@ -10644,7 +10653,7 @@ function createImageEffectTools(controller) {
10644
10653
  handler: ({ layerId, effectId, settings }) => {
10645
10654
  const id = layerArg(layerId);
10646
10655
  const changes = _nullishCoalesce(settings, () => ( {}));
10647
- if (!Object.keys(changes).length) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("Give at least one setting to change.");
10656
+ if (!Object.keys(changes).length) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Give at least one setting to change.");
10648
10657
  controller.updateLayerEffect(id, effectId, changes);
10649
10658
  return result(id);
10650
10659
  }
@@ -10696,7 +10705,7 @@ function createImageEffectTools(controller) {
10696
10705
  },
10697
10706
  annotations: { title: "Set the global light", ...WRITE_IDEMPOTENT3 },
10698
10707
  handler: ({ angle, altitude }) => {
10699
- if (angle === void 0 && altitude === void 0) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("Give angle, altitude or both.");
10708
+ if (angle === void 0 && altitude === void 0) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Give angle, altitude or both.");
10700
10709
  const next = {};
10701
10710
  if (angle !== void 0) next.angle = angle;
10702
10711
  if (altitude !== void 0) next.altitude = altitude;
@@ -10878,7 +10887,7 @@ function handlePaintShortcut(controller, e) {
10878
10887
  }
10879
10888
  if (key === "]" || key === "}") {
10880
10889
  if (e.shiftKey || key === "}") set({ hardness: Math.min(1, Math.round((brush.hardness + 0.25) * 4) / 4) });
10881
- else set({ size: Math.min(_chunkQBWEH3IMcjs.MAX_BRUSH_SIZE, brush.size + sizeStep(brush.size)) });
10890
+ else set({ size: Math.min(_chunk3T5O225Tcjs.MAX_BRUSH_SIZE, brush.size + sizeStep(brush.size)) });
10882
10891
  return true;
10883
10892
  }
10884
10893
  if (/^[0-9]$/.test(key) && isPaintTool(controller.getState().activeTool)) {
@@ -10909,7 +10918,7 @@ var PaintGesture = (_class8 = class {
10909
10918
  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.`);
10910
10919
  if (_optionalChain([layer, 'access', _370 => _370.locks, 'optionalAccess', _371 => _371.all]) || _optionalChain([layer, 'access', _372 => _372.locks, 'optionalAccess', _373 => _373.position])) throw new Error(`Layer "${layer.name}" has its position locked.`);
10911
10920
  const origin = layer.type === "pixel" ? { ...layer.offset } : layer.type === "smart" ? { ...layer.placement.corners[0] } : (() => {
10912
- const b = _chunkXN2NBLV5cjs.shapeGeometryBounds.call(void 0, layer);
10921
+ const b = _chunkPMEHFHSPcjs.shapeGeometryBounds.call(void 0, layer);
10913
10922
  return b ? { x: b.x, y: b.y } : { x: 0, y: 0 };
10914
10923
  })();
10915
10924
  this.move = { id: layer.id, start: { x: sample.x, y: sample.y }, origin, moved: false };
@@ -10987,7 +10996,7 @@ var BRUSH = {
10987
10996
  type: "object",
10988
10997
  description: "Brush settings; missing fields use the current paint options (default round, hard, 20 px).",
10989
10998
  properties: {
10990
- size: { type: "number", minimum: 1, maximum: _chunkQBWEH3IMcjs.MAX_BRUSH_SIZE, description: "Diameter in px (default 20)." },
10999
+ size: { type: "number", minimum: 1, maximum: _chunk3T5O225Tcjs.MAX_BRUSH_SIZE, description: "Diameter in px (default 20)." },
10991
11000
  hardness: { type: "number", minimum: 0, maximum: 1, description: "Edge hardness 0 (soft) .. 1 (hard, default)." },
10992
11001
  spacing: { type: "number", minimum: 0.01, maximum: 10, description: "Dab spacing as a fraction of the diameter (default 0.1)." },
10993
11002
  angle: { type: "number", minimum: -360, maximum: 360, description: "Tip angle in degrees (default 0)." },
@@ -11010,7 +11019,7 @@ var MIXER = {
11010
11019
  mix: { type: "number", minimum: 0, maximum: 1, description: "How far each dab's paint moves from the reservoir towards the picked-up colour, 0 .. 1 (default 0.5)." },
11011
11020
  loadEachStroke: { type: "boolean", description: "Refill the reservoir with `color` (or the foreground) before the stroke (default true). Off, the brush keeps what is left of its last load." },
11012
11021
  cleanEachStroke: { type: "boolean", description: "Empty the pickup well after the stroke (default true). Off, the next stroke starts with the colour this one picked up." },
11013
- mixing: { type: "string", enum: [..._chunkQBWEH3IMcjs.MIXING_MODELS], description: "rgb (default): RGB averages. pigment: mixes like paint (Kubelka-Munk), so blue dragged through yellow makes green." }
11022
+ mixing: { type: "string", enum: [..._chunk3T5O225Tcjs.MIXING_MODELS], description: "rgb (default): RGB averages. pigment: mixes like paint (Kubelka-Munk), so blue dragged through yellow makes green." }
11014
11023
  },
11015
11024
  additionalProperties: false
11016
11025
  };
@@ -11054,7 +11063,7 @@ function createImagePaintTools(controller) {
11054
11063
  description: "Paint colour #rrggbb (default the foreground). On a mask its grey value: #000000 hides, #ffffff reveals. For the mixer, the colour its reservoir is loaded with before the stroke (given, it loads even with loadEachStroke false)."
11055
11064
  },
11056
11065
  paint: {
11057
- ..._chunkQBWEH3IMcjs.PAINT_SOURCE_JSON_SCHEMA,
11066
+ ..._chunk3T5O225Tcjs.PAINT_SOURCE_JSON_SCHEMA,
11058
11067
  description: "Brush only: what this stroke paints with instead of the paint options' paint (set_paint): a colour, or gradient paint that changes colour as the stroke goes (by distance, pressure, velocity, direction, time, across the tip or at random). On a mask each colour's grey value."
11059
11068
  },
11060
11069
  brush: BRUSH,
@@ -11067,9 +11076,9 @@ function createImagePaintTools(controller) {
11067
11076
  annotations: { title: "Paint a brush stroke", ...WRITE4 },
11068
11077
  handler: (args) => {
11069
11078
  const tool = args.tool;
11070
- if (args.mixer !== void 0 && tool !== "mixer") throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)('mixer settings apply to the Mixer Brush only; pass tool "mixer", or drop mixer.');
11071
- if (args.paint !== void 0 && (_nullishCoalesce(tool, () => ( "brush"))) !== "brush") throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)('paint applies to the brush only (the eraser removes paint; the Mixer Brush loads color); drop paint or use tool "brush".');
11072
- if (args.paint !== void 0 && args.color !== void 0) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("Give color or paint, not both.");
11079
+ if (args.mixer !== void 0 && tool !== "mixer") throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)('mixer settings apply to the Mixer Brush only; pass tool "mixer", or drop mixer.');
11080
+ if (args.paint !== void 0 && (_nullishCoalesce(tool, () => ( "brush"))) !== "brush") throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)('paint applies to the brush only (the eraser removes paint; the Mixer Brush loads color); drop paint or use tool "brush".');
11081
+ if (args.paint !== void 0 && args.color !== void 0) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Give color or paint, not both.");
11073
11082
  const result = controller.paintStroke({
11074
11083
  tool,
11075
11084
  points: args.points,
@@ -11165,7 +11174,7 @@ function createImagePaintTools(controller) {
11165
11174
  name: "set_paint",
11166
11175
  title: "Set the paint (colour or gradient)",
11167
11176
  description: `Sets what the brush paints: one colour (it becomes the foreground), or gradient paint that changes colour as the stroke goes. Gradient paint: 2..16 stops sorted by offset (#rrggbb, or "paint" / "secondary" for the foreground and background colours), space pigment (default: mixes like paint) / oklab / srgb, and map: distance (default: the colour changes as the stroke is dragged out, 300 px then mirrored back), pressure, tilt, velocity, direction, time, across-tip or random. paint_stroke with tool brush samples it per dab (on a mask, each colour's grey); the eraser and the Mixer Brush ignore it, and Fill uses the foreground. View state, not an undo step. Returns paint, foreground, background and brush.`,
11168
- inputSchema: { type: "object", properties: { paint: _chunkQBWEH3IMcjs.PAINT_SOURCE_JSON_SCHEMA }, required: ["paint"], additionalProperties: false },
11177
+ inputSchema: { type: "object", properties: { paint: _chunk3T5O225Tcjs.PAINT_SOURCE_JSON_SCHEMA }, required: ["paint"], additionalProperties: false },
11169
11178
  annotations: { title: "Set the paint (colour or gradient)", ...SET },
11170
11179
  handler: ({ paint }) => {
11171
11180
  controller.setPaintOptions({ paint });
@@ -11200,7 +11209,7 @@ function profileArg(v) {
11200
11209
  try {
11201
11210
  return _chunkO7LUD7MHcjs.base64ToBytes.call(void 0, s.slice(4));
11202
11211
  } catch (e30) {
11203
- throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("The icc: value is not valid base64.");
11212
+ throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("The icc: value is not valid base64.");
11204
11213
  }
11205
11214
  }
11206
11215
  return s;
@@ -11265,10 +11274,10 @@ function createImageColorTools(controller) {
11265
11274
  annotations: { title: "Set up soft proofing", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
11266
11275
  handler: (args) => {
11267
11276
  if (args.off === true) {
11268
- if (args.profile !== void 0) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("Give either off true or a profile, not both.");
11277
+ if (args.profile !== void 0) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Give either off true or a profile, not both.");
11269
11278
  return controller.setProofSetup(null);
11270
11279
  }
11271
- if (args.profile === void 0) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("Pass the profile to proof with (e.g. coated-cmyk), or off true.");
11280
+ if (args.profile === void 0) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Pass the profile to proof with (e.g. coated-cmyk), or off true.");
11272
11281
  const s = controller.setProofSetup({
11273
11282
  profile: profileArg(args.profile),
11274
11283
  ...args.intent !== void 0 ? { intent: args.intent } : {},
@@ -11320,7 +11329,7 @@ function createImageColorTools(controller) {
11320
11329
  },
11321
11330
  annotations: { title: "Set the colour mode", readOnlyHint: false, destructiveHint: false, idempotentHint: true, openWorldHint: false },
11322
11331
  handler: (args) => {
11323
- if (args.mode !== "cmyk" && (args.profile !== void 0 || args.intent !== void 0)) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("profile and intent apply to CMYK mode only.");
11332
+ if (args.mode !== "cmyk" && (args.profile !== void 0 || args.intent !== void 0)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("profile and intent apply to CMYK mode only.");
11324
11333
  return controller.setColorMode(args.mode, {
11325
11334
  ...args.profile !== void 0 ? { profile: profileArg(args.profile) } : {},
11326
11335
  ...args.intent !== void 0 ? { intent: args.intent } : {}
@@ -11353,7 +11362,7 @@ var BRUSH2 = {
11353
11362
  type: "object",
11354
11363
  description: "Brush tip; missing fields use the current paint options (default round, hard, 20 px).",
11355
11364
  properties: {
11356
- size: { type: "number", minimum: 1, maximum: _chunkQBWEH3IMcjs.MAX_BRUSH_SIZE, description: "Diameter in px (default 20)." },
11365
+ size: { type: "number", minimum: 1, maximum: _chunk3T5O225Tcjs.MAX_BRUSH_SIZE, description: "Diameter in px (default 20)." },
11357
11366
  hardness: { type: "number", minimum: 0, maximum: 1, description: "Edge hardness 0 (soft) .. 1 (hard, default). Retouching usually wants a soft tip (0..0.5)." },
11358
11367
  spacing: { type: "number", minimum: 0.01, maximum: 10, description: "Dab spacing as a fraction of the diameter (default 0.1)." },
11359
11368
  opacity: { type: "number", minimum: 0, maximum: 1, description: "Stroke opacity (Clone Stamp and Healing Brush only; default 1)." },
@@ -11374,7 +11383,7 @@ var TARGET2 = {
11374
11383
  };
11375
11384
  var SAMPLE = {
11376
11385
  type: "string",
11377
- enum: [..._chunkTLCTTQFFcjs.RETOUCH_SAMPLES],
11386
+ enum: [..._chunkVEHVXRJUcjs.RETOUCH_SAMPLES],
11378
11387
  description: "What is sampled: current (default: the target layer), current-below (the composite of this layer and everything under it), or all (the composite of every layer). Sample current-below or all to retouch onto an empty layer above the image."
11379
11388
  };
11380
11389
  function readTarget2(args) {
@@ -11385,7 +11394,7 @@ function checkSource(controller, source) {
11385
11394
  const p = source;
11386
11395
  const { width, height } = controller.getState().imageDimensions;
11387
11396
  if (!(p.x >= 0 && p.y >= 0 && p.x < width && p.y < height)) {
11388
- throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`source (${p.x}, ${p.y}) is outside the ${width} \xD7 ${height} canvas; pick a point on the image to sample.`);
11397
+ throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`source (${p.x}, ${p.y}) is outside the ${width} \xD7 ${height} canvas; pick a point on the image to sample.`);
11389
11398
  }
11390
11399
  return p;
11391
11400
  }
@@ -11453,7 +11462,7 @@ function createImageRetouchTools(controller) {
11453
11462
  type: "object",
11454
11463
  properties: {
11455
11464
  points: POINTS,
11456
- type: { type: "string", enum: [..._chunkTLCTTQFFcjs.SPOT_HEAL_TYPES], description: "proximity-match (default the current option), content-aware or smooth." },
11465
+ type: { type: "string", enum: [..._chunkVEHVXRJUcjs.SPOT_HEAL_TYPES], description: "proximity-match (default the current option), content-aware or smooth." },
11457
11466
  sample: SAMPLE,
11458
11467
  brush: BRUSH2,
11459
11468
  ...TARGET2
@@ -11486,7 +11495,7 @@ function createImageRetouchTools(controller) {
11486
11495
  type: "object",
11487
11496
  properties: {
11488
11497
  points: POINTS,
11489
- range: { type: "string", enum: [..._chunkTLCTTQFFcjs.TONE_RANGES], description: `Which tones to ${verb} most: shadows, midtones (default the current option, midtones) or highlights.` },
11498
+ range: { type: "string", enum: [..._chunkVEHVXRJUcjs.TONE_RANGES], description: `Which tones to ${verb} most: shadows, midtones (default the current option, midtones) or highlights.` },
11490
11499
  exposure: { type: "number", minimum: 0, maximum: 1, description: "Strength 0..1 (default the current option, 0.5). Overlapping dabs in one stroke never go past it; another stroke builds on it." },
11491
11500
  protectTones: { type: "boolean", description: "Change luma only, keeping hue and saturation (default true)." },
11492
11501
  brush: BRUSH2,
@@ -11595,8 +11604,8 @@ function createImageRetouchTools(controller) {
11595
11604
  properties: {
11596
11605
  aligned: { type: "boolean", description: "Clone / heal: keep the offset from stroke to stroke (default true)." },
11597
11606
  sample: SAMPLE,
11598
- spotType: { type: "string", enum: [..._chunkTLCTTQFFcjs.SPOT_HEAL_TYPES], description: "Spot heal: proximity-match (default), content-aware or smooth." },
11599
- range: { type: "string", enum: [..._chunkTLCTTQFFcjs.TONE_RANGES], description: "Dodge / burn: shadows, midtones (default) or highlights." },
11607
+ spotType: { type: "string", enum: [..._chunkVEHVXRJUcjs.SPOT_HEAL_TYPES], description: "Spot heal: proximity-match (default), content-aware or smooth." },
11608
+ range: { type: "string", enum: [..._chunkVEHVXRJUcjs.TONE_RANGES], description: "Dodge / burn: shadows, midtones (default) or highlights." },
11600
11609
  exposure: { type: "number", minimum: 0, maximum: 1, description: "Dodge / burn strength 0..1 (default 0.5)." },
11601
11610
  protectTones: { type: "boolean", description: "Dodge / burn: keep hue and saturation (default true)." },
11602
11611
  spongeMode: { type: "string", enum: ["desaturate", "saturate"], description: "Sponge: desaturate (default) or saturate." },
@@ -11625,10 +11634,10 @@ function createImageRetouchTools(controller) {
11625
11634
  annotations: { title: "Set the clone source", ...WRITE5, idempotentHint: true },
11626
11635
  handler: (args) => {
11627
11636
  if (args.clear === true) {
11628
- if (args.x !== void 0 || args.y !== void 0) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("Give either clear true or x and y, not both.");
11637
+ if (args.x !== void 0 || args.y !== void 0) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Give either clear true or x and y, not both.");
11629
11638
  return controller.setCloneSource(null);
11630
11639
  }
11631
- if (typeof args.x !== "number" || typeof args.y !== "number") throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("Pass x and y (document pixels) for the source point, or clear true to remove it.");
11640
+ if (typeof args.x !== "number" || typeof args.y !== "number") throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Pass x and y (document pixels) for the source point, or clear true to remove it.");
11632
11641
  return controller.setCloneSource(checkSource(controller, { x: args.x, y: args.y }));
11633
11642
  }
11634
11643
  };
@@ -11651,7 +11660,7 @@ function createImageRetouchTools(controller) {
11651
11660
  annotations: { title: "Transform the clone source", ...WRITE5, idempotentHint: false },
11652
11661
  handler: (args) => {
11653
11662
  if (args.reset === true) {
11654
- if (Object.keys(args).some((k) => k !== "reset")) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("Give either reset true or transform values, not both.");
11663
+ if (Object.keys(args).some((k) => k !== "reset")) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Give either reset true or transform values, not both.");
11655
11664
  return controller.setCloneTransform(null);
11656
11665
  }
11657
11666
  const cur = controller.getState().paint.cloneTransform;
@@ -11661,7 +11670,7 @@ function createImageRetouchTools(controller) {
11661
11670
  if (args.rotate !== void 0) next.rotate = args.rotate;
11662
11671
  if (args.flipHorizontal === true) next.scaleX = -(_nullishCoalesce(next.scaleX, () => ( cur.scaleX)));
11663
11672
  if (args.flipVertical === true) next.scaleY = -(_nullishCoalesce(next.scaleY, () => ( cur.scaleY)));
11664
- if (!Object.keys(next).length) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("Pass scaleX, scaleY, rotate, flipHorizontal or flipVertical, or reset true.");
11673
+ if (!Object.keys(next).length) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Pass scaleX, scaleY, rotate, flipHorizontal or flipVertical, or reset true.");
11665
11674
  return controller.setCloneTransform(next);
11666
11675
  }
11667
11676
  };
@@ -11682,11 +11691,11 @@ var DATA = {
11682
11691
  description: "The PSD or PSB file as base64 (a `data:` URL prefix is accepted)."
11683
11692
  };
11684
11693
  function psdBytesFromBase64(data) {
11685
- if (typeof data !== "string" || !data.trim()) throw new (0, _chunkXN2NBLV5cjs.PsdError)("data is required: the PSD file as base64.");
11694
+ if (typeof data !== "string" || !data.trim()) throw new (0, _chunkPMEHFHSPcjs.PsdError)("data is required: the PSD file as base64.");
11686
11695
  const body = data.trim().replace(/^data:[^,]*;base64,/i, "");
11687
- if (!/^[A-Za-z0-9+/=_\s-]+$/.test(body)) throw new (0, _chunkXN2NBLV5cjs.PsdError)("data is not base64; send the PSD file bytes base64-encoded.");
11696
+ if (!/^[A-Za-z0-9+/=_\s-]+$/.test(body)) throw new (0, _chunkPMEHFHSPcjs.PsdError)("data is not base64; send the PSD file bytes base64-encoded.");
11688
11697
  const bytes = _chunkO7LUD7MHcjs.base64ToBytes.call(void 0, body);
11689
- if (bytes.length < 26) throw new (0, _chunkXN2NBLV5cjs.PsdError)(`data decodes to ${bytes.length} bytes, too short for a PSD (at least 26).`);
11698
+ if (bytes.length < 26) throw new (0, _chunkPMEHFHSPcjs.PsdError)(`data decodes to ${bytes.length} bytes, too short for a PSD (at least 26).`);
11690
11699
  return bytes;
11691
11700
  }
11692
11701
  function createImagePsdTools(controller) {
@@ -11697,7 +11706,7 @@ function createImagePsdTools(controller) {
11697
11706
  inputSchema: { type: "object", properties: { data: DATA }, required: ["data"], additionalProperties: false },
11698
11707
  annotations: { title: "Inspect a PSD", ...READ7 },
11699
11708
  handler: ({ data }) => {
11700
- const res = _chunkXN2NBLV5cjs.importPsd.call(void 0, psdBytesFromBase64(data), { skipPixels: true });
11709
+ const res = _chunkPMEHFHSPcjs.importPsd.call(void 0, psdBytesFromBase64(data), { skipPixels: true });
11701
11710
  return {
11702
11711
  width: res.width,
11703
11712
  height: res.height,
@@ -11784,7 +11793,7 @@ var GEOMETRY = {
11784
11793
  dy: { type: "number", description: "Move down after scaling and rotating, in document pixels (default 0)." },
11785
11794
  reference: {
11786
11795
  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}.",
11787
- anyOf: [{ type: "string", enum: _chunkXN2NBLV5cjs.TRANSFORM_ANCHORS }, POINT]
11796
+ anyOf: [{ type: "string", enum: _chunkPMEHFHSPcjs.TRANSFORM_ANCHORS }, POINT]
11788
11797
  },
11789
11798
  matrix: {
11790
11799
  type: "array",
@@ -11805,14 +11814,14 @@ var NUMERIC = ["scaleX", "scaleY", "rotate", "skewX", "skewY", "dx", "dy", "refe
11805
11814
  function geometryFrom(args) {
11806
11815
  const numeric = NUMERIC.filter((k) => args[k] !== void 0);
11807
11816
  const ways = [numeric.length > 0, args.matrix !== void 0, args.corners !== void 0].filter(Boolean).length;
11808
- if (ways === 0) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("Give the transform one way: numeric fields (scaleX, scaleY, rotate, skewX, skewY, dx, dy, reference), matrix, or corners.");
11809
- if (ways > 1) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("Give the transform only one way: numeric fields, matrix or corners, not a mix.");
11817
+ if (ways === 0) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Give the transform one way: numeric fields (scaleX, scaleY, rotate, skewX, skewY, dx, dy, reference), matrix, or corners.");
11818
+ if (ways > 1) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Give the transform only one way: numeric fields, matrix or corners, not a mix.");
11810
11819
  if (args.matrix !== void 0) return { matrix: args.matrix };
11811
11820
  if (args.corners !== void 0) return { corners: args.corners };
11812
11821
  const params = {};
11813
11822
  for (const k of NUMERIC) if (args[k] !== void 0) params[k] = args[k];
11814
- if (params.scaleX === 0 || params.scaleY === 0) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("scaleX and scaleY must not be 0 (that collapses the layer to a line).");
11815
- if (typeof params.reference === "string" && !_chunkXN2NBLV5cjs.isTransformAnchor.call(void 0, params.reference)) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`Unknown reference "${params.reference}". Use ${_chunkXN2NBLV5cjs.TRANSFORM_ANCHORS.join(", ")} or {x, y}.`);
11823
+ if (params.scaleX === 0 || params.scaleY === 0) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("scaleX and scaleY must not be 0 (that collapses the layer to a line).");
11824
+ if (typeof params.reference === "string" && !_chunkPMEHFHSPcjs.isTransformAnchor.call(void 0, params.reference)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Unknown reference "${params.reference}". Use ${_chunkPMEHFHSPcjs.TRANSFORM_ANCHORS.join(", ")} or {x, y}.`);
11816
11825
  return { params };
11817
11826
  }
11818
11827
  function targetFrom(args) {
@@ -11861,15 +11870,15 @@ function createImageTransformTools(controller) {
11861
11870
  moved: [...s.moves],
11862
11871
  frame: { ...s.box },
11863
11872
  corners: s.startGeometry.corners.map(roundPoint),
11864
- center: roundPoint(_chunkXN2NBLV5cjs.anchorPoint.call(void 0, s.startGeometry, "center"))
11873
+ center: roundPoint(_chunkPMEHFHSPcjs.anchorPoint.call(void 0, s.startGeometry, "center"))
11865
11874
  };
11866
11875
  if (s.smartObject) out.smartObject = true;
11867
11876
  s.cancel();
11868
11877
  if (args.meshColumns !== void 0) {
11869
11878
  const cols = args.meshColumns;
11870
11879
  const rows = _nullishCoalesce(args.meshRows, () => ( cols));
11871
- const mesh = _chunk5OOIUXNJcjs.identityWarpMesh.call(void 0, s.box, cols, rows);
11872
- out.mesh = { columns: cols, rows, pointsPerRow: _chunk5OOIUXNJcjs.warpMeshColumns.call(void 0, mesh), pointRows: _chunk5OOIUXNJcjs.warpMeshRows.call(void 0, mesh), points: mesh.points.map(roundPoint) };
11880
+ const mesh = _chunkXFXHA5MUcjs.identityWarpMesh.call(void 0, s.box, cols, rows);
11881
+ out.mesh = { columns: cols, rows, pointsPerRow: _chunkXFXHA5MUcjs.warpMeshColumns.call(void 0, mesh), pointRows: _chunkXFXHA5MUcjs.warpMeshRows.call(void 0, mesh), points: mesh.points.map(roundPoint) };
11873
11882
  }
11874
11883
  return out;
11875
11884
  }
@@ -11894,7 +11903,7 @@ function createImageTransformTools(controller) {
11894
11903
  type: "object",
11895
11904
  properties: {
11896
11905
  ...TARGET3,
11897
- style: { type: "string", enum: _chunk5OOIUXNJcjs.WARP_STYLES, description: "Preset warp (Photoshop\u2019s menu): arc, arcLower, arcUpper, arch, bulge, shellLower, shellUpper, flag, wave, fish, rise, fisheye, inflate, squeeze, twist." },
11906
+ style: { type: "string", enum: _chunkXFXHA5MUcjs.WARP_STYLES, description: "Preset warp (Photoshop\u2019s menu): arc, arcLower, arcUpper, arch, bulge, shellLower, shellUpper, flag, wave, fish, rise, fisheye, inflate, squeeze, twist." },
11898
11907
  bend: { type: "number", minimum: -100, maximum: 100, description: "Preset bend in percent, \u2212100..100 (default 50)." },
11899
11908
  horizontal: { type: "number", minimum: -100, maximum: 100, description: "Preset horizontal distortion in percent, \u2212100..100 (default 0)." },
11900
11909
  vertical: { type: "number", minimum: -100, maximum: 100, description: "Preset vertical distortion in percent, \u2212100..100 (default 0)." },
@@ -11916,11 +11925,11 @@ function createImageTransformTools(controller) {
11916
11925
  annotations: { title: "Warp a layer", ...WRITE6 },
11917
11926
  handler: (args) => {
11918
11927
  const hasPreset = ["style", "bend", "horizontal", "vertical", "orientation"].some((k) => args[k] !== void 0);
11919
- if (hasPreset && args.mesh !== void 0) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("Give a preset (style, bend, horizontal, vertical, orientation) or a mesh, not both.");
11920
- if (!hasPreset && args.mesh === void 0) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("Give a preset style or a mesh.");
11928
+ if (hasPreset && args.mesh !== void 0) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Give a preset (style, bend, horizontal, vertical, orientation) or a mesh, not both.");
11929
+ if (!hasPreset && args.mesh === void 0) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Give a preset style or a mesh.");
11921
11930
  let warp;
11922
11931
  if (hasPreset) {
11923
- if (args.style === void 0) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`style is required with a preset. Styles: ${_chunk5OOIUXNJcjs.WARP_STYLES.join(", ")}.`);
11932
+ if (args.style === void 0) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`style is required with a preset. Styles: ${_chunkXFXHA5MUcjs.WARP_STYLES.join(", ")}.`);
11924
11933
  warp = {
11925
11934
  style: args.style,
11926
11935
  bend: _nullishCoalesce(args.bend, () => ( 50)),
@@ -11931,7 +11940,7 @@ function createImageTransformTools(controller) {
11931
11940
  } else {
11932
11941
  const m = args.mesh;
11933
11942
  const want = (3 * m.columns + 1) * (3 * m.rows + 1);
11934
- if (m.points.length !== want) throw new (0, _chunkXN2NBLV5cjs.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}.`);
11943
+ if (m.points.length !== want) throw new (0, _chunkPMEHFHSPcjs.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}.`);
11935
11944
  const knots = (n) => Array.from({ length: n + 1 }, (_, i) => i / n);
11936
11945
  warp = { us: knots(m.columns), vs: knots(m.rows), points: m.points.map((p) => ({ x: p.x, y: p.y })) };
11937
11946
  }
@@ -12026,13 +12035,13 @@ function settingsFrom(args) {
12026
12035
  return out;
12027
12036
  }
12028
12037
  function imageArg(image) {
12029
- if (typeof image !== "string" || !image.trim()) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("image is required: a PNG as a data URL or base64 (other formats need a browser).");
12038
+ if (typeof image !== "string" || !image.trim()) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("image is required: a PNG as a data URL or base64 (other formats need a browser).");
12030
12039
  return image.trim();
12031
12040
  }
12032
12041
  function createImageSmartObjectTools(controller) {
12033
12042
  const smartId = (id) => {
12034
- if (typeof id !== "string" || !id) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("layerId is required (a smart object id from list_layers).");
12035
- _chunkXN2NBLV5cjs.requireSmartObject.call(void 0, controller.getLayers(), id);
12043
+ if (typeof id !== "string" || !id) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("layerId is required (a smart object id from list_layers).");
12044
+ _chunkPMEHFHSPcjs.requireSmartObject.call(void 0, controller.getLayers(), id);
12036
12045
  return id;
12037
12046
  };
12038
12047
  const info = (id) => {
@@ -12069,7 +12078,7 @@ function createImageSmartObjectTools(controller) {
12069
12078
  },
12070
12079
  annotations: { title: "Convert to Smart Object", ...WRITE7 },
12071
12080
  handler: ({ layerIds, name }) => {
12072
- for (const id2 of _nullishCoalesce(layerIds, () => ( []))) _chunkXN2NBLV5cjs.requireLayer.call(void 0, controller.getLayers(), id2);
12081
+ for (const id2 of _nullishCoalesce(layerIds, () => ( []))) _chunkPMEHFHSPcjs.requireLayer.call(void 0, controller.getLayers(), id2);
12073
12082
  const id = controller.convertToSmartObject(layerIds, { name });
12074
12083
  return { layer: layerSummary(id), smartObject: info(id) };
12075
12084
  }
@@ -12106,7 +12115,7 @@ function createImageSmartObjectTools(controller) {
12106
12115
  {
12107
12116
  type: "object",
12108
12117
  properties: {
12109
- style: { type: "string", enum: _chunk5OOIUXNJcjs.WARP_STYLES, description: "Preset (Photoshop\u2019s menu)." },
12118
+ style: { type: "string", enum: _chunkXFXHA5MUcjs.WARP_STYLES, description: "Preset (Photoshop\u2019s menu)." },
12110
12119
  bend: { type: "number", minimum: -100, maximum: 100, description: "Bend in percent (default 50)." },
12111
12120
  horizontal: { type: "number", minimum: -100, maximum: 100, description: "Horizontal distortion in percent (default 0)." },
12112
12121
  vertical: { type: "number", minimum: -100, maximum: 100, description: "Vertical distortion in percent (default 0)." },
@@ -12142,12 +12151,12 @@ function createImageSmartObjectTools(controller) {
12142
12151
  else if (w) {
12143
12152
  const m = w;
12144
12153
  const want = (3 * m.columns + 1) * (3 * m.rows + 1);
12145
- if (m.points.length !== want) throw new (0, _chunkXN2NBLV5cjs.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}.`);
12154
+ if (m.points.length !== want) throw new (0, _chunkPMEHFHSPcjs.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}.`);
12146
12155
  const knots = (n) => Array.from({ length: n + 1 }, (_, i) => i / n);
12147
12156
  warp = { us: knots(m.columns), vs: knots(m.rows), points: m.points.map((p) => ({ x: p.x, y: p.y })) };
12148
12157
  }
12149
12158
  const keys = ["corners", "matrix", "scaleX", "scaleY", "rotate", "skewX", "skewY", "x", "y", "warp", "interpolation"];
12150
- if (!keys.some((k) => args[k] !== void 0)) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`Give something to set: ${keys.join(", ")}.`);
12159
+ if (!keys.some((k) => args[k] !== void 0)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Give something to set: ${keys.join(", ")}.`);
12151
12160
  const res = controller.setSmartObjectTransform(id, {
12152
12161
  corners: args.corners,
12153
12162
  matrix: args.matrix,
@@ -12272,7 +12281,7 @@ function createImageSmartObjectTools(controller) {
12272
12281
  handler: (args) => {
12273
12282
  const id = smartId(args.layerId);
12274
12283
  const changes = settingsFrom(args);
12275
- if (!Object.keys(changes).length) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("Give at least one value to change.");
12284
+ if (!Object.keys(changes).length) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Give at least one value to change.");
12276
12285
  const filter = controller.updateSmartFilter(id, args.filterId, changes);
12277
12286
  return { layerId: id, filter, smartFilters: info(id).smartFilters };
12278
12287
  }
@@ -12593,8 +12602,8 @@ function geometry(args) {
12593
12602
  }
12594
12603
  function createImageShapeTools(controller) {
12595
12604
  const shapeId = (id) => {
12596
- if (typeof id !== "string" || !id) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("layerId is required (a shape layer id from list_layers).");
12597
- _chunkXN2NBLV5cjs.requireShapeLayer.call(void 0, controller.getLayers(), id);
12605
+ if (typeof id !== "string" || !id) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("layerId is required (a shape layer id from list_layers).");
12606
+ _chunkPMEHFHSPcjs.requireShapeLayer.call(void 0, controller.getLayers(), id);
12598
12607
  return id;
12599
12608
  };
12600
12609
  const layerSummary = (id) => {
@@ -12669,7 +12678,7 @@ function createImageShapeTools(controller) {
12669
12678
  annotations: { title: "Restyle a shape", ...WRITE_IDEMPOTENT5 },
12670
12679
  handler: ({ layerId, fill, stroke, fillRule }) => {
12671
12680
  const id = shapeId(layerId);
12672
- if (fill === void 0 && stroke === void 0 && fillRule === void 0) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("Give fill, stroke or fillRule to change.");
12681
+ if (fill === void 0 && stroke === void 0 && fillRule === void 0) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Give fill, stroke or fillRule to change.");
12673
12682
  return controller.setShapeStyle(id, { fill, stroke, fillRule });
12674
12683
  }
12675
12684
  };
@@ -12718,7 +12727,7 @@ function createImageShapeTools(controller) {
12718
12727
  handler: ({ layerId, componentIndex, ...rest }) => {
12719
12728
  const id = shapeId(layerId);
12720
12729
  const change = geometry(rest);
12721
- if (change.shape === void 0 && change.subpaths === void 0 && change.op === void 0) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("Give shape, subpaths or op to change.");
12730
+ if (change.shape === void 0 && change.subpaths === void 0 && change.op === void 0) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("Give shape, subpaths or op to change.");
12722
12731
  return controller.setShapeComponent(id, componentIndex, change);
12723
12732
  }
12724
12733
  };
@@ -12792,8 +12801,8 @@ function pick2(args, keys) {
12792
12801
  }
12793
12802
  function createImageTypeTools(controller) {
12794
12803
  const typeId = (id) => {
12795
- if (typeof id !== "string" || !id) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("layerId is required (a type layer id from list_layers).");
12796
- _chunkXN2NBLV5cjs.requireTypeLayer.call(void 0, controller.getLayers(), id);
12804
+ if (typeof id !== "string" || !id) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("layerId is required (a type layer id from list_layers).");
12805
+ _chunkPMEHFHSPcjs.requireTypeLayer.call(void 0, controller.getLayers(), id);
12797
12806
  return id;
12798
12807
  };
12799
12808
  const layerSummary = (id) => {
@@ -12873,7 +12882,7 @@ function createImageTypeTools(controller) {
12873
12882
  annotations: { title: "Style a range of text", ...WRITE_IDEMPOTENT6 },
12874
12883
  handler: (args) => {
12875
12884
  const style = pick2(args, Object.keys(STYLE));
12876
- if (!Object.keys(style).length) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`Give at least one style field: ${Object.keys(STYLE).join(", ")}.`);
12885
+ if (!Object.keys(style).length) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Give at least one style field: ${Object.keys(STYLE).join(", ")}.`);
12877
12886
  return controller.setTextStyle(typeId(args.layerId), style, range(args));
12878
12887
  }
12879
12888
  };
@@ -12885,7 +12894,7 @@ function createImageTypeTools(controller) {
12885
12894
  annotations: { title: "Style paragraphs", ...WRITE_IDEMPOTENT6 },
12886
12895
  handler: (args) => {
12887
12896
  const style = pick2(args, Object.keys(PARAGRAPH));
12888
- if (!Object.keys(style).length) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)(`Give at least one paragraph field: ${Object.keys(PARAGRAPH).join(", ")}.`);
12897
+ if (!Object.keys(style).length) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)(`Give at least one paragraph field: ${Object.keys(PARAGRAPH).join(", ")}.`);
12889
12898
  return controller.setParagraphStyle(typeId(args.layerId), style, range(args));
12890
12899
  }
12891
12900
  };
@@ -12907,7 +12916,7 @@ function createImageTypeTools(controller) {
12907
12916
  annotations: { title: "Point or paragraph text", ...WRITE_IDEMPOTENT6 },
12908
12917
  handler: ({ layerId, kind, width, height }) => {
12909
12918
  const id = typeId(layerId);
12910
- if (kind === "box" && (width === void 0 || height === void 0)) throw new (0, _chunkXN2NBLV5cjs.LayerOperationError)("kind box needs width and height in pixels.");
12919
+ if (kind === "box" && (width === void 0 || height === void 0)) throw new (0, _chunkPMEHFHSPcjs.LayerOperationError)("kind box needs width and height in pixels.");
12911
12920
  return controller.setTextFrame(id, kind === "box" ? { kind: "box", width, height } : { kind: "point" });
12912
12921
  }
12913
12922
  };
@@ -12929,7 +12938,7 @@ function createImageTypeTools(controller) {
12929
12938
  var LAYER_PATH = /^layers\.([^.]+)\.(.+)$/;
12930
12939
  function adjustmentsSummary(adjustments) {
12931
12940
  return {
12932
- process: _chunkXN2NBLV5cjs.normalizeProcessVersion.call(void 0, adjustments.process),
12941
+ process: _chunkPMEHFHSPcjs.normalizeProcessVersion.call(void 0, adjustments.process),
12933
12942
  values: readAdjustmentControls(adjustments),
12934
12943
  layers: (_nullishCoalesce(adjustments.layers, () => ( []))).map((l) => JSON.parse(JSON.stringify(l)))
12935
12944
  };
@@ -12972,7 +12981,7 @@ function createImageEditorToolProvider(controller, options = {}) {
12972
12981
  default: def,
12973
12982
  ...requiresProcess ? { requiresProcess } : {}
12974
12983
  })),
12975
- layerKinds: _chunkXN2NBLV5cjs.ADJUSTMENT_KINDS.map(({ kind, label }) => ({
12984
+ layerKinds: _chunkPMEHFHSPcjs.ADJUSTMENT_KINDS.map(({ kind, label }) => ({
12976
12985
  kind,
12977
12986
  label,
12978
12987
  controls: [...ADJUSTMENT_LAYER_CONTROLS[kind], ADJUSTMENT_LAYER_OPACITY_CONTROL].map(({ id, label: l, min, max, step, default: def }) => ({
@@ -13058,7 +13067,7 @@ function createImageEditorToolProvider(controller, options = {}) {
13058
13067
  const result = { applied, clamped };
13059
13068
  if (typeof label === "string" && label) result.label = label;
13060
13069
  const notes = [];
13061
- if ("tint" in applied && _chunkXN2NBLV5cjs.normalizeProcessVersion.call(void 0, controller.getState().adjustments.process) < 2) {
13070
+ if ("tint" in applied && _chunkPMEHFHSPcjs.normalizeProcessVersion.call(void 0, controller.getState().adjustments.process) < 2) {
13062
13071
  notes.push("Tint has no effect on process 1 edits.");
13063
13072
  }
13064
13073
  if (notes.length) result.notes = notes;
@@ -13068,11 +13077,11 @@ function createImageEditorToolProvider(controller, options = {}) {
13068
13077
  const addLayer = {
13069
13078
  name: "add_adjustment_layer",
13070
13079
  title: "Add an adjustment layer",
13071
- description: "Adds a non-destructive adjustment layer on top of the stack (one undoable step) and returns it. Kinds: " + _chunkXN2NBLV5cjs.ADJUSTMENT_KINDS.map((k) => k.kind).join(", ") + ". Omitted params are neutral.",
13080
+ description: "Adds a non-destructive adjustment layer on top of the stack (one undoable step) and returns it. Kinds: " + _chunkPMEHFHSPcjs.ADJUSTMENT_KINDS.map((k) => k.kind).join(", ") + ". Omitted params are neutral.",
13072
13081
  inputSchema: {
13073
13082
  type: "object",
13074
13083
  properties: {
13075
- kind: { type: "string", enum: _chunkXN2NBLV5cjs.ADJUSTMENT_KINDS.map((k) => k.kind), description: "Adjustment kind." },
13084
+ kind: { type: "string", enum: _chunkPMEHFHSPcjs.ADJUSTMENT_KINDS.map((k) => k.kind), description: "Adjustment kind." },
13076
13085
  params: { type: "object", description: "Initial parameters (see list_controls); merged with neutral defaults." },
13077
13086
  opacity: { type: "number", minimum: 0, maximum: 1, description: "Layer opacity 0-1 (default 1)." },
13078
13087
  blend: { type: "string", enum: _chunkO7LUD7MHcjs.BLEND_MODES.map((m) => m.id), description: "Blend mode (default normal)." },
@@ -13091,7 +13100,7 @@ function createImageEditorToolProvider(controller, options = {}) {
13091
13100
  openWorldHint: false
13092
13101
  },
13093
13102
  handler: ({ kind, params, opacity, blend, name, aboveId, parentId }) => {
13094
- if (!_chunkXN2NBLV5cjs.isAdjustmentKind.call(void 0, kind)) throw new Error(`Unknown adjustment kind "${kind}".`);
13103
+ if (!_chunkPMEHFHSPcjs.isAdjustmentKind.call(void 0, kind)) throw new Error(`Unknown adjustment kind "${kind}".`);
13095
13104
  if (blend !== void 0 && !_chunkO7LUD7MHcjs.isBlendMode.call(void 0, blend)) throw new Error(`Unknown blend mode "${blend}".`);
13096
13105
  if (aboveId !== void 0 && parentId !== void 0) throw new Error("Give aboveId or parentId, not both.");
13097
13106
  for (const ref of [aboveId, parentId]) {
@@ -13185,7 +13194,7 @@ function boxToCurvePoint(x, y, width, height) {
13185
13194
  return { input: clampLevel(x / (width || 1) * 255), output: clampLevel((height - y) / (height || 1) * 255) };
13186
13195
  }
13187
13196
  function curveSvgPath(points, width, height, samples = 64) {
13188
- const lut = _chunkXN2NBLV5cjs.curveLutFromLevels.call(void 0, points);
13197
+ const lut = _chunkPMEHFHSPcjs.curveLutFromLevels.call(void 0, points);
13189
13198
  const n = lut.length - 1;
13190
13199
  let d = "";
13191
13200
  for (let i = 0; i <= samples; i++) {
@@ -13695,7 +13704,7 @@ var TextEditSession = (_class11 = class {
13695
13704
  else {
13696
13705
  const layout = this.layout();
13697
13706
  if (layout && layout.lines.length) {
13698
- const c = _chunk5OOIUXNJcjs.caretAt.call(void 0, layout, f);
13707
+ const c = _chunkXFXHA5MUcjs.caretAt.call(void 0, layout, f);
13699
13708
  const line = layout.lines[c.line];
13700
13709
  if (to === "home") f = line.start;
13701
13710
  else if (to === "end") {
@@ -13790,7 +13799,7 @@ var TextEditSession = (_class11 = class {
13790
13799
  styleHere() {
13791
13800
  const layer = this.layer;
13792
13801
  const at = this.start > 0 && this.start === this.end ? this.start - 1 : this.start;
13793
- return _chunk5OOIUXNJcjs.styleAt.call(void 0, layer.runs, at, _chunk5OOIUXNJcjs.DEFAULT_TEXT_STYLE);
13802
+ return _chunkXFXHA5MUcjs.styleAt.call(void 0, layer.runs, at, _chunkXFXHA5MUcjs.DEFAULT_TEXT_STYLE);
13794
13803
  }
13795
13804
  info() {
13796
13805
  return this.controller.getTextLayer(this.layerId);
@@ -13799,8 +13808,8 @@ var TextEditSession = (_class11 = class {
13799
13808
  overlay() {
13800
13809
  const layer = this.layer;
13801
13810
  const layout = this.layout();
13802
- const m = _chunkXN2NBLV5cjs.textMatrix.call(void 0, layer);
13803
- const at = (x, y) => _chunk5OOIUXNJcjs.applyMatrix.call(void 0, m, { x, y });
13811
+ const m = _chunkPMEHFHSPcjs.textMatrix.call(void 0, layer);
13812
+ const at = (x, y) => _chunkXFXHA5MUcjs.applyMatrix.call(void 0, m, { x, y });
13804
13813
  let frame = null;
13805
13814
  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)];
13806
13815
  else if (layout) {
@@ -13820,7 +13829,7 @@ var TextEditSession = (_class11 = class {
13820
13829
  selection.push([at(x0, top), at(x1, top), at(x1, bottom), at(x0, bottom)]);
13821
13830
  }
13822
13831
  }
13823
- const c = _chunk5OOIUXNJcjs.caretAt.call(void 0, layout, this.focus);
13832
+ const c = _chunkXFXHA5MUcjs.caretAt.call(void 0, layout, this.focus);
13824
13833
  return { caret: [at(c.x, c.top), at(c.x, c.bottom)], selection, frame };
13825
13834
  }
13826
13835
  /** Ends editing: an empty layer made for this session is deleted (as Photoshop does). Returns whether the layer remains. */
@@ -13835,7 +13844,7 @@ var TextEditSession = (_class11 = class {
13835
13844
  }
13836
13845
  if (this.layer.name === "Text" && this.changed) {
13837
13846
  try {
13838
- this.controller.setLayerProperties(this.layerId, { name: _chunkXN2NBLV5cjs.typeLayerName.call(void 0, this.text) }, false);
13847
+ this.controller.setLayerProperties(this.layerId, { name: _chunkPMEHFHSPcjs.typeLayerName.call(void 0, this.text) }, false);
13839
13848
  } catch (e32) {
13840
13849
  }
13841
13850
  }
@@ -13846,8 +13855,8 @@ function typeLayerAt(controller, p, slop = 4) {
13846
13855
  const layers = [...flattenTypeLayers(controller.getLayers())].reverse();
13847
13856
  for (const l of layers) {
13848
13857
  if (!l.visible) continue;
13849
- const inv = invert(_chunkXN2NBLV5cjs.textMatrix.call(void 0, l));
13850
- const q = _chunk5OOIUXNJcjs.applyMatrix.call(void 0, inv, p);
13858
+ const inv = invert(_chunkPMEHFHSPcjs.textMatrix.call(void 0, l));
13859
+ const q = _chunkXFXHA5MUcjs.applyMatrix.call(void 0, inv, p);
13851
13860
  let b = null;
13852
13861
  if (l.frame.kind === "box") b = { x: 0, y: 0, width: l.frame.width, height: l.frame.height };
13853
13862
  else {
@@ -13957,7 +13966,7 @@ function layerPanelRows(layers, activeId) {
13957
13966
  }
13958
13967
  function layerLabel(layer) {
13959
13968
  if (layer.name) return layer.name;
13960
- if (layer.type === "adjustment") return _chunkXN2NBLV5cjs.adjustmentKindLabel.call(void 0, layer.kind);
13969
+ if (layer.type === "adjustment") return _chunkPMEHFHSPcjs.adjustmentKindLabel.call(void 0, layer.kind);
13961
13970
  return layer.type === "group" ? "Group" : "Layer";
13962
13971
  }
13963
13972
  function layerBadge(layer) {
@@ -14429,7 +14438,7 @@ var FREE_TRANSFORM_MODE_OPTIONS = [
14429
14438
  ];
14430
14439
  var WARP_STYLE_OPTIONS = [
14431
14440
  { id: "custom", label: "Custom" },
14432
- ..._chunk5OOIUXNJcjs.WARP_STYLES.map((id) => ({ id, label: _chunk5OOIUXNJcjs.WARP_STYLE_LABELS[id] }))
14441
+ ..._chunkXFXHA5MUcjs.WARP_STYLES.map((id) => ({ id, label: _chunkXFXHA5MUcjs.WARP_STYLE_LABELS[id] }))
14433
14442
  ];
14434
14443
  var WARP_GRID_OPTIONS = [
14435
14444
  { id: "1x1", label: "Default", columns: 1, rows: 1 },
@@ -14565,7 +14574,7 @@ var FreeTransformTool = (_class13 = class {
14565
14574
  setMode(mode) {
14566
14575
  this.modeValue = mode;
14567
14576
  const s = this.session;
14568
- if (mode === "warp" && s && !this.mesh) this.mesh = _chunk5OOIUXNJcjs.identityWarpMesh.call(void 0, s.box, this.warpSettings.columns, this.warpSettings.rows);
14577
+ if (mode === "warp" && s && !this.mesh) this.mesh = _chunkXFXHA5MUcjs.identityWarpMesh.call(void 0, s.box, this.warpSettings.columns, this.warpSettings.rows);
14569
14578
  this.changed();
14570
14579
  }
14571
14580
  /** The Warp options bar's settings. */
@@ -14587,13 +14596,13 @@ var FreeTransformTool = (_class13 = class {
14587
14596
  this.modeValue = "warp";
14588
14597
  const next = { ...this.warpSettings, ...changes };
14589
14598
  this.warpSettings = next;
14590
- let mesh = _nullishCoalesce(this.mesh, () => ( _chunk5OOIUXNJcjs.identityWarpMesh.call(void 0, s.box, next.columns, next.rows)));
14599
+ let mesh = _nullishCoalesce(this.mesh, () => ( _chunkXFXHA5MUcjs.identityWarpMesh.call(void 0, s.box, next.columns, next.rows)));
14591
14600
  if (next.style !== "custom" && ("style" in changes || "bend" in changes || "horizontal" in changes || "vertical" in changes || "orientation" in changes)) {
14592
14601
  const preset = { style: next.style, bend: next.bend, horizontal: next.horizontal, vertical: next.vertical, orientation: next.orientation };
14593
- mesh = _nullishCoalesce(_chunk5OOIUXNJcjs.warpPresetMesh.call(void 0, preset, s.box), () => ( _chunk5OOIUXNJcjs.identityWarpMesh.call(void 0, s.box)));
14594
- mesh = _chunk5OOIUXNJcjs.resizeWarpMesh.call(void 0, mesh, next.columns, next.rows);
14602
+ mesh = _nullishCoalesce(_chunkXFXHA5MUcjs.warpPresetMesh.call(void 0, preset, s.box), () => ( _chunkXFXHA5MUcjs.identityWarpMesh.call(void 0, s.box)));
14603
+ mesh = _chunkXFXHA5MUcjs.resizeWarpMesh.call(void 0, mesh, next.columns, next.rows);
14595
14604
  }
14596
- if ("columns" in changes || "rows" in changes) mesh = _chunk5OOIUXNJcjs.resizeWarpMesh.call(void 0, mesh, next.columns, next.rows);
14605
+ if ("columns" in changes || "rows" in changes) mesh = _chunkXFXHA5MUcjs.resizeWarpMesh.call(void 0, mesh, next.columns, next.rows);
14597
14606
  this.mesh = mesh;
14598
14607
  this.changed();
14599
14608
  this.preview();
@@ -14640,11 +14649,11 @@ var FreeTransformTool = (_class13 = class {
14640
14649
  const m = this.mesh;
14641
14650
  const at = (p) => _nullishCoalesce(_chunkMUUXNRU4cjs.applyHomography.call(void 0, h, p), () => ( p));
14642
14651
  const pts = m.points.map(at);
14643
- const edit = _chunk5OOIUXNJcjs.warpMeshEditPoints.call(void 0, m);
14652
+ const edit = _chunkXFXHA5MUcjs.warpMeshEditPoints.call(void 0, m);
14644
14653
  out.handles = [];
14645
- out.outline = _chunk5OOIUXNJcjs.warpMeshGridCurves.call(void 0, { ...m, points: pts }).length ? this.meshOutline(pts, m) : out.outline;
14654
+ out.outline = _chunkXFXHA5MUcjs.warpMeshGridCurves.call(void 0, { ...m, points: pts }).length ? this.meshOutline(pts, m) : out.outline;
14646
14655
  out.warp = {
14647
- curves: _chunk5OOIUXNJcjs.warpMeshGridCurves.call(void 0, { ...m, points: pts }),
14656
+ curves: _chunkXFXHA5MUcjs.warpMeshGridCurves.call(void 0, { ...m, points: pts }),
14648
14657
  anchors: edit.anchors.map((i) => pts[i]),
14649
14658
  handles: edit.handles.map((e) => ({ point: pts[e.index], anchor: pts[e.anchor] }))
14650
14659
  };
@@ -14668,7 +14677,7 @@ var FreeTransformTool = (_class13 = class {
14668
14677
  if (!o) return null;
14669
14678
  if (this.modeValue === "warp" && this.mesh) {
14670
14679
  const h = this.homography();
14671
- const edit = _chunk5OOIUXNJcjs.warpMeshEditPoints.call(void 0, this.mesh);
14680
+ const edit = _chunkXFXHA5MUcjs.warpMeshEditPoints.call(void 0, this.mesh);
14672
14681
  let best2 = -1;
14673
14682
  let bestD2 = tolerance;
14674
14683
  for (const i of [...edit.anchors, ...edit.handles.map((e) => e.index)]) {
@@ -14713,7 +14722,7 @@ var FreeTransformTool = (_class13 = class {
14713
14722
  if (this.modeValue === "warp" && this.mesh && handle === "inside") {
14714
14723
  const q = this.toFrame(p, this.corners);
14715
14724
  if (q) {
14716
- const r = _chunk5OOIUXNJcjs.warpMeshParamAt.call(void 0, this.mesh, q);
14725
+ const r = _chunkXFXHA5MUcjs.warpMeshParamAt.call(void 0, this.mesh, q);
14717
14726
  st = { s: r.s, t: r.t };
14718
14727
  }
14719
14728
  }
@@ -14746,8 +14755,8 @@ var FreeTransformTool = (_class13 = class {
14746
14755
  if (!a || !b) return;
14747
14756
  const delta = { x: b.x - a.x, y: b.y - a.y };
14748
14757
  const i = meshIndex(d.handle);
14749
- if (i >= 0) this.mesh = _chunk5OOIUXNJcjs.dragWarpMeshPoint.call(void 0, d.mesh, i, delta);
14750
- else if (d.handle === "inside" && d.st) this.mesh = _chunk5OOIUXNJcjs.pullWarpMesh.call(void 0, d.mesh, d.st.s, d.st.t, delta);
14758
+ if (i >= 0) this.mesh = _chunkXFXHA5MUcjs.dragWarpMeshPoint.call(void 0, d.mesh, i, delta);
14759
+ else if (d.handle === "inside" && d.st) this.mesh = _chunkXFXHA5MUcjs.pullWarpMesh.call(void 0, d.mesh, d.st.s, d.st.t, delta);
14751
14760
  else return;
14752
14761
  this.warpSettings = { ...this.warpSettings, style: "custom" };
14753
14762
  this.changed();
@@ -14871,7 +14880,7 @@ var FreeTransformTool = (_class13 = class {
14871
14880
  bar() {
14872
14881
  const s = this.session;
14873
14882
  if (!s || !this.corners) return null;
14874
- const read = _chunkXN2NBLV5cjs.describeTransform.call(void 0, { box: s.box, corners: this.corners }, this.refBox);
14883
+ const read = _chunkPMEHFHSPcjs.describeTransform.call(void 0, { box: s.box, corners: this.corners }, this.refBox);
14875
14884
  return {
14876
14885
  affine: read.affine,
14877
14886
  x: _nullishCoalesce(this.typed.x, () => ( read.x)),
@@ -14896,7 +14905,7 @@ var FreeTransformTool = (_class13 = class {
14896
14905
  this.changed();
14897
14906
  return;
14898
14907
  }
14899
- const m = _chunkXN2NBLV5cjs.matrixFromParams.call(void 0, s.box, {
14908
+ const m = _chunkPMEHFHSPcjs.matrixFromParams.call(void 0, s.box, {
14900
14909
  scaleX: next.scaleX,
14901
14910
  scaleY: next.scaleY,
14902
14911
  rotate: next.rotate,
@@ -14906,7 +14915,7 @@ var FreeTransformTool = (_class13 = class {
14906
14915
  dx: next.x - this.refBox.x,
14907
14916
  dy: next.y - this.refBox.y
14908
14917
  });
14909
- this.setCorners(_chunkXN2NBLV5cjs.cornersFromMatrix.call(void 0, s.box, m));
14918
+ this.setCorners(_chunkPMEHFHSPcjs.cornersFromMatrix.call(void 0, s.box, m));
14910
14919
  this.typed = { scaleX: next.scaleX, scaleY: next.scaleY, rotate: next.rotate, skewX: next.skewX, skewY: next.skewY, x: next.x, y: next.y };
14911
14920
  this.changed();
14912
14921
  }
@@ -16006,5 +16015,14 @@ function createImageEffectsToolProvider(controller, options = {}) {
16006
16015
 
16007
16016
 
16008
16017
 
16009
- exports.ADJUSTMENT_KEYS = _chunkXN2NBLV5cjs.ADJUSTMENT_KEYS; exports.ADJUSTMENT_KINDS = _chunkXN2NBLV5cjs.ADJUSTMENT_KINDS; exports.ADJUSTMENT_LAYER_CONTROLS = ADJUSTMENT_LAYER_CONTROLS; exports.ADJUSTMENT_LAYER_OPACITY_CONTROL = ADJUSTMENT_LAYER_OPACITY_CONTROL; exports.ADJUSTMENT_LUT_SIZE = _chunkXN2NBLV5cjs.ADJUSTMENT_LUT_SIZE; exports.AS_SHOT_KELVIN = _chunkXN2NBLV5cjs.AS_SHOT_KELVIN; exports.BACKGROUND_LAYER_ID = _chunkXN2NBLV5cjs.BACKGROUND_LAYER_ID; exports.BACKGROUND_LAYER_NAME = _chunkXN2NBLV5cjs.BACKGROUND_LAYER_NAME; exports.BIT_DEPTHS = _chunkO7LUD7MHcjs.BIT_DEPTHS; exports.BIT_DEPTH_OPTIONS = BIT_DEPTH_OPTIONS; exports.BLEND_MODES = _chunkO7LUD7MHcjs.BLEND_MODES; exports.BLUR_FILTER_ID = _chunkXN2NBLV5cjs.BLUR_FILTER_ID; exports.BODY_SCATTER = _chunkF2Y4E4GUcjs.BODY_SCATTER; exports.BRUSHSTROKE_MAX_SCALE = _chunkSYPFUL5Bcjs.BRUSHSTROKE_MAX_SCALE; exports.BRUSHSTROKE_MIN_SCALE = _chunkSYPFUL5Bcjs.BRUSHSTROKE_MIN_SCALE; exports.BRUSH_OPTION_CONTROLS = BRUSH_OPTION_CONTROLS; exports.BUILTIN_PROFILES = _chunkG5NMLUVFcjs.BUILTIN_PROFILES; exports.BrushstrokeCache = _chunkQBWEH3IMcjs.BrushstrokeCache; exports.CLONE_TRANSFORM_CONTROLS = CLONE_TRANSFORM_CONTROLS; exports.COLOR_MODE_OPTIONS = COLOR_MODE_OPTIONS; exports.CoverageMap = _chunkQBWEH3IMcjs.CoverageMap; exports.D50 = _chunkXN2NBLV5cjs.D50; exports.D65 = _chunkXN2NBLV5cjs.D65; exports.DEFAULT_ADJUSTMENTS = DEFAULT_ADJUSTMENTS; exports.DEFAULT_AUTO_LEADING = _chunk5OOIUXNJcjs.DEFAULT_AUTO_LEADING; exports.DEFAULT_BLENDER = _chunkQBWEH3IMcjs.DEFAULT_BLENDER; exports.DEFAULT_BRUSH = _chunkQBWEH3IMcjs.DEFAULT_BRUSH; exports.DEFAULT_DEPTH_MASK = DEFAULT_DEPTH_MASK; exports.DEFAULT_FLOW = _chunkF2Y4E4GUcjs.DEFAULT_FLOW; exports.DEFAULT_GLOBAL_LIGHT = _chunkAEAAN4ADcjs.DEFAULT_GLOBAL_LIGHT; exports.DEFAULT_MITER_LIMIT = _chunkXN2NBLV5cjs.DEFAULT_MITER_LIMIT; exports.DEFAULT_MIXER = _chunkQBWEH3IMcjs.DEFAULT_MIXER; exports.DEFAULT_PAINT_GRADIENT = _chunkQBWEH3IMcjs.DEFAULT_PAINT_GRADIENT; exports.DEFAULT_PAINT_GRADIENT_MAPPING = _chunkQBWEH3IMcjs.DEFAULT_PAINT_GRADIENT_MAPPING; exports.DEFAULT_PROOF = DEFAULT_PROOF; exports.DEFAULT_REFINE_EDGE_PARAMS = DEFAULT_REFINE_EDGE_PARAMS; exports.DEFAULT_RETOUCH = _chunkTLCTTQFFcjs.DEFAULT_RETOUCH; exports.DEFAULT_SELECTION_TOOL_OPTIONS = DEFAULT_SELECTION_TOOL_OPTIONS; exports.DEFAULT_SHAPE_TOOL_OPTIONS = DEFAULT_SHAPE_TOOL_OPTIONS; exports.DEFAULT_SMUDGE = _chunkQBWEH3IMcjs.DEFAULT_SMUDGE; exports.DEFAULT_TEXT_STYLE = _chunk5OOIUXNJcjs.DEFAULT_TEXT_STYLE; exports.DEFAULT_TRANSFORM = DEFAULT_TRANSFORM; exports.DEFAULT_TYPE_TOOL_OPTIONS = DEFAULT_TYPE_TOOL_OPTIONS; exports.DEFAULT_WET_PAPER = _chunkF2Y4E4GUcjs.DEFAULT_WET_PAPER; exports.DEFAULT_WET_PARAMS = _chunkF2Y4E4GUcjs.DEFAULT_WET_PARAMS; exports.DEPTH_MASK_CONTROLS = DEPTH_MASK_CONTROLS; exports.DEVELOP_FILTER_ID = _chunkXN2NBLV5cjs.DEVELOP_FILTER_ID; exports.DIRECT_GAUSSIAN_MAX_SIGMA = _chunkAEAAN4ADcjs.DIRECT_GAUSSIAN_MAX_SIGMA; exports.DRY_EPS = _chunkF2Y4E4GUcjs.DRY_EPS; exports.DabWalker = _chunkQBWEH3IMcjs.DabWalker; exports.EMPTY_DISTANCE = _chunkXN2NBLV5cjs.EMPTY_DISTANCE; exports.EMPTY_MIXER_LOAD = _chunkQBWEH3IMcjs.EMPTY_MIXER_LOAD; exports.EX = _chunkF2Y4E4GUcjs.EX; exports.EY = _chunkF2Y4E4GUcjs.EY; exports.FLAG_ALIVE = _chunkF2Y4E4GUcjs.FLAG_ALIVE; exports.FLAG_BOTTOM = _chunkF2Y4E4GUcjs.FLAG_BOTTOM; exports.FLAG_LEFT = _chunkF2Y4E4GUcjs.FLAG_LEFT; exports.FLAG_RIGHT = _chunkF2Y4E4GUcjs.FLAG_RIGHT; exports.FLAG_TOP = _chunkF2Y4E4GUcjs.FLAG_TOP; exports.FLAG_WET = _chunkF2Y4E4GUcjs.FLAG_WET; exports.FLAT = _chunkF2Y4E4GUcjs.FLAT; exports.FREE_INTERVAL = _chunkF2Y4E4GUcjs.FREE_INTERVAL; exports.FREE_TRANSFORM_CONTENTS = FREE_TRANSFORM_CONTENTS; exports.FREE_TRANSFORM_FIELDS = FREE_TRANSFORM_FIELDS; exports.FREE_TRANSFORM_MODES = _chunkXN2NBLV5cjs.FREE_TRANSFORM_MODES; exports.FREE_TRANSFORM_MODE_OPTIONS = FREE_TRANSFORM_MODE_OPTIONS; exports.FreeTransformSession = FreeTransformSession; exports.FreeTransformTool = FreeTransformTool; exports.GUIDED_FILTER_EPS = GUIDED_FILTER_EPS; exports.HIDE = _chunkF2Y4E4GUcjs.HIDE; exports.HISTOGRAM_BINS = HISTOGRAM_BINS; exports.HUE_RANGE_LABELS = _chunkXN2NBLV5cjs.HUE_RANGE_LABELS; exports.IDENTITY_CLONE_TRANSFORM = _chunkTLCTTQFFcjs.IDENTITY_CLONE_TRANSFORM; exports.IDENTITY_MATRIX3 = _chunkXN2NBLV5cjs.IDENTITY_MATRIX3; exports.IMAGE_ADJUSTMENT_CONTROLS = IMAGE_ADJUSTMENT_CONTROLS; exports.IMAGE_CROP_PRESETS = IMAGE_CROP_PRESETS; exports.IMAGE_EDITOR_SCHEMA_VERSION = IMAGE_EDITOR_SCHEMA_VERSION; exports.IMAGE_EDITOR_STATE_VERSION = IMAGE_EDITOR_STATE_VERSION; exports.IMAGE_EFFECT_PLACES = IMAGE_EFFECT_PLACES; exports.IMAGE_FILTER_PRESETS = IMAGE_FILTER_PRESETS; exports.INTENTS = _chunkG5NMLUVFcjs.INTENTS; exports.INTENT_OPTIONS = INTENT_OPTIONS; exports.INTERPOLATIONS = _chunkAEAAN4ADcjs.INTERPOLATIONS; exports.ImageEditorController = ImageEditorController; exports.ImageEditorRenderer = ImageEditorRenderer; exports.ImageEffectsEngine = ImageEffectsEngine; exports.LATEST_PROCESS_VERSION = _chunkXN2NBLV5cjs.LATEST_PROCESS_VERSION; exports.LAYERED_SCHEMA_VERSION = _chunkXN2NBLV5cjs.LAYERED_SCHEMA_VERSION; exports.LAYER_EFFECT_KINDS = _chunkAEAAN4ADcjs.LAYER_EFFECT_KINDS; exports.LAYER_EFFECT_MENU = LAYER_EFFECT_MENU; exports.LEGACY_PROCESS_VERSION = _chunkXN2NBLV5cjs.LEGACY_PROCESS_VERSION; exports.LIVE_SHAPE_KINDS = _chunkXN2NBLV5cjs.LIVE_SHAPE_KINDS; exports.LUMA_709 = _chunkXN2NBLV5cjs.LUMA_709; exports.LayerCompositor = _chunkXN2NBLV5cjs.LayerCompositor; exports.LayerEffectError = _chunkAEAAN4ADcjs.LayerEffectError; exports.LayerOperationError = _chunkXN2NBLV5cjs.LayerOperationError; exports.MAX_BATCH = _chunkF2Y4E4GUcjs.MAX_BATCH; exports.MAX_BRUSH_SIZE = _chunkQBWEH3IMcjs.MAX_BRUSH_SIZE; exports.MAX_EFFECT_REACH = _chunkAEAAN4ADcjs.MAX_EFFECT_REACH; exports.MAX_KELVIN = _chunkXN2NBLV5cjs.MAX_KELVIN; exports.MAX_TILT_ACCEL = _chunkF2Y4E4GUcjs.MAX_TILT_ACCEL; exports.MAX_TRANSFORM_PIXELS = _chunkAEAAN4ADcjs.MAX_TRANSFORM_PIXELS; exports.MAX_WET_LANES = _chunkF2Y4E4GUcjs.MAX_WET_LANES; exports.MAX_WET_SLOTS = _chunkF2Y4E4GUcjs.MAX_WET_SLOTS; exports.MIN_KELVIN = _chunkXN2NBLV5cjs.MIN_KELVIN; exports.MIRED_PER_TEMPERATURE_UNIT = _chunkXN2NBLV5cjs.MIRED_PER_TEMPERATURE_UNIT; exports.MIXER_DRAIN = _chunkQBWEH3IMcjs.MIXER_DRAIN; exports.MIXER_MIXING_OPTIONS = MIXER_MIXING_OPTIONS; exports.MIXER_OPTION_CONTROLS = MIXER_OPTION_CONTROLS; exports.MIXER_PICKUP_RATE = _chunkQBWEH3IMcjs.MIXER_PICKUP_RATE; exports.MIXING_MODELS = _chunkQBWEH3IMcjs.MIXING_MODELS; exports.MixerStroke = _chunkQBWEH3IMcjs.MixerStroke; exports.OPP = _chunkF2Y4E4GUcjs.OPP; exports.PAINTERLY_BLEND_MODES = _chunkO7LUD7MHcjs.PAINTERLY_BLEND_MODES; exports.PAINT_COLOR_JSON_SCHEMA = _chunkQBWEH3IMcjs.PAINT_COLOR_JSON_SCHEMA; exports.PAINT_GRADIENT_FULL_SPEED = _chunkQBWEH3IMcjs.PAINT_GRADIENT_FULL_SPEED; exports.PAINT_GRADIENT_JSON_SCHEMA = _chunkQBWEH3IMcjs.PAINT_GRADIENT_JSON_SCHEMA; exports.PAINT_GRADIENT_KIT = _chunkQBWEH3IMcjs.PAINT_GRADIENT_KIT; exports.PAINT_GRADIENT_MAPPINGS = _chunkQBWEH3IMcjs.PAINT_GRADIENT_MAPPINGS; exports.PAINT_GRADIENT_MAPPING_LABELS = _chunkQBWEH3IMcjs.PAINT_GRADIENT_MAPPING_LABELS; exports.PAINT_GRADIENT_PRESETS = _chunkQBWEH3IMcjs.PAINT_GRADIENT_PRESETS; exports.PAINT_GRADIENT_REPEATS = _chunkQBWEH3IMcjs.PAINT_GRADIENT_REPEATS; exports.PAINT_GRADIENT_REPEAT_LABELS = _chunkQBWEH3IMcjs.PAINT_GRADIENT_REPEAT_LABELS; exports.PAINT_GRADIENT_SPACES = _chunkQBWEH3IMcjs.PAINT_GRADIENT_SPACES; exports.PAINT_GRADIENT_SPACE_LABELS = _chunkQBWEH3IMcjs.PAINT_GRADIENT_SPACE_LABELS; exports.PAINT_SOURCE_JSON_SCHEMA = _chunkQBWEH3IMcjs.PAINT_SOURCE_JSON_SCHEMA; exports.PAINT_TOOLS = PAINT_TOOLS; exports.PAPER_CAPACITY = _chunkF2Y4E4GUcjs.PAPER_CAPACITY; exports.PARAGRAPH_STYLE_FIELDS = _chunkXN2NBLV5cjs.PARAGRAPH_STYLE_FIELDS; exports.PARAM = _chunkF2Y4E4GUcjs.PARAM; exports.PARAM_FLOATS = _chunkF2Y4E4GUcjs.PARAM_FLOATS; exports.PATTERN_BLOCK_KEYS = _chunkXN2NBLV5cjs.PATTERN_BLOCK_KEYS; exports.PIGMENT_BANDS = _chunkO7LUD7MHcjs.PIGMENT_BANDS; exports.PIGMENT_CHANNELS = _chunkF2Y4E4GUcjs.PIGMENT_CHANNELS; exports.PIGMENT_LAMBDA_MIN = _chunkO7LUD7MHcjs.PIGMENT_LAMBDA_MIN; exports.PIGMENT_LAMBDA_STEP = _chunkO7LUD7MHcjs.PIGMENT_LAMBDA_STEP; exports.PIGMENT_UNIT = _chunkF2Y4E4GUcjs.PIGMENT_UNIT; exports.PIGMENT_WAVELENGTHS = _chunkO7LUD7MHcjs.PIGMENT_WAVELENGTHS; exports.PLANE = _chunkF2Y4E4GUcjs.PLANE; exports.PLANE_BYTES = _chunkF2Y4E4GUcjs.PLANE_BYTES; exports.PROOF_PROFILE_OPTIONS = PROOF_PROFILE_OPTIONS; exports.PSD_BLEND_KEYS = _chunkXN2NBLV5cjs.PSD_BLEND_KEYS; exports.PSD_FILE_ACCEPT = PSD_FILE_ACCEPT; exports.P_D0 = _chunkF2Y4E4GUcjs.P_D0; exports.P_EDGE = _chunkF2Y4E4GUcjs.P_EDGE; exports.P_FX = _chunkF2Y4E4GUcjs.P_FX; exports.P_FY = _chunkF2Y4E4GUcjs.P_FY; exports.P_H = _chunkF2Y4E4GUcjs.P_H; exports.P_P0 = _chunkF2Y4E4GUcjs.P_P0; exports.P_RHO = _chunkF2Y4E4GUcjs.P_RHO; exports.P_SW = _chunkF2Y4E4GUcjs.P_SW; exports.P_UX = _chunkF2Y4E4GUcjs.P_UX; exports.P_UY = _chunkF2Y4E4GUcjs.P_UY; exports.PaintExchange = _chunkQBWEH3IMcjs.PaintExchange; exports.PaintGesture = PaintGesture; exports.PaintGradientSampler = _chunkQBWEH3IMcjs.PaintGradientSampler; exports.PaintSourceError = _chunkQBWEH3IMcjs.PaintSourceError; exports.PaintStrokeSession = PaintStrokeSession; exports.PatternPlacement = _chunkAEAAN4ADcjs.PatternPlacement; exports.PatternTile = _chunkAEAAN4ADcjs.PatternTile; exports.PsdError = _chunkXN2NBLV5cjs.PsdError; exports.REFINE_EDGE_CONTROLS = REFINE_EDGE_CONTROLS; exports.RETOUCH_CHOICES = RETOUCH_CHOICES; exports.RETOUCH_OPTION_CONTROLS = RETOUCH_OPTION_CONTROLS; exports.RETOUCH_SAMPLES = _chunkTLCTTQFFcjs.RETOUCH_SAMPLES; exports.RETOUCH_TOGGLES = RETOUCH_TOGGLES; exports.RETOUCH_TOOLS = RETOUCH_TOOLS; exports.RegionPixelSource = _chunkTLCTTQFFcjs.RegionPixelSource; exports.RetouchDabStroke = _chunkTLCTTQFFcjs.RetouchDabStroke; exports.SELECTION_MODES = _chunkXN2NBLV5cjs.SELECTION_MODES; exports.SELECTION_MODE_LABELS = SELECTION_MODE_LABELS; exports.SELECTION_MODIFY_OPS = _chunkXN2NBLV5cjs.SELECTION_MODIFY_OPS; exports.SELECTION_TOOLS = SELECTION_TOOLS; exports.SET_PLANES = _chunkF2Y4E4GUcjs.SET_PLANES; exports.SHADOW_AMBIENT = _chunkO7LUD7MHcjs.SHADOW_AMBIENT; exports.SHAPE_KIND_LABELS = SHAPE_KIND_LABELS; exports.SHAPE_OPERATIONS = _chunkXN2NBLV5cjs.SHAPE_OPERATIONS; exports.SHAPE_RENDER_MARGIN = _chunkXN2NBLV5cjs.SHAPE_RENDER_MARGIN; exports.SLOT_BYTES = _chunkF2Y4E4GUcjs.SLOT_BYTES; exports.SLOT_PLANES = _chunkF2Y4E4GUcjs.SLOT_PLANES; exports.SLOT_SIDE = _chunkF2Y4E4GUcjs.SLOT_SIDE; exports.SMART_RENDER_MARGIN = _chunkXN2NBLV5cjs.SMART_RENDER_MARGIN; exports.SPOT_HEAL_TYPES = _chunkTLCTTQFFcjs.SPOT_HEAL_TYPES; exports.SRGB_TO_LINEAR = _chunkF2Y4E4GUcjs.SRGB_TO_LINEAR; exports.STRIP = _chunkF2Y4E4GUcjs.STRIP; exports.SUPPORTED_ADJUSTMENT_KEYS = _chunkXN2NBLV5cjs.SUPPORTED_ADJUSTMENT_KEYS; exports.SelectionGesture = SelectionGesture; exports.ShapeDrawGesture = ShapeDrawGesture; exports.SmudgeTip = _chunkQBWEH3IMcjs.SmudgeTip; exports.StrokeCoverage = _chunkQBWEH3IMcjs.StrokeCoverage; exports.SurfaceDraft = _chunkO7LUD7MHcjs.SurfaceDraft; exports.TEXT_ALIGNS = _chunkXN2NBLV5cjs.TEXT_ALIGNS; exports.TEXT_RENDER_MARGIN = _chunkXN2NBLV5cjs.TEXT_RENDER_MARGIN; exports.TEXT_STYLE_FIELDS = _chunkXN2NBLV5cjs.TEXT_STYLE_FIELDS; exports.TILE = _chunkO7LUD7MHcjs.TILE; exports.TILE_SHIFT = _chunkO7LUD7MHcjs.TILE_SHIFT; exports.TINT_SCALE = _chunkXN2NBLV5cjs.TINT_SCALE; exports.TIP_GRADIENT_STEPS = _chunkQBWEH3IMcjs.TIP_GRADIENT_STEPS; exports.TONE_LUT_SIZE = _chunkXN2NBLV5cjs.TONE_LUT_SIZE; exports.TONE_RANGES = _chunkTLCTTQFFcjs.TONE_RANGES; exports.TONE_RANGE_PRESETS = TONE_RANGE_PRESETS; exports.TRANSFORM_ANCHORS = _chunkXN2NBLV5cjs.TRANSFORM_ANCHORS; exports.TextEditSession = TextEditSession; exports.TileMedium = _chunkQBWEH3IMcjs.TileMedium; exports.TilePixelSource = _chunkTLCTTQFFcjs.TilePixelSource; exports.TiledSurface = _chunkO7LUD7MHcjs.TiledSurface; exports.TransformTooLargeError = _chunkAEAAN4ADcjs.TransformTooLargeError; exports.TransformedPixelSource = _chunkTLCTTQFFcjs.TransformedPixelSource; exports.TypeToolGesture = TypeToolGesture; exports.U_MAX = _chunkF2Y4E4GUcjs.U_MAX; exports.VIBRANCE_GREY = _chunkXN2NBLV5cjs.VIBRANCE_GREY; exports.W9 = _chunkF2Y4E4GUcjs.W9; exports.WARP_GRID_OPTIONS = WARP_GRID_OPTIONS; exports.WARP_STYLES = _chunk5OOIUXNJcjs.WARP_STYLES; exports.WARP_STYLE_LABELS = _chunk5OOIUXNJcjs.WARP_STYLE_LABELS; exports.WARP_STYLE_OPTIONS = WARP_STYLE_OPTIONS; exports.WET_FLOW_KINDS = _chunkF2Y4E4GUcjs.WET_FLOW_KINDS; exports.WET_PARAM_KEYS = _chunkF2Y4E4GUcjs.WET_PARAM_KEYS; exports.WET_TILE = _chunkF2Y4E4GUcjs.WET_TILE; exports.WGSL_HALO = _chunkF2Y4E4GUcjs.WGSL_HALO; exports.WGSL_SHADE = _chunkF2Y4E4GUcjs.WGSL_SHADE; exports.WGSL_STEP = _chunkF2Y4E4GUcjs.WGSL_STEP; exports.WORKING_SPACE_OPTIONS = WORKING_SPACE_OPTIONS; exports.WetGpuEngine = _chunkF2Y4E4GUcjs.WetGpuEngine; exports.WetMedium = _chunkF2Y4E4GUcjs.WetMedium; exports.WetWorkerPool = _chunkF2Y4E4GUcjs.WetWorkerPool; exports.WetWorld = _chunkF2Y4E4GUcjs.WetWorld; exports.WetWorldError = _chunkF2Y4E4GUcjs.WetWorldError; exports.XYZ_D50_TO_SRGB = _chunkXN2NBLV5cjs.XYZ_D50_TO_SRGB; exports.ZlibError = _chunk643B2HKCcjs.ZlibError; exports.activeAdjustmentLayers = _chunkXN2NBLV5cjs.activeAdjustmentLayers; exports.activeEffectSmartFilters = _chunkXN2NBLV5cjs.activeEffectSmartFilters; exports.activeSmartFilters = _chunkXN2NBLV5cjs.activeSmartFilters; exports.addLayerEffect = _chunkXN2NBLV5cjs.addLayerEffect; exports.addLayerFilter = _chunkXN2NBLV5cjs.addLayerFilter; exports.addPaintGradientStop = _chunkQBWEH3IMcjs.addPaintGradientStop; exports.addSmartFilter = _chunkXN2NBLV5cjs.addSmartFilter; exports.addToHistogram = addToHistogram; exports.adjustmentKindLabel = _chunkXN2NBLV5cjs.adjustmentKindLabel; exports.adjustmentLayersKey = _chunkXN2NBLV5cjs.adjustmentLayersKey; exports.adjustmentNodeAsLayer = _chunkXN2NBLV5cjs.adjustmentNodeAsLayer; exports.adjustmentNodeFromLegacy = _chunkXN2NBLV5cjs.adjustmentNodeFromLegacy; exports.adler32 = _chunk643B2HKCcjs.adler32; exports.anchorPoint = _chunkXN2NBLV5cjs.anchorPoint; exports.annotationBlend = _chunkXN2NBLV5cjs.annotationBlend; exports.annotationLayerFor = _chunkXN2NBLV5cjs.annotationLayerFor; exports.annotationLayerName = _chunkXN2NBLV5cjs.annotationLayerName; exports.annotationOfLayer = _chunkXN2NBLV5cjs.annotationOfLayer; exports.annotationOfShape = _chunkXN2NBLV5cjs.annotationOfShape; exports.annotationOfType = _chunkXN2NBLV5cjs.annotationOfType; exports.applyAdjustmentLayers = _chunkXN2NBLV5cjs.applyAdjustmentLayers; exports.applyAdjustmentLayersFloat = _chunkXN2NBLV5cjs.applyAdjustmentLayersFloat; exports.applyAdjustments = _chunkXN2NBLV5cjs.applyAdjustments; exports.applyBoxBlur = _chunkXN2NBLV5cjs.applyBoxBlur; exports.applyBoxBlurFloat = _chunkXN2NBLV5cjs.applyBoxBlurFloat; exports.applyDepthMask = _chunkXN2NBLV5cjs.applyDepthMask; exports.applyHomography = _chunkMUUXNRU4cjs.applyHomography; exports.applyImageProjectionToContext = _chunkXN2NBLV5cjs.applyImageProjectionToContext; exports.applyLegacyAdjustments = _chunkXN2NBLV5cjs.applyLegacyAdjustments; exports.applyLegacyFloat = _chunkXN2NBLV5cjs.applyLegacyFloat; exports.applyMatrix3 = _chunkXN2NBLV5cjs.applyMatrix3; exports.applyOutputStage = applyOutputStage; exports.applyParams = _chunkXN2NBLV5cjs.applyParams; exports.applyProcess2Adjustments = _chunkXN2NBLV5cjs.applyProcess2Adjustments; exports.applyProcess2Float = _chunkXN2NBLV5cjs.applyProcess2Float; exports.applyRegionBlur = applyRegionBlur; exports.applyRegionMosaic = applyRegionMosaic; exports.applyRetouchToTile = _chunkTLCTTQFFcjs.applyRetouchToTile; exports.applyShapeOptions = applyShapeOptions; exports.applySmartFilters = _chunkXN2NBLV5cjs.applySmartFilters; exports.applyStrokeToDeepTile = _chunkQBWEH3IMcjs.applyStrokeToDeepTile; exports.applyStrokeToTile = _chunkQBWEH3IMcjs.applyStrokeToTile; exports.applyToneToDeepTile = _chunkTLCTTQFFcjs.applyToneToDeepTile; exports.backgroundLayer = _chunkXN2NBLV5cjs.backgroundLayer; exports.base64ToBytes = _chunkO7LUD7MHcjs.base64ToBytes; exports.baseProjection = baseProjection; exports.bestOffset = _chunkTLCTTQFFcjs.bestOffset; exports.blackWhiteGray = _chunkXN2NBLV5cjs.blackWhiteGray; exports.blendChannel = _chunkO7LUD7MHcjs.blendChannel; exports.blendImageData = _chunkO7LUD7MHcjs.blendImageData; exports.blendLum = _chunkO7LUD7MHcjs.blendLum; exports.blendPixel = _chunkO7LUD7MHcjs.blendPixel; exports.blendRadius = _chunkQBWEH3IMcjs.blendRadius; exports.blendRgb = _chunkO7LUD7MHcjs.blendRgb; exports.blendTile = _chunkAEAAN4ADcjs.blendTile; exports.blenderDab = _chunkQBWEH3IMcjs.blenderDab; exports.blurFilter = _chunkXN2NBLV5cjs.blurFilter; exports.borderCoverage = _chunkXN2NBLV5cjs.borderCoverage; exports.boxBlurPixels = _chunkTLCTTQFFcjs.boxBlurPixels; exports.boxMean = boxMean; exports.boxPointOf = _chunkXN2NBLV5cjs.boxPointOf; exports.boxQuad = _chunkMUUXNRU4cjs.boxQuad; exports.boxToCurvePoint = boxToCurvePoint; exports.bradfordAdaptation = _chunkXN2NBLV5cjs.bradfordAdaptation; exports.brushstrokeDataUrl = _chunkQBWEH3IMcjs.brushstrokeDataUrl; exports.brushstrokeKey = _chunkQBWEH3IMcjs.brushstrokeKey; exports.brushstrokeSamples = _chunkQBWEH3IMcjs.brushstrokeSamples; exports.brushstrokeScaleBucket = _chunkSYPFUL5Bcjs.brushstrokeScaleBucket; exports.brushstrokeStrokeOptions = _chunkQBWEH3IMcjs.brushstrokeStrokeOptions; exports.brushstrokeToCanvas = _chunkQBWEH3IMcjs.brushstrokeToCanvas; exports.buildLayerMaskPlanes = _chunkXN2NBLV5cjs.buildLayerMaskPlanes; exports.buildToneLut = _chunkXN2NBLV5cjs.buildToneLut; exports.builtinPattern = _chunkAEAAN4ADcjs.builtinPattern; exports.builtinPatternIds = _chunkAEAAN4ADcjs.builtinPatternIds; exports.bytesToBase64 = _chunkO7LUD7MHcjs.bytesToBase64; exports.calculateCropDrag = _chunkXN2NBLV5cjs.calculateCropDrag; exports.canShareMemory = _chunkF2Y4E4GUcjs.canShareMemory; exports.canvasCompositeOperation = _chunkO7LUD7MHcjs.canvasCompositeOperation; exports.canvasToImagePoint = _chunkXN2NBLV5cjs.canvasToImagePoint; exports.caretAt = _chunk5OOIUXNJcjs.caretAt; exports.changedTiles = _chunkAEAAN4ADcjs.changedTiles; exports.checkImageEffectPlace = checkImageEffectPlace; exports.clampControlValue = clampControlValue; exports.clampCropToImage = _chunkXN2NBLV5cjs.clampCropToImage; exports.cleanMixer = _chunkQBWEH3IMcjs.cleanMixer; exports.cloneSamplePoint = _chunkTLCTTQFFcjs.cloneSamplePoint; exports.cloneSourceLabel = cloneSourceLabel; exports.cloneTransformView = cloneTransformView; exports.collectTiles = _chunkO7LUD7MHcjs.collectTiles; exports.colorBalanceChannel = _chunkXN2NBLV5cjs.colorBalanceChannel; exports.colorModePlanes = colorModePlanes; exports.colorModePlanes16 = colorModePlanes16; exports.colorPanelView = colorPanelView; exports.colorRange = colorRange; exports.combineSelections = _chunkXN2NBLV5cjs.combineSelections; exports.compileAdjustmentLayer = _chunkXN2NBLV5cjs.compileAdjustmentLayer; exports.componentPath = _chunkXN2NBLV5cjs.componentPath; exports.compositeDeep = _chunkXN2NBLV5cjs.compositeDeep; exports.compositeSurfaceOver = _chunkAEAAN4ADcjs.compositeSurfaceOver; exports.computeHistogram = computeHistogram; exports.computeSelectionBounds = _chunkXN2NBLV5cjs.computeSelectionBounds; exports.contentAwareFill = _chunkTLCTTQFFcjs.contentAwareFill; exports.contentBounds = _chunkO7LUD7MHcjs.contentBounds; exports.contentsBox = _chunkXN2NBLV5cjs.contentsBox; exports.contentsSurface = _chunkXN2NBLV5cjs.contentsSurface; exports.contractCoverage = _chunkXN2NBLV5cjs.contractCoverage; exports.controlPosition = controlPosition; exports.controlTrackBackground = controlTrackBackground; exports.convertColorFields = convertColorFields; exports.convertHex = convertHex; exports.convertSurfaceColors = convertSurfaceColors; exports.convertSurfaceDepth = _chunkO7LUD7MHcjs.convertSurfaceDepth; exports.convertToSmartObject = _chunkXN2NBLV5cjs.convertToSmartObject; exports.copySmartObject = _chunkXN2NBLV5cjs.copySmartObject; exports.cornersFromMatrix = _chunkXN2NBLV5cjs.cornersFromMatrix; exports.coverageTileCoord = _chunkQBWEH3IMcjs.coverageTileCoord; exports.coverageToByte = _chunkXN2NBLV5cjs.coverageToByte; exports.coveringRect = coveringRect; exports.createAdjustmentLayer = _chunkXN2NBLV5cjs.createAdjustmentLayer; exports.createBlenderScratch = _chunkQBWEH3IMcjs.createBlenderScratch; exports.createCanvasTextShaper = _chunk5OOIUXNJcjs.createCanvasTextShaper; exports.createImageCaptureSurface = createImageCaptureSurface; exports.createImageColorTools = createImageColorTools; exports.createImageEditTools = createImageEditTools; exports.createImageEditorToolProvider = createImageEditorToolProvider; exports.createImageEffectTools = createImageEffectTools; exports.createImageEffectsToolProvider = createImageEffectsToolProvider; exports.createImageLayerTools = createImageLayerTools; exports.createImagePaintTools = createImagePaintTools; exports.createImagePsdTools = createImagePsdTools; exports.createImageRetouchTools = createImageRetouchTools; exports.createImageSelectionTools = createImageSelectionTools; exports.createImageShapeTools = createImageShapeTools; exports.createImageSmartObjectTools = createImageSmartObjectTools; exports.createImageTransformTools = createImageTransformTools; exports.createImageTypeTools = createImageTypeTools; exports.createMetricTextShaper = _chunk5OOIUXNJcjs.createMetricTextShaper; exports.createOutlineTextShaper = _chunk5OOIUXNJcjs.createOutlineTextShaper; exports.createPigment = _chunkO7LUD7MHcjs.createPigment; exports.createPigmentTools = _chunkF2Y4E4GUcjs.createPigmentTools; exports.createSelectionMask = _chunkXN2NBLV5cjs.createSelectionMask; exports.createShapeLayer = _chunkXN2NBLV5cjs.createShapeLayer; exports.createTypeLayer = _chunkXN2NBLV5cjs.createTypeLayer; exports.createWetGpuEngine = _chunkF2Y4E4GUcjs.createWetGpuEngine; exports.cssFont = _chunk5OOIUXNJcjs.cssFont; exports.cssFontFamily = _chunk5OOIUXNJcjs.cssFontFamily; exports.curveLut = _chunkAEAAN4ADcjs.curveLut; exports.curveLutFromLevels = _chunkXN2NBLV5cjs.curveLutFromLevels; exports.curvePointToBox = curvePointToBox; exports.curveSvgPath = curveSvgPath; exports.dabCoverage = _chunkQBWEH3IMcjs.dabCoverage; exports.dabRect = _chunkQBWEH3IMcjs.dabRect; exports.decodeDeepSurface = _chunkXN2NBLV5cjs.decodeDeepSurface; exports.decodeLayerChannel = _chunkXN2NBLV5cjs.decodeLayerChannel; exports.decodeLayerMask = _chunkXN2NBLV5cjs.decodeLayerMask; exports.decodeMergedImage = _chunkXN2NBLV5cjs.decodeMergedImage; exports.decodePlanes = _chunkXN2NBLV5cjs.decodePlanes; exports.decodePng = _chunkO7LUD7MHcjs.decodePng; exports.decodePngDataUrl = _chunkXN2NBLV5cjs.decodePngDataUrl; exports.decodeSelectionRle = _chunkXN2NBLV5cjs.decodeSelectionRle; exports.deepBytes = _chunkO7LUD7MHcjs.deepBytes; exports.deepTile = _chunkO7LUD7MHcjs.deepTile; exports.defaultAdjustmentParams = _chunkXN2NBLV5cjs.defaultAdjustmentParams; exports.defaultEffectGradient = _chunkAEAAN4ADcjs.defaultEffectGradient; exports.defaultLayerEffect = _chunkAEAAN4ADcjs.defaultLayerEffect; exports.defaultShapeName = _chunkXN2NBLV5cjs.defaultShapeName; exports.deflate = _chunk643B2HKCcjs.deflate; exports.deflateRaw = _chunk643B2HKCcjs.deflateRaw; exports.depthMaskAlpha = _chunkXN2NBLV5cjs.depthMaskAlpha; exports.depthOf = _chunkO7LUD7MHcjs.depthOf; exports.depthRasterMask = _chunkXN2NBLV5cjs.depthRasterMask; exports.describeLayer = describeLayer; exports.describeLayerEffects = describeLayerEffects; exports.describeSelection = describeSelection; exports.describeTransform = _chunkXN2NBLV5cjs.describeTransform; exports.deserializeColorMode = deserializeColorMode; exports.deserializeColorProfile = deserializeColorProfile; exports.deserializeEffects = _chunkXN2NBLV5cjs.deserializeEffects; exports.deserializeLayer = _chunkXN2NBLV5cjs.deserializeLayer; exports.deserializeLayers = _chunkXN2NBLV5cjs.deserializeLayers; exports.deserializePatterns = _chunkXN2NBLV5cjs.deserializePatterns; exports.deserializeSelection = _chunkXN2NBLV5cjs.deserializeSelection; exports.developFilter = _chunkXN2NBLV5cjs.developFilter; exports.developFromAdjustments = _chunkXN2NBLV5cjs.developFromAdjustments; exports.developTarget = _chunkXN2NBLV5cjs.developTarget; exports.dexp = _chunkF2Y4E4GUcjs.dexp; exports.dilateMask = _chunkTLCTTQFFcjs.dilateMask; exports.displayTransform = displayTransform; exports.distanceTransform = _chunkXN2NBLV5cjs.distanceTransform; exports.dlog = _chunkF2Y4E4GUcjs.dlog; exports.documentContents = _chunkXN2NBLV5cjs.documentContents; exports.documentProfile = documentProfile; exports.dodgeBurn = _chunkTLCTTQFFcjs.dodgeBurn; exports.dodgeBurnCurve = _chunkTLCTTQFFcjs.dodgeBurnCurve; exports.downloadPsd = downloadPsd; exports.dpow = _chunkF2Y4E4GUcjs.dpow; exports.dragWarpMeshPoint = _chunk5OOIUXNJcjs.dragWarpMeshPoint; exports.dropPlacement = dropPlacement; exports.dropZone = dropZone; exports.dsincos = _chunkF2Y4E4GUcjs.dsincos; exports.duplicateLayer = _chunkXN2NBLV5cjs.duplicateLayer; exports.edgeBits = _chunkF2Y4E4GUcjs.edgeBits; exports.edgeWidth = edgeWidth; exports.effectColorHex = _chunkAEAAN4ADcjs.effectColorHex; exports.effectControlChange = effectControlChange; exports.effectPixelsToSurface = effectPixelsToSurface; exports.effectReach = _chunkAEAAN4ADcjs.effectReach; exports.effectiveProof = effectiveProof; exports.effectsFingerprint = _chunkAEAAN4ADcjs.effectsFingerprint; exports.effectsMargin = _chunkAEAAN4ADcjs.effectsMargin; exports.effectsScale = _chunkAEAAN4ADcjs.effectsScale; exports.ellipsePoints = ellipsePoints; exports.ellipseSelection = ellipseSelection; exports.emptyHistogram = emptyHistogram; exports.emptySurface = _chunkO7LUD7MHcjs.emptySurface; exports.encodeDeepSurface = _chunkXN2NBLV5cjs.encodeDeepSurface; exports.encodePng = _chunkO7LUD7MHcjs.encodePng; exports.encodeRle = _chunkXN2NBLV5cjs.encodeRle; exports.encodeSelectionRle = _chunkXN2NBLV5cjs.encodeSelectionRle; exports.encodeSurface = _chunkXN2NBLV5cjs.encodeSurface; exports.evalWarpMesh = _chunk5OOIUXNJcjs.evalWarpMesh; exports.evaluateAdjustmentLayers = _chunkXN2NBLV5cjs.evaluateAdjustmentLayers; exports.exchangeRates = _chunkQBWEH3IMcjs.exchangeRates; exports.expNeg = _chunkF2Y4E4GUcjs.expNeg; exports.expandCoverage = _chunkXN2NBLV5cjs.expandCoverage; exports.exportPsd = _chunkXN2NBLV5cjs.exportPsd; exports.extractNormalizedLayerItems = extractNormalizedLayerItems; exports.featherCoverage = _chunkXN2NBLV5cjs.featherCoverage; exports.fillRect = _chunkO7LUD7MHcjs.fillRect; exports.filmPixel = _chunkF2Y4E4GUcjs.filmPixel; exports.filmReflectance = _chunkF2Y4E4GUcjs.filmReflectance; exports.filterMaskCoverage = _chunkXN2NBLV5cjs.filterMaskCoverage; exports.findAdjustmentControl = findAdjustmentControl; exports.findLayer = _chunkAEAAN4ADcjs.findLayer; exports.findLayerControl = findLayerControl; exports.findWebGpu = _chunkF2Y4E4GUcjs.findWebGpu; exports.finishTile = _chunkO7LUD7MHcjs.finishTile; exports.fitParagraphRuns = _chunk5OOIUXNJcjs.fitParagraphRuns; exports.fitRuns = _chunk5OOIUXNJcjs.fitRuns; exports.flattenLayers = _chunkAEAAN4ADcjs.flattenLayers; exports.flattenPath = _chunkXN2NBLV5cjs.flattenPath; exports.flipCorners = _chunkXN2NBLV5cjs.flipCorners; exports.flowField = _chunkF2Y4E4GUcjs.flowField; exports.fontOf = _chunk5OOIUXNJcjs.fontOf; exports.formatControlValue = formatControlValue; exports.fullSelection = _chunkXN2NBLV5cjs.fullSelection; exports.gaussianBlur = _chunkAEAAN4ADcjs.gaussianBlur; exports.geometryHomography = _chunkXN2NBLV5cjs.geometryHomography; exports.getAnnotationBounds = _chunkXN2NBLV5cjs.getAnnotationBounds; exports.getControlPath = getControlPath; exports.getCropCursor = _chunkXN2NBLV5cjs.getCropCursor; exports.getRotatedSize = _chunkXN2NBLV5cjs.getRotatedSize; exports.getViewportMetrics = _chunkXN2NBLV5cjs.getViewportMetrics; exports.getViewportProjection = _chunkXN2NBLV5cjs.getViewportProjection; exports.globalImageCache = globalImageCache; exports.gradientDabColor = _chunkQBWEH3IMcjs.gradientDabColor; exports.greyMorphology = _chunkXN2NBLV5cjs.greyMorphology; exports.groupLayers = _chunkXN2NBLV5cjs.groupLayers; exports.guidePlanes = guidePlanes; exports.guidedFilterColor = guidedFilterColor; exports.handlePaintShortcut = handlePaintShortcut; exports.hasActiveEffects = _chunkAEAAN4ADcjs.hasActiveEffects; exports.hasResampledLegacyMask = _chunkXN2NBLV5cjs.hasResampledLegacyMask; exports.hasSurface = _chunkXN2NBLV5cjs.hasSurface; exports.hasWarp = _chunkXN2NBLV5cjs.hasWarp; exports.hash2 = _chunkQBWEH3IMcjs.hash2; exports.hashMaskContent = _chunkXN2NBLV5cjs.hashMaskContent; exports.hashNoise = _chunkAEAAN4ADcjs.hashNoise; exports.healPixels = _chunkTLCTTQFFcjs.healPixels; exports.hexToPaintRgb = _chunkQBWEH3IMcjs.hexToPaintRgb; exports.hexToRgb = _chunkXN2NBLV5cjs.hexToRgb; exports.histogramPath = histogramPath; exports.hitTestAnnotation = _chunkXN2NBLV5cjs.hitTestAnnotation; exports.hitTestCrop = _chunkXN2NBLV5cjs.hitTestCrop; exports.hitTestCurvePoint = hitTestCurvePoint; exports.homographyFromAffine = _chunkMUUXNRU4cjs.homographyFromAffine; exports.homographyFromPoints = _chunkMUUXNRU4cjs.homographyFromPoints; exports.hslToRgb = _chunkXN2NBLV5cjs.hslToRgb; exports.hueRange = hueRange; exports.hueRangeTables = _chunkXN2NBLV5cjs.hueRangeTables; exports.hueRangeWeight = _chunkXN2NBLV5cjs.hueRangeWeight; exports.hueSaturation = _chunkXN2NBLV5cjs.hueSaturation; exports.identityCurve = _chunkXN2NBLV5cjs.identityCurve; exports.identityLevels = _chunkXN2NBLV5cjs.identityLevels; exports.identityTransform = _chunkXN2NBLV5cjs.identityTransform; exports.identityWarpMesh = _chunk5OOIUXNJcjs.identityWarpMesh; exports.imageEditorStateMigrations = imageEditorStateMigrations; exports.imageLayerAppliedEffects = imageLayerAppliedEffects; exports.imageToCanvasPoint = _chunkXN2NBLV5cjs.imageToCanvasPoint; exports.importPsd = _chunkXN2NBLV5cjs.importPsd; exports.inflate = _chunk643B2HKCcjs.inflate; exports.inflateRaw = _chunk643B2HKCcjs.inflateRaw; exports.insertCurvePoint = insertCurvePoint; exports.insertLayer = _chunkAEAAN4ADcjs.insertLayer; exports.instancesOf = _chunkXN2NBLV5cjs.instancesOf; exports.invertHomography = _chunkMUUXNRU4cjs.invertHomography; exports.invertMatrix3 = _chunkXN2NBLV5cjs.invertMatrix3; exports.invertSelection = _chunkXN2NBLV5cjs.invertSelection; exports.isActiveFilter = _chunkXN2NBLV5cjs.isActiveFilter; exports.isAdjustmentKind = _chunkXN2NBLV5cjs.isAdjustmentKind; exports.isBitDepth = _chunkO7LUD7MHcjs.isBitDepth; exports.isBlendMode = _chunkO7LUD7MHcjs.isBlendMode; exports.isBrushstrokeBrush = _chunkQBWEH3IMcjs.isBrushstrokeBrush; exports.isContentsDecoded = _chunkXN2NBLV5cjs.isContentsDecoded; exports.isDefaultDepthMask = _chunkXN2NBLV5cjs.isDefaultDepthMask; exports.isGradientPaint = _chunkQBWEH3IMcjs.isGradientPaint; exports.isIdentityCloneTransform = _chunkTLCTTQFFcjs.isIdentityCloneTransform; exports.isIdentityTransform = _chunkXN2NBLV5cjs.isIdentityTransform; exports.isInterpolation = _chunkAEAAN4ADcjs.isInterpolation; exports.isLayerEffectKind = _chunkAEAAN4ADcjs.isLayerEffectKind; exports.isLayerLocked = _chunkAEAAN4ADcjs.isLayerLocked; exports.isLegacyShape = _chunkXN2NBLV5cjs.isLegacyShape; exports.isPaintTool = isPaintTool; exports.isPainterlyBlendMode = _chunkO7LUD7MHcjs.isPainterlyBlendMode; exports.isPng = _chunkO7LUD7MHcjs.isPng; exports.isQuarterTurn = isQuarterTurn; exports.isQuarterTurnSwapped = _chunkXN2NBLV5cjs.isQuarterTurnSwapped; exports.isRenderedLayer = _chunkXN2NBLV5cjs.isRenderedLayer; exports.isRetouchPaintTool = isRetouchPaintTool; exports.isRetouchTool = isRetouchTool; exports.isSelectionEmpty = _chunkXN2NBLV5cjs.isSelectionEmpty; exports.isSelectionMode = _chunkXN2NBLV5cjs.isSelectionMode; exports.isSeparableBlendMode = _chunkO7LUD7MHcjs.isSeparableBlendMode; exports.isSmartSurfaceIncomplete = _chunkXN2NBLV5cjs.isSmartSurfaceIncomplete; exports.isSpatialFilter = _chunkXN2NBLV5cjs.isSpatialFilter; exports.isSrgb = isSrgb; exports.isTransformAnchor = _chunkXN2NBLV5cjs.isTransformAnchor; exports.isValidWarp = _chunkXN2NBLV5cjs.isValidWarp; exports.keepDeepSamples = _chunkO7LUD7MHcjs.keepDeepSamples; exports.kelvinToTemperature = _chunkXN2NBLV5cjs.kelvinToTemperature; exports.keysWeight = _chunkAEAAN4ADcjs.keysWeight; exports.latticeViscosity = _chunkF2Y4E4GUcjs.latticeViscosity; exports.layerBadge = layerBadge; exports.layerEffectControls = layerEffectControls; exports.layerEffectFields = _chunkAEAAN4ADcjs.layerEffectFields; exports.layerEffectLabel = _chunkAEAAN4ADcjs.layerEffectLabel; exports.layerEffectsBadge = layerEffectsBadge; exports.layerEffectsOf = _chunkXN2NBLV5cjs.layerEffectsOf; exports.layerEffectsPanel = layerEffectsPanel; exports.layerHasThumbnail = layerHasThumbnail; exports.layerLabel = layerLabel; exports.layerMaskCoverage = _chunkXN2NBLV5cjs.layerMaskCoverage; exports.layerMaskFromSelection = _chunkXN2NBLV5cjs.layerMaskFromSelection; exports.layerMaskKey = _chunkXN2NBLV5cjs.layerMaskKey; exports.layerMenu = layerMenu; exports.layerName = _chunkXN2NBLV5cjs.layerName; exports.layerPanelRows = layerPanelRows; exports.layerTree = _chunkXN2NBLV5cjs.layerTree; exports.layerTypeLabel = _chunkXN2NBLV5cjs.layerTypeLabel; exports.layerWarning = layerWarning; exports.layersFromLegacy = _chunkXN2NBLV5cjs.layersFromLegacy; exports.layoutText = _chunk5OOIUXNJcjs.layoutText; exports.legacyAdjustmentLayer = _chunkXN2NBLV5cjs.legacyAdjustmentLayer; exports.legacyMaskOf = _chunkXN2NBLV5cjs.legacyMaskOf; exports.legacyView = _chunkXN2NBLV5cjs.legacyView; exports.lerpPigment = _chunkO7LUD7MHcjs.lerpPigment; exports.lerpPigmentInto = _chunkO7LUD7MHcjs.lerpPigmentInto; exports.levelsValue = _chunkXN2NBLV5cjs.levelsValue; exports.linearSrgbToXy = _chunkXN2NBLV5cjs.linearSrgbToXy; exports.linearToSrgb = _chunkXN2NBLV5cjs.linearToSrgb; exports.linearToSrgb8 = _chunkF2Y4E4GUcjs.linearToSrgb8; exports.liveComponent = _chunkXN2NBLV5cjs.liveComponent; exports.liveShapeForDrag = liveShapeForDrag; exports.liveShapeSubpaths = _chunkXN2NBLV5cjs.liveShapeSubpaths; exports.loadImageEditorDocument = loadImageEditorDocument; exports.loadMixer = _chunkQBWEH3IMcjs.loadMixer; exports.loadOpenTypeFont = _chunk2OJACTPRcjs.loadOpenTypeFont; exports.loadWetKernel = _chunkF2Y4E4GUcjs.loadWetKernel; exports.luma = _chunkTLCTTQFFcjs.luma; exports.magicWand = magicWand; exports.mapCropHandle = _chunkXN2NBLV5cjs.mapCropHandle; exports.mapLayer = _chunkAEAAN4ADcjs.mapLayer; exports.mapSubpaths = _chunkXN2NBLV5cjs.mapSubpaths; exports.maskBounds = _chunkTLCTTQFFcjs.maskBounds; exports.maskSummary = maskSummary; exports.matrixFromCorners = _chunkXN2NBLV5cjs.matrixFromCorners; exports.matrixFromParams = _chunkXN2NBLV5cjs.matrixFromParams; exports.membraneFill = _chunkTLCTTQFFcjs.membraneFill; exports.mergeLayerEffect = _chunkAEAAN4ADcjs.mergeLayerEffect; exports.mergeShapeComponents = _chunkXN2NBLV5cjs.mergeShapeComponents; exports.migrateSerializedImageEditorState = migrateSerializedImageEditorState; exports.migrateToLayeredState = migrateToLayeredState; exports.mix32 = _chunkQBWEH3IMcjs.mix32; exports.mixPigment8 = _chunkO7LUD7MHcjs.mixPigment8; exports.mixPigmentRgb = _chunkO7LUD7MHcjs.mixPigmentRgb; exports.mixPigments = _chunkO7LUD7MHcjs.mixPigments; exports.mixerLoadResult = mixerLoadResult; exports.mixerRates = _chunkQBWEH3IMcjs.mixerRates; exports.modifySelection = _chunkXN2NBLV5cjs.modifySelection; exports.moveCurvePoint = moveCurvePoint; exports.moveLayer = _chunkXN2NBLV5cjs.moveLayer; exports.moveSmartFilter = _chunkXN2NBLV5cjs.moveSmartFilter; exports.mulMatrix3 = _chunkXN2NBLV5cjs.mulMatrix3; exports.needsLegacyBase = needsLegacyBase; exports.neutralHueRange = _chunkXN2NBLV5cjs.neutralHueRange; exports.newContentsId = _chunkXN2NBLV5cjs.newContentsId; exports.newEffectId = _chunkAEAAN4ADcjs.newEffectId; exports.newLayerId = _chunkXN2NBLV5cjs.newLayerId; exports.normalizeAdjustmentLayer = _chunkXN2NBLV5cjs.normalizeAdjustmentLayer; exports.normalizeAdjustmentLayers = _chunkXN2NBLV5cjs.normalizeAdjustmentLayers; exports.normalizeAngle = _chunkXN2NBLV5cjs.normalizeAngle; exports.normalizeBlendMode = _chunkO7LUD7MHcjs.normalizeBlendMode; exports.normalizeBlender = _chunkQBWEH3IMcjs.normalizeBlender; exports.normalizeBrush = _chunkQBWEH3IMcjs.normalizeBrush; exports.normalizeFilter = _chunkXN2NBLV5cjs.normalizeFilter; exports.normalizeFlow = _chunkF2Y4E4GUcjs.normalizeFlow; exports.normalizeHexColor = _chunkQBWEH3IMcjs.normalizeHexColor; exports.normalizeLayerEffects = _chunkAEAAN4ADcjs.normalizeLayerEffects; exports.normalizeLayerMask = _chunkXN2NBLV5cjs.normalizeLayerMask; exports.normalizeLiveShape = _chunkXN2NBLV5cjs.normalizeLiveShape; exports.normalizeMixer = _chunkQBWEH3IMcjs.normalizeMixer; exports.normalizePlacement = _chunkXN2NBLV5cjs.normalizePlacement; exports.normalizeProcessVersion = _chunkXN2NBLV5cjs.normalizeProcessVersion; exports.normalizeRect = normalizeRect; exports.normalizeRefineEdgeParams = normalizeRefineEdgeParams; exports.normalizeRetouch = _chunkTLCTTQFFcjs.normalizeRetouch; exports.normalizeShapePaint = _chunkXN2NBLV5cjs.normalizeShapePaint; exports.normalizeShapeStroke = _chunkXN2NBLV5cjs.normalizeShapeStroke; exports.normalizeSmartFilter = _chunkXN2NBLV5cjs.normalizeSmartFilter; exports.normalizeSmudge = _chunkQBWEH3IMcjs.normalizeSmudge; exports.normalizeStoredAdjustments = normalizeStoredAdjustments; exports.normalizeSubpaths = _chunkXN2NBLV5cjs.normalizeSubpaths; exports.normalizeText = _chunkXN2NBLV5cjs.normalizeText; exports.normalizeTilt = _chunkF2Y4E4GUcjs.normalizeTilt; exports.normalizeWetParams = _chunkF2Y4E4GUcjs.normalizeWetParams; exports.offsetLayer = _chunkXN2NBLV5cjs.offsetLayer; exports.offsetShape = _chunkXN2NBLV5cjs.offsetShape; exports.offsetSmartObject = _chunkXN2NBLV5cjs.offsetSmartObject; exports.openPsdFile = openPsdFile; exports.packRgba = _chunkO7LUD7MHcjs.packRgba; exports.packWetParams = _chunkF2Y4E4GUcjs.packWetParams; exports.paintGradientMappingFor = _chunkQBWEH3IMcjs.paintGradientMappingFor; exports.paintPathStroke = _chunkQBWEH3IMcjs.paintPathStroke; exports.paintSourceColor = _chunkQBWEH3IMcjs.paintSourceColor; exports.paintSourceCss = _chunkQBWEH3IMcjs.paintSourceCss; exports.paragraphRanges = _chunk5OOIUXNJcjs.paragraphRanges; exports.parseAdjustmentBlock = _chunkXN2NBLV5cjs.parseAdjustmentBlock; exports.parseBlend = _chunkXN2NBLV5cjs.parseBlend; exports.parseColor = parseColor; exports.parseCssColor = _chunk2YQONY6Gcjs.parseCssColor; exports.parseDataUrl = _chunkO7LUD7MHcjs.parseDataUrl; exports.parseEffectColor = _chunkAEAAN4ADcjs.parseEffectColor; exports.parseLfx2 = _chunkXN2NBLV5cjs.parseLfx2; exports.parseLrfx = _chunkXN2NBLV5cjs.parseLrfx; exports.parseOpenTypeFont = _chunk2OJACTPRcjs.parseOpenTypeFont; exports.parsePaintSource = _chunkQBWEH3IMcjs.parsePaintSource; exports.parsePatternBlock = _chunkXN2NBLV5cjs.parsePatternBlock; exports.parseSelectionMode = _chunkXN2NBLV5cjs.parseSelectionMode; exports.parseVersionedDescriptor = _chunkXN2NBLV5cjs.parseVersionedDescriptor; exports.patchParagraphStyle = _chunkXN2NBLV5cjs.patchParagraphStyle; exports.patchTextStyle = _chunkXN2NBLV5cjs.patchTextStyle; exports.pathStrokeCoverage = _chunkQBWEH3IMcjs.pathStrokeCoverage; exports.pathStrokeDabs = _chunkQBWEH3IMcjs.pathStrokeDabs; exports.perDabStrength = _chunkTLCTTQFFcjs.perDabStrength; exports.photoFilterMatrix = _chunkXN2NBLV5cjs.photoFilterMatrix; exports.pigment8 = _chunkO7LUD7MHcjs.pigment8; exports.pigmentColor = _chunkF2Y4E4GUcjs.pigmentColor; exports.pigmentOf = _chunkF2Y4E4GUcjs.pigmentOf; exports.pixelLayerBounds = _chunkXN2NBLV5cjs.pixelLayerBounds; exports.pixelLayers = _chunkXN2NBLV5cjs.pixelLayers; exports.pixelPigment = _chunkF2Y4E4GUcjs.pixelPigment; exports.placeContents = _chunkXN2NBLV5cjs.placeContents; exports.placeLayer = _chunkXN2NBLV5cjs.placeLayer; exports.placementAt = _chunkXN2NBLV5cjs.placementAt; exports.placementBounds = _chunkXN2NBLV5cjs.placementBounds; exports.placementGeometry = _chunkXN2NBLV5cjs.placementGeometry; exports.pngDataUrl = _chunkO7LUD7MHcjs.pngDataUrl; exports.pointerPressure = _chunkF2Y4E4GUcjs.pointerPressure; exports.pointerStrokeSample = _chunkF2Y4E4GUcjs.pointerStrokeSample; exports.pointerStrokeSamples = _chunkF2Y4E4GUcjs.pointerStrokeSamples; exports.polygonCoverage = polygonCoverage; exports.polygonSelection = polygonSelection; exports.posterizeValue = _chunkXN2NBLV5cjs.posterizeValue; exports.presetWarp = _chunkXN2NBLV5cjs.presetWarp; exports.previewStep = previewStep; exports.profileBytes = profileBytes; exports.projectImagePoint = _chunkXN2NBLV5cjs.projectImagePoint; exports.projectImageRect = _chunkXN2NBLV5cjs.projectImageRect; exports.projectMaskCoverage = _chunkXN2NBLV5cjs.projectMaskCoverage; exports.projectQuarterTurn = projectQuarterTurn; exports.proxyOf = _chunkO7LUD7MHcjs.proxyOf; exports.psdBytesFromBase64 = psdBytesFromBase64; exports.psdFileName = psdFileName; exports.psdPatternToEffectPattern = _chunkXN2NBLV5cjs.psdPatternToEffectPattern; exports.psdToLayers = _chunkXN2NBLV5cjs.psdToLayers; exports.pullWarpMesh = _chunk5OOIUXNJcjs.pullWarpMesh; exports.put255 = _chunkQBWEH3IMcjs.put255; exports.quickMaskPixels = quickMaskPixels; exports.rand01 = _chunkQBWEH3IMcjs.rand01; exports.rangeLightness = _chunkXN2NBLV5cjs.rangeLightness; exports.rasterContents = _chunkXN2NBLV5cjs.rasterContents; exports.rasterMaskFromLegacy = _chunkXN2NBLV5cjs.rasterMaskFromLegacy; exports.rasterizeCoverage = _chunkXN2NBLV5cjs.rasterizeCoverage; exports.rasterizeDab = _chunkQBWEH3IMcjs.rasterizeDab; exports.rasterizeSmartObject = _chunkXN2NBLV5cjs.rasterizeSmartObject; exports.readAdjustmentControls = readAdjustmentControls; exports.readDeepRegion = _chunkO7LUD7MHcjs.readDeepRegion; exports.readPaintSource = _chunkQBWEH3IMcjs.readPaintSource; exports.readPixel = _chunkO7LUD7MHcjs.readPixel; exports.readPsd = _chunkXN2NBLV5cjs.readPsd; exports.readRegion = _chunkO7LUD7MHcjs.readRegion; exports.readSourceRegion = _chunkTLCTTQFFcjs.readSourceRegion; exports.rectSelection = rectSelection; exports.rectToQuad = _chunkMUUXNRU4cjs.rectToQuad; exports.reduceSurface = _chunkAEAAN4ADcjs.reduceSurface; exports.referencePoint = _chunkXN2NBLV5cjs.referencePoint; exports.refineCoverage = refineCoverage; exports.refineEdgeHalo = refineEdgeHalo; exports.refineSelection = refineSelection; exports.reflectanceToRgb = _chunkO7LUD7MHcjs.reflectanceToRgb; exports.removeAlpha = _chunkXN2NBLV5cjs.removeAlpha; exports.removeCurvePoint = removeCurvePoint; exports.removeLayer = _chunkXN2NBLV5cjs.removeLayer; exports.removeLayerEffect = _chunkXN2NBLV5cjs.removeLayerEffect; exports.removeLayerFilter = _chunkXN2NBLV5cjs.removeLayerFilter; exports.removePaintGradientStop = _chunkQBWEH3IMcjs.removePaintGradientStop; exports.removeSmartFilter = _chunkXN2NBLV5cjs.removeSmartFilter; exports.renderBrushstroke = _chunkQBWEH3IMcjs.renderBrushstroke; exports.renderLayerEffects = _chunkAEAAN4ADcjs.renderLayerEffects; exports.renderLayeredBase = renderLayeredBase; exports.renderShape = _chunkXN2NBLV5cjs.renderShape; exports.renderShapeRect = _chunkXN2NBLV5cjs.renderShapeRect; exports.renderSmartObject = _chunkXN2NBLV5cjs.renderSmartObject; exports.renderText = _chunkXN2NBLV5cjs.renderText; exports.replaceContents = _chunkXN2NBLV5cjs.replaceContents; exports.replaceTextRange = _chunkXN2NBLV5cjs.replaceTextRange; exports.requireLayer = _chunkXN2NBLV5cjs.requireLayer; exports.requireOperation = _chunkXN2NBLV5cjs.requireOperation; exports.requireShapeLayer = _chunkXN2NBLV5cjs.requireShapeLayer; exports.requireSmartObject = _chunkXN2NBLV5cjs.requireSmartObject; exports.requireTypeLayer = _chunkXN2NBLV5cjs.requireTypeLayer; exports.requireUnlocked = _chunkXN2NBLV5cjs.requireUnlocked; exports.rerender = _chunkXN2NBLV5cjs.rerender; exports.rerenderShape = _chunkXN2NBLV5cjs.rerenderShape; exports.rerenderText = _chunkXN2NBLV5cjs.rerenderText; exports.resizePixels = resizePixels; exports.resizeSelection = _chunkXN2NBLV5cjs.resizeSelection; exports.resizeWarpMesh = _chunk5OOIUXNJcjs.resizeWarpMesh; exports.resolveExternalAssets = _chunkXN2NBLV5cjs.resolveExternalAssets; exports.resolveMosaicRegionBounds = resolveMosaicRegionBounds; exports.resolvePaintGradient = _chunkQBWEH3IMcjs.resolvePaintGradient; exports.resolveProfile = resolveProfile; exports.restyleRange = _chunk5OOIUXNJcjs.restyleRange; exports.retouchFilter = _chunkTLCTTQFFcjs.retouchFilter; exports.reversePaintGradient = _chunkQBWEH3IMcjs.reversePaintGradient; exports.rgbToGray = _chunkXN2NBLV5cjs.rgbToGray; exports.rgbToHsl = _chunkXN2NBLV5cjs.rgbToHsl; exports.rgbToReflectance = _chunkO7LUD7MHcjs.rgbToReflectance; exports.rgbUnitToHex = rgbUnitToHex; exports.rgbaViewOfGrey = _chunkTLCTTQFFcjs.rgbaViewOfGrey; exports.runLayerFilters = _chunkXN2NBLV5cjs.runLayerFilters; exports.runLayerFiltersFloat = _chunkXN2NBLV5cjs.runLayerFiltersFloat; exports.runLayerMenuAction = runLayerMenuAction; exports.sampleLut = _chunkXN2NBLV5cjs.sampleLut; exports.sampleToneLut = _chunkXN2NBLV5cjs.sampleToneLut; exports.saturationOf = _chunkTLCTTQFFcjs.saturationOf; exports.scaleLayerEffect = _chunkAEAAN4ADcjs.scaleLayerEffect; exports.scalePaintGradient = _chunkQBWEH3IMcjs.scalePaintGradient; exports.seamlessClone = _chunkTLCTTQFFcjs.seamlessClone; exports.selectionArea = _chunkXN2NBLV5cjs.selectionArea; exports.selectionFromCoverage = _chunkXN2NBLV5cjs.selectionFromCoverage; exports.selectionFromPixels = _chunkXN2NBLV5cjs.selectionFromPixels; exports.selectionModeFromModifiers = selectionModeFromModifiers; exports.selectionOutline = selectionOutline; exports.selectionToCoverage = _chunkXN2NBLV5cjs.selectionToCoverage; exports.selectionToPixels = _chunkXN2NBLV5cjs.selectionToPixels; exports.selectionValueAt = _chunkXN2NBLV5cjs.selectionValueAt; exports.serializeColorMode = serializeColorMode; exports.serializeColorProfile = serializeColorProfile; exports.serializeContents = _chunkXN2NBLV5cjs.serializeContents; exports.serializeEffects = _chunkXN2NBLV5cjs.serializeEffects; exports.serializeLayer = _chunkXN2NBLV5cjs.serializeLayer; exports.serializeLayers = _chunkXN2NBLV5cjs.serializeLayers; exports.serializeLayersExternal = _chunkXN2NBLV5cjs.serializeLayersExternal; exports.serializePatterns = _chunkXN2NBLV5cjs.serializePatterns; exports.serializeSelection = _chunkXN2NBLV5cjs.serializeSelection; exports.setCloneTransformValue = setCloneTransformValue; exports.setControlPath = setControlPath; exports.setLayerEffects = _chunkXN2NBLV5cjs.setLayerEffects; exports.setLayerEffectsEnabled = _chunkXN2NBLV5cjs.setLayerEffectsEnabled; exports.setLayerMask = _chunkXN2NBLV5cjs.setLayerMask; exports.setLayerProperties = _chunkXN2NBLV5cjs.setLayerProperties; exports.setLum = _chunkO7LUD7MHcjs.setLum; exports.setPigmentColor = _chunkO7LUD7MHcjs.setPigmentColor; exports.setRetouchChoice = setRetouchChoice; exports.setSmartFilterMask = _chunkXN2NBLV5cjs.setSmartFilterMask; exports.setSmartFiltersEnabled = _chunkXN2NBLV5cjs.setSmartFiltersEnabled; exports.setSmartPlacement = _chunkXN2NBLV5cjs.setSmartPlacement; exports.shadeTile = _chunkF2Y4E4GUcjs.shadeTile; exports.shapeAsPixelLayer = _chunkXN2NBLV5cjs.shapeAsPixelLayer; exports.shapeFromAnnotation = _chunkXN2NBLV5cjs.shapeFromAnnotation; exports.shapeGeometryBounds = _chunkXN2NBLV5cjs.shapeGeometryBounds; exports.shapeLayers = _chunkXN2NBLV5cjs.shapeLayers; exports.shapeOutline = _chunkXN2NBLV5cjs.shapeOutline; exports.shapeRenderClip = _chunkXN2NBLV5cjs.shapeRenderClip; exports.shiftCoverage = _chunkXN2NBLV5cjs.shiftCoverage; exports.smartFilterRows = smartFilterRows; exports.smartObjectLayers = _chunkXN2NBLV5cjs.smartObjectLayers; exports.smoothCoverage = _chunkXN2NBLV5cjs.smoothCoverage; exports.smoothPoints = _chunkQBWEH3IMcjs.smoothPoints; exports.smudgeEffect = _chunkTLCTTQFFcjs.smudgeEffect; exports.solidPaint = _chunkQBWEH3IMcjs.solidPaint; exports.solidSurface = _chunkO7LUD7MHcjs.solidSurface; exports.solveMembrane = _chunkTLCTTQFFcjs.solveMembrane; exports.spliceRuns = _chunk5OOIUXNJcjs.spliceRuns; exports.splitOverlayAnnotations = splitOverlayAnnotations; exports.sponge = _chunkTLCTTQFFcjs.sponge; exports.spongeEffect = _chunkTLCTTQFFcjs.spongeEffect; exports.spotHealPixels = _chunkTLCTTQFFcjs.spotHealPixels; exports.spotHealWindow = _chunkTLCTTQFFcjs.spotHealWindow; exports.srgb8ToLab = srgb8ToLab; exports.srgbByteToLinear = _chunkF2Y4E4GUcjs.srgbByteToLinear; exports.srgbDecode = _chunkO7LUD7MHcjs.srgbDecode; exports.srgbEncode = _chunkO7LUD7MHcjs.srgbEncode; exports.srgbToLinear = _chunkXN2NBLV5cjs.srgbToLinear; exports.standardBlendMode = _chunkO7LUD7MHcjs.standardBlendMode; exports.stepSlotTs = _chunkF2Y4E4GUcjs.stepSlotTs; exports.styleAt = _chunk5OOIUXNJcjs.styleAt; exports.sumHistograms = sumHistograms; exports.surfaceBytes = _chunkO7LUD7MHcjs.surfaceBytes; exports.surfaceDepth = _chunkO7LUD7MHcjs.surfaceDepth; exports.surfaceFromDeepPixels = _chunkO7LUD7MHcjs.surfaceFromDeepPixels; exports.surfaceFromPixels = _chunkO7LUD7MHcjs.surfaceFromPixels; exports.surfacesEqual = _chunkO7LUD7MHcjs.surfacesEqual; exports.tempTintToXy = _chunkXN2NBLV5cjs.tempTintToXy; exports.temperatureToKelvin = _chunkXN2NBLV5cjs.temperatureToKelvin; exports.textIndexAt = _chunk5OOIUXNJcjs.textIndexAt; exports.textMatrix = _chunkXN2NBLV5cjs.textMatrix; exports.textOutlines = _chunkXN2NBLV5cjs.textOutlines; exports.textRange = _chunkXN2NBLV5cjs.textRange; exports.tileCoord = _chunkO7LUD7MHcjs.tileCoord; exports.tileKey = _chunkO7LUD7MHcjs.tileKey; exports.tileRect = _chunkO7LUD7MHcjs.tileRect; exports.tileSamples = _chunkO7LUD7MHcjs.tileSamples; exports.tileSamples16 = _chunkO7LUD7MHcjs.tileSamples16; exports.tileSamples32 = _chunkO7LUD7MHcjs.tileSamples32; exports.tilesInRect = _chunkO7LUD7MHcjs.tilesInRect; exports.tipFalloff = _chunkQBWEH3IMcjs.tipFalloff; exports.tipReach = _chunkQBWEH3IMcjs.tipReach; exports.tipShape = _chunkQBWEH3IMcjs.tipShape; exports.to16From32 = _chunkO7LUD7MHcjs.to16From32; exports.to16From8 = _chunkO7LUD7MHcjs.to16From8; exports.to32From16 = _chunkO7LUD7MHcjs.to32From16; exports.to32From8 = _chunkO7LUD7MHcjs.to32From8; exports.to8From16 = _chunkO7LUD7MHcjs.to8From16; exports.to8From32 = _chunkO7LUD7MHcjs.to8From32; exports.toHex = toHex; exports.toTextSpace = _chunkXN2NBLV5cjs.toTextSpace; exports.toneCurve = _chunkXN2NBLV5cjs.toneCurve; exports.toneLuts = _chunkXN2NBLV5cjs.toneLuts; exports.toneOf = _chunkTLCTTQFFcjs.toneOf; exports.toneRange = toneRange; exports.transformHomography = _chunkXN2NBLV5cjs.transformHomography; exports.transformMap = _chunkXN2NBLV5cjs.transformMap; exports.transformShapeComponents = _chunkXN2NBLV5cjs.transformShapeComponents; exports.transformSurface = _chunkAEAAN4ADcjs.transformSurface; exports.transformTypeLayer = _chunkXN2NBLV5cjs.transformTypeLayer; exports.transformedBounds = _chunkAEAAN4ADcjs.transformedBounds; exports.transformedBox = _chunkXN2NBLV5cjs.transformedBox; exports.transformedPoint = _chunkXN2NBLV5cjs.transformedPoint; exports.translateSurface = _chunkO7LUD7MHcjs.translateSurface; exports.typeAsPixelLayer = _chunkXN2NBLV5cjs.typeAsPixelLayer; exports.typeFrame = _chunkXN2NBLV5cjs.typeFrame; exports.typeFromAnnotation = _chunkXN2NBLV5cjs.typeFromAnnotation; exports.typeLayerAt = typeLayerAt; exports.typeLayerName = _chunkXN2NBLV5cjs.typeLayerName; exports.ungroupLayer = _chunkXN2NBLV5cjs.ungroupLayer; exports.uniformTile = _chunkO7LUD7MHcjs.uniformTile; exports.unionRect = _chunkXN2NBLV5cjs.unionRect; exports.unprojectCanvasPoint = _chunkXN2NBLV5cjs.unprojectCanvasPoint; exports.updateLayerEffect = _chunkXN2NBLV5cjs.updateLayerEffect; exports.updateLayerFilter = _chunkXN2NBLV5cjs.updateLayerFilter; exports.updateLayerMaskProps = _chunkXN2NBLV5cjs.updateLayerMaskProps; exports.updatePaintGradientStop = _chunkQBWEH3IMcjs.updatePaintGradientStop; exports.updateShapeLayer = _chunkXN2NBLV5cjs.updateShapeLayer; exports.updateSmartFilter = _chunkXN2NBLV5cjs.updateSmartFilter; exports.updateTypeLayer = _chunkXN2NBLV5cjs.updateTypeLayer; exports.uvToXy = _chunkXN2NBLV5cjs.uvToXy; exports.validateEffectGradient = _chunkAEAAN4ADcjs.validateEffectGradient; exports.validateLayerEffect = _chunkAEAAN4ADcjs.validateLayerEffect; exports.validateLayerEffects = _chunkAEAAN4ADcjs.validateLayerEffects; exports.versionedDescriptorBytes = _chunkXN2NBLV5cjs.versionedDescriptorBytes; exports.vibranceLinear = _chunkXN2NBLV5cjs.vibranceLinear; exports.vibrancePixel = _chunkXN2NBLV5cjs.vibrancePixel; exports.walkDabs = _chunkQBWEH3IMcjs.walkDabs; exports.warpMeshEditPoints = _chunk5OOIUXNJcjs.warpMeshEditPoints; exports.warpMeshGridCurves = _chunk5OOIUXNJcjs.warpMeshGridCurves; exports.warpMeshParamAt = _chunk5OOIUXNJcjs.warpMeshParamAt; exports.warpPresetMesh = _chunk5OOIUXNJcjs.warpPresetMesh; exports.warpSurface = _chunkAEAAN4ADcjs.warpSurface; exports.wbMatrix = _chunkXN2NBLV5cjs.wbMatrix; exports.wetGpuSupport = _chunkF2Y4E4GUcjs.wetGpuSupport; exports.wetSimdSupported = _chunkF2Y4E4GUcjs.wetSimdSupported; exports.wetSupport = _chunkF2Y4E4GUcjs.wetSupport; exports.whiteBalanceFromSample = _chunkXN2NBLV5cjs.whiteBalanceFromSample; exports.whiteBalanceMatrix = _chunkXN2NBLV5cjs.whiteBalanceMatrix; exports.withFilterMaskSurface = _chunkXN2NBLV5cjs.withFilterMaskSurface; exports.withNewIds = _chunkXN2NBLV5cjs.withNewIds; exports.writeAdjustmentBlock = _chunkXN2NBLV5cjs.writeAdjustmentBlock; exports.writeDeepRegion = _chunkO7LUD7MHcjs.writeDeepRegion; exports.writeLfx2 = _chunkXN2NBLV5cjs.writeLfx2; exports.writePatternBlock = _chunkXN2NBLV5cjs.writePatternBlock; exports.writePsd = _chunkXN2NBLV5cjs.writePsd; exports.writeRegion = _chunkO7LUD7MHcjs.writeRegion; exports.xyToTempTint = _chunkXN2NBLV5cjs.xyToTempTint; exports.xyToUv = _chunkXN2NBLV5cjs.xyToUv;
16018
+
16019
+
16020
+
16021
+
16022
+
16023
+
16024
+
16025
+
16026
+
16027
+ exports.ADJUSTMENT_KEYS = _chunkPMEHFHSPcjs.ADJUSTMENT_KEYS; exports.ADJUSTMENT_KINDS = _chunkPMEHFHSPcjs.ADJUSTMENT_KINDS; exports.ADJUSTMENT_LAYER_CONTROLS = ADJUSTMENT_LAYER_CONTROLS; exports.ADJUSTMENT_LAYER_OPACITY_CONTROL = ADJUSTMENT_LAYER_OPACITY_CONTROL; exports.ADJUSTMENT_LUT_SIZE = _chunkPMEHFHSPcjs.ADJUSTMENT_LUT_SIZE; exports.AS_SHOT_KELVIN = _chunkPMEHFHSPcjs.AS_SHOT_KELVIN; exports.BACKGROUND_LAYER_ID = _chunkPMEHFHSPcjs.BACKGROUND_LAYER_ID; exports.BACKGROUND_LAYER_NAME = _chunkPMEHFHSPcjs.BACKGROUND_LAYER_NAME; exports.BIT_DEPTHS = _chunkO7LUD7MHcjs.BIT_DEPTHS; exports.BIT_DEPTH_OPTIONS = BIT_DEPTH_OPTIONS; exports.BLEND_MODES = _chunkO7LUD7MHcjs.BLEND_MODES; exports.BLUR_FILTER_ID = _chunkPMEHFHSPcjs.BLUR_FILTER_ID; exports.BODY_SCATTER = _chunkF2Y4E4GUcjs.BODY_SCATTER; exports.BRUSHSTROKE_MAX_SCALE = _chunkSYPFUL5Bcjs.BRUSHSTROKE_MAX_SCALE; exports.BRUSHSTROKE_MIN_SCALE = _chunkSYPFUL5Bcjs.BRUSHSTROKE_MIN_SCALE; exports.BRUSH_OPTION_CONTROLS = BRUSH_OPTION_CONTROLS; exports.BUILTIN_PROFILES = _chunkG5NMLUVFcjs.BUILTIN_PROFILES; exports.BrushstrokeCache = _chunk3T5O225Tcjs.BrushstrokeCache; exports.CLONE_TRANSFORM_CONTROLS = CLONE_TRANSFORM_CONTROLS; exports.COLOR_MODE_OPTIONS = COLOR_MODE_OPTIONS; exports.CoverageMap = _chunk3T5O225Tcjs.CoverageMap; exports.D50 = _chunkPMEHFHSPcjs.D50; exports.D65 = _chunkPMEHFHSPcjs.D65; exports.DEFAULT_ADJUSTMENTS = DEFAULT_ADJUSTMENTS; exports.DEFAULT_AUTO_LEADING = _chunkXFXHA5MUcjs.DEFAULT_AUTO_LEADING; exports.DEFAULT_BLENDER = _chunk3T5O225Tcjs.DEFAULT_BLENDER; exports.DEFAULT_BRUSH = _chunk3T5O225Tcjs.DEFAULT_BRUSH; exports.DEFAULT_DEPTH_MASK = DEFAULT_DEPTH_MASK; exports.DEFAULT_FLOW = _chunkF2Y4E4GUcjs.DEFAULT_FLOW; exports.DEFAULT_GLOBAL_LIGHT = _chunkAEAAN4ADcjs.DEFAULT_GLOBAL_LIGHT; exports.DEFAULT_MITER_LIMIT = _chunkPMEHFHSPcjs.DEFAULT_MITER_LIMIT; exports.DEFAULT_MIXER = _chunk3T5O225Tcjs.DEFAULT_MIXER; exports.DEFAULT_PAINT_GRADIENT = _chunk3T5O225Tcjs.DEFAULT_PAINT_GRADIENT; exports.DEFAULT_PAINT_GRADIENT_MAPPING = _chunk3T5O225Tcjs.DEFAULT_PAINT_GRADIENT_MAPPING; exports.DEFAULT_PROOF = DEFAULT_PROOF; exports.DEFAULT_REFINE_EDGE_PARAMS = DEFAULT_REFINE_EDGE_PARAMS; exports.DEFAULT_RETOUCH = _chunkVEHVXRJUcjs.DEFAULT_RETOUCH; exports.DEFAULT_SELECTION_TOOL_OPTIONS = DEFAULT_SELECTION_TOOL_OPTIONS; exports.DEFAULT_SHAPE_TOOL_OPTIONS = DEFAULT_SHAPE_TOOL_OPTIONS; exports.DEFAULT_SMUDGE = _chunk3T5O225Tcjs.DEFAULT_SMUDGE; exports.DEFAULT_TEXT_STYLE = _chunkXFXHA5MUcjs.DEFAULT_TEXT_STYLE; exports.DEFAULT_TRANSFORM = DEFAULT_TRANSFORM; exports.DEFAULT_TYPE_TOOL_OPTIONS = DEFAULT_TYPE_TOOL_OPTIONS; exports.DEFAULT_WET_PAPER = _chunkF2Y4E4GUcjs.DEFAULT_WET_PAPER; exports.DEFAULT_WET_PARAMS = _chunkF2Y4E4GUcjs.DEFAULT_WET_PARAMS; exports.DEPTH_MASK_CONTROLS = DEPTH_MASK_CONTROLS; exports.DEVELOP_FILTER_ID = _chunkPMEHFHSPcjs.DEVELOP_FILTER_ID; exports.DIRECT_GAUSSIAN_MAX_SIGMA = _chunkAEAAN4ADcjs.DIRECT_GAUSSIAN_MAX_SIGMA; exports.DRY_EPS = _chunkF2Y4E4GUcjs.DRY_EPS; exports.DabWalker = _chunk3T5O225Tcjs.DabWalker; exports.EMPTY_DISTANCE = _chunkPMEHFHSPcjs.EMPTY_DISTANCE; exports.EMPTY_MIXER_LOAD = _chunk3T5O225Tcjs.EMPTY_MIXER_LOAD; exports.EX = _chunkF2Y4E4GUcjs.EX; exports.EY = _chunkF2Y4E4GUcjs.EY; exports.FLAG_ALIVE = _chunkF2Y4E4GUcjs.FLAG_ALIVE; exports.FLAG_BOTTOM = _chunkF2Y4E4GUcjs.FLAG_BOTTOM; exports.FLAG_LEFT = _chunkF2Y4E4GUcjs.FLAG_LEFT; exports.FLAG_RIGHT = _chunkF2Y4E4GUcjs.FLAG_RIGHT; exports.FLAG_TOP = _chunkF2Y4E4GUcjs.FLAG_TOP; exports.FLAG_WET = _chunkF2Y4E4GUcjs.FLAG_WET; exports.FLAT = _chunkF2Y4E4GUcjs.FLAT; exports.FREE_INTERVAL = _chunkF2Y4E4GUcjs.FREE_INTERVAL; exports.FREE_TRANSFORM_CONTENTS = FREE_TRANSFORM_CONTENTS; exports.FREE_TRANSFORM_FIELDS = FREE_TRANSFORM_FIELDS; exports.FREE_TRANSFORM_MODES = _chunkPMEHFHSPcjs.FREE_TRANSFORM_MODES; exports.FREE_TRANSFORM_MODE_OPTIONS = FREE_TRANSFORM_MODE_OPTIONS; exports.FreeTransformSession = FreeTransformSession; exports.FreeTransformTool = FreeTransformTool; exports.GRAIN_PATTERNS = _chunk3T5O225Tcjs.GRAIN_PATTERNS; exports.GRAIN_TILE = _chunk3T5O225Tcjs.GRAIN_TILE; exports.GUIDED_FILTER_EPS = GUIDED_FILTER_EPS; exports.HIDE = _chunkF2Y4E4GUcjs.HIDE; exports.HISTOGRAM_BINS = HISTOGRAM_BINS; exports.HUE_RANGE_LABELS = _chunkPMEHFHSPcjs.HUE_RANGE_LABELS; exports.IDENTITY_CLONE_TRANSFORM = _chunkVEHVXRJUcjs.IDENTITY_CLONE_TRANSFORM; exports.IDENTITY_MATRIX3 = _chunkPMEHFHSPcjs.IDENTITY_MATRIX3; exports.IMAGE_ADJUSTMENT_CONTROLS = IMAGE_ADJUSTMENT_CONTROLS; exports.IMAGE_CROP_PRESETS = IMAGE_CROP_PRESETS; exports.IMAGE_EDITOR_SCHEMA_VERSION = IMAGE_EDITOR_SCHEMA_VERSION; exports.IMAGE_EDITOR_STATE_VERSION = IMAGE_EDITOR_STATE_VERSION; exports.IMAGE_EFFECT_PLACES = IMAGE_EFFECT_PLACES; exports.IMAGE_FILTER_PRESETS = IMAGE_FILTER_PRESETS; exports.INTENTS = _chunkG5NMLUVFcjs.INTENTS; exports.INTENT_OPTIONS = INTENT_OPTIONS; exports.INTERPOLATIONS = _chunkAEAAN4ADcjs.INTERPOLATIONS; exports.ImageEditorController = ImageEditorController; exports.ImageEditorRenderer = ImageEditorRenderer; exports.ImageEffectsEngine = ImageEffectsEngine; exports.LATEST_PROCESS_VERSION = _chunkPMEHFHSPcjs.LATEST_PROCESS_VERSION; exports.LAYERED_SCHEMA_VERSION = _chunkPMEHFHSPcjs.LAYERED_SCHEMA_VERSION; exports.LAYER_EFFECT_KINDS = _chunkAEAAN4ADcjs.LAYER_EFFECT_KINDS; exports.LAYER_EFFECT_MENU = LAYER_EFFECT_MENU; exports.LEGACY_PROCESS_VERSION = _chunkPMEHFHSPcjs.LEGACY_PROCESS_VERSION; exports.LIVE_SHAPE_KINDS = _chunkPMEHFHSPcjs.LIVE_SHAPE_KINDS; exports.LUMA_709 = _chunkPMEHFHSPcjs.LUMA_709; exports.LayerCompositor = _chunkPMEHFHSPcjs.LayerCompositor; exports.LayerEffectError = _chunkAEAAN4ADcjs.LayerEffectError; exports.LayerOperationError = _chunkPMEHFHSPcjs.LayerOperationError; exports.MAX_BATCH = _chunkF2Y4E4GUcjs.MAX_BATCH; exports.MAX_BRUSH_SIZE = _chunk3T5O225Tcjs.MAX_BRUSH_SIZE; exports.MAX_EFFECT_REACH = _chunkAEAAN4ADcjs.MAX_EFFECT_REACH; exports.MAX_KELVIN = _chunkPMEHFHSPcjs.MAX_KELVIN; exports.MAX_TILT_ACCEL = _chunkF2Y4E4GUcjs.MAX_TILT_ACCEL; exports.MAX_TRANSFORM_PIXELS = _chunkAEAAN4ADcjs.MAX_TRANSFORM_PIXELS; exports.MAX_WET_LANES = _chunkF2Y4E4GUcjs.MAX_WET_LANES; exports.MAX_WET_SLOTS = _chunkF2Y4E4GUcjs.MAX_WET_SLOTS; exports.MIN_KELVIN = _chunkPMEHFHSPcjs.MIN_KELVIN; exports.MIRED_PER_TEMPERATURE_UNIT = _chunkPMEHFHSPcjs.MIRED_PER_TEMPERATURE_UNIT; exports.MIXER_DRAIN = _chunk3T5O225Tcjs.MIXER_DRAIN; exports.MIXER_MIXING_OPTIONS = MIXER_MIXING_OPTIONS; exports.MIXER_OPTION_CONTROLS = MIXER_OPTION_CONTROLS; exports.MIXER_PICKUP_RATE = _chunk3T5O225Tcjs.MIXER_PICKUP_RATE; exports.MIXING_MODELS = _chunk3T5O225Tcjs.MIXING_MODELS; exports.MixerStroke = _chunk3T5O225Tcjs.MixerStroke; exports.OPP = _chunkF2Y4E4GUcjs.OPP; exports.PAINTERLY_BLEND_MODES = _chunkO7LUD7MHcjs.PAINTERLY_BLEND_MODES; exports.PAINT_COLOR_JSON_SCHEMA = _chunk3T5O225Tcjs.PAINT_COLOR_JSON_SCHEMA; exports.PAINT_GRADIENT_FULL_SPEED = _chunk3T5O225Tcjs.PAINT_GRADIENT_FULL_SPEED; exports.PAINT_GRADIENT_JSON_SCHEMA = _chunk3T5O225Tcjs.PAINT_GRADIENT_JSON_SCHEMA; exports.PAINT_GRADIENT_KIT = _chunk3T5O225Tcjs.PAINT_GRADIENT_KIT; exports.PAINT_GRADIENT_MAPPINGS = _chunk3T5O225Tcjs.PAINT_GRADIENT_MAPPINGS; exports.PAINT_GRADIENT_MAPPING_LABELS = _chunk3T5O225Tcjs.PAINT_GRADIENT_MAPPING_LABELS; exports.PAINT_GRADIENT_PRESETS = _chunk3T5O225Tcjs.PAINT_GRADIENT_PRESETS; exports.PAINT_GRADIENT_REPEATS = _chunk3T5O225Tcjs.PAINT_GRADIENT_REPEATS; exports.PAINT_GRADIENT_REPEAT_LABELS = _chunk3T5O225Tcjs.PAINT_GRADIENT_REPEAT_LABELS; exports.PAINT_GRADIENT_SPACES = _chunk3T5O225Tcjs.PAINT_GRADIENT_SPACES; exports.PAINT_GRADIENT_SPACE_LABELS = _chunk3T5O225Tcjs.PAINT_GRADIENT_SPACE_LABELS; exports.PAINT_SOURCE_JSON_SCHEMA = _chunk3T5O225Tcjs.PAINT_SOURCE_JSON_SCHEMA; exports.PAINT_TOOLS = PAINT_TOOLS; exports.PAPER_CAPACITY = _chunkF2Y4E4GUcjs.PAPER_CAPACITY; exports.PARAGRAPH_STYLE_FIELDS = _chunkPMEHFHSPcjs.PARAGRAPH_STYLE_FIELDS; exports.PARAM = _chunkF2Y4E4GUcjs.PARAM; exports.PARAM_FLOATS = _chunkF2Y4E4GUcjs.PARAM_FLOATS; exports.PATTERN_BLOCK_KEYS = _chunkPMEHFHSPcjs.PATTERN_BLOCK_KEYS; exports.PIGMENT_BANDS = _chunkO7LUD7MHcjs.PIGMENT_BANDS; exports.PIGMENT_CHANNELS = _chunkF2Y4E4GUcjs.PIGMENT_CHANNELS; exports.PIGMENT_LAMBDA_MIN = _chunkO7LUD7MHcjs.PIGMENT_LAMBDA_MIN; exports.PIGMENT_LAMBDA_STEP = _chunkO7LUD7MHcjs.PIGMENT_LAMBDA_STEP; exports.PIGMENT_UNIT = _chunkF2Y4E4GUcjs.PIGMENT_UNIT; exports.PIGMENT_WAVELENGTHS = _chunkO7LUD7MHcjs.PIGMENT_WAVELENGTHS; exports.PLANE = _chunkF2Y4E4GUcjs.PLANE; exports.PLANE_BYTES = _chunkF2Y4E4GUcjs.PLANE_BYTES; exports.PROOF_PROFILE_OPTIONS = PROOF_PROFILE_OPTIONS; exports.PSD_BLEND_KEYS = _chunkPMEHFHSPcjs.PSD_BLEND_KEYS; exports.PSD_FILE_ACCEPT = PSD_FILE_ACCEPT; exports.P_D0 = _chunkF2Y4E4GUcjs.P_D0; exports.P_EDGE = _chunkF2Y4E4GUcjs.P_EDGE; exports.P_FX = _chunkF2Y4E4GUcjs.P_FX; exports.P_FY = _chunkF2Y4E4GUcjs.P_FY; exports.P_H = _chunkF2Y4E4GUcjs.P_H; exports.P_P0 = _chunkF2Y4E4GUcjs.P_P0; exports.P_RHO = _chunkF2Y4E4GUcjs.P_RHO; exports.P_SW = _chunkF2Y4E4GUcjs.P_SW; exports.P_UX = _chunkF2Y4E4GUcjs.P_UX; exports.P_UY = _chunkF2Y4E4GUcjs.P_UY; exports.PaintExchange = _chunk3T5O225Tcjs.PaintExchange; exports.PaintGesture = PaintGesture; exports.PaintGradientSampler = _chunk3T5O225Tcjs.PaintGradientSampler; exports.PaintSourceError = _chunk3T5O225Tcjs.PaintSourceError; exports.PaintStrokeSession = PaintStrokeSession; exports.PaperGrain = _chunk3T5O225Tcjs.PaperGrain; exports.PatternPlacement = _chunkAEAAN4ADcjs.PatternPlacement; exports.PatternTile = _chunkAEAAN4ADcjs.PatternTile; exports.PsdError = _chunkPMEHFHSPcjs.PsdError; exports.REFINE_EDGE_CONTROLS = REFINE_EDGE_CONTROLS; exports.RETOUCH_CHOICES = RETOUCH_CHOICES; exports.RETOUCH_OPTION_CONTROLS = RETOUCH_OPTION_CONTROLS; exports.RETOUCH_SAMPLES = _chunkVEHVXRJUcjs.RETOUCH_SAMPLES; exports.RETOUCH_TOGGLES = RETOUCH_TOGGLES; exports.RETOUCH_TOOLS = RETOUCH_TOOLS; exports.RegionPixelSource = _chunkVEHVXRJUcjs.RegionPixelSource; exports.RetouchDabStroke = _chunkVEHVXRJUcjs.RetouchDabStroke; exports.SELECTION_MODES = _chunkPMEHFHSPcjs.SELECTION_MODES; exports.SELECTION_MODE_LABELS = SELECTION_MODE_LABELS; exports.SELECTION_MODIFY_OPS = _chunkPMEHFHSPcjs.SELECTION_MODIFY_OPS; exports.SELECTION_TOOLS = SELECTION_TOOLS; exports.SET_PLANES = _chunkF2Y4E4GUcjs.SET_PLANES; exports.SHADOW_AMBIENT = _chunkO7LUD7MHcjs.SHADOW_AMBIENT; exports.SHAPE_KIND_LABELS = SHAPE_KIND_LABELS; exports.SHAPE_OPERATIONS = _chunkPMEHFHSPcjs.SHAPE_OPERATIONS; exports.SHAPE_RENDER_MARGIN = _chunkPMEHFHSPcjs.SHAPE_RENDER_MARGIN; exports.SLOT_BYTES = _chunkF2Y4E4GUcjs.SLOT_BYTES; exports.SLOT_PLANES = _chunkF2Y4E4GUcjs.SLOT_PLANES; exports.SLOT_SIDE = _chunkF2Y4E4GUcjs.SLOT_SIDE; exports.SMART_RENDER_MARGIN = _chunkPMEHFHSPcjs.SMART_RENDER_MARGIN; exports.SPOT_HEAL_TYPES = _chunkVEHVXRJUcjs.SPOT_HEAL_TYPES; exports.SRGB_TO_LINEAR = _chunkF2Y4E4GUcjs.SRGB_TO_LINEAR; exports.STRIP = _chunkF2Y4E4GUcjs.STRIP; exports.SUPPORTED_ADJUSTMENT_KEYS = _chunkPMEHFHSPcjs.SUPPORTED_ADJUSTMENT_KEYS; exports.SelectionGesture = SelectionGesture; exports.ShapeDrawGesture = ShapeDrawGesture; exports.SmudgeTip = _chunk3T5O225Tcjs.SmudgeTip; exports.StrokeCoverage = _chunk3T5O225Tcjs.StrokeCoverage; exports.SurfaceDraft = _chunkO7LUD7MHcjs.SurfaceDraft; exports.TEXT_ALIGNS = _chunkPMEHFHSPcjs.TEXT_ALIGNS; exports.TEXT_RENDER_MARGIN = _chunkPMEHFHSPcjs.TEXT_RENDER_MARGIN; exports.TEXT_STYLE_FIELDS = _chunkPMEHFHSPcjs.TEXT_STYLE_FIELDS; exports.TILE = _chunkO7LUD7MHcjs.TILE; exports.TILE_SHIFT = _chunkO7LUD7MHcjs.TILE_SHIFT; exports.TINT_SCALE = _chunkPMEHFHSPcjs.TINT_SCALE; exports.TIP_GRADIENT_STEPS = _chunk3T5O225Tcjs.TIP_GRADIENT_STEPS; exports.TONE_LUT_SIZE = _chunkPMEHFHSPcjs.TONE_LUT_SIZE; exports.TONE_RANGES = _chunkVEHVXRJUcjs.TONE_RANGES; exports.TONE_RANGE_PRESETS = TONE_RANGE_PRESETS; exports.TRANSFORM_ANCHORS = _chunkPMEHFHSPcjs.TRANSFORM_ANCHORS; exports.TextEditSession = TextEditSession; exports.TileMedium = _chunk3T5O225Tcjs.TileMedium; exports.TilePixelSource = _chunkVEHVXRJUcjs.TilePixelSource; exports.TileableNoise = _chunk3T5O225Tcjs.TileableNoise; exports.TiledSurface = _chunkO7LUD7MHcjs.TiledSurface; exports.TransformTooLargeError = _chunkAEAAN4ADcjs.TransformTooLargeError; exports.TransformedPixelSource = _chunkVEHVXRJUcjs.TransformedPixelSource; exports.TypeToolGesture = TypeToolGesture; exports.U_MAX = _chunkF2Y4E4GUcjs.U_MAX; exports.VIBRANCE_GREY = _chunkPMEHFHSPcjs.VIBRANCE_GREY; exports.W9 = _chunkF2Y4E4GUcjs.W9; exports.WARP_GRID_OPTIONS = WARP_GRID_OPTIONS; exports.WARP_STYLES = _chunkXFXHA5MUcjs.WARP_STYLES; exports.WARP_STYLE_LABELS = _chunkXFXHA5MUcjs.WARP_STYLE_LABELS; exports.WARP_STYLE_OPTIONS = WARP_STYLE_OPTIONS; exports.WET_FLOW_KINDS = _chunkF2Y4E4GUcjs.WET_FLOW_KINDS; exports.WET_PARAM_KEYS = _chunkF2Y4E4GUcjs.WET_PARAM_KEYS; exports.WET_TILE = _chunkF2Y4E4GUcjs.WET_TILE; exports.WGSL_HALO = _chunkF2Y4E4GUcjs.WGSL_HALO; exports.WGSL_SHADE = _chunkF2Y4E4GUcjs.WGSL_SHADE; exports.WGSL_STEP = _chunkF2Y4E4GUcjs.WGSL_STEP; exports.WORKING_SPACE_OPTIONS = WORKING_SPACE_OPTIONS; exports.WetGpuEngine = _chunkF2Y4E4GUcjs.WetGpuEngine; exports.WetMedium = _chunkF2Y4E4GUcjs.WetMedium; exports.WetWorkerPool = _chunkF2Y4E4GUcjs.WetWorkerPool; exports.WetWorld = _chunkF2Y4E4GUcjs.WetWorld; exports.WetWorldError = _chunkF2Y4E4GUcjs.WetWorldError; exports.XYZ_D50_TO_SRGB = _chunkPMEHFHSPcjs.XYZ_D50_TO_SRGB; exports.ZlibError = _chunk643B2HKCcjs.ZlibError; exports.activeAdjustmentLayers = _chunkPMEHFHSPcjs.activeAdjustmentLayers; exports.activeEffectSmartFilters = _chunkPMEHFHSPcjs.activeEffectSmartFilters; exports.activeSmartFilters = _chunkPMEHFHSPcjs.activeSmartFilters; exports.addLayerEffect = _chunkPMEHFHSPcjs.addLayerEffect; exports.addLayerFilter = _chunkPMEHFHSPcjs.addLayerFilter; exports.addPaintGradientStop = _chunk3T5O225Tcjs.addPaintGradientStop; exports.addSmartFilter = _chunkPMEHFHSPcjs.addSmartFilter; exports.addToHistogram = addToHistogram; exports.adjustmentKindLabel = _chunkPMEHFHSPcjs.adjustmentKindLabel; exports.adjustmentLayersKey = _chunkPMEHFHSPcjs.adjustmentLayersKey; exports.adjustmentNodeAsLayer = _chunkPMEHFHSPcjs.adjustmentNodeAsLayer; exports.adjustmentNodeFromLegacy = _chunkPMEHFHSPcjs.adjustmentNodeFromLegacy; exports.adler32 = _chunk643B2HKCcjs.adler32; exports.anchorPoint = _chunkPMEHFHSPcjs.anchorPoint; exports.annotationBlend = _chunkPMEHFHSPcjs.annotationBlend; exports.annotationLayerFor = _chunkPMEHFHSPcjs.annotationLayerFor; exports.annotationLayerName = _chunkPMEHFHSPcjs.annotationLayerName; exports.annotationOfLayer = _chunkPMEHFHSPcjs.annotationOfLayer; exports.annotationOfShape = _chunkPMEHFHSPcjs.annotationOfShape; exports.annotationOfType = _chunkPMEHFHSPcjs.annotationOfType; exports.applyAdjustmentLayers = _chunkPMEHFHSPcjs.applyAdjustmentLayers; exports.applyAdjustmentLayersFloat = _chunkPMEHFHSPcjs.applyAdjustmentLayersFloat; exports.applyAdjustments = _chunkPMEHFHSPcjs.applyAdjustments; exports.applyBoxBlur = _chunkPMEHFHSPcjs.applyBoxBlur; exports.applyBoxBlurFloat = _chunkPMEHFHSPcjs.applyBoxBlurFloat; exports.applyDepthMask = _chunkPMEHFHSPcjs.applyDepthMask; exports.applyHomography = _chunkMUUXNRU4cjs.applyHomography; exports.applyImageProjectionToContext = _chunkPMEHFHSPcjs.applyImageProjectionToContext; exports.applyLegacyAdjustments = _chunkPMEHFHSPcjs.applyLegacyAdjustments; exports.applyLegacyFloat = _chunkPMEHFHSPcjs.applyLegacyFloat; exports.applyMatrix3 = _chunkPMEHFHSPcjs.applyMatrix3; exports.applyOutputStage = applyOutputStage; exports.applyParams = _chunkPMEHFHSPcjs.applyParams; exports.applyProcess2Adjustments = _chunkPMEHFHSPcjs.applyProcess2Adjustments; exports.applyProcess2Float = _chunkPMEHFHSPcjs.applyProcess2Float; exports.applyRegionBlur = applyRegionBlur; exports.applyRegionMosaic = applyRegionMosaic; exports.applyRetouchToTile = _chunkVEHVXRJUcjs.applyRetouchToTile; exports.applyShapeOptions = applyShapeOptions; exports.applySmartFilters = _chunkPMEHFHSPcjs.applySmartFilters; exports.applyStrokeToDeepTile = _chunk3T5O225Tcjs.applyStrokeToDeepTile; exports.applyStrokeToTile = _chunk3T5O225Tcjs.applyStrokeToTile; exports.applyToneToDeepTile = _chunkVEHVXRJUcjs.applyToneToDeepTile; exports.backgroundLayer = _chunkPMEHFHSPcjs.backgroundLayer; exports.base64ToBytes = _chunkO7LUD7MHcjs.base64ToBytes; exports.baseProjection = baseProjection; exports.bestOffset = _chunkVEHVXRJUcjs.bestOffset; exports.blackWhiteGray = _chunkPMEHFHSPcjs.blackWhiteGray; exports.blendChannel = _chunkO7LUD7MHcjs.blendChannel; exports.blendImageData = _chunkO7LUD7MHcjs.blendImageData; exports.blendLum = _chunkO7LUD7MHcjs.blendLum; exports.blendPixel = _chunkO7LUD7MHcjs.blendPixel; exports.blendRadius = _chunk3T5O225Tcjs.blendRadius; exports.blendRgb = _chunkO7LUD7MHcjs.blendRgb; exports.blendTile = _chunkAEAAN4ADcjs.blendTile; exports.blenderDab = _chunk3T5O225Tcjs.blenderDab; exports.blurFilter = _chunkPMEHFHSPcjs.blurFilter; exports.borderCoverage = _chunkPMEHFHSPcjs.borderCoverage; exports.boxBlurPixels = _chunkVEHVXRJUcjs.boxBlurPixels; exports.boxMean = boxMean; exports.boxPointOf = _chunkPMEHFHSPcjs.boxPointOf; exports.boxQuad = _chunkMUUXNRU4cjs.boxQuad; exports.boxToCurvePoint = boxToCurvePoint; exports.bradfordAdaptation = _chunkPMEHFHSPcjs.bradfordAdaptation; exports.brushstrokeDataUrl = _chunk3T5O225Tcjs.brushstrokeDataUrl; exports.brushstrokeKey = _chunk3T5O225Tcjs.brushstrokeKey; exports.brushstrokeSamples = _chunk3T5O225Tcjs.brushstrokeSamples; exports.brushstrokeScaleBucket = _chunkSYPFUL5Bcjs.brushstrokeScaleBucket; exports.brushstrokeStrokeOptions = _chunk3T5O225Tcjs.brushstrokeStrokeOptions; exports.brushstrokeToCanvas = _chunk3T5O225Tcjs.brushstrokeToCanvas; exports.buildLayerMaskPlanes = _chunkPMEHFHSPcjs.buildLayerMaskPlanes; exports.buildToneLut = _chunkPMEHFHSPcjs.buildToneLut; exports.builtinPattern = _chunkAEAAN4ADcjs.builtinPattern; exports.builtinPatternIds = _chunkAEAAN4ADcjs.builtinPatternIds; exports.bytesToBase64 = _chunkO7LUD7MHcjs.bytesToBase64; exports.calculateCropDrag = _chunkPMEHFHSPcjs.calculateCropDrag; exports.canShareMemory = _chunkF2Y4E4GUcjs.canShareMemory; exports.canvasCompositeOperation = _chunkO7LUD7MHcjs.canvasCompositeOperation; exports.canvasToImagePoint = _chunkPMEHFHSPcjs.canvasToImagePoint; exports.caretAt = _chunkXFXHA5MUcjs.caretAt; exports.changedTiles = _chunkAEAAN4ADcjs.changedTiles; exports.checkImageEffectPlace = checkImageEffectPlace; exports.clampControlValue = clampControlValue; exports.clampCropToImage = _chunkPMEHFHSPcjs.clampCropToImage; exports.cleanMixer = _chunk3T5O225Tcjs.cleanMixer; exports.cloneSamplePoint = _chunkVEHVXRJUcjs.cloneSamplePoint; exports.cloneSourceLabel = cloneSourceLabel; exports.cloneTransformView = cloneTransformView; exports.collectTiles = _chunkO7LUD7MHcjs.collectTiles; exports.colorBalanceChannel = _chunkPMEHFHSPcjs.colorBalanceChannel; exports.colorModePlanes = colorModePlanes; exports.colorModePlanes16 = colorModePlanes16; exports.colorPanelView = colorPanelView; exports.colorRange = colorRange; exports.combineSelections = _chunkPMEHFHSPcjs.combineSelections; exports.compileAdjustmentLayer = _chunkPMEHFHSPcjs.compileAdjustmentLayer; exports.componentPath = _chunkPMEHFHSPcjs.componentPath; exports.compositeDeep = _chunkPMEHFHSPcjs.compositeDeep; exports.compositeSurfaceOver = _chunkAEAAN4ADcjs.compositeSurfaceOver; exports.computeHistogram = computeHistogram; exports.computeSelectionBounds = _chunkPMEHFHSPcjs.computeSelectionBounds; exports.contentAwareFill = _chunkVEHVXRJUcjs.contentAwareFill; exports.contentBounds = _chunkO7LUD7MHcjs.contentBounds; exports.contentsBox = _chunkPMEHFHSPcjs.contentsBox; exports.contentsSurface = _chunkPMEHFHSPcjs.contentsSurface; exports.contractCoverage = _chunkPMEHFHSPcjs.contractCoverage; exports.controlPosition = controlPosition; exports.controlTrackBackground = controlTrackBackground; exports.convertColorFields = convertColorFields; exports.convertHex = convertHex; exports.convertSurfaceColors = convertSurfaceColors; exports.convertSurfaceDepth = _chunkO7LUD7MHcjs.convertSurfaceDepth; exports.convertToSmartObject = _chunkPMEHFHSPcjs.convertToSmartObject; exports.copySmartObject = _chunkPMEHFHSPcjs.copySmartObject; exports.cornersFromMatrix = _chunkPMEHFHSPcjs.cornersFromMatrix; exports.coverageTileCoord = _chunk3T5O225Tcjs.coverageTileCoord; exports.coverageToByte = _chunkPMEHFHSPcjs.coverageToByte; exports.coveringRect = coveringRect; exports.createAdjustmentLayer = _chunkPMEHFHSPcjs.createAdjustmentLayer; exports.createBlenderScratch = _chunk3T5O225Tcjs.createBlenderScratch; exports.createCanvasTextShaper = _chunkXFXHA5MUcjs.createCanvasTextShaper; exports.createImageCaptureSurface = createImageCaptureSurface; exports.createImageColorTools = createImageColorTools; exports.createImageEditTools = createImageEditTools; exports.createImageEditorToolProvider = createImageEditorToolProvider; exports.createImageEffectTools = createImageEffectTools; exports.createImageEffectsToolProvider = createImageEffectsToolProvider; exports.createImageLayerTools = createImageLayerTools; exports.createImagePaintTools = createImagePaintTools; exports.createImagePsdTools = createImagePsdTools; exports.createImageRetouchTools = createImageRetouchTools; exports.createImageSelectionTools = createImageSelectionTools; exports.createImageShapeTools = createImageShapeTools; exports.createImageSmartObjectTools = createImageSmartObjectTools; exports.createImageTransformTools = createImageTransformTools; exports.createImageTypeTools = createImageTypeTools; exports.createMetricTextShaper = _chunkXFXHA5MUcjs.createMetricTextShaper; exports.createOutlineTextShaper = _chunkXFXHA5MUcjs.createOutlineTextShaper; exports.createPigment = _chunkO7LUD7MHcjs.createPigment; exports.createPigmentTools = _chunkF2Y4E4GUcjs.createPigmentTools; exports.createSelectionMask = _chunkPMEHFHSPcjs.createSelectionMask; exports.createShapeLayer = _chunkPMEHFHSPcjs.createShapeLayer; exports.createTypeLayer = _chunkPMEHFHSPcjs.createTypeLayer; exports.createWetGpuEngine = _chunkF2Y4E4GUcjs.createWetGpuEngine; exports.cssFont = _chunkXFXHA5MUcjs.cssFont; exports.cssFontFamily = _chunkXFXHA5MUcjs.cssFontFamily; exports.curveLut = _chunkAEAAN4ADcjs.curveLut; exports.curveLutFromLevels = _chunkPMEHFHSPcjs.curveLutFromLevels; exports.curvePointToBox = curvePointToBox; exports.curveSvgPath = curveSvgPath; exports.dabCoverage = _chunk3T5O225Tcjs.dabCoverage; exports.dabRect = _chunk3T5O225Tcjs.dabRect; exports.decodeDeepSurface = _chunkPMEHFHSPcjs.decodeDeepSurface; exports.decodeLayerChannel = _chunkPMEHFHSPcjs.decodeLayerChannel; exports.decodeLayerMask = _chunkPMEHFHSPcjs.decodeLayerMask; exports.decodeMergedImage = _chunkPMEHFHSPcjs.decodeMergedImage; exports.decodePlanes = _chunkPMEHFHSPcjs.decodePlanes; exports.decodePng = _chunkO7LUD7MHcjs.decodePng; exports.decodePngDataUrl = _chunkPMEHFHSPcjs.decodePngDataUrl; exports.decodeSelectionRle = _chunkPMEHFHSPcjs.decodeSelectionRle; exports.deepBytes = _chunkO7LUD7MHcjs.deepBytes; exports.deepTile = _chunkO7LUD7MHcjs.deepTile; exports.defaultAdjustmentParams = _chunkPMEHFHSPcjs.defaultAdjustmentParams; exports.defaultEffectGradient = _chunkAEAAN4ADcjs.defaultEffectGradient; exports.defaultLayerEffect = _chunkAEAAN4ADcjs.defaultLayerEffect; exports.defaultShapeName = _chunkPMEHFHSPcjs.defaultShapeName; exports.deflate = _chunk643B2HKCcjs.deflate; exports.deflateRaw = _chunk643B2HKCcjs.deflateRaw; exports.depthMaskAlpha = _chunkPMEHFHSPcjs.depthMaskAlpha; exports.depthOf = _chunkO7LUD7MHcjs.depthOf; exports.depthRasterMask = _chunkPMEHFHSPcjs.depthRasterMask; exports.describeLayer = describeLayer; exports.describeLayerEffects = describeLayerEffects; exports.describeSelection = describeSelection; exports.describeTransform = _chunkPMEHFHSPcjs.describeTransform; exports.deserializeColorMode = deserializeColorMode; exports.deserializeColorProfile = deserializeColorProfile; exports.deserializeEffects = _chunkPMEHFHSPcjs.deserializeEffects; exports.deserializeLayer = _chunkPMEHFHSPcjs.deserializeLayer; exports.deserializeLayers = _chunkPMEHFHSPcjs.deserializeLayers; exports.deserializePatterns = _chunkPMEHFHSPcjs.deserializePatterns; exports.deserializeSelection = _chunkPMEHFHSPcjs.deserializeSelection; exports.developFilter = _chunkPMEHFHSPcjs.developFilter; exports.developFromAdjustments = _chunkPMEHFHSPcjs.developFromAdjustments; exports.developTarget = _chunkPMEHFHSPcjs.developTarget; exports.dexp = _chunkF2Y4E4GUcjs.dexp; exports.dilateMask = _chunkVEHVXRJUcjs.dilateMask; exports.displayTransform = displayTransform; exports.distanceTransform = _chunkPMEHFHSPcjs.distanceTransform; exports.dlog = _chunkF2Y4E4GUcjs.dlog; exports.documentContents = _chunkPMEHFHSPcjs.documentContents; exports.documentProfile = documentProfile; exports.dodgeBurn = _chunkVEHVXRJUcjs.dodgeBurn; exports.dodgeBurnCurve = _chunkVEHVXRJUcjs.dodgeBurnCurve; exports.downloadPsd = downloadPsd; exports.dpow = _chunkF2Y4E4GUcjs.dpow; exports.dragWarpMeshPoint = _chunkXFXHA5MUcjs.dragWarpMeshPoint; exports.dropPlacement = dropPlacement; exports.dropZone = dropZone; exports.dsincos = _chunkF2Y4E4GUcjs.dsincos; exports.duplicateLayer = _chunkPMEHFHSPcjs.duplicateLayer; exports.edgeBits = _chunkF2Y4E4GUcjs.edgeBits; exports.edgeWidth = edgeWidth; exports.effectColorHex = _chunkAEAAN4ADcjs.effectColorHex; exports.effectControlChange = effectControlChange; exports.effectPixelsToSurface = effectPixelsToSurface; exports.effectReach = _chunkAEAAN4ADcjs.effectReach; exports.effectiveProof = effectiveProof; exports.effectsFingerprint = _chunkAEAAN4ADcjs.effectsFingerprint; exports.effectsMargin = _chunkAEAAN4ADcjs.effectsMargin; exports.effectsScale = _chunkAEAAN4ADcjs.effectsScale; exports.ellipsePoints = ellipsePoints; exports.ellipseSelection = ellipseSelection; exports.emptyHistogram = emptyHistogram; exports.emptySurface = _chunkO7LUD7MHcjs.emptySurface; exports.encodeDeepSurface = _chunkPMEHFHSPcjs.encodeDeepSurface; exports.encodePng = _chunkO7LUD7MHcjs.encodePng; exports.encodeRle = _chunkPMEHFHSPcjs.encodeRle; exports.encodeSelectionRle = _chunkPMEHFHSPcjs.encodeSelectionRle; exports.encodeSurface = _chunkPMEHFHSPcjs.encodeSurface; exports.evalWarpMesh = _chunkXFXHA5MUcjs.evalWarpMesh; exports.evaluateAdjustmentLayers = _chunkPMEHFHSPcjs.evaluateAdjustmentLayers; exports.exchangeRates = _chunk3T5O225Tcjs.exchangeRates; exports.expNeg = _chunkF2Y4E4GUcjs.expNeg; exports.expandCoverage = _chunkPMEHFHSPcjs.expandCoverage; exports.exportPsd = _chunkPMEHFHSPcjs.exportPsd; exports.extractNormalizedLayerItems = extractNormalizedLayerItems; exports.featherCoverage = _chunkPMEHFHSPcjs.featherCoverage; exports.fillRect = _chunkO7LUD7MHcjs.fillRect; exports.filmPixel = _chunkF2Y4E4GUcjs.filmPixel; exports.filmReflectance = _chunkF2Y4E4GUcjs.filmReflectance; exports.filterMaskCoverage = _chunkPMEHFHSPcjs.filterMaskCoverage; exports.findAdjustmentControl = findAdjustmentControl; exports.findLayer = _chunkAEAAN4ADcjs.findLayer; exports.findLayerControl = findLayerControl; exports.findWebGpu = _chunkF2Y4E4GUcjs.findWebGpu; exports.finishTile = _chunkO7LUD7MHcjs.finishTile; exports.fitParagraphRuns = _chunkXFXHA5MUcjs.fitParagraphRuns; exports.fitRuns = _chunkXFXHA5MUcjs.fitRuns; exports.flattenLayers = _chunkAEAAN4ADcjs.flattenLayers; exports.flattenPath = _chunkPMEHFHSPcjs.flattenPath; exports.flipCorners = _chunkPMEHFHSPcjs.flipCorners; exports.flowField = _chunkF2Y4E4GUcjs.flowField; exports.fontOf = _chunkXFXHA5MUcjs.fontOf; exports.formatControlValue = formatControlValue; exports.fullSelection = _chunkPMEHFHSPcjs.fullSelection; exports.gaussianBlur = _chunkAEAAN4ADcjs.gaussianBlur; exports.geometryHomography = _chunkPMEHFHSPcjs.geometryHomography; exports.getAnnotationBounds = _chunkPMEHFHSPcjs.getAnnotationBounds; exports.getControlPath = getControlPath; exports.getCropCursor = _chunkPMEHFHSPcjs.getCropCursor; exports.getRotatedSize = _chunkPMEHFHSPcjs.getRotatedSize; exports.getViewportMetrics = _chunkPMEHFHSPcjs.getViewportMetrics; exports.getViewportProjection = _chunkPMEHFHSPcjs.getViewportProjection; exports.globalImageCache = globalImageCache; exports.gradientDabColor = _chunk3T5O225Tcjs.gradientDabColor; exports.grainCatch = _chunk3T5O225Tcjs.grainCatch; exports.grainHeights = _chunk3T5O225Tcjs.grainHeights; exports.greyMorphology = _chunkPMEHFHSPcjs.greyMorphology; exports.groupLayers = _chunkPMEHFHSPcjs.groupLayers; exports.guidePlanes = guidePlanes; exports.guidedFilterColor = guidedFilterColor; exports.handlePaintShortcut = handlePaintShortcut; exports.hasActiveEffects = _chunkAEAAN4ADcjs.hasActiveEffects; exports.hasResampledLegacyMask = _chunkPMEHFHSPcjs.hasResampledLegacyMask; exports.hasSurface = _chunkPMEHFHSPcjs.hasSurface; exports.hasWarp = _chunkPMEHFHSPcjs.hasWarp; exports.hash2 = _chunk3T5O225Tcjs.hash2; exports.hashMaskContent = _chunkPMEHFHSPcjs.hashMaskContent; exports.hashNoise = _chunkAEAAN4ADcjs.hashNoise; exports.healPixels = _chunkVEHVXRJUcjs.healPixels; exports.hexToPaintRgb = _chunk3T5O225Tcjs.hexToPaintRgb; exports.hexToRgb = _chunkPMEHFHSPcjs.hexToRgb; exports.histogramPath = histogramPath; exports.hitTestAnnotation = _chunkPMEHFHSPcjs.hitTestAnnotation; exports.hitTestCrop = _chunkPMEHFHSPcjs.hitTestCrop; exports.hitTestCurvePoint = hitTestCurvePoint; exports.homographyFromAffine = _chunkMUUXNRU4cjs.homographyFromAffine; exports.homographyFromPoints = _chunkMUUXNRU4cjs.homographyFromPoints; exports.hslToRgb = _chunkPMEHFHSPcjs.hslToRgb; exports.hueRange = hueRange; exports.hueRangeTables = _chunkPMEHFHSPcjs.hueRangeTables; exports.hueRangeWeight = _chunkPMEHFHSPcjs.hueRangeWeight; exports.hueSaturation = _chunkPMEHFHSPcjs.hueSaturation; exports.identityCurve = _chunkPMEHFHSPcjs.identityCurve; exports.identityLevels = _chunkPMEHFHSPcjs.identityLevels; exports.identityTransform = _chunkPMEHFHSPcjs.identityTransform; exports.identityWarpMesh = _chunkXFXHA5MUcjs.identityWarpMesh; exports.imageEditorStateMigrations = imageEditorStateMigrations; exports.imageLayerAppliedEffects = imageLayerAppliedEffects; exports.imageToCanvasPoint = _chunkPMEHFHSPcjs.imageToCanvasPoint; exports.importPsd = _chunkPMEHFHSPcjs.importPsd; exports.inflate = _chunk643B2HKCcjs.inflate; exports.inflateRaw = _chunk643B2HKCcjs.inflateRaw; exports.insertCurvePoint = insertCurvePoint; exports.insertLayer = _chunkAEAAN4ADcjs.insertLayer; exports.instancesOf = _chunkPMEHFHSPcjs.instancesOf; exports.invertHomography = _chunkMUUXNRU4cjs.invertHomography; exports.invertMatrix3 = _chunkPMEHFHSPcjs.invertMatrix3; exports.invertSelection = _chunkPMEHFHSPcjs.invertSelection; exports.isActiveFilter = _chunkPMEHFHSPcjs.isActiveFilter; exports.isAdjustmentKind = _chunkPMEHFHSPcjs.isAdjustmentKind; exports.isBitDepth = _chunkO7LUD7MHcjs.isBitDepth; exports.isBlendMode = _chunkO7LUD7MHcjs.isBlendMode; exports.isBrushstrokeBrush = _chunk3T5O225Tcjs.isBrushstrokeBrush; exports.isContentsDecoded = _chunkPMEHFHSPcjs.isContentsDecoded; exports.isDefaultDepthMask = _chunkPMEHFHSPcjs.isDefaultDepthMask; exports.isGradientPaint = _chunk3T5O225Tcjs.isGradientPaint; exports.isIdentityCloneTransform = _chunkVEHVXRJUcjs.isIdentityCloneTransform; exports.isIdentityTransform = _chunkPMEHFHSPcjs.isIdentityTransform; exports.isInterpolation = _chunkAEAAN4ADcjs.isInterpolation; exports.isLayerEffectKind = _chunkAEAAN4ADcjs.isLayerEffectKind; exports.isLayerLocked = _chunkAEAAN4ADcjs.isLayerLocked; exports.isLegacyShape = _chunkPMEHFHSPcjs.isLegacyShape; exports.isPaintTool = isPaintTool; exports.isPainterlyBlendMode = _chunkO7LUD7MHcjs.isPainterlyBlendMode; exports.isPng = _chunkO7LUD7MHcjs.isPng; exports.isQuarterTurn = isQuarterTurn; exports.isQuarterTurnSwapped = _chunkPMEHFHSPcjs.isQuarterTurnSwapped; exports.isRenderedLayer = _chunkPMEHFHSPcjs.isRenderedLayer; exports.isRetouchPaintTool = isRetouchPaintTool; exports.isRetouchTool = isRetouchTool; exports.isSelectionEmpty = _chunkPMEHFHSPcjs.isSelectionEmpty; exports.isSelectionMode = _chunkPMEHFHSPcjs.isSelectionMode; exports.isSeparableBlendMode = _chunkO7LUD7MHcjs.isSeparableBlendMode; exports.isSmartSurfaceIncomplete = _chunkPMEHFHSPcjs.isSmartSurfaceIncomplete; exports.isSpatialFilter = _chunkPMEHFHSPcjs.isSpatialFilter; exports.isSrgb = isSrgb; exports.isTransformAnchor = _chunkPMEHFHSPcjs.isTransformAnchor; exports.isValidWarp = _chunkPMEHFHSPcjs.isValidWarp; exports.keepDeepSamples = _chunkO7LUD7MHcjs.keepDeepSamples; exports.kelvinToTemperature = _chunkPMEHFHSPcjs.kelvinToTemperature; exports.keysWeight = _chunkAEAAN4ADcjs.keysWeight; exports.latticeViscosity = _chunkF2Y4E4GUcjs.latticeViscosity; exports.layerBadge = layerBadge; exports.layerEffectControls = layerEffectControls; exports.layerEffectFields = _chunkAEAAN4ADcjs.layerEffectFields; exports.layerEffectLabel = _chunkAEAAN4ADcjs.layerEffectLabel; exports.layerEffectsBadge = layerEffectsBadge; exports.layerEffectsOf = _chunkPMEHFHSPcjs.layerEffectsOf; exports.layerEffectsPanel = layerEffectsPanel; exports.layerHasThumbnail = layerHasThumbnail; exports.layerLabel = layerLabel; exports.layerMaskCoverage = _chunkPMEHFHSPcjs.layerMaskCoverage; exports.layerMaskFromSelection = _chunkPMEHFHSPcjs.layerMaskFromSelection; exports.layerMaskKey = _chunkPMEHFHSPcjs.layerMaskKey; exports.layerMenu = layerMenu; exports.layerName = _chunkPMEHFHSPcjs.layerName; exports.layerPanelRows = layerPanelRows; exports.layerTree = _chunkPMEHFHSPcjs.layerTree; exports.layerTypeLabel = _chunkPMEHFHSPcjs.layerTypeLabel; exports.layerWarning = layerWarning; exports.layersFromLegacy = _chunkPMEHFHSPcjs.layersFromLegacy; exports.layoutText = _chunkXFXHA5MUcjs.layoutText; exports.legacyAdjustmentLayer = _chunkPMEHFHSPcjs.legacyAdjustmentLayer; exports.legacyMaskOf = _chunkPMEHFHSPcjs.legacyMaskOf; exports.legacyView = _chunkPMEHFHSPcjs.legacyView; exports.lerpPigment = _chunkO7LUD7MHcjs.lerpPigment; exports.lerpPigmentInto = _chunkO7LUD7MHcjs.lerpPigmentInto; exports.levelsValue = _chunkPMEHFHSPcjs.levelsValue; exports.linearSrgbToXy = _chunkPMEHFHSPcjs.linearSrgbToXy; exports.linearToSrgb = _chunkPMEHFHSPcjs.linearToSrgb; exports.linearToSrgb8 = _chunkF2Y4E4GUcjs.linearToSrgb8; exports.liveComponent = _chunkPMEHFHSPcjs.liveComponent; exports.liveShapeForDrag = liveShapeForDrag; exports.liveShapeSubpaths = _chunkPMEHFHSPcjs.liveShapeSubpaths; exports.loadImageEditorDocument = loadImageEditorDocument; exports.loadMixer = _chunk3T5O225Tcjs.loadMixer; exports.loadOpenTypeFont = _chunk2OJACTPRcjs.loadOpenTypeFont; exports.loadWetKernel = _chunkF2Y4E4GUcjs.loadWetKernel; exports.luma = _chunkVEHVXRJUcjs.luma; exports.magicWand = magicWand; exports.mapCropHandle = _chunkPMEHFHSPcjs.mapCropHandle; exports.mapLayer = _chunkAEAAN4ADcjs.mapLayer; exports.mapSubpaths = _chunkPMEHFHSPcjs.mapSubpaths; exports.maskBounds = _chunkVEHVXRJUcjs.maskBounds; exports.maskSummary = maskSummary; exports.matrixFromCorners = _chunkPMEHFHSPcjs.matrixFromCorners; exports.matrixFromParams = _chunkPMEHFHSPcjs.matrixFromParams; exports.membraneFill = _chunkVEHVXRJUcjs.membraneFill; exports.mergeLayerEffect = _chunkAEAAN4ADcjs.mergeLayerEffect; exports.mergeShapeComponents = _chunkPMEHFHSPcjs.mergeShapeComponents; exports.migrateSerializedImageEditorState = migrateSerializedImageEditorState; exports.migrateToLayeredState = migrateToLayeredState; exports.mix32 = _chunk3T5O225Tcjs.mix32; exports.mixPigment8 = _chunkO7LUD7MHcjs.mixPigment8; exports.mixPigmentRgb = _chunkO7LUD7MHcjs.mixPigmentRgb; exports.mixPigments = _chunkO7LUD7MHcjs.mixPigments; exports.mixerLoadResult = mixerLoadResult; exports.mixerRates = _chunk3T5O225Tcjs.mixerRates; exports.modifySelection = _chunkPMEHFHSPcjs.modifySelection; exports.moveCurvePoint = moveCurvePoint; exports.moveLayer = _chunkPMEHFHSPcjs.moveLayer; exports.moveSmartFilter = _chunkPMEHFHSPcjs.moveSmartFilter; exports.mulMatrix3 = _chunkPMEHFHSPcjs.mulMatrix3; exports.needsLegacyBase = needsLegacyBase; exports.neutralHueRange = _chunkPMEHFHSPcjs.neutralHueRange; exports.newContentsId = _chunkPMEHFHSPcjs.newContentsId; exports.newEffectId = _chunkAEAAN4ADcjs.newEffectId; exports.newLayerId = _chunkPMEHFHSPcjs.newLayerId; exports.normalizeAdjustmentLayer = _chunkPMEHFHSPcjs.normalizeAdjustmentLayer; exports.normalizeAdjustmentLayers = _chunkPMEHFHSPcjs.normalizeAdjustmentLayers; exports.normalizeAngle = _chunkPMEHFHSPcjs.normalizeAngle; exports.normalizeBlendMode = _chunkO7LUD7MHcjs.normalizeBlendMode; exports.normalizeBlender = _chunk3T5O225Tcjs.normalizeBlender; exports.normalizeBrush = _chunk3T5O225Tcjs.normalizeBrush; exports.normalizeFilter = _chunkPMEHFHSPcjs.normalizeFilter; exports.normalizeFlow = _chunkF2Y4E4GUcjs.normalizeFlow; exports.normalizeHexColor = _chunk3T5O225Tcjs.normalizeHexColor; exports.normalizeLayerEffects = _chunkAEAAN4ADcjs.normalizeLayerEffects; exports.normalizeLayerMask = _chunkPMEHFHSPcjs.normalizeLayerMask; exports.normalizeLiveShape = _chunkPMEHFHSPcjs.normalizeLiveShape; exports.normalizeMixer = _chunk3T5O225Tcjs.normalizeMixer; exports.normalizePlacement = _chunkPMEHFHSPcjs.normalizePlacement; exports.normalizeProcessVersion = _chunkPMEHFHSPcjs.normalizeProcessVersion; exports.normalizeRect = normalizeRect; exports.normalizeRefineEdgeParams = normalizeRefineEdgeParams; exports.normalizeRetouch = _chunkVEHVXRJUcjs.normalizeRetouch; exports.normalizeShapePaint = _chunkPMEHFHSPcjs.normalizeShapePaint; exports.normalizeShapeStroke = _chunkPMEHFHSPcjs.normalizeShapeStroke; exports.normalizeSmartFilter = _chunkPMEHFHSPcjs.normalizeSmartFilter; exports.normalizeSmudge = _chunk3T5O225Tcjs.normalizeSmudge; exports.normalizeStoredAdjustments = normalizeStoredAdjustments; exports.normalizeSubpaths = _chunkPMEHFHSPcjs.normalizeSubpaths; exports.normalizeText = _chunkPMEHFHSPcjs.normalizeText; exports.normalizeTilt = _chunkF2Y4E4GUcjs.normalizeTilt; exports.normalizeWetParams = _chunkF2Y4E4GUcjs.normalizeWetParams; exports.offsetLayer = _chunkPMEHFHSPcjs.offsetLayer; exports.offsetShape = _chunkPMEHFHSPcjs.offsetShape; exports.offsetSmartObject = _chunkPMEHFHSPcjs.offsetSmartObject; exports.openPsdFile = openPsdFile; exports.packRgba = _chunkO7LUD7MHcjs.packRgba; exports.packWetParams = _chunkF2Y4E4GUcjs.packWetParams; exports.paintGradientMappingFor = _chunk3T5O225Tcjs.paintGradientMappingFor; exports.paintPathStroke = _chunk3T5O225Tcjs.paintPathStroke; exports.paintSourceColor = _chunk3T5O225Tcjs.paintSourceColor; exports.paintSourceCss = _chunk3T5O225Tcjs.paintSourceCss; exports.paragraphRanges = _chunkXFXHA5MUcjs.paragraphRanges; exports.parseAdjustmentBlock = _chunkPMEHFHSPcjs.parseAdjustmentBlock; exports.parseBlend = _chunkPMEHFHSPcjs.parseBlend; exports.parseColor = parseColor; exports.parseCssColor = _chunk2YQONY6Gcjs.parseCssColor; exports.parseDataUrl = _chunkO7LUD7MHcjs.parseDataUrl; exports.parseEffectColor = _chunkAEAAN4ADcjs.parseEffectColor; exports.parseLfx2 = _chunkPMEHFHSPcjs.parseLfx2; exports.parseLrfx = _chunkPMEHFHSPcjs.parseLrfx; exports.parseOpenTypeFont = _chunk2OJACTPRcjs.parseOpenTypeFont; exports.parsePaintSource = _chunk3T5O225Tcjs.parsePaintSource; exports.parsePatternBlock = _chunkPMEHFHSPcjs.parsePatternBlock; exports.parseSelectionMode = _chunkPMEHFHSPcjs.parseSelectionMode; exports.parseVersionedDescriptor = _chunkPMEHFHSPcjs.parseVersionedDescriptor; exports.patchParagraphStyle = _chunkPMEHFHSPcjs.patchParagraphStyle; exports.patchTextStyle = _chunkPMEHFHSPcjs.patchTextStyle; exports.pathStrokeCoverage = _chunk3T5O225Tcjs.pathStrokeCoverage; exports.pathStrokeDabs = _chunk3T5O225Tcjs.pathStrokeDabs; exports.perDabStrength = _chunkVEHVXRJUcjs.perDabStrength; exports.photoFilterMatrix = _chunkPMEHFHSPcjs.photoFilterMatrix; exports.pigment8 = _chunkO7LUD7MHcjs.pigment8; exports.pigmentColor = _chunkF2Y4E4GUcjs.pigmentColor; exports.pigmentOf = _chunkF2Y4E4GUcjs.pigmentOf; exports.pixelLayerBounds = _chunkPMEHFHSPcjs.pixelLayerBounds; exports.pixelLayers = _chunkPMEHFHSPcjs.pixelLayers; exports.pixelPigment = _chunkF2Y4E4GUcjs.pixelPigment; exports.placeContents = _chunkPMEHFHSPcjs.placeContents; exports.placeLayer = _chunkPMEHFHSPcjs.placeLayer; exports.placementAt = _chunkPMEHFHSPcjs.placementAt; exports.placementBounds = _chunkPMEHFHSPcjs.placementBounds; exports.placementGeometry = _chunkPMEHFHSPcjs.placementGeometry; exports.pngDataUrl = _chunkO7LUD7MHcjs.pngDataUrl; exports.pointerPressure = _chunkF2Y4E4GUcjs.pointerPressure; exports.pointerStrokeSample = _chunkF2Y4E4GUcjs.pointerStrokeSample; exports.pointerStrokeSamples = _chunkF2Y4E4GUcjs.pointerStrokeSamples; exports.polygonCoverage = polygonCoverage; exports.polygonSelection = polygonSelection; exports.posterizeValue = _chunkPMEHFHSPcjs.posterizeValue; exports.presetWarp = _chunkPMEHFHSPcjs.presetWarp; exports.previewStep = previewStep; exports.profileBytes = profileBytes; exports.projectImagePoint = _chunkPMEHFHSPcjs.projectImagePoint; exports.projectImageRect = _chunkPMEHFHSPcjs.projectImageRect; exports.projectMaskCoverage = _chunkPMEHFHSPcjs.projectMaskCoverage; exports.projectQuarterTurn = projectQuarterTurn; exports.proxyOf = _chunkO7LUD7MHcjs.proxyOf; exports.psdBytesFromBase64 = psdBytesFromBase64; exports.psdFileName = psdFileName; exports.psdPatternToEffectPattern = _chunkPMEHFHSPcjs.psdPatternToEffectPattern; exports.psdToLayers = _chunkPMEHFHSPcjs.psdToLayers; exports.pullWarpMesh = _chunkXFXHA5MUcjs.pullWarpMesh; exports.put255 = _chunk3T5O225Tcjs.put255; exports.quickMaskPixels = quickMaskPixels; exports.rand01 = _chunk3T5O225Tcjs.rand01; exports.randSigned = _chunk3T5O225Tcjs.randSigned; exports.rangeLightness = _chunkPMEHFHSPcjs.rangeLightness; exports.rasterContents = _chunkPMEHFHSPcjs.rasterContents; exports.rasterMaskFromLegacy = _chunkPMEHFHSPcjs.rasterMaskFromLegacy; exports.rasterizeCoverage = _chunkPMEHFHSPcjs.rasterizeCoverage; exports.rasterizeDab = _chunk3T5O225Tcjs.rasterizeDab; exports.rasterizeSmartObject = _chunkPMEHFHSPcjs.rasterizeSmartObject; exports.readAdjustmentControls = readAdjustmentControls; exports.readDeepRegion = _chunkO7LUD7MHcjs.readDeepRegion; exports.readPaintSource = _chunk3T5O225Tcjs.readPaintSource; exports.readPixel = _chunkO7LUD7MHcjs.readPixel; exports.readPsd = _chunkPMEHFHSPcjs.readPsd; exports.readRegion = _chunkO7LUD7MHcjs.readRegion; exports.readSourceRegion = _chunkVEHVXRJUcjs.readSourceRegion; exports.rectSelection = rectSelection; exports.rectToQuad = _chunkMUUXNRU4cjs.rectToQuad; exports.reduceSurface = _chunkAEAAN4ADcjs.reduceSurface; exports.referencePoint = _chunkPMEHFHSPcjs.referencePoint; exports.refineCoverage = refineCoverage; exports.refineEdgeHalo = refineEdgeHalo; exports.refineSelection = refineSelection; exports.reflectanceToRgb = _chunkO7LUD7MHcjs.reflectanceToRgb; exports.removeAlpha = _chunkPMEHFHSPcjs.removeAlpha; exports.removeCurvePoint = removeCurvePoint; exports.removeLayer = _chunkPMEHFHSPcjs.removeLayer; exports.removeLayerEffect = _chunkPMEHFHSPcjs.removeLayerEffect; exports.removeLayerFilter = _chunkPMEHFHSPcjs.removeLayerFilter; exports.removePaintGradientStop = _chunk3T5O225Tcjs.removePaintGradientStop; exports.removeSmartFilter = _chunkPMEHFHSPcjs.removeSmartFilter; exports.renderBrushstroke = _chunk3T5O225Tcjs.renderBrushstroke; exports.renderLayerEffects = _chunkAEAAN4ADcjs.renderLayerEffects; exports.renderLayeredBase = renderLayeredBase; exports.renderShape = _chunkPMEHFHSPcjs.renderShape; exports.renderShapeRect = _chunkPMEHFHSPcjs.renderShapeRect; exports.renderSmartObject = _chunkPMEHFHSPcjs.renderSmartObject; exports.renderText = _chunkPMEHFHSPcjs.renderText; exports.replaceContents = _chunkPMEHFHSPcjs.replaceContents; exports.replaceTextRange = _chunkPMEHFHSPcjs.replaceTextRange; exports.requireLayer = _chunkPMEHFHSPcjs.requireLayer; exports.requireOperation = _chunkPMEHFHSPcjs.requireOperation; exports.requireShapeLayer = _chunkPMEHFHSPcjs.requireShapeLayer; exports.requireSmartObject = _chunkPMEHFHSPcjs.requireSmartObject; exports.requireTypeLayer = _chunkPMEHFHSPcjs.requireTypeLayer; exports.requireUnlocked = _chunkPMEHFHSPcjs.requireUnlocked; exports.rerender = _chunkPMEHFHSPcjs.rerender; exports.rerenderShape = _chunkPMEHFHSPcjs.rerenderShape; exports.rerenderText = _chunkPMEHFHSPcjs.rerenderText; exports.resizePixels = resizePixels; exports.resizeSelection = _chunkPMEHFHSPcjs.resizeSelection; exports.resizeWarpMesh = _chunkXFXHA5MUcjs.resizeWarpMesh; exports.resolveExternalAssets = _chunkPMEHFHSPcjs.resolveExternalAssets; exports.resolveMosaicRegionBounds = resolveMosaicRegionBounds; exports.resolvePaintGradient = _chunk3T5O225Tcjs.resolvePaintGradient; exports.resolveProfile = resolveProfile; exports.restyleRange = _chunkXFXHA5MUcjs.restyleRange; exports.retouchFilter = _chunkVEHVXRJUcjs.retouchFilter; exports.reversePaintGradient = _chunk3T5O225Tcjs.reversePaintGradient; exports.rgbToGray = _chunkPMEHFHSPcjs.rgbToGray; exports.rgbToHsl = _chunkPMEHFHSPcjs.rgbToHsl; exports.rgbToReflectance = _chunkO7LUD7MHcjs.rgbToReflectance; exports.rgbUnitToHex = rgbUnitToHex; exports.rgbaViewOfGrey = _chunkVEHVXRJUcjs.rgbaViewOfGrey; exports.runLayerFilters = _chunkPMEHFHSPcjs.runLayerFilters; exports.runLayerFiltersFloat = _chunkPMEHFHSPcjs.runLayerFiltersFloat; exports.runLayerMenuAction = runLayerMenuAction; exports.sampleLut = _chunkPMEHFHSPcjs.sampleLut; exports.sampleToneLut = _chunkPMEHFHSPcjs.sampleToneLut; exports.saturationOf = _chunkVEHVXRJUcjs.saturationOf; exports.scaleLayerEffect = _chunkAEAAN4ADcjs.scaleLayerEffect; exports.scalePaintGradient = _chunk3T5O225Tcjs.scalePaintGradient; exports.seamlessClone = _chunkVEHVXRJUcjs.seamlessClone; exports.seedFromString = _chunk3T5O225Tcjs.seedFromString; exports.selectionArea = _chunkPMEHFHSPcjs.selectionArea; exports.selectionFromCoverage = _chunkPMEHFHSPcjs.selectionFromCoverage; exports.selectionFromPixels = _chunkPMEHFHSPcjs.selectionFromPixels; exports.selectionModeFromModifiers = selectionModeFromModifiers; exports.selectionOutline = selectionOutline; exports.selectionToCoverage = _chunkPMEHFHSPcjs.selectionToCoverage; exports.selectionToPixels = _chunkPMEHFHSPcjs.selectionToPixels; exports.selectionValueAt = _chunkPMEHFHSPcjs.selectionValueAt; exports.serializeColorMode = serializeColorMode; exports.serializeColorProfile = serializeColorProfile; exports.serializeContents = _chunkPMEHFHSPcjs.serializeContents; exports.serializeEffects = _chunkPMEHFHSPcjs.serializeEffects; exports.serializeLayer = _chunkPMEHFHSPcjs.serializeLayer; exports.serializeLayers = _chunkPMEHFHSPcjs.serializeLayers; exports.serializeLayersExternal = _chunkPMEHFHSPcjs.serializeLayersExternal; exports.serializePatterns = _chunkPMEHFHSPcjs.serializePatterns; exports.serializeSelection = _chunkPMEHFHSPcjs.serializeSelection; exports.setCloneTransformValue = setCloneTransformValue; exports.setControlPath = setControlPath; exports.setLayerEffects = _chunkPMEHFHSPcjs.setLayerEffects; exports.setLayerEffectsEnabled = _chunkPMEHFHSPcjs.setLayerEffectsEnabled; exports.setLayerMask = _chunkPMEHFHSPcjs.setLayerMask; exports.setLayerProperties = _chunkPMEHFHSPcjs.setLayerProperties; exports.setLum = _chunkO7LUD7MHcjs.setLum; exports.setPigmentColor = _chunkO7LUD7MHcjs.setPigmentColor; exports.setRetouchChoice = setRetouchChoice; exports.setSmartFilterMask = _chunkPMEHFHSPcjs.setSmartFilterMask; exports.setSmartFiltersEnabled = _chunkPMEHFHSPcjs.setSmartFiltersEnabled; exports.setSmartPlacement = _chunkPMEHFHSPcjs.setSmartPlacement; exports.shadeTile = _chunkF2Y4E4GUcjs.shadeTile; exports.shapeAsPixelLayer = _chunkPMEHFHSPcjs.shapeAsPixelLayer; exports.shapeFromAnnotation = _chunkPMEHFHSPcjs.shapeFromAnnotation; exports.shapeGeometryBounds = _chunkPMEHFHSPcjs.shapeGeometryBounds; exports.shapeLayers = _chunkPMEHFHSPcjs.shapeLayers; exports.shapeOutline = _chunkPMEHFHSPcjs.shapeOutline; exports.shapeRenderClip = _chunkPMEHFHSPcjs.shapeRenderClip; exports.shiftCoverage = _chunkPMEHFHSPcjs.shiftCoverage; exports.smartFilterRows = smartFilterRows; exports.smartObjectLayers = _chunkPMEHFHSPcjs.smartObjectLayers; exports.smoothCoverage = _chunkPMEHFHSPcjs.smoothCoverage; exports.smoothPoints = _chunk3T5O225Tcjs.smoothPoints; exports.smudgeEffect = _chunkVEHVXRJUcjs.smudgeEffect; exports.solidPaint = _chunk3T5O225Tcjs.solidPaint; exports.solidSurface = _chunkO7LUD7MHcjs.solidSurface; exports.solveMembrane = _chunkVEHVXRJUcjs.solveMembrane; exports.spliceRuns = _chunkXFXHA5MUcjs.spliceRuns; exports.splitOverlayAnnotations = splitOverlayAnnotations; exports.sponge = _chunkVEHVXRJUcjs.sponge; exports.spongeEffect = _chunkVEHVXRJUcjs.spongeEffect; exports.spotHealPixels = _chunkVEHVXRJUcjs.spotHealPixels; exports.spotHealWindow = _chunkVEHVXRJUcjs.spotHealWindow; exports.srgb8ToLab = srgb8ToLab; exports.srgbByteToLinear = _chunkF2Y4E4GUcjs.srgbByteToLinear; exports.srgbDecode = _chunkO7LUD7MHcjs.srgbDecode; exports.srgbEncode = _chunkO7LUD7MHcjs.srgbEncode; exports.srgbToLinear = _chunkPMEHFHSPcjs.srgbToLinear; exports.standardBlendMode = _chunkO7LUD7MHcjs.standardBlendMode; exports.stepSlotTs = _chunkF2Y4E4GUcjs.stepSlotTs; exports.strokeGrainCatch = _chunk3T5O225Tcjs.strokeGrainCatch; exports.styleAt = _chunkXFXHA5MUcjs.styleAt; exports.sumHistograms = sumHistograms; exports.surfaceBytes = _chunkO7LUD7MHcjs.surfaceBytes; exports.surfaceDepth = _chunkO7LUD7MHcjs.surfaceDepth; exports.surfaceFromDeepPixels = _chunkO7LUD7MHcjs.surfaceFromDeepPixels; exports.surfaceFromPixels = _chunkO7LUD7MHcjs.surfaceFromPixels; exports.surfacesEqual = _chunkO7LUD7MHcjs.surfacesEqual; exports.tempTintToXy = _chunkPMEHFHSPcjs.tempTintToXy; exports.temperatureToKelvin = _chunkPMEHFHSPcjs.temperatureToKelvin; exports.textIndexAt = _chunkXFXHA5MUcjs.textIndexAt; exports.textMatrix = _chunkPMEHFHSPcjs.textMatrix; exports.textOutlines = _chunkPMEHFHSPcjs.textOutlines; exports.textRange = _chunkPMEHFHSPcjs.textRange; exports.tileCoord = _chunkO7LUD7MHcjs.tileCoord; exports.tileKey = _chunkO7LUD7MHcjs.tileKey; exports.tileRect = _chunkO7LUD7MHcjs.tileRect; exports.tileSamples = _chunkO7LUD7MHcjs.tileSamples; exports.tileSamples16 = _chunkO7LUD7MHcjs.tileSamples16; exports.tileSamples32 = _chunkO7LUD7MHcjs.tileSamples32; exports.tilesInRect = _chunkO7LUD7MHcjs.tilesInRect; exports.tipFalloff = _chunk3T5O225Tcjs.tipFalloff; exports.tipReach = _chunk3T5O225Tcjs.tipReach; exports.tipShape = _chunk3T5O225Tcjs.tipShape; exports.to16From32 = _chunkO7LUD7MHcjs.to16From32; exports.to16From8 = _chunkO7LUD7MHcjs.to16From8; exports.to32From16 = _chunkO7LUD7MHcjs.to32From16; exports.to32From8 = _chunkO7LUD7MHcjs.to32From8; exports.to8From16 = _chunkO7LUD7MHcjs.to8From16; exports.to8From32 = _chunkO7LUD7MHcjs.to8From32; exports.toHex = toHex; exports.toTextSpace = _chunkPMEHFHSPcjs.toTextSpace; exports.toneCurve = _chunkPMEHFHSPcjs.toneCurve; exports.toneLuts = _chunkPMEHFHSPcjs.toneLuts; exports.toneOf = _chunkVEHVXRJUcjs.toneOf; exports.toneRange = toneRange; exports.transformHomography = _chunkPMEHFHSPcjs.transformHomography; exports.transformMap = _chunkPMEHFHSPcjs.transformMap; exports.transformShapeComponents = _chunkPMEHFHSPcjs.transformShapeComponents; exports.transformSurface = _chunkAEAAN4ADcjs.transformSurface; exports.transformTypeLayer = _chunkPMEHFHSPcjs.transformTypeLayer; exports.transformedBounds = _chunkAEAAN4ADcjs.transformedBounds; exports.transformedBox = _chunkPMEHFHSPcjs.transformedBox; exports.transformedPoint = _chunkPMEHFHSPcjs.transformedPoint; exports.translateSurface = _chunkO7LUD7MHcjs.translateSurface; exports.typeAsPixelLayer = _chunkPMEHFHSPcjs.typeAsPixelLayer; exports.typeFrame = _chunkPMEHFHSPcjs.typeFrame; exports.typeFromAnnotation = _chunkPMEHFHSPcjs.typeFromAnnotation; exports.typeLayerAt = typeLayerAt; exports.typeLayerName = _chunkPMEHFHSPcjs.typeLayerName; exports.ungroupLayer = _chunkPMEHFHSPcjs.ungroupLayer; exports.uniformTile = _chunkO7LUD7MHcjs.uniformTile; exports.unionRect = _chunkPMEHFHSPcjs.unionRect; exports.unprojectCanvasPoint = _chunkPMEHFHSPcjs.unprojectCanvasPoint; exports.updateLayerEffect = _chunkPMEHFHSPcjs.updateLayerEffect; exports.updateLayerFilter = _chunkPMEHFHSPcjs.updateLayerFilter; exports.updateLayerMaskProps = _chunkPMEHFHSPcjs.updateLayerMaskProps; exports.updatePaintGradientStop = _chunk3T5O225Tcjs.updatePaintGradientStop; exports.updateShapeLayer = _chunkPMEHFHSPcjs.updateShapeLayer; exports.updateSmartFilter = _chunkPMEHFHSPcjs.updateSmartFilter; exports.updateTypeLayer = _chunkPMEHFHSPcjs.updateTypeLayer; exports.uvToXy = _chunkPMEHFHSPcjs.uvToXy; exports.validateEffectGradient = _chunkAEAAN4ADcjs.validateEffectGradient; exports.validateLayerEffect = _chunkAEAAN4ADcjs.validateLayerEffect; exports.validateLayerEffects = _chunkAEAAN4ADcjs.validateLayerEffects; exports.versionedDescriptorBytes = _chunkPMEHFHSPcjs.versionedDescriptorBytes; exports.vibranceLinear = _chunkPMEHFHSPcjs.vibranceLinear; exports.vibrancePixel = _chunkPMEHFHSPcjs.vibrancePixel; exports.walkDabs = _chunk3T5O225Tcjs.walkDabs; exports.warpMeshEditPoints = _chunkXFXHA5MUcjs.warpMeshEditPoints; exports.warpMeshGridCurves = _chunkXFXHA5MUcjs.warpMeshGridCurves; exports.warpMeshParamAt = _chunkXFXHA5MUcjs.warpMeshParamAt; exports.warpPresetMesh = _chunkXFXHA5MUcjs.warpPresetMesh; exports.warpSurface = _chunkAEAAN4ADcjs.warpSurface; exports.wbMatrix = _chunkPMEHFHSPcjs.wbMatrix; exports.wetGpuSupport = _chunkF2Y4E4GUcjs.wetGpuSupport; exports.wetSimdSupported = _chunkF2Y4E4GUcjs.wetSimdSupported; exports.wetSupport = _chunkF2Y4E4GUcjs.wetSupport; exports.whiteBalanceFromSample = _chunkPMEHFHSPcjs.whiteBalanceFromSample; exports.whiteBalanceMatrix = _chunkPMEHFHSPcjs.whiteBalanceMatrix; exports.withFilterMaskSurface = _chunkPMEHFHSPcjs.withFilterMaskSurface; exports.withNewIds = _chunkPMEHFHSPcjs.withNewIds; exports.writeAdjustmentBlock = _chunkPMEHFHSPcjs.writeAdjustmentBlock; exports.writeDeepRegion = _chunkO7LUD7MHcjs.writeDeepRegion; exports.writeLfx2 = _chunkPMEHFHSPcjs.writeLfx2; exports.writePatternBlock = _chunkPMEHFHSPcjs.writePatternBlock; exports.writePsd = _chunkPMEHFHSPcjs.writePsd; exports.writeRegion = _chunkO7LUD7MHcjs.writeRegion; exports.xyToTempTint = _chunkPMEHFHSPcjs.xyToTempTint; exports.xyToUv = _chunkPMEHFHSPcjs.xyToUv;
16010
16028
  //# sourceMappingURL=index.cjs.map