hyperframes 0.8.30 → 0.8.31

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.
package/dist/cli.js CHANGED
@@ -50,7 +50,7 @@ var VERSION;
50
50
  var init_version = __esm({
51
51
  "src/version.ts"() {
52
52
  "use strict";
53
- VERSION = true ? "0.8.30" : "0.0.0-dev";
53
+ VERSION = true ? "0.8.31" : "0.0.0-dev";
54
54
  }
55
55
  });
56
56
 
@@ -4858,7 +4858,7 @@ var require_util = __commonJS({
4858
4858
  }
4859
4859
  path2 = url.path;
4860
4860
  }
4861
- var isAbsolute19 = exports.isAbsolute(path2);
4861
+ var isAbsolute20 = exports.isAbsolute(path2);
4862
4862
  var parts = path2.split(/\/+/);
4863
4863
  for (var part, up = 0, i2 = parts.length - 1; i2 >= 0; i2--) {
4864
4864
  part = parts[i2];
@@ -4878,7 +4878,7 @@ var require_util = __commonJS({
4878
4878
  }
4879
4879
  path2 = parts.join("/");
4880
4880
  if (path2 === "") {
4881
- path2 = isAbsolute19 ? "/" : ".";
4881
+ path2 = isAbsolute20 ? "/" : ".";
4882
4882
  }
4883
4883
  if (url) {
4884
4884
  url.path = path2;
@@ -4923,7 +4923,7 @@ var require_util = __commonJS({
4923
4923
  exports.isAbsolute = function(aPath) {
4924
4924
  return aPath.charAt(0) === "/" || urlRegexp.test(aPath);
4925
4925
  };
4926
- function relative34(aRoot, aPath) {
4926
+ function relative35(aRoot, aPath) {
4927
4927
  if (aRoot === "") {
4928
4928
  aRoot = ".";
4929
4929
  }
@@ -4942,7 +4942,7 @@ var require_util = __commonJS({
4942
4942
  }
4943
4943
  return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
4944
4944
  }
4945
- exports.relative = relative34;
4945
+ exports.relative = relative35;
4946
4946
  var supportsNullProto = (function() {
4947
4947
  var obj = /* @__PURE__ */ Object.create(null);
4948
4948
  return !("__proto__" in obj);
@@ -15818,9 +15818,9 @@ var require_printer = __commonJS({
15818
15818
  }
15819
15819
  case "ForStatement": {
15820
15820
  var init = path2.call(print2, "init");
15821
- var sep14 = init.length > 1 ? ";\n" : "; ";
15821
+ var sep15 = init.length > 1 ? ";\n" : "; ";
15822
15822
  var forParen = "for (";
15823
- var indented = (0, lines_1.fromString)(sep14).join([init, path2.call(print2, "test"), path2.call(print2, "update")]).indentTail(forParen.length);
15823
+ var indented = (0, lines_1.fromString)(sep15).join([init, path2.call(print2, "test"), path2.call(print2, "update")]).indentTail(forParen.length);
15824
15824
  var head = (0, lines_1.concat)([forParen, indented, ")"]);
15825
15825
  var clause = adjustClause(path2.call(print2, "body"), options);
15826
15826
  parts.push(head);
@@ -41390,10 +41390,10 @@ function compareDocumentPosition(nodeA, nodeB) {
41390
41390
  function uniqueSort(nodes) {
41391
41391
  nodes = nodes.filter((node, i2, arr) => !arr.includes(node, i2 + 1));
41392
41392
  nodes.sort((a, b2) => {
41393
- const relative34 = compareDocumentPosition(a, b2);
41394
- if (relative34 & DocumentPosition.PRECEDING) {
41393
+ const relative35 = compareDocumentPosition(a, b2);
41394
+ if (relative35 & DocumentPosition.PRECEDING) {
41395
41395
  return -1;
41396
- } else if (relative34 & DocumentPosition.FOLLOWING) {
41396
+ } else if (relative35 & DocumentPosition.FOLLOWING) {
41397
41397
  return 1;
41398
41398
  }
41399
41399
  return 0;
@@ -47608,12 +47608,12 @@ var require_CSSValueExpression = __commonJS({
47608
47608
  return false;
47609
47609
  }
47610
47610
  };
47611
- CSSOM.CSSValueExpression.prototype._parseJSString = function(token, idx, sep14) {
47612
- var endIdx = this._findMatchedIdx(token, idx, sep14), text2;
47611
+ CSSOM.CSSValueExpression.prototype._parseJSString = function(token, idx, sep15) {
47612
+ var endIdx = this._findMatchedIdx(token, idx, sep15), text2;
47613
47613
  if (endIdx === -1) {
47614
47614
  return false;
47615
47615
  } else {
47616
- text2 = token.substring(idx, endIdx + sep14.length);
47616
+ text2 = token.substring(idx, endIdx + sep15.length);
47617
47617
  return {
47618
47618
  idx: endIdx,
47619
47619
  text: text2
@@ -47653,15 +47653,15 @@ var require_CSSValueExpression = __commonJS({
47653
47653
  if (!isLegal) {
47654
47654
  return false;
47655
47655
  } else {
47656
- var sep14 = "/";
47657
- return this._parseJSString(token, idx, sep14);
47656
+ var sep15 = "/";
47657
+ return this._parseJSString(token, idx, sep15);
47658
47658
  }
47659
47659
  };
47660
- CSSOM.CSSValueExpression.prototype._findMatchedIdx = function(token, idx, sep14) {
47660
+ CSSOM.CSSValueExpression.prototype._findMatchedIdx = function(token, idx, sep15) {
47661
47661
  var startIdx = idx, endIdx;
47662
47662
  var NOT_FOUND = -1;
47663
47663
  while (true) {
47664
- endIdx = token.indexOf(sep14, startIdx + 1);
47664
+ endIdx = token.indexOf(sep15, startIdx + 1);
47665
47665
  if (endIdx === -1) {
47666
47666
  endIdx = NOT_FOUND;
47667
47667
  break;
@@ -50603,8 +50603,8 @@ var init_esm10 = __esm({
50603
50603
  });
50604
50604
 
50605
50605
  // ../../node_modules/.bun/@jridgewell+sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
50606
- function encodeInteger(builder, num3, relative34) {
50607
- let delta = num3 - relative34;
50606
+ function encodeInteger(builder, num3, relative35) {
50607
+ let delta = num3 - relative35;
50608
50608
  delta = delta < 0 ? -delta << 1 | 1 : delta << 1;
50609
50609
  do {
50610
50610
  let clamped = delta & 31;
@@ -80383,57 +80383,264 @@ function stripStringLiterals(source) {
80383
80383
  (literal2) => literal2[0] + " ".repeat(Math.max(0, literal2.length - 1))
80384
80384
  );
80385
80385
  }
80386
- function stripJsComments(source) {
80386
+ function scanJsComments(source) {
80387
80387
  let out = "";
80388
80388
  let i2 = 0;
80389
80389
  let quote = null;
80390
80390
  let escaped = false;
80391
+ let inRegex = false;
80392
+ let inRegexClass = false;
80393
+ let regexMisread = false;
80394
+ const ctx = new CodeContext();
80395
+ const emitCode = (ch) => {
80396
+ out += ch;
80397
+ ctx.push(ch);
80398
+ };
80399
+ const emitOpaque = (ch) => {
80400
+ out += ch;
80401
+ ctx.push(" ");
80402
+ };
80391
80403
  while (i2 < source.length) {
80392
80404
  const ch = source[i2] ?? "";
80393
80405
  const next = source[i2 + 1] ?? "";
80394
- if (quote) {
80406
+ if (inRegex) {
80395
80407
  out += ch;
80396
80408
  if (escaped) {
80397
80409
  escaped = false;
80410
+ if (ch === "\n" || ch === "\r") {
80411
+ inRegex = false;
80412
+ inRegexClass = false;
80413
+ regexMisread = true;
80414
+ }
80398
80415
  } else if (ch === "\\") {
80399
80416
  escaped = true;
80417
+ } else if (ch === "[") {
80418
+ inRegexClass = true;
80419
+ } else if (ch === "]") {
80420
+ inRegexClass = false;
80421
+ } else if (ch === "/" && !inRegexClass) {
80422
+ inRegex = false;
80423
+ ctx.push(ch);
80424
+ } else if (ch === "\n" || ch === "\r") {
80425
+ inRegex = false;
80426
+ inRegexClass = false;
80427
+ regexMisread = true;
80428
+ }
80429
+ i2 += 1;
80430
+ continue;
80431
+ }
80432
+ if (quote) {
80433
+ if (escaped) {
80434
+ escaped = false;
80435
+ emitOpaque(ch);
80436
+ } else if (ch === "\\") {
80437
+ escaped = true;
80438
+ emitOpaque(ch);
80400
80439
  } else if (ch === quote) {
80401
80440
  quote = null;
80441
+ emitCode(ch);
80442
+ } else {
80443
+ emitOpaque(ch);
80402
80444
  }
80403
80445
  i2 += 1;
80404
80446
  continue;
80405
80447
  }
80406
80448
  if (ch === "'" || ch === '"' || ch === "`") {
80407
80449
  quote = ch;
80408
- out += ch;
80450
+ emitCode(ch);
80409
80451
  i2 += 1;
80410
80452
  continue;
80411
80453
  }
80412
80454
  if (ch === "/" && next === "/") {
80413
80455
  out += " ";
80456
+ ctx.push(" ");
80457
+ ctx.push(" ");
80414
80458
  i2 += 2;
80415
80459
  while (i2 < source.length && source[i2] !== "\n" && source[i2] !== "\r") {
80416
80460
  out += " ";
80461
+ ctx.push(" ");
80417
80462
  i2 += 1;
80418
80463
  }
80419
80464
  continue;
80420
80465
  }
80421
80466
  if (ch === "/" && next === "*") {
80422
80467
  out += " ";
80468
+ ctx.push(" ");
80469
+ ctx.push(" ");
80423
80470
  i2 += 2;
80424
80471
  while (i2 < source.length) {
80425
80472
  const blockCh = source[i2] ?? "";
80426
80473
  const blockNext = source[i2 + 1] ?? "";
80427
80474
  if (blockCh === "*" && blockNext === "/") {
80428
80475
  out += " ";
80476
+ ctx.push(" ");
80477
+ ctx.push(" ");
80429
80478
  i2 += 2;
80430
80479
  break;
80431
80480
  }
80432
- out += blockCh === "\n" || blockCh === "\r" ? blockCh : " ";
80481
+ const kept = blockCh === "\n" || blockCh === "\r" ? blockCh : " ";
80482
+ out += kept;
80483
+ ctx.push(kept);
80433
80484
  i2 += 1;
80434
80485
  }
80435
80486
  continue;
80436
80487
  }
80488
+ if (ch === "/" && ctx.startsRegexLiteral()) {
80489
+ inRegex = true;
80490
+ emitCode(ch);
80491
+ i2 += 1;
80492
+ continue;
80493
+ }
80494
+ emitCode(ch);
80495
+ i2 += 1;
80496
+ }
80497
+ return { out, balanced: quote === null && !inRegex && !regexMisread };
80498
+ }
80499
+ function stripJsComments(source) {
80500
+ return scanJsComments(source).out;
80501
+ }
80502
+ function stripJsCode(source) {
80503
+ const { out, balanced } = scanJsComments(source);
80504
+ return balanced ? stripJsStringLiterals(out) : source;
80505
+ }
80506
+ function stripJsStringLiterals(source) {
80507
+ let out = "";
80508
+ let i2 = 0;
80509
+ const templateBraces = [];
80510
+ const ctx = new CodeContext();
80511
+ let quote = null;
80512
+ let escaped = false;
80513
+ let inRegex = false;
80514
+ let inRegexClass = false;
80515
+ let regexMisread = false;
80516
+ const blank = (ch) => ch === "\n" || ch === "\r" ? ch : " ";
80517
+ const emit2 = (text2) => {
80518
+ out += text2;
80519
+ for (const ch of text2) ctx.push(ch);
80520
+ };
80521
+ while (i2 < source.length) {
80522
+ const ch = source[i2] ?? "";
80523
+ const next = source[i2 + 1] ?? "";
80524
+ if (inRegex) {
80525
+ if (escaped) {
80526
+ escaped = false;
80527
+ if (ch === "\n" || ch === "\r") {
80528
+ inRegex = false;
80529
+ inRegexClass = false;
80530
+ regexMisread = true;
80531
+ }
80532
+ emit2(blank(ch));
80533
+ } else if (ch === "\\") {
80534
+ escaped = true;
80535
+ emit2(" ");
80536
+ } else if (ch === "[") {
80537
+ inRegexClass = true;
80538
+ emit2(" ");
80539
+ } else if (ch === "]") {
80540
+ inRegexClass = false;
80541
+ emit2(" ");
80542
+ } else if (ch === "/" && !inRegexClass) {
80543
+ inRegex = false;
80544
+ emit2(ch);
80545
+ } else if (ch === "\n" || ch === "\r") {
80546
+ inRegex = false;
80547
+ inRegexClass = false;
80548
+ escaped = false;
80549
+ regexMisread = true;
80550
+ emit2(ch);
80551
+ } else {
80552
+ emit2(" ");
80553
+ }
80554
+ i2 += 1;
80555
+ continue;
80556
+ }
80557
+ if (quote) {
80558
+ if (escaped) {
80559
+ escaped = false;
80560
+ emit2(blank(ch));
80561
+ } else if (ch === "\\") {
80562
+ escaped = true;
80563
+ emit2(" ");
80564
+ } else if (ch === quote) {
80565
+ quote = null;
80566
+ emit2(ch);
80567
+ } else if (ch === "`" || quote !== "`" || ch !== "$" || next !== "{") {
80568
+ emit2(blank(ch));
80569
+ } else {
80570
+ templateBraces.push(0);
80571
+ quote = null;
80572
+ emit2("${");
80573
+ i2 += 2;
80574
+ continue;
80575
+ }
80576
+ i2 += 1;
80577
+ continue;
80578
+ }
80579
+ if (ch === "'" || ch === '"' || ch === "`") {
80580
+ quote = ch;
80581
+ emit2(ch);
80582
+ i2 += 1;
80583
+ continue;
80584
+ }
80585
+ if (ch === "/" && next !== "/" && next !== "*" && ctx.startsRegexLiteral()) {
80586
+ inRegex = true;
80587
+ emit2(ch);
80588
+ i2 += 1;
80589
+ continue;
80590
+ }
80591
+ if (templateBraces.length > 0) {
80592
+ const depth = templateBraces[templateBraces.length - 1] ?? 0;
80593
+ if (ch === "{") templateBraces[templateBraces.length - 1] = depth + 1;
80594
+ else if (ch === "}") {
80595
+ if (depth === 0) {
80596
+ templateBraces.pop();
80597
+ quote = "`";
80598
+ emit2(ch);
80599
+ i2 += 1;
80600
+ continue;
80601
+ }
80602
+ templateBraces[templateBraces.length - 1] = depth - 1;
80603
+ }
80604
+ }
80605
+ emit2(ch);
80606
+ i2 += 1;
80607
+ }
80608
+ if (quote !== null || templateBraces.length > 0 || inRegex || regexMisread) return source;
80609
+ return out;
80610
+ }
80611
+ function stripCssComments(source) {
80612
+ let out = "";
80613
+ let i2 = 0;
80614
+ let quote = null;
80615
+ while (i2 < source.length) {
80616
+ const ch = source[i2] ?? "";
80617
+ if (quote) {
80618
+ out += ch;
80619
+ if (ch === "\\") {
80620
+ out += source[i2 + 1] ?? "";
80621
+ i2 += 2;
80622
+ continue;
80623
+ }
80624
+ if (ch === quote) quote = null;
80625
+ i2 += 1;
80626
+ continue;
80627
+ }
80628
+ if (ch === '"' || ch === "'") {
80629
+ quote = ch;
80630
+ out += ch;
80631
+ i2 += 1;
80632
+ continue;
80633
+ }
80634
+ if (ch === "/" && source[i2 + 1] === "*") {
80635
+ const end = source.indexOf("*/", i2 + 2);
80636
+ const stop = end === -1 ? source.length : end + 2;
80637
+ for (let j3 = i2; j3 < stop; j3 += 1) {
80638
+ const c3 = source[j3] ?? "";
80639
+ out += c3 === "\n" || c3 === "\r" ? c3 : " ";
80640
+ }
80641
+ i2 = stop;
80642
+ continue;
80643
+ }
80437
80644
  out += ch;
80438
80645
  i2 += 1;
80439
80646
  }
@@ -80688,6 +80895,7 @@ function srcKind(src) {
80688
80895
  if (!mime) return null;
80689
80896
  if (mime.startsWith("image/")) return "image";
80690
80897
  if (mime.startsWith("video/")) return "video";
80898
+ if (mime.startsWith("audio/")) return "audio";
80691
80899
  return null;
80692
80900
  }
80693
80901
  if (lower3.startsWith("blob:")) return null;
@@ -80707,6 +80915,7 @@ function srcKind(src) {
80707
80915
  const ext = base2.slice(dot + 1).toLowerCase();
80708
80916
  if (IMAGE_SRC_EXT.has(ext)) return "image";
80709
80917
  if (VIDEO_SRC_EXT.has(ext)) return "video";
80918
+ if (AUDIO_SRC_EXT.has(ext)) return "audio";
80710
80919
  return null;
80711
80920
  }
80712
80921
  function findMediaSrcKindMismatchFindings(ctx) {
@@ -80717,16 +80926,15 @@ function findMediaSrcKindMismatchFindings(ctx) {
80717
80926
  if (!src) continue;
80718
80927
  const kind = srcKind(src);
80719
80928
  if (kind === null) continue;
80720
- if (tag.name === "video" && kind !== "image") continue;
80721
- if (tag.name === "img" && kind !== "video") continue;
80722
- const elementId = readAttr(tag.raw, "id") || void 0;
80723
80929
  const expected = tag.name === "video" ? "video" : "image";
80930
+ if (kind === expected) continue;
80931
+ const elementId = readAttr(tag.raw, "id") || void 0;
80724
80932
  findings.push({
80725
80933
  code: "media_src_kind_mismatch",
80726
80934
  severity: "error",
80727
- message: `<${tag.name}${elementId ? ` id="${elementId}"` : ""}> src is a ${kind}, not a ${expected}. The producer fail-closes when the tag and file kind disagree.`,
80935
+ message: `<${tag.name}${elementId ? ` id="${elementId}"` : ""}> src is ${SRC_KIND_NOUN[kind]}, not ${SRC_KIND_NOUN[expected]}. The producer fail-closes when the tag and file kind disagree.`,
80728
80936
  elementId,
80729
- fixHint: tag.name === "video" ? "Use <img> for a still, or point <video> at a video URL (mp4/webm/mov/\u2026)." : "Use <video> for a video URL, or point <img> at a still (png/jpg/webp/\u2026).",
80937
+ fixHint: tag.name === "video" ? "Use <img> for a still, <audio> for sound, or point <video> at a video URL (mp4/webm/mov/\u2026)." : "Use <video> for a video URL, <audio> for sound, or point <img> at a still (png/jpg/webp/\u2026).",
80730
80938
  snippet: truncateSnippet(tag.raw)
80731
80939
  });
80732
80940
  }
@@ -81122,6 +81330,14 @@ function isHiddenGsapState(values) {
81122
81330
  const display = stringValue(values.display)?.toLowerCase();
81123
81331
  return zeroValue(values.opacity) || zeroValue(values.autoAlpha) || visibility === "hidden" || display === "none";
81124
81332
  }
81333
+ function hiddenSetTargetSelectors(target, aliases2) {
81334
+ const parts = target.startsWith("[") && target.endsWith("]") ? target.slice(1, -1).split(",") : [target];
81335
+ return parts.flatMap((part) => {
81336
+ const trimmed = part.trim();
81337
+ const resolved2 = /^(["'`])([^"'`]+)\1$/.exec(trimmed)?.[2] ?? aliases2.get(trimmed);
81338
+ return resolved2 === void 0 ? [] : resolved2.split(",");
81339
+ }).map((selector) => selector.trim()).filter((selector) => selector.length > 0);
81340
+ }
81125
81341
  function extractStandaloneHiddenSelectors(script) {
81126
81342
  const selectors = /* @__PURE__ */ new Set();
81127
81343
  const source = stripJsComments(script);
@@ -81132,16 +81348,15 @@ function extractStandaloneHiddenSelectors(script) {
81132
81348
  )) {
81133
81349
  aliases2.set(match2[1] ?? "", match2[3] ?? "");
81134
81350
  }
81135
- const pattern = /gsap\.set\s*\(\s*([^,]+?)\s*,\s*\{([\s\S]*?)\}\s*\)/g;
81351
+ const pattern = /gsap\.set\s*\(\s*(\[[^[\]]*\]|"[^"]*"|'[^']*'|`[^`]*`|[^,()[\]]+?)\s*,\s*\{([\s\S]*?)\}\s*\)/g;
81136
81352
  let match;
81137
81353
  while ((match = pattern.exec(source)) !== null) {
81138
81354
  if (indexInsideNonIifeRange(match.index, source, functionRanges)) continue;
81139
- const target = (match[1] ?? "").trim();
81140
- const selector = /^(["'`])([^"'`]+)\1$/.exec(target)?.[2] ?? aliases2.get(target);
81141
- if (!selector) continue;
81355
+ const targets = hiddenSetTargetSelectors((match[1] ?? "").trim(), aliases2);
81356
+ if (targets.length === 0) continue;
81142
81357
  const body = match[2] ?? "";
81143
81358
  if (/(?:opacity|autoAlpha)\s*:\s*0(?:\.0+)?\s*(?:,|$)/.test(body)) {
81144
- selectors.add(selector);
81359
+ for (const selector of targets) selectors.add(selector);
81145
81360
  }
81146
81361
  }
81147
81362
  return selectors;
@@ -81929,7 +82144,7 @@ function collectTextureCss(styles) {
81929
82144
  }
81930
82145
  return { definedTextureClasses, dropShadowRules };
81931
82146
  }
81932
- function stripCssComments(css) {
82147
+ function stripCssComments2(css) {
81933
82148
  return css.replace(/\/\*[\s\S]*?\*\//g, " ");
81934
82149
  }
81935
82150
  function extractFontFaceFamilies(styles) {
@@ -81937,7 +82152,7 @@ function extractFontFaceFamilies(styles) {
81937
82152
  const fontFaceRe = /@font-face\s*\{[^}]*\}/gi;
81938
82153
  const familyRe = /font-family\s*:\s*(['"]?)([^;'"]+)\1/i;
81939
82154
  for (const style of styles) {
81940
- const content = stripCssComments(style.content);
82155
+ const content = stripCssComments2(style.content);
81941
82156
  let match;
81942
82157
  while ((match = fontFaceRe.exec(content)) !== null) {
81943
82158
  const familyMatch = match[0].match(familyRe);
@@ -81958,7 +82173,7 @@ function extractUsedFontFamilies(styles) {
81958
82173
  const seen = /* @__PURE__ */ new Set();
81959
82174
  const propRe = /font-family\s*:\s*([^;}{]+)/gi;
81960
82175
  for (const style of styles) {
81961
- const withoutFontFace = stripCssComments(style.content).replace(/@font-face\s*\{[^}]*\}/gi, "");
82176
+ const withoutFontFace = stripCssComments2(style.content).replace(/@font-face\s*\{[^}]*\}/gi, "");
81962
82177
  let match;
81963
82178
  while ((match = propRe.exec(withoutFontFace)) !== null) {
81964
82179
  for (const part of match[1].split(",")) {
@@ -82698,7 +82913,7 @@ function isSnippetFragment(html) {
82698
82913
  if (!firstTag) return false;
82699
82914
  return /\bdata-hf-snippet\b/.test(firstTag[0]);
82700
82915
  }
82701
- var import_postcss_selector_parser, COMPOSITION_ID_IN_CSS_PATTERN, TIMELINE_REGISTRY_INIT_PATTERN, TIMELINE_REGISTRY_OBJECT_LITERAL_PATTERN, TIMELINE_REGISTRY_ASSIGN_PATTERN, WINDOW_TIMELINE_ASSIGN_PATTERN, INVALID_SCRIPT_CLOSE_PATTERN, TIMELINE_REGISTRY_KEY_PATTERN, TIMELINE_REGISTRY_OBJECT_OPEN_PATTERN, TIMELINE_REGISTRY_OBJECT_ENTRY_PATTERN, VISIBLE_MARKUP_COMMENT_PATTERN, VISIBLE_MARKUP_COMMENT_PROTECTED_BLOCK_PATTERN, coreRules, IMAGE_SRC_EXT, VIDEO_SRC_EXT, mediaRules, AUDIO_GROUP_TIMING_ATTRS, SCENE_BOUNDARY_EPSILON_SECONDS, UNRESOLVED_TARGET, gsapWindowsCache, CONFLICTING_TRANSLATE_PROPS, CONFLICTING_SCALE_PROPS, RELATIVE_TWEEN_VALUE, TRANSFORM_SENSITIVE_READ, TRANSFORM_INVARIANT_READ, CALLBACK_MEASUREMENT_PATTERN, NUMBER_METHODS, gsapRules, captionRules, MAX_COMPOSITION_LINES, MAX_TIMED_ELEMENTS_PER_TRACK, TRACK_DENSITY_EXEMPT_TAGS, CAPTION_CUE_TOKEN, HEAVY_OVERLAY_ELEMENT_COUNT_WARN, HEAVY_OVERLAY_EXEMPT_TAGS, HEAVY_OVERLAY_CSS_PATTERN, INLINE_STYLE_DISPLAY_NONE_PATTERN, compositionRules, adapterRules, TEXTURE_BASE_CLASS, TEXTURE_CLASS_PREFIX, textureRules, GENERIC_FAMILIES, fontRules, slideshowRules, RULE_GROUPS, LINT_RULE_COUNT, LINT_RULE_GROUP_COUNTS, PROBE_TIMEOUT_MS, PROBE_CONCURRENCY, AUDIO_EXTENSIONS, MASK_IMAGE_URL_RE;
82916
+ var import_postcss_selector_parser, COMPOSITION_ID_IN_CSS_PATTERN, TIMELINE_REGISTRY_INIT_PATTERN, TIMELINE_REGISTRY_OBJECT_LITERAL_PATTERN, TIMELINE_REGISTRY_ASSIGN_PATTERN, WINDOW_TIMELINE_ASSIGN_PATTERN, INVALID_SCRIPT_CLOSE_PATTERN, TIMELINE_REGISTRY_KEY_PATTERN, TIMELINE_REGISTRY_OBJECT_OPEN_PATTERN, TIMELINE_REGISTRY_OBJECT_ENTRY_PATTERN, REGEX_ALLOWED_BEFORE, REGEX_ALLOWED_KEYWORDS, WORD_CHAR, CodeContext, VISIBLE_MARKUP_COMMENT_PATTERN, VISIBLE_MARKUP_COMMENT_PROTECTED_BLOCK_PATTERN, coreRules, IMAGE_SRC_EXT, VIDEO_SRC_EXT, AUDIO_SRC_EXT, SRC_KIND_NOUN, mediaRules, AUDIO_GROUP_TIMING_ATTRS, SCENE_BOUNDARY_EPSILON_SECONDS, UNRESOLVED_TARGET, gsapWindowsCache, CONFLICTING_TRANSLATE_PROPS, CONFLICTING_SCALE_PROPS, RELATIVE_TWEEN_VALUE, TRANSFORM_SENSITIVE_READ, TRANSFORM_INVARIANT_READ, CALLBACK_MEASUREMENT_PATTERN, NUMBER_METHODS, gsapRules, captionRules, MAX_COMPOSITION_LINES, MAX_TIMED_ELEMENTS_PER_TRACK, TRACK_DENSITY_EXEMPT_TAGS, CAPTION_CUE_TOKEN, HEAVY_OVERLAY_ELEMENT_COUNT_WARN, HEAVY_OVERLAY_EXEMPT_TAGS, HEAVY_OVERLAY_CSS_PATTERN, INLINE_STYLE_DISPLAY_NONE_PATTERN, compositionRules, adapterRules, TEXTURE_BASE_CLASS, TEXTURE_CLASS_PREFIX, textureRules, GENERIC_FAMILIES, fontRules, slideshowRules, RULE_GROUPS, LINT_RULE_COUNT, LINT_RULE_GROUP_COUNTS, PROBE_TIMEOUT_MS, PROBE_CONCURRENCY, AUDIO_EXTENSIONS, MASK_IMAGE_URL_RE;
82702
82917
  var init_dist4 = __esm({
82703
82918
  "../lint/dist/index.js"() {
82704
82919
  "use strict";
@@ -82725,6 +82940,53 @@ var init_dist4 = __esm({
82725
82940
  TIMELINE_REGISTRY_KEY_PATTERN = /window\.__timelines(?:\[\s*["']([^"']+)["']\s*\]|\.\s*([A-Za-z_$][\w$]*))\s*=/g;
82726
82941
  TIMELINE_REGISTRY_OBJECT_OPEN_PATTERN = /window\.__timelines\s*=\s*\{/i;
82727
82942
  TIMELINE_REGISTRY_OBJECT_ENTRY_PATTERN = /(?:["']([^"']+)["']|([A-Za-z_$][\w$]*))\s*:\s*[A-Za-z_$][\w$]*/g;
82943
+ REGEX_ALLOWED_BEFORE = new Set("=(,:[!&|?{};+-*%^~<>");
82944
+ REGEX_ALLOWED_KEYWORDS = /* @__PURE__ */ new Set([
82945
+ "return",
82946
+ "typeof",
82947
+ "instanceof",
82948
+ "in",
82949
+ "of",
82950
+ "new",
82951
+ "delete",
82952
+ "void",
82953
+ "case",
82954
+ "do",
82955
+ "else",
82956
+ "yield",
82957
+ "await"
82958
+ ]);
82959
+ WORD_CHAR = /[A-Za-z0-9_$]/;
82960
+ CodeContext = class {
82961
+ last = "";
82962
+ prev = "";
82963
+ word = "";
82964
+ wordEnded = false;
82965
+ wordAfterDot = false;
82966
+ push(ch) {
82967
+ if (ch === " " || ch === " " || ch === "\n" || ch === "\r") {
82968
+ this.wordEnded = true;
82969
+ return;
82970
+ }
82971
+ if (WORD_CHAR.test(ch)) {
82972
+ if (this.wordEnded || this.word === "") this.wordAfterDot = this.last === ".";
82973
+ this.word = this.wordEnded ? ch : this.word + ch;
82974
+ } else {
82975
+ this.word = "";
82976
+ this.wordAfterDot = false;
82977
+ }
82978
+ this.wordEnded = false;
82979
+ this.prev = this.last;
82980
+ this.last = ch;
82981
+ }
82982
+ startsRegexLiteral() {
82983
+ if (this.last === "") return true;
82984
+ if (WORD_CHAR.test(this.last))
82985
+ return !this.wordAfterDot && REGEX_ALLOWED_KEYWORDS.has(this.word);
82986
+ if ((this.last === "+" || this.last === "-") && this.prev === this.last) return false;
82987
+ return REGEX_ALLOWED_BEFORE.has(this.last);
82988
+ }
82989
+ };
82728
82990
  VISIBLE_MARKUP_COMMENT_PATTERN = /\/\*[\s\S]*?\*\//g;
82729
82991
  VISIBLE_MARKUP_COMMENT_PROTECTED_BLOCK_PATTERN = /<(style|script|template|title|noscript|pre|code|textarea|text)\b[^>]*>[\s\S]*?<\/\1(?:\s[^>]*)?>/gi;
82730
82992
  coreRules = [
@@ -83038,6 +83300,12 @@ var init_dist4 = __esm({
83038
83300
  "mpg",
83039
83301
  "mpeg"
83040
83302
  ]);
83303
+ AUDIO_SRC_EXT = /* @__PURE__ */ new Set(["mp3", "wav", "aac", "flac", "opus", "aiff", "wma"]);
83304
+ SRC_KIND_NOUN = {
83305
+ image: "an image",
83306
+ video: "a video",
83307
+ audio: "an audio file"
83308
+ };
83041
83309
  mediaRules = [
83042
83310
  // duplicate_media_id + duplicate_media_discovery_risk
83043
83311
  ({ tags }) => {
@@ -83444,6 +83712,9 @@ var init_dist4 = __esm({
83444
83712
  // fallow-ignore-next-line complexity
83445
83713
  async ({ source, tags, scripts, styles, rootCompositionId }) => {
83446
83714
  const findings = [];
83715
+ const authoredHiddenSelectors = new Set(
83716
+ scripts.flatMap((script) => [...extractStandaloneHiddenSelectors(script.content)])
83717
+ );
83447
83718
  const clipIds = /* @__PURE__ */ new Map();
83448
83719
  const clipClasses = /* @__PURE__ */ new Map();
83449
83720
  for (const tag of tags) {
@@ -83536,9 +83807,10 @@ ${right.raw}`)
83536
83807
  );
83537
83808
  }).sort((a, b2) => a.position - b2.position);
83538
83809
  const startsHiddenAtZero = visibilityWindows.some(
83539
- (win) => win.position <= SCENE_BOUNDARY_EPSILON_SECONDS && isHiddenGsapState(win.propertyValues)
83810
+ (win) => win.position <= SCENE_BOUNDARY_EPSILON_SECONDS && (isHiddenGsapState(win.propertyValues) || win.fromPropertyValues !== void 0 && isHiddenGsapState(win.fromPropertyValues))
83540
83811
  );
83541
83812
  if (startsHiddenAtZero) continue;
83813
+ if (selectors.some((selector2) => authoredHiddenSelectors.has(selector2))) continue;
83542
83814
  const firstVisible = visibilityWindows.find((win) => makesOverlayVisible(win));
83543
83815
  if (!firstVisible) continue;
83544
83816
  const selector = selectors.find(
@@ -84865,8 +85137,8 @@ ${other.raw}`)
84865
85137
  });
84866
85138
  }
84867
85139
  };
84868
- for (const style of styles) scan(style.content);
84869
- for (const script of scripts) scan(script.content);
85140
+ for (const style of styles) scan(stripCssComments(style.content));
85141
+ for (const script of scripts) scan(stripJsComments(script.content));
84870
85142
  return findings;
84871
85143
  },
84872
85144
  // template_literal_selector
@@ -84874,14 +85146,17 @@ ${other.raw}`)
84874
85146
  const findings = [];
84875
85147
  for (const script of scripts) {
84876
85148
  const templateLiteralSelectorPattern = /(?:querySelector|querySelectorAll)\s*\(\s*`[^`]*\$\{[^}]+\}[^`]*`\s*\)/g;
85149
+ const scanned = stripJsCode(script.content);
84877
85150
  let tlMatch;
84878
- while ((tlMatch = templateLiteralSelectorPattern.exec(script.content)) !== null) {
85151
+ while ((tlMatch = templateLiteralSelectorPattern.exec(scanned)) !== null) {
84879
85152
  findings.push({
84880
85153
  code: "template_literal_selector",
84881
85154
  severity: "error",
84882
85155
  message: "querySelector uses a template literal variable (e.g. `${compId}`). The HTML bundler's CSS parser crashes on these. Use a hardcoded string instead.",
84883
85156
  fixHint: "Replace the template literal variable with a hardcoded string. The bundler's CSS parser cannot handle interpolated variables in script content.",
84884
- snippet: truncateSnippet(tlMatch[0])
85157
+ snippet: truncateSnippet(
85158
+ script.content.slice(tlMatch.index, tlMatch.index + tlMatch[0].length)
85159
+ )
84885
85160
  });
84886
85161
  }
84887
85162
  }
@@ -84983,7 +85258,7 @@ ${other.raw}`)
84983
85258
  if (isRegistrySourceFile(options.filePath) || isRegistryInstalledFile(rawSource)) return [];
84984
85259
  const findings = [];
84985
85260
  for (const script of scripts) {
84986
- const stripped = stripJsComments(script.content);
85261
+ const stripped = stripJsCode(script.content);
84987
85262
  if (/requestAnimationFrame\s*\(/.test(stripped)) {
84988
85263
  findings.push({
84989
85264
  code: "requestanimationframe_in_composition",
@@ -98697,8 +98972,8 @@ function inferPreGrouped(words) {
98697
98972
  function joinTokens(left, right) {
98698
98973
  const a = left.at(-1) ?? "";
98699
98974
  const b2 = right[0] ?? "";
98700
- const sep14 = CJK_CHAR.test(a) || CJK_CHAR.test(b2) ? "" : " ";
98701
- return `${left}${sep14}${right}`;
98975
+ const sep15 = CJK_CHAR.test(a) || CJK_CHAR.test(b2) ? "" : " ";
98976
+ return `${left}${sep15}${right}`;
98702
98977
  }
98703
98978
  function wordsToCues(words, opts = {}) {
98704
98979
  const preGrouped = opts.preGrouped ?? inferPreGrouped(words);
@@ -105592,8 +105867,8 @@ function upsertProp(ms, objNode, key2, value) {
105592
105867
  if (existing) {
105593
105868
  ms.overwrite(existing.value.start, existing.value.end, valueToCode(value));
105594
105869
  } else {
105595
- const sep14 = objNode.properties.length > 0 ? ", " : "";
105596
- ms.appendLeft(objNode.end - 1, `${sep14}${safeKey(key2)}: ${valueToCode(value)}`);
105870
+ const sep15 = objNode.properties.length > 0 ? ", " : "";
105871
+ ms.appendLeft(objNode.end - 1, `${sep15}${safeKey(key2)}: ${valueToCode(value)}`);
105597
105872
  }
105598
105873
  }
105599
105874
  function isEditableVarKey(key2) {
@@ -106160,8 +106435,8 @@ function insertNewKeyframe(ms, kfNode, percentage, pctKey, valueCode) {
106160
106435
  if (insertBeforeProp) {
106161
106436
  ms.appendLeft(insertBeforeProp.start, `${JSON.stringify(pctKey)}: ${valueCode}, `);
106162
106437
  } else {
106163
- const sep14 = allProps.length > 0 ? ", " : "";
106164
- ms.appendLeft(kfNode.end - 1, `${sep14}${JSON.stringify(pctKey)}: ${valueCode}`);
106438
+ const sep15 = allProps.length > 0 ? ", " : "";
106439
+ ms.appendLeft(kfNode.end - 1, `${sep15}${JSON.stringify(pctKey)}: ${valueCode}`);
106165
106440
  }
106166
106441
  }
106167
106442
  function collapseKeyframesToFlat(ms, varsNode, source, remainingRecord) {
@@ -106605,8 +106880,8 @@ function enableArcPath(ms, call, animation, config) {
106605
106880
  const k2 = propKeyName22(p2);
106606
106881
  return k2 !== "x" && k2 !== "y";
106607
106882
  });
106608
- const sep14 = survivesRemoval ? ", " : "";
106609
- ms.appendRight(vars.start + 1, ` motionPath: ${motionPathCode}${sep14}`);
106883
+ const sep15 = survivesRemoval ? ", " : "";
106884
+ ms.appendRight(vars.start + 1, ` motionPath: ${motionPathCode}${sep15}`);
106610
106885
  stripXYFromKeyframes(ms, findPropertyNode22(call.varsArg, "keyframes"));
106611
106886
  removePropsByKey(ms, call.varsArg, /* @__PURE__ */ new Set(["x", "y"]));
106612
106887
  return true;
@@ -110236,17 +110511,26 @@ import {
110236
110511
  writeSync,
110237
110512
  mkdirSync as mkdirSync32,
110238
110513
  unlinkSync as unlinkSync23,
110239
- rmSync as rmSync22,
110514
+ rmSync as rmSync32,
110240
110515
  statSync as statSync23,
110241
- renameSync as renameSync8,
110516
+ renameSync as renameSync22,
110242
110517
  readdirSync as readdirSync42
110243
110518
  } from "fs";
110244
- import { resolve as resolve32, dirname as dirname22, join as join62 } from "path";
110519
+ import { resolve as resolve32, dirname as dirname32, join as join62 } from "path";
110245
110520
  import { spawn as spawn9 } from "child_process";
110246
- import { existsSync as existsSync211, writeFileSync as writeFileSync15, mkdirSync as mkdirSync16, statSync as statSync13 } from "fs";
110247
- import { join as join36 } from "path";
110521
+ import {
110522
+ existsSync as existsSync211,
110523
+ writeFileSync as writeFileSync15,
110524
+ mkdirSync as mkdirSync16,
110525
+ lstatSync as lstatSync22,
110526
+ mkdtempSync as mkdtempSync7,
110527
+ renameSync as renameSync8,
110528
+ rmSync as rmSync12,
110529
+ statSync as statSync13
110530
+ } from "fs";
110531
+ import { dirname as dirname16, join as join36 } from "path";
110248
110532
  import { spawnSync } from "child_process";
110249
- import { mkdtempSync as mkdtempSync7, rmSync as rmSync12, writeFileSync as writeFileSync22 } from "fs";
110533
+ import { mkdtempSync as mkdtempSync22, rmSync as rmSync22, writeFileSync as writeFileSync22 } from "fs";
110250
110534
  import { tmpdir as tmpdir5 } from "os";
110251
110535
  import { basename as basename5, join as join42 } from "path";
110252
110536
  import { mkdirSync as mkdirSync22, readdirSync as readdirSync32, readFileSync as readFileSync32, unlinkSync as unlinkSync5, writeFileSync as writeFileSync32 } from "fs";
@@ -110255,8 +110539,9 @@ import { join as join52, relative as relative22 } from "path";
110255
110539
  import { createHash as createHash22, randomUUID as randomUUID9 } from "crypto";
110256
110540
  import { existsSync as existsSync37, readFileSync as readFileSync42, realpathSync as realpathSync6 } from "fs";
110257
110541
  import { randomUUID as randomUUID22 } from "crypto";
110258
- import { dirname as dirname16, relative as relative32, resolve as resolve23, sep as sep22 } from "path";
110259
- import { existsSync as existsSync62, readFileSync as readFileSync82, statSync as statSync32 } from "fs";
110542
+ import { dirname as dirname22, relative as relative32, resolve as resolve23, sep as sep22 } from "path";
110543
+ import { createReadStream as createReadStream3, existsSync as existsSync62, readFileSync as readFileSync82, statSync as statSync32 } from "fs";
110544
+ import { Readable as Readable2 } from "stream";
110260
110545
  import { join as join82, resolve as resolve42 } from "path";
110261
110546
  import { createHash as createHash32 } from "crypto";
110262
110547
  import { existsSync as existsSync52, readFileSync as readFileSync62 } from "fs";
@@ -110281,20 +110566,20 @@ import {
110281
110566
  mkdirSync as mkdirSync52,
110282
110567
  readFileSync as readFileSync112,
110283
110568
  readdirSync as readdirSync62,
110284
- renameSync as renameSync22,
110285
- rmSync as rmSync32,
110569
+ renameSync as renameSync32,
110570
+ rmSync as rmSync42,
110286
110571
  statSync as statSync52,
110287
110572
  unlinkSync as unlinkSync42,
110288
110573
  writeFileSync as writeFileSync62
110289
110574
  } from "fs";
110290
110575
  import { join as join112 } from "path";
110291
110576
  import { createHash as createHash42, randomUUID as randomUUID32 } from "crypto";
110292
- import { existsSync as existsSync92, readFileSync as readFileSync122, writeFileSync as writeFileSync72, mkdirSync as mkdirSync62, statSync as statSync62 } from "fs";
110577
+ import { existsSync as existsSync92, readFileSync as readFileSync122, statSync as statSync62 } from "fs";
110293
110578
  import { join as join122 } from "path";
110294
110579
  import { closeSync as closeSync32, constants as constants22, fstatSync as fstatSync22, openSync as openSync32, readSync } from "fs";
110295
110580
  import { streamSSE as streamSSE2 } from "hono/streaming";
110296
- import { existsSync as existsSync102, mkdirSync as mkdirSync72 } from "fs";
110297
- import { basename as basename22, dirname as dirname32, extname as extname22, join as join132 } from "path";
110581
+ import { existsSync as existsSync102, mkdirSync as mkdirSync62 } from "fs";
110582
+ import { basename as basename22, dirname as dirname42, extname as extname22, join as join132 } from "path";
110298
110583
  import { existsSync as existsSync112, readFileSync as readFileSync132 } from "fs";
110299
110584
  import { homedir as homedir10 } from "os";
110300
110585
  import { join as join142 } from "path";
@@ -110612,10 +110897,34 @@ async function generateWaveformCache(projectDir, assetPath) {
110612
110897
  const stats = statSync13(audioPath);
110613
110898
  const cacheDir = join36(projectDir, ".waveform-cache");
110614
110899
  const cachePath2 = join36(cacheDir, buildWaveformCacheKey(assetPath, stats));
110615
- if (existsSync211(cachePath2)) return;
110900
+ if (isWaveformCacheDirectory(cacheDir) && existsSync211(cachePath2)) return;
110616
110901
  const peaks = await decodeAudioPeaks(audioPath);
110617
- mkdirSync16(cacheDir, { recursive: true });
110618
- writeFileSync15(cachePath2, JSON.stringify(peaks));
110902
+ writeWaveformCache(cachePath2, peaks);
110903
+ }
110904
+ function isWaveformCacheDirectory(cacheDir) {
110905
+ return lstatSync22(cacheDir, { throwIfNoEntry: false })?.isDirectory() ?? false;
110906
+ }
110907
+ function writeWaveformCache(cachePath2, peaks) {
110908
+ const cacheDir = dirname16(cachePath2);
110909
+ try {
110910
+ mkdirSync16(cacheDir, { mode: 448 });
110911
+ } catch (error) {
110912
+ if (!(error instanceof Error && "code" in error && error.code === "EEXIST")) throw error;
110913
+ }
110914
+ if (!isWaveformCacheDirectory(cacheDir)) {
110915
+ throw new Error("Waveform cache must be a directory, not a symlink");
110916
+ }
110917
+ const stagingDir = mkdtempSync7(join36(cacheDir, ".waveform-"));
110918
+ try {
110919
+ const stagingPath = join36(stagingDir, "peaks.json");
110920
+ writeFileSync15(stagingPath, JSON.stringify(peaks), { flag: "wx" });
110921
+ renameSync8(stagingPath, cachePath2);
110922
+ } finally {
110923
+ try {
110924
+ rmSync12(stagingDir, { recursive: true, force: true });
110925
+ } catch {
110926
+ }
110927
+ }
110619
110928
  }
110620
110929
  function validateUploadedMedia(filePath, runner = spawnSync) {
110621
110930
  const isVideo2 = VIDEO_EXT2.test(filePath);
@@ -110651,13 +110960,13 @@ function validateUploadedMedia(filePath, runner = spawnSync) {
110651
110960
  }
110652
110961
  }
110653
110962
  function validateUploadedMediaBuffer(fileName, buffer, runner = spawnSync) {
110654
- const tempDir = mkdtempSync7(join42(tmpdir5(), "hyperframes-upload-"));
110963
+ const tempDir = mkdtempSync22(join42(tmpdir5(), "hyperframes-upload-"));
110655
110964
  const tempPath = join42(tempDir, basename5(fileName));
110656
110965
  try {
110657
110966
  writeFileSync22(tempPath, buffer);
110658
110967
  return validateUploadedMedia(tempPath, runner);
110659
110968
  } finally {
110660
- rmSync12(tempDir, { recursive: true, force: true });
110969
+ rmSync22(tempDir, { recursive: true, force: true });
110661
110970
  }
110662
110971
  }
110663
110972
  function backupKeyForPath(path2) {
@@ -110796,7 +111105,7 @@ function canonicalDependency(projectDir, ownerAbs, sourcePath) {
110796
111105
  validateSourcePath(sourcePath);
110797
111106
  return canonicalProjectPath(
110798
111107
  projectDir,
110799
- resolveWithinProject(projectDir, relative32(projectDir, resolve23(dirname16(ownerAbs), sourcePath)))
111108
+ resolveWithinProject(projectDir, relative32(projectDir, resolve23(dirname22(ownerAbs), sourcePath)))
110800
111109
  );
110801
111110
  }
110802
111111
  function validateDependencyGraph(projectDir, targetAbs, sourceAbs) {
@@ -110869,7 +111178,7 @@ function uniqueHostId(root, base2) {
110869
111178
  return `${base2}_${suffix}`;
110870
111179
  }
110871
111180
  function relativeSourcePath(targetAbs, sourceAbs) {
110872
- return relative32(dirname16(targetAbs), sourceAbs).split(sep22).join("/");
111181
+ return relative32(dirname22(targetAbs), sourceAbs).split(sep22).join("/");
110873
111182
  }
110874
111183
  function insertCompositionIntoSource(input2) {
110875
111184
  const targetAbs = canonicalProjectFile(input2.projectDir, input2.targetPath);
@@ -111147,7 +111456,7 @@ async function parseMutationBody(c3) {
111147
111456
  return { target: body.target, body };
111148
111457
  }
111149
111458
  function ensureDir(filePath) {
111150
- const dir = dirname22(filePath);
111459
+ const dir = dirname32(filePath);
111151
111460
  if (!existsSync42(dir)) mkdirSync32(dir, { recursive: true });
111152
111461
  }
111153
111462
  function generateCopyPath(projectDir, originalPath) {
@@ -112420,7 +112729,7 @@ function registerFileRoutes(api, adapter2) {
112420
112729
  const backup = snapshotBeforeWrite(res.project.dir, res.absPath);
112421
112730
  if (backup.error) console.warn(`Failed to create backup for ${res.filePath}: ${backup.error}`);
112422
112731
  if (stat3.isDirectory()) {
112423
- rmSync22(res.absPath, { recursive: true });
112732
+ rmSync32(res.absPath, { recursive: true });
112424
112733
  } else {
112425
112734
  unlinkSync23(res.absPath);
112426
112735
  }
@@ -112916,7 +113225,7 @@ function registerFileRoutes(api, adapter2) {
112916
113225
  return c3.json({ error: "already exists" }, 409);
112917
113226
  }
112918
113227
  ensureDir(newAbs);
112919
- renameSync8(res.absPath, newAbs);
113228
+ renameSync22(res.absPath, newAbs);
112920
113229
  const updatedFiles = updateReferences(res.project.dir, res.filePath, body.newPath);
112921
113230
  return c3.json({ ok: true, path: body.newPath, updatedReferences: updatedFiles });
112922
113231
  });
@@ -113609,29 +113918,39 @@ ${runtimeTag}`;
113609
113918
  }
113610
113919
  servedContentType = PROXY_VARIANT_CONFIG[proxyVariant].contentType;
113611
113920
  }
113612
- const buffer = isText2 ? Buffer.from(readFileSync82(file, "utf-8"), "utf-8") : readFileSync82(servedPath);
113613
- const totalSize2 = buffer.length;
113921
+ const textBuffer = isText2 ? Buffer.from(readFileSync82(file, "utf-8"), "utf-8") : null;
113922
+ const totalSize2 = textBuffer ? textBuffer.length : statSync32(servedPath).size;
113923
+ const bodyFor = (start, end) => textBuffer ? new Uint8Array(textBuffer.subarray(start, end + 1)) : (
113924
+ // Node's web stream type and the DOM one do not overlap for tsc on
113925
+ // every platform's lib set; the double cast is the documented bridge.
113926
+ Readable2.toWeb(
113927
+ createReadStream3(servedPath, { start, end })
113928
+ )
113929
+ );
113614
113930
  const rangeHeader = c3.req.header("Range");
113615
- if (rangeHeader) {
113616
- const match = /bytes=(\d+)-(\d*)/.exec(rangeHeader);
113617
- if (match) {
113618
- const start = parseInt(match[1], 10);
113619
- const end = match[2] ? parseInt(match[2], 10) : totalSize2 - 1;
113620
- const safeEnd = Math.min(end, totalSize2 - 1);
113621
- const chunkSize = safeEnd - start + 1;
113622
- return new Response(new Uint8Array(buffer.slice(start, safeEnd + 1)), {
113623
- status: 206,
113624
- headers: {
113625
- ...cacheHeaders,
113626
- "Content-Type": servedContentType,
113627
- "Content-Range": `bytes ${start}-${safeEnd}/${totalSize2}`,
113628
- "Accept-Ranges": "bytes",
113629
- "Content-Length": String(chunkSize)
113630
- }
113931
+ const match = rangeHeader ? /bytes=(\d+)-(\d*)/.exec(rangeHeader) : null;
113932
+ if (match) {
113933
+ const start = parseInt(match[1], 10);
113934
+ const end = match[2] ? parseInt(match[2], 10) : totalSize2 - 1;
113935
+ const safeEnd = Math.min(end, totalSize2 - 1);
113936
+ if (start > safeEnd) {
113937
+ return new Response(null, {
113938
+ status: 416,
113939
+ headers: { ...cacheHeaders, "Content-Range": `bytes */${totalSize2}` }
113631
113940
  });
113632
113941
  }
113942
+ return new Response(bodyFor(start, safeEnd), {
113943
+ status: 206,
113944
+ headers: {
113945
+ ...cacheHeaders,
113946
+ "Content-Type": servedContentType,
113947
+ "Content-Range": `bytes ${start}-${safeEnd}/${totalSize2}`,
113948
+ "Accept-Ranges": "bytes",
113949
+ "Content-Length": String(safeEnd - start + 1)
113950
+ }
113951
+ });
113633
113952
  }
113634
- return new Response(new Uint8Array(buffer), {
113953
+ return new Response(totalSize2 > 0 ? bodyFor(0, totalSize2 - 1) : null, {
113635
113954
  headers: {
113636
113955
  ...cacheHeaders,
113637
113956
  "Content-Type": servedContentType,
@@ -113932,7 +114251,7 @@ function pruneThumbnailCache(cacheDir, protectedPaths, now = Date.now()) {
113932
114251
  const retained = [];
113933
114252
  for (const file of files) {
113934
114253
  if (!protectedPaths.has(file.path) && now - file.mtimeMs > THUMBNAIL_CACHE_MAX_AGE_MS) {
113935
- rmSync32(file.path, { force: true });
114254
+ rmSync42(file.path, { force: true });
113936
114255
  } else {
113937
114256
  retained.push(file);
113938
114257
  }
@@ -113952,9 +114271,9 @@ function writeThumbnailAtomically(path2, buffer) {
113952
114271
  const temporaryPath = `${path2}.${process.pid}.${randomUUID32()}.tmp`;
113953
114272
  try {
113954
114273
  writeFileSync62(temporaryPath, buffer, { flag: "wx" });
113955
- renameSync22(temporaryPath, path2);
114274
+ renameSync32(temporaryPath, path2);
113956
114275
  } finally {
113957
- rmSync32(temporaryPath, { force: true });
114276
+ rmSync42(temporaryPath, { force: true });
113958
114277
  }
113959
114278
  }
113960
114279
  function registerThumbnailRoutes(api, adapter2) {
@@ -114100,12 +114419,12 @@ function registerWaveformRoutes(api, adapter2) {
114100
114419
  if (!stats) return c3.json({ error: "file not found" }, 404);
114101
114420
  const cacheDir = join122(project.dir, ".waveform-cache");
114102
114421
  const cachePath2 = join122(cacheDir, buildWaveformCacheKey(assetPath, stats));
114103
- if (existsSync92(cachePath2)) {
114104
- try {
114422
+ try {
114423
+ if (isWaveformCacheDirectory(cacheDir) && existsSync92(cachePath2)) {
114105
114424
  const peaks2 = JSON.parse(readFileSync122(cachePath2, "utf-8"));
114106
114425
  return c3.json({ peaks: peaks2 });
114107
- } catch {
114108
114426
  }
114427
+ } catch {
114109
114428
  }
114110
114429
  let peaks;
114111
114430
  try {
@@ -114114,8 +114433,7 @@ function registerWaveformRoutes(api, adapter2) {
114114
114433
  return c3.json({ error: "failed to decode audio" }, 500);
114115
114434
  }
114116
114435
  try {
114117
- mkdirSync62(cacheDir, { recursive: true });
114118
- writeFileSync72(cachePath2, JSON.stringify(peaks));
114436
+ writeWaveformCache(cachePath2, peaks);
114119
114437
  } catch {
114120
114438
  }
114121
114439
  return c3.json({ peaks });
@@ -114469,8 +114787,8 @@ function registerMediaRoutes(api, adapter2, options = {}) {
114469
114787
  return c3.json({ error: "forbidden" }, 403);
114470
114788
  }
114471
114789
  }
114472
- mkdirSync72(dirname32(outputPath), { recursive: true });
114473
- if (backgroundOutputPath) mkdirSync72(dirname32(backgroundOutputPath), { recursive: true });
114790
+ mkdirSync62(dirname42(outputPath), { recursive: true });
114791
+ if (backgroundOutputPath) mkdirSync62(dirname42(backgroundOutputPath), { recursive: true });
114474
114792
  const jobId = makeJobId(project.id, mediaJobs);
114475
114793
  const state = adapter2.startBackgroundRemoval({
114476
114794
  project,
@@ -116636,7 +116954,7 @@ import {
116636
116954
  existsSync as existsSync41,
116637
116955
  realpathSync as realpathSync7,
116638
116956
  statSync as statSync15,
116639
- createReadStream as createReadStream3,
116957
+ createReadStream as createReadStream4,
116640
116958
  openSync as openSync7,
116641
116959
  fstatSync as fstatSync4,
116642
116960
  closeSync as closeSync7,
@@ -116644,7 +116962,7 @@ import {
116644
116962
  readFile as readFile3
116645
116963
  } from "fs";
116646
116964
  import { promisify as promisify5 } from "util";
116647
- import { Readable as Readable2 } from "stream";
116965
+ import { Readable as Readable3 } from "stream";
116648
116966
  import { join as join40, extname as extname10, resolve as resolve27, sep as sep9 } from "path";
116649
116967
  function isPathInside2(child, parent, options = {}) {
116650
116968
  const { resolveSymlinks = false, pathModule } = options;
@@ -117062,14 +117380,14 @@ function createFileServer2(options) {
117062
117380
  }
117063
117381
  };
117064
117382
  if (c3.req.method === "HEAD") return new Response(null, responseOptions);
117065
- const stream = createReadStream3(filePath, {
117383
+ const stream = createReadStream4(filePath, {
117066
117384
  fd,
117067
117385
  autoClose: true,
117068
117386
  ...range ? { start: range.start, end: range.end } : {}
117069
117387
  });
117070
117388
  streamOwnsFd = true;
117071
117389
  try {
117072
- const webStream = Readable2.toWeb(stream);
117390
+ const webStream = Readable3.toWeb(stream);
117073
117391
  return new Response(webStream, responseOptions);
117074
117392
  } catch (error) {
117075
117393
  stream.destroy();
@@ -124023,7 +124341,7 @@ var init_assetMediaType = __esm({
124023
124341
  });
124024
124342
 
124025
124343
  // ../producer/src/services/htmlCompiler.ts
124026
- import { createReadStream as createReadStream4, existsSync as existsSync49, mkdirSync as mkdirSync23, readFileSync as readFileSync31 } from "fs";
124344
+ import { createReadStream as createReadStream5, existsSync as existsSync49, mkdirSync as mkdirSync23, readFileSync as readFileSync31 } from "fs";
124027
124345
  import { join as join49, dirname as dirname24, resolve as resolve31, basename as basename10, relative as relative12 } from "path";
124028
124346
  function logRemoteDownloadTelemetry(event) {
124029
124347
  defaultLogger.info("[Compiler] Remote asset download integrity", { ...event });
@@ -124923,7 +125241,7 @@ function urlOccurrenceRe(localPath) {
124923
125241
  async function readLocalFont(absPath) {
124924
125242
  const chunks = [];
124925
125243
  let totalBytes = 0;
124926
- for await (const chunk of createReadStream4(absPath)) {
125244
+ for await (const chunk of createReadStream5(absPath)) {
124927
125245
  const buffer = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
124928
125246
  totalBytes += buffer.length;
124929
125247
  if (totalBytes > MAX_LOCAL_FONT_DATA_URI_BYTES) {
@@ -132952,8 +133270,16 @@ var init_config3 = __esm({
132952
133270
  });
132953
133271
 
132954
133272
  // ../producer/src/services/hyperframeLint.ts
132955
- import { existsSync as existsSync56, readFileSync as readFileSync35, statSync as statSync19 } from "fs";
132956
- import { resolve as resolve34, join as join67 } from "path";
133273
+ import {
133274
+ existsSync as existsSync56,
133275
+ readFileSync as readFileSync35,
133276
+ statSync as statSync19,
133277
+ openSync as openSync10,
133278
+ fstatSync as fstatSync7,
133279
+ closeSync as closeSync11,
133280
+ constants as constants7
133281
+ } from "fs";
133282
+ import { resolve as resolve34, join as join67, relative as relative13, isAbsolute as isAbsolute12, sep as sep10 } from "path";
132957
133283
  function isStringRecord2(value) {
132958
133284
  if (!value || typeof value !== "object" || Array.isArray(value)) {
132959
133285
  return false;
@@ -132979,6 +133305,23 @@ function pickEntryFile(files, preferredEntryFile) {
132979
133305
  }
132980
133306
  return null;
132981
133307
  }
133308
+ function readEntryHtml(filePath) {
133309
+ let fd;
133310
+ try {
133311
+ fd = openSync10(filePath, constants7.O_RDONLY | constants7.O_NONBLOCK);
133312
+ } catch (error) {
133313
+ if (error instanceof Error && "code" in error && (error.code === "ENOENT" || error.code === "ENOTDIR"))
133314
+ return null;
133315
+ if (!statSync19(filePath, { throwIfNoEntry: false })?.isFile()) return null;
133316
+ throw error;
133317
+ }
133318
+ try {
133319
+ if (!fstatSync7(fd).isFile()) return null;
133320
+ return readFileSync35(fd, "utf-8");
133321
+ } finally {
133322
+ closeSync11(fd);
133323
+ }
133324
+ }
132982
133325
  function readProjectEntryFile(projectDir, preferredEntryFile) {
132983
133326
  const absProjectDir = resolve34(projectDir);
132984
133327
  if (!existsSync56(absProjectDir) || !statSync19(absProjectDir).isDirectory()) {
@@ -132989,13 +133332,15 @@ function readProjectEntryFile(projectDir, preferredEntryFile) {
132989
133332
  );
132990
133333
  for (const entryFile of entryCandidates) {
132991
133334
  const absoluteEntryPath = resolve34(absProjectDir, entryFile);
132992
- if (!absoluteEntryPath.startsWith(absProjectDir)) {
133335
+ const entryRelativePath = relative13(absProjectDir, absoluteEntryPath);
133336
+ if (entryRelativePath === ".." || entryRelativePath.startsWith(`..${sep10}`) || isAbsolute12(entryRelativePath)) {
132993
133337
  return { error: `Entry file must stay inside project directory: ${entryFile}` };
132994
133338
  }
132995
- if (existsSync56(absoluteEntryPath) && statSync19(absoluteEntryPath).isFile()) {
133339
+ const html = readEntryHtml(absoluteEntryPath);
133340
+ if (html !== null) {
132996
133341
  return {
132997
133342
  entryFile,
132998
- html: readFileSync35(absoluteEntryPath, "utf-8"),
133343
+ html,
132999
133344
  source: "projectDir"
133000
133345
  };
133001
133346
  }
@@ -133147,7 +133492,7 @@ import {
133147
133492
  mkdtempSync as mkdtempSync14,
133148
133493
  writeFileSync as writeFileSync20,
133149
133494
  rmSync as rmSync23,
133150
- createReadStream as createReadStream5
133495
+ createReadStream as createReadStream6
133151
133496
  } from "fs";
133152
133497
  import { resolve as resolve35, dirname as dirname30, join as join69 } from "path";
133153
133498
  import { tmpdir as tmpdir10 } from "os";
@@ -133710,7 +134055,7 @@ function createRenderHandlers(options = {}) {
133710
134055
  return c3.json({ success: false, error: "Output artifact file missing" }, 404);
133711
134056
  }
133712
134057
  const stats = statSync20(artifact.path);
133713
- return new Response(createReadStream5(artifact.path), {
134058
+ return new Response(createReadStream6(artifact.path), {
133714
134059
  headers: {
133715
134060
  "content-type": "video/mp4",
133716
134061
  "content-length": String(stats.size),
@@ -133984,7 +134329,7 @@ var init_planHash = __esm({
133984
134329
 
133985
134330
  // ../producer/src/services/render/stages/freezePlan.ts
133986
134331
  import { existsSync as existsSync59, mkdirSync as mkdirSync29, readFileSync as readFileSync36, readdirSync as readdirSync20, writeFileSync as writeFileSync21 } from "fs";
133987
- import { join as join70, relative as relative13, resolve as resolve36 } from "path";
134332
+ import { join as join70, relative as relative14, resolve as resolve36 } from "path";
133988
134333
  function stripUndefined(value) {
133989
134334
  if (Array.isArray(value)) return value.map(stripUndefined);
133990
134335
  if (value !== null && typeof value === "object") {
@@ -134010,7 +134355,7 @@ function listPlanFiles(planDir) {
134010
134355
  walk(full2);
134011
134356
  } else if (entry.isFile()) {
134012
134357
  results.push({
134013
- planRelativePath: relative13(rootResolved, full2).split(/[\\/]+/).join("/"),
134358
+ planRelativePath: relative14(rootResolved, full2).split(/[\\/]+/).join("/"),
134014
134359
  absolutePath: full2
134015
134360
  });
134016
134361
  }
@@ -134424,7 +134769,7 @@ var init_shared2 = __esm({
134424
134769
  // ../producer/src/services/distributed/planSize.ts
134425
134770
  import { createHash as createHash17 } from "crypto";
134426
134771
  import { lstatSync as lstatSync6, readdirSync as readdirSync21 } from "fs";
134427
- import { extname as extname13, join as join73, relative as relative14 } from "path";
134772
+ import { extname as extname13, join as join73, relative as relative15 } from "path";
134428
134773
  function hashComponent(value) {
134429
134774
  return createHash17("sha256").update(value).digest("hex").slice(0, 12);
134430
134775
  }
@@ -134487,7 +134832,7 @@ function recordFile(result, components, rootDir, rootKind, filePath) {
134487
134832
  } catch {
134488
134833
  return;
134489
134834
  }
134490
- const rel = relative14(rootDir, filePath);
134835
+ const rel = relative15(rootDir, filePath);
134491
134836
  const segments = rel.split(/[\\/]+/).filter(Boolean);
134492
134837
  const classified = classifyFile(segments, rootKind);
134493
134838
  result.totalBytes += sizeBytes;
@@ -134564,7 +134909,7 @@ var init_planSize = __esm({
134564
134909
 
134565
134910
  // ../producer/src/services/distributed/plan.ts
134566
134911
  import { cpSync as cpSync3, existsSync as existsSync61, mkdirSync as mkdirSync30, renameSync as renameSync13, rmSync as rmSync24, writeFileSync as writeFileSync23 } from "fs";
134567
- import { join as join74, relative as relative15, sep as sep10 } from "path";
134912
+ import { join as join74, relative as relative16, sep as sep11 } from "path";
134568
134913
  function applyDistributedAudioWarningPolicy(job, audioError, audioFailures = [], log2 = defaultLogger) {
134569
134914
  const failureOwner = audioFailures.length === 0 ? void 0 : audioFailures.some((failure) => failure.owner === "system") ? "system" : "user";
134570
134915
  const retryable = audioFailures.length === 0 ? void 0 : audioFailures.every((failure) => failure.retryable);
@@ -134804,9 +135149,9 @@ async function buildLocalExecutionPlan(projectDir, config, executionPlanDir, opt
134804
135149
  recursive: true,
134805
135150
  dereference: true,
134806
135151
  filter: (src) => {
134807
- const rel = relative15(projectDir, src);
135152
+ const rel = relative16(projectDir, src);
134808
135153
  if (rel === "" || rel.startsWith("..")) return true;
134809
- const firstSegment = rel.split(sep10, 1)[0];
135154
+ const firstSegment = rel.split(sep11, 1)[0];
134810
135155
  return firstSegment === void 0 || !PLAN_PROJECT_DIR_SKIP_SEGMENTS.has(firstSegment);
134811
135156
  }
134812
135157
  });
@@ -135269,13 +135614,13 @@ var init_planV2Publisher = __esm({
135269
135614
 
135270
135615
  // ../producer/src/services/distributed/planV2.ts
135271
135616
  import {
135272
- closeSync as closeSync11,
135617
+ closeSync as closeSync12,
135273
135618
  copyFileSync as copyFileSync8,
135274
135619
  existsSync as existsSync64,
135275
135620
  lstatSync as lstatSync7,
135276
135621
  mkdirSync as mkdirSync33,
135277
135622
  mkdtempSync as mkdtempSync16,
135278
- openSync as openSync10,
135623
+ openSync as openSync11,
135279
135624
  readFileSync as readFileSync38,
135280
135625
  readSync as readSync4,
135281
135626
  readdirSync as readdirSync23,
@@ -135286,7 +135631,7 @@ import {
135286
135631
  } from "fs";
135287
135632
  import { createHash as createHash18 } from "crypto";
135288
135633
  import { tmpdir as tmpdir11 } from "os";
135289
- import { dirname as dirname34, isAbsolute as isAbsolute12, join as join77, relative as relative16, resolve as resolve37, sep as sep11 } from "path";
135634
+ import { dirname as dirname34, isAbsolute as isAbsolute13, join as join77, relative as relative17, resolve as resolve37, sep as sep12 } from "path";
135290
135635
  function isRecord8(value) {
135291
135636
  return value !== null && typeof value === "object" && !Array.isArray(value);
135292
135637
  }
@@ -135308,7 +135653,7 @@ function readJsonFile(path2, label2) {
135308
135653
  }
135309
135654
  function assertSafeRelativePath(path2) {
135310
135655
  const normalized2 = path2.split(/[\\/]+/);
135311
- if (path2.length === 0 || isAbsolute12(path2) || normalized2.some((part) => part === "" || part === "." || part === "..")) {
135656
+ if (path2.length === 0 || isAbsolute13(path2) || normalized2.some((part) => part === "" || part === "." || part === "..")) {
135312
135657
  throw new PlanV2IntegrityError(`unsafe artifact path: ${JSON.stringify(path2)}`);
135313
135658
  }
135314
135659
  }
@@ -135322,7 +135667,7 @@ function listFiles(root) {
135322
135667
  walk(absolutePath);
135323
135668
  } else if (entry.isFile()) {
135324
135669
  files.push({
135325
- path: relative16(rootResolved, absolutePath).split(sep11).join("/"),
135670
+ path: relative17(rootResolved, absolutePath).split(sep12).join("/"),
135326
135671
  absolutePath
135327
135672
  });
135328
135673
  } else {
@@ -135338,7 +135683,7 @@ function listFiles(root) {
135338
135683
  function sha256File(path2) {
135339
135684
  const hash2 = createHash18("sha256");
135340
135685
  const buffer = Buffer.allocUnsafe(1024 * 1024);
135341
- const fd = openSync10(path2, "r");
135686
+ const fd = openSync11(path2, "r");
135342
135687
  try {
135343
135688
  let bytesRead = 0;
135344
135689
  do {
@@ -135346,7 +135691,7 @@ function sha256File(path2) {
135346
135691
  if (bytesRead > 0) hash2.update(buffer.subarray(0, bytesRead));
135347
135692
  } while (bytesRead > 0);
135348
135693
  } finally {
135349
- closeSync11(fd);
135694
+ closeSync12(fd);
135350
135695
  }
135351
135696
  return hash2.digest("hex");
135352
135697
  }
@@ -135377,7 +135722,7 @@ function isExtractionCacheCompleteSentinelPath(path2) {
135377
135722
  function resolveExtractedVideoOutputDir(planDir, videoId) {
135378
135723
  const videoRoot = resolve37(planDir, "video-frames");
135379
135724
  const outputDir = resolve37(videoRoot, videoId);
135380
- if (outputDir === videoRoot || !outputDir.startsWith(`${videoRoot}${sep11}`)) {
135725
+ if (outputDir === videoRoot || !outputDir.startsWith(`${videoRoot}${sep12}`)) {
135381
135726
  throw new PlanV2IntegrityError(`unsafe extracted video id: ${JSON.stringify(videoId)}`);
135382
135727
  }
135383
135728
  return outputDir;
@@ -135494,7 +135839,7 @@ function buildVideoChunkDependencies(executionPlanDir, dimensions) {
135494
135839
  for (let frame = chunk.startFrame; frame < chunk.endFrame; frame++) {
135495
135840
  const globalTime = frame * fpsDen / fpsNum;
135496
135841
  for (const payload of table.getActiveFramePayloads(globalTime).values()) {
135497
- const path2 = relative16(resolve37(executionPlanDir), payload.framePath).split(sep11).join("/");
135842
+ const path2 = relative17(resolve37(executionPlanDir), payload.framePath).split(sep12).join("/");
135498
135843
  assertSafeRelativePath(path2);
135499
135844
  const indexes = mutable.get(path2) ?? /* @__PURE__ */ new Set();
135500
135845
  indexes.add(chunk.index);
@@ -136839,7 +137184,7 @@ var init_planV2Execution = __esm({
136839
137184
  // ../producer/src/services/distributed/projectHash.ts
136840
137185
  import { readdirSync as readdirSync26, readFileSync as readFileSync41 } from "fs";
136841
137186
  import { createHash as createHash19 } from "crypto";
136842
- import { join as join81, relative as relative17 } from "path";
137187
+ import { join as join81, relative as relative18 } from "path";
136843
137188
  var init_projectHash = __esm({
136844
137189
  "../producer/src/services/distributed/projectHash.ts"() {
136845
137190
  "use strict";
@@ -140771,7 +141116,7 @@ __export(add_exports, {
140771
141116
  runAdd: () => runAdd
140772
141117
  });
140773
141118
  import { existsSync as existsSync73 } from "fs";
140774
- import { resolve as resolve41, relative as relative18 } from "path";
141119
+ import { resolve as resolve41, relative as relative19 } from "path";
140775
141120
  function remapTarget(item, originalTarget, paths) {
140776
141121
  if (item.type === "hyperframes:block") {
140777
141122
  const blocksDir = paths.blocks.replace(/\/+$/, "");
@@ -141044,11 +141389,11 @@ var init_add = __esm({
141044
141389
  console.log(`${c.success("\u2713")} Added ${c.accent(result.name)} (${result.type})`);
141045
141390
  for (const file of result.preserved) {
141046
141391
  console.log(
141047
- ` ${c.warn("kept")} ${relative18(projectDir, file) || file} \u2014 you have edited this; --force to overwrite`
141392
+ ` ${c.warn("kept")} ${relative19(projectDir, file) || file} \u2014 you have edited this; --force to overwrite`
141048
141393
  );
141049
141394
  }
141050
141395
  for (const file of result.written) {
141051
- console.log(` ${c.dim(relative18(projectDir, file))}`);
141396
+ console.log(` ${c.dim(relative19(projectDir, file))}`);
141052
141397
  }
141053
141398
  if (result.variablesApplied.length > 0) {
141054
141399
  console.log(` ${c.dim(`variables applied: ${result.variablesApplied.join(", ")}`)}`);
@@ -142044,9 +142389,9 @@ var init_mediaProxyPreview = __esm({
142044
142389
  });
142045
142390
 
142046
142391
  // src/utils/compositionServer.ts
142047
- import { createReadStream as createReadStream6, existsSync as existsSync76, statSync as statSync26 } from "fs";
142392
+ import { createReadStream as createReadStream7, existsSync as existsSync76, statSync as statSync26 } from "fs";
142048
142393
  import { resolve as resolve44, dirname as dirname38 } from "path";
142049
- import { Readable as Readable3 } from "stream";
142394
+ import { Readable as Readable4 } from "stream";
142050
142395
  import { fileURLToPath as fileURLToPath10 } from "url";
142051
142396
  function helperDir() {
142052
142397
  return dirname38(fileURLToPath10(import.meta.url));
@@ -142089,7 +142434,7 @@ function buildRangeResponse(filePath, contentType, rangeHeader) {
142089
142434
  const size = statSync26(filePath).size;
142090
142435
  const last = size - 1;
142091
142436
  const match = rangeHeader ? /^bytes=(\d*)-(\d*)$/.exec(rangeHeader.trim()) : null;
142092
- const body = (start2, end2) => size === 0 ? null : Readable3.toWeb(createReadStream6(filePath, { start: start2, end: end2 }));
142437
+ const body = (start2, end2) => size === 0 ? null : Readable4.toWeb(createReadStream7(filePath, { start: start2, end: end2 }));
142093
142438
  if (!match) {
142094
142439
  return new Response(body(0, last), {
142095
142440
  status: 200,
@@ -144110,7 +144455,7 @@ var init_projectLink = __esm({
144110
144455
  });
144111
144456
 
144112
144457
  // src/utils/publishProject.ts
144113
- import { basename as basename14, dirname as dirname40, join as join91, posix as posix5, relative as relative19, resolve as resolve48 } from "path";
144458
+ import { basename as basename14, dirname as dirname40, join as join91, posix as posix5, relative as relative20, resolve as resolve48 } from "path";
144114
144459
  import { existsSync as existsSync80, readdirSync as readdirSync28, readFileSync as readFileSync53, statSync as statSync27 } from "fs";
144115
144460
  import AdmZip from "adm-zip";
144116
144461
  import ignore2 from "ignore";
@@ -144283,7 +144628,7 @@ function collectProjectFiles(rootDir, currentDir, paths, matcher) {
144283
144628
  for (const entry of readdirSync28(currentDir, { withFileTypes: true })) {
144284
144629
  if (shouldIgnoreSegment(entry.name)) continue;
144285
144630
  const absolutePath = join91(currentDir, entry.name);
144286
- const relativePath = relative19(rootDir, absolutePath).replaceAll("\\", "/");
144631
+ const relativePath = relative20(rootDir, absolutePath).replaceAll("\\", "/");
144287
144632
  if (!relativePath) continue;
144288
144633
  if (entry.isDirectory()) {
144289
144634
  if (matcher.ignores(`${relativePath}/`)) continue;
@@ -144298,7 +144643,7 @@ function collectProjectFiles(rootDir, currentDir, paths, matcher) {
144298
144643
  function addExternalAsset(ctx, absPath) {
144299
144644
  const existing = ctx.externalMap.get(absPath);
144300
144645
  if (existing) return existing;
144301
- const rel = relative19(ctx.absProjectDir, absPath).replaceAll("\\", "/");
144646
+ const rel = relative20(ctx.absProjectDir, absPath).replaceAll("\\", "/");
144302
144647
  const stripped = rel.replace(/^(?:\.\.\/)+/, "");
144303
144648
  let archivePath = `${EXT_ASSETS_PREFIX}/${stripped}`;
144304
144649
  if (ctx.usedArchivePaths.has(archivePath)) {
@@ -144710,7 +145055,7 @@ __export(publish_exports, {
144710
145055
  examples: () => examples8,
144711
145056
  parseUpdateTarget: () => parseUpdateTarget
144712
145057
  });
144713
- import { join as join93, posix as posix6, relative as relative20, resolve as resolve50 } from "path";
145058
+ import { join as join93, posix as posix6, relative as relative21, resolve as resolve50 } from "path";
144714
145059
  import { existsSync as existsSync83 } from "fs";
144715
145060
  function parseUpdateTarget(value) {
144716
145061
  const trimmed = value.trim();
@@ -144915,7 +145260,7 @@ var init_publish = __esm({
144915
145260
  const file = writeTeamProject(dir, { projectId: published.projectId, spaceId });
144916
145261
  console.log();
144917
145262
  console.log(
144918
- ` ${c.dim(`Wrote ${relative20(dir, file) || file} \u2014 commit it so your team publishes to this link.`)}`
145263
+ ` ${c.dim(`Wrote ${relative21(dir, file) || file} \u2014 commit it so your team publishes to this link.`)}`
144919
145264
  );
144920
145265
  } catch {
144921
145266
  }
@@ -144960,7 +145305,7 @@ var init_publish = __esm({
144960
145305
 
144961
145306
  // src/utils/catalogUsage.ts
144962
145307
  import { readFileSync as readFileSync54 } from "fs";
144963
- import { isAbsolute as isAbsolute13, relative as relative21, resolve as resolve51 } from "path";
145308
+ import { isAbsolute as isAbsolute14, relative as relative23, resolve as resolve51 } from "path";
144964
145309
  function reachableCompositions(projectDir, entryPath) {
144965
145310
  const seen = /* @__PURE__ */ new Set();
144966
145311
  const queue = [resolve51(entryPath)];
@@ -144982,9 +145327,9 @@ function reachableCompositions(projectDir, entryPath) {
144982
145327
  return seen;
144983
145328
  }
144984
145329
  function isReached(projectDir, target, reachable) {
144985
- if (isAbsolute13(target)) return false;
145330
+ if (isAbsolute14(target)) return false;
144986
145331
  const abs = resolve51(projectDir, target);
144987
- if (relative21(projectDir, abs).startsWith("..")) return false;
145332
+ if (relative23(projectDir, abs).startsWith("..")) return false;
144988
145333
  return reachable.has(abs);
144989
145334
  }
144990
145335
  function reportableNames(names) {
@@ -145029,7 +145374,7 @@ var init_catalogUsage = __esm({
145029
145374
 
145030
145375
  // src/commands/render/plan.ts
145031
145376
  import { statSync as statSync28 } from "fs";
145032
- import { dirname as dirname42, join as join94, resolve as resolve52 } from "path";
145377
+ import { dirname as dirname43, join as join94, resolve as resolve52 } from "path";
145033
145378
  function formatFpsParseError(input2, reason) {
145034
145379
  switch (reason) {
145035
145380
  case "empty":
@@ -145296,7 +145641,7 @@ function applyRenderEnvironment(plan2) {
145296
145641
  for (const [key2, value] of Object.entries(plan2.environment)) process.env[key2] = value;
145297
145642
  }
145298
145643
  function renderOutputDirectory(plan2) {
145299
- return dirname42(plan2.outputPath);
145644
+ return dirname43(plan2.outputPath);
145300
145645
  }
145301
145646
  function resolveBrowserGpuForCli(useDocker, browserGpuArg, envMode = process.env.PRODUCER_BROWSER_GPU_MODE) {
145302
145647
  if (useDocker) return "software";
@@ -145535,7 +145880,7 @@ __export(batchRender_exports, {
145535
145880
  runBatchRender: () => runBatchRender
145536
145881
  });
145537
145882
  import { mkdirSync as mkdirSync43, readFileSync as readFileSync57, writeFileSync as writeFileSync33 } from "fs";
145538
- import { dirname as dirname43, join as join95, resolve as resolve54, sep as sep12 } from "path";
145883
+ import { dirname as dirname44, join as join95, resolve as resolve54, sep as sep13 } from "path";
145539
145884
  function isRecord10(value) {
145540
145885
  return value !== null && typeof value === "object" && !Array.isArray(value);
145541
145886
  }
@@ -145592,16 +145937,16 @@ function resolveOutputTemplate(template, row, index) {
145592
145937
  );
145593
145938
  }
145594
145939
  function isSameOrChildPath(path2, parent) {
145595
- return path2 === parent || path2.startsWith(parent.endsWith(sep12) ? parent : parent + sep12);
145940
+ return path2 === parent || path2.startsWith(parent.endsWith(sep13) ? parent : parent + sep13);
145596
145941
  }
145597
145942
  function commonOutputDirectory(outputPaths) {
145598
145943
  const firstPath = outputPaths[0];
145599
145944
  if (!firstPath) return resolve54("renders");
145600
- let common = dirname43(firstPath);
145945
+ let common = dirname44(firstPath);
145601
145946
  for (const outputPath of outputPaths.slice(1)) {
145602
- const dir = dirname43(outputPath);
145947
+ const dir = dirname44(outputPath);
145603
145948
  while (!isSameOrChildPath(dir, common)) {
145604
- const parent = dirname43(common);
145949
+ const parent = dirname44(common);
145605
145950
  if (parent === common) return common;
145606
145951
  common = parent;
145607
145952
  }
@@ -145724,7 +146069,7 @@ function summarizeManifest(manifest) {
145724
146069
  }
145725
146070
  function writeManifest(manifest) {
145726
146071
  summarizeManifest(manifest);
145727
- mkdirSync43(dirname43(manifest.manifestPath), { recursive: true });
146072
+ mkdirSync43(dirname44(manifest.manifestPath), { recursive: true });
145728
146073
  writeFileSync33(manifest.manifestPath, JSON.stringify(manifest, null, 2) + "\n", "utf8");
145729
146074
  }
145730
146075
  async function renderBatchRow(row, manifest, options) {
@@ -145739,7 +146084,7 @@ async function renderBatchRow(row, manifest, options) {
145739
146084
  console.log(c.dim(`Batch row ${row.index}: ${row.outputPath}`));
145740
146085
  }
145741
146086
  try {
145742
- mkdirSync43(dirname43(row.outputPath), { recursive: true });
146087
+ mkdirSync43(dirname44(row.outputPath), { recursive: true });
145743
146088
  const result = await options.renderOne(row);
145744
146089
  manifestRow.status = "completed";
145745
146090
  manifestRow.durationMs = result.durationMs ?? null;
@@ -146480,7 +146825,7 @@ __export(render_exports, {
146480
146825
  });
146481
146826
  import { mkdtempSync as mkdtempSync18, readdirSync as readdirSync29, readFileSync as readFileSync59, statSync as statSync29, writeFileSync as writeFileSync34, rmSync as rmSync30 } from "fs";
146482
146827
  import { freemem as freemem5, tmpdir as tmpdir13 } from "os";
146483
- import { resolve as resolve55, dirname as dirname44, join as join96, basename as basename16 } from "path";
146828
+ import { resolve as resolve55, dirname as dirname45, join as join96, basename as basename16 } from "path";
146484
146829
  import { execFileSync as execFileSync12, spawn as spawn15 } from "child_process";
146485
146830
  async function readCompositionDimensions(compositionHtml) {
146486
146831
  try {
@@ -146614,7 +146959,7 @@ async function renderDocker(projectDir, outputPath, options) {
146614
146959
  );
146615
146960
  failCommand();
146616
146961
  }
146617
- const outputDir = dirname44(outputPath);
146962
+ const outputDir = dirname45(outputPath);
146618
146963
  const outputFilename = basename16(outputPath);
146619
146964
  const dockerArgs = buildDockerRunArgs({
146620
146965
  imageTag,
@@ -146705,7 +147050,7 @@ async function renderLocal(projectDir, outputPath, options) {
146705
147050
  }
146706
147051
  const preflight = await runEnvironmentChecks({
146707
147052
  projectDir,
146708
- diskPaths: [tmpdir13(), dirname44(outputPath)],
147053
+ diskPaths: [tmpdir13(), dirname45(outputPath)],
146709
147054
  browserPath: options.browserPath,
146710
147055
  includeBrowser: true,
146711
147056
  includeDisk: true,
@@ -147761,8 +148106,8 @@ __export(staticProjectServer_exports, {
147761
148106
  serveStaticProjectHtml: () => serveStaticProjectHtml
147762
148107
  });
147763
148108
  import { createServer as createServer2 } from "http";
147764
- import { createReadStream as createReadStream7, existsSync as existsSync84, statSync as statSync30 } from "fs";
147765
- import { isAbsolute as isAbsolute14, relative as relative23, resolve as resolve56 } from "path";
148109
+ import { createReadStream as createReadStream8, existsSync as existsSync84, statSync as statSync30 } from "fs";
148110
+ import { isAbsolute as isAbsolute15, relative as relative24, resolve as resolve56 } from "path";
147766
148111
  function serveFileWithRange(filePath, rangeHeader, res, contentType = getMimeType(filePath)) {
147767
148112
  const size = statSync30(filePath).size;
147768
148113
  const headers = {
@@ -147787,7 +148132,7 @@ function serveFileWithRange(filePath, rangeHeader, res, contentType = getMimeTyp
147787
148132
  headers["Content-Range"] = `bytes ${start}-${end}/${size}`;
147788
148133
  }
147789
148134
  headers["Content-Length"] = String(end - start + 1);
147790
- const stream = createReadStream7(filePath, { start, end });
148135
+ const stream = createReadStream8(filePath, { start, end });
147791
148136
  stream.on("open", () => {
147792
148137
  res.writeHead(status, headers);
147793
148138
  stream.pipe(res);
@@ -147863,8 +148208,8 @@ async function serveStaticProjectHtml(projectDir, html, bindErrorMessage = "Fail
147863
148208
  const requestPath = decodeURIComponent(pathOnly).replace(/^\//, "");
147864
148209
  for (const root of roots) {
147865
148210
  const filePath = resolve56(root, requestPath);
147866
- const rel = relative23(root, filePath);
147867
- if (rel.startsWith("..") || isAbsolute14(rel)) continue;
148211
+ const rel = relative24(root, filePath);
148212
+ if (rel.startsWith("..") || isAbsolute15(rel)) continue;
147868
148213
  if (existsSync84(filePath)) {
147869
148214
  if (proxyRequest) {
147870
148215
  void serveProxyRequest(
@@ -147981,23 +148326,49 @@ function collapseStaticLayoutIssues(issues, totalSampleCount) {
147981
148326
  issue,
147982
148327
  firstSeen: issue.time,
147983
148328
  lastSeen: issue.time,
147984
- occurrences: 1
148329
+ occurrences: 1,
148330
+ times: [issue.time]
147985
148331
  });
147986
148332
  continue;
147987
148333
  }
147988
148334
  existing.firstSeen = Math.min(existing.firstSeen, issue.time);
147989
148335
  existing.lastSeen = Math.max(existing.lastSeen, issue.time);
147990
148336
  existing.occurrences += 1;
148337
+ existing.times.push(issue.time);
147991
148338
  }
147992
148339
  const sampleCount = totalSampleCount ?? new Set(issues.map((issue) => issue.time)).size;
147993
148340
  const multiSampleRun = sampleCount > 1;
147994
148341
  return [...groups.values()].map(
147995
- ({ issue, firstSeen, lastSeen, occurrences }) => applyPersistenceTier(
147996
- { ...issue, time: firstSeen, firstSeen, lastSeen, occurrences },
148342
+ ({ issue, firstSeen, lastSeen, occurrences, times }) => applyPersistenceTier(
148343
+ {
148344
+ ...issue,
148345
+ time: firstSeen,
148346
+ firstSeen,
148347
+ lastSeen,
148348
+ occurrences,
148349
+ heldMs: longestContiguousRunMs(times)
148350
+ },
147997
148351
  multiSampleRun
147998
148352
  )
147999
148353
  );
148000
148354
  }
148355
+ function longestContiguousRunMs(times) {
148356
+ const sorted = [...new Set(times)].sort((a, b2) => a - b2);
148357
+ const first = sorted[0];
148358
+ const last = sorted.at(-1);
148359
+ if (first === void 0 || last === void 0) return 0;
148360
+ let longest = 0;
148361
+ let runStart = first;
148362
+ let previous = first;
148363
+ for (const current2 of sorted) {
148364
+ if ((current2 - previous) * 1e3 > CONTIGUOUS_SAMPLE_GAP_MS) {
148365
+ longest = Math.max(longest, previous - runStart);
148366
+ runStart = current2;
148367
+ }
148368
+ previous = current2;
148369
+ }
148370
+ return Math.max(longest, last - runStart) * 1e3;
148371
+ }
148001
148372
  function applyPersistenceTier(issue, multiSampleRun) {
148002
148373
  if (!multiSampleRun) return issue;
148003
148374
  if (!PERSISTENCE_TIERED_CODES.has(issue.code)) return issue;
@@ -148030,7 +148401,7 @@ function isContentOverlapHeldLongEnough(issue, occurrences) {
148030
148401
  if (occurrences < HELD_ACROSS_SAMPLES_MIN_OCCURRENCES) return false;
148031
148402
  const firstSeen = issue.firstSeen ?? issue.time;
148032
148403
  const lastSeen = issue.lastSeen ?? issue.time;
148033
- const heldMs = (lastSeen - firstSeen) * 1e3;
148404
+ const heldMs = issue.heldMs ?? (lastSeen - firstSeen) * 1e3;
148034
148405
  return heldMs >= CONTENT_OVERLAP_HELD_ERROR_MS;
148035
148406
  }
148036
148407
  function limitLayoutIssues(issues, maxIssues) {
@@ -148057,7 +148428,7 @@ function staticIssueKey(issue) {
148057
148428
  issue.severity,
148058
148429
  issue.selector,
148059
148430
  issue.containerSelector ?? "",
148060
- issue.text ?? "",
148431
+ TEXT_AGNOSTIC_KEY_CODES.has(issue.code) ? "" : issue.text ?? "",
148061
148432
  issue.overflow ? formatOverflow(issue.overflow) : "",
148062
148433
  framePositionKey(issue)
148063
148434
  ].join("|");
@@ -148118,7 +148489,7 @@ function formatNumber(value) {
148118
148489
  function roundTime(value) {
148119
148490
  return Math.round(value * 1e3) / 1e3;
148120
148491
  }
148121
- var CONTENT_OVERLAP_HELD_ERROR_MS, HELD_ACROSS_SAMPLES_MIN_OCCURRENCES, PERSISTENCE_TIERED_CODES;
148492
+ var CONTENT_OVERLAP_HELD_ERROR_MS, HELD_ACROSS_SAMPLES_MIN_OCCURRENCES, PERSISTENCE_TIERED_CODES, CONTIGUOUS_SAMPLE_GAP_MS, TEXT_AGNOSTIC_KEY_CODES;
148122
148493
  var init_layoutAudit = __esm({
148123
148494
  "src/utils/layoutAudit.ts"() {
148124
148495
  "use strict";
@@ -148135,6 +148506,11 @@ var init_layoutAudit = __esm({
148135
148506
  "panel_out_of_canvas",
148136
148507
  "connector_detached"
148137
148508
  ]);
148509
+ CONTIGUOUS_SAMPLE_GAP_MS = CONTENT_OVERLAP_HELD_ERROR_MS * 2;
148510
+ TEXT_AGNOSTIC_KEY_CODES = /* @__PURE__ */ new Set([
148511
+ "content_overlap",
148512
+ "text_occluded"
148513
+ ]);
148138
148514
  }
148139
148515
  });
148140
148516
 
@@ -148145,7 +148521,7 @@ function ambiguousIssue(selector) {
148145
148521
  severity: "error",
148146
148522
  time: 0,
148147
148523
  selector,
148148
- message: `${selector} matches multiple elements \u2014 use a more specific selector so the assertion targets exactly one`,
148524
+ message: `${selector} matches multiple elements \u2014 use a more specific selector so the assertion targets exactly one.`,
148149
148525
  rect: ZERO_RECT,
148150
148526
  fixHint: "Use #id or :nth-child() instead of a class selector when multiple elements share the same class."
148151
148527
  };
@@ -148297,23 +148673,29 @@ function evaluateMotion(frames, assertions, canvas) {
148297
148673
  }
148298
148674
  });
148299
148675
  }
148676
+ function assertionTargets(assertion) {
148677
+ switch (assertion.kind) {
148678
+ case "appearsBy":
148679
+ case "staysInFrame":
148680
+ return { selectors: [assertion.selector], scopes: [] };
148681
+ case "before":
148682
+ return { selectors: [assertion.a, assertion.b], scopes: [] };
148683
+ case "keepsMoving":
148684
+ return { selectors: [], scopes: [assertion.withinSelector ?? "*"] };
148685
+ default: {
148686
+ const exhaustive = assertion;
148687
+ void exhaustive;
148688
+ return { selectors: [], scopes: [] };
148689
+ }
148690
+ }
148691
+ }
148300
148692
  function collectSamplingTargets(assertions) {
148301
148693
  const selectors = /* @__PURE__ */ new Set();
148302
148694
  const scopes = /* @__PURE__ */ new Set();
148303
148695
  for (const assertion of assertions) {
148304
- switch (assertion.kind) {
148305
- case "appearsBy":
148306
- case "staysInFrame":
148307
- selectors.add(assertion.selector);
148308
- break;
148309
- case "before":
148310
- selectors.add(assertion.a);
148311
- selectors.add(assertion.b);
148312
- break;
148313
- case "keepsMoving":
148314
- scopes.add(assertion.withinSelector ?? "*");
148315
- break;
148316
- }
148696
+ const targets = assertionTargets(assertion);
148697
+ for (const selector of targets.selectors) selectors.add(selector);
148698
+ for (const scope of targets.scopes) scopes.add(scope);
148317
148699
  }
148318
148700
  return { selectors: [...selectors], livenessScopes: [...scopes] };
148319
148701
  }
@@ -148445,7 +148827,7 @@ __export(layout_exports, {
148445
148827
  parseAt: () => parseAt
148446
148828
  });
148447
148829
  import { existsSync as existsSync86, readFileSync as readFileSync63 } from "fs";
148448
- import { dirname as dirname45, join as join99 } from "path";
148830
+ import { dirname as dirname46, join as join99 } from "path";
148449
148831
  import { fileURLToPath as fileURLToPath11 } from "url";
148450
148832
  function buildMotionSampleTimes(duration) {
148451
148833
  if (!Number.isFinite(duration) || duration <= 0) return [];
@@ -148909,7 +149291,7 @@ var init_layout2 = __esm({
148909
149291
  init_motionSpec();
148910
149292
  init_captureCompositionFrame();
148911
149293
  __filename = fileURLToPath11(import.meta.url);
148912
- __dirname2 = dirname45(__filename);
149294
+ __dirname2 = dirname46(__filename);
148913
149295
  LAYOUT_SEEK_OPTIONS = AUDIT_SEEK_OPTIONS;
148914
149296
  INSPECT_SCHEMA_VERSION = 1;
148915
149297
  MOTION_FPS = 20;
@@ -149004,7 +149386,7 @@ __export(validate_exports, {
149004
149386
  });
149005
149387
  import { existsSync as existsSync87, mkdtempSync as mkdtempSync19, readFileSync as readFileSync64, rmSync as rmSync31 } from "fs";
149006
149388
  import { tmpdir as tmpdir14 } from "os";
149007
- import { join as join100, dirname as dirname46 } from "path";
149389
+ import { join as join100, dirname as dirname47 } from "path";
149008
149390
  import { fileURLToPath as fileURLToPath12 } from "url";
149009
149391
  function resolveNavigationTimeoutMs(optTimeout) {
149010
149392
  return Math.max(NAV_TIMEOUT_FLOOR_MS, optTimeout ?? 0);
@@ -149376,7 +149758,7 @@ var init_validate = __esm({
149376
149758
  init_updateCheck();
149377
149759
  init_captureCompositionFrame();
149378
149760
  __filename2 = fileURLToPath12(import.meta.url);
149379
- __dirname3 = dirname46(__filename2);
149761
+ __dirname3 = dirname47(__filename2);
149380
149762
  CONTRAST_SAMPLES = 5;
149381
149763
  SEEK_SETTLE_MS = 150;
149382
149764
  PREFERRED_SEEK_TARGET_WAIT_MS2 = 500;
@@ -150420,7 +150802,7 @@ var init_checkBrowser = __esm({
150420
150802
 
150421
150803
  // src/utils/checkPipeline.ts
150422
150804
  import { mkdirSync as mkdirSync47, writeFileSync as writeFileSync37 } from "fs";
150423
- import { join as join103, relative as relative24 } from "path";
150805
+ import { join as join103, relative as relative25 } from "path";
150424
150806
  function selectContrastTimes(grid) {
150425
150807
  if (grid.length <= 5) return [...grid];
150426
150808
  return Array.from({ length: 5 }, (_, index) => {
@@ -150470,12 +150852,27 @@ async function buildSampleGrid(driver, options) {
150470
150852
  }
150471
150853
  async function planMotionSampling(driver, motion, duration) {
150472
150854
  if (motion.kind !== "valid") {
150473
- return { times: [], selectors: [], livenessScopes: [], preflightIssues: [] };
150855
+ return { times: [], selectors: [], livenessScopes: [], preflightIssues: [], assertions: [] };
150856
+ }
150857
+ const preflightIssues = await driver.findAmbiguousSelectors(
150858
+ collectSamplingTargets(motion.spec.assertions).selectors
150859
+ );
150860
+ const ambiguous = new Set(preflightIssues.map((issue) => issue.selector));
150861
+ const assertions = motion.spec.assertions.filter(
150862
+ (assertion) => !assertionTargets(assertion).selectors.some((selector) => ambiguous.has(selector))
150863
+ );
150864
+ noteSkippedAssertions(preflightIssues, motion.spec.assertions);
150865
+ const targets = collectSamplingTargets(assertions);
150866
+ const times = assertions.length > 0 ? buildMotionSampleTimes2(motion.spec.duration ?? duration) : [];
150867
+ return { times, ...targets, preflightIssues, assertions };
150868
+ }
150869
+ function noteSkippedAssertions(issues, assertions) {
150870
+ for (const issue of issues) {
150871
+ const skipped = assertions.filter(
150872
+ (assertion) => assertionTargets(assertion).selectors.includes(issue.selector)
150873
+ ).length;
150874
+ if (skipped > 0) issue.message += ` ${skipped} assertion(s) naming it were not evaluated.`;
150474
150875
  }
150475
- const targets = collectSamplingTargets(motion.spec.assertions);
150476
- const preflightIssues = await driver.findAmbiguousSelectors(targets.selectors);
150477
- const times = preflightIssues.length === 0 ? buildMotionSampleTimes2(motion.spec.duration ?? duration) : [];
150478
- return { times, ...targets, preflightIssues };
150479
150876
  }
150480
150877
  function geometryRequest(time, grid, options) {
150481
150878
  const text2 = grid.captionSamples.includes(time);
@@ -151008,13 +151405,13 @@ async function runAuditGrid(driver, options, motion) {
151008
151405
  const collected = await collectGridSamples(driver, options, grid, plan2);
151009
151406
  const seekLoopMs = Date.now() - seekLoopStart;
151010
151407
  let motionIssues = plan2.preflightIssues;
151011
- if (motion.kind === "valid" && motionIssues.length === 0 && collected.motionFrames.length > 0) {
151408
+ if (motion.kind === "valid" && plan2.assertions.length > 0 && collected.motionFrames.length > 0) {
151012
151409
  const evaluated = evaluateMotion(
151013
151410
  collected.motionFrames,
151014
- motion.spec.assertions,
151411
+ plan2.assertions,
151015
151412
  await driver.getCanvas()
151016
151413
  );
151017
- motionIssues = await driver.anchorMotionIssues(evaluated);
151414
+ motionIssues = [...motionIssues, ...await driver.anchorMotionIssues(evaluated)];
151018
151415
  }
151019
151416
  const sweepFindings = detectSweepStatic(
151020
151417
  grid.duration,
@@ -151068,15 +151465,14 @@ async function runCheckPipeline(project, options, dependencies = DEFAULT_DEPENDE
151068
151465
  return buildReport(options, lint, emptyBrowserResult(), { kind: "none" }, [], []);
151069
151466
  }
151070
151467
  const motion = dependencies.resolveMotionSpec(project.dir);
151071
- if (motion.kind === "invalid") {
151072
- const finding = findingAtRoot(
151468
+ const specFindings = motion.kind === "invalid" ? [
151469
+ findingAtRoot(
151073
151470
  "motion_spec_invalid",
151074
151471
  "error",
151075
151472
  motion.message,
151076
- relative24(project.dir, motion.path) || "index.motion.json"
151077
- );
151078
- return buildReport(options, lint, emptyBrowserResult(), motion, [finding], []);
151079
- }
151473
+ relative25(project.dir, motion.path) || "index.motion.json"
151474
+ )
151475
+ ] : [];
151080
151476
  let browser;
151081
151477
  try {
151082
151478
  browser = await dependencies.runBrowserCheck(project, options, motion);
@@ -151085,7 +151481,7 @@ async function runCheckPipeline(project, options, dependencies = DEFAULT_DEPENDE
151085
151481
  browser.runtimeFindings.push(runtimeFailure(error));
151086
151482
  }
151087
151483
  const snapshotFiles = options.snapshots ? await writeContrastSnapshots(dependencies, project.dir, browser) : [];
151088
- const report2 = buildReport(options, lint, browser, motion, [], snapshotFiles);
151484
+ const report2 = buildReport(options, lint, browser, motion, specFindings, snapshotFiles);
151089
151485
  return options.snapshots ? await withFindingCrops(dependencies, project, options, report2) : report2;
151090
151486
  }
151091
151487
  async function writeContrastSnapshots(dependencies, projectDir, browser) {
@@ -151980,10 +152376,10 @@ var init_beats = __esm({
151980
152376
  // src/beats/headlessAnalyzer.ts
151981
152377
  import { existsSync as existsSync88, readFileSync as readFileSync65 } from "fs";
151982
152378
  import { createRequire as createRequire4 } from "module";
151983
- import { dirname as dirname47, join as join104 } from "path";
152379
+ import { dirname as dirname48, join as join104 } from "path";
151984
152380
  import { fileURLToPath as fileURLToPath13 } from "url";
151985
152381
  function findPrebuiltBundle() {
151986
- const here = dirname47(fileURLToPath13(import.meta.url));
152382
+ const here = dirname48(fileURLToPath13(import.meta.url));
151987
152383
  const candidates = [
151988
152384
  join104(here, "beat-analyzer.global.js"),
151989
152385
  // dist root (tsup-bundled cli)
@@ -151998,7 +152394,7 @@ function findPrebuiltBundle() {
151998
152394
  }
151999
152395
  async function buildFromCoreSource() {
152000
152396
  const esbuild = await import("esbuild");
152001
- const coreRoot = dirname47(require2.resolve("@hyperframes/core/package.json"));
152397
+ const coreRoot = dirname48(require2.resolve("@hyperframes/core/package.json"));
152002
152398
  const entry = join104(coreRoot, "src/beats/beatDetection.ts");
152003
152399
  const result = await esbuild.build({
152004
152400
  stdin: {
@@ -152100,7 +152496,7 @@ __export(beats_exports, {
152100
152496
  examples: () => examples13
152101
152497
  });
152102
152498
  import { existsSync as existsSync89, readFileSync as readFileSync66, mkdirSync as mkdirSync48, writeFileSync as writeFileSync38 } from "fs";
152103
- import { resolve as resolve58, join as join105, dirname as dirname48 } from "path";
152499
+ import { resolve as resolve58, join as join105, dirname as dirname49 } from "path";
152104
152500
  function fail(message) {
152105
152501
  console.error(c.error(message));
152106
152502
  failCommand();
@@ -152172,7 +152568,7 @@ var init_beats2 = __esm({
152172
152568
  fail(`No beats detected in ${rel} \u2014 nothing written. (Track may be silent/ambient.)`);
152173
152569
  }
152174
152570
  const outPath = join105(project.dir, "beats", `${rel}.json`);
152175
- mkdirSync48(dirname48(outPath), { recursive: true });
152571
+ mkdirSync48(dirname49(outPath), { recursive: true });
152176
152572
  writeFileSync38(outPath, serializeBeats(result.beatTimes, result.beatStrengths, rel));
152177
152573
  report(`beats/${rel}.json`, result, Boolean(args.json));
152178
152574
  }
@@ -152194,7 +152590,7 @@ __export(normalize_audio_exports, {
152194
152590
  });
152195
152591
  import { execFile as execFile8 } from "child_process";
152196
152592
  import { existsSync as existsSync90, readFileSync as readFileSync67, renameSync as renameSync16, writeFileSync as writeFileSync39 } from "fs";
152197
- import { isAbsolute as isAbsolute15, relative as relative25, resolve as resolve59 } from "path";
152593
+ import { isAbsolute as isAbsolute16, relative as relative26, resolve as resolve59 } from "path";
152198
152594
  import { promisify as promisify7 } from "util";
152199
152595
  function authoredNumber(raw, fallback, attribute2, id, strictlyPositive = false) {
152200
152596
  if (raw === void 0) return fallback;
@@ -152357,12 +152753,12 @@ function resolveLocalAudioPath(projectDir, src) {
152357
152753
  } catch {
152358
152754
  throw new Error(`Audio source must be a local project file: ${src}`);
152359
152755
  }
152360
- if (!decoded || isAbsolute15(decoded) || /^(?:[a-z][a-z\d+.-]*:|\/\/)/i.test(decoded)) {
152756
+ if (!decoded || isAbsolute16(decoded) || /^(?:[a-z][a-z\d+.-]*:|\/\/)/i.test(decoded)) {
152361
152757
  throw new Error(`Audio source must be a local project file: ${src}`);
152362
152758
  }
152363
152759
  const root = resolve59(projectDir);
152364
152760
  const file = resolve59(root, decoded);
152365
- const rel = relative25(root, file);
152761
+ const rel = relative26(root, file);
152366
152762
  if (!rel || rel === ".." || rel.startsWith(`..${process.platform === "win32" ? "\\" : "/"}`)) {
152367
152763
  throw new Error(`Audio source must be a local project file: ${src}`);
152368
152764
  }
@@ -152479,7 +152875,7 @@ function requiredFfmpeg() {
152479
152875
  function existingAudioFile(projectDir, tag) {
152480
152876
  const file = resolveLocalAudioPath(projectDir, tag.src);
152481
152877
  if (!existsSync90(file)) {
152482
- throw new Error(`Audio #${tag.id} file was not found: ${relative25(projectDir, file)}`);
152878
+ throw new Error(`Audio #${tag.id} file was not found: ${relative26(projectDir, file)}`);
152483
152879
  }
152484
152880
  return file;
152485
152881
  }
@@ -152538,7 +152934,7 @@ function printHumanResult(result) {
152538
152934
  `Set #${result.targetId} data-volume ${result.previousVolume.toFixed(3)} \u2192 ${result.volume.toFixed(6)} (${result.changeDb >= 0 ? "+" : ""}${result.changeDb.toFixed(1)} dB).`
152539
152935
  );
152540
152936
  console.log(
152541
- result.wrote ? c.success(`Updated ${relative25(process.cwd(), result.indexPath) || "index.html"}.`) : c.dim("Dry run only. Pass --write to persist this gain.")
152937
+ result.wrote ? c.success(`Updated ${relative26(process.cwd(), result.indexPath) || "index.html"}.`) : c.dim("Dry run only. Pass --write to persist this gain.")
152542
152938
  );
152543
152939
  }
152544
152940
  var execFileAsync4, FFMPEG_TIMEOUT_MS, DEFAULT_TOLERANCE_LU, examples14, normalize_audio_default;
@@ -154597,7 +154993,7 @@ __export(motionShot_exports, {
154597
154993
  seekAllAdaptersInBrowser: () => seekAllAdaptersInBrowser
154598
154994
  });
154599
154995
  import { mkdirSync as mkdirSync49, statSync as statSync31, writeFileSync as writeFileSync40 } from "fs";
154600
- import { dirname as dirname49, resolve as resolve60 } from "path";
154996
+ import { dirname as dirname50, resolve as resolve60 } from "path";
154601
154997
  function pathsReferToSameFile(firstPath, secondPath) {
154602
154998
  const first = resolve60(firstPath);
154603
154999
  const second = resolve60(secondPath);
@@ -154616,7 +155012,7 @@ function ensureShotOutputDir(outPath, sourcePath) {
154616
155012
  `--shot output must not overwrite the composition source: ${sourcePath}. Choose a separate .png path.`
154617
155013
  );
154618
155014
  }
154619
- mkdirSync49(dirname49(outPath), { recursive: true });
155015
+ mkdirSync49(dirname50(outPath), { recursive: true });
154620
155016
  }
154621
155017
  async function sampleMarkerOnionElements(selectors, ts) {
154622
155018
  const seek = window.__hfSeekAllAdapters;
@@ -155165,7 +155561,7 @@ __export(keyframes_exports, {
155165
155561
  surfaceComposition: () => surfaceComposition
155166
155562
  });
155167
155563
  import { existsSync as existsSync91, readFileSync as readFileSync68, statSync as statSync33 } from "fs";
155168
- import { resolve as resolve61, dirname as dirname50, basename as basename18, join as join106, relative as relative26, sep as sep13 } from "path";
155564
+ import { resolve as resolve61, dirname as dirname51, basename as basename18, join as join106, relative as relative27, sep as sep14 } from "path";
155169
155565
  function queryIncludingTemplates(html, selector) {
155170
155566
  const doc = new DOMParser().parseFromString(html, "text/html");
155171
155567
  const roots = [doc];
@@ -155381,11 +155777,11 @@ function animationNamesFromDeclarations(body, knownNames) {
155381
155777
  addAnimationShorthandNames(body, knownNames, out);
155382
155778
  return [...out];
155383
155779
  }
155384
- function stripCssComments2(css) {
155780
+ function stripCssComments3(css) {
155385
155781
  return css.replace(/\/\*[\s\S]*?\*\//g, " ");
155386
155782
  }
155387
155783
  function surfaceCssKeyframes(rawCss) {
155388
- const css = stripCssComments2(rawCss);
155784
+ const css = stripCssComments3(rawCss);
155389
155785
  if (!css.trim()) return [];
155390
155786
  const { keyframes, ranges } = collectKeyframeBlocks(css);
155391
155787
  if (keyframes.length === 0) return [];
@@ -155527,7 +155923,7 @@ function groupTraces(tweens) {
155527
155923
  }
155528
155924
  function collectCompositions(indexPath2) {
155529
155925
  const html = readFileSync68(indexPath2, "utf-8");
155530
- const baseDir = dirname50(indexPath2);
155926
+ const baseDir = dirname51(indexPath2);
155531
155927
  const out = [
155532
155928
  surfaceComposition(html, basename18(indexPath2), basename18(indexPath2))
155533
155929
  ];
@@ -155660,7 +156056,7 @@ function resolveScope(args) {
155660
156056
  comps = [surfaceComposition(readFileSync68(entryPath, "utf-8"), basename18(entryPath), entryPath)];
155661
156057
  projectName = basename18(entryPath);
155662
156058
  projectDir = findProjectRoot(entryPath);
155663
- entryFile = relative26(projectDir, entryPath).split(sep13).join("/");
156059
+ entryFile = relative27(projectDir, entryPath).split(sep14).join("/");
155664
156060
  } else {
155665
156061
  const project = resolveProject(raw);
155666
156062
  comps = collectCompositions(project.indexPath);
@@ -155684,12 +156080,12 @@ function resolveScope(args) {
155684
156080
  return { comps, allComps, projectName, projectDir, entryFile };
155685
156081
  }
155686
156082
  function findProjectRoot(entryPath) {
155687
- const entryDir = dirname50(entryPath);
156083
+ const entryDir = dirname51(entryPath);
155688
156084
  let candidate = entryDir;
155689
156085
  for (; ; ) {
155690
156086
  if (existsSync91(join106(candidate, "index.html"))) return candidate;
155691
156087
  if (existsSync91(join106(candidate, ".git"))) return entryDir;
155692
- const parent = dirname50(candidate);
156088
+ const parent = dirname51(candidate);
155693
156089
  if (parent === candidate) return entryDir;
155694
156090
  candidate = parent;
155695
156091
  }
@@ -155986,7 +156382,7 @@ __export(compositions_exports, {
155986
156382
  parseSubComposition: () => parseSubComposition
155987
156383
  });
155988
156384
  import { existsSync as existsSync93, readFileSync as readFileSync70 } from "fs";
155989
- import { resolve as resolve62, dirname as dirname51 } from "path";
156385
+ import { resolve as resolve62, dirname as dirname52 } from "path";
155990
156386
  function countRenderableDescendants(root) {
155991
156387
  return Array.from(root.querySelectorAll("*")).filter(
155992
156388
  (el) => !NON_RENDERED_TAGS2.has(el.tagName.toLowerCase())
@@ -156174,7 +156570,7 @@ var init_compositions = __esm({
156174
156570
  const project = resolveProject(args.dir);
156175
156571
  const html = readFileSync70(project.indexPath, "utf-8");
156176
156572
  ensureDOMParser();
156177
- const compositions = parseCompositions(html, dirname51(project.indexPath));
156573
+ const compositions = parseCompositions(html, dirname52(project.indexPath));
156178
156574
  if (args.json) {
156179
156575
  console.log(JSON.stringify(withMeta({ compositions }), null, 2));
156180
156576
  return;
@@ -156892,7 +157288,7 @@ __export(transcribe_exports2, {
156892
157288
  examples: () => examples22
156893
157289
  });
156894
157290
  import { existsSync as existsSync97, writeFileSync as writeFileSync43 } from "fs";
156895
- import { resolve as resolve65, join as join110, extname as extname17, dirname as dirname52 } from "path";
157291
+ import { resolve as resolve65, join as join110, extname as extname17, dirname as dirname53 } from "path";
156896
157292
  function parseTimeoutMs(raw, json) {
156897
157293
  const source = raw ?? process.env["HYPERFRAMES_TRANSCRIBE_TIMEOUT_MS"];
156898
157294
  if (source == null || source === "") return void 0;
@@ -157136,7 +157532,7 @@ var init_transcribe2 = __esm({
157136
157532
  console.error(c.error(message));
157137
157533
  failCommand();
157138
157534
  }
157139
- const dir = resolve65(args.dir ?? dirname52(inputPath));
157535
+ const dir = resolve65(args.dir ?? dirname53(inputPath));
157140
157536
  const ext = extname17(inputPath).toLowerCase();
157141
157537
  const isImport = ext === ".json" || ext === ".srt" || ext === ".vtt";
157142
157538
  const to = parseExportFormat(args.to, args.json);
@@ -157342,7 +157738,7 @@ __export(synthesize_exports, {
157342
157738
  });
157343
157739
  import { execFileSync as execFileSync15 } from "child_process";
157344
157740
  import { existsSync as existsSync99, mkdirSync as mkdirSync51, readdirSync as readdirSync33, unlinkSync as unlinkSync9 } from "fs";
157345
- import { join as join113, dirname as dirname53, basename as basename20 } from "path";
157741
+ import { join as join113, dirname as dirname54, basename as basename20 } from "path";
157346
157742
  import { homedir as homedir22 } from "os";
157347
157743
  function ensureSynthScript() {
157348
157744
  if (!existsSync99(SCRIPT_PATH)) {
@@ -157387,7 +157783,7 @@ async function synthesize(text2, outputPath, options) {
157387
157783
  ensureVoices({ onProgress: options?.onProgress })
157388
157784
  ]);
157389
157785
  const scriptPath = ensureSynthScript();
157390
- mkdirSync51(dirname53(outputPath), { recursive: true });
157786
+ mkdirSync51(dirname54(outputPath), { recursive: true });
157391
157787
  options?.onProgress?.(`Generating speech with voice ${voice} (${lang})...`);
157392
157788
  try {
157393
157789
  const espeakLang = ESPEAK_LANG_OVERRIDES[lang] ?? lang;
@@ -157723,11 +158119,11 @@ __export(docs_exports, {
157723
158119
  examples: () => examples24
157724
158120
  });
157725
158121
  import { readFileSync as readFileSync74, existsSync as existsSync101 } from "fs";
157726
- import { resolve as resolve67, dirname as dirname54, join as join114 } from "path";
158122
+ import { resolve as resolve67, dirname as dirname55, join as join114 } from "path";
157727
158123
  import { fileURLToPath as fileURLToPath14 } from "url";
157728
158124
  function docsDir() {
157729
158125
  const thisFile = fileURLToPath14(import.meta.url);
157730
- const dir = dirname54(thisFile);
158126
+ const dir = dirname55(thisFile);
157731
158127
  const devPath = resolve67(dir, "..", "docs");
157732
158128
  const builtPath = resolve67(dir, "docs");
157733
158129
  return existsSync101(devPath) ? devPath : builtPath;
@@ -157909,7 +158305,7 @@ __export(doctor_exports, {
157909
158305
  import { execFileSync as execFileSync16, execSync as execSync5 } from "child_process";
157910
158306
  import { existsSync as existsSync103 } from "fs";
157911
158307
  import { platform as platform10 } from "os";
157912
- import { dirname as dirname55 } from "path";
158308
+ import { dirname as dirname56 } from "path";
157913
158309
  function checkDocker() {
157914
158310
  try {
157915
158311
  const version2 = execSync5("docker --version", { encoding: "utf-8", timeout: 5e3 }).trim();
@@ -158029,7 +158425,7 @@ function firstExistingAncestor(path2, fileExists) {
158029
158425
  let current2 = path2;
158030
158426
  for (let i2 = 0; i2 < 64; i2 += 1) {
158031
158427
  if (fileExists(current2)) return current2;
158032
- const parent = dirname55(current2);
158428
+ const parent = dirname56(current2);
158033
158429
  if (parent === current2) return null;
158034
158430
  current2 = parent;
158035
158431
  }
@@ -159016,7 +159412,7 @@ __export(contactSheet_exports, {
159016
159412
  });
159017
159413
  import sharp from "sharp";
159018
159414
  import { readdirSync as readdirSync35, readFileSync as readFileSync76, writeFileSync as writeFileSync45, unlinkSync as unlinkSync10, existsSync as existsSync105 } from "fs";
159019
- import { join as join115, extname as extname19, basename as basename21, dirname as dirname56 } from "path";
159415
+ import { join as join115, extname as extname19, basename as basename21, dirname as dirname57 } from "path";
159020
159416
  async function createContactSheet(imagePaths, outputPath, opts = {}) {
159021
159417
  const {
159022
159418
  cols = 3,
@@ -159167,7 +159563,7 @@ async function createSvgContactSheet(svgsDir, outputPath, assetsRootDir, budget
159167
159563
  if (svgPaths.length === 0) return [];
159168
159564
  const svgFileNames = svgPaths.map((p2) => p2.split("/").pop());
159169
159565
  const thumbSize = 200;
159170
- const tmpDir = dirname56(outputPath);
159566
+ const tmpDir = dirname57(outputPath);
159171
159567
  const tmpPaths = [];
159172
159568
  const labels = [];
159173
159569
  for (let i2 = 0; i2 < svgPaths.length; i2++) {
@@ -165376,7 +165772,7 @@ var require_node_domexception = __commonJS({
165376
165772
  });
165377
165773
 
165378
165774
  // ../../node_modules/.bun/fetch-blob@3.2.0/node_modules/fetch-blob/from.js
165379
- import { statSync as statSync36, createReadStream as createReadStream8, promises as fs3 } from "fs";
165775
+ import { statSync as statSync36, createReadStream as createReadStream9, promises as fs3 } from "fs";
165380
165776
  import { basename as basename23 } from "path";
165381
165777
  var import_node_domexception, stat, blobFromSync, blobFrom, fileFrom, fileFromSync, fromBlob, fromFile, BlobDataItem;
165382
165778
  var init_from = __esm({
@@ -165428,7 +165824,7 @@ var init_from = __esm({
165428
165824
  if (mtimeMs > this.lastModified) {
165429
165825
  throw new import_node_domexception.default("The requested file could not be read, typically due to permission problems that have occurred after a reference to a file was acquired.", "NotReadableError");
165430
165826
  }
165431
- yield* createReadStream8(this.#path, {
165827
+ yield* createReadStream9(this.#path, {
165432
165828
  start: this.#start,
165433
165829
  end: this.#start + this.size - 1
165434
165830
  });
@@ -179181,7 +179577,7 @@ var require_websocket = __commonJS({
179181
179577
  var net2 = __require("net");
179182
179578
  var tls = __require("tls");
179183
179579
  var { randomBytes: randomBytes3, createHash: createHash26 } = __require("crypto");
179184
- var { Duplex, Readable: Readable5 } = __require("stream");
179580
+ var { Duplex, Readable: Readable6 } = __require("stream");
179185
179581
  var { URL: URL2 } = __require("url");
179186
179582
  var PerMessageDeflate2 = require_permessage_deflate();
179187
179583
  var Receiver2 = require_receiver();
@@ -180594,11 +180990,11 @@ var require_websocket_server = __commonJS({
180594
180990
  });
180595
180991
 
180596
180992
  // ../../node_modules/.bun/ws@8.20.0/node_modules/ws/wrapper.mjs
180597
- var import_stream2, import_extension, import_permessage_deflate, import_receiver, import_sender, import_subprotocol, import_websocket, import_websocket_server;
180993
+ var import_stream3, import_extension, import_permessage_deflate, import_receiver, import_sender, import_subprotocol, import_websocket, import_websocket_server;
180598
180994
  var init_wrapper = __esm({
180599
180995
  "../../node_modules/.bun/ws@8.20.0/node_modules/ws/wrapper.mjs"() {
180600
180996
  "use strict";
180601
- import_stream2 = __toESM(require_stream(), 1);
180997
+ import_stream3 = __toESM(require_stream(), 1);
180602
180998
  import_extension = __toESM(require_extension(), 1);
180603
180999
  import_permessage_deflate = __toESM(require_permessage_deflate(), 1);
180604
181000
  import_receiver = __toESM(require_receiver(), 1);
@@ -180761,7 +181157,7 @@ __export(node_exports, {
180761
181157
  import { createWriteStream as createWriteStream3 } from "fs";
180762
181158
  import * as fs4 from "fs/promises";
180763
181159
  import { writeFile as writeFile3 } from "fs/promises";
180764
- import { Readable as Readable4 } from "stream";
181160
+ import { Readable as Readable5 } from "stream";
180765
181161
  import { finished } from "stream/promises";
180766
181162
  import * as path$1 from "path";
180767
181163
  function setDefaultBaseUrls(baseUrlParams) {
@@ -198267,7 +198663,7 @@ ${underline2}`);
198267
198663
  const response = await downloadFile2(params, apiClient);
198268
198664
  if (response instanceof HttpResponse) {
198269
198665
  const writer = createWriteStream3(params.downloadPath);
198270
- const body = Readable4.fromWeb(response.responseInternal.body);
198666
+ const body = Readable5.fromWeb(response.responseInternal.body);
198271
198667
  body.pipe(writer);
198272
198668
  await finished(writer);
198273
198669
  } else {
@@ -198963,7 +199359,7 @@ __export(snapshot_exports, {
198963
199359
  });
198964
199360
  import { existsSync as existsSync106, mkdtempSync as mkdtempSync21, readFileSync as readFileSync77, mkdirSync as mkdirSync53, rmSync as rmSync34, writeFileSync as writeFileSync46 } from "fs";
198965
199361
  import { tmpdir as tmpdir16 } from "os";
198966
- import { resolve as resolve70, join as join116, relative as relative27, isAbsolute as isAbsolute16, basename as basename25, posix as posix7 } from "path";
199362
+ import { resolve as resolve70, join as join116, relative as relative28, isAbsolute as isAbsolute17, basename as basename25, posix as posix7 } from "path";
198967
199363
  function orbitStageSource() {
198968
199364
  return `function(cam) {
198969
199365
  var root = document.querySelector("[data-composition-id]")
@@ -199217,8 +199613,8 @@ async function captureSnapshots(projectDir, opts) {
199217
199613
  const url = new URL(v2.src);
199218
199614
  const decodedPath = decodeURIComponent(url.pathname).replace(/^\//, "");
199219
199615
  const candidate = resolve70(projectDir, decodedPath);
199220
- const rel2 = relative27(projectDir, candidate);
199221
- if (!rel2.startsWith("..") && !isAbsolute16(rel2) && existsSync106(candidate)) {
199616
+ const rel2 = relative28(projectDir, candidate);
199617
+ if (!rel2.startsWith("..") && !isAbsolute17(rel2) && existsSync106(candidate)) {
199222
199618
  ffmpegInput = candidate;
199223
199619
  inputIsLocal = true;
199224
199620
  } else if (url.protocol === "http:" || url.protocol === "https:") {
@@ -199304,8 +199700,8 @@ async function captureSnapshots(projectDir, opts) {
199304
199700
  });
199305
199701
  }
199306
199702
  }
199307
- const rel = relative27(projectDir, framePath);
199308
- savedPaths.push(rel.startsWith("..") || isAbsolute16(rel) ? framePath : rel);
199703
+ const rel = relative28(projectDir, framePath);
199704
+ savedPaths.push(rel.startsWith("..") || isAbsolute17(rel) ? framePath : rel);
199309
199705
  }
199310
199706
  } finally {
199311
199707
  await chromeBrowser.close();
@@ -199598,22 +199994,22 @@ var init_sourceMutation = __esm({
199598
199994
  });
199599
199995
 
199600
199996
  // src/utils/pathArgs.ts
199601
- import { isAbsolute as isAbsolute17, relative as relative28, resolve as resolve71 } from "path";
199997
+ import { isAbsolute as isAbsolute18, relative as relative29, resolve as resolve71 } from "path";
199602
199998
  function readOptionalString(value) {
199603
199999
  if (typeof value !== "string") return void 0;
199604
200000
  const trimmed = value.trim();
199605
200001
  return trimmed ? trimmed : void 0;
199606
200002
  }
199607
200003
  function resolveFromBase(baseDir, input2) {
199608
- return isAbsolute17(input2) ? input2 : resolve71(baseDir, input2);
200004
+ return isAbsolute18(input2) ? input2 : resolve71(baseDir, input2);
199609
200005
  }
199610
200006
  function displayPathFromBase(baseDir, filePath) {
199611
- const rel = relative28(baseDir, filePath);
199612
- if (rel && !rel.startsWith("..") && !isAbsolute17(rel)) return rel;
200007
+ const rel = relative29(baseDir, filePath);
200008
+ if (rel && !rel.startsWith("..") && !isAbsolute18(rel)) return rel;
199613
200009
  return filePath;
199614
200010
  }
199615
200011
  function displayPathFromInput(baseDir, input2) {
199616
- return isAbsolute17(input2) ? displayPathFromBase(baseDir, input2) : input2;
200012
+ return isAbsolute18(input2) ? displayPathFromBase(baseDir, input2) : input2;
199617
200013
  }
199618
200014
  var init_pathArgs = __esm({
199619
200015
  "src/utils/pathArgs.ts"() {
@@ -199903,7 +200299,7 @@ __export(media_treatment_exports, {
199903
200299
  resolveMediaTreatmentSource: () => resolveMediaTreatmentSource
199904
200300
  });
199905
200301
  import { existsSync as existsSync107, readFileSync as readFileSync78, writeFileSync as writeFileSync47 } from "fs";
199906
- import { join as join117, relative as relative29, resolve as resolve72 } from "path";
200302
+ import { join as join117, relative as relative30, resolve as resolve72 } from "path";
199907
200303
  function getMediaTreatmentCapabilityOverview() {
199908
200304
  const capabilities = getHfColorGradingCapabilities();
199909
200305
  const family = (id, label2, description) => ({
@@ -200351,7 +200747,7 @@ function analyzeTarget(args) {
200351
200747
  selectorIndex
200352
200748
  );
200353
200749
  const source = mediaSourceForElement(element);
200354
- const compositionFile = relative29(project.dir, filePath).split("\\").join("/");
200750
+ const compositionFile = relative30(project.dir, filePath).split("\\").join("/");
200355
200751
  const mediaPath = resolveMediaTreatmentSource(project.dir, compositionFile, source);
200356
200752
  return {
200357
200753
  ok: true,
@@ -200387,7 +200783,7 @@ function prepareMutation(args) {
200387
200783
  payload: {
200388
200784
  ok: true,
200389
200785
  action,
200390
- file: relative29(project.dir, filePath) || "index.html",
200786
+ file: relative30(project.dir, filePath) || "index.html",
200391
200787
  selector,
200392
200788
  selectorIndex: selectorIndex ?? 0,
200393
200789
  tag: result.tag,
@@ -200559,13 +200955,13 @@ import {
200559
200955
  copyFileSync as copyFileSync10,
200560
200956
  existsSync as existsSync108,
200561
200957
  mkdirSync as mkdirSync54,
200562
- mkdtempSync as mkdtempSync22,
200958
+ mkdtempSync as mkdtempSync23,
200563
200959
  readFileSync as readFileSync79,
200564
200960
  rmSync as rmSync35,
200565
200961
  writeFileSync as writeFileSync48
200566
200962
  } from "fs";
200567
200963
  import { tmpdir as tmpdir17 } from "os";
200568
- import { basename as basename27, dirname as dirname57, extname as extname21, join as join118, resolve as resolve73 } from "path";
200964
+ import { basename as basename27, dirname as dirname58, extname as extname21, join as join118, resolve as resolve73 } from "path";
200569
200965
  import sharp2 from "sharp";
200570
200966
  function isRecord14(value) {
200571
200967
  return typeof value === "object" && value !== null && !Array.isArray(value);
@@ -200821,7 +201217,7 @@ function frameFileNameForPath(framePath) {
200821
201217
  return "frame.png";
200822
201218
  }
200823
201219
  async function prepareGradeCompareTempProject(opts) {
200824
- const tempDir = mkdtempSync22(join118(tmpdir17(), "hf-grade-compare-"));
201220
+ const tempDir = mkdtempSync23(join118(tmpdir17(), "hf-grade-compare-"));
200825
201221
  try {
200826
201222
  const frameFileName2 = opts.frameFileName ?? frameFileNameForPath(opts.framePath);
200827
201223
  writeFileSync48(join118(tempDir, frameFileName2), opts.frameBuffer);
@@ -200868,7 +201264,7 @@ function isVideoPath2(filePath) {
200868
201264
  return [".mp4", ".mov", ".m4v", ".webm", ".mkv", ".avi", ".mpeg", ".mpg", ".ogv"].includes(ext);
200869
201265
  }
200870
201266
  async function extractVideoFrameToBuffer2(videoPath) {
200871
- const tmp = mkdtempSync22(join118(tmpdir17(), "hf-grade-compare-frame-"));
201267
+ const tmp = mkdtempSync23(join118(tmpdir17(), "hf-grade-compare-frame-"));
200872
201268
  const outPath = join118(tmp, "frame.png");
200873
201269
  try {
200874
201270
  const ffmpegPath = findFFmpeg();
@@ -201065,7 +201461,7 @@ var init_grade_compare = __esm({
201065
201461
  prepared.tempDir,
201066
201462
  parsed.timeoutMs
201067
201463
  );
201068
- mkdirSync54(dirname57(parsed.outPath), { recursive: true });
201464
+ mkdirSync54(dirname58(parsed.outPath), { recursive: true });
201069
201465
  copyFileSync10(tempSheet, parsed.outPath);
201070
201466
  trackCompareSheet({
201071
201467
  command: "grade-compare",
@@ -201110,9 +201506,9 @@ __export(compare_exports, {
201110
201506
  parseCompareArgs: () => parseCompareArgs,
201111
201507
  prepareCompareVariantProjects: () => prepareCompareVariantProjects
201112
201508
  });
201113
- import { cpSync as cpSync6, existsSync as existsSync109, mkdirSync as mkdirSync55, mkdtempSync as mkdtempSync23, renameSync as renameSync18, rmSync as rmSync36, statSync as statSync37 } from "fs";
201509
+ import { cpSync as cpSync6, existsSync as existsSync109, mkdirSync as mkdirSync55, mkdtempSync as mkdtempSync24, renameSync as renameSync18, rmSync as rmSync36, statSync as statSync37 } from "fs";
201114
201510
  import { tmpdir as tmpdir18 } from "os";
201115
- import { basename as basename28, dirname as dirname58, extname as extname23, join as join119 } from "path";
201511
+ import { basename as basename28, dirname as dirname59, extname as extname23, join as join119 } from "path";
201116
201512
  function defaultLabelForPath(input2) {
201117
201513
  const name = basename28(input2);
201118
201514
  return extname23(name).toLowerCase() === ".html" ? basename28(name, extname23(name)) : name;
@@ -201211,9 +201607,9 @@ function inputError(variant) {
201211
201607
  );
201212
201608
  }
201213
201609
  function stageHtmlVariant(variant) {
201214
- const stagedDir = mkdtempSync23(join119(tmpdir18(), "hf-compare-variant-"));
201610
+ const stagedDir = mkdtempSync24(join119(tmpdir18(), "hf-compare-variant-"));
201215
201611
  try {
201216
- cpSync6(dirname58(variant.inputPath), stagedDir, {
201612
+ cpSync6(dirname59(variant.inputPath), stagedDir, {
201217
201613
  recursive: true,
201218
201614
  filter: (src) => {
201219
201615
  const base2 = basename28(src);
@@ -201308,7 +201704,7 @@ async function renderCompareSheet(parsed) {
201308
201704
  const capResult = capCompareVariants(parsed.variants);
201309
201705
  const variants = capResult.variants;
201310
201706
  const prepared = prepareCompareVariantProjects(variants);
201311
- const frameDir = mkdtempSync23(join119(tmpdir18(), "hf-compare-frames-"));
201707
+ const frameDir = mkdtempSync24(join119(tmpdir18(), "hf-compare-frames-"));
201312
201708
  const framePaths = [];
201313
201709
  try {
201314
201710
  let renderReadyTimedOut = false;
@@ -201323,7 +201719,7 @@ async function renderCompareSheet(parsed) {
201323
201719
  framePaths.push(rendered.framePath);
201324
201720
  renderReadyTimedOut = renderReadyTimedOut || rendered.renderReadyTimedOut;
201325
201721
  }
201326
- mkdirSync55(dirname58(parsed.outPath), { recursive: true });
201722
+ mkdirSync55(dirname59(parsed.outPath), { recursive: true });
201327
201723
  await createContactSheet(framePaths, parsed.outPath, {
201328
201724
  cols: parsed.cols ?? defaultCompareCols(framePaths.length),
201329
201725
  maxImages: framePaths.length,
@@ -202489,7 +202885,7 @@ async function extractHtml(page, opts = {}) {
202489
202885
  (_match, pre, urls, post) => {
202490
202886
  const fixed = urls.replace(/&amp;/g, "&").replace(
202491
202887
  /(^|,\s*)(\/[^\s,]+)/g,
202492
- (_m, sep14, path2) => sep14 + pageOrigin + path2
202888
+ (_m, sep15, path2) => sep15 + pageOrigin + path2
202493
202889
  );
202494
202890
  return pre + fixed + post;
202495
202891
  }
@@ -204481,9 +204877,9 @@ import {
204481
204877
  readdirSync as readdirSync38,
204482
204878
  statSync as statSync39,
204483
204879
  readFileSync as readFileSync84,
204484
- openSync as openSync11,
204485
- fstatSync as fstatSync7,
204486
- closeSync as closeSync12
204880
+ openSync as openSync12,
204881
+ fstatSync as fstatSync8,
204882
+ closeSync as closeSync13
204487
204883
  } from "fs";
204488
204884
  import { basename as basename30, join as join125 } from "path";
204489
204885
  function resolveVisionPhaseCompletion(outcome, remainingMs) {
@@ -204787,14 +205183,14 @@ async function captionImagesWithGemini(outputDir, progress, warnings, options =
204787
205183
  const results = await Promise.allSettled(
204788
205184
  batch.map(async (file) => {
204789
205185
  const filePath = join125(outputDir, "assets", file);
204790
- const fd = openSync11(filePath, "r");
205186
+ const fd = openSync12(filePath, "r");
204791
205187
  let buffer;
204792
205188
  try {
204793
- const stat3 = fstatSync7(fd);
205189
+ const stat3 = fstatSync8(fd);
204794
205190
  if (stat3.size > 4e6) return { file, caption: "" };
204795
205191
  buffer = readFileSync84(fd);
204796
205192
  } finally {
204797
- closeSync12(fd);
205193
+ closeSync13(fd);
204798
205194
  }
204799
205195
  const base64 = buffer.toString("base64");
204800
205196
  const ext = file.split(".").pop()?.toLowerCase() || "png";
@@ -206809,13 +207205,13 @@ __export(state_exports, {
206809
207205
  writeStackOutputs: () => writeStackOutputs
206810
207206
  });
206811
207207
  import { existsSync as existsSync117, mkdirSync as mkdirSync61, readdirSync as readdirSync40, readFileSync as readFileSync86, rmSync as rmSync37, writeFileSync as writeFileSync57 } from "fs";
206812
- import { dirname as dirname59, join as join131 } from "path";
207208
+ import { dirname as dirname60, join as join131 } from "path";
206813
207209
  function stateFilePath(stackName = DEFAULT_STACK_NAME, cwd = process.cwd()) {
206814
207210
  return join131(cwd, STATE_DIR_NAME, `${STATE_FILE_PREFIX}${stackName}.json`);
206815
207211
  }
206816
207212
  function writeStackOutputs(outputs, cwd = process.cwd()) {
206817
207213
  const path2 = stateFilePath(outputs.stackName, cwd);
206818
- mkdirSync61(dirname59(path2), { recursive: true });
207214
+ mkdirSync61(dirname60(path2), { recursive: true });
206819
207215
  writeFileSync57(path2, JSON.stringify(outputs, null, 2) + "\n");
206820
207216
  return path2;
206821
207217
  }
@@ -206989,19 +207385,19 @@ var init_sam = __esm({
206989
207385
 
206990
207386
  // src/commands/lambda/repoRoot.ts
206991
207387
  import { existsSync as existsSync119 } from "fs";
206992
- import { dirname as dirname60, resolve as resolve77 } from "path";
207388
+ import { dirname as dirname61, resolve as resolve77 } from "path";
206993
207389
  import { fileURLToPath as fileURLToPath15 } from "url";
206994
207390
  function repoRoot() {
206995
207391
  const override = process.env.HYPERFRAMES_REPO_ROOT;
206996
207392
  if (override && existsSync119(resolve77(override, "packages", "aws-lambda", "package.json"))) {
206997
207393
  return override;
206998
207394
  }
206999
- let dir = dirname60(fileURLToPath15(import.meta.url));
207395
+ let dir = dirname61(fileURLToPath15(import.meta.url));
207000
207396
  for (let depth = 0; depth < 12; depth++) {
207001
207397
  if (existsSync119(resolve77(dir, "packages", "aws-lambda", "package.json"))) {
207002
207398
  return dir;
207003
207399
  }
207004
- const parent = dirname60(dir);
207400
+ const parent = dirname61(dir);
207005
207401
  if (parent === dir) break;
207006
207402
  dir = parent;
207007
207403
  }
@@ -209250,7 +209646,7 @@ var init_poll = __esm({
209250
209646
 
209251
209647
  // src/cloud/download.ts
209252
209648
  import { createWriteStream as createWriteStream5, mkdirSync as mkdirSync64, unlinkSync as unlinkSync12 } from "fs";
209253
- import { dirname as dirname61 } from "path";
209649
+ import { dirname as dirname62 } from "path";
209254
209650
  async function downloadToFile(url, destPath, options = {}) {
209255
209651
  const fetchImpl = options.fetchImpl ?? fetch;
209256
209652
  const res = await fetchImpl(url, { signal: options.signal });
@@ -209260,7 +209656,7 @@ async function downloadToFile(url, destPath, options = {}) {
209260
209656
  if (!res.body) {
209261
209657
  throw new Error(`Failed to download ${url}: empty response body`);
209262
209658
  }
209263
- mkdirSync64(dirname61(destPath), { recursive: true });
209659
+ mkdirSync64(dirname62(destPath), { recursive: true });
209264
209660
  const totalHeader = res.headers.get("content-length");
209265
209661
  const total = totalHeader ? Number.parseInt(totalHeader, 10) : void 0;
209266
209662
  const totalOpt = total !== void 0 && Number.isFinite(total) ? total : void 0;
@@ -209853,7 +210249,7 @@ __export(render_exports3, {
209853
210249
  validateDryRunSource: () => validateDryRunSource,
209854
210250
  validateResolutionFormatCombo: () => validateResolutionFormatCombo
209855
210251
  });
209856
- import { isAbsolute as isAbsolute18, relative as relative30, resolve as resolvePath4 } from "path";
210252
+ import { isAbsolute as isAbsolute19, relative as relative31, resolve as resolvePath4 } from "path";
209857
210253
  import { existsSync as existsSync124 } from "fs";
209858
210254
  function parsePollIntervalMs(raw) {
209859
210255
  const n2 = parseNumericFlag(raw, { flag: "--poll-interval", min: 1 });
@@ -209979,7 +210375,7 @@ function prepareLocalArchive(source, composition, asJson) {
209979
210375
  }
209980
210376
  try {
209981
210377
  const fileMap = buildPublishFileMap(project.dir);
209982
- const entryPath = relative30(
210378
+ const entryPath = relative31(
209983
210379
  project.dir,
209984
210380
  resolvePath4(project.dir, composition ?? "index.html")
209985
210381
  ).replaceAll("\\", "/");
@@ -210164,7 +210560,7 @@ function handleFailedRender(detail, asJson) {
210164
210560
  }
210165
210561
  function resolveOutputPath2(output, renderId, format) {
210166
210562
  if (output) {
210167
- return isAbsolute18(output) ? output : resolvePath4(process.cwd(), output);
210563
+ return isAbsolute19(output) ? output : resolvePath4(process.cwd(), output);
210168
210564
  }
210169
210565
  const ext = FORMAT_EXT2[format] ?? `.${format}`;
210170
210566
  return resolvePath4(process.cwd(), "renders", `${renderId}${ext}`);
@@ -211936,7 +212332,7 @@ var init_parseFigmaRef = __esm({
211936
212332
 
211937
212333
  // ../core/dist/figma/freeze.js
211938
212334
  import { copyFileSync as copyFileSync11, mkdirSync as mkdirSync65, rmSync as rmSync38, statSync as statSync40, writeFileSync as writeFileSync59 } from "fs";
211939
- import { dirname as dirname62 } from "path";
212335
+ import { dirname as dirname63 } from "path";
211940
212336
  function exceedsFreezeCap(byteLength) {
211941
212337
  return byteLength > MAX_FREEZE_BYTES;
211942
212338
  }
@@ -211945,7 +212341,7 @@ function freezeBytes(bytes, destPath) {
211945
212341
  throw new Error("freeze failed: empty bytes");
211946
212342
  if (exceedsFreezeCap(bytes.length))
211947
212343
  throw new Error(`freeze failed: ${bytes.length} bytes exceeds ${MAX_FREEZE_BYTES} cap`);
211948
- mkdirSync65(dirname62(destPath), { recursive: true });
212344
+ mkdirSync65(dirname63(destPath), { recursive: true });
211949
212345
  try {
211950
212346
  writeFileSync59(destPath, bytes, { flag: "wx" });
211951
212347
  } catch (err) {
@@ -212085,7 +212481,7 @@ var init_manifest = __esm({
212085
212481
 
212086
212482
  // ../core/dist/figma/mediaIndex.js
212087
212483
  import { mkdirSync as mkdirSync67, writeFileSync as writeFileSync61 } from "fs";
212088
- import { dirname as dirname63, join as join140 } from "path";
212484
+ import { dirname as dirname64, join as join140 } from "path";
212089
212485
  function isRow(value) {
212090
212486
  return typeof value === "object" && value !== null;
212091
212487
  }
@@ -212135,7 +212531,7 @@ function regenerateIndex(projectDir) {
212135
212531
  const records = readJsonlValues(manifestPath(projectDir)).filter(isRow);
212136
212532
  const content = generateIndexContent(records);
212137
212533
  const p2 = indexPath(projectDir);
212138
- mkdirSync67(dirname63(p2), { recursive: true });
212534
+ mkdirSync67(dirname64(p2), { recursive: true });
212139
212535
  writeFileSync61(p2, content);
212140
212536
  return content;
212141
212537
  }
@@ -212805,7 +213201,7 @@ __export(asset_exports, {
212805
213201
  runAssetImportMany: () => runAssetImportMany
212806
213202
  });
212807
213203
  import { existsSync as existsSync127 } from "fs";
212808
- import { join as join143, relative as relative31 } from "path";
213204
+ import { join as join143, relative as relative33 } from "path";
212809
213205
  function gatherAssetRefs(positionals) {
212810
213206
  return positionals.flatMap((r2) => /^https?:/i.test(r2.trim()) ? [r2] : r2.split(",")).map((r2) => r2.trim()).filter((r2) => r2.length > 0);
212811
213207
  }
@@ -212847,7 +213243,7 @@ async function freezeAndRecord(fileKey2, nodeId, url, ext, opts, version2, deps,
212847
213243
  const record = {
212848
213244
  id,
212849
213245
  type: "image",
212850
- path: relative31(deps.projectDir, destAbs),
213246
+ path: relative33(deps.projectDir, destAbs),
212851
213247
  source: `figma:${fileKey2}/${nodeId}`,
212852
213248
  ...description !== void 0 && { description },
212853
213249
  ...entity !== void 0 && { entity },
@@ -213091,7 +213487,7 @@ __export(component_exports, {
213091
213487
  runComponentImport: () => runComponentImport
213092
213488
  });
213093
213489
  import { existsSync as existsSync128, mkdirSync as mkdirSync69, writeFileSync as writeFileSync65 } from "fs";
213094
- import { join as join145, relative as relative33 } from "path";
213490
+ import { join as join145, relative as relative34 } from "path";
213095
213491
  function escapeAttr2(value) {
213096
213492
  return value.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
213097
213493
  }
@@ -213141,7 +213537,7 @@ async function runComponentImport(refInput, deps) {
213141
213537
  );
213142
213538
  return {
213143
213539
  name,
213144
- htmlPath: relative33(deps.projectDir, htmlFile),
213540
+ htmlPath: relative34(deps.projectDir, htmlFile),
213145
213541
  unresolved: bindings.unresolved,
213146
213542
  rasterized: mapped.rasterize,
213147
213543
  failedRasterize
@@ -213161,7 +213557,7 @@ async function rasterizeFallback(mapped, fileKey2, componentDir, deps) {
213161
213557
  continue;
213162
213558
  }
213163
213559
  frozenAssets.push(asset.record.path);
213164
- const srcRel = relative33(componentDir, join145(deps.projectDir, asset.record.path)).replaceAll(
213560
+ const srcRel = relative34(componentDir, join145(deps.projectDir, asset.record.path)).replaceAll(
213165
213561
  "\\",
213166
213562
  "/"
213167
213563
  );
@@ -213308,7 +213704,7 @@ __export(autoUpdate_exports, {
213308
213704
  scheduleBackgroundInstall: () => scheduleBackgroundInstall
213309
213705
  });
213310
213706
  import { spawn as spawn16 } from "child_process";
213311
- import { appendFileSync as appendFileSync4, mkdirSync as mkdirSync70, openSync as openSync12 } from "fs";
213707
+ import { appendFileSync as appendFileSync4, mkdirSync as mkdirSync70, openSync as openSync13 } from "fs";
213312
213708
  import { homedir as homedir24 } from "os";
213313
213709
  import { join as join146 } from "path";
213314
213710
  import { compareVersions as compareVersions3 } from "compare-versions";
@@ -213358,7 +213754,7 @@ function launchDetachedInstall(invocation, displayCommand, version2) {
213358
213754
  } catch (e) {}
213359
213755
  });
213360
213756
  `;
213361
- const out = openSync12(LOG_FILE, "a", 384);
213757
+ const out = openSync13(LOG_FILE, "a", 384);
213362
213758
  const child = spawn16(process.execPath, ["-e", nodeScript], {
213363
213759
  detached: true,
213364
213760
  stdio: ["ignore", out, out],
@@ -213650,7 +214046,7 @@ var init_help = __esm({
213650
214046
  init_version();
213651
214047
  init_dist();
213652
214048
  init_runId();
213653
- import { dirname as dirname64, join as join147 } from "path";
214049
+ import { dirname as dirname65, join as join147 } from "path";
213654
214050
  import { fileURLToPath as fileURLToPath16 } from "url";
213655
214051
  import { existsSync as existsSync129 } from "fs";
213656
214052
 
@@ -213768,7 +214164,7 @@ for (const stream of [process.stdout, process.stderr]) {
213768
214164
  });
213769
214165
  }
213770
214166
  (() => {
213771
- const here = dirname64(fileURLToPath16(import.meta.url));
214167
+ const here = dirname65(fileURLToPath16(import.meta.url));
213772
214168
  const shader = join147(here, "shaderTransitionWorker.js");
213773
214169
  if (!process.env.HF_SHADER_WORKER_ENTRY && existsSync129(shader)) {
213774
214170
  process.env.HF_SHADER_WORKER_ENTRY = shader;