@pixerate/editor 0.217.0 → 0.218.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.
@@ -45,7 +45,9 @@ require('../chunk-K6PXS6DO.cjs');
45
45
 
46
46
 
47
47
 
48
- var _chunkKWNMBMKGcjs = require('../chunk-KWNMBMKG.cjs');
48
+
49
+
50
+ var _chunkXFYLA3ZOcjs = require('../chunk-XFYLA3ZO.cjs');
49
51
  require('../chunk-BROJYMWU.cjs');
50
52
 
51
53
 
@@ -613,10 +615,10 @@ function lightTile(color, height, heightAround, material, light) {
613
615
  const nh = Math.max(0, nx * hx + ny * hy + nz * hz);
614
616
  const spec = Math.max(0, Math.pow(nh, shininess) - Math.pow(hz, shininess)) * (0.25 + 0.75 * gloss) * light.relief;
615
617
  for (let c = 0; c < 3; c++) {
616
- const a = _chunkKWNMBMKGcjs.SRGB_TO_LINEAR[color[i + c]];
618
+ const a = _chunkXFYLA3ZOcjs.SRGB_TO_LINEAR[color[i + c]];
617
619
  const tint = metal * a + (1 - metal);
618
620
  const v = a * shade * (1 - 0.35 * metal) + spec * tint * (1 + metal);
619
- out[i + c] = _chunkKWNMBMKGcjs.linearToSrgb8.call(void 0, v);
621
+ out[i + c] = _chunkXFYLA3ZOcjs.linearToSrgb8.call(void 0, v);
620
622
  }
621
623
  }
622
624
  }
@@ -1791,7 +1793,7 @@ function viewPenToDocument(view, p) {
1791
1793
 
1792
1794
  // src/paint-editor/input.ts
1793
1795
  function samplePressure(e) {
1794
- return _chunkKWNMBMKGcjs.pointerPressure.call(void 0, e);
1796
+ return _chunkXFYLA3ZOcjs.pointerPressure.call(void 0, e);
1795
1797
  }
1796
1798
  function pointerToPenPoint(e, x, y, view) {
1797
1799
  const p = { x, y, pressure: samplePressure(e) };
@@ -1861,7 +1863,7 @@ function downloadBytes(bytes, fileName, mimeType) {
1861
1863
 
1862
1864
  // src/paint-editor/wet.ts
1863
1865
  var STROKE_WATER = 0.9;
1864
- var STROKE_MASS = _chunkKWNMBMKGcjs.PIGMENT_UNIT * 2.5;
1866
+ var STROKE_MASS = _chunkXFYLA3ZOcjs.PIGMENT_UNIT * 2.5;
1865
1867
  var COVERAGE_STEPS = 4096;
1866
1868
  function union2(a, b) {
1867
1869
  if (!a) return { ...b };
@@ -1890,7 +1892,7 @@ var WetStrokeDriver = (_class5 = class {
1890
1892
  const spacing = Math.max(0.02, brush.tip.spacing);
1891
1893
  const perDab = Math.min(1, spacing * 1.2);
1892
1894
  const thin = wet.thinner;
1893
- this.medium = new (0, _chunkKWNMBMKGcjs.WetMedium)(init.world, init.laneId, {
1895
+ this.medium = new (0, _chunkXFYLA3ZOcjs.WetMedium)(init.world, init.laneId, {
1894
1896
  water: STROKE_WATER * Math.min(1, wet.water * (1 + thin)) * perDab,
1895
1897
  mass: STROKE_MASS * wet.pigment * (1 - 0.6 * thin) * perDab,
1896
1898
  body: wet.body * (1 - thin)
@@ -2082,7 +2084,7 @@ var PaintWetLayers = (_class6 = class {
2082
2084
 
2083
2085
 
2084
2086
  __init47() {this.world = null}
2085
- __init48() {this.tilt = { ..._chunkKWNMBMKGcjs.FLAT }}
2087
+ __init48() {this.tilt = { ..._chunkXFYLA3ZOcjs.FLAT }}
2086
2088
  __init49() {this.settings = /* @__PURE__ */ new Map()}
2087
2089
  __init50() {this.paused = false}
2088
2090
  /** Wet strokes dry as soon as they end (one undo step with the stroke). */
@@ -2106,8 +2108,8 @@ var PaintWetLayers = (_class6 = class {
2106
2108
  /** Starts the GPU engine for the world (once; it may turn out unavailable). */
2107
2109
  startGpu() {
2108
2110
  if (this.gpuMode === "off" || this.gpu || this.gpuStarting || this.gpuSupport) return;
2109
- const provider = this.options.gpuProvider === void 0 ? _chunkKWNMBMKGcjs.findWebGpu.call(void 0, ) : this.options.gpuProvider;
2110
- this.gpuStarting = _chunkKWNMBMKGcjs.createWetGpuEngine.call(void 0, provider).then(({ engine, support }) => {
2111
+ const provider = this.options.gpuProvider === void 0 ? _chunkXFYLA3ZOcjs.findWebGpu.call(void 0, ) : this.options.gpuProvider;
2112
+ this.gpuStarting = _chunkXFYLA3ZOcjs.createWetGpuEngine.call(void 0, provider).then(({ engine, support }) => {
2111
2113
  this.gpuSupport = support;
2112
2114
  if (!engine) return;
2113
2115
  if (this.gpuMode === "off" || !this.world) {
@@ -2162,15 +2164,50 @@ var PaintWetLayers = (_class6 = class {
2162
2164
  if (this.world.laneIds().length) throw new Error("The wet world is the wrong size; dry the paint before resizing the canvas.");
2163
2165
  this.dropWorld();
2164
2166
  }
2165
- if (!this.world) {
2166
- this.world = new (0, _chunkKWNMBMKGcjs.WetWorld)(width, height, wetPaperInput(this.host.paper()), { kernel: this.options.kernel, threads: this.options.threads });
2167
- this.world.setTilt(this.tilt);
2168
- this.world.gpuMinTiles = this.gpuMinTiles;
2169
- if (this.gpu) this.world.attachGpu(this.gpu);
2170
- else this.startGpu();
2171
- }
2167
+ if (!this.world) this.world = this.makeWorld(width, height, this.host.paper());
2172
2168
  return this.world;
2173
2169
  }
2170
+ makeWorld(width, height, paper) {
2171
+ const world = new (0, _chunkXFYLA3ZOcjs.WetWorld)(width, height, wetPaperInput(paper), { kernel: this.options.kernel, threads: this.options.threads });
2172
+ world.setTilt(this.tilt);
2173
+ world.gpuMinTiles = this.gpuMinTiles;
2174
+ if (this.gpu) world.attachGpu(this.gpu);
2175
+ else this.startGpu();
2176
+ return world;
2177
+ }
2178
+ /**
2179
+ * Whether `extend` can keep the wet paint when the canvas grows by `left` / `top` on those
2180
+ * sides: the shift has to be whole wet tiles (256 px), and no wet stroke may be live.
2181
+ */
2182
+ canExtend(left, top) {
2183
+ return left % _chunkXFYLA3ZOcjs.WET_TILE === 0 && top % _chunkXFYLA3ZOcjs.WET_TILE === 0 && !this.driver;
2184
+ }
2185
+ /**
2186
+ * Keeps the wet paint while the canvas grows to `width`×`height` by `left` / `top` on those
2187
+ * sides (`canExtend` must hold): the world is made again at the new size with every wet layer
2188
+ * moved by (left, top), still wet, its base and flow map with it; `paper` is the new
2189
+ * document's paper (its grain moved with the paint). Wet settings' flow centres move too. The
2190
+ * caller shows the layers again (`syncDisplays`) once the document is the new size.
2191
+ */
2192
+ extend(width, height, left, top, paper) {
2193
+ if (!this.canExtend(left, top)) throw new Error("Wet paint only moves by whole 256 px tiles, between strokes.");
2194
+ for (const [id, s] of this.settings) if (s.flow.center) this.settings.set(id, { ...s, flow: { ...s.flow, center: { x: s.flow.center.x + left, y: s.flow.center.y + top } } });
2195
+ const old = this.world;
2196
+ const snap = _optionalChain([old, 'optionalAccess', _95 => _95.laneIds, 'call', _96 => _96(), 'access', _97 => _97.length]) ? old.snapshot() : null;
2197
+ this.dropWorld();
2198
+ this.lastTick = null;
2199
+ this.stepsOwed = 0;
2200
+ if (!old || !snap) return;
2201
+ const moved = _chunkXFYLA3ZOcjs.moveWetSnapshot.call(void 0, snap, old, { width, height }, left, top, (l) => {
2202
+ const flow = _optionalChain([this, 'access', _98 => _98.settings, 'access', _99 => _99.get, 'call', _100 => _100(l.id), 'optionalAccess', _101 => _101.flow]);
2203
+ return {
2204
+ base: _chunk474IQG74cjs.translateSurface.call(void 0, l.base, left, top),
2205
+ flow: l.flow && flow && flow.kind !== "none" ? _chunkXFYLA3ZOcjs.flowField.call(void 0, flow, width, height) : l.flow
2206
+ };
2207
+ });
2208
+ this.world = this.makeWorld(width, height, paper);
2209
+ this.world.restore(moved);
2210
+ }
2174
2211
  /** Whether any layer (or `layerId`) has wet paint. */
2175
2212
  isWet(layerId) {
2176
2213
  const w = this.world;
@@ -2180,11 +2217,11 @@ var PaintWetLayers = (_class6 = class {
2180
2217
  }
2181
2218
  /** Layers holding a wet layer (wet or drying). */
2182
2219
  wetLayerIds() {
2183
- return _nullishCoalesce(_optionalChain([this, 'access', _95 => _95.world, 'optionalAccess', _96 => _96.laneIds, 'call', _97 => _97()]), () => ( []));
2220
+ return _nullishCoalesce(_optionalChain([this, 'access', _102 => _102.world, 'optionalAccess', _103 => _103.laneIds, 'call', _104 => _104()]), () => ( []));
2184
2221
  }
2185
2222
  /** Whether a batch is running (edits wait). */
2186
2223
  get busy() {
2187
- return Boolean(_optionalChain([this, 'access', _98 => _98.world, 'optionalAccess', _99 => _99.busy]));
2224
+ return Boolean(_optionalChain([this, 'access', _105 => _105.world, 'optionalAccess', _106 => _106.busy]));
2188
2225
  }
2189
2226
  /** Resolves when no batch is running. */
2190
2227
  async idle() {
@@ -2193,7 +2230,7 @@ var PaintWetLayers = (_class6 = class {
2193
2230
  settingsOf(layerId, medium = "watercolor") {
2194
2231
  let s = this.settings.get(layerId);
2195
2232
  if (!s) {
2196
- s = { params: _chunkKWNMBMKGcjs.normalizeWetParams.call(void 0, WET_MEDIUM_PARAMS[medium], _chunkKWNMBMKGcjs.DEFAULT_WET_PARAMS), flow: { ..._chunkKWNMBMKGcjs.DEFAULT_FLOW } };
2233
+ s = { params: _chunkXFYLA3ZOcjs.normalizeWetParams.call(void 0, WET_MEDIUM_PARAMS[medium], _chunkXFYLA3ZOcjs.DEFAULT_WET_PARAMS), flow: { ..._chunkXFYLA3ZOcjs.DEFAULT_FLOW } };
2197
2234
  this.settings.set(layerId, s);
2198
2235
  }
2199
2236
  return s;
@@ -2206,50 +2243,50 @@ var PaintWetLayers = (_class6 = class {
2206
2243
  const s = this.settingsOf(layerId, medium);
2207
2244
  w.ensureLane(layerId, { params: s.params, base });
2208
2245
  const { width, height } = this.host.canvas();
2209
- if (s.flow.kind !== "none") w.setFlow(layerId, _chunkKWNMBMKGcjs.flowField.call(void 0, s.flow, width, height), s.flow.strength);
2246
+ if (s.flow.kind !== "none") w.setFlow(layerId, _chunkXFYLA3ZOcjs.flowField.call(void 0, s.flow, width, height), s.flow.strength);
2210
2247
  }
2211
2248
  return w;
2212
2249
  }
2213
2250
  setParams(layerId, update) {
2214
2251
  const s = this.settingsOf(layerId);
2215
- s.params = _chunkKWNMBMKGcjs.normalizeWetParams.call(void 0, update, s.params);
2216
- if (_optionalChain([this, 'access', _100 => _100.world, 'optionalAccess', _101 => _101.hasLane, 'call', _102 => _102(layerId)])) this.world.setParams(layerId, s.params);
2252
+ s.params = _chunkXFYLA3ZOcjs.normalizeWetParams.call(void 0, update, s.params);
2253
+ if (_optionalChain([this, 'access', _107 => _107.world, 'optionalAccess', _108 => _108.hasLane, 'call', _109 => _109(layerId)])) this.world.setParams(layerId, s.params);
2217
2254
  return { ...s.params };
2218
2255
  }
2219
2256
  setFlow(layerId, update) {
2220
2257
  const s = this.settingsOf(layerId);
2221
- s.flow = _chunkKWNMBMKGcjs.normalizeFlow.call(void 0, update, s.flow);
2222
- if (_optionalChain([this, 'access', _103 => _103.world, 'optionalAccess', _104 => _104.hasLane, 'call', _105 => _105(layerId)])) {
2258
+ s.flow = _chunkXFYLA3ZOcjs.normalizeFlow.call(void 0, update, s.flow);
2259
+ if (_optionalChain([this, 'access', _110 => _110.world, 'optionalAccess', _111 => _111.hasLane, 'call', _112 => _112(layerId)])) {
2223
2260
  const { width, height } = this.host.canvas();
2224
- this.world.setFlow(layerId, _chunkKWNMBMKGcjs.flowField.call(void 0, s.flow, width, height), s.flow.strength);
2261
+ this.world.setFlow(layerId, _chunkXFYLA3ZOcjs.flowField.call(void 0, s.flow, width, height), s.flow.strength);
2225
2262
  }
2226
2263
  return { ...s.flow };
2227
2264
  }
2228
2265
  setTilt(update) {
2229
- this.tilt = _chunkKWNMBMKGcjs.normalizeTilt.call(void 0, update, this.tilt);
2230
- _optionalChain([this, 'access', _106 => _106.world, 'optionalAccess', _107 => _107.setTilt, 'call', _108 => _108(this.tilt)]);
2266
+ this.tilt = _chunkXFYLA3ZOcjs.normalizeTilt.call(void 0, update, this.tilt);
2267
+ _optionalChain([this, 'access', _113 => _113.world, 'optionalAccess', _114 => _114.setTilt, 'call', _115 => _115(this.tilt)]);
2231
2268
  return { ...this.tilt };
2232
2269
  }
2233
2270
  /** The paper changed. */
2234
2271
  paperChanged() {
2235
- _optionalChain([this, 'access', _109 => _109.world, 'optionalAccess', _110 => _110.setPaper, 'call', _111 => _111(wetPaperInput(this.host.paper()))]);
2272
+ _optionalChain([this, 'access', _116 => _116.world, 'optionalAccess', _117 => _117.setPaper, 'call', _118 => _118(wetPaperInput(this.host.paper()))]);
2236
2273
  }
2237
2274
  /** A layer as tools describe it. */
2238
2275
  info(layerId) {
2239
2276
  const s = this.settingsOf(layerId);
2240
- const st = _optionalChain([this, 'access', _112 => _112.world, 'optionalAccess', _113 => _113.hasLane, 'call', _114 => _114(layerId)]) ? this.world.stats(layerId) : null;
2277
+ const st = _optionalChain([this, 'access', _119 => _119.world, 'optionalAccess', _120 => _120.hasLane, 'call', _121 => _121(layerId)]) ? this.world.stats(layerId) : null;
2241
2278
  return {
2242
2279
  layerId,
2243
2280
  wet: Boolean(st && st.wetCells > 0),
2244
- wetCells: _nullishCoalesce(_optionalChain([st, 'optionalAccess', _115 => _115.wetCells]), () => ( 0)),
2245
- wetBounds: _nullishCoalesce(_optionalChain([st, 'optionalAccess', _116 => _116.wetBounds]), () => ( null)),
2246
- activeTiles: _nullishCoalesce(_optionalChain([st, 'optionalAccess', _117 => _117.activeTiles]), () => ( 0)),
2281
+ wetCells: _nullishCoalesce(_optionalChain([st, 'optionalAccess', _122 => _122.wetCells]), () => ( 0)),
2282
+ wetBounds: _nullishCoalesce(_optionalChain([st, 'optionalAccess', _123 => _123.wetBounds]), () => ( null)),
2283
+ activeTiles: _nullishCoalesce(_optionalChain([st, 'optionalAccess', _124 => _124.activeTiles]), () => ( 0)),
2247
2284
  params: { ...s.params },
2248
2285
  flow: { ...s.flow }
2249
2286
  };
2250
2287
  }
2251
2288
  backend() {
2252
- return _nullishCoalesce(_optionalChain([this, 'access', _118 => _118.world, 'optionalAccess', _119 => _119.backend, 'call', _120 => _120()]), () => ( null));
2289
+ return _nullishCoalesce(_optionalChain([this, 'access', _125 => _125.world, 'optionalAccess', _126 => _126.backend, 'call', _127 => _127()]), () => ( null));
2253
2290
  }
2254
2291
  /** Shows the current wet pixels (at most `maxTiles` reshaded per layer). */
2255
2292
  syncDisplays(maxTiles = Infinity) {
@@ -2285,7 +2322,7 @@ var PaintWetLayers = (_class6 = class {
2285
2322
  const w = this.world;
2286
2323
  if (!w) return;
2287
2324
  for (const id of w.laneIds()) {
2288
- if (w.isActive(id) || _optionalChain([this, 'access', _121 => _121.driver, 'optionalAccess', _122 => _122.init, 'access', _123 => _123.laneId]) === id) continue;
2325
+ if (w.isActive(id) || _optionalChain([this, 'access', _128 => _128.driver, 'optionalAccess', _129 => _129.init, 'access', _130 => _130.laneId]) === id) continue;
2289
2326
  const base = w.getBase(id);
2290
2327
  w.removeLane(id);
2291
2328
  this.host.updateSurfaces(/* @__PURE__ */ new Map([[id, base]]), []);
@@ -2365,7 +2402,7 @@ var PaintWetLayers = (_class6 = class {
2365
2402
  if (!d || !this.world) return;
2366
2403
  const rects = d.flush();
2367
2404
  if (rects.length) this.syncDisplays(DISPLAY_TILES_PER_TICK);
2368
- if (d.done) _optionalChain([this, 'access', _124 => _124.onDriverDone, 'optionalCall', _125 => _125(d)]);
2405
+ if (d.done) _optionalChain([this, 'access', _131 => _131.onDriverDone, 'optionalCall', _132 => _132(d)]);
2369
2406
  }
2370
2407
  /** Called when a live stroke that ended mid-batch has finished applying. */
2371
2408
  __init62() {this.onDriverDone = null}
@@ -2409,7 +2446,7 @@ var PaintWetLayers = (_class6 = class {
2409
2446
  /** The layer's pixels with all its wet paint dried (deterministic), without changing anything. */
2410
2447
  bakedSurface(layerId) {
2411
2448
  const w = this.world;
2412
- if (!_optionalChain([w, 'optionalAccess', _126 => _126.hasLane, 'call', _127 => _127(layerId)])) return null;
2449
+ if (!_optionalChain([w, 'optionalAccess', _133 => _133.hasLane, 'call', _134 => _134(layerId)])) return null;
2413
2450
  return w.bakedSurface(layerId);
2414
2451
  }
2415
2452
  /** A snapshot of the world for undo (`null` when there is none). */
@@ -2430,13 +2467,13 @@ var PaintWetLayers = (_class6 = class {
2430
2467
  this.syncDisplays();
2431
2468
  }
2432
2469
  dropWorld() {
2433
- _optionalChain([this, 'access', _128 => _128.world, 'optionalAccess', _129 => _129.destroy, 'call', _130 => _130()]);
2470
+ _optionalChain([this, 'access', _135 => _135.world, 'optionalAccess', _136 => _136.destroy, 'call', _137 => _137()]);
2434
2471
  this.world = null;
2435
2472
  this.driver = null;
2436
2473
  }
2437
2474
  /** Forgets everything wet (a new canvas, a resize, opening a document). */
2438
2475
  reset() {
2439
- _optionalChain([this, 'access', _131 => _131.world, 'optionalAccess', _132 => _132.destroy, 'call', _133 => _133()]);
2476
+ _optionalChain([this, 'access', _138 => _138.world, 'optionalAccess', _139 => _139.destroy, 'call', _140 => _140()]);
2440
2477
  this.world = null;
2441
2478
  this.driver = null;
2442
2479
  this.settings.clear();
@@ -2466,23 +2503,23 @@ var PaintWetLayers = (_class6 = class {
2466
2503
  return out;
2467
2504
  }
2468
2505
  destroy() {
2469
- _optionalChain([this, 'access', _134 => _134.world, 'optionalAccess', _135 => _135.destroy, 'call', _136 => _136()]);
2506
+ _optionalChain([this, 'access', _141 => _141.world, 'optionalAccess', _142 => _142.destroy, 'call', _143 => _143()]);
2470
2507
  this.world = null;
2471
- _optionalChain([this, 'access', _137 => _137.gpu, 'optionalAccess', _138 => _138.destroy, 'call', _139 => _139()]);
2508
+ _optionalChain([this, 'access', _144 => _144.gpu, 'optionalAccess', _145 => _145.destroy, 'call', _146 => _146()]);
2472
2509
  this.gpu = null;
2473
2510
  }
2474
2511
  }, _class6);
2475
2512
  function wetPigmentOf(hex, body) {
2476
2513
  const [r, g, b] = _chunkROVK6AXXcjs.hexToRgb8.call(void 0, hex);
2477
- return Array.from(_chunkKWNMBMKGcjs.pigmentOf.call(void 0, [r / 255, g / 255, b / 255], body));
2514
+ return Array.from(_chunkXFYLA3ZOcjs.pigmentOf.call(void 0, [r / 255, g / 255, b / 255], body));
2478
2515
  }
2479
2516
 
2480
2517
  // src/paint-editor/thumbnails.ts
2481
2518
  var thumbWorld = null;
2482
2519
  function paintWetTestStroke(brush, paper, color, width, height) {
2483
2520
  if (!thumbWorld || thumbWorld.width !== width || thumbWorld.height !== height) {
2484
- _optionalChain([thumbWorld, 'optionalAccess', _140 => _140.destroy, 'call', _141 => _141()]);
2485
- thumbWorld = new (0, _chunkKWNMBMKGcjs.WetWorld)(width, height, wetPaperInput(paper), { kernel: "typescript", threads: 0 });
2521
+ _optionalChain([thumbWorld, 'optionalAccess', _147 => _147.destroy, 'call', _148 => _148()]);
2522
+ thumbWorld = new (0, _chunkXFYLA3ZOcjs.WetWorld)(width, height, wetPaperInput(paper), { kernel: "typescript", threads: 0 });
2486
2523
  } else thumbWorld.setPaper(wetPaperInput(paper));
2487
2524
  const w = thumbWorld;
2488
2525
  if (w.hasLane("thumb")) w.removeLane("thumb");
@@ -2490,8 +2527,8 @@ function paintWetTestStroke(brush, paper, color, width, height) {
2490
2527
  const [r, g, b] = _chunkROVK6AXXcjs.hexToRgb8.call(void 0, color);
2491
2528
  if (brush.wet.tool !== "paint" && brush.wet.tool !== "water") {
2492
2529
  const half = Math.ceil(height / 2);
2493
- w.paint("thumb", { x: 0, y: 0, width, height: half }, null, 0.4, Array.from(_chunkKWNMBMKGcjs.pigmentOf.call(void 0, [r / 255, g / 255, b / 255], 0), (v) => v * 0.05));
2494
- w.paint("thumb", { x: 0, y: half, width, height: height - half }, null, 0.4, Array.from(_chunkKWNMBMKGcjs.pigmentOf.call(void 0, [232 / 255, 196 / 255, 64 / 255], 0), (v) => v * 0.05));
2530
+ w.paint("thumb", { x: 0, y: 0, width, height: half }, null, 0.4, Array.from(_chunkXFYLA3ZOcjs.pigmentOf.call(void 0, [r / 255, g / 255, b / 255], 0), (v) => v * 0.05));
2531
+ w.paint("thumb", { x: 0, y: half, width, height: height - half }, null, 0.4, Array.from(_chunkXFYLA3ZOcjs.pigmentOf.call(void 0, [232 / 255, 196 / 255, 64 / 255], 0), (v) => v * 0.05));
2495
2532
  }
2496
2533
  const driver = new WetStrokeDriver({
2497
2534
  world: w,
@@ -2816,11 +2853,11 @@ function readSwatch(raw) {
2816
2853
  if (!raw || typeof raw !== "object") return null;
2817
2854
  const r = raw;
2818
2855
  const g = _chunkPQ3H2AANcjs.readPaintSource.call(void 0, r.paint);
2819
- const color = typeof r.color === "string" && /^#[0-9a-f]{6}$/i.test(r.color) ? r.color.toLowerCase() : _optionalChain([g, 'optionalAccess', _142 => _142.type]) === "gradient" ? _chunkPQ3H2AANcjs.paintSourceColor.call(void 0, g) : null;
2856
+ const color = typeof r.color === "string" && /^#[0-9a-f]{6}$/i.test(r.color) ? r.color.toLowerCase() : _optionalChain([g, 'optionalAccess', _149 => _149.type]) === "gradient" ? _chunkPQ3H2AANcjs.paintSourceColor.call(void 0, g) : null;
2820
2857
  if (!color) return null;
2821
2858
  const out = { color };
2822
2859
  if (typeof r.name === "string" && r.name.trim()) out.name = r.name.trim().slice(0, 80);
2823
- if (_optionalChain([g, 'optionalAccess', _143 => _143.type]) === "gradient") out.paint = g;
2860
+ if (_optionalChain([g, 'optionalAccess', _150 => _150.type]) === "gradient") out.paint = g;
2824
2861
  return out;
2825
2862
  }
2826
2863
  var DEFAULT_SWATCHES = [
@@ -3007,7 +3044,7 @@ var MixingPad = (_class8 = class {constructor() { _class8.prototype.__init65.cal
3007
3044
  }
3008
3045
  /** Replaces the pad with a PNG (data URL or base64) of the pad's size, as `toPng` writes. */
3009
3046
  fromPng(png) {
3010
- const bytes = png.startsWith("data:") ? _optionalChain([_chunkOLNIPTB3cjs.parseDataUrl.call(void 0, png), 'optionalAccess', _144 => _144.bytes]) : _chunkOLNIPTB3cjs.base64ToBytes.call(void 0, png);
3047
+ const bytes = png.startsWith("data:") ? _optionalChain([_chunkOLNIPTB3cjs.parseDataUrl.call(void 0, png), 'optionalAccess', _151 => _151.bytes]) : _chunkOLNIPTB3cjs.base64ToBytes.call(void 0, png);
3011
3048
  if (!bytes || !_chunkOLNIPTB3cjs.isPng.call(void 0, bytes)) throw new Error("The pad image is not a PNG data URL or base64 PNG.");
3012
3049
  const img = _chunkOLNIPTB3cjs.decodePng.call(void 0, bytes);
3013
3050
  if (img.width !== this.width || img.height !== this.height) throw new Error(`The pad image is ${img.width}\xD7${img.height}; a mixing pad is ${this.width}\xD7${this.height}.`);
@@ -3061,7 +3098,7 @@ async function replayPainting(source, target, options = {}) {
3061
3098
  const n = Math.min(left, chunk);
3062
3099
  await target.advanceWet({ steps: n });
3063
3100
  left -= n;
3064
- if (Number.isFinite(chunk)) await _optionalChain([options, 'access', _145 => _145.onWetSteps, 'optionalCall', _146 => _146(target.getState().wet.clock)]);
3101
+ if (Number.isFinite(chunk)) await _optionalChain([options, 'access', _152 => _152.onWetSteps, 'optionalCall', _153 => _153(target.getState().wet.clock)]);
3065
3102
  }
3066
3103
  };
3067
3104
  const sr = (r) => ({ x: r.x * s, y: r.y * s, width: r.width * s, height: r.height * s });
@@ -3073,7 +3110,7 @@ async function replayPainting(source, target, options = {}) {
3073
3110
  if (e.kind === "fill") target.fillLayer({ layerId: e.layerId, ...e.data });
3074
3111
  else if (e.kind === "clear") target.clearLayer(e.layerId);
3075
3112
  else if (e.kind === "stickers") {
3076
- const list = (_nullishCoalesce(_optionalChain([e, 'access', _147 => _147.data, 'optionalAccess', _148 => _148.stickers]), () => ( []))).map((x) => s === 1 ? x : { ...x, x: x.x * s, y: x.y * s, size: x.size * s });
3113
+ const list = (_nullishCoalesce(_optionalChain([e, 'access', _154 => _154.data, 'optionalAccess', _155 => _155.stickers]), () => ( []))).map((x) => s === 1 ? x : { ...x, x: x.x * s, y: x.y * s, size: x.size * s });
3077
3114
  target.replaceStickers(e.layerId, list);
3078
3115
  } else target.flattenRelief(e.layerId);
3079
3116
  continue;
@@ -3086,8 +3123,8 @@ async function replayPainting(source, target, options = {}) {
3086
3123
  switch (e.kind) {
3087
3124
  case "dry": {
3088
3125
  const rect = e.data;
3089
- const ids = _optionalChain([e, 'access', _149 => _149.layerId, 'optionalAccess', _150 => _150.split, 'call', _151 => _151(","), 'access', _152 => _152.filter, 'call', _153 => _153(Boolean)]);
3090
- if (_optionalChain([ids, 'optionalAccess', _154 => _154.length])) for (const id of ids) target.dryPaint({ layerId: id, rect: rect ? sr(rect) : void 0 });
3126
+ const ids = _optionalChain([e, 'access', _156 => _156.layerId, 'optionalAccess', _157 => _157.split, 'call', _158 => _158(","), 'access', _159 => _159.filter, 'call', _160 => _160(Boolean)]);
3127
+ if (_optionalChain([ids, 'optionalAccess', _161 => _161.length])) for (const id of ids) target.dryPaint({ layerId: id, rect: rect ? sr(rect) : void 0 });
3091
3128
  else target.dryPaint({ rect: rect ? sr(rect) : void 0 });
3092
3129
  break;
3093
3130
  }
@@ -3118,7 +3155,7 @@ async function replayPainting(source, target, options = {}) {
3118
3155
  strokes++;
3119
3156
  if (!target.getLayer(st.layerId)) continue;
3120
3157
  const init = { layerId: st.layerId, color: st.color, brush: st.brush, seed: st.seed, copies: _nullishCoalesce(st.copies, () => ( [])), ...st.load ? { load: st.load } : {}, ...st.paint ? { paint: st.paint } : {}, snapToPerspective: false, stencils: false, maskStencils: (_nullishCoalesce(st.stencils, () => ( []))).map((x) => s === 1 ? x : scaleStencil(x, s)) };
3121
- if (st.brush.engine === "wet" && _optionalChain([st, 'access', _155 => _155.steps, 'optionalAccess', _156 => _156.length]) === st.points.length) {
3158
+ if (st.brush.engine === "wet" && _optionalChain([st, 'access', _162 => _162.steps, 'optionalAccess', _163 => _163.length]) === st.points.length) {
3122
3159
  await target.wetIdle();
3123
3160
  await advanceTo(st.steps[0]);
3124
3161
  const session = target.beginStroke({ ...init, start: st.points[0] });
@@ -3138,7 +3175,7 @@ async function replayPainting(source, target, options = {}) {
3138
3175
  await target.wetIdle();
3139
3176
  target.paintStroke({ ...init, points: st.points });
3140
3177
  }
3141
- await _optionalChain([options, 'access', _157 => _157.onStroke, 'optionalCall', _158 => _158(strokes)]);
3178
+ await _optionalChain([options, 'access', _164 => _164.onStroke, 'optionalCall', _165 => _165(strokes)]);
3142
3179
  }
3143
3180
  void IDENTITY_AFFINE;
3144
3181
  }
@@ -3183,7 +3220,7 @@ async function buildTimeLapse(source, target, options = {}) {
3183
3220
  wetChunk: wetEvery > 0 ? wetEvery : 0,
3184
3221
  onStroke: (i) => {
3185
3222
  if (i % perFrame === 0 || i === total) shoot(i);
3186
- _optionalChain([options, 'access', _159 => _159.onProgress, 'optionalCall', _160 => _160(total ? i / total : 1)]);
3223
+ _optionalChain([options, 'access', _166 => _166.onProgress, 'optionalCall', _167 => _167(total ? i / total : 1)]);
3187
3224
  },
3188
3225
  onWetSteps: wetEvery > 0 ? () => shoot(-1) : void 0
3189
3226
  });
@@ -3366,7 +3403,7 @@ function unionRect(a, b) {
3366
3403
  const y = Math.min(a.y, b.y);
3367
3404
  return { x, y, width: Math.max(a.x + a.width, b.x + b.width) - x, height: Math.max(a.y + a.height, b.y + b.height) - y };
3368
3405
  }
3369
- var isPixelLayer = (l) => _optionalChain([l, 'optionalAccess', _161 => _161.type]) === "pixel";
3406
+ var isPixelLayer = (l) => _optionalChain([l, 'optionalAccess', _168 => _168.type]) === "pixel";
3370
3407
  var PaintEditorController = (_class10 = class _PaintEditorController {
3371
3408
 
3372
3409
  __init72() {this.extensions = {}}
@@ -3435,7 +3472,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
3435
3472
  canvas: () => this.doc.canvas,
3436
3473
  paper: () => this.doc.paper,
3437
3474
  layerSurface: (id) => {
3438
- const l = _optionalChain([_chunkB46UQUDCcjs.findLayer.call(void 0, this.doc.layers, id), 'optionalAccess', _162 => _162.layer]);
3475
+ const l = _optionalChain([_chunkB46UQUDCcjs.findLayer.call(void 0, this.doc.layers, id), 'optionalAccess', _169 => _169.layer]);
3439
3476
  return isPixelLayer(l) ? l.surface : null;
3440
3477
  },
3441
3478
  updateSurfaces: (surfaces, rects) => {
@@ -3449,7 +3486,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
3449
3486
  },
3450
3487
  options.wet
3451
3488
  );
3452
- this.wet.onDriverDone = () => _optionalChain([this, 'access', _163 => _163.session, 'optionalAccess', _164 => _164.completeWetEnd, 'call', _165 => _165()]);
3489
+ this.wet.onDriverDone = () => _optionalChain([this, 'access', _170 => _170.session, 'optionalAccess', _171 => _171.completeWetEnd, 'call', _172 => _172()]);
3453
3490
  }
3454
3491
  // --- State and events ----------------------------------------------------------
3455
3492
  subscribe(listener) {
@@ -3480,8 +3517,8 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
3480
3517
  hand: this.hand,
3481
3518
  canUndo: this.undoStack.length > 0 && !this.session,
3482
3519
  canRedo: this.redoStack.length > 0 && !this.session,
3483
- undoLabel: _nullishCoalesce(_optionalChain([last, 'optionalAccess', _166 => _166.label]), () => ( null)),
3484
- redoLabel: _nullishCoalesce(_optionalChain([next, 'optionalAccess', _167 => _167.label]), () => ( null)),
3520
+ undoLabel: _nullishCoalesce(_optionalChain([last, 'optionalAccess', _173 => _173.label]), () => ( null)),
3521
+ redoLabel: _nullishCoalesce(_optionalChain([next, 'optionalAccess', _174 => _174.label]), () => ( null)),
3485
3522
  guides: this.guides,
3486
3523
  swatches: this.swatches,
3487
3524
  mixingPadVersion: this.pad.version,
@@ -3494,10 +3531,10 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
3494
3531
  overlay: this.wet.overlay,
3495
3532
  instantDry: this.wet.instantDry,
3496
3533
  speed: this.wet.speed,
3497
- clock: _nullishCoalesce(_optionalChain([this, 'access', _168 => _168.wet, 'access', _169 => _169.world, 'optionalAccess', _170 => _170.clock]), () => ( 0)),
3534
+ clock: _nullishCoalesce(_optionalChain([this, 'access', _175 => _175.wet, 'access', _176 => _176.world, 'optionalAccess', _177 => _177.clock]), () => ( 0)),
3498
3535
  tilt: { ...this.wet.tilt },
3499
3536
  gpu: this.wet.gpuMode,
3500
- gpuActive: Boolean(_optionalChain([this, 'access', _171 => _171.wet, 'access', _172 => _172.world, 'optionalAccess', _173 => _173.gpuActive]))
3537
+ gpuActive: Boolean(_optionalChain([this, 'access', _178 => _178.wet, 'access', _179 => _179.world, 'optionalAccess', _180 => _180.gpuActive]))
3501
3538
  },
3502
3539
  version: this.version
3503
3540
  };
@@ -3601,7 +3638,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
3601
3638
  /** Records a wet event (for replays) in the document being built. */
3602
3639
  __init107() {this.pendingWetEvents = []}
3603
3640
  logWet(e) {
3604
- this.pendingWetEvents.push({ clock: _nullishCoalesce(_optionalChain([this, 'access', _174 => _174.wet, 'access', _175 => _175.world, 'optionalAccess', _176 => _176.clock]), () => ( 0)), at: this.doc.strokes.length, ...e });
3641
+ this.pendingWetEvents.push({ clock: _nullishCoalesce(_optionalChain([this, 'access', _181 => _181.wet, 'access', _182 => _182.world, 'optionalAccess', _183 => _183.clock]), () => ( 0)), at: this.doc.strokes.length, ...e });
3605
3642
  }
3606
3643
  /** The document with a paint event appended (for replays). */
3607
3644
  withPaintEvent(doc, e) {
@@ -3709,9 +3746,11 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
3709
3746
  * move by (left, top) in document pixels, `document.origin` moves by (−left, −top), and the view
3710
3747
  * pans so the picture stays still on screen.
3711
3748
  *
3712
- * Wet paint dries first (the wet simulation is canvas-sized), as with `setCanvas`; one undo step
3713
- * (undo brings back the old size, origin and guides, and the wet paint). Returns the new canvas,
3714
- * where it sits in the previous document's pixels, and the origin.
3749
+ * Wet paint stays wet and moves with the picture when `left` and `top` are whole 256 px tiles
3750
+ * (so a host growing a canvas while someone paints should grow it in tile steps); otherwise it
3751
+ * dries first (the wet simulation is canvas-sized), as with `setCanvas`. One undo step (undo
3752
+ * brings back the old size, origin and guides, and the wet paint). Returns the new canvas, where
3753
+ * it sits in the previous document's pixels, and the origin.
3715
3754
  */
3716
3755
  extendCanvas(by) {
3717
3756
  this.requireIdle("extending the canvas");
@@ -3731,14 +3770,29 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
3731
3770
  if (width > MAX_CANVAS_SIDE || height > MAX_CANVAS_SIDE) {
3732
3771
  throw new PaintEditorError(`The canvas would be ${width}\xD7${height}; the limit is ${MAX_CANVAS_SIDE} px per side. Extend by less (it is ${was.width}\xD7${was.height} now).`);
3733
3772
  }
3773
+ let keptWet = [];
3734
3774
  if (this.wet.world) {
3735
3775
  this.requireWetIdle("extending the canvas");
3736
- this.dryLayersFirst(this.wet.wetLayerIds());
3737
- const settings = [...this.wet.settings];
3738
- this.wet.reset();
3739
- for (const [id, s] of settings) this.wet.settings.set(id, s.flow.center ? { ...s, flow: { ...s.flow, center: { x: s.flow.center.x + left, y: s.flow.center.y + top } } } : s);
3776
+ if (this.wet.canExtend(left, top)) {
3777
+ keptWet = this.wet.wetLayerIds();
3778
+ if (keptWet.length) this.beginWetOp();
3779
+ } else {
3780
+ this.dryLayersFirst(this.wet.wetLayerIds());
3781
+ }
3782
+ }
3783
+ let next = { ...shiftDocument(this.withWetEvents(this.doc), left, top), canvas: { ...was, width, height } };
3784
+ for (const id of keptWet) {
3785
+ const l = _optionalChain([_chunkB46UQUDCcjs.findLayer.call(void 0, next.layers, id), 'optionalAccess', _184 => _184.layer]);
3786
+ if (isPixelLayer(l)) next = { ...next, layers: _chunkB46UQUDCcjs.mapLayer.call(void 0, next.layers, id, () => ({ ...l, surface: _chunk474IQG74cjs.translateSurface.call(void 0, l.surface, l.offset.x, l.offset.y), offset: { x: 0, y: 0 } })) };
3787
+ }
3788
+ if (this.wet.world) {
3789
+ if (keptWet.length) this.wet.extend(width, height, left, top, next.paper);
3790
+ else {
3791
+ const settings = [...this.wet.settings];
3792
+ this.wet.reset();
3793
+ for (const [id, s] of settings) this.wet.settings.set(id, s.flow.center ? { ...s, flow: { ...s.flow, center: { x: s.flow.center.x + left, y: s.flow.center.y + top } } } : s);
3794
+ }
3740
3795
  }
3741
- const next = { ...shiftDocument(this.withWetEvents(this.doc), left, top), canvas: { ...was, width, height } };
3742
3796
  const m = viewMatrix(this.view, was, { width: 0, height: 0 });
3743
3797
  const dx = (right - left) / 2;
3744
3798
  const dy = (bottom - top) / 2;
@@ -3746,6 +3800,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
3746
3800
  const guidesBefore = this.guides;
3747
3801
  if (left || top) this.restoreGuides(shiftGuides(this.guides, left, top));
3748
3802
  this.commit("Extend canvas", next);
3803
+ if (keptWet.length) this.wet.syncDisplays();
3749
3804
  if (this.guides !== guidesBefore) this.undoStack[this.undoStack.length - 1].guides = { before: guidesBefore, after: this.guides };
3750
3805
  const origin = { ..._nullishCoalesce(next.origin, () => ( { x: 0, y: 0 })) };
3751
3806
  return { canvas: { ...next.canvas }, rect: { x: 0 - left, y: 0 - top, width, height }, origin };
@@ -3771,7 +3826,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
3771
3826
  }
3772
3827
  // --- Layers --------------------------------------------------------------------
3773
3828
  getLayer(id) {
3774
- return _optionalChain([_chunkB46UQUDCcjs.findLayer.call(void 0, this.doc.layers, id), 'optionalAccess', _177 => _177.layer]);
3829
+ return _optionalChain([_chunkB46UQUDCcjs.findLayer.call(void 0, this.doc.layers, id), 'optionalAccess', _185 => _185.layer]);
3775
3830
  }
3776
3831
  /** The active pixel layer (or `undefined`). */
3777
3832
  getActiveLayer() {
@@ -3790,7 +3845,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
3790
3845
  walk(this.doc.layers, null, 0);
3791
3846
  return out;
3792
3847
  }
3793
- describeLayer(l, parentId = _nullishCoalesce(_optionalChain([_chunkB46UQUDCcjs.findLayer.call(void 0, this.doc.layers, l.id), 'optionalAccess', _178 => _178.parent, 'optionalAccess', _179 => _179.id]), () => ( null)), depth = _nullishCoalesce(_optionalChain([_chunkB46UQUDCcjs.findLayer.call(void 0, this.doc.layers, l.id), 'optionalAccess', _180 => _180.path, 'access', _181 => _181.length]), () => ( 0))) {
3848
+ describeLayer(l, parentId = _nullishCoalesce(_optionalChain([_chunkB46UQUDCcjs.findLayer.call(void 0, this.doc.layers, l.id), 'optionalAccess', _186 => _186.parent, 'optionalAccess', _187 => _187.id]), () => ( null)), depth = _nullishCoalesce(_optionalChain([_chunkB46UQUDCcjs.findLayer.call(void 0, this.doc.layers, l.id), 'optionalAccess', _188 => _188.path, 'access', _189 => _189.length]), () => ( 0))) {
3794
3849
  let bounds = null;
3795
3850
  if (l.type === "pixel") {
3796
3851
  const b = _chunk474IQG74cjs.contentBounds.call(void 0, l.surface);
@@ -3837,7 +3892,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
3837
3892
  this.requireIdle("adding a layer");
3838
3893
  const count = _chunkB46UQUDCcjs.flattenLayers.call(void 0, this.doc.layers).length;
3839
3894
  const type = _nullishCoalesce(options.type, () => ( "pixel"));
3840
- const name = _optionalChain([options, 'access', _182 => _182.name, 'optionalAccess', _183 => _183.trim, 'call', _184 => _184()]) || (type === "group" ? `Group ${count + 1}` : `Layer ${count + 1}`);
3895
+ const name = _optionalChain([options, 'access', _190 => _190.name, 'optionalAccess', _191 => _191.trim, 'call', _192 => _192()]) || (type === "group" ? `Group ${count + 1}` : `Layer ${count + 1}`);
3841
3896
  const layer = type === "group" ? { type: "group", id: newPaintLayerId(), name, visible: true, opacity: 1, blend: "pass-through", children: [] } : createPaintLayer(name);
3842
3897
  let parentId = null;
3843
3898
  let index;
@@ -3849,7 +3904,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
3849
3904
  } else if (above) {
3850
3905
  const loc = _chunkB46UQUDCcjs.findLayer.call(void 0, this.doc.layers, above);
3851
3906
  if (!loc) throw new PaintEditorError(`Unknown layer "${above}". Call list_layers for the ids.`);
3852
- parentId = _nullishCoalesce(_optionalChain([loc, 'access', _185 => _185.parent, 'optionalAccess', _186 => _186.id]), () => ( null));
3907
+ parentId = _nullishCoalesce(_optionalChain([loc, 'access', _193 => _193.parent, 'optionalAccess', _194 => _194.id]), () => ( null));
3853
3908
  index = loc.index + 1;
3854
3909
  }
3855
3910
  const layers = _chunkB46UQUDCcjs.insertLayer.call(void 0, this.doc.layers, layer, parentId, index);
@@ -3889,7 +3944,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
3889
3944
  }
3890
3945
  const layers = _chunkB46UQUDCcjs.mapLayer.call(void 0, this.doc.layers, id, () => null);
3891
3946
  let active = this.doc.activeLayerId;
3892
- if (active && !_chunkB46UQUDCcjs.findLayer.call(void 0, layers, active)) active = _nullishCoalesce(_optionalChain([_chunkB46UQUDCcjs.flattenLayers.call(void 0, layers), 'access', _187 => _187.filter, 'call', _188 => _188((x) => x.type === "pixel"), 'access', _189 => _189.pop, 'call', _190 => _190(), 'optionalAccess', _191 => _191.id]), () => ( null));
3947
+ if (active && !_chunkB46UQUDCcjs.findLayer.call(void 0, layers, active)) active = _nullishCoalesce(_optionalChain([_chunkB46UQUDCcjs.flattenLayers.call(void 0, layers), 'access', _195 => _195.filter, 'call', _196 => _196((x) => x.type === "pixel"), 'access', _197 => _197.pop, 'call', _198 => _198(), 'optionalAccess', _199 => _199.id]), () => ( null));
3893
3948
  this.commit("Remove layer", { ...this.doc, layers, activeLayerId: active, ...this.thickWithout(_chunkB46UQUDCcjs.flattenLayers.call(void 0, [l]).map((x) => x.id)), ...this.stickersWithout(_chunkB46UQUDCcjs.flattenLayers.call(void 0, [l]).map((x) => x.id)) });
3894
3949
  return { removed: id, activeLayerId: active };
3895
3950
  }
@@ -3910,7 +3965,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
3910
3965
  return l.type === "group" ? { ...l, id: id2, children: l.children.map(copy) } : { ...l, id: id2 };
3911
3966
  };
3912
3967
  const dup = { ...copy(loc.layer), name: `${loc.layer.name} copy` };
3913
- const layers = _chunkB46UQUDCcjs.insertLayer.call(void 0, this.doc.layers, dup, _nullishCoalesce(_optionalChain([loc, 'access', _192 => _192.parent, 'optionalAccess', _193 => _193.id]), () => ( null)), loc.index + 1);
3968
+ const layers = _chunkB46UQUDCcjs.insertLayer.call(void 0, this.doc.layers, dup, _nullishCoalesce(_optionalChain([loc, 'access', _200 => _200.parent, 'optionalAccess', _201 => _201.id]), () => ( null)), loc.index + 1);
3914
3969
  this.commit("Duplicate layer", this.withWetEvents({ ...this.doc, layers, activeLayerId: dup.id, ...this.doc.thick ? { thick } : {}, ...this.doc.stickers ? { stickers } : {} }));
3915
3970
  return this.describeLayer(dup);
3916
3971
  }
@@ -3919,7 +3974,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
3919
3974
  this.requireIdle("moving a layer");
3920
3975
  const loc = _chunkB46UQUDCcjs.findLayer.call(void 0, this.doc.layers, id);
3921
3976
  if (!loc) throw new PaintEditorError(`Unknown layer "${id}". Call list_layers for the ids.`);
3922
- const target = parentId === void 0 ? _nullishCoalesce(_optionalChain([loc, 'access', _194 => _194.parent, 'optionalAccess', _195 => _195.id]), () => ( null)) : parentId;
3977
+ const target = parentId === void 0 ? _nullishCoalesce(_optionalChain([loc, 'access', _202 => _202.parent, 'optionalAccess', _203 => _203.id]), () => ( null)) : parentId;
3923
3978
  if (target) {
3924
3979
  const g = this.requireLayer(target);
3925
3980
  if (g.type !== "group") throw new PaintEditorError(`Layer "${g.name}" is not a group; pass a group id as parentId.`);
@@ -3938,7 +3993,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
3938
3993
  const pre = _chunkB46UQUDCcjs.findLayer.call(void 0, this.doc.layers, id);
3939
3994
  if (pre) {
3940
3995
  const sib = pre.parent ? pre.parent.children : this.doc.layers;
3941
- this.dryLayersFirst([id, _optionalChain([sib, 'access', _196 => _196[pre.index - 1], 'optionalAccess', _197 => _197.id])].filter((x) => Boolean(x)));
3996
+ this.dryLayersFirst([id, _optionalChain([sib, 'access', _204 => _204[pre.index - 1], 'optionalAccess', _205 => _205.id])].filter((x) => Boolean(x)));
3942
3997
  }
3943
3998
  const loc = _chunkB46UQUDCcjs.findLayer.call(void 0, this.doc.layers, id);
3944
3999
  if (!loc) throw new PaintEditorError(`Unknown layer "${id}". Call list_layers for the ids.`);
@@ -3979,7 +4034,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
3979
4034
  fillLayer(options = {}) {
3980
4035
  this.requireIdle("filling");
3981
4036
  const fillTarget = this.paintTarget(options.layerId, "fill");
3982
- if (_optionalChain([this, 'access', _198 => _198.doc, 'access', _199 => _199.stickers, 'optionalAccess', _200 => _200[fillTarget.id], 'optionalAccess', _201 => _201.length])) throw new PaintEditorError(`Layer "${fillTarget.name}" is a sticker layer; fill another layer (add_layer).`);
4037
+ if (_optionalChain([this, 'access', _206 => _206.doc, 'access', _207 => _207.stickers, 'optionalAccess', _208 => _208[fillTarget.id], 'optionalAccess', _209 => _209.length])) throw new PaintEditorError(`Layer "${fillTarget.name}" is a sticker layer; fill another layer (add_layer).`);
3983
4038
  this.dryLayersFirst([_nullishCoalesce(_nullishCoalesce(options.layerId, () => ( this.doc.activeLayerId)), () => ( ""))]);
3984
4039
  const l = this.paintTarget(options.layerId, "fill");
3985
4040
  const color = options.color === void 0 ? this.color : parseColor(options.color);
@@ -4020,7 +4075,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
4020
4075
  const tiles = new Map(base.tiles);
4021
4076
  for (const { tx, ty } of _chunk474IQG74cjs.tilesInRect.call(void 0, { x: rect.x - l.offset.x, y: rect.y - l.offset.y, width: rect.width, height: rect.height })) {
4022
4077
  const key = _chunk474IQG74cjs.tileKey.call(void 0, tx, ty);
4023
- const src = _nullishCoalesce(_optionalChain([base, 'access', _202 => _202.tiles, 'access', _203 => _203.get, 'call', _204 => _204(key), 'optionalAccess', _205 => _205.data]), () => ( new Uint8ClampedArray(_chunk474IQG74cjs.TILE * _chunk474IQG74cjs.TILE * 4)));
4078
+ const src = _nullishCoalesce(_optionalChain([base, 'access', _210 => _210.tiles, 'access', _211 => _211.get, 'call', _212 => _212(key), 'optionalAccess', _213 => _213.data]), () => ( new Uint8ClampedArray(_chunk474IQG74cjs.TILE * _chunk474IQG74cjs.TILE * 4)));
4024
4079
  const tile = _chunk474IQG74cjs.finishTile.call(void 0, _chunkPQ3H2AANcjs.applyStrokeToTile.call(void 0, coverage, src, 4, tx, ty, apply), 4, 0);
4025
4080
  if (tile) tiles.set(key, tile);
4026
4081
  else tiles.delete(key);
@@ -4053,7 +4108,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
4053
4108
  }
4054
4109
  /** The effect a layer is drawn from, or `undefined` for other layers. */
4055
4110
  getEffectLayer(layerId) {
4056
- return _chunkB46UQUDCcjs.findLayer.call(void 0, this.doc.layers, layerId) ? _optionalChain([this, 'access', _206 => _206.doc, 'access', _207 => _207.effectLayers, 'optionalAccess', _208 => _208[layerId]]) : void 0;
4111
+ return _chunkB46UQUDCcjs.findLayer.call(void 0, this.doc.layers, layerId) ? _optionalChain([this, 'access', _214 => _214.doc, 'access', _215 => _215.effectLayers, 'optionalAccess', _216 => _216[layerId]]) : void 0;
4057
4112
  }
4058
4113
  /** The effect paper (without its pixels), or `null`. */
4059
4114
  getPaperEffect() {
@@ -4090,7 +4145,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
4090
4145
  /** A pixel layer that takes effect pixels: unlocked, visible, no sticker layer, no wet paint. */
4091
4146
  effectTarget(layerId, what) {
4092
4147
  const l = this.paintTarget(layerId, what);
4093
- if (_optionalChain([this, 'access', _209 => _209.doc, 'access', _210 => _210.stickers, 'optionalAccess', _211 => _211[l.id], 'optionalAccess', _212 => _212.length])) throw new PaintEditorError(`Layer "${l.name}" is a sticker layer; ${what} another layer (add_layer).`);
4148
+ if (_optionalChain([this, 'access', _217 => _217.doc, 'access', _218 => _218.stickers, 'optionalAccess', _219 => _219[l.id], 'optionalAccess', _220 => _220.length])) throw new PaintEditorError(`Layer "${l.name}" is a sticker layer; ${what} another layer (add_layer).`);
4094
4149
  if (this.wet.wetLayerIds().includes(l.id)) throw new PaintEditorError(`Layer "${l.name}" holds wet paint; effects go on dried paint, so dry it first (dry_paint) and try again.`);
4095
4150
  return l;
4096
4151
  }
@@ -4129,8 +4184,8 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
4129
4184
  const was = this.doc.paperEffect;
4130
4185
  const paperEffect = {
4131
4186
  ...this.sourceOf(d, values, options.time),
4132
- opacity: _nullishCoalesce(_nullishCoalesce(options.opacity, () => ( _optionalChain([was, 'optionalAccess', _213 => _213.opacity]))), () => ( 1)),
4133
- blend: _nullishCoalesce(_nullishCoalesce(options.blend, () => ( _optionalChain([was, 'optionalAccess', _214 => _214.blend]))), () => ( "multiply")),
4187
+ opacity: _nullishCoalesce(_nullishCoalesce(options.opacity, () => ( _optionalChain([was, 'optionalAccess', _221 => _221.opacity]))), () => ( 1)),
4188
+ blend: _nullishCoalesce(_nullishCoalesce(options.blend, () => ( _optionalChain([was, 'optionalAccess', _222 => _222.blend]))), () => ( "multiply")),
4134
4189
  image: { width: pixels.width, height: pixels.height, data: new Uint8ClampedArray(pixels.data) },
4135
4190
  version: nextPaperEffectVersion()
4136
4191
  };
@@ -4183,8 +4238,8 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
4183
4238
  const above = _nullishCoalesce(options.aboveId, () => ( this.doc.activeLayerId));
4184
4239
  const loc = above ? _chunkB46UQUDCcjs.findLayer.call(void 0, this.doc.layers, above) : null;
4185
4240
  if (options.aboveId !== void 0 && !loc) throw new PaintEditorError(`Layer "${options.aboveId}" was removed while the effect rendered.`);
4186
- const layer = { ...createPaintLayer(_optionalChain([options, 'access', _215 => _215.name, 'optionalAccess', _216 => _216.trim, 'call', _217 => _217()]) || d.name), surface: _chunk474IQG74cjs.surfaceFromPixels.call(void 0, pixels, 4), opacity: _nullishCoalesce(options.opacity, () => ( 1)), blend: _nullishCoalesce(options.blend, () => ( "normal")) };
4187
- const layers = _chunkB46UQUDCcjs.insertLayer.call(void 0, this.doc.layers, layer, _nullishCoalesce(_optionalChain([loc, 'optionalAccess', _218 => _218.parent, 'optionalAccess', _219 => _219.id]), () => ( null)), loc ? loc.index + 1 : void 0);
4241
+ const layer = { ...createPaintLayer(_optionalChain([options, 'access', _223 => _223.name, 'optionalAccess', _224 => _224.trim, 'call', _225 => _225()]) || d.name), surface: _chunk474IQG74cjs.surfaceFromPixels.call(void 0, pixels, 4), opacity: _nullishCoalesce(options.opacity, () => ( 1)), blend: _nullishCoalesce(options.blend, () => ( "normal")) };
4242
+ const layers = _chunkB46UQUDCcjs.insertLayer.call(void 0, this.doc.layers, layer, _nullishCoalesce(_optionalChain([loc, 'optionalAccess', _226 => _226.parent, 'optionalAccess', _227 => _227.id]), () => ( null)), loc ? loc.index + 1 : void 0);
4188
4243
  const source = this.sourceOf(d, values, options.time);
4189
4244
  this.commit("Add effect layer", { ...this.doc, layers, activeLayerId: layer.id, effectLayers: { ..._nullishCoalesce(this.doc.effectLayers, () => ( {})), [layer.id]: source } });
4190
4245
  return { layer: this.describeLayer(layer), source };
@@ -4260,14 +4315,14 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
4260
4315
  const before = _chunk474IQG74cjs.readRegion.call(void 0, l.surface, rect);
4261
4316
  const inputs = { source: { width: rect.width, height: rect.height, data: before } };
4262
4317
  const heightInput = d.inputs.find((i) => i.kind === "image" && /^(height|depth|relief)$/i.test(i.name));
4263
- const relief = _optionalChain([this, 'access', _220 => _220.doc, 'access', _221 => _221.thick, 'optionalAccess', _222 => _222[l.id]]);
4318
+ const relief = _optionalChain([this, 'access', _228 => _228.doc, 'access', _229 => _229.thick, 'optionalAccess', _230 => _230[l.id]]);
4264
4319
  if (heightInput && relief) {
4265
4320
  const h = _chunk474IQG74cjs.readRegion.call(void 0, relief.height, rect);
4266
4321
  const rgba = new Uint8ClampedArray(rect.width * rect.height * 4);
4267
4322
  for (let i = 0; i < h.length; i++) rgba.set([h[i], h[i], h[i], 255], i * 4);
4268
4323
  inputs[heightInput.name] = { width: rect.width, height: rect.height, data: rgba };
4269
4324
  }
4270
- const sourceInput = _nullishCoalesce(_optionalChain([d, 'access', _223 => _223.inputs, 'access', _224 => _224.find, 'call', _225 => _225((i) => i.kind === "image" && i.name !== _optionalChain([heightInput, 'optionalAccess', _226 => _226.name])), 'optionalAccess', _227 => _227.name]), () => ( "source"));
4325
+ const sourceInput = _nullishCoalesce(_optionalChain([d, 'access', _231 => _231.inputs, 'access', _232 => _232.find, 'call', _233 => _233((i) => i.kind === "image" && i.name !== _optionalChain([heightInput, 'optionalAccess', _234 => _234.name])), 'optionalAccess', _235 => _235.name]), () => ( "source"));
4271
4326
  if (sourceInput !== "source") {
4272
4327
  inputs[sourceInput] = inputs.source;
4273
4328
  delete inputs.source;
@@ -4523,7 +4578,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
4523
4578
  return l;
4524
4579
  })();
4525
4580
  const brush = this.strokeBrush(init);
4526
- const stickerLayer = Boolean(_optionalChain([doc, 'access', _228 => _228.stickers, 'optionalAccess', _229 => _229[layer.id], 'optionalAccess', _230 => _230.length]));
4581
+ const stickerLayer = Boolean(_optionalChain([doc, 'access', _236 => _236.stickers, 'optionalAccess', _237 => _237[layer.id], 'optionalAccess', _238 => _238.length]));
4527
4582
  if (brush.engine === "sticker") {
4528
4583
  if (!stickerLayer && _chunk474IQG74cjs.contentBounds.call(void 0, layer.surface)) throw new PaintEditorError(`Layer "${layer.name}" already has paint; spray stickers onto an empty layer (add_layer) so they stay editable.`);
4529
4584
  } else if (stickerLayer) {
@@ -4538,8 +4593,8 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
4538
4593
  if (doc !== this.doc) doc = { ...doc, layers: _chunkB46UQUDCcjs.mapLayer.call(void 0, doc.layers, layer.id, () => moved) };
4539
4594
  layer = moved;
4540
4595
  }
4541
- if (!this.wet.wetLayerIds().includes(layer.id) && this.wet.wetLayerIds().length >= _chunkKWNMBMKGcjs.MAX_WET_LANES) {
4542
- throw new PaintEditorError(`At most ${_chunkKWNMBMKGcjs.MAX_WET_LANES} layers can hold wet paint at once; dry one first (dry_paint).`);
4596
+ if (!this.wet.wetLayerIds().includes(layer.id) && this.wet.wetLayerIds().length >= _chunkXFYLA3ZOcjs.MAX_WET_LANES) {
4597
+ throw new PaintEditorError(`At most ${_chunkXFYLA3ZOcjs.MAX_WET_LANES} layers can hold wet paint at once; dry one first (dry_paint).`);
4543
4598
  }
4544
4599
  this.beginWetOp();
4545
4600
  const world = this.wet.ensureLane(layer.id, brush.wet.medium);
@@ -4573,7 +4628,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
4573
4628
  }
4574
4629
  let color = init.color === void 0 ? this.color : parseColor(init.color);
4575
4630
  const tracing = this.guides.tracing;
4576
- if (init.color === void 0 && init.start && _optionalChain([tracing, 'optionalAccess', _231 => _231.visible]) && tracing.sampleColors) color = _nullishCoalesce(this.sampleTracingColor(init.start.x, init.start.y), () => ( color));
4631
+ if (init.color === void 0 && init.start && _optionalChain([tracing, 'optionalAccess', _239 => _239.visible]) && tracing.sampleColors) color = _nullishCoalesce(this.sampleTracingColor(init.start.x, init.start.y), () => ( color));
4577
4632
  const perspective = this.guides.perspective;
4578
4633
  const snapper = init.snapToPerspective && perspective.enabled && perspective.snap ? new PerspectiveSnapper(perspective) : null;
4579
4634
  const useStencils = init.stencils !== false;
@@ -4602,7 +4657,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
4602
4657
  mixerLoad: _nullishCoalesce(init.load, () => ( brushLoadForStroke(brush, this.mixerLoad, [rgba[0] / 255, rgba[1] / 255, rgba[2] / 255]))),
4603
4658
  secondary: rgbaOf(this.secondaryColor),
4604
4659
  wet,
4605
- thick: brush.engine === "impasto" ? { channels: _nullishCoalesce(_optionalChain([doc, 'access', _232 => _232.thick, 'optionalAccess', _233 => _233[layer.id]]), () => ( emptyThickChannels())) } : void 0,
4660
+ thick: brush.engine === "impasto" ? { channels: _nullishCoalesce(_optionalChain([doc, 'access', _240 => _240.thick, 'optionalAccess', _241 => _241[layer.id]]), () => ( emptyThickChannels())) } : void 0,
4606
4661
  sticker: brush.engine === "sticker" ? { nextId: this.nextStickerNumber(doc) } : void 0,
4607
4662
  paint: this.strokeGradient(init, brush, color)
4608
4663
  });
@@ -4639,12 +4694,12 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
4639
4694
  const before = this.doc;
4640
4695
  const host = {
4641
4696
  update: (layerId, surface, rects) => {
4642
- if (_optionalChain([this, 'access', _234 => _234.session, 'optionalAccess', _235 => _235.init, 'access', _236 => _236.wet])) {
4697
+ if (_optionalChain([this, 'access', _242 => _242.session, 'optionalAccess', _243 => _243.init, 'access', _244 => _244.wet])) {
4643
4698
  this.wet.syncDisplays();
4644
4699
  return;
4645
4700
  }
4646
4701
  this.live = { layerId, surface };
4647
- const ch = _optionalChain([this, 'access', _237 => _237.session, 'optionalAccess', _238 => _238.thickChannels, 'call', _239 => _239()]);
4702
+ const ch = _optionalChain([this, 'access', _245 => _245.session, 'optionalAccess', _246 => _246.thickChannels, 'call', _247 => _247()]);
4648
4703
  this.liveThick = ch ? { layerId, channels: ch } : null;
4649
4704
  this.emit(rects);
4650
4705
  },
@@ -4656,7 +4711,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
4656
4711
  const wetStroke = Boolean(s.init.wet);
4657
4712
  if (wetStroke) this.wet.driver = null;
4658
4713
  const brush = s.init.brush;
4659
- if (!cancelled && _optionalChain([s, 'access', _240 => _240.result, 'optionalAccess', _241 => _241.mixerLoad])) this.keepLoad(brush, s.result.mixerLoad);
4714
+ if (!cancelled && _optionalChain([s, 'access', _248 => _248.result, 'optionalAccess', _249 => _249.mixerLoad])) this.keepLoad(brush, s.result.mixerLoad);
4660
4715
  if (cancelled || !surface) {
4661
4716
  if (this.wetOp) {
4662
4717
  const snap = this.wetOp.before;
@@ -4681,7 +4736,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
4681
4736
  const ch = s.thickChannels();
4682
4737
  const thick = ch ? { ..._nullishCoalesce(this.doc.thick, () => ( {})), [l.id]: ch } : this.doc.thick;
4683
4738
  const sprayed = s.stickers();
4684
- const stickers = sprayed ? { ..._nullishCoalesce(this.doc.stickers, () => ( {})), [l.id]: [..._nullishCoalesce(_optionalChain([this, 'access', _242 => _242.doc, 'access', _243 => _243.stickers, 'optionalAccess', _244 => _244[l.id]]), () => ( [])), ...sprayed] } : this.doc.stickers;
4739
+ const stickers = sprayed ? { ..._nullishCoalesce(this.doc.stickers, () => ( {})), [l.id]: [..._nullishCoalesce(_optionalChain([this, 'access', _250 => _250.doc, 'access', _251 => _251.stickers, 'optionalAccess', _252 => _252[l.id]]), () => ( [])), ...sprayed] } : this.doc.stickers;
4685
4740
  this.commit(`${brush.name} stroke`, this.withWetEvents({ ...this.doc, layers: _chunkB46UQUDCcjs.mapLayer.call(void 0, this.doc.layers, l.id, () => ({ ...l, surface })), strokes: [...this.doc.strokes, stroke], ...thick ? { thick } : {}, ...stickers ? { stickers } : {} }), wetStroke ? before : this.doc);
4686
4741
  }
4687
4742
  };
@@ -4719,7 +4774,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
4719
4774
  layers: _chunkB46UQUDCcjs.mapLayer.call(void 0, out.layers, l.id, () => ({ ...l, surface, offset })),
4720
4775
  strokes: [...out.strokes, stroke],
4721
4776
  ...ch ? { thick: { ..._nullishCoalesce(out.thick, () => ( {})), [l.id]: ch } } : {},
4722
- ...sprayed ? { stickers: { ..._nullishCoalesce(out.stickers, () => ( {})), [l.id]: [..._nullishCoalesce(_optionalChain([out, 'access', _245 => _245.stickers, 'optionalAccess', _246 => _246[l.id]]), () => ( [])), ...sprayed] } } : {}
4777
+ ...sprayed ? { stickers: { ..._nullishCoalesce(out.stickers, () => ( {})), [l.id]: [..._nullishCoalesce(_optionalChain([out, 'access', _253 => _253.stickers, 'optionalAccess', _254 => _254[l.id]]), () => ( [])), ...sprayed] } } : {}
4723
4778
  };
4724
4779
  }
4725
4780
  };
@@ -4777,7 +4832,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
4777
4832
  */
4778
4833
  replayStrokes(options) {
4779
4834
  this.requireIdle("replaying");
4780
- if (!_optionalChain([options, 'access', _247 => _247.strokeIds, 'optionalAccess', _248 => _248.length])) throw new PaintEditorError("strokeIds is empty; pass ids from list_strokes.");
4835
+ if (!_optionalChain([options, 'access', _255 => _255.strokeIds, 'optionalAccess', _256 => _256.length])) throw new PaintEditorError("strokeIds is empty; pass ids from list_strokes.");
4781
4836
  const strokes = options.strokeIds.map((id) => {
4782
4837
  const s = this.doc.strokes.find((x) => x.id === id);
4783
4838
  if (!s) throw new PaintEditorError(`Unknown stroke "${id}". Call list_strokes for the ids.`);
@@ -4853,7 +4908,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
4853
4908
  const id = _nullishCoalesce(layerId, () => ( this.doc.activeLayerId));
4854
4909
  if (!id) return null;
4855
4910
  this.requireLayer(id);
4856
- const ch = _optionalChain([this, 'access', _249 => _249.doc, 'access', _250 => _250.thick, 'optionalAccess', _251 => _251[id]]);
4911
+ const ch = _optionalChain([this, 'access', _257 => _257.doc, 'access', _258 => _258.thick, 'optionalAccess', _259 => _259[id]]);
4857
4912
  if (!ch) return null;
4858
4913
  const r = reliefInfo(ch);
4859
4914
  return { layerId: id, bounds: r.bounds, maxHeight: r.maxHeight };
@@ -4958,7 +5013,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
4958
5013
  wetState() {
4959
5014
  const st = this.getState().wet;
4960
5015
  const backend = this.wet.backend();
4961
- return { ...st, layers: this.wet.wetLayerIds().map((id) => this.wet.info(id)), backend, message: _nullishCoalesce(_optionalChain([backend, 'optionalAccess', _252 => _252.message]), () => ( _chunkKWNMBMKGcjs.wetSupport.call(void 0, ).message)), engine: this.wet.engineInfo() };
5016
+ return { ...st, layers: this.wet.wetLayerIds().map((id) => this.wet.info(id)), backend, message: _nullishCoalesce(_optionalChain([backend, 'optionalAccess', _260 => _260.message]), () => ( _chunkXFYLA3ZOcjs.wetSupport.call(void 0, ).message)), engine: this.wet.engineInfo() };
4962
5017
  }
4963
5018
  /**
4964
5019
  * Engine B, the WebGPU accelerator for large wet areas: whether it may run, its state (`off`,
@@ -5031,7 +5086,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
5031
5086
  const amount = _nullishCoalesce(options.amount, () => ( 1));
5032
5087
  if (!(amount > 0 && amount <= 1)) throw new PaintEditorError(`amount ${amount} is out of range; use above 0 up to 1.`);
5033
5088
  const rect = _nullishCoalesce(this.checkRect(options.rect), () => ( { x: 0, y: 0, width: this.doc.canvas.width, height: this.doc.canvas.height }));
5034
- if (!this.wet.wetLayerIds().includes(l.id) && this.wet.wetLayerIds().length >= _chunkKWNMBMKGcjs.MAX_WET_LANES) throw new PaintEditorError(`At most ${_chunkKWNMBMKGcjs.MAX_WET_LANES} layers can hold wet paint at once; dry one first (dry_paint).`);
5089
+ if (!this.wet.wetLayerIds().includes(l.id) && this.wet.wetLayerIds().length >= _chunkXFYLA3ZOcjs.MAX_WET_LANES) throw new PaintEditorError(`At most ${_chunkXFYLA3ZOcjs.MAX_WET_LANES} layers can hold wet paint at once; dry one first (dry_paint).`);
5035
5090
  const before = this.doc;
5036
5091
  this.beginWetOp();
5037
5092
  const world = this.wet.ensureLane(l.id);
@@ -5043,7 +5098,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
5043
5098
  }
5044
5099
  /** Records a settings change as a wet event (not an undo step). */
5045
5100
  recordWetSetting(e) {
5046
- this.doc = { ...this.doc, wetEvents: [..._nullishCoalesce(this.doc.wetEvents, () => ( [])), { clock: _nullishCoalesce(_optionalChain([this, 'access', _253 => _253.wet, 'access', _254 => _254.world, 'optionalAccess', _255 => _255.clock]), () => ( 0)), at: this.doc.strokes.length, ...e }] };
5101
+ this.doc = { ...this.doc, wetEvents: [..._nullishCoalesce(this.doc.wetEvents, () => ( [])), { clock: _nullishCoalesce(_optionalChain([this, 'access', _261 => _261.wet, 'access', _262 => _262.world, 'optionalAccess', _263 => _263.clock]), () => ( 0)), at: this.doc.strokes.length, ...e }] };
5047
5102
  }
5048
5103
  /** Changes a layer's wet settings (viscosity, evaporation, granulation…). Editor settings saved with the document, not an undo step. */
5049
5104
  setWetParams(layerId, update) {
@@ -5110,7 +5165,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
5110
5165
  currentLayers() {
5111
5166
  const live = this.live;
5112
5167
  if (!live) return this.doc.layers;
5113
- if (_optionalChain([this, 'access', _256 => _256.liveLayers, 'optionalAccess', _257 => _257.key]) === live.surface) return this.liveLayers.layers;
5168
+ if (_optionalChain([this, 'access', _264 => _264.liveLayers, 'optionalAccess', _265 => _265.key]) === live.surface) return this.liveLayers.layers;
5114
5169
  const layers = _chunkB46UQUDCcjs.mapLayer.call(void 0, this.doc.layers, live.layerId, (l) => ({ ...l, surface: live.surface }));
5115
5170
  this.liveLayers = { key: live.surface, layers };
5116
5171
  return layers;
@@ -5133,7 +5188,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
5133
5188
  tracingNode(t) {
5134
5189
  const { width, height } = this.doc.canvas;
5135
5190
  const key = this.tracingVersion * 100003 + width * 7 + height;
5136
- if (_optionalChain([this, 'access', _258 => _258.tracingCache, 'optionalAccess', _259 => _259.key]) === key && this.tracingCache.node.opacity === t.opacity) return this.tracingCache.node;
5191
+ if (_optionalChain([this, 'access', _266 => _266.tracingCache, 'optionalAccess', _267 => _267.key]) === key && this.tracingCache.node.opacity === t.opacity) return this.tracingCache.node;
5137
5192
  const src = _nullishCoalesce(this.imagePixels.get(t.src), () => ( this.decodeImage(t.src)));
5138
5193
  const image = resampleInto(src, t.rect, width, height);
5139
5194
  const node = { type: "image", id: TRACING_NODE_ID, name: "Tracing", visible: true, opacity: t.opacity, blend: "normal", image, version: key + Math.round(t.opacity * 1e3) / 1e4 };
@@ -5160,8 +5215,8 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
5160
5215
  let out = layers;
5161
5216
  const ids = /* @__PURE__ */ new Set([...Object.keys(_nullishCoalesce(thick, () => ( {}))), ...live ? [live.layerId] : []]);
5162
5217
  for (const id of ids) {
5163
- const ch = _optionalChain([live, 'optionalAccess', _260 => _260.layerId]) === id ? live.channels : _optionalChain([thick, 'optionalAccess', _261 => _261[id]]);
5164
- const l = ch && _optionalChain([_chunkB46UQUDCcjs.findLayer.call(void 0, out, id), 'optionalAccess', _262 => _262.layer]);
5218
+ const ch = _optionalChain([live, 'optionalAccess', _268 => _268.layerId]) === id ? live.channels : _optionalChain([thick, 'optionalAccess', _269 => _269[id]]);
5219
+ const l = ch && _optionalChain([_chunkB46UQUDCcjs.findLayer.call(void 0, out, id), 'optionalAccess', _270 => _270.layer]);
5165
5220
  if (!ch || !isPixelLayer(l)) continue;
5166
5221
  let cache = this.litCaches.get(id);
5167
5222
  if (!cache) this.litCaches.set(id, cache = new LitCache());
@@ -5174,7 +5229,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
5174
5229
  let layers = this.litLayers((_nullishCoalesce(options.wet, () => ( "display"))) === "dried" ? this.driedLayers() : this.currentLayers());
5175
5230
  if (options.layerIds) {
5176
5231
  const picked = [];
5177
- for (const id of options.layerIds) picked.push(_nullishCoalesce(_optionalChain([_chunkB46UQUDCcjs.findLayer.call(void 0, layers, id), 'optionalAccess', _263 => _263.layer]), () => ( this.requireLayer(id))));
5232
+ for (const id of options.layerIds) picked.push(_nullishCoalesce(_optionalChain([_chunkB46UQUDCcjs.findLayer.call(void 0, layers, id), 'optionalAccess', _271 => _271.layer]), () => ( this.requireLayer(id))));
5178
5233
  layers = picked.map((l) => ({ ...l, visible: true }));
5179
5234
  }
5180
5235
  const under = options.paper === false ? [] : [paperNode(this.doc.paper, this.lighting)];
@@ -5190,7 +5245,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
5190
5245
  */
5191
5246
  compositeTiles(rect, onTile, options = {}) {
5192
5247
  const dirty = options.dirty === "all" ? void 0 : options.dirty;
5193
- this.viewCompositor.compositeTiles(this.renderLayers({ paper: options.paper }, true), rect, this.sources(), onTile, { dirty, checkpointLayerId: _nullishCoalesce(_optionalChain([this, 'access', _264 => _264.live, 'optionalAccess', _265 => _265.layerId]), () => ( this.doc.activeLayerId)) });
5248
+ this.viewCompositor.compositeTiles(this.renderLayers({ paper: options.paper }, true), rect, this.sources(), onTile, { dirty, checkpointLayerId: _nullishCoalesce(_optionalChain([this, 'access', _272 => _272.live, 'optionalAccess', _273 => _273.layerId]), () => ( this.doc.activeLayerId)) });
5194
5249
  }
5195
5250
  /** The canvas as canvas-sized RGBA (paper included by default). */
5196
5251
  compositePixels(options = {}) {
@@ -5227,7 +5282,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
5227
5282
  this.wet.reset();
5228
5283
  if (!raw || typeof raw !== "object") return;
5229
5284
  const r = raw;
5230
- this.wet.setTilt(_chunkKWNMBMKGcjs.normalizeTilt.call(void 0, _nullishCoalesce(r.tilt, () => ( {}))));
5285
+ this.wet.setTilt(_chunkXFYLA3ZOcjs.normalizeTilt.call(void 0, _nullishCoalesce(r.tilt, () => ( {}))));
5231
5286
  if (r.layers && typeof r.layers === "object") {
5232
5287
  for (const [id, v] of Object.entries(r.layers)) {
5233
5288
  if (!v || typeof v !== "object") {
@@ -5235,7 +5290,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
5235
5290
  continue;
5236
5291
  }
5237
5292
  const x = v;
5238
- this.wet.settings.set(id, { params: _chunkKWNMBMKGcjs.normalizeWetParams.call(void 0, _nullishCoalesce(x.params, () => ( {}))), flow: _chunkKWNMBMKGcjs.normalizeFlow.call(void 0, _nullishCoalesce(x.flow, () => ( {}))) });
5293
+ this.wet.settings.set(id, { params: _chunkXFYLA3ZOcjs.normalizeWetParams.call(void 0, _nullishCoalesce(x.params, () => ( {}))), flow: _chunkXFYLA3ZOcjs.normalizeFlow.call(void 0, _nullishCoalesce(x.flow, () => ( {}))) });
5239
5294
  }
5240
5295
  }
5241
5296
  }
@@ -5254,7 +5309,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
5254
5309
  for (const [id, list] of Object.entries(_nullishCoalesce(this.doc.stickers, () => ( {})))) if (list.length && _chunkB46UQUDCcjs.findLayer.call(void 0, this.doc.layers, id)) stickers[id] = list.map((x) => ({ ...x }));
5255
5310
  if (Object.keys(stickers).length) ext.stickers = stickers;
5256
5311
  else delete ext.stickers;
5257
- const effectLayers = effectLayersToJSON(_nullishCoalesce(this.doc.effectLayers, () => ( {})), (id) => isPixelLayer(_optionalChain([_chunkB46UQUDCcjs.findLayer.call(void 0, this.doc.layers, id), 'optionalAccess', _266 => _266.layer])));
5312
+ const effectLayers = effectLayersToJSON(_nullishCoalesce(this.doc.effectLayers, () => ( {})), (id) => isPixelLayer(_optionalChain([_chunkB46UQUDCcjs.findLayer.call(void 0, this.doc.layers, id), 'optionalAccess', _274 => _274.layer])));
5258
5313
  if (effectLayers) ext.effectLayers = effectLayers;
5259
5314
  else delete ext.effectLayers;
5260
5315
  if (this.doc.paperEffect) ext.paperEffect = paperEffectToJSON(this.doc.paperEffect);
@@ -5280,7 +5335,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
5280
5335
  if (ext.effectLayers && typeof ext.effectLayers === "object") {
5281
5336
  const effectLayers = {};
5282
5337
  for (const [id, v] of Object.entries(ext.effectLayers)) {
5283
- if (!isPixelLayer(_optionalChain([_chunkB46UQUDCcjs.findLayer.call(void 0, state.layers, id), 'optionalAccess', _267 => _267.layer]))) continue;
5338
+ if (!isPixelLayer(_optionalChain([_chunkB46UQUDCcjs.findLayer.call(void 0, state.layers, id), 'optionalAccess', _275 => _275.layer]))) continue;
5284
5339
  const source = readPaintEffectSource(v);
5285
5340
  if (source) effectLayers[id] = source;
5286
5341
  else problems.push(`The effect of layer "${id}" could not be read; it loads as a plain layer.`);
@@ -5321,7 +5376,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
5321
5376
  this.readGuides(loaded.guides, loaded.state, loaded.problems);
5322
5377
  if (Array.isArray(loaded.swatches)) this.swatches = loaded.swatches.map(readSwatch).filter((x) => x !== null);
5323
5378
  for (const s of loaded.state.strokes) {
5324
- const n = Number(_nullishCoalesce(_optionalChain([/^s(\d+)$/, 'access', _268 => _268.exec, 'call', _269 => _269(s.id), 'optionalAccess', _270 => _270[1]]), () => ( 0)));
5379
+ const n = Number(_nullishCoalesce(_optionalChain([/^s(\d+)$/, 'access', _276 => _276.exec, 'call', _277 => _277(s.id), 'optionalAccess', _278 => _278[1]]), () => ( 0)));
5325
5380
  if (n >= this.strokeCounter) this.strokeCounter = n + 1;
5326
5381
  }
5327
5382
  this.undoStack = [];
@@ -5415,8 +5470,8 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
5415
5470
  const layers = toStandard(dried);
5416
5471
  const result = _chunkS55JFWDAcjs.exportPsd.call(void 0, { width, height, layers: [paperLayer, ...layers], merged, resolution: dpi });
5417
5472
  for (const [mode, names] of changed) {
5418
- const label = _nullishCoalesce(_optionalChain([_chunkOLNIPTB3cjs.BLEND_MODES, 'access', _271 => _271.find, 'call', _272 => _272((m) => m.id === mode), 'optionalAccess', _273 => _273.label]), () => ( mode));
5419
- const std = _nullishCoalesce(_optionalChain([_chunkOLNIPTB3cjs.BLEND_MODES, 'access', _274 => _274.find, 'call', _275 => _275((m) => m.id === _chunkOLNIPTB3cjs.standardBlendMode.call(void 0, mode)), 'optionalAccess', _276 => _276.label]), () => ( _chunkOLNIPTB3cjs.standardBlendMode.call(void 0, mode)));
5473
+ const label = _nullishCoalesce(_optionalChain([_chunkOLNIPTB3cjs.BLEND_MODES, 'access', _279 => _279.find, 'call', _280 => _280((m) => m.id === mode), 'optionalAccess', _281 => _281.label]), () => ( mode));
5474
+ const std = _nullishCoalesce(_optionalChain([_chunkOLNIPTB3cjs.BLEND_MODES, 'access', _282 => _282.find, 'call', _283 => _283((m) => m.id === _chunkOLNIPTB3cjs.standardBlendMode.call(void 0, mode)), 'optionalAccess', _284 => _284.label]), () => ( _chunkOLNIPTB3cjs.standardBlendMode.call(void 0, mode)));
5420
5475
  const list = names.map((n) => `"${n}"`).join(", ");
5421
5476
  const one = names.length === 1;
5422
5477
  result.warnings.push(`${label} blending has no PSD equivalent; ${list} ${one ? "was" : "were"} written as ${std}, the nearest Photoshop mode, so ${one ? "it looks" : "they look"} different in Photoshop (the merged image is exact).`);
@@ -5532,7 +5587,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
5532
5587
  const { src, pixels } = this.importImage(options, "The reference image");
5533
5588
  const ref2 = {
5534
5589
  id: `ref${this.nextReferenceId++}`,
5535
- name: _optionalChain([options, 'access', _277 => _277.name, 'optionalAccess', _278 => _278.trim, 'call', _279 => _279()]) || `Reference ${this.guides.references.length + 1}`,
5590
+ name: _optionalChain([options, 'access', _285 => _285.name, 'optionalAccess', _286 => _286.trim, 'call', _287 => _287()]) || `Reference ${this.guides.references.length + 1}`,
5536
5591
  src,
5537
5592
  width: pixels.width,
5538
5593
  height: pixels.height,
@@ -5611,7 +5666,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
5611
5666
  try {
5612
5667
  const px = this.decodeImage(ref2.src, `Reference "${ref2.name}"`);
5613
5668
  guides.references.push({ id: ref2.id, name: String(_nullishCoalesce(ref2.name, () => ( ref2.id))), src: ref2.src, width: px.width, height: px.height, x: Number(ref2.x) || 0, y: Number(ref2.y) || 0, displayWidth: Number(ref2.displayWidth) || 240, visible: ref2.visible !== false });
5614
- const n = Number(_nullishCoalesce(_optionalChain([/^ref(\d+)$/, 'access', _280 => _280.exec, 'call', _281 => _281(ref2.id), 'optionalAccess', _282 => _282[1]]), () => ( 0)));
5669
+ const n = Number(_nullishCoalesce(_optionalChain([/^ref(\d+)$/, 'access', _288 => _288.exec, 'call', _289 => _289(ref2.id), 'optionalAccess', _290 => _290[1]]), () => ( 0)));
5615
5670
  if (n >= this.nextReferenceId) this.nextReferenceId = n + 1;
5616
5671
  } catch (e) {
5617
5672
  problems.push(e.message);
@@ -5622,7 +5677,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
5622
5677
  guides.stencils = [];
5623
5678
  r.stencils.forEach((raw2, i) => {
5624
5679
  try {
5625
- const id = typeof _optionalChain([raw2, 'optionalAccess', _283 => _283.id]) === "string" && /^stencil\d+$/.test(raw2.id) ? raw2.id : `stencil${this.nextStencilId}`;
5680
+ const id = typeof _optionalChain([raw2, 'optionalAccess', _291 => _291.id]) === "string" && /^stencil\d+$/.test(raw2.id) ? raw2.id : `stencil${this.nextStencilId}`;
5626
5681
  guides.stencils.push(normalizeStencil(raw2, id));
5627
5682
  const n = Number(id.slice(7));
5628
5683
  if (n >= this.nextStencilId) this.nextStencilId = n + 1;
@@ -5645,12 +5700,12 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
5645
5700
  /** The next free sticker number (ids `st<n>` are unique across the document). */
5646
5701
  nextStickerNumber(doc = this.doc) {
5647
5702
  let n = 0;
5648
- for (const list of Object.values(_nullishCoalesce(doc.stickers, () => ( {})))) for (const st of list) n = Math.max(n, Number(_nullishCoalesce(_optionalChain([/^st(\d+)$/, 'access', _284 => _284.exec, 'call', _285 => _285(st.id), 'optionalAccess', _286 => _286[1]]), () => ( 0))));
5703
+ for (const list of Object.values(_nullishCoalesce(doc.stickers, () => ( {})))) for (const st of list) n = Math.max(n, Number(_nullishCoalesce(_optionalChain([/^st(\d+)$/, 'access', _292 => _292.exec, 'call', _293 => _293(st.id), 'optionalAccess', _294 => _294[1]]), () => ( 0))));
5649
5704
  return n + 1;
5650
5705
  }
5651
5706
  stickerLayer(layerId) {
5652
5707
  const l = this.wetLayer(layerId, "edit the stickers of");
5653
- const stickers = _optionalChain([this, 'access', _287 => _287.doc, 'access', _288 => _288.stickers, 'optionalAccess', _289 => _289[l.id]]);
5708
+ const stickers = _optionalChain([this, 'access', _295 => _295.doc, 'access', _296 => _296.stickers, 'optionalAccess', _297 => _297[l.id]]);
5654
5709
  if (!stickers) throw new PaintEditorError(`Layer "${l.name}" has no stickers; spray some with a sticker brush (list_brushes category sticker).`);
5655
5710
  return { layer: l, stickers };
5656
5711
  }
@@ -5659,7 +5714,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
5659
5714
  const id = _nullishCoalesce(layerId, () => ( this.doc.activeLayerId));
5660
5715
  if (!id) return [];
5661
5716
  this.requireLayer(id);
5662
- return (_nullishCoalesce(_optionalChain([this, 'access', _290 => _290.doc, 'access', _291 => _291.stickers, 'optionalAccess', _292 => _292[id]]), () => ( []))).map((s) => ({ ...s }));
5717
+ return (_nullishCoalesce(_optionalChain([this, 'access', _298 => _298.doc, 'access', _299 => _299.stickers, 'optionalAccess', _300 => _300[id]]), () => ( []))).map((s) => ({ ...s }));
5663
5718
  }
5664
5719
  /** Replaces a layer's stickers and redraws its pixels from them (one undo step). */
5665
5720
  commitStickers(label, layer, stickers) {
@@ -5715,7 +5770,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
5715
5770
  stencilSelection(stencils = this.guides.stencils) {
5716
5771
  const { width, height } = this.doc.canvas;
5717
5772
  const size = `${width}x${height}`;
5718
- if (_optionalChain([this, 'access', _293 => _293.stencilCache, 'optionalAccess', _294 => _294.key]) === stencils && this.stencilCache.size === size) return this.stencilCache.mask;
5773
+ if (_optionalChain([this, 'access', _301 => _301.stencilCache, 'optionalAccess', _302 => _302.key]) === stencils && this.stencilCache.size === size) return this.stencilCache.mask;
5719
5774
  const mask = stencilMask(stencils, width, height);
5720
5775
  this.stencilCache = { key: stencils, size, mask };
5721
5776
  return mask;
@@ -5777,7 +5832,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
5777
5832
  makeSwatch(color, name) {
5778
5833
  const p = typeof color === "string" ? { type: "color", color: parseColor(color) } : this.readStrokePaint(color);
5779
5834
  const out = { color: _chunkPQ3H2AANcjs.paintSourceColor.call(void 0, p, { paint: this.color, secondary: this.secondaryColor }) };
5780
- if (_optionalChain([name, 'optionalAccess', _295 => _295.trim, 'call', _296 => _296()])) out.name = name.trim();
5835
+ if (_optionalChain([name, 'optionalAccess', _303 => _303.trim, 'call', _304 => _304()])) out.name = name.trim();
5781
5836
  if (p.type === "gradient") out.paint = p;
5782
5837
  return out;
5783
5838
  }
@@ -5829,7 +5884,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
5829
5884
  * mix becomes the paint colour. Returns the mixed colour and the pile's bounds.
5830
5885
  */
5831
5886
  mixOnPad(paints, options = {}) {
5832
- const parsed = (_nullishCoalesce(paints, () => ( []))).map((p, i) => ({ color: parseColor(_optionalChain([p, 'optionalAccess', _297 => _297.color]), `paints[${i}].color`), parts: _optionalChain([p, 'optionalAccess', _298 => _298.parts]) }));
5887
+ const parsed = (_nullishCoalesce(paints, () => ( []))).map((p, i) => ({ color: parseColor(_optionalChain([p, 'optionalAccess', _305 => _305.color]), `paints[${i}].color`), parts: _optionalChain([p, 'optionalAccess', _306 => _306.parts]) }));
5833
5888
  let r;
5834
5889
  try {
5835
5890
  r = this.pad.mix(parsed, options);
@@ -5918,7 +5973,7 @@ var PaintEditorController = (_class10 = class _PaintEditorController {
5918
5973
  }
5919
5974
  /** A layer's tile surface (live while stroking), for thumbnails. */
5920
5975
  layerSurface(id) {
5921
- const l = _optionalChain([_chunkB46UQUDCcjs.findLayer.call(void 0, this.currentLayers(), id), 'optionalAccess', _299 => _299.layer]);
5976
+ const l = _optionalChain([_chunkB46UQUDCcjs.findLayer.call(void 0, this.currentLayers(), id), 'optionalAccess', _307 => _307.layer]);
5922
5977
  return isPixelLayer(l) ? l.surface : null;
5923
5978
  }
5924
5979
  }, _class10);
@@ -5944,7 +5999,7 @@ function shiftDocument(doc, dx, dy) {
5944
5999
  if (doc.stickers) out.stickers = Object.fromEntries(Object.entries(doc.stickers).map(([id, list]) => [id, moveStickers(list)]));
5945
6000
  if (doc.paintEvents) {
5946
6001
  out.paintEvents = doc.paintEvents.map((e) => {
5947
- const list = e.kind === "stickers" ? _optionalChain([e, 'access', _300 => _300.data, 'optionalAccess', _301 => _301.stickers]) : void 0;
6002
+ const list = e.kind === "stickers" ? _optionalChain([e, 'access', _308 => _308.data, 'optionalAccess', _309 => _309.stickers]) : void 0;
5948
6003
  return list ? { ...e, data: { ...e.data, stickers: moveStickers(list) } } : e;
5949
6004
  });
5950
6005
  }
@@ -6026,8 +6081,8 @@ function strokeSchedule(points) {
6026
6081
  return total > 0 ? acc.map((d) => d / total) : points.map(() => 1);
6027
6082
  }
6028
6083
  function strokeDuration(points, max = 1800) {
6029
- const t0 = _optionalChain([points, 'access', _302 => _302[0], 'optionalAccess', _303 => _303.t]);
6030
- const t1 = _optionalChain([points, 'access', _304 => _304[points.length - 1], 'optionalAccess', _305 => _305.t]);
6084
+ const t0 = _optionalChain([points, 'access', _310 => _310[0], 'optionalAccess', _311 => _311.t]);
6085
+ const t1 = _optionalChain([points, 'access', _312 => _312[points.length - 1], 'optionalAccess', _313 => _313.t]);
6031
6086
  let ms;
6032
6087
  if (points.every((p) => Number.isFinite(p.t)) && t1 > t0) ms = t1 - t0;
6033
6088
  else {
@@ -6081,7 +6136,7 @@ var PaintDirector = class {
6081
6136
  }
6082
6137
  where(id) {
6083
6138
  const a = this.presence.get(id);
6084
- return { x: _nullishCoalesce(_optionalChain([a, 'optionalAccess', _306 => _306.x]), () => ( 0)), y: _nullishCoalesce(_optionalChain([a, 'optionalAccess', _307 => _307.y]), () => ( 0)) };
6139
+ return { x: _nullishCoalesce(_optionalChain([a, 'optionalAccess', _314 => _314.x]), () => ( 0)), y: _nullishCoalesce(_optionalChain([a, 'optionalAccess', _315 => _315.y]), () => ( 0)) };
6085
6140
  }
6086
6141
  /** Glides to `to`; an actor that just appeared starts there instead of the corner. */
6087
6142
  async glide(id, to, ms = 380) {
@@ -6128,8 +6183,8 @@ var PaintDirector = class {
6128
6183
  }
6129
6184
  case "replay": {
6130
6185
  await this.say(id, command.note, 500);
6131
- const source = c.getStrokes().filter((s) => _optionalChain([command, 'access', _308 => _308.replay, 'access', _309 => _309.strokeIds, 'optionalAccess', _310 => _310.includes, 'call', _311 => _311(s.id)]));
6132
- const first = _optionalChain([source, 'access', _312 => _312[0], 'optionalAccess', _313 => _313.points, 'access', _314 => _314[0]]);
6186
+ const source = c.getStrokes().filter((s) => _optionalChain([command, 'access', _316 => _316.replay, 'access', _317 => _317.strokeIds, 'optionalAccess', _318 => _318.includes, 'call', _319 => _319(s.id)]));
6187
+ const first = _optionalChain([source, 'access', _320 => _320[0], 'optionalAccess', _321 => _321.points, 'access', _322 => _322[0]]);
6133
6188
  if (first) await this.glide(id, first);
6134
6189
  const result = c.replayStrokes(command.replay);
6135
6190
  if (result.bounds) await this.glide(id, centre(result.bounds), 520);
@@ -6885,7 +6940,7 @@ function createPaintWetTools(c) {
6885
6940
  type: "object",
6886
6941
  properties: {
6887
6942
  layerId: LAYER_ID2,
6888
- kind: { type: "string", enum: [..._chunkKWNMBMKGcjs.WET_FLOW_KINDS], description: "none, linear, swirl, radial or turbulent." },
6943
+ kind: { type: "string", enum: [..._chunkXFYLA3ZOcjs.WET_FLOW_KINDS], description: "none, linear, swirl, radial or turbulent." },
6889
6944
  strength: UNIT("How hard it pushes, 0..1 (1 is about a 25\xB0 tilt; default 0.5)."),
6890
6945
  angle: { type: "number", minimum: -360, maximum: 360, description: "linear: direction in degrees clockwise from canvas down (default 0)." },
6891
6946
  center: {
@@ -7433,7 +7488,7 @@ function createPaintEditorToolProvider(controller, options = {}) {
7433
7488
  add({
7434
7489
  name: "extend_canvas",
7435
7490
  title: "Extend the canvas",
7436
- description: "Grows the canvas by adding pixels on any side, keeping everything painted. Adding on the left or top moves the whole picture (layers, paper grain, guides, stencils, recorded strokes) right or down by that much in document pixels, so coordinates you read before change by (+left, +top). Wet paint dries first. One undo step. Returns the canvas, rect (the new canvas in the previous coordinates: x -left, y -top) and origin.",
7491
+ description: "Grows the canvas by adding pixels on any side, keeping everything painted. Adding on the left or top moves the whole picture (layers, paper grain, guides, stencils, recorded strokes) right or down by that much in document pixels, so coordinates you read before change by (+left, +top). Wet paint stays wet and moves with it when left and top are multiples of 256; otherwise it dries first. One undo step. Returns the canvas, rect (the new canvas in the previous coordinates: x -left, y -top) and origin.",
7437
7492
  inputSchema: {
7438
7493
  type: "object",
7439
7494
  properties: { left: EXTEND_SIDE("left"), top: EXTEND_SIDE("top"), right: EXTEND_SIDE("right"), bottom: EXTEND_SIDE("bottom") },
@@ -7670,7 +7725,7 @@ function createPaintEditorToolProvider(controller, options = {}) {
7670
7725
  annotations: { title: "List brushes", ...READ6 },
7671
7726
  handler: () => {
7672
7727
  const s = c.getState();
7673
- return { activeBrushId: s.brush.id, activeEdited: !s.brush.builtin && Boolean(_optionalChain([c, 'access', _315 => _315.getBrush, 'call', _316 => _316(s.brush.id), 'optionalAccess', _317 => _317.builtin])), brushes: s.brushes.map(brushSummary) };
7728
+ return { activeBrushId: s.brush.id, activeEdited: !s.brush.builtin && Boolean(_optionalChain([c, 'access', _323 => _323.getBrush, 'call', _324 => _324(s.brush.id), 'optionalAccess', _325 => _325.builtin])), brushes: s.brushes.map(brushSummary) };
7674
7729
  }
7675
7730
  });
7676
7731
  add({
@@ -7908,7 +7963,7 @@ function createPaintEditorToolProvider(controller, options = {}) {
7908
7963
  color: s.color,
7909
7964
  points: ids ? s.points : s.points.length,
7910
7965
  seed: s.seed,
7911
- copies: _nullishCoalesce(_optionalChain([s, 'access', _318 => _318.copies, 'optionalAccess', _319 => _319.length]), () => ( 0)),
7966
+ copies: _nullishCoalesce(_optionalChain([s, 'access', _326 => _326.copies, 'optionalAccess', _327 => _327.length]), () => ( 0)),
7912
7967
  bounds: { x: Math.floor(Math.min(...xs) - pad), y: Math.floor(Math.min(...ys) - pad), width: Math.ceil(Math.max(...xs) - Math.min(...xs) + 2 * pad), height: Math.ceil(Math.max(...ys) - Math.min(...ys) + 2 * pad) }
7913
7968
  };
7914
7969
  })
@@ -8061,7 +8116,7 @@ function createPaintEditorToolProvider(controller, options = {}) {
8061
8116
  tools.push(...createPaintThickTools(c));
8062
8117
  tools.push(...createPaintReplayTools(c));
8063
8118
  tools.push(...createPaintStickerTools(c));
8064
- tools.push(..._chunkKWNMBMKGcjs.createPigmentTools.call(void 0, ));
8119
+ tools.push(..._chunkXFYLA3ZOcjs.createPigmentTools.call(void 0, ));
8065
8120
  const exclude = new Set(_nullishCoalesce(options.exclude, () => ( [])));
8066
8121
  const description = "Natural-media painting: paper and grain, dry and wet brushes, the brush library, strokes as data, pigment mixing, stencils, guides, layers and export.";
8067
8122
  return withPaintPlayback({
@@ -8075,16 +8130,16 @@ function createPaintEditorToolProvider(controller, options = {}) {
8075
8130
  }
8076
8131
  function hostTool({ coordinates, ...tool }, { origin, onChange }) {
8077
8132
  if (!origin && !onChange) return tool;
8078
- const write = !_optionalChain([tool, 'access', _320 => _320.annotations, 'optionalAccess', _321 => _321.readOnlyHint]);
8133
+ const write = !_optionalChain([tool, 'access', _328 => _328.annotations, 'optionalAccess', _329 => _329.readOnlyHint]);
8079
8134
  const done = (result) => {
8080
- if (write) _optionalChain([onChange, 'optionalCall', _322 => _322({ tool: tool.name })]);
8081
- return origin && _optionalChain([coordinates, 'optionalAccess', _323 => _323.out]) ? fromDocument(result, coordinates.out, origin) : result;
8135
+ if (write) _optionalChain([onChange, 'optionalCall', _330 => _330({ tool: tool.name })]);
8136
+ return origin && _optionalChain([coordinates, 'optionalAccess', _331 => _331.out]) ? fromDocument(result, coordinates.out, origin) : result;
8082
8137
  };
8083
8138
  return {
8084
8139
  ...tool,
8085
8140
  ...origin ? { description: hostedText(_nullishCoalesce(tool.description, () => ( ""))), inputSchema: hostedSchema(tool.inputSchema) } : {},
8086
8141
  handler: (args, context) => {
8087
- const r = tool.handler(origin && _optionalChain([coordinates, 'optionalAccess', _324 => _324.in]) ? toDocument(args, coordinates.in, origin) : args, context);
8142
+ const r = tool.handler(origin && _optionalChain([coordinates, 'optionalAccess', _332 => _332.in]) ? toDocument(args, coordinates.in, origin) : args, context);
8088
8143
  return r instanceof Promise ? r.then(done) : done(r);
8089
8144
  }
8090
8145
  };
@@ -8192,12 +8247,12 @@ var PaintGesture = (_class11 = class {
8192
8247
  if (!m || m.pointerId !== e.pointerId) return;
8193
8248
  this.mode = null;
8194
8249
  this.predicted = [];
8195
- if (m.kind === "stroke") _optionalChain([this, 'access', _325 => _325.controller, 'access', _326 => _326.activeStroke, 'optionalAccess', _327 => _327.end, 'call', _328 => _328()]);
8250
+ if (m.kind === "stroke") _optionalChain([this, 'access', _333 => _333.controller, 'access', _334 => _334.activeStroke, 'optionalAccess', _335 => _335.end, 'call', _336 => _336()]);
8196
8251
  }
8197
8252
  cancel() {
8198
8253
  this.penDown = false;
8199
8254
  this.predicted = [];
8200
- if (_optionalChain([this, 'access', _329 => _329.mode, 'optionalAccess', _330 => _330.kind]) === "stroke") _optionalChain([this, 'access', _331 => _331.controller, 'access', _332 => _332.activeStroke, 'optionalAccess', _333 => _333.cancel, 'call', _334 => _334()]);
8255
+ if (_optionalChain([this, 'access', _337 => _337.mode, 'optionalAccess', _338 => _338.kind]) === "stroke") _optionalChain([this, 'access', _339 => _339.controller, 'access', _340 => _340.activeStroke, 'optionalAccess', _341 => _341.cancel, 'call', _342 => _342()]);
8201
8256
  this.mode = null;
8202
8257
  }
8203
8258
  get active() {
@@ -8331,7 +8386,7 @@ var PAPER_SLIDERS = [
8331
8386
  ];
8332
8387
  function readPath(obj, path) {
8333
8388
  let v = obj;
8334
- for (const k of path.split(".")) v = _optionalChain([v, 'optionalAccess', _335 => _335[k]]);
8389
+ for (const k of path.split(".")) v = _optionalChain([v, 'optionalAccess', _343 => _343[k]]);
8335
8390
  return typeof v === "number" ? v : 0;
8336
8391
  }
8337
8392
  function patchPath(obj, path, value) {
@@ -8453,7 +8508,7 @@ function brushEngineControls(brush) {
8453
8508
  impastoTool: true
8454
8509
  };
8455
8510
  case "wet": {
8456
- const tool = _nullishCoalesce(_optionalChain([brush, 'access', _336 => _336.wet, 'optionalAccess', _337 => _337.tool]), () => ( "paint"));
8511
+ const tool = _nullishCoalesce(_optionalChain([brush, 'access', _344 => _344.wet, 'optionalAccess', _345 => _345.tool]), () => ( "paint"));
8457
8512
  const sliders = tool === "paint" ? [
8458
8513
  { path: "wet.water", label: "Water", min: 0, max: 1, step: 0.01 },
8459
8514
  { path: "wet.pigment", label: "Pigment", min: 0, max: 1, step: 0.01 },
@@ -8586,7 +8641,7 @@ function startWetClock(controller, frame, cancel) {
8586
8641
  id = raf(loop);
8587
8642
  return () => {
8588
8643
  stopped = true;
8589
- _optionalChain([caf, 'optionalCall', _338 => _338(id)]);
8644
+ _optionalChain([caf, 'optionalCall', _346 => _346(id)]);
8590
8645
  };
8591
8646
  }
8592
8647
  function drawWaterOverlay(controller, ctx) {
@@ -9144,4 +9199,4 @@ function createPaintEditorDocument(controller, options = {}) {
9144
9199
 
9145
9200
 
9146
9201
 
9147
- exports.BLEND_MENU_GROUPS = BLEND_MENU_GROUPS; exports.BLEND_MODES = _chunkOLNIPTB3cjs.BLEND_MODES; exports.BRUSH_ID = _chunkROVK6AXXcjs.BRUSH_ID; exports.BRUSH_ROTATIONS = _chunkROVK6AXXcjs.BRUSH_ROTATIONS; exports.BRUSH_SLIDERS = BRUSH_SLIDERS; exports.BUILTIN_BRUSHES = _chunkROVK6AXXcjs.BUILTIN_BRUSHES; exports.BristleStroke = _chunkROVK6AXXcjs.BristleStroke; exports.DEFAULT_BEHAVIOR = _chunkROVK6AXXcjs.DEFAULT_BEHAVIOR; exports.DEFAULT_BRISTLE = _chunkROVK6AXXcjs.DEFAULT_BRISTLE; exports.DEFAULT_BRUSH_ID = _chunkROVK6AXXcjs.DEFAULT_BRUSH_ID; exports.DEFAULT_DPI = DEFAULT_DPI; exports.DEFAULT_DYNAMICS = _chunkROVK6AXXcjs.DEFAULT_DYNAMICS; exports.DEFAULT_FLOW = _chunkKWNMBMKGcjs.DEFAULT_FLOW; exports.DEFAULT_IMPASTO = _chunkROVK6AXXcjs.DEFAULT_IMPASTO; exports.DEFAULT_LIGHTING = DEFAULT_LIGHTING; exports.DEFAULT_MULTI_COLOR = _chunkROVK6AXXcjs.DEFAULT_MULTI_COLOR; exports.DEFAULT_PAINT_GRADIENT = _chunkPQ3H2AANcjs.DEFAULT_PAINT_GRADIENT; exports.DEFAULT_PAINT_GRADIENT_MAPPING = _chunkPQ3H2AANcjs.DEFAULT_PAINT_GRADIENT_MAPPING; exports.DEFAULT_PAPER = _chunkROVK6AXXcjs.DEFAULT_PAPER; exports.DEFAULT_PARTICLE = _chunkROVK6AXXcjs.DEFAULT_PARTICLE; exports.DEFAULT_STICKER = _chunkROVK6AXXcjs.DEFAULT_STICKER; exports.DEFAULT_SWATCHES = DEFAULT_SWATCHES; exports.DEFAULT_VIEW = DEFAULT_VIEW; exports.DEFAULT_WET_BRUSH = _chunkROVK6AXXcjs.DEFAULT_WET_BRUSH; exports.DEFAULT_WET_PARAMS = _chunkKWNMBMKGcjs.DEFAULT_WET_PARAMS; exports.DryStroke = _chunkROVK6AXXcjs.DryStroke; exports.GPU_LEAD = GPU_LEAD; exports.GRAIN_PATTERNS = _chunkPQ3H2AANcjs.GRAIN_PATTERNS; exports.GRAIN_TILE = _chunkPQ3H2AANcjs.GRAIN_TILE; exports.HARMONY_KINDS = _chunkEUIDTZNQcjs.HARMONY_KINDS; exports.IDENTITY_AFFINE = IDENTITY_AFFINE; exports.IDENTITY_COPY = _chunkROVK6AXXcjs.IDENTITY_COPY; exports.IMPASTO_TOOLS = _chunkROVK6AXXcjs.IMPASTO_TOOLS; exports.IMPASTO_TOOL_LABELS = IMPASTO_TOOL_LABELS; exports.LIGHT_SLIDERS = LIGHT_SLIDERS; exports.LitCache = LitCache; exports.MAX_BRUSH_SIZE = _chunkPQ3H2AANcjs.MAX_BRUSH_SIZE; exports.MAX_CANVAS_SIDE = MAX_CANVAS_SIDE; exports.MAX_COORDINATE = MAX_COORDINATE; exports.MAX_IMAGE_SIDE = MAX_IMAGE_SIDE; exports.MAX_ZOOM = MAX_ZOOM; exports.MIN_CANVAS_SIDE = MIN_CANVAS_SIDE; exports.MIN_ZOOM = MIN_ZOOM; exports.MIXING_PAD_HEIGHT = MIXING_PAD_HEIGHT; exports.MIXING_PAD_WIDTH = MIXING_PAD_WIDTH; exports.MULTI_COLOR_MODES = _chunkROVK6AXXcjs.MULTI_COLOR_MODES; exports.MixingPad = MixingPad; exports.PAD_SAMPLE_SIZES = PAD_SAMPLE_SIZES; exports.PAINTERLY_BLEND_MODES = _chunkOLNIPTB3cjs.PAINTERLY_BLEND_MODES; exports.PAINT_BRUSH_CATEGORIES = _chunkROVK6AXXcjs.PAINT_BRUSH_CATEGORIES; exports.PAINT_BRUSH_ENGINES = _chunkROVK6AXXcjs.PAINT_BRUSH_ENGINES; exports.PAINT_COLOR_JSON_SCHEMA = _chunkPQ3H2AANcjs.PAINT_COLOR_JSON_SCHEMA; exports.PAINT_EFFECT_PLACES = PAINT_EFFECT_PLACES; exports.PAINT_FORMAT = PAINT_FORMAT; exports.PAINT_GRADIENT_FULL_SPEED = _chunkPQ3H2AANcjs.PAINT_GRADIENT_FULL_SPEED; exports.PAINT_GRADIENT_JSON_SCHEMA = _chunkPQ3H2AANcjs.PAINT_GRADIENT_JSON_SCHEMA; exports.PAINT_GRADIENT_KIT = _chunkPQ3H2AANcjs.PAINT_GRADIENT_KIT; exports.PAINT_GRADIENT_MAPPINGS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_MAPPINGS; exports.PAINT_GRADIENT_MAPPING_LABELS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_MAPPING_LABELS; exports.PAINT_GRADIENT_PRESETS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_PRESETS; exports.PAINT_GRADIENT_REPEATS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_REPEATS; exports.PAINT_GRADIENT_REPEAT_LABELS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_REPEAT_LABELS; exports.PAINT_GRADIENT_SPACES = _chunkPQ3H2AANcjs.PAINT_GRADIENT_SPACES; exports.PAINT_GRADIENT_SPACE_LABELS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_SPACE_LABELS; exports.PAINT_SCHEMA_VERSION = PAINT_SCHEMA_VERSION; exports.PAINT_SOURCE_JSON_SCHEMA = _chunkPQ3H2AANcjs.PAINT_SOURCE_JSON_SCHEMA; exports.PAINT_TOOLS = PAINT_TOOLS; exports.PAPER_EFFECT_BLENDS = PAPER_EFFECT_BLENDS; exports.PAPER_EFFECT_NODE_ID = PAPER_EFFECT_NODE_ID; exports.PAPER_FAMILIES = _chunkROVK6AXXcjs.PAPER_FAMILIES; exports.PAPER_LIBRARY = _chunkROVK6AXXcjs.PAPER_LIBRARY; exports.PAPER_NODE_ID = PAPER_NODE_ID; exports.PAPER_SLIDERS = PAPER_SLIDERS; exports.PAPER_TARGET = PAPER_TARGET; exports.PARTICLE_KINDS = _chunkROVK6AXXcjs.PARTICLE_KINDS; exports.PARTICLE_KIND_LABELS = PARTICLE_KIND_LABELS; exports.PARTICLE_RENDERS = _chunkROVK6AXXcjs.PARTICLE_RENDERS; exports.PARTICLE_RENDER_LABELS = PARTICLE_RENDER_LABELS; exports.PaintCanvasPresenter = PaintCanvasPresenter; exports.PaintDabStroke = PaintDabStroke; exports.PaintDirector = PaintDirector; exports.PaintDocumentError = PaintDocumentError; exports.PaintEditorController = PaintEditorController; exports.PaintEditorError = PaintEditorError; exports.PaintEffectsRenderer = PaintEffectsRenderer; exports.PaintGesture = PaintGesture; exports.PaintGradientSampler = _chunkPQ3H2AANcjs.PaintGradientSampler; exports.PaintPresence = PaintPresence; exports.PaintSourceError = _chunkPQ3H2AANcjs.PaintSourceError; exports.PaintStrokeSession = PaintStrokeSession; exports.PaintWetLayers = PaintWetLayers; exports.PaperGrain = _chunkPQ3H2AANcjs.PaperGrain; exports.ParticleStroke = _chunkROVK6AXXcjs.ParticleStroke; exports.PenDabWalker = _chunkROVK6AXXcjs.PenDabWalker; exports.PenSmoother = _chunkROVK6AXXcjs.PenSmoother; exports.PerspectiveSnapper = PerspectiveSnapper; exports.SNAP_DECIDE_DISTANCE = SNAP_DECIDE_DISTANCE; exports.STAMP_KINDS = _chunkROVK6AXXcjs.STAMP_KINDS; exports.STAMP_LABELS = STAMP_LABELS; exports.STENCIL_KINDS = STENCIL_KINDS; exports.STENCIL_SHAPES = STENCIL_SHAPES; exports.STICKER_SLIDERS = STICKER_SLIDERS; exports.SYMMETRY_MODES = SYMMETRY_MODES; exports.StencilSnapper = StencilSnapper; exports.StickerSpray = _chunkROVK6AXXcjs.StickerSpray; exports.TRACING_NODE_ID = TRACING_NODE_ID; exports.ThickStrokeDriver = ThickStrokeDriver; exports.TileableNoise = _chunkPQ3H2AANcjs.TileableNoise; exports.WET_FLOW_KINDS = _chunkKWNMBMKGcjs.WET_FLOW_KINDS; exports.WET_GPU_MODES = WET_GPU_MODES; exports.WET_GPU_OPTIONS = WET_GPU_OPTIONS; exports.WET_MEDIA = _chunkROVK6AXXcjs.WET_MEDIA; exports.WET_MEDIUM_LABELS = WET_MEDIUM_LABELS; exports.WET_MEDIUM_PARAMS = WET_MEDIUM_PARAMS; exports.WET_PARAM_KEYS = _chunkKWNMBMKGcjs.WET_PARAM_KEYS; exports.WET_PARAM_SCHEMA = WET_PARAM_SCHEMA; exports.WET_PARAM_SLIDERS = WET_PARAM_SLIDERS; exports.WET_SPEED_SLIDER = WET_SPEED_SLIDER; exports.WET_TILT_SLIDERS = WET_TILT_SLIDERS; exports.WET_TOOLS = _chunkROVK6AXXcjs.WET_TOOLS; exports.WET_TOOL_LABELS = WET_TOOL_LABELS; exports.WetStrokeDriver = WetStrokeDriver; exports.addPaintGradientStop = _chunkPQ3H2AANcjs.addPaintGradientStop; exports.affineCopy = affineCopy; exports.applyAffine = applyAffine; exports.brushEngineControls = brushEngineControls; exports.brushLoadColor = brushLoadColor; exports.brushLoadForStroke = brushLoadForStroke; exports.brushTakesPaint = _chunkROVK6AXXcjs.brushTakesPaint; exports.brushToJSON = _chunkROVK6AXXcjs.brushToJSON; exports.buildTimeLapse = buildTimeLapse; exports.checkPaintEffectPlace = checkPaintEffectPlace; exports.clonePaper = _chunkROVK6AXXcjs.clonePaper; exports.colorHarmony = colorHarmony2; exports.composeAffine = composeAffine; exports.contactSheet = contactSheet; exports.createPaintCompositor = createPaintCompositor; exports.createPaintDocument = createPaintDocument; exports.createPaintEditorDocument = createPaintEditorDocument; exports.createPaintEditorToolProvider = createPaintEditorToolProvider; exports.createPaintEffectsToolProvider = createPaintEffectsToolProvider; exports.createPaintLayer = createPaintLayer; exports.createPaintReplayTools = createPaintReplayTools; exports.createPaintStickerTools = createPaintStickerTools; exports.createPaintThickTools = createPaintThickTools; exports.createPaintWetTools = createPaintWetTools; exports.decodeImageBlob = decodeImageBlob; exports.defaultGuides = defaultGuides; exports.defaultImageEncoder = defaultImageEncoder; exports.deserializePaintDocument = deserializePaintDocument; exports.deserializePaintDocumentAsync = deserializePaintDocumentAsync; exports.documentExtensions = documentExtensions; exports.documentToScreen = documentToScreen; exports.downloadBytes = downloadBytes; exports.downsampleRgba = downsampleRgba; exports.drawSticker = _chunkROVK6AXXcjs.drawSticker; exports.drawWaterOverlay = drawWaterOverlay; exports.effectLayersToJSON = effectLayersToJSON; exports.emptiedLayers = emptiedLayers; exports.emptyThickChannels = emptyThickChannels; exports.fitZoom = fitZoom; exports.grainCatch = _chunkPQ3H2AANcjs.grainCatch; exports.grainHeights = _chunkPQ3H2AANcjs.grainHeights; exports.guideOverlay = guideOverlay; exports.handlePaintShortcut = handlePaintShortcut; exports.hash2 = _chunkPQ3H2AANcjs.hash2; exports.hexToPaintRgb = _chunkPQ3H2AANcjs.hexToPaintRgb; exports.hexToRgb8 = _chunkROVK6AXXcjs.hexToRgb8; exports.hslToRgb = hslToRgb; exports.hsvToRgb = hsvToRgb; exports.hueToWheel = _chunkEUIDTZNQcjs.hueToWheel; exports.invertAffine = invertAffine; exports.isBlendMode = _chunkOLNIPTB3cjs.isBlendMode; exports.isGradientPaint = _chunkPQ3H2AANcjs.isGradientPaint; exports.isPainterlyBlendMode = _chunkOLNIPTB3cjs.isPainterlyBlendMode; exports.isPalmTouch = isPalmTouch; exports.isWetBrush = _chunkROVK6AXXcjs.isWetBrush; exports.isWetCapable = _chunkROVK6AXXcjs.isWetCapable; exports.lightTile = lightTile; exports.lightingKey = lightingKey; exports.mapPenPoint = mapPenPoint; exports.mix32 = _chunkPQ3H2AANcjs.mix32; exports.mixPixels = mixPixels; exports.mixerLoadForStroke = mixerLoadForStroke; exports.mixerTip = _chunkROVK6AXXcjs.mixerTip; exports.multiColorForDab = multiColorForDab; exports.multiColorGradient = multiColorGradient; exports.multiColorPalette = multiColorPalette; exports.multiColorSliders = multiColorSliders; exports.multiColorToPaint = _chunkROVK6AXXcjs.multiColorToPaint; exports.newPaintLayerId = newPaintLayerId; exports.nextPaperEffectVersion = nextPaperEffectVersion; exports.normalizeBehavior = _chunkROVK6AXXcjs.normalizeBehavior; exports.normalizeBristle = _chunkROVK6AXXcjs.normalizeBristle; exports.normalizeBrushStroke = normalizeBrushStroke; exports.normalizeCanvas = normalizeCanvas; exports.normalizeDynamics = _chunkROVK6AXXcjs.normalizeDynamics; exports.normalizeFlow = _chunkKWNMBMKGcjs.normalizeFlow; exports.normalizeHexColor = _chunkPQ3H2AANcjs.normalizeHexColor; exports.normalizeImpasto = _chunkROVK6AXXcjs.normalizeImpasto; exports.normalizeLighting = normalizeLighting; exports.normalizeMultiColor = _chunkROVK6AXXcjs.normalizeMultiColor; exports.normalizePaintBrush = _chunkROVK6AXXcjs.normalizePaintBrush; exports.normalizePaper = _chunkROVK6AXXcjs.normalizePaper; exports.normalizeParticle = _chunkROVK6AXXcjs.normalizeParticle; exports.normalizePerspective = normalizePerspective; exports.normalizeRotation = normalizeRotation; exports.normalizeStencil = normalizeStencil; exports.normalizeStickerSettings = _chunkROVK6AXXcjs.normalizeStickerSettings; exports.normalizeStickerUpdate = _chunkROVK6AXXcjs.normalizeStickerUpdate; exports.normalizeSymmetry = normalizeSymmetry; exports.normalizeView = normalizeView; exports.normalizeWetBrush = _chunkROVK6AXXcjs.normalizeWetBrush; exports.normalizeWetParams = _chunkKWNMBMKGcjs.normalizeWetParams; exports.overPixels = overPixels; exports.padSampleRadius = padSampleRadius; exports.paintGradientMappingFor = _chunkPQ3H2AANcjs.paintGradientMappingFor; exports.paintPlaybackPanel = paintPlaybackPanel; exports.paintSourceColor = _chunkPQ3H2AANcjs.paintSourceColor; exports.paintSourceCss = _chunkPQ3H2AANcjs.paintSourceCss; exports.paintToMultiColor = _chunkROVK6AXXcjs.paintToMultiColor; exports.paperEffectFromJSON = paperEffectFromJSON; exports.paperEffectToJSON = paperEffectToJSON; exports.paperGrain = paperGrain; exports.paperKey = paperKey; exports.paperNode = paperNode; exports.paperPreset = _chunkROVK6AXXcjs.paperPreset; exports.parseBrushLibrary = _chunkROVK6AXXcjs.parseBrushLibrary; exports.parseHexColor = parseHexColor; exports.parsePaintSource = _chunkPQ3H2AANcjs.parsePaintSource; exports.patchBrushValue = patchBrushValue; exports.patchPath = patchPath; exports.penOrientation = _chunkROVK6AXXcjs.penOrientation; exports.perspectiveDirections = perspectiveDirections; exports.perspectiveGuideLines = perspectiveGuideLines; exports.planPaintToolPlayback = planPaintToolPlayback; exports.pointerToPenPoint = pointerToPenPoint; exports.quickStencil = quickStencil; exports.rand01 = _chunkPQ3H2AANcjs.rand01; exports.randSigned = _chunkPQ3H2AANcjs.randSigned; exports.readPaintEffectSource = readPaintEffectSource; exports.readPaintSource = _chunkPQ3H2AANcjs.readPaintSource; exports.readPath = readPath; exports.readSwatch = readSwatch; exports.reliefInfo = reliefInfo; exports.removePaintGradientStop = _chunkPQ3H2AANcjs.removePaintGradientStop; exports.renderBrushThumbnail = renderBrushThumbnail; exports.renderColorWheel = renderColorWheel; exports.renderPaper = _chunkROVK6AXXcjs.renderPaper; exports.renderStickers = _chunkROVK6AXXcjs.renderStickers; exports.replayFrame = replayFrame; exports.replayItems = replayItems; exports.replayPainting = replayPainting; exports.resolvePaintGradient = _chunkPQ3H2AANcjs.resolvePaintGradient; exports.reversePaintGradient = _chunkPQ3H2AANcjs.reversePaintGradient; exports.rgbToHexColor = rgbToHexColor; exports.rgbToHsl = rgbToHsl; exports.rgbToHsv = rgbToHsv; exports.samplePressure = samplePressure; exports.scalePaintGradient = _chunkPQ3H2AANcjs.scalePaintGradient; exports.scaleStencil = scaleStencil; exports.screenToDocument = screenToDocument; exports.seedFromString = _chunkPQ3H2AANcjs.seedFromString; exports.serializePaintDocument = serializePaintDocument; exports.serializePaintDocumentExternal = serializePaintDocumentExternal; exports.solidPaint = _chunkPQ3H2AANcjs.solidPaint; exports.stampCoverage = _chunkROVK6AXXcjs.stampCoverage; exports.standardBlendMode = _chunkOLNIPTB3cjs.standardBlendMode; exports.startWetClock = startWetClock; exports.stencilMask = stencilMask; exports.stencilOutline = stencilOutline; exports.stickerRect = _chunkROVK6AXXcjs.stickerRect; exports.stickerSurface = _chunkROVK6AXXcjs.stickerSurface; exports.strokeBounds = strokeBounds; exports.strokeDuration = strokeDuration; exports.strokeSchedule = strokeSchedule; exports.sweepPath = sweepPath; exports.symmetryAxisAngles = symmetryAxisAngles; exports.symmetryAxisSegments = symmetryAxisSegments; exports.symmetryCopies = symmetryCopies; exports.thickFromJSON = thickFromJSON; exports.thickToJSON = thickToJSON; exports.thumbnailStroke = thumbnailStroke; exports.tiltToOrientation = _chunkROVK6AXXcjs.tiltToOrientation; exports.timeLapseVideo = timeLapseVideo; exports.timeLapseZip = timeLapseZip; exports.toStrokePoint = _chunkROVK6AXXcjs.toStrokePoint; exports.toggleStamp = toggleStamp; exports.translateStencil = translateStencil; exports.updatePaintGradientStop = _chunkPQ3H2AANcjs.updatePaintGradientStop; exports.usesPaintExchange = _chunkROVK6AXXcjs.usesPaintExchange; exports.variationAffine = variationAffine; exports.varyStroke = varyStroke; exports.viewCssTransform = viewCssTransform; exports.viewMatrix = viewMatrix; exports.viewPenToDocument = viewPenToDocument; exports.wetEngineSummary = wetEngineSummary; exports.wetPaperInput = wetPaperInput; exports.wetPigmentOf = wetPigmentOf; exports.wetSupport = _chunkKWNMBMKGcjs.wetSupport; exports.wheelAngle = wheelAngle; exports.wheelPick = wheelPick; exports.wheelPoint = wheelPoint; exports.wheelToHue = _chunkEUIDTZNQcjs.wheelToHue; exports.withPaintPlayback = withPaintPlayback;
9202
+ exports.BLEND_MENU_GROUPS = BLEND_MENU_GROUPS; exports.BLEND_MODES = _chunkOLNIPTB3cjs.BLEND_MODES; exports.BRUSH_ID = _chunkROVK6AXXcjs.BRUSH_ID; exports.BRUSH_ROTATIONS = _chunkROVK6AXXcjs.BRUSH_ROTATIONS; exports.BRUSH_SLIDERS = BRUSH_SLIDERS; exports.BUILTIN_BRUSHES = _chunkROVK6AXXcjs.BUILTIN_BRUSHES; exports.BristleStroke = _chunkROVK6AXXcjs.BristleStroke; exports.DEFAULT_BEHAVIOR = _chunkROVK6AXXcjs.DEFAULT_BEHAVIOR; exports.DEFAULT_BRISTLE = _chunkROVK6AXXcjs.DEFAULT_BRISTLE; exports.DEFAULT_BRUSH_ID = _chunkROVK6AXXcjs.DEFAULT_BRUSH_ID; exports.DEFAULT_DPI = DEFAULT_DPI; exports.DEFAULT_DYNAMICS = _chunkROVK6AXXcjs.DEFAULT_DYNAMICS; exports.DEFAULT_FLOW = _chunkXFYLA3ZOcjs.DEFAULT_FLOW; exports.DEFAULT_IMPASTO = _chunkROVK6AXXcjs.DEFAULT_IMPASTO; exports.DEFAULT_LIGHTING = DEFAULT_LIGHTING; exports.DEFAULT_MULTI_COLOR = _chunkROVK6AXXcjs.DEFAULT_MULTI_COLOR; exports.DEFAULT_PAINT_GRADIENT = _chunkPQ3H2AANcjs.DEFAULT_PAINT_GRADIENT; exports.DEFAULT_PAINT_GRADIENT_MAPPING = _chunkPQ3H2AANcjs.DEFAULT_PAINT_GRADIENT_MAPPING; exports.DEFAULT_PAPER = _chunkROVK6AXXcjs.DEFAULT_PAPER; exports.DEFAULT_PARTICLE = _chunkROVK6AXXcjs.DEFAULT_PARTICLE; exports.DEFAULT_STICKER = _chunkROVK6AXXcjs.DEFAULT_STICKER; exports.DEFAULT_SWATCHES = DEFAULT_SWATCHES; exports.DEFAULT_VIEW = DEFAULT_VIEW; exports.DEFAULT_WET_BRUSH = _chunkROVK6AXXcjs.DEFAULT_WET_BRUSH; exports.DEFAULT_WET_PARAMS = _chunkXFYLA3ZOcjs.DEFAULT_WET_PARAMS; exports.DryStroke = _chunkROVK6AXXcjs.DryStroke; exports.GPU_LEAD = GPU_LEAD; exports.GRAIN_PATTERNS = _chunkPQ3H2AANcjs.GRAIN_PATTERNS; exports.GRAIN_TILE = _chunkPQ3H2AANcjs.GRAIN_TILE; exports.HARMONY_KINDS = _chunkEUIDTZNQcjs.HARMONY_KINDS; exports.IDENTITY_AFFINE = IDENTITY_AFFINE; exports.IDENTITY_COPY = _chunkROVK6AXXcjs.IDENTITY_COPY; exports.IMPASTO_TOOLS = _chunkROVK6AXXcjs.IMPASTO_TOOLS; exports.IMPASTO_TOOL_LABELS = IMPASTO_TOOL_LABELS; exports.LIGHT_SLIDERS = LIGHT_SLIDERS; exports.LitCache = LitCache; exports.MAX_BRUSH_SIZE = _chunkPQ3H2AANcjs.MAX_BRUSH_SIZE; exports.MAX_CANVAS_SIDE = MAX_CANVAS_SIDE; exports.MAX_COORDINATE = MAX_COORDINATE; exports.MAX_IMAGE_SIDE = MAX_IMAGE_SIDE; exports.MAX_ZOOM = MAX_ZOOM; exports.MIN_CANVAS_SIDE = MIN_CANVAS_SIDE; exports.MIN_ZOOM = MIN_ZOOM; exports.MIXING_PAD_HEIGHT = MIXING_PAD_HEIGHT; exports.MIXING_PAD_WIDTH = MIXING_PAD_WIDTH; exports.MULTI_COLOR_MODES = _chunkROVK6AXXcjs.MULTI_COLOR_MODES; exports.MixingPad = MixingPad; exports.PAD_SAMPLE_SIZES = PAD_SAMPLE_SIZES; exports.PAINTERLY_BLEND_MODES = _chunkOLNIPTB3cjs.PAINTERLY_BLEND_MODES; exports.PAINT_BRUSH_CATEGORIES = _chunkROVK6AXXcjs.PAINT_BRUSH_CATEGORIES; exports.PAINT_BRUSH_ENGINES = _chunkROVK6AXXcjs.PAINT_BRUSH_ENGINES; exports.PAINT_COLOR_JSON_SCHEMA = _chunkPQ3H2AANcjs.PAINT_COLOR_JSON_SCHEMA; exports.PAINT_EFFECT_PLACES = PAINT_EFFECT_PLACES; exports.PAINT_FORMAT = PAINT_FORMAT; exports.PAINT_GRADIENT_FULL_SPEED = _chunkPQ3H2AANcjs.PAINT_GRADIENT_FULL_SPEED; exports.PAINT_GRADIENT_JSON_SCHEMA = _chunkPQ3H2AANcjs.PAINT_GRADIENT_JSON_SCHEMA; exports.PAINT_GRADIENT_KIT = _chunkPQ3H2AANcjs.PAINT_GRADIENT_KIT; exports.PAINT_GRADIENT_MAPPINGS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_MAPPINGS; exports.PAINT_GRADIENT_MAPPING_LABELS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_MAPPING_LABELS; exports.PAINT_GRADIENT_PRESETS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_PRESETS; exports.PAINT_GRADIENT_REPEATS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_REPEATS; exports.PAINT_GRADIENT_REPEAT_LABELS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_REPEAT_LABELS; exports.PAINT_GRADIENT_SPACES = _chunkPQ3H2AANcjs.PAINT_GRADIENT_SPACES; exports.PAINT_GRADIENT_SPACE_LABELS = _chunkPQ3H2AANcjs.PAINT_GRADIENT_SPACE_LABELS; exports.PAINT_SCHEMA_VERSION = PAINT_SCHEMA_VERSION; exports.PAINT_SOURCE_JSON_SCHEMA = _chunkPQ3H2AANcjs.PAINT_SOURCE_JSON_SCHEMA; exports.PAINT_TOOLS = PAINT_TOOLS; exports.PAPER_EFFECT_BLENDS = PAPER_EFFECT_BLENDS; exports.PAPER_EFFECT_NODE_ID = PAPER_EFFECT_NODE_ID; exports.PAPER_FAMILIES = _chunkROVK6AXXcjs.PAPER_FAMILIES; exports.PAPER_LIBRARY = _chunkROVK6AXXcjs.PAPER_LIBRARY; exports.PAPER_NODE_ID = PAPER_NODE_ID; exports.PAPER_SLIDERS = PAPER_SLIDERS; exports.PAPER_TARGET = PAPER_TARGET; exports.PARTICLE_KINDS = _chunkROVK6AXXcjs.PARTICLE_KINDS; exports.PARTICLE_KIND_LABELS = PARTICLE_KIND_LABELS; exports.PARTICLE_RENDERS = _chunkROVK6AXXcjs.PARTICLE_RENDERS; exports.PARTICLE_RENDER_LABELS = PARTICLE_RENDER_LABELS; exports.PaintCanvasPresenter = PaintCanvasPresenter; exports.PaintDabStroke = PaintDabStroke; exports.PaintDirector = PaintDirector; exports.PaintDocumentError = PaintDocumentError; exports.PaintEditorController = PaintEditorController; exports.PaintEditorError = PaintEditorError; exports.PaintEffectsRenderer = PaintEffectsRenderer; exports.PaintGesture = PaintGesture; exports.PaintGradientSampler = _chunkPQ3H2AANcjs.PaintGradientSampler; exports.PaintPresence = PaintPresence; exports.PaintSourceError = _chunkPQ3H2AANcjs.PaintSourceError; exports.PaintStrokeSession = PaintStrokeSession; exports.PaintWetLayers = PaintWetLayers; exports.PaperGrain = _chunkPQ3H2AANcjs.PaperGrain; exports.ParticleStroke = _chunkROVK6AXXcjs.ParticleStroke; exports.PenDabWalker = _chunkROVK6AXXcjs.PenDabWalker; exports.PenSmoother = _chunkROVK6AXXcjs.PenSmoother; exports.PerspectiveSnapper = PerspectiveSnapper; exports.SNAP_DECIDE_DISTANCE = SNAP_DECIDE_DISTANCE; exports.STAMP_KINDS = _chunkROVK6AXXcjs.STAMP_KINDS; exports.STAMP_LABELS = STAMP_LABELS; exports.STENCIL_KINDS = STENCIL_KINDS; exports.STENCIL_SHAPES = STENCIL_SHAPES; exports.STICKER_SLIDERS = STICKER_SLIDERS; exports.SYMMETRY_MODES = SYMMETRY_MODES; exports.StencilSnapper = StencilSnapper; exports.StickerSpray = _chunkROVK6AXXcjs.StickerSpray; exports.TRACING_NODE_ID = TRACING_NODE_ID; exports.ThickStrokeDriver = ThickStrokeDriver; exports.TileableNoise = _chunkPQ3H2AANcjs.TileableNoise; exports.WET_FLOW_KINDS = _chunkXFYLA3ZOcjs.WET_FLOW_KINDS; exports.WET_GPU_MODES = WET_GPU_MODES; exports.WET_GPU_OPTIONS = WET_GPU_OPTIONS; exports.WET_MEDIA = _chunkROVK6AXXcjs.WET_MEDIA; exports.WET_MEDIUM_LABELS = WET_MEDIUM_LABELS; exports.WET_MEDIUM_PARAMS = WET_MEDIUM_PARAMS; exports.WET_PARAM_KEYS = _chunkXFYLA3ZOcjs.WET_PARAM_KEYS; exports.WET_PARAM_SCHEMA = WET_PARAM_SCHEMA; exports.WET_PARAM_SLIDERS = WET_PARAM_SLIDERS; exports.WET_SPEED_SLIDER = WET_SPEED_SLIDER; exports.WET_TILT_SLIDERS = WET_TILT_SLIDERS; exports.WET_TOOLS = _chunkROVK6AXXcjs.WET_TOOLS; exports.WET_TOOL_LABELS = WET_TOOL_LABELS; exports.WetStrokeDriver = WetStrokeDriver; exports.addPaintGradientStop = _chunkPQ3H2AANcjs.addPaintGradientStop; exports.affineCopy = affineCopy; exports.applyAffine = applyAffine; exports.brushEngineControls = brushEngineControls; exports.brushLoadColor = brushLoadColor; exports.brushLoadForStroke = brushLoadForStroke; exports.brushTakesPaint = _chunkROVK6AXXcjs.brushTakesPaint; exports.brushToJSON = _chunkROVK6AXXcjs.brushToJSON; exports.buildTimeLapse = buildTimeLapse; exports.checkPaintEffectPlace = checkPaintEffectPlace; exports.clonePaper = _chunkROVK6AXXcjs.clonePaper; exports.colorHarmony = colorHarmony2; exports.composeAffine = composeAffine; exports.contactSheet = contactSheet; exports.createPaintCompositor = createPaintCompositor; exports.createPaintDocument = createPaintDocument; exports.createPaintEditorDocument = createPaintEditorDocument; exports.createPaintEditorToolProvider = createPaintEditorToolProvider; exports.createPaintEffectsToolProvider = createPaintEffectsToolProvider; exports.createPaintLayer = createPaintLayer; exports.createPaintReplayTools = createPaintReplayTools; exports.createPaintStickerTools = createPaintStickerTools; exports.createPaintThickTools = createPaintThickTools; exports.createPaintWetTools = createPaintWetTools; exports.decodeImageBlob = decodeImageBlob; exports.defaultGuides = defaultGuides; exports.defaultImageEncoder = defaultImageEncoder; exports.deserializePaintDocument = deserializePaintDocument; exports.deserializePaintDocumentAsync = deserializePaintDocumentAsync; exports.documentExtensions = documentExtensions; exports.documentToScreen = documentToScreen; exports.downloadBytes = downloadBytes; exports.downsampleRgba = downsampleRgba; exports.drawSticker = _chunkROVK6AXXcjs.drawSticker; exports.drawWaterOverlay = drawWaterOverlay; exports.effectLayersToJSON = effectLayersToJSON; exports.emptiedLayers = emptiedLayers; exports.emptyThickChannels = emptyThickChannels; exports.fitZoom = fitZoom; exports.grainCatch = _chunkPQ3H2AANcjs.grainCatch; exports.grainHeights = _chunkPQ3H2AANcjs.grainHeights; exports.guideOverlay = guideOverlay; exports.handlePaintShortcut = handlePaintShortcut; exports.hash2 = _chunkPQ3H2AANcjs.hash2; exports.hexToPaintRgb = _chunkPQ3H2AANcjs.hexToPaintRgb; exports.hexToRgb8 = _chunkROVK6AXXcjs.hexToRgb8; exports.hslToRgb = hslToRgb; exports.hsvToRgb = hsvToRgb; exports.hueToWheel = _chunkEUIDTZNQcjs.hueToWheel; exports.invertAffine = invertAffine; exports.isBlendMode = _chunkOLNIPTB3cjs.isBlendMode; exports.isGradientPaint = _chunkPQ3H2AANcjs.isGradientPaint; exports.isPainterlyBlendMode = _chunkOLNIPTB3cjs.isPainterlyBlendMode; exports.isPalmTouch = isPalmTouch; exports.isWetBrush = _chunkROVK6AXXcjs.isWetBrush; exports.isWetCapable = _chunkROVK6AXXcjs.isWetCapable; exports.lightTile = lightTile; exports.lightingKey = lightingKey; exports.mapPenPoint = mapPenPoint; exports.mix32 = _chunkPQ3H2AANcjs.mix32; exports.mixPixels = mixPixels; exports.mixerLoadForStroke = mixerLoadForStroke; exports.mixerTip = _chunkROVK6AXXcjs.mixerTip; exports.multiColorForDab = multiColorForDab; exports.multiColorGradient = multiColorGradient; exports.multiColorPalette = multiColorPalette; exports.multiColorSliders = multiColorSliders; exports.multiColorToPaint = _chunkROVK6AXXcjs.multiColorToPaint; exports.newPaintLayerId = newPaintLayerId; exports.nextPaperEffectVersion = nextPaperEffectVersion; exports.normalizeBehavior = _chunkROVK6AXXcjs.normalizeBehavior; exports.normalizeBristle = _chunkROVK6AXXcjs.normalizeBristle; exports.normalizeBrushStroke = normalizeBrushStroke; exports.normalizeCanvas = normalizeCanvas; exports.normalizeDynamics = _chunkROVK6AXXcjs.normalizeDynamics; exports.normalizeFlow = _chunkXFYLA3ZOcjs.normalizeFlow; exports.normalizeHexColor = _chunkPQ3H2AANcjs.normalizeHexColor; exports.normalizeImpasto = _chunkROVK6AXXcjs.normalizeImpasto; exports.normalizeLighting = normalizeLighting; exports.normalizeMultiColor = _chunkROVK6AXXcjs.normalizeMultiColor; exports.normalizePaintBrush = _chunkROVK6AXXcjs.normalizePaintBrush; exports.normalizePaper = _chunkROVK6AXXcjs.normalizePaper; exports.normalizeParticle = _chunkROVK6AXXcjs.normalizeParticle; exports.normalizePerspective = normalizePerspective; exports.normalizeRotation = normalizeRotation; exports.normalizeStencil = normalizeStencil; exports.normalizeStickerSettings = _chunkROVK6AXXcjs.normalizeStickerSettings; exports.normalizeStickerUpdate = _chunkROVK6AXXcjs.normalizeStickerUpdate; exports.normalizeSymmetry = normalizeSymmetry; exports.normalizeView = normalizeView; exports.normalizeWetBrush = _chunkROVK6AXXcjs.normalizeWetBrush; exports.normalizeWetParams = _chunkXFYLA3ZOcjs.normalizeWetParams; exports.overPixels = overPixels; exports.padSampleRadius = padSampleRadius; exports.paintGradientMappingFor = _chunkPQ3H2AANcjs.paintGradientMappingFor; exports.paintPlaybackPanel = paintPlaybackPanel; exports.paintSourceColor = _chunkPQ3H2AANcjs.paintSourceColor; exports.paintSourceCss = _chunkPQ3H2AANcjs.paintSourceCss; exports.paintToMultiColor = _chunkROVK6AXXcjs.paintToMultiColor; exports.paperEffectFromJSON = paperEffectFromJSON; exports.paperEffectToJSON = paperEffectToJSON; exports.paperGrain = paperGrain; exports.paperKey = paperKey; exports.paperNode = paperNode; exports.paperPreset = _chunkROVK6AXXcjs.paperPreset; exports.parseBrushLibrary = _chunkROVK6AXXcjs.parseBrushLibrary; exports.parseHexColor = parseHexColor; exports.parsePaintSource = _chunkPQ3H2AANcjs.parsePaintSource; exports.patchBrushValue = patchBrushValue; exports.patchPath = patchPath; exports.penOrientation = _chunkROVK6AXXcjs.penOrientation; exports.perspectiveDirections = perspectiveDirections; exports.perspectiveGuideLines = perspectiveGuideLines; exports.planPaintToolPlayback = planPaintToolPlayback; exports.pointerToPenPoint = pointerToPenPoint; exports.quickStencil = quickStencil; exports.rand01 = _chunkPQ3H2AANcjs.rand01; exports.randSigned = _chunkPQ3H2AANcjs.randSigned; exports.readPaintEffectSource = readPaintEffectSource; exports.readPaintSource = _chunkPQ3H2AANcjs.readPaintSource; exports.readPath = readPath; exports.readSwatch = readSwatch; exports.reliefInfo = reliefInfo; exports.removePaintGradientStop = _chunkPQ3H2AANcjs.removePaintGradientStop; exports.renderBrushThumbnail = renderBrushThumbnail; exports.renderColorWheel = renderColorWheel; exports.renderPaper = _chunkROVK6AXXcjs.renderPaper; exports.renderStickers = _chunkROVK6AXXcjs.renderStickers; exports.replayFrame = replayFrame; exports.replayItems = replayItems; exports.replayPainting = replayPainting; exports.resolvePaintGradient = _chunkPQ3H2AANcjs.resolvePaintGradient; exports.reversePaintGradient = _chunkPQ3H2AANcjs.reversePaintGradient; exports.rgbToHexColor = rgbToHexColor; exports.rgbToHsl = rgbToHsl; exports.rgbToHsv = rgbToHsv; exports.samplePressure = samplePressure; exports.scalePaintGradient = _chunkPQ3H2AANcjs.scalePaintGradient; exports.scaleStencil = scaleStencil; exports.screenToDocument = screenToDocument; exports.seedFromString = _chunkPQ3H2AANcjs.seedFromString; exports.serializePaintDocument = serializePaintDocument; exports.serializePaintDocumentExternal = serializePaintDocumentExternal; exports.solidPaint = _chunkPQ3H2AANcjs.solidPaint; exports.stampCoverage = _chunkROVK6AXXcjs.stampCoverage; exports.standardBlendMode = _chunkOLNIPTB3cjs.standardBlendMode; exports.startWetClock = startWetClock; exports.stencilMask = stencilMask; exports.stencilOutline = stencilOutline; exports.stickerRect = _chunkROVK6AXXcjs.stickerRect; exports.stickerSurface = _chunkROVK6AXXcjs.stickerSurface; exports.strokeBounds = strokeBounds; exports.strokeDuration = strokeDuration; exports.strokeSchedule = strokeSchedule; exports.sweepPath = sweepPath; exports.symmetryAxisAngles = symmetryAxisAngles; exports.symmetryAxisSegments = symmetryAxisSegments; exports.symmetryCopies = symmetryCopies; exports.thickFromJSON = thickFromJSON; exports.thickToJSON = thickToJSON; exports.thumbnailStroke = thumbnailStroke; exports.tiltToOrientation = _chunkROVK6AXXcjs.tiltToOrientation; exports.timeLapseVideo = timeLapseVideo; exports.timeLapseZip = timeLapseZip; exports.toStrokePoint = _chunkROVK6AXXcjs.toStrokePoint; exports.toggleStamp = toggleStamp; exports.translateStencil = translateStencil; exports.updatePaintGradientStop = _chunkPQ3H2AANcjs.updatePaintGradientStop; exports.usesPaintExchange = _chunkROVK6AXXcjs.usesPaintExchange; exports.variationAffine = variationAffine; exports.varyStroke = varyStroke; exports.viewCssTransform = viewCssTransform; exports.viewMatrix = viewMatrix; exports.viewPenToDocument = viewPenToDocument; exports.wetEngineSummary = wetEngineSummary; exports.wetPaperInput = wetPaperInput; exports.wetPigmentOf = wetPigmentOf; exports.wetSupport = _chunkXFYLA3ZOcjs.wetSupport; exports.wheelAngle = wheelAngle; exports.wheelPick = wheelPick; exports.wheelPoint = wheelPoint; exports.wheelToHue = _chunkEUIDTZNQcjs.wheelToHue; exports.withPaintPlayback = withPaintPlayback;