hyperframes 0.8.63 → 0.8.64

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.
@@ -313,28 +313,28 @@ var init_decode = __esm({
313
313
  * @param offset The offset at which the entity begins. Should be 0 if this is not the first call.
314
314
  * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
315
315
  */
316
- write(input, offset2) {
316
+ write(input, offset3) {
317
317
  switch (this.state) {
318
318
  case EntityDecoderState.EntityStart: {
319
- if (input.charCodeAt(offset2) === CharCodes.NUM) {
319
+ if (input.charCodeAt(offset3) === CharCodes.NUM) {
320
320
  this.state = EntityDecoderState.NumericStart;
321
321
  this.consumed += 1;
322
- return this.stateNumericStart(input, offset2 + 1);
322
+ return this.stateNumericStart(input, offset3 + 1);
323
323
  }
324
324
  this.state = EntityDecoderState.NamedEntity;
325
- return this.stateNamedEntity(input, offset2);
325
+ return this.stateNamedEntity(input, offset3);
326
326
  }
327
327
  case EntityDecoderState.NumericStart: {
328
- return this.stateNumericStart(input, offset2);
328
+ return this.stateNumericStart(input, offset3);
329
329
  }
330
330
  case EntityDecoderState.NumericDecimal: {
331
- return this.stateNumericDecimal(input, offset2);
331
+ return this.stateNumericDecimal(input, offset3);
332
332
  }
333
333
  case EntityDecoderState.NumericHex: {
334
- return this.stateNumericHex(input, offset2);
334
+ return this.stateNumericHex(input, offset3);
335
335
  }
336
336
  case EntityDecoderState.NamedEntity: {
337
- return this.stateNamedEntity(input, offset2);
337
+ return this.stateNamedEntity(input, offset3);
338
338
  }
339
339
  }
340
340
  }
@@ -347,17 +347,17 @@ var init_decode = __esm({
347
347
  * @param offset The current offset.
348
348
  * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
349
349
  */
350
- stateNumericStart(input, offset2) {
351
- if (offset2 >= input.length) {
350
+ stateNumericStart(input, offset3) {
351
+ if (offset3 >= input.length) {
352
352
  return -1;
353
353
  }
354
- if ((input.charCodeAt(offset2) | TO_LOWER_BIT) === CharCodes.LOWER_X) {
354
+ if ((input.charCodeAt(offset3) | TO_LOWER_BIT) === CharCodes.LOWER_X) {
355
355
  this.state = EntityDecoderState.NumericHex;
356
356
  this.consumed += 1;
357
- return this.stateNumericHex(input, offset2 + 1);
357
+ return this.stateNumericHex(input, offset3 + 1);
358
358
  }
359
359
  this.state = EntityDecoderState.NumericDecimal;
360
- return this.stateNumericDecimal(input, offset2);
360
+ return this.stateNumericDecimal(input, offset3);
361
361
  }
362
362
  /**
363
363
  * Parses a hexadecimal numeric entity.
@@ -368,14 +368,14 @@ var init_decode = __esm({
368
368
  * @param offset The current offset.
369
369
  * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
370
370
  */
371
- stateNumericHex(input, offset2) {
372
- while (offset2 < input.length) {
373
- const char = input.charCodeAt(offset2);
371
+ stateNumericHex(input, offset3) {
372
+ while (offset3 < input.length) {
373
+ const char = input.charCodeAt(offset3);
374
374
  if (isNumber(char) || isHexadecimalCharacter(char)) {
375
375
  const digit = char <= CharCodes.NINE ? char - CharCodes.ZERO : (char | TO_LOWER_BIT) - CharCodes.LOWER_A + 10;
376
376
  this.result = this.result * 16 + digit;
377
377
  this.consumed++;
378
- offset2++;
378
+ offset3++;
379
379
  } else {
380
380
  return this.emitNumericEntity(char, 3);
381
381
  }
@@ -391,13 +391,13 @@ var init_decode = __esm({
391
391
  * @param offset The current offset.
392
392
  * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
393
393
  */
394
- stateNumericDecimal(input, offset2) {
395
- while (offset2 < input.length) {
396
- const char = input.charCodeAt(offset2);
394
+ stateNumericDecimal(input, offset3) {
395
+ while (offset3 < input.length) {
396
+ const char = input.charCodeAt(offset3);
397
397
  if (isNumber(char)) {
398
398
  this.result = this.result * 10 + (char - CharCodes.ZERO);
399
399
  this.consumed++;
400
- offset2++;
400
+ offset3++;
401
401
  } else {
402
402
  return this.emitNumericEntity(char, 2);
403
403
  }
@@ -446,34 +446,34 @@ var init_decode = __esm({
446
446
  * @param offset The current offset.
447
447
  * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
448
448
  */
449
- stateNamedEntity(input, offset2) {
449
+ stateNamedEntity(input, offset3) {
450
450
  const { decodeTree } = this;
451
451
  let current2 = decodeTree[this.treeIndex];
452
452
  let valueLength = (current2 & BinTrieFlags.VALUE_LENGTH) >> 14;
453
- while (offset2 < input.length) {
453
+ while (offset3 < input.length) {
454
454
  if (valueLength === 0 && (current2 & BinTrieFlags.FLAG13) !== 0) {
455
455
  const runLength = (current2 & BinTrieFlags.BRANCH_LENGTH) >> 7;
456
456
  if (this.runConsumed === 0) {
457
457
  const firstChar = current2 & BinTrieFlags.JUMP_TABLE;
458
- if (input.charCodeAt(offset2) !== firstChar) {
458
+ if (input.charCodeAt(offset3) !== firstChar) {
459
459
  return this.result === 0 ? 0 : this.emitNotTerminatedNamedEntity();
460
460
  }
461
- offset2++;
461
+ offset3++;
462
462
  this.excess++;
463
463
  this.runConsumed++;
464
464
  }
465
465
  while (this.runConsumed < runLength) {
466
- if (offset2 >= input.length) {
466
+ if (offset3 >= input.length) {
467
467
  return -1;
468
468
  }
469
469
  const charIndexInPacked = this.runConsumed - 1;
470
470
  const packedWord = decodeTree[this.treeIndex + 1 + (charIndexInPacked >> 1)];
471
471
  const expectedChar = charIndexInPacked % 2 === 0 ? packedWord & 255 : packedWord >> 8 & 255;
472
- if (input.charCodeAt(offset2) !== expectedChar) {
472
+ if (input.charCodeAt(offset3) !== expectedChar) {
473
473
  this.runConsumed = 0;
474
474
  return this.result === 0 ? 0 : this.emitNotTerminatedNamedEntity();
475
475
  }
476
- offset2++;
476
+ offset3++;
477
477
  this.excess++;
478
478
  this.runConsumed++;
479
479
  }
@@ -482,9 +482,9 @@ var init_decode = __esm({
482
482
  current2 = decodeTree[this.treeIndex];
483
483
  valueLength = (current2 & BinTrieFlags.VALUE_LENGTH) >> 14;
484
484
  }
485
- if (offset2 >= input.length)
485
+ if (offset3 >= input.length)
486
486
  break;
487
- const char = input.charCodeAt(offset2);
487
+ const char = input.charCodeAt(offset3);
488
488
  if (char === CharCodes.SEMI && valueLength !== 0 && (current2 & BinTrieFlags.FLAG13) !== 0) {
489
489
  return this.emitNamedEntityData(this.treeIndex, valueLength, this.consumed + this.excess);
490
490
  }
@@ -507,7 +507,7 @@ var init_decode = __esm({
507
507
  this.excess = 0;
508
508
  }
509
509
  }
510
- offset2++;
510
+ offset3++;
511
511
  this.excess++;
512
512
  }
513
513
  return -1;
@@ -856,10 +856,10 @@ var init_Tokenizer = __esm({
856
856
  isTagStartChar(c) {
857
857
  return this.xmlMode ? !isEndOfTagSection(c) : isASCIIAlpha(c);
858
858
  }
859
- startSpecial(sequence, offset2) {
859
+ startSpecial(sequence, offset3) {
860
860
  this.isSpecial = true;
861
861
  this.currentSequence = sequence;
862
- this.sequenceIndex = offset2;
862
+ this.sequenceIndex = offset3;
863
863
  this.state = State.SpecialStartSequence;
864
864
  }
865
865
  stateBeforeTagName(c) {
@@ -1588,18 +1588,18 @@ var init_Parser = __esm({
1588
1588
  this.startIndex = endIndex + 1;
1589
1589
  }
1590
1590
  /** @internal */
1591
- oncomment(start, endIndex, offset2) {
1591
+ oncomment(start, endIndex, offset3) {
1592
1592
  var _a3, _b, _c, _d;
1593
1593
  this.endIndex = endIndex;
1594
- (_b = (_a3 = this.cbs).oncomment) === null || _b === void 0 ? void 0 : _b.call(_a3, this.getSlice(start, endIndex - offset2));
1594
+ (_b = (_a3 = this.cbs).oncomment) === null || _b === void 0 ? void 0 : _b.call(_a3, this.getSlice(start, endIndex - offset3));
1595
1595
  (_d = (_c = this.cbs).oncommentend) === null || _d === void 0 ? void 0 : _d.call(_c);
1596
1596
  this.startIndex = endIndex + 1;
1597
1597
  }
1598
1598
  /** @internal */
1599
- oncdata(start, endIndex, offset2) {
1599
+ oncdata(start, endIndex, offset3) {
1600
1600
  var _a3, _b, _c, _d, _e, _f, _g, _h, _j, _k;
1601
1601
  this.endIndex = endIndex;
1602
- const value = this.getSlice(start, endIndex - offset2);
1602
+ const value = this.getSlice(start, endIndex - offset3);
1603
1603
  if (!this.htmlMode || this.options.recognizeCDATA) {
1604
1604
  (_b = (_a3 = this.cbs).oncdatastart) === null || _b === void 0 ? void 0 : _b.call(_a3);
1605
1605
  (_d = (_c = this.cbs).ontext) === null || _d === void 0 ? void 0 : _d.call(_c, value);
@@ -2297,21 +2297,21 @@ function getDecoder(decodeTree) {
2297
2297
  const decoder = new EntityDecoder2(decodeTree, (str) => ret += fromCodePoint2(str));
2298
2298
  return function decodeWithTrie(str, decodeMode) {
2299
2299
  let lastIndex = 0;
2300
- let offset2 = 0;
2301
- while ((offset2 = str.indexOf("&", offset2)) >= 0) {
2302
- ret += str.slice(lastIndex, offset2);
2300
+ let offset3 = 0;
2301
+ while ((offset3 = str.indexOf("&", offset3)) >= 0) {
2302
+ ret += str.slice(lastIndex, offset3);
2303
2303
  decoder.startEntity(decodeMode);
2304
2304
  const len = decoder.write(
2305
2305
  str,
2306
2306
  // Skip the "&"
2307
- offset2 + 1
2307
+ offset3 + 1
2308
2308
  );
2309
2309
  if (len < 0) {
2310
- lastIndex = offset2 + decoder.end();
2310
+ lastIndex = offset3 + decoder.end();
2311
2311
  break;
2312
2312
  }
2313
- lastIndex = offset2 + len;
2314
- offset2 = len === 0 ? lastIndex + 1 : lastIndex;
2313
+ lastIndex = offset3 + len;
2314
+ offset3 = len === 0 ? lastIndex + 1 : lastIndex;
2315
2315
  }
2316
2316
  const result = ret + str.slice(lastIndex);
2317
2317
  ret = "";
@@ -2415,28 +2415,28 @@ var init_decode2 = __esm({
2415
2415
  * @param offset The offset at which the entity begins. Should be 0 if this is not the first call.
2416
2416
  * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
2417
2417
  */
2418
- write(str, offset2) {
2418
+ write(str, offset3) {
2419
2419
  switch (this.state) {
2420
2420
  case EntityDecoderState2.EntityStart: {
2421
- if (str.charCodeAt(offset2) === CharCodes3.NUM) {
2421
+ if (str.charCodeAt(offset3) === CharCodes3.NUM) {
2422
2422
  this.state = EntityDecoderState2.NumericStart;
2423
2423
  this.consumed += 1;
2424
- return this.stateNumericStart(str, offset2 + 1);
2424
+ return this.stateNumericStart(str, offset3 + 1);
2425
2425
  }
2426
2426
  this.state = EntityDecoderState2.NamedEntity;
2427
- return this.stateNamedEntity(str, offset2);
2427
+ return this.stateNamedEntity(str, offset3);
2428
2428
  }
2429
2429
  case EntityDecoderState2.NumericStart: {
2430
- return this.stateNumericStart(str, offset2);
2430
+ return this.stateNumericStart(str, offset3);
2431
2431
  }
2432
2432
  case EntityDecoderState2.NumericDecimal: {
2433
- return this.stateNumericDecimal(str, offset2);
2433
+ return this.stateNumericDecimal(str, offset3);
2434
2434
  }
2435
2435
  case EntityDecoderState2.NumericHex: {
2436
- return this.stateNumericHex(str, offset2);
2436
+ return this.stateNumericHex(str, offset3);
2437
2437
  }
2438
2438
  case EntityDecoderState2.NamedEntity: {
2439
- return this.stateNamedEntity(str, offset2);
2439
+ return this.stateNamedEntity(str, offset3);
2440
2440
  }
2441
2441
  }
2442
2442
  }
@@ -2449,17 +2449,17 @@ var init_decode2 = __esm({
2449
2449
  * @param offset The current offset.
2450
2450
  * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
2451
2451
  */
2452
- stateNumericStart(str, offset2) {
2453
- if (offset2 >= str.length) {
2452
+ stateNumericStart(str, offset3) {
2453
+ if (offset3 >= str.length) {
2454
2454
  return -1;
2455
2455
  }
2456
- if ((str.charCodeAt(offset2) | TO_LOWER_BIT2) === CharCodes3.LOWER_X) {
2456
+ if ((str.charCodeAt(offset3) | TO_LOWER_BIT2) === CharCodes3.LOWER_X) {
2457
2457
  this.state = EntityDecoderState2.NumericHex;
2458
2458
  this.consumed += 1;
2459
- return this.stateNumericHex(str, offset2 + 1);
2459
+ return this.stateNumericHex(str, offset3 + 1);
2460
2460
  }
2461
2461
  this.state = EntityDecoderState2.NumericDecimal;
2462
- return this.stateNumericDecimal(str, offset2);
2462
+ return this.stateNumericDecimal(str, offset3);
2463
2463
  }
2464
2464
  addToNumericResult(str, start, end, base2) {
2465
2465
  if (start !== end) {
@@ -2477,18 +2477,18 @@ var init_decode2 = __esm({
2477
2477
  * @param offset The current offset.
2478
2478
  * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
2479
2479
  */
2480
- stateNumericHex(str, offset2) {
2481
- const startIdx = offset2;
2482
- while (offset2 < str.length) {
2483
- const char = str.charCodeAt(offset2);
2480
+ stateNumericHex(str, offset3) {
2481
+ const startIdx = offset3;
2482
+ while (offset3 < str.length) {
2483
+ const char = str.charCodeAt(offset3);
2484
2484
  if (isNumber2(char) || isHexadecimalCharacter2(char)) {
2485
- offset2 += 1;
2485
+ offset3 += 1;
2486
2486
  } else {
2487
- this.addToNumericResult(str, startIdx, offset2, 16);
2487
+ this.addToNumericResult(str, startIdx, offset3, 16);
2488
2488
  return this.emitNumericEntity(char, 3);
2489
2489
  }
2490
2490
  }
2491
- this.addToNumericResult(str, startIdx, offset2, 16);
2491
+ this.addToNumericResult(str, startIdx, offset3, 16);
2492
2492
  return -1;
2493
2493
  }
2494
2494
  /**
@@ -2500,18 +2500,18 @@ var init_decode2 = __esm({
2500
2500
  * @param offset The current offset.
2501
2501
  * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
2502
2502
  */
2503
- stateNumericDecimal(str, offset2) {
2504
- const startIdx = offset2;
2505
- while (offset2 < str.length) {
2506
- const char = str.charCodeAt(offset2);
2503
+ stateNumericDecimal(str, offset3) {
2504
+ const startIdx = offset3;
2505
+ while (offset3 < str.length) {
2506
+ const char = str.charCodeAt(offset3);
2507
2507
  if (isNumber2(char)) {
2508
- offset2 += 1;
2508
+ offset3 += 1;
2509
2509
  } else {
2510
- this.addToNumericResult(str, startIdx, offset2, 10);
2510
+ this.addToNumericResult(str, startIdx, offset3, 10);
2511
2511
  return this.emitNumericEntity(char, 2);
2512
2512
  }
2513
2513
  }
2514
- this.addToNumericResult(str, startIdx, offset2, 10);
2514
+ this.addToNumericResult(str, startIdx, offset3, 10);
2515
2515
  return -1;
2516
2516
  }
2517
2517
  /**
@@ -2556,12 +2556,12 @@ var init_decode2 = __esm({
2556
2556
  * @param offset The current offset.
2557
2557
  * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
2558
2558
  */
2559
- stateNamedEntity(str, offset2) {
2559
+ stateNamedEntity(str, offset3) {
2560
2560
  const { decodeTree } = this;
2561
2561
  let current2 = decodeTree[this.treeIndex];
2562
2562
  let valueLength = (current2 & BinTrieFlags2.VALUE_LENGTH) >> 14;
2563
- for (; offset2 < str.length; offset2++, this.excess++) {
2564
- const char = str.charCodeAt(offset2);
2563
+ for (; offset3 < str.length; offset3++, this.excess++) {
2564
+ const char = str.charCodeAt(offset3);
2565
2565
  this.treeIndex = determineBranch2(decodeTree, current2, this.treeIndex + Math.max(1, valueLength), char);
2566
2566
  if (this.treeIndex < 0) {
2567
2567
  return this.result === 0 || // If we are parsing an attribute
@@ -5023,23 +5023,23 @@ var init_character_data = __esm({
5023
5023
  get length() {
5024
5024
  return this.data.length;
5025
5025
  }
5026
- substringData(offset2, count) {
5027
- return this.data.substr(offset2, count);
5026
+ substringData(offset3, count) {
5027
+ return this.data.substr(offset3, count);
5028
5028
  }
5029
5029
  appendData(data2) {
5030
5030
  this.data += data2;
5031
5031
  }
5032
- insertData(offset2, data2) {
5032
+ insertData(offset3, data2) {
5033
5033
  const { data: t } = this;
5034
- this.data = t.slice(0, offset2) + data2 + t.slice(offset2);
5034
+ this.data = t.slice(0, offset3) + data2 + t.slice(offset3);
5035
5035
  }
5036
- deleteData(offset2, count) {
5036
+ deleteData(offset3, count) {
5037
5037
  const { data: t } = this;
5038
- this.data = t.slice(0, offset2) + t.slice(offset2 + count);
5038
+ this.data = t.slice(0, offset3) + t.slice(offset3 + count);
5039
5039
  }
5040
- replaceData(offset2, count, data2) {
5040
+ replaceData(offset3, count, data2) {
5041
5041
  const { data: t } = this;
5042
- this.data = t.slice(0, offset2) + data2 + t.slice(offset2 + count);
5042
+ this.data = t.slice(0, offset3) + data2 + t.slice(offset3 + count);
5043
5043
  }
5044
5044
  /* c8 ignore stop */
5045
5045
  toJSON() {
@@ -5186,17 +5186,17 @@ function parse(selector) {
5186
5186
  }
5187
5187
  function parseSelector(subselects2, selector, selectorIndex) {
5188
5188
  let tokens = [];
5189
- function getName3(offset2) {
5190
- const match = selector.slice(selectorIndex + offset2).match(reName);
5189
+ function getName3(offset3) {
5190
+ const match = selector.slice(selectorIndex + offset3).match(reName);
5191
5191
  if (!match) {
5192
5192
  throw new Error(`Expected name, found ${selector.slice(selectorIndex)}`);
5193
5193
  }
5194
5194
  const [name] = match;
5195
- selectorIndex += offset2 + name.length;
5195
+ selectorIndex += offset3 + name.length;
5196
5196
  return unescapeCSS(name);
5197
5197
  }
5198
- function stripWhitespace(offset2) {
5199
- selectorIndex += offset2;
5198
+ function stripWhitespace(offset3) {
5199
+ selectorIndex += offset3;
5200
5200
  while (selectorIndex < selector.length && isWhitespace2(selector.charCodeAt(selectorIndex))) {
5201
5201
  selectorIndex++;
5202
5202
  }
@@ -14223,9 +14223,9 @@ var require_path = __commonJS({
14223
14223
  };
14224
14224
  function emptyMoves() {
14225
14225
  }
14226
- function getMoves(path, offset2, start, end) {
14226
+ function getMoves(path, offset3, start, end) {
14227
14227
  isArray3.assert(path.value);
14228
- if (offset2 === 0) {
14228
+ if (offset3 === 0) {
14229
14229
  return emptyMoves;
14230
14230
  }
14231
14231
  var length = path.value.length;
@@ -14253,7 +14253,7 @@ var require_path = __commonJS({
14253
14253
  if (childPath.name !== i) {
14254
14254
  throw new Error("");
14255
14255
  }
14256
- var newIndex = i + offset2;
14256
+ var newIndex = i + offset3;
14257
14257
  childPath.name = newIndex;
14258
14258
  moves[newIndex] = childPath;
14259
14259
  delete cache2[i];
@@ -18177,13 +18177,13 @@ var require_source_map_consumer = __commonJS({
18177
18177
  if (s.url) {
18178
18178
  throw new Error("Support for url field in sections not implemented.");
18179
18179
  }
18180
- var offset2 = util.getArg(s, "offset");
18181
- var offsetLine = util.getArg(offset2, "line");
18182
- var offsetColumn = util.getArg(offset2, "column");
18180
+ var offset3 = util.getArg(s, "offset");
18181
+ var offsetLine = util.getArg(offset3, "line");
18182
+ var offsetColumn = util.getArg(offset3, "column");
18183
18183
  if (offsetLine < lastOffset.line || offsetLine === lastOffset.line && offsetColumn < lastOffset.column) {
18184
18184
  throw new Error("Section offsets must be ordered and non-overlapping.");
18185
18185
  }
18186
- lastOffset = offset2;
18186
+ lastOffset = offset3;
18187
18187
  return {
18188
18188
  generatedOffset: {
18189
18189
  // The offset fields are 0-based, but we use 1-based indices when
@@ -23628,16 +23628,16 @@ var require_esprima2 = __commonJS({
23628
23628
  }
23629
23629
  this.errorHandler.tolerateError(this.index, this.lineNumber, this.index - this.lineStart + 1, message);
23630
23630
  };
23631
- Scanner2.prototype.skipSingleLineComment = function(offset2) {
23631
+ Scanner2.prototype.skipSingleLineComment = function(offset3) {
23632
23632
  var comments = [];
23633
23633
  var start, loc;
23634
23634
  if (this.trackComment) {
23635
23635
  comments = [];
23636
- start = this.index - offset2;
23636
+ start = this.index - offset3;
23637
23637
  loc = {
23638
23638
  start: {
23639
23639
  line: this.lineNumber,
23640
- column: this.index - this.lineStart - offset2
23640
+ column: this.index - this.lineStart - offset3
23641
23641
  },
23642
23642
  end: {}
23643
23643
  };
@@ -23653,7 +23653,7 @@ var require_esprima2 = __commonJS({
23653
23653
  };
23654
23654
  var entry = {
23655
23655
  multiLine: false,
23656
- slice: [start + offset2, this.index - 1],
23656
+ slice: [start + offset3, this.index - 1],
23657
23657
  range: [start, this.index - 1],
23658
23658
  loc
23659
23659
  };
@@ -23674,7 +23674,7 @@ var require_esprima2 = __commonJS({
23674
23674
  };
23675
23675
  var entry = {
23676
23676
  multiLine: false,
23677
- slice: [start + offset2, this.index],
23677
+ slice: [start + offset3, this.index],
23678
23678
  range: [start, this.index],
23679
23679
  loc
23680
23680
  };
@@ -44193,11 +44193,11 @@ function codePointToString(code) {
44193
44193
  code -= 65536;
44194
44194
  return String.fromCharCode((code >> 10) + 55296, (code & 1023) + 56320);
44195
44195
  }
44196
- function getLineInfo(input, offset2) {
44196
+ function getLineInfo(input, offset3) {
44197
44197
  for (var line = 1, cur = 0; ; ) {
44198
- var nextBreak = nextLineBreak(input, cur, offset2);
44198
+ var nextBreak = nextLineBreak(input, cur, offset3);
44199
44199
  if (nextBreak < 0) {
44200
- return new Position(line, offset2 - cur);
44200
+ return new Position(line, offset3 - cur);
44201
44201
  }
44202
44202
  ++line;
44203
44203
  cur = nextBreak;
@@ -52939,16 +52939,16 @@ function readAscii(bytes, start, length) {
52939
52939
  }
52940
52940
  return value;
52941
52941
  }
52942
- function readU16LE(bytes, offset2) {
52943
- if (offset2 + 1 >= bytes.length)
52942
+ function readU16LE(bytes, offset3) {
52943
+ if (offset3 + 1 >= bytes.length)
52944
52944
  return null;
52945
- return (bytes[offset2] ?? 0) | (bytes[offset2 + 1] ?? 0) << 8;
52945
+ return (bytes[offset3] ?? 0) | (bytes[offset3 + 1] ?? 0) << 8;
52946
52946
  }
52947
52947
  function colorTableByteLength(packed) {
52948
52948
  return 3 * 2 ** ((packed & 7) + 1);
52949
52949
  }
52950
- function skipSubBlocks(bytes, offset2) {
52951
- let pos = offset2;
52950
+ function skipSubBlocks(bytes, offset3) {
52951
+ let pos = offset3;
52952
52952
  while (pos < bytes.length) {
52953
52953
  const size = bytes[pos];
52954
52954
  if (size === void 0)
@@ -52960,12 +52960,12 @@ function skipSubBlocks(bytes, offset2) {
52960
52960
  }
52961
52961
  return null;
52962
52962
  }
52963
- function parseApplicationExtension(bytes, offset2) {
52964
- const blockSize = bytes[offset2];
52965
- if (blockSize === void 0 || offset2 + 1 + blockSize > bytes.length)
52963
+ function parseApplicationExtension(bytes, offset3) {
52964
+ const blockSize = bytes[offset3];
52965
+ if (blockSize === void 0 || offset3 + 1 + blockSize > bytes.length)
52966
52966
  return null;
52967
- const appId = readAscii(bytes, offset2 + 1, blockSize);
52968
- let pos = offset2 + 1 + blockSize;
52967
+ const appId = readAscii(bytes, offset3 + 1, blockSize);
52968
+ let pos = offset3 + 1 + blockSize;
52969
52969
  let loopCount = null;
52970
52970
  while (pos < bytes.length) {
52971
52971
  const size = bytes[pos];
@@ -54400,6 +54400,588 @@ var init_canaryRegistry = __esm({
54400
54400
  }
54401
54401
  });
54402
54402
 
54403
+ // ../core/dist/vfx/fractalNoise.frag.js
54404
+ var HASH_CONSTANTS, mulX, mulY, mulMix, offset2, shift1, shift2, divisor, MAX_OCTAVES, FRACTAL_NOISE_FRAG;
54405
+ var init_fractalNoise_frag = __esm({
54406
+ "../core/dist/vfx/fractalNoise.frag.js"() {
54407
+ "use strict";
54408
+ HASH_CONSTANTS = {
54409
+ /** Odd 32-bit multipliers, one per lattice axis plus one for the seed. */
54410
+ mulX: 374761393,
54411
+ mulY: 668265263,
54412
+ mulMix: 1274126177,
54413
+ /** 2^32/φ — breaks the all-zero fixed point at lattice corner (0, 0). */
54414
+ offset: 2654435769,
54415
+ shift1: 13,
54416
+ shift2: 16,
54417
+ /** 2^32: maps the mixed 32-bit word into [0, 1). */
54418
+ divisor: 4294967296
54419
+ };
54420
+ ({ mulX, mulY, mulMix, offset: offset2, shift1, shift2, divisor } = HASH_CONSTANTS);
54421
+ MAX_OCTAVES = 20;
54422
+ FRACTAL_NOISE_FRAG = `#version 300 es
54423
+ precision highp float;
54424
+ precision highp int;
54425
+
54426
+ in vec2 v_uv;
54427
+ out vec4 fragColor;
54428
+
54429
+ uniform vec2 u_size;
54430
+ uniform float u_t;
54431
+ uniform float u_fps;
54432
+ uniform float u_fractalType;
54433
+ uniform float u_noiseType;
54434
+ uniform float u_invert;
54435
+ uniform float u_contrast;
54436
+ uniform float u_brightness;
54437
+ uniform float u_scale;
54438
+ uniform float u_complexity;
54439
+ uniform float u_subInfluence;
54440
+ uniform float u_subScaling;
54441
+ uniform float u_evolution;
54442
+ uniform float u_randomSeed;
54443
+ uniform float u_opacity;
54444
+
54445
+ float hfHashUnit(int ix, int iy, int seed) {
54446
+ uint h = ((uint(ix) * ${mulX}u) ^ (uint(iy) * ${mulY}u) ^ (uint(seed) * ${mulMix}u)) + ${offset2}u;
54447
+ h = h ^ (h >> ${shift1}u);
54448
+ h = h * ${mulMix}u;
54449
+ h = h ^ (h >> ${shift2}u);
54450
+ return float(h) / ${divisor}.0;
54451
+ }
54452
+
54453
+ float hfFade(float f, float noiseType) {
54454
+ if (noiseType < 1.5) return 0.0;
54455
+ if (noiseType < 2.5) return f;
54456
+ if (noiseType < 3.5) return f * f * (3.0 - 2.0 * f);
54457
+ return f * f * f * (f * (f * 6.0 - 15.0) + 10.0);
54458
+ }
54459
+
54460
+ float hfValueNoise(vec2 p, int seed) {
54461
+ vec2 cell = floor(p);
54462
+ vec2 f = p - cell;
54463
+ int ix = int(cell.x);
54464
+ int iy = int(cell.y);
54465
+ float sx = hfFade(f.x, u_noiseType);
54466
+ float sy = hfFade(f.y, u_noiseType);
54467
+ float bottom = mix(hfHashUnit(ix, iy, seed), hfHashUnit(ix + 1, iy, seed), sx);
54468
+ float top = mix(hfHashUnit(ix, iy + 1, seed), hfHashUnit(ix + 1, iy + 1, seed), sx);
54469
+ return mix(bottom, top, sy);
54470
+ }
54471
+
54472
+ float hfFbm(vec2 p) {
54473
+ float lacunarity = 100.0 / max(u_subScaling, 1.0);
54474
+ float gain = u_subInfluence / 100.0;
54475
+ int seed = int(u_randomSeed);
54476
+ float amp = 1.0;
54477
+ float freq = 1.0;
54478
+ float sum = 0.0;
54479
+ float norm = 0.0;
54480
+ for (int i = 0; i < ${MAX_OCTAVES}; i++) {
54481
+ if (float(i) >= u_complexity) break;
54482
+ sum += amp * hfValueNoise(p * freq, seed + i);
54483
+ norm += amp;
54484
+ amp *= gain;
54485
+ freq *= lacunarity;
54486
+ }
54487
+ return norm > 0.0 ? sum / norm : 0.0;
54488
+ }
54489
+
54490
+ void main() {
54491
+ vec2 px = v_uv * u_size;
54492
+ vec2 p = px / max(u_scale, 1.0) + vec2(u_evolution, u_evolution * 0.5);
54493
+ float v = hfFbm(p);
54494
+ v = (v - 0.5) * (u_contrast / 100.0) + 0.5 + u_brightness / 100.0;
54495
+ if (u_invert > 0.5) v = 1.0 - v;
54496
+ v = clamp(v, 0.0, 1.0);
54497
+ float a = clamp(u_opacity / 100.0, 0.0, 1.0);
54498
+ fragColor = vec4(v * a, v * a, v * a, a);
54499
+ }
54500
+ `;
54501
+ }
54502
+ });
54503
+
54504
+ // ../core/dist/vfx/displacementMap.frag.js
54505
+ var DISPLACEMENT_MAP_CONSTANTS, lumaR, lumaG, lumaB, DISPLACEMENT_MAP_FRAG;
54506
+ var init_displacementMap_frag = __esm({
54507
+ "../core/dist/vfx/displacementMap.frag.js"() {
54508
+ "use strict";
54509
+ DISPLACEMENT_MAP_CONSTANTS = {
54510
+ lumaR: 0.299,
54511
+ lumaG: 0.587,
54512
+ lumaB: 0.114
54513
+ };
54514
+ ({ lumaR, lumaG, lumaB } = DISPLACEMENT_MAP_CONSTANTS);
54515
+ DISPLACEMENT_MAP_FRAG = `#version 300 es
54516
+ precision highp float;
54517
+
54518
+ in vec2 v_uv;
54519
+ out vec4 fragColor;
54520
+
54521
+ uniform vec2 u_size;
54522
+ uniform float u_t;
54523
+ uniform float u_fps;
54524
+ uniform sampler2D u_src;
54525
+ uniform float u_useH;
54526
+ uniform float u_maxH;
54527
+ uniform float u_useV;
54528
+ uniform float u_maxV;
54529
+ uniform float u_behavior;
54530
+ uniform float u_edge;
54531
+ uniform float u_expand;
54532
+
54533
+ vec4 hfSampleSrc(vec2 uv) {
54534
+ if (uv.x < 0.0 || uv.x > 1.0 || uv.y < 0.0 || uv.y > 1.0) return vec4(0.0);
54535
+ return texture(u_src, uv);
54536
+ }
54537
+
54538
+ // The selector's value, in [0, 1]. Half and Off both land on 0.5, which is the
54539
+ // "no displacement" midpoint the caller subtracts.
54540
+ float hfMapChannel(vec4 premultiplied, float selector) {
54541
+ vec3 rgb = premultiplied.a > 0.0 ? premultiplied.rgb / premultiplied.a : vec3(0.0);
54542
+ if (selector < 1.5) return rgb.r;
54543
+ if (selector < 2.5) return rgb.g;
54544
+ if (selector < 3.5) return rgb.b;
54545
+ if (selector < 4.5) return premultiplied.a;
54546
+ if (selector < 8.5) return dot(rgb, vec3(${lumaR}, ${lumaG}, ${lumaB}));
54547
+ if (selector < 9.5) return 1.0;
54548
+ return 0.5;
54549
+ }
54550
+
54551
+ void main() {
54552
+ vec4 mapTexel = texture(u_src, v_uv);
54553
+ float h = hfMapChannel(mapTexel, u_useH);
54554
+ float v = hfMapChannel(mapTexel, u_useV);
54555
+ vec2 d = vec2((h - 0.5) * 2.0 * u_maxH, (v - 0.5) * 2.0 * u_maxV);
54556
+ fragColor = hfSampleSrc(v_uv + d / u_size);
54557
+ }
54558
+ `;
54559
+ }
54560
+ });
54561
+
54562
+ // ../core/dist/vfx/waveWarp.frag.js
54563
+ var WAVE_WARP_CONSTANTS, tau, degreesPerTurn, WAVE_WARP_FRAG;
54564
+ var init_waveWarp_frag = __esm({
54565
+ "../core/dist/vfx/waveWarp.frag.js"() {
54566
+ "use strict";
54567
+ WAVE_WARP_CONSTANTS = {
54568
+ tau: 6.283185307179586,
54569
+ degreesPerTurn: 360
54570
+ };
54571
+ ({ tau, degreesPerTurn } = WAVE_WARP_CONSTANTS);
54572
+ WAVE_WARP_FRAG = `#version 300 es
54573
+ precision highp float;
54574
+
54575
+ in vec2 v_uv;
54576
+ out vec4 fragColor;
54577
+
54578
+ uniform vec2 u_size;
54579
+ uniform float u_t;
54580
+ uniform float u_fps;
54581
+ uniform sampler2D u_src;
54582
+ uniform float u_waveType;
54583
+ uniform float u_height;
54584
+ uniform float u_width;
54585
+ uniform float u_direction;
54586
+ uniform float u_speed;
54587
+ uniform float u_pinning;
54588
+ uniform float u_phase;
54589
+
54590
+ // Outside the layer's own box there is nothing to warp in from, so the wave
54591
+ // carries transparency rather than a smeared edge pixel.
54592
+ vec4 hfSampleSrc(vec2 uv) {
54593
+ if (uv.x < 0.0 || uv.x > 1.0 || uv.y < 0.0 || uv.y > 1.0) return vec4(0.0);
54594
+ return texture(u_src, uv);
54595
+ }
54596
+
54597
+ void main() {
54598
+ vec2 px = v_uv * u_size;
54599
+ float dir = radians(u_direction);
54600
+ vec2 travel = vec2(sin(dir), -cos(dir));
54601
+ vec2 swing = vec2(-travel.y, travel.x);
54602
+ float proj = (px.x + 1.0) * travel.x + px.y * travel.y;
54603
+ float turns = proj / max(u_width, 1.0) + u_phase / ${degreesPerTurn}.0 + u_speed * u_t;
54604
+ float disp = u_height * sin(${tau} * turns);
54605
+ fragColor = hfSampleSrc((px + swing * disp) / u_size);
54606
+ }
54607
+ `;
54608
+ }
54609
+ });
54610
+
54611
+ // ../core/dist/vfx.js
54612
+ function enabledVfxNodes(chain) {
54613
+ return chain.nodes.filter((n) => n.enabled !== false);
54614
+ }
54615
+ function chainCapture(chain) {
54616
+ let best = "none";
54617
+ for (const node of enabledVfxNodes(chain)) {
54618
+ const def = BY_ID2.get(node.type);
54619
+ if (def && CAPTURE_RANK[def.capture] > CAPTURE_RANK[best])
54620
+ best = def.capture;
54621
+ }
54622
+ return best;
54623
+ }
54624
+ function parseVfxChain(json) {
54625
+ let raw;
54626
+ try {
54627
+ raw = JSON.parse(json);
54628
+ } catch (err) {
54629
+ throw new VfxChainError(`Chain file is not valid JSON: ${err.message}`);
54630
+ }
54631
+ if (typeof raw !== "object" || raw === null) {
54632
+ throw new VfxChainError("Chain file must be a JSON object.");
54633
+ }
54634
+ const obj = raw;
54635
+ if (obj.version !== HF_VFX_CHAIN_VERSION) {
54636
+ throw new VfxChainError(`Unsupported chain version: ${String(obj.version)}`);
54637
+ }
54638
+ if (!Array.isArray(obj.nodes)) {
54639
+ throw new VfxChainError("Chain file is missing a `nodes` array.");
54640
+ }
54641
+ const nodes = obj.nodes.map(parseVfxNode);
54642
+ return { version: HF_VFX_CHAIN_VERSION, nodes };
54643
+ }
54644
+ function isPlainObject(v) {
54645
+ return typeof v === "object" && v !== null;
54646
+ }
54647
+ function requireVfxNodeType(node, i) {
54648
+ if (typeof node.type !== "string" || !BY_ID2.has(node.type)) {
54649
+ throw new VfxChainError(`Node ${i} has unknown effect type: ${String(node.type)}`);
54650
+ }
54651
+ return node.type;
54652
+ }
54653
+ function requireVfxNodeId(node, i) {
54654
+ if (typeof node.id !== "string" || node.id === "") {
54655
+ throw new VfxChainError(`Node ${i} is missing an id.`);
54656
+ }
54657
+ return node.id;
54658
+ }
54659
+ function parseVfxNode(n, i) {
54660
+ if (!isPlainObject(n)) {
54661
+ throw new VfxChainError(`Node ${i} is not an object.`);
54662
+ }
54663
+ const node = n;
54664
+ const type = requireVfxNodeType(node, i);
54665
+ const id = requireVfxNodeId(node, i);
54666
+ const params = isPlainObject(node.params) ? node.params : {};
54667
+ return withoutUndefined2({
54668
+ type,
54669
+ id,
54670
+ enabled: node.enabled === false ? false : void 0,
54671
+ params
54672
+ });
54673
+ }
54674
+ function withoutUndefined2(obj) {
54675
+ for (const key2 of Object.keys(obj)) {
54676
+ if (obj[key2] === void 0)
54677
+ delete obj[key2];
54678
+ }
54679
+ return obj;
54680
+ }
54681
+ var HF_VFX_ATTR, HF_VFX_CHAIN_VERSION, DISPLACEMENT_CHANNELS, HF_VFX, BY_ID2, VfxChainError, CAPTURE_RANK;
54682
+ var init_vfx = __esm({
54683
+ "../core/dist/vfx.js"() {
54684
+ "use strict";
54685
+ init_fractalNoise_frag();
54686
+ init_displacementMap_frag();
54687
+ init_waveWarp_frag();
54688
+ HF_VFX_ATTR = "data-vfx-chain";
54689
+ HF_VFX_CHAIN_VERSION = 1;
54690
+ DISPLACEMENT_CHANNELS = [
54691
+ { value: 1, label: "Red" },
54692
+ { value: 2, label: "Green" },
54693
+ { value: 3, label: "Blue" },
54694
+ { value: 4, label: "Alpha" },
54695
+ { value: 5, label: "Luminance" },
54696
+ { value: 6, label: "Hue" },
54697
+ { value: 7, label: "Lightness" },
54698
+ { value: 8, label: "Saturation" },
54699
+ { value: 9, label: "Full" },
54700
+ { value: 10, label: "Half" },
54701
+ { value: 11, label: "Off" }
54702
+ ];
54703
+ HF_VFX = [
54704
+ {
54705
+ id: "fractal-noise",
54706
+ label: "Fractal Noise",
54707
+ ae: "ADBE Fractal Noise",
54708
+ capture: "none",
54709
+ frag: FRACTAL_NOISE_FRAG,
54710
+ params: [
54711
+ {
54712
+ kind: "enum",
54713
+ key: "fractalType",
54714
+ label: "Fractal Type",
54715
+ options: [{ value: 1, label: "Basic" }],
54716
+ default: 1,
54717
+ hint: "Only Basic is implemented in v1."
54718
+ },
54719
+ {
54720
+ kind: "enum",
54721
+ key: "noiseType",
54722
+ label: "Noise Type",
54723
+ options: [
54724
+ { value: 1, label: "Block" },
54725
+ { value: 2, label: "Linear" },
54726
+ { value: 3, label: "Soft Linear" },
54727
+ { value: 4, label: "Spline" }
54728
+ ],
54729
+ default: 3
54730
+ },
54731
+ { kind: "bool", key: "invert", label: "Invert", default: false },
54732
+ {
54733
+ kind: "number",
54734
+ key: "contrast",
54735
+ label: "Contrast",
54736
+ unit: "%",
54737
+ min: 0,
54738
+ max: 1e3,
54739
+ step: 1,
54740
+ default: 100
54741
+ },
54742
+ {
54743
+ kind: "number",
54744
+ key: "brightness",
54745
+ label: "Brightness",
54746
+ unit: "",
54747
+ min: -1e3,
54748
+ max: 1e3,
54749
+ step: 1,
54750
+ default: 0
54751
+ },
54752
+ {
54753
+ kind: "number",
54754
+ key: "scale",
54755
+ label: "Scale",
54756
+ unit: "%",
54757
+ min: 6,
54758
+ max: 1e4,
54759
+ step: 1,
54760
+ default: 100
54761
+ },
54762
+ {
54763
+ kind: "number",
54764
+ key: "complexity",
54765
+ label: "Complexity",
54766
+ unit: "",
54767
+ min: 1,
54768
+ max: 20,
54769
+ step: 1,
54770
+ default: 6
54771
+ },
54772
+ {
54773
+ kind: "number",
54774
+ key: "subInfluence",
54775
+ label: "Sub Influence",
54776
+ unit: "%",
54777
+ min: 0,
54778
+ max: 100,
54779
+ step: 1,
54780
+ default: 70
54781
+ },
54782
+ {
54783
+ kind: "number",
54784
+ key: "subScaling",
54785
+ label: "Sub Scaling",
54786
+ unit: "%",
54787
+ min: 0,
54788
+ max: 100,
54789
+ step: 1,
54790
+ default: 56
54791
+ },
54792
+ {
54793
+ kind: "number",
54794
+ key: "evolution",
54795
+ label: "Evolution",
54796
+ unit: "revolutions",
54797
+ min: -1e4,
54798
+ max: 1e4,
54799
+ step: 0.01,
54800
+ default: 0,
54801
+ animatable: true
54802
+ },
54803
+ {
54804
+ kind: "number",
54805
+ key: "randomSeed",
54806
+ label: "Random Seed",
54807
+ unit: "",
54808
+ min: 0,
54809
+ max: 99999,
54810
+ step: 1,
54811
+ default: 0
54812
+ },
54813
+ {
54814
+ kind: "number",
54815
+ key: "opacity",
54816
+ label: "Opacity",
54817
+ unit: "%",
54818
+ min: 0,
54819
+ max: 100,
54820
+ step: 1,
54821
+ default: 100,
54822
+ animatable: true
54823
+ }
54824
+ ]
54825
+ },
54826
+ {
54827
+ id: "wave-warp",
54828
+ label: "Wave Warp",
54829
+ ae: "ADBE Wave Warp",
54830
+ capture: "self",
54831
+ frag: WAVE_WARP_FRAG,
54832
+ params: [
54833
+ {
54834
+ kind: "enum",
54835
+ key: "waveType",
54836
+ label: "Wave Type",
54837
+ options: [{ value: 1, label: "Sine" }],
54838
+ default: 1,
54839
+ hint: "Only Sine is implemented in v1; the exporter marks the others cosmetic."
54840
+ },
54841
+ {
54842
+ kind: "number",
54843
+ key: "height",
54844
+ label: "Wave Height",
54845
+ unit: "px",
54846
+ min: -1e3,
54847
+ max: 1e3,
54848
+ step: 1,
54849
+ default: 10,
54850
+ animatable: true
54851
+ },
54852
+ {
54853
+ kind: "number",
54854
+ key: "width",
54855
+ label: "Wave Width",
54856
+ unit: "px",
54857
+ min: 1,
54858
+ max: 1e4,
54859
+ step: 1,
54860
+ default: 40,
54861
+ animatable: true
54862
+ },
54863
+ {
54864
+ kind: "number",
54865
+ key: "direction",
54866
+ label: "Direction",
54867
+ unit: "deg",
54868
+ min: -360,
54869
+ max: 360,
54870
+ step: 1,
54871
+ default: 90
54872
+ },
54873
+ {
54874
+ kind: "number",
54875
+ key: "speed",
54876
+ label: "Wave Speed",
54877
+ unit: "waves/s",
54878
+ min: -100,
54879
+ max: 100,
54880
+ step: 0.1,
54881
+ default: 1
54882
+ },
54883
+ {
54884
+ kind: "enum",
54885
+ key: "pinning",
54886
+ label: "Pinning",
54887
+ options: [{ value: 1, label: "None" }],
54888
+ default: 1,
54889
+ hint: "Only None is implemented in v1; the exporter marks the others cosmetic."
54890
+ },
54891
+ {
54892
+ kind: "number",
54893
+ key: "phase",
54894
+ label: "Phase",
54895
+ unit: "deg",
54896
+ min: -360,
54897
+ max: 360,
54898
+ step: 1,
54899
+ default: 0,
54900
+ animatable: true
54901
+ }
54902
+ ]
54903
+ },
54904
+ {
54905
+ id: "displacement-map",
54906
+ label: "Displacement Map",
54907
+ ae: "ADBE Displacement Map",
54908
+ capture: "self",
54909
+ frag: DISPLACEMENT_MAP_FRAG,
54910
+ params: [
54911
+ {
54912
+ kind: "enum",
54913
+ key: "useH",
54914
+ label: "Use For Horizontal Displacement",
54915
+ options: DISPLACEMENT_CHANNELS,
54916
+ default: 1,
54917
+ hint: "Hue, Lightness and Saturation are read as Luminance in v1."
54918
+ },
54919
+ {
54920
+ kind: "number",
54921
+ key: "maxH",
54922
+ label: "Max Horizontal Displacement",
54923
+ unit: "px",
54924
+ min: -32e3,
54925
+ max: 32e3,
54926
+ step: 1,
54927
+ default: 5,
54928
+ animatable: true
54929
+ },
54930
+ {
54931
+ kind: "enum",
54932
+ key: "useV",
54933
+ label: "Use For Vertical Displacement",
54934
+ options: DISPLACEMENT_CHANNELS,
54935
+ default: 2,
54936
+ hint: "Hue, Lightness and Saturation are read as Luminance in v1."
54937
+ },
54938
+ {
54939
+ kind: "number",
54940
+ key: "maxV",
54941
+ label: "Max Vertical Displacement",
54942
+ unit: "px",
54943
+ min: -32e3,
54944
+ max: 32e3,
54945
+ step: 1,
54946
+ default: 5,
54947
+ animatable: true
54948
+ },
54949
+ {
54950
+ kind: "enum",
54951
+ key: "behavior",
54952
+ label: "Displacement Map Behavior",
54953
+ options: [{ value: 1, label: "Center Map" }],
54954
+ default: 1,
54955
+ hint: "Only Center Map is implemented in v1."
54956
+ },
54957
+ {
54958
+ kind: "enum",
54959
+ key: "edge",
54960
+ label: "Edge Behavior",
54961
+ options: [{ value: 0, label: "Off" }],
54962
+ default: 0,
54963
+ hint: "Only Off (transparent outside the layer) is implemented in v1."
54964
+ },
54965
+ {
54966
+ kind: "bool",
54967
+ key: "expand",
54968
+ label: "Expand Output",
54969
+ default: true
54970
+ }
54971
+ ]
54972
+ }
54973
+ ];
54974
+ BY_ID2 = new Map(HF_VFX.map((d) => [d.id, d]));
54975
+ VfxChainError = class extends Error {
54976
+ constructor(message) {
54977
+ super(message);
54978
+ this.name = "VfxChainError";
54979
+ }
54980
+ };
54981
+ CAPTURE_RANK = { none: 0, self: 1, backdrop: 2 };
54982
+ }
54983
+ });
54984
+
54403
54985
  // ../core/dist/index.js
54404
54986
  var init_dist2 = __esm({
54405
54987
  "../core/dist/index.js"() {
@@ -54444,6 +55026,7 @@ var init_dist2 = __esm({
54444
55026
  init_registry();
54445
55027
  init_canary();
54446
55028
  init_canaryRegistry();
55029
+ init_vfx();
54447
55030
  }
54448
55031
  });
54449
55032
 
@@ -54645,7 +55228,7 @@ var init_vp9Options = __esm({
54645
55228
  // ../engine/src/config.ts
54646
55229
  import { tmpdir } from "os";
54647
55230
  import { join as join3 } from "path";
54648
- function isPlainObject(value) {
55231
+ function isPlainObject2(value) {
54649
55232
  return typeof value === "object" && value !== null && !Array.isArray(value) && [Object.prototype, null].includes(Object.getPrototypeOf(value));
54650
55233
  }
54651
55234
  function assertEngineConfigNumber(config, field, min, integer = false) {
@@ -54714,7 +55297,7 @@ function validateEngineConfigRuntime(config) {
54714
55297
  }
54715
55298
  function validateEngineConfigHdr(config) {
54716
55299
  const { hdr } = config;
54717
- if (hdr !== false && (!isPlainObject(hdr) || Object.keys(hdr).length !== 1 || hdr.transfer !== "hlg" && hdr.transfer !== "pq")) {
55300
+ if (hdr !== false && (!isPlainObject2(hdr) || Object.keys(hdr).length !== 1 || hdr.transfer !== "hlg" && hdr.transfer !== "pq")) {
54718
55301
  throw new Error("Engine config hdr must be false or an hlg/pq transfer object");
54719
55302
  }
54720
55303
  }
@@ -54738,7 +55321,7 @@ function validateOptionalEngineConfigFields(config) {
54738
55321
  }
54739
55322
  }
54740
55323
  function validateEngineConfigSnapshot(value) {
54741
- if (!isPlainObject(value)) throw new Error("Engine config snapshot must be a plain object");
55324
+ if (!isPlainObject2(value)) throw new Error("Engine config snapshot must be a plain object");
54742
55325
  validateRequiredEngineConfigFields(value);
54743
55326
  validateEngineConfigScalars(value);
54744
55327
  validateEngineConfigParallelism(value);
@@ -56716,7 +57299,7 @@ function motionBlurSampleTimes(plan2, frameIndex, fps, samplesPerFrame) {
56716
57299
  const grid = fps * plan2.subFrameDivisions;
56717
57300
  const frameTicks = frameIndex * plan2.subFrameDivisions;
56718
57301
  return sampleTickOffsets(plan2, samplesPerFrame).map(
56719
- (offset2) => Math.max(0, frameTicks + offset2) / grid
57302
+ (offset3) => Math.max(0, frameTicks + offset3) / grid
56720
57303
  );
56721
57304
  }
56722
57305
  function motionBlurProbeTimes(plan2, frameIndex, fps) {
@@ -60619,14 +61202,14 @@ async function computeStaticFrameSet(page, fps) {
60619
61202
  const intervals2 = [];
60620
61203
  let tweenCount2 = 0;
60621
61204
  let hasTimelineCall2 = false;
60622
- function walk(tl, offset2) {
61205
+ function walk(tl, offset3) {
60623
61206
  if (typeof tl.getChildren !== "function") return;
60624
61207
  if (typeof tl.vars?.onUpdate === "function") {
60625
61208
  const total = typeof tl.totalDuration === "function" ? tl.totalDuration() : 0;
60626
- if (total > 0) intervals2.push({ start: offset2, end: offset2 + total, spatial: true });
61209
+ if (total > 0) intervals2.push({ start: offset3, end: offset3 + total, spatial: true });
60627
61210
  }
60628
61211
  for (const child of tl.getChildren(false, true, true)) {
60629
- const start = offset2 + (typeof child.startTime === "function" ? child.startTime() : 0);
61212
+ const start = offset3 + (typeof child.startTime === "function" ? child.startTime() : 0);
60630
61213
  const single = typeof child.duration === "function" ? child.duration() : 0;
60631
61214
  const total = typeof child.totalDuration === "function" ? child.totalDuration() : single;
60632
61215
  if (typeof child.getChildren === "function") {
@@ -61054,10 +61637,10 @@ async function computeTimelineAtRiskFrames(page, fps) {
61054
61637
  "maskImage",
61055
61638
  "mask"
61056
61639
  ]);
61057
- function walkTimeline(tl, offset2, out) {
61640
+ function walkTimeline(tl, offset3, out) {
61058
61641
  if (typeof tl.getChildren !== "function") return;
61059
61642
  for (const child of tl.getChildren(false, true, true)) {
61060
- const childStart = offset2 + (typeof child.startTime === "function" ? child.startTime() : 0);
61643
+ const childStart = offset3 + (typeof child.startTime === "function" ? child.startTime() : 0);
61061
61644
  const childDur = typeof child.duration === "function" ? child.duration() : 0;
61062
61645
  if (typeof child.getChildren === "function") {
61063
61646
  walkTimeline(child, childStart, out);
@@ -62393,8 +62976,8 @@ function redactFfprobeInput(stderr, filePath) {
62393
62976
  const inputBasename = basename2(filePath);
62394
62977
  if (inputBasename) redacted = redacted.split(inputBasename).join("[input]");
62395
62978
  if (!redacted.startsWith("[input]")) {
62396
- for (let offset2 = 1; offset2 < filePath.length; offset2 += 1) {
62397
- const suffix = filePath.slice(offset2);
62979
+ for (let offset3 = 1; offset3 < filePath.length; offset3 += 1) {
62980
+ const suffix = filePath.slice(offset3);
62398
62981
  if (suffix.length < 4 || !redacted.startsWith(suffix)) continue;
62399
62982
  const boundary = redacted[suffix.length];
62400
62983
  if (boundary !== void 0 && !/[\s:'")\]}]/.test(boundary)) continue;
@@ -62489,8 +63072,8 @@ async function hasAvifFileBrand(filePath) {
62489
63072
  if (boxSize < 16 || boxSize > bytes.length) return false;
62490
63073
  const avifBrands = /* @__PURE__ */ new Set(["avif", "avis"]);
62491
63074
  if (avifBrands.has(bytes.toString("ascii", 8, 12))) return true;
62492
- for (let offset2 = 16; offset2 + 4 <= boxSize; offset2 += 4) {
62493
- if (avifBrands.has(bytes.toString("ascii", offset2, offset2 + 4))) return true;
63075
+ for (let offset3 = 16; offset3 + 4 <= boxSize; offset3 += 4) {
63076
+ if (avifBrands.has(bytes.toString("ascii", offset3, offset3 + 4))) return true;
62494
63077
  }
62495
63078
  return false;
62496
63079
  } catch {
@@ -62572,20 +63155,20 @@ async function hasCompletePngStructure(filePath, signal) {
62572
63155
  }
62573
63156
  let seenHeader = false;
62574
63157
  let seenImageData = false;
62575
- let offset2 = 8;
62576
- while (offset2 + 12 <= fileSize) {
63158
+ let offset3 = 8;
63159
+ while (offset3 + 12 <= fileSize) {
62577
63160
  signal?.throwIfAborted();
62578
- const chunkHeader = await readFileRange(filePath, offset2, 8, signal);
63161
+ const chunkHeader = await readFileRange(filePath, offset3, 8, signal);
62579
63162
  signal?.throwIfAborted();
62580
63163
  if (chunkHeader.length !== 8) return false;
62581
63164
  const chunkLength = chunkHeader.readUInt32BE(0);
62582
- const chunkEnd = offset2 + 12 + chunkLength;
63165
+ const chunkEnd = offset3 + 12 + chunkLength;
62583
63166
  if (chunkEnd > fileSize) return false;
62584
63167
  const chunkType = chunkHeader.toString("ascii", 4, 8);
62585
- if (chunkType === "IHDR") seenHeader = chunkLength === 13 && offset2 === 8;
63168
+ if (chunkType === "IHDR") seenHeader = chunkLength === 13 && offset3 === 8;
62586
63169
  if (chunkType === "IDAT") seenImageData = true;
62587
63170
  if (chunkType === "IEND") return seenHeader && seenImageData && chunkLength === 0;
62588
- offset2 = chunkEnd;
63171
+ offset3 = chunkEnd;
62589
63172
  }
62590
63173
  return false;
62591
63174
  } catch (error) {
@@ -63694,9 +64277,9 @@ var init_chunkEncoder = __esm({
63694
64277
  function jpegInputError(buffer) {
63695
64278
  if (buffer.length === 0) return "empty frame";
63696
64279
  if (buffer[0] !== 255 || buffer[1] !== 216) return "missing JPEG SOI marker";
63697
- let offset2 = 2;
63698
- while (offset2 < buffer.length) {
63699
- const segment = readSegment(buffer, offset2);
64280
+ let offset3 = 2;
64281
+ while (offset3 < buffer.length) {
64282
+ const segment = readSegment(buffer, offset3);
63700
64283
  if (typeof segment === "string") return segment;
63701
64284
  const { marker, start, end } = segment;
63702
64285
  if (marker === 219) {
@@ -63704,33 +64287,33 @@ function jpegInputError(buffer) {
63704
64287
  if (error) return error;
63705
64288
  }
63706
64289
  if (marker === 218) return void 0;
63707
- offset2 = end;
64290
+ offset3 = end;
63708
64291
  }
63709
64292
  return "missing JPEG scan";
63710
64293
  }
63711
- function readSegment(buffer, offset2) {
63712
- if (buffer[offset2++] !== 255) return "invalid JPEG marker";
63713
- while (buffer[offset2] === 255) offset2++;
63714
- const marker = buffer[offset2++];
64294
+ function readSegment(buffer, offset3) {
64295
+ if (buffer[offset3++] !== 255) return "invalid JPEG marker";
64296
+ while (buffer[offset3] === 255) offset3++;
64297
+ const marker = buffer[offset3++];
63715
64298
  if (marker === void 0) return "truncated JPEG marker";
63716
- if (marker === 1) return { marker, start: offset2, end: offset2 };
63717
- if (offset2 + 2 > buffer.length) return "truncated JPEG segment length";
63718
- const length = buffer.readUInt16BE(offset2);
63719
- const end = offset2 + length;
64299
+ if (marker === 1) return { marker, start: offset3, end: offset3 };
64300
+ if (offset3 + 2 > buffer.length) return "truncated JPEG segment length";
64301
+ const length = buffer.readUInt16BE(offset3);
64302
+ const end = offset3 + length;
63720
64303
  if (length < 2 || end > buffer.length) return "invalid JPEG segment length";
63721
- return { marker, start: offset2 + 2, end };
64304
+ return { marker, start: offset3 + 2, end };
63722
64305
  }
63723
64306
  function quantizationTableError(buffer, start, end) {
63724
64307
  if (start === end) return "empty JPEG DQT segment";
63725
- let offset2 = start;
63726
- while (offset2 < end) {
63727
- const descriptor = buffer[offset2++];
64308
+ let offset3 = start;
64309
+ while (offset3 < end) {
64310
+ const descriptor = buffer[offset3++];
63728
64311
  if (descriptor === void 0) return "truncated JPEG DQT descriptor";
63729
64312
  const precision = descriptor >> 4;
63730
64313
  if (precision > 1) return `invalid JPEG DQT precision ${precision}`;
63731
64314
  if ((descriptor & 15) > 3) return "invalid JPEG DQT table id";
63732
- offset2 += precision === 0 ? 64 : 128;
63733
- if (offset2 > end) return "truncated JPEG DQT table";
64315
+ offset3 += precision === 0 ? 64 : 128;
64316
+ if (offset3 > end) return "truncated JPEG DQT table";
63734
64317
  }
63735
64318
  return void 0;
63736
64319
  }
@@ -68189,7 +68772,7 @@ var require_tokenize = __commonJS({
68189
68772
  var tokens = [];
68190
68773
  var css = input.css.valueOf();
68191
68774
  var length = css.length;
68192
- var offset2 = -1;
68775
+ var offset3 = -1;
68193
68776
  var line = 1;
68194
68777
  var start = 0;
68195
68778
  var end = 0;
@@ -68199,13 +68782,13 @@ var require_tokenize = __commonJS({
68199
68782
  css += fix;
68200
68783
  next = css.length - 1;
68201
68784
  } else {
68202
- throw input.error("Unclosed " + what, line, start - offset2, start);
68785
+ throw input.error("Unclosed " + what, line, start - offset3, start);
68203
68786
  }
68204
68787
  }
68205
68788
  while (start < length) {
68206
68789
  code = css.charCodeAt(start);
68207
68790
  if (code === t.newline) {
68208
- offset2 = start;
68791
+ offset3 = start;
68209
68792
  line += 1;
68210
68793
  }
68211
68794
  switch (code) {
@@ -68219,13 +68802,13 @@ var require_tokenize = __commonJS({
68219
68802
  next += 1;
68220
68803
  code = css.charCodeAt(next);
68221
68804
  if (code === t.newline) {
68222
- offset2 = next;
68805
+ offset3 = next;
68223
68806
  line += 1;
68224
68807
  }
68225
68808
  } while (code === t.space || code === t.newline || code === t.tab || code === t.cr || code === t.feed);
68226
68809
  tokenType = t.space;
68227
68810
  endLine = line;
68228
- endColumn = next - offset2 - 1;
68811
+ endColumn = next - offset3 - 1;
68229
68812
  end = next;
68230
68813
  break;
68231
68814
  case t.plus:
@@ -68239,7 +68822,7 @@ var require_tokenize = __commonJS({
68239
68822
  } while (code === t.plus || code === t.greaterThan || code === t.tilde || code === t.pipe);
68240
68823
  tokenType = t.combinator;
68241
68824
  endLine = line;
68242
- endColumn = start - offset2;
68825
+ endColumn = start - offset3;
68243
68826
  end = next;
68244
68827
  break;
68245
68828
  // Consume these characters as single tokens.
@@ -68259,7 +68842,7 @@ var require_tokenize = __commonJS({
68259
68842
  next = start;
68260
68843
  tokenType = code;
68261
68844
  endLine = line;
68262
- endColumn = start - offset2;
68845
+ endColumn = start - offset3;
68263
68846
  end = next + 1;
68264
68847
  break;
68265
68848
  case t.singleQuote:
@@ -68280,7 +68863,7 @@ var require_tokenize = __commonJS({
68280
68863
  } while (escaped);
68281
68864
  tokenType = t.str;
68282
68865
  endLine = line;
68283
- endColumn = start - offset2;
68866
+ endColumn = start - offset3;
68284
68867
  end = next + 1;
68285
68868
  break;
68286
68869
  default:
@@ -68297,7 +68880,7 @@ var require_tokenize = __commonJS({
68297
68880
  nextOffset = next - lines[last].length;
68298
68881
  } else {
68299
68882
  nextLine = line;
68300
- nextOffset = offset2;
68883
+ nextOffset = offset3;
68301
68884
  }
68302
68885
  tokenType = t.comment;
68303
68886
  line = nextLine;
@@ -68307,13 +68890,13 @@ var require_tokenize = __commonJS({
68307
68890
  next = start;
68308
68891
  tokenType = code;
68309
68892
  endLine = line;
68310
- endColumn = start - offset2;
68893
+ endColumn = start - offset3;
68311
68894
  end = next + 1;
68312
68895
  } else {
68313
68896
  next = consumeWord(css, start);
68314
68897
  tokenType = t.word;
68315
68898
  endLine = line;
68316
- endColumn = next - offset2;
68899
+ endColumn = next - offset3;
68317
68900
  }
68318
68901
  end = next + 1;
68319
68902
  break;
@@ -68323,7 +68906,7 @@ var require_tokenize = __commonJS({
68323
68906
  // [0] Token type
68324
68907
  line,
68325
68908
  // [1] Starting line
68326
- start - offset2,
68909
+ start - offset3,
68327
68910
  // [2] Starting column
68328
68911
  endLine,
68329
68912
  // [3] Ending line
@@ -68335,7 +68918,7 @@ var require_tokenize = __commonJS({
68335
68918
  // [6] End position
68336
68919
  ]);
68337
68920
  if (nextOffset) {
68338
- offset2 = nextOffset;
68921
+ offset3 = nextOffset;
68339
68922
  nextOffset = null;
68340
68923
  }
68341
68924
  start = end;
@@ -76745,8 +77328,8 @@ ${other.raw}`)
76745
77328
  (tag) => tagSimpleSelectors(tag).some((token) => alreadyHidden.has(token))
76746
77329
  );
76747
77330
  if (hiddenByToken || hiddenByElement) continue;
76748
- const offset2 = win.propertyValues["strokeDashoffset"];
76749
- const hidesByOffset = numberValue(offset2) !== null && !zeroValue(offset2);
77331
+ const offset3 = win.propertyValues["strokeDashoffset"];
77332
+ const hidesByOffset = numberValue(offset3) !== null && !zeroValue(offset3);
76750
77333
  const hides = isHiddenGsapState(win.propertyValues) || zeroValue(win.propertyValues["scale"]) || hidesByOffset;
76751
77334
  if (!hides) continue;
76752
77335
  findings.push({
@@ -80223,12 +80806,12 @@ var init_mediaVolumeEnvelope = __esm({
80223
80806
 
80224
80807
  // ../engine/src/services/wavChunks.ts
80225
80808
  function* riffChunks(buffer) {
80226
- let offset2 = 12;
80227
- while (offset2 + 8 <= buffer.length) {
80228
- const id = buffer.toString("ascii", offset2, offset2 + 4);
80229
- const size = buffer.readUInt32LE(offset2 + 4);
80230
- yield { id, body: offset2 + 8, size };
80231
- offset2 += 8 + size + size % 2;
80809
+ let offset3 = 12;
80810
+ while (offset3 + 8 <= buffer.length) {
80811
+ const id = buffer.toString("ascii", offset3, offset3 + 4);
80812
+ const size = buffer.readUInt32LE(offset3 + 4);
80813
+ yield { id, body: offset3 + 8, size };
80814
+ offset3 += 8 + size + size % 2;
80232
80815
  }
80233
80816
  }
80234
80817
  function extensibleFormatTag(fmt) {
@@ -80638,13 +81221,13 @@ async function readPlaneFromPage(page, index, byteLength) {
80638
81221
  const parts = [];
80639
81222
  for (let at2 = 0; at2 < byteLength; at2 += TRANSFER_BYTES) {
80640
81223
  const b64 = await page.evaluate(
80641
- ([plane_index, offset2, limit]) => {
81224
+ ([plane_index, offset3, limit]) => {
80642
81225
  const plane = window.__HF_FX_IO?.out[plane_index];
80643
81226
  if (!plane) return "";
80644
81227
  const u8 = new Uint8Array(
80645
81228
  plane.buffer,
80646
- plane.byteOffset + offset2,
80647
- Math.min(limit, plane.length * 4 - offset2)
81229
+ plane.byteOffset + offset3,
81230
+ Math.min(limit, plane.length * 4 - offset3)
80648
81231
  );
80649
81232
  let s = "";
80650
81233
  const CHUNK = 32768;
@@ -82230,11 +82813,11 @@ async function verifyDiskDrawElementSamples(session, task, streaming) {
82230
82813
  if (!truths || truths.size === 0) return;
82231
82814
  const verifyMinDb = resolveDeVerifyMinDb();
82232
82815
  const ext = session.options.format === "png" ? "png" : "jpg";
82233
- const offset2 = task.outputFrameOffset ?? 0;
82816
+ const offset3 = task.outputFrameOffset ?? 0;
82234
82817
  for (const idx of selectVerifySampleIndicesForTask(truths.keys(), task)) {
82235
82818
  const truth = truths.get(idx);
82236
82819
  if (!truth) continue;
82237
- const framePath = join17(task.outputDir, `frame_${String(idx - offset2).padStart(6, "0")}.${ext}`);
82820
+ const framePath = join17(task.outputDir, `frame_${String(idx - offset3).padStart(6, "0")}.${ext}`);
82238
82821
  const db = await psnrForDiskSample(framePath, truth, task.workerId, idx);
82239
82822
  if (db === null) continue;
82240
82823
  assertDiskSampleAboveFloor(db, verifyMinDb, idx, task.workerId);
@@ -90109,6 +90692,9 @@ function aggregateDrawElement(perfs, de) {
90109
90692
  hasLut: de.hasLut,
90110
90693
  rootBodyMismatch: de.rootBodyMismatch,
90111
90694
  rootBodyDeltaPxBucket: de.rootBodyDeltaPxBucket,
90695
+ vfxHostCount: de.vfxHostCount,
90696
+ vfxCapture: de.vfxCapture,
90697
+ vfxTypes: de.vfxTypes,
90112
90698
  shortBand: de.shortBand,
90113
90699
  parallelRouter: de.parallelRouter ?? "none",
90114
90700
  preRouterWorkers: de.preRouterWorkers,
@@ -92056,18 +92642,18 @@ function resolveHostWindow(element, document2, startCache, visiting) {
92056
92642
  if (ancestor2.hasAttribute(COMPOSITION_HOST_ATTR)) hosts.push(ancestor2);
92057
92643
  }
92058
92644
  if (hosts.length === 0) return ROOT_WINDOW;
92059
- let offset2 = 0;
92645
+ let offset3 = 0;
92060
92646
  let limit = Infinity;
92061
92647
  for (const host of hosts.reverse()) {
92062
92648
  const hostStart = resolveReferencedStart(document2, host, startCache, visiting);
92063
92649
  const hostEnd = resolveHostEnd(host, hostStart);
92064
- if (hostEnd != null) limit = Math.min(limit, offset2 + hostEnd);
92065
- offset2 += hostStart;
92650
+ if (hostEnd != null) limit = Math.min(limit, offset3 + hostEnd);
92651
+ offset3 += hostStart;
92066
92652
  }
92067
92653
  const tag = element.tagName.toLowerCase();
92068
92654
  const basis = tag === "video" || tag === "audio" ? readMediaStartBasis(element.getAttribute(MEDIA_START_BASIS_ATTR)) : "local";
92069
92655
  return {
92070
- offset: offset2,
92656
+ offset: offset3,
92071
92657
  limit,
92072
92658
  basis
92073
92659
  };
@@ -93996,7 +94582,7 @@ function studioPositionSeekReapplyRuntime() {
93996
94582
  }
93997
94583
 
93998
94584
  // ../core/dist/generated/position-edits-render-inline.js
93999
- var POSITION_EDITS_RENDER_IIFE = '"use strict";(()=>{function T(){return globalThis}function P(e,t){if(typeof window>"u")return;let o=T(),r=o.__hf?.onSwallowed;if(r)try{r({label:e,error:t})}catch(s){}(o.__hfDebug||o.__HYPERFRAMES_DEBUG)&&console.debug(`[hyperframes] ${e} swallowed:`,t)}var x=null;function R(e,t){if(x)try{x({source:"hf-preview",type:"analytics",event:e,properties:t??{}})}catch(o){P("runtime.analytics.site1",o)}}var W="http://www.w3.org/1999/xhtml";function N(e){return e!=null&&e.nodeType===1}function _(e){return N(e)&&(e.namespaceURI===W||e.namespaceURI==="http://www.w3.org/2000/svg")}var w="data-hf-edit-base-x",y="data-hf-edit-base-y",m="data-hf-edit-original-translate",k=e=>{let t=parseFloat(e??"");return Number.isFinite(t)?t:0},O=e=>{let t=[],o=0,r="";for(let s of e.trim())s==="("&&(o+=1),s===")"&&(o=Math.max(0,o-1)),/\\s/.test(s)&&o===0?(r&&t.push(r),r=""):r+=s;return r&&t.push(r),t},L=/^-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)px$/,b=(e,t)=>L.test(e)&&L.test(t)?`${parseFloat(e)+parseFloat(t)}px`:`calc(${e} + ${t})`,V=(e,t,o)=>{if(!e||e==="none")return`${t} ${o}`;let[r,s,a]=O(e);if(r===void 0)return`${t} ${o}`;if(s===void 0)return`${b(r,t)} ${o}`;let i=a===void 0?"":` ${a}`;return`${b(r,t)} ${b(s,o)}${i}`},j=e=>{try{e.ownerDocument.defaultView?.gsap?.getProperty?.(e,"x")}catch{}},G=e=>{let t=e.style.getPropertyValue("translate").trim();if(t)return t==="none"?"":t;try{let o=e.ownerDocument.defaultView,r=o?o.getComputedStyle(e).getPropertyValue("translate").trim():"";return r==="none"?"":r}catch{return""}},E=new WeakMap;function B(e,t){let o=E.get(e);if(!t?.force&&o!==void 0&&e.style.getPropertyValue("translate")!==o){R("position_edit_fold_skipped",{hfId:e.getAttribute("data-hf-id")});return}let r=k(e.getAttribute("data-x"))-k(e.getAttribute(w)),s=k(e.getAttribute("data-y"))-k(e.getAttribute(y));e.hasAttribute(m)||e.setAttribute(m,G(e)),o===void 0&&j(e);let a=e.getAttribute(m)??"",i=V(a,`${r}px`,`${s}px`);e.style.setProperty("translate",i),E.set(e,e.style.getPropertyValue("translate"))}function S(e,t){let o=e.querySelectorAll(`[${m}]:not([${w}]):not([${y}])`);for(let a=0;a<o.length;a++){let i=o[a];if(i===void 0||!_(i))continue;let g=i.getAttribute(m)??"";g===""?i.style.removeProperty("translate"):i.style.setProperty("translate",g),i.removeAttribute(m),E.delete(i)}let r=e.querySelectorAll(`[${w}], [${y}]`),s=0;for(let a=0;a<r.length;a++){let i=r[a];i===void 0||!_(i)||(B(i,t),s+=1)}return s}var $="__hfPositionEditsSeekReapplyWrapped",D=new WeakSet,M=new WeakMap,F=new WeakMap;function H(e){let t=e,o=()=>{try{S(t.document)}catch{}},r=n=>typeof n=="function"&&(D.has(n)||!!n[$]),s=n=>{D.add(n);try{Object.defineProperty(n,$,{value:!0})}catch{}},a=n=>{if(typeof n!="function"||r(n))return n;let l=function(...u){let d=n.apply(this,u);return o(),d};return s(l),l},i=(n,l)=>{let u=M.get(n);if(u?.has(l))return!0;let d=Object.getOwnPropertyDescriptor(n,l);if(d?.configurable===!1){let c=n[l];return typeof c=="function"&&(n[l]=a(c),o()),!1}let p=n[l],f=d?.set;return Object.defineProperty(n,l,{configurable:!0,enumerable:d?.enumerable??!0,get:()=>p,set:c=>{p=a(c),f?.call(n,c)}}),p=a(p),u??(u=new Set),u.add(l),M.set(n,u),o(),!0},g=(n,l)=>{let u=F.get(t),d=Object.getOwnPropertyDescriptor(t,n);if(!u?.has(n)){if(d?.configurable===!1){let c=t[n];return c?i(c,l):!1}let f=t[n];Object.defineProperty(t,n,{configurable:!0,enumerable:d?.enumerable??!0,get:()=>f,set:c=>{f=c,f&&i(f,l)}}),u??(u=new Set),u.add(n),F.set(t,u)}let p=t[n];return p?i(p,l):!1},h=()=>{let n=g("__hf","seek"),l=g("__player","renderSeek");return n&&l};if(h())return;let v=120,A=t.setInterval(()=>{if(h()){t.clearInterval(A);return}v-=1,v<=0&&t.clearInterval(A)},50)}function I(){document.querySelector(`[${w}], [${y}]`)&&(S(document),H(window))}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",I,{once:!0}):I();})();\n';
94585
+ var POSITION_EDITS_RENDER_IIFE = '"use strict";(()=>{function T(){return globalThis}function P(e,t){if(typeof window>"u")return;let o=T(),r=o.__hf?.onSwallowed;if(r)try{r({label:e,error:t})}catch(s){}(o.__hfDebug||o.__HYPERFRAMES_DEBUG)&&console.debug(`[hyperframes] ${e} swallowed:`,t)}var x=null;function R(e,t){if(x)try{x({source:"hf-preview",type:"analytics",event:e,properties:t??{}})}catch(o){P("runtime.analytics.site1",o)}}var W="http://www.w3.org/1999/xhtml";function N(e){return e!=null&&e.nodeType===1}function _(e){return N(e)&&(e.namespaceURI===W||e.namespaceURI==="http://www.w3.org/2000/svg")}var w="data-hf-edit-base-x",y="data-hf-edit-base-y",m="data-hf-edit-original-translate",k=e=>{let t=parseFloat(e??"");return Number.isFinite(t)?t:0},O=e=>{let t=[],o=0,r="";for(let s of e.trim())s==="("&&(o+=1),s===")"&&(o=Math.max(0,o-1)),/\\s/.test(s)&&o===0?(r&&t.push(r),r=""):r+=s;return r&&t.push(r),t},L=/^-?(?:\\d+(?:\\.\\d+)?|\\.\\d+)px$/,b=(e,t)=>L.test(e)&&L.test(t)?`${parseFloat(e)+parseFloat(t)}px`:`calc(${e} + ${t})`,V=(e,t,o)=>{if(!e||e==="none")return`${t} ${o}`;let[r,s,a]=O(e);if(r===void 0)return`${t} ${o}`;if(s===void 0)return`${b(r,t)} ${o}`;let i=a===void 0?"":` ${a}`;return`${b(r,t)} ${b(s,o)}${i}`},j=e=>{try{e.ownerDocument.defaultView?.gsap?.getProperty?.(e,"x")}catch{}},G=e=>{let t=e.style.getPropertyValue("translate").trim();if(t)return t==="none"?"":t;try{let o=e.ownerDocument.defaultView,r=o?o.getComputedStyle(e).getPropertyValue("translate").trim():"";return r==="none"?"":r}catch{return""}},E=new WeakMap;function B(e,t){let o=E.get(e);if(!t?.force&&o!==void 0&&e.style.getPropertyValue("translate")!==o){R("position_edit_fold_skipped",{hfId:e.getAttribute("data-hf-id")});return}let r=k(e.getAttribute("data-x"))-k(e.getAttribute(w)),s=k(e.getAttribute("data-y"))-k(e.getAttribute(y));e.hasAttribute(m)||e.setAttribute(m,G(e)),o===void 0&&j(e);let a=e.getAttribute(m)??"",i=V(a,`${r}px`,`${s}px`);e.style.setProperty("translate",i),E.set(e,e.style.getPropertyValue("translate"))}function S(e,t){let o=e.querySelectorAll(`[${m}]:not([${w}]):not([${y}])`);for(let a=0;a<o.length;a++){let i=o[a];if(i===void 0||!_(i))continue;let g=i.getAttribute(m)??"";g===""?i.style.removeProperty("translate"):i.style.setProperty("translate",g),i.removeAttribute(m),E.delete(i)}let r=e.querySelectorAll(`[${w}], [${y}]`),s=0;for(let a=0;a<r.length;a++){let i=r[a];i===void 0||!_(i)||(B(i,t),s+=1)}return s}var $="__hfPositionEditsSeekReapplyWrapped",D=new WeakSet,M=new WeakMap,H=new WeakMap;function F(e){let t=e,o=()=>{try{S(t.document)}catch{}},r=n=>typeof n=="function"&&(D.has(n)||!!n[$]),s=n=>{D.add(n);try{Object.defineProperty(n,$,{value:!0})}catch{}},a=n=>{if(typeof n!="function"||r(n))return n;let l=function(...u){let d=n.apply(this,u);return o(),d};return s(l),l},i=(n,l)=>{let u=M.get(n);if(u?.has(l))return!0;let d=Object.getOwnPropertyDescriptor(n,l);if(d?.configurable===!1){let c=n[l];return typeof c=="function"&&(n[l]=a(c),o()),!1}let p=n[l],f=d?.set;return Object.defineProperty(n,l,{configurable:!0,enumerable:d?.enumerable??!0,get:()=>p,set:c=>{p=a(c),f?.call(n,c)}}),p=a(p),u??(u=new Set),u.add(l),M.set(n,u),o(),!0},g=(n,l)=>{let u=H.get(t),d=Object.getOwnPropertyDescriptor(t,n);if(!u?.has(n)){if(d?.configurable===!1){let c=t[n];return c?i(c,l):!1}let f=t[n];Object.defineProperty(t,n,{configurable:!0,enumerable:d?.enumerable??!0,get:()=>f,set:c=>{f=c,f&&i(f,l)}}),u??(u=new Set),u.add(n),H.set(t,u)}let p=t[n];return p?i(p,l):!1},v=()=>{let n=g("__hf","seek"),l=g("__player","renderSeek");return n&&l};if(v())return;let h=120,A=t.setInterval(()=>{if(v()){t.clearInterval(A);return}h-=1,h<=0&&t.clearInterval(A)},50)}function I(){document.querySelector(`[${w}], [${y}]`)&&(S(document),F(window))}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",I,{once:!0}):I();})();\n';
94000
94586
  function getPositionEditsRenderScript() {
94001
94587
  return POSITION_EDITS_RENDER_IIFE;
94002
94588
  }
@@ -99396,6 +99982,7 @@ function envInt(name, fallback) {
99396
99982
  return Number.isInteger(parsed) ? parsed : fallback;
99397
99983
  }
99398
99984
  var MAX_REPORTED_ELEMENT_TAGS = 50;
99985
+ var VFX_CAPTURE_RANK = { none: 0, self: 1, backdrop: 2 };
99399
99986
  var ROOT_COMPOSITION_TAG_RE = /<[a-zA-Z][-a-zA-Z0-9]*\b[^>]*\bdata-composition-id=["'][^"']*["'][^>]*>/i;
99400
99987
  function bucketPxDelta(delta) {
99401
99988
  if (delta === 0) return "0";
@@ -99450,6 +100037,25 @@ function scanElementTags(html) {
99450
100037
  colorGradingCount++;
99451
100038
  if (!hasLut) hasLut = colorGradingValueHasLut(m[1] ?? m[2] ?? "");
99452
100039
  }
100040
+ let vfxHostCount = 0;
100041
+ let vfxCapture;
100042
+ const vfxTypeSet = /* @__PURE__ */ new Set();
100043
+ for (const m of markup.matchAll(new RegExp(`\\b${HF_VFX_ATTR}=(?:"([^"]*)"|'([^']*)')`, "gi"))) {
100044
+ vfxHostCount++;
100045
+ try {
100046
+ const chain = parseVfxChain(decodeHtmlAttrJson(m[1] ?? m[2] ?? ""));
100047
+ for (const node of chain.nodes) {
100048
+ if (node.enabled === false) continue;
100049
+ vfxTypeSet.add(node.type);
100050
+ }
100051
+ const capture = chainCapture(chain);
100052
+ if (vfxCapture === void 0 || VFX_CAPTURE_RANK[capture] > VFX_CAPTURE_RANK[vfxCapture]) {
100053
+ vfxCapture = capture;
100054
+ }
100055
+ } catch {
100056
+ }
100057
+ }
100058
+ const vfxTypes = [...vfxTypeSet].sort().join(",");
99453
100059
  return {
99454
100060
  total,
99455
100061
  byTag,
@@ -99461,11 +100067,17 @@ function scanElementTags(html) {
99461
100067
  audioGroupCount,
99462
100068
  colorGradingCount,
99463
100069
  hasLut,
100070
+ vfxHostCount,
100071
+ vfxCapture,
100072
+ vfxTypes,
99464
100073
  ...detectRootBodySizeMismatch(html)
99465
100074
  };
99466
100075
  }
100076
+ function decodeHtmlAttrJson(rawAttributeValue) {
100077
+ return rawAttributeValue.replace(/&quot;/g, '"').replace(/&#39;/g, "'").replace(/&amp;/g, "&");
100078
+ }
99467
100079
  function colorGradingValueHasLut(rawAttributeValue) {
99468
- const decoded = rawAttributeValue.replace(/&quot;/g, '"').replace(/&#39;/g, "'").replace(/&amp;/g, "&");
100080
+ const decoded = decodeHtmlAttrJson(rawAttributeValue);
99469
100081
  try {
99470
100082
  const parsed = JSON.parse(decoded);
99471
100083
  if (typeof parsed !== "object" || parsed === null || !("lut" in parsed)) return false;
@@ -99506,7 +100118,10 @@ async function resolveCompositionElementCount(probeSession, html) {
99506
100118
  colorGradingCount: scan.colorGradingCount,
99507
100119
  hasLut: scan.hasLut,
99508
100120
  rootBodyMismatch: scan.rootBodyMismatch,
99509
- rootBodyDeltaPxBucket: scan.rootBodyDeltaPxBucket
100121
+ rootBodyDeltaPxBucket: scan.rootBodyDeltaPxBucket,
100122
+ vfxHostCount: scan.vfxHostCount,
100123
+ vfxCapture: scan.vfxCapture,
100124
+ vfxTypes: scan.vfxTypes
99510
100125
  };
99511
100126
  }
99512
100127
  var KNOWN_RUNTIME_ADAPTERS = [
@@ -100318,7 +100933,10 @@ async function executeRenderPipeline(input) {
100318
100933
  colorGradingCount,
100319
100934
  hasLut,
100320
100935
  rootBodyMismatch,
100321
- rootBodyDeltaPxBucket
100936
+ rootBodyDeltaPxBucket,
100937
+ vfxHostCount,
100938
+ vfxCapture,
100939
+ vfxTypes
100322
100940
  } = await resolveCompositionElementCount(probeSession, compiled.html);
100323
100941
  const adaptersUsed = await resolveAdaptersUsed(probeSession, compiled.html);
100324
100942
  const deShortBandEnabled = deShortBandMaxElements > 0;
@@ -101394,6 +102012,9 @@ async function executeRenderPipeline(input) {
101394
102012
  hasLut,
101395
102013
  rootBodyMismatch,
101396
102014
  rootBodyDeltaPxBucket,
102015
+ vfxHostCount,
102016
+ vfxCapture,
102017
+ vfxTypes,
101397
102018
  shortBand: deShortBand,
101398
102019
  parallelRouter: deParallelRouter,
101399
102020
  preRouterWorkers: deParallelRouter ? preRoutingWorkerCount : void 0,
@@ -101602,14 +102223,14 @@ function describeValue(value) {
101602
102223
 
101603
102224
  // ../producer/src/renderRequest.ts
101604
102225
  var RENDER_REQUEST_VERSION = 1;
101605
- function isPlainObject2(value) {
102226
+ function isPlainObject3(value) {
101606
102227
  if (typeof value !== "object" || value === null || Array.isArray(value)) return false;
101607
102228
  const proto = Object.getPrototypeOf(value);
101608
102229
  return proto === Object.prototype || proto === null;
101609
102230
  }
101610
102231
  function assertPositiveFps(options) {
101611
102232
  const fps = options.fps;
101612
- if (!isPlainObject2(fps) || typeof fps.num !== "number" || typeof fps.den !== "number" || !Number.isInteger(fps.num) || !Number.isInteger(fps.den) || fps.num <= 0 || fps.den <= 0) {
102233
+ if (!isPlainObject3(fps) || typeof fps.num !== "number" || typeof fps.den !== "number" || !Number.isInteger(fps.num) || !Number.isInteger(fps.den) || fps.num <= 0 || fps.den <= 0) {
101613
102234
  throw new Error("Render request fps must be a positive rational");
101614
102235
  }
101615
102236
  }
@@ -101639,7 +102260,7 @@ function isCanvasResolution(value) {
101639
102260
  return typeof value === "string" && VALID_CANVAS_RESOLUTIONS.some((resolution) => resolution === value);
101640
102261
  }
101641
102262
  function assertDistributedOptions(value) {
101642
- if (!isPlainObject2(value)) throw new Error("Render request distributed must be an object");
102263
+ if (!isPlainObject3(value)) throw new Error("Render request distributed must be an object");
101643
102264
  for (const field of ["width", "height"]) {
101644
102265
  if (typeof value[field] !== "number" || !Number.isInteger(value[field]) || value[field] <= 0) {
101645
102266
  throw new Error(`Render request distributed.${field} must be a positive integer`);
@@ -101687,13 +102308,13 @@ function assertRequestOptionScalars(options) {
101687
102308
  }
101688
102309
  function assertRequestOptionObjects(options) {
101689
102310
  validateEngineConfigSnapshot(options.engineConfig);
101690
- if (options.variables !== void 0 && !isPlainObject2(options.variables)) {
102311
+ if (options.variables !== void 0 && !isPlainObject3(options.variables)) {
101691
102312
  throw new Error("Render request variables must be a JSON object");
101692
102313
  }
101693
102314
  if (options.distributed !== void 0) assertDistributedOptions(options.distributed);
101694
102315
  }
101695
102316
  function assertRequestOptions(options) {
101696
- if (!isPlainObject2(options)) throw new Error("Render request options must be an object");
102317
+ if (!isPlainObject3(options)) throw new Error("Render request options must be an object");
101697
102318
  assertPositiveFps(options);
101698
102319
  if (!["draft", "standard", "high"].includes(String(options.quality))) {
101699
102320
  throw new Error("Render request quality is invalid");
@@ -101713,8 +102334,8 @@ function omitUndefinedProperties(value) {
101713
102334
  return Object.fromEntries(Object.entries(value).filter(([, item]) => item !== void 0));
101714
102335
  }
101715
102336
  function assertRenderRequest(value) {
101716
- if (!isPlainObject2(value) || value.version !== RENDER_REQUEST_VERSION) {
101717
- const version2 = isPlainObject2(value) ? value.version : void 0;
102337
+ if (!isPlainObject3(value) || value.version !== RENDER_REQUEST_VERSION) {
102338
+ const version2 = isPlainObject3(value) ? value.version : void 0;
101718
102339
  throw new Error(`Unsupported render request version: ${String(version2)}`);
101719
102340
  }
101720
102341
  assertNonEmptyPath(value.projectDir, "projectDir");
@@ -102010,7 +102631,7 @@ function extractSafeRenderErrorMetadata(error) {
102010
102631
  errorCode,
102011
102632
  errorOwner: owner === "user" || owner === "system" ? owner : void 0,
102012
102633
  retryable: typeof retryable === "boolean" ? retryable : void 0,
102013
- ...isPlainObject3(publicMetadata) ? { errorMetadata: publicMetadata } : {}
102634
+ ...isPlainObject4(publicMetadata) ? { errorMetadata: publicMetadata } : {}
102014
102635
  };
102015
102636
  }
102016
102637
  function parseServerFps(value) {
@@ -102078,11 +102699,11 @@ function parseRenderOptions(body) {
102078
102699
  videoFrameFormat
102079
102700
  };
102080
102701
  }
102081
- function isPlainObject3(value) {
102702
+ function isPlainObject4(value) {
102082
102703
  return typeof value === "object" && value !== null && !Array.isArray(value);
102083
102704
  }
102084
102705
  function parseRenderOverrides(body) {
102085
- const variables = isPlainObject3(body.variables) ? body.variables : void 0;
102706
+ const variables = isPlainObject4(body.variables) ? body.variables : void 0;
102086
102707
  const rawOutputResolution = typeof body.outputResolution === "string" ? body.outputResolution : void 0;
102087
102708
  const outputResolution = rawOutputResolution ? normalizeResolutionFlag(rawOutputResolution) : void 0;
102088
102709
  const outputResolutionAspectAgnostic = outputResolution ? isAspectAgnosticResolutionAlias(rawOutputResolution) : void 0;
@@ -102118,7 +102739,7 @@ function resolvePreparedRenderOutput(prepared, rendersDir, log) {
102118
102739
  return { input, cleanupProjectDir, absoluteOutputPath };
102119
102740
  }
102120
102741
  function validateRenderOverrides(body) {
102121
- if (body.variables !== void 0 && !isPlainObject3(body.variables)) {
102742
+ if (body.variables !== void 0 && !isPlainObject4(body.variables)) {
102122
102743
  return 'variables must be a JSON object keyed by variable id (e.g. {"title":"Hello"})';
102123
102744
  }
102124
102745
  if (body.outputDynamicRange !== void 0 && parseServerOutputDynamicRange(body.outputDynamicRange) === void 0) {
@@ -102817,8 +103438,8 @@ async function runFontLocalize(io, localize) {
102817
103438
  }
102818
103439
 
102819
103440
  // src/version.ts
102820
- var VERSION = true ? "0.8.63" : "0.0.0-dev";
102821
- var PRODUCER_VERSION = true ? "0.8.63" : "0.0.0-dev";
103441
+ var VERSION = true ? "0.8.64" : "0.0.0-dev";
103442
+ var PRODUCER_VERSION = true ? "0.8.64" : "0.0.0-dev";
102822
103443
 
102823
103444
  // src/fontLocalizeCli.ts
102824
103445
  async function readStdin() {