hyperframes 0.8.172 → 0.8.174

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (185) hide show
  1. package/dist/{add-TJNZWO7P.js → add-XANMFNIP.js} +14 -15
  2. package/dist/{animatedGifPrep-K4WFG6KK.js → animatedGifPrep-OUQ4M2T3.js} +9 -11
  3. package/dist/api.js +19 -21
  4. package/dist/{asset-QN5J2P7H.js → asset-SVONSQ67.js} +2 -2
  5. package/dist/{assetCataloger-RLFDI5YD.js → assetCataloger-AG77T6SF.js} +9 -11
  6. package/dist/{audio-QJ4C3NMN.js → audio-DMQOTXKL.js} +16 -18
  7. package/dist/{auth-K7EHUGWE.js → auth-ED7SPBS6.js} +2 -2
  8. package/dist/{autoUpdate-76QXHQRT.js → autoUpdate-4QQYZOVT.js} +2 -2
  9. package/dist/{backgroundChecks-NMYRM5LV.js → backgroundChecks-2VT46P5S.js} +3 -3
  10. package/dist/backgroundChecksWorker.js +3 -3
  11. package/dist/{batchRender-RENYERF5.js → batchRender-KIYAPCTG.js} +4 -4
  12. package/dist/{beats-ZOR2HBAR.js → beats-OE7M5BEE.js} +6 -7
  13. package/dist/{benchmark-CY2VFIKL.js → benchmark-2ZQP2RNF.js} +11 -12
  14. package/dist/{browser-NPCKLUT7.js → browser-CSSJ3VWW.js} +5 -6
  15. package/dist/{bundleWithLocalizedFonts-FKH55KKW.js → bundleWithLocalizedFonts-ZUC4MLSO.js} +2 -2
  16. package/dist/{capture-TMSBTUYU.js → capture-3NXAHID3.js} +2 -2
  17. package/dist/{capture-IC2QJMMQ.js → capture-APNSW4ZT.js} +22 -18
  18. package/dist/{catalog-N7OCMRPT.js → catalog-CFDBIVSC.js} +15 -16
  19. package/dist/{catch-up-2MGK5I2D.js → catch-up-OUK522JT.js} +6 -7
  20. package/dist/{check-NU4GL2WC.js → check-PUDEOXGP.js} +37 -39
  21. package/dist/{checkBrowser-HRXAL4QD.js → checkBrowser-PMRJSTFJ.js} +34 -36
  22. package/dist/chunk-2CDBTQKS.js +113 -0
  23. package/dist/{chunk-C2F37AXS.js → chunk-2XSAYE7U.js} +2 -2
  24. package/dist/{chunk-3RM2ETQT.js → chunk-32GKETR7.js} +28 -2
  25. package/dist/{chunk-UIDRXHUY.js → chunk-3MDO2Q4F.js} +1 -1
  26. package/dist/{chunk-5B57KZJX.js → chunk-4PX47Z65.js} +1 -1
  27. package/dist/{chunk-IK3SOMZ4.js → chunk-4VTUDCHM.js} +19 -22
  28. package/dist/{chunk-Z6L3W5KZ.js → chunk-4WQUBVDO.js} +3 -3
  29. package/dist/{chunk-NLEDKGZT.js → chunk-55LJK3H2.js} +3 -3
  30. package/dist/{chunk-KRMOJUVL.js → chunk-6HF2WFPV.js} +5 -5
  31. package/dist/{chunk-EDUBJPGL.js → chunk-ALCCEHX2.js} +33 -7
  32. package/dist/{chunk-FXHGO3NH.js → chunk-APMA7XXB.js} +1 -1
  33. package/dist/{chunk-CDXC2UQ7.js → chunk-AR2SEGPZ.js} +1 -1
  34. package/dist/{chunk-K6SBDWUV.js → chunk-B23GBPCW.js} +2 -2
  35. package/dist/{chunk-YHECAUDC.js → chunk-CI7ZHFSV.js} +11 -11
  36. package/dist/chunk-CIWX5UKC.js +16 -0
  37. package/dist/{chunk-FYR6GKFN.js → chunk-CSMKMVGG.js} +6 -6
  38. package/dist/{chunk-TV2N4UIJ.js → chunk-D2YN4FNH.js} +2 -2
  39. package/dist/{chunk-CUDHVUIF.js → chunk-DRR3UMIY.js} +1 -1
  40. package/dist/{chunk-6K2N6WPO.js → chunk-EAR5LFOH.js} +42 -2
  41. package/dist/{chunk-MEEETF7G.js → chunk-EJZJ5AY7.js} +1 -1
  42. package/dist/{chunk-R73GAMUQ.js → chunk-G4UUEQDT.js} +1 -1
  43. package/dist/{chunk-G47TXPYN.js → chunk-GK2FIKIQ.js} +10 -8
  44. package/dist/{chunk-7DVH2IQQ.js → chunk-GXWV4FNV.js} +1 -1
  45. package/dist/{chunk-UNALPZL6.js → chunk-H2BPHBDY.js} +1 -1
  46. package/dist/{chunk-X3SCQP2A.js → chunk-HB2UP4V7.js} +1 -1
  47. package/dist/chunk-HIP62XAW.js +36 -0
  48. package/dist/{chunk-DQRZWV3B.js → chunk-HIYAJFRH.js} +1 -1
  49. package/dist/{chunk-4UR2EQSR.js → chunk-HZZYJV7K.js} +17 -19
  50. package/dist/{chunk-A2DMF2Q6.js → chunk-HZZZ6C6Z.js} +2 -2
  51. package/dist/{chunk-QQI7R2QL.js → chunk-JKPI7VLI.js} +1 -1
  52. package/dist/{chunk-4N2YVSXH.js → chunk-JL76Y45C.js} +7 -7
  53. package/dist/{chunk-EKKROA7V.js → chunk-LR72ON5B.js} +1 -1
  54. package/dist/{chunk-QVVANKN2.js → chunk-LUKY7253.js} +491 -133
  55. package/dist/{chunk-257IUNPQ.js → chunk-MXNPYP5F.js} +1 -1
  56. package/dist/{chunk-VFCKXTBB.js → chunk-NL5F3AD4.js} +27 -38
  57. package/dist/{chunk-S6JCFZVB.js → chunk-ONXTLGJB.js} +5 -5
  58. package/dist/{chunk-KRTCHLBA.js → chunk-PLYTTPVE.js} +2 -2
  59. package/dist/{chunk-R2P2SANE.js → chunk-QJCVK7CI.js} +4 -4
  60. package/dist/{chunk-HN5WVJZB.js → chunk-QRO2UBWS.js} +1 -1
  61. package/dist/{chunk-KOMXCNZX.js → chunk-QUK2IZKI.js} +1 -1
  62. package/dist/{chunk-2VR7HIPZ.js → chunk-RLBLLBLL.js} +2 -2
  63. package/dist/{chunk-PDFMNU6D.js → chunk-RMKL5FVH.js} +4 -17
  64. package/dist/{chunk-VQSSP7XG.js → chunk-RNKNDYBN.js} +1 -1
  65. package/dist/{chunk-BQYQV6JP.js → chunk-RYR3LTZR.js} +2 -2
  66. package/dist/{chunk-NYXHZOPD.js → chunk-RZ2FMZ5U.js} +1 -1
  67. package/dist/{chunk-DOV2QOFY.js → chunk-S5D4Q74P.js} +2 -2
  68. package/dist/{chunk-Z5ENX63S.js → chunk-SEHRMJTO.js} +13 -7
  69. package/dist/{chunk-XEJUMBIC.js → chunk-SEXAKOK3.js} +3 -3
  70. package/dist/{chunk-HZWXDKYB.js → chunk-SH43VDEF.js} +11 -15
  71. package/dist/{chunk-YAA3AOBA.js → chunk-SI76MFBF.js} +2 -2
  72. package/dist/{chunk-QWQ6GQTI.js → chunk-T6AGUTZJ.js} +2 -4
  73. package/dist/{chunk-ZY43P2M7.js → chunk-TI3HKGQC.js} +3 -3
  74. package/dist/{chunk-MFWQEG2W.js → chunk-UDJHYQSZ.js} +1 -1
  75. package/dist/{chunk-V5IZAL3H.js → chunk-UKAOWORD.js} +8 -8
  76. package/dist/chunk-UKJECUDK.js +3805 -0
  77. package/dist/{chunk-M235XUHL.js → chunk-UQLXFITA.js} +241 -6
  78. package/dist/{chunk-JYVGYKXG.js → chunk-W2LGJSEN.js} +73 -1
  79. package/dist/{chunk-UFAKRR5G.js → chunk-W3YVQ6VI.js} +12 -12
  80. package/dist/{chunk-FQP7TLRF.js → chunk-W4AECR7V.js} +1 -1
  81. package/dist/{chunk-AG2O2USE.js → chunk-X3BE2HX4.js} +3 -3
  82. package/dist/{chunk-TDPVEMBS.js → chunk-XFCLWWL3.js} +1 -1
  83. package/dist/{chunk-NZ5HOUJH.js → chunk-XVIFWEPR.js} +67 -33
  84. package/dist/{clean-JDODBRVL.js → clean-6SVCU47L.js} +18 -20
  85. package/dist/cli.js +53 -53
  86. package/dist/{cloud-YHJZ72XP.js → cloud-TIISRMZV.js} +4 -4
  87. package/dist/{cloudrun-E5EOHYTG.js → cloudrun-4TMBWELQ.js} +5 -5
  88. package/dist/{compare-VQQXHSE3.js → compare-YV2XTKYX.js} +28 -30
  89. package/dist/{compiler-I4GWSEK3.js → compiler-O5R3ZZDV.js} +5 -6
  90. package/dist/{component-WOSMKPL7.js → component-7LWSMRKZ.js} +3 -3
  91. package/dist/{compositions-WLJE5752.js → compositions-5VTSC4M3.js} +14 -16
  92. package/dist/{delete-PILRKH5C.js → delete-AV2SKLZW.js} +4 -4
  93. package/dist/{deploy-4MK3Y67M.js → deploy-NKWMPAMH.js} +19 -5
  94. package/dist/{destroy-GFQLTIY3.js → destroy-UKP522AE.js} +4 -2
  95. package/dist/{dist-7TYQROOE.js → dist-2FMTAVGL.js} +3 -3
  96. package/dist/{dist-SDXOTECD.js → dist-4FY5EEH5.js} +3 -3
  97. package/dist/{doctor-FNICQNSA.js → doctor-XOCYSEAZ.js} +14 -16
  98. package/dist/{events-5WNYSVPY.js → events-6QPRKX45.js} +4 -5
  99. package/dist/{events-YXPWFV5S.js → events-MAZUZI43.js} +5 -6
  100. package/dist/{feedback-KLA5RSSN.js → feedback-MGRILBMP.js} +10 -11
  101. package/dist/{ffmpeg-7BYARPLM.js → ffmpeg-YCULCUB2.js} +24 -4
  102. package/dist/{figma-PQIZI67M.js → figma-UMBACTCG.js} +3 -3
  103. package/dist/fontLocalizeCli.js +11 -13
  104. package/dist/{get-OBOWSUA7.js → get-LWEOLWYN.js} +4 -4
  105. package/dist/{gpuPolicy-HWH4OW6H.js → gpuPolicy-MCIQK5Z7.js} +9 -11
  106. package/dist/{grade-compare-5IOHWZX6.js → grade-compare-MZQOTX3F.js} +29 -31
  107. package/dist/{help-K4IK2N36.js → help-THPG2NRP.js} +1 -1
  108. package/dist/{history-AC5ZUFOX.js → history-2IQYTDU5.js} +8 -9
  109. package/dist/hyperframe-runtime.js +55 -55
  110. package/dist/hyperframe.manifest.json +1 -1
  111. package/dist/hyperframe.runtime.iife.js +55 -55
  112. package/dist/hyperframes-player.global.js +3 -3
  113. package/dist/{info-BD6555FQ.js → info-CXMADV6K.js} +10 -11
  114. package/dist/{init-KTNJH3QB.js → init-Y5GU454D.js} +34 -34
  115. package/dist/{inspect-PF2DWLRP.js → inspect-S7JDKEMJ.js} +29 -31
  116. package/dist/{installer-72NGZ5BM.js → installer-AY23RPEZ.js} +5 -5
  117. package/dist/{keyframes-P3GRO3LL.js → keyframes-FKYT6QAJ.js} +8 -9
  118. package/dist/{lambda-XRNX7HLH.js → lambda-7WMZGRH5.js} +16 -12
  119. package/dist/{layout-KN7SX3WH.js → layout-LL4GOS6G.js} +29 -31
  120. package/dist/{lint-TXBEZUA5.js → lint-2M7FY4ZT.js} +11 -12
  121. package/dist/{lintProject-65YGC4UB.js → lintProject-ARKJXDQF.js} +3 -3
  122. package/dist/{list-4YL3BA2G.js → list-SZBMUHBW.js} +4 -4
  123. package/dist/{login-JUI7PHHJ.js → login-QRACITGK.js} +4 -4
  124. package/dist/{manager-B6MVBM2E.js → manager-W2BTPAVT.js} +25 -3
  125. package/dist/{media-treatment-6DDWZLLE.js → media-treatment-E4VJETTT.js} +30 -22
  126. package/dist/{models-CLSFYHTD.js → models-AHO3MYE7.js} +13 -15
  127. package/dist/{motionShot-WMJSRE67.js → motionShot-LMMYPGPT.js} +21 -23
  128. package/dist/{normalize-audio-YZTHI75G.js → normalize-audio-RDWIWZOO.js} +6 -7
  129. package/dist/{open-VSJ3TPAB.js → open-WOKRHFDH.js} +31 -8
  130. package/dist/{parakeetRunner-YCZT3DG2.js → parakeetRunner-RY2KIE63.js} +16 -18
  131. package/dist/{pipeline-RV64A4MZ.js → pipeline-LEA32KLW.js} +11 -13
  132. package/dist/{play-CF6TJIQL.js → play-3S46XG66.js} +21 -23
  133. package/dist/{policies-DCSIM4AB.js → policies-5NTZOHJA.js} +2 -0
  134. package/dist/preflight-MCOFNWFQ.js +52 -0
  135. package/dist/{present-5XKI26BN.js → present-GR7F4CTI.js} +17 -19
  136. package/dist/{preview-RORZIRSN.js → preview-TKEAF3KR.js} +34 -25
  137. package/dist/{producer-K2H3YFX5.js → producer-BJ5SUPVD.js} +1 -1
  138. package/dist/{progress-5AM2MZ7V.js → progress-I37JB7R4.js} +1 -0
  139. package/dist/{projectConfig-Q2ECBQUG.js → projectConfig-YJBYWSNK.js} +7 -7
  140. package/dist/{publication-2V3WX4HW.js → publication-2HXIW4LS.js} +3 -3
  141. package/dist/{publish-7COI3FRD.js → publish-LHJFEKEI.js} +11 -11
  142. package/dist/{remove-background-QSOESZXW.js → remove-background-AQUUVAPD.js} +12 -14
  143. package/dist/{render-ACRKADG6.js → render-AOHXNGIM.js} +40 -38
  144. package/dist/{render-KHDJ2P4J.js → render-AXTGGHVZ.js} +9 -4
  145. package/dist/{render-3ZLZDN64.js → render-B5S7FLLS.js} +14 -15
  146. package/dist/{render-batch-OG3JHMDF.js → render-batch-DMQG3QWK.js} +4 -4
  147. package/dist/renderSetupWorker.js +3 -3
  148. package/dist/{resolver-ALLVWDQE.js → resolver-FV54X3T2.js} +5 -5
  149. package/dist/sam-IKPEJRRO.js +21 -0
  150. package/dist/{screenshotCapture-XAYELJK7.js → screenshotCapture-HXEZ3TNJ.js} +20 -3
  151. package/dist/{sherpa-QY3NGRLC.js → sherpa-RKURBTUM.js} +15 -17
  152. package/dist/skills/hyperframes/SKILL.md +42 -0
  153. package/dist/skills/hyperframes-cli/references/cloud.md +1 -1
  154. package/dist/skills/media-use/scripts/lib/recipe-store.mjs +5 -2
  155. package/dist/{skills-YIZYEARC.js → skills-YUXI4IRF.js} +11 -10
  156. package/dist/{skillsUpdateCheck-EXZOQQRS.js → skillsUpdateCheck-HK3GDYD6.js} +3 -3
  157. package/dist/{snapshot-3XMGHMRD.js → snapshot-D6Q52Z4X.js} +32 -34
  158. package/dist/{src-CGIRN4KP.js → src-DPR7JBU3.js} +10 -12
  159. package/dist/{src-RY4V2ZZT.js → src-MRYINZ62.js} +10 -10
  160. package/dist/{staticProjectServer-4E3ODA5P.js → staticProjectServer-RT7JATD2.js} +15 -16
  161. package/dist/{status-RGHSK3DJ.js → status-BV7QAUQD.js} +2 -3
  162. package/dist/studio/assets/{hyperframes-player-BDj9J28W.js → hyperframes-player-B4KfQdfl.js} +1 -1
  163. package/dist/studio/assets/{index--HWjGqrU.js → index-Bsc8xBh9.js} +1 -1
  164. package/dist/studio/assets/{index-DkQKsFxx.css → index-CESvLzz0.css} +1 -1
  165. package/dist/studio/assets/{index-CVxB8lqm.js → index-DGl_Zvb3.js} +128 -128
  166. package/dist/studio/index.html +2 -2
  167. package/dist/{studio-api-LTHBT45F.js → studio-api-NL2RMVB5.js} +9 -10
  168. package/dist/{studioServer-NDRRYB5V.js → studioServer-VL2GUVCR.js} +63 -56
  169. package/dist/{system-VRXC6S4A.js → system-7F3UEHQT.js} +2 -3
  170. package/dist/{telemetry-QBHPMHPC.js → telemetry-5PJWDFSZ.js} +5 -6
  171. package/dist/{timeline-J22LXNAI.js → timeline-OH35TN25.js} +124 -51
  172. package/dist/{tokens-EAPT2GUT.js → tokens-YISVK7W2.js} +2 -2
  173. package/dist/{transcribe-L5GHBNR6.js → transcribe-6KBSE76Q.js} +12 -14
  174. package/dist/{transcribe-6LCZK44H.js → transcribe-KRPN2FWA.js} +22 -24
  175. package/dist/{updateCheck-B3U7O3QS.js → updateCheck-QCZTFFSQ.js} +2 -2
  176. package/dist/{upgrade-UMJEDSYD.js → upgrade-DRFQISI6.js} +2 -2
  177. package/dist/{urlDownloader-SRL6J4NU.js → urlDownloader-CJDXTKMC.js} +8 -10
  178. package/dist/{validate-I3KHH5Z4.js → validate-BKY3FIJC.js} +23 -27
  179. package/dist/{video-HWLZYFUC.js → video-3UEJ57Q7.js} +9 -11
  180. package/package.json +1 -1
  181. package/dist/chunk-7KDQAD2W.js +0 -81
  182. package/dist/chunk-BXCMXMJQ.js +0 -73
  183. package/dist/chunk-KCF6GHJP.js +0 -250
  184. package/dist/chunk-Q2E3DQII.js +0 -3803
  185. package/dist/preflight-G5KP7ZKA.js +0 -32
@@ -4,9 +4,6 @@ import { dirname as __hf_dirname } from "node:path";
4
4
  var require = __hf_createRequire(import.meta.url);
5
5
  var __filename = __hf_fileURLToPath(import.meta.url);
6
6
  var __dirname = __hf_dirname(__filename);
7
- import {
8
- ensureHfIds
9
- } from "./chunk-KCF6GHJP.js";
10
7
  import {
11
8
  HF_AUDIO_FX_ATTR,
12
9
  HF_COLOR_GRADING_ATTR,
@@ -40,7 +37,7 @@ import {
40
37
  stripEmbeddedRuntimeScripts,
41
38
  styleElementsFor,
42
39
  warnUnknownEnumValues
43
- } from "./chunk-Q2E3DQII.js";
40
+ } from "./chunk-UKJECUDK.js";
44
41
  import {
45
42
  cssVariableName
46
43
  } from "./chunk-VC76R6W2.js";
@@ -50,11 +47,11 @@ import {
50
47
  } from "./chunk-OFQWTKPW.js";
51
48
  import {
52
49
  lintHyperframeHtml
53
- } from "./chunk-G47TXPYN.js";
50
+ } from "./chunk-GK2FIKIQ.js";
54
51
  import {
55
52
  checkSubCompositionUsability,
56
53
  resolveSubCompositionContent
57
- } from "./chunk-3RM2ETQT.js";
54
+ } from "./chunk-32GKETR7.js";
58
55
  import {
59
56
  CSS_URL_RE,
60
57
  decodeCssEscapes,
@@ -1862,6 +1859,239 @@ function inlineSubCompositions(document, hosts, options) {
1862
1859
  };
1863
1860
  }
1864
1861
 
1862
+ // ../parsers/dist/hfIds.js
1863
+ var EXCLUDED_TAGS = /* @__PURE__ */ new Set([
1864
+ "script",
1865
+ "style",
1866
+ "template",
1867
+ "meta",
1868
+ "link",
1869
+ "noscript",
1870
+ "base"
1871
+ ]);
1872
+ function fnv1a(str) {
1873
+ let h = 2166136261;
1874
+ for (let i = 0; i < str.length; i++) {
1875
+ h ^= str.charCodeAt(i);
1876
+ h = Math.imul(h, 16777619);
1877
+ }
1878
+ return h >>> 0;
1879
+ }
1880
+ function toHfId(hash2) {
1881
+ const s = (hash2 >>> 0).toString(36);
1882
+ const four = s.length >= 4 ? s.slice(-4) : s.padStart(4, "0");
1883
+ return `hf-${four}`;
1884
+ }
1885
+ function ownText(el) {
1886
+ let text = "";
1887
+ el.childNodes.forEach((n) => {
1888
+ if (n.nodeType === 3) text += n.nodeValue ?? "";
1889
+ });
1890
+ return text.trim();
1891
+ }
1892
+ function getContractAttribute(el, name) {
1893
+ return Array.from(el.attributes).find((attr) => attr.name.toLowerCase() === name)?.value ?? null;
1894
+ }
1895
+ function contentKey(el) {
1896
+ const attrs = Array.from(el.attributes).filter((a) => !a.name.toLowerCase().startsWith("data-hf-")).map((a) => `${a.name.toLowerCase()}\0${a.value}`).sort().join("");
1897
+ return `${el.tagName.toLowerCase()}|${attrs}|${ownText(el)}`;
1898
+ }
1899
+ function mintHfId(el, assigned) {
1900
+ const key = contentKey(el);
1901
+ let id = toHfId(fnv1a(key));
1902
+ let dup = 0;
1903
+ while (assigned.has(id)) {
1904
+ dup += 1;
1905
+ if (dup > 1e4) {
1906
+ id = `hf-${(fnv1a(key) >>> 0).toString(36)}-${dup}`;
1907
+ break;
1908
+ }
1909
+ id = toHfId(fnv1a(`${key}#${dup}`));
1910
+ }
1911
+ assigned.add(id);
1912
+ return id;
1913
+ }
1914
+ function getChildElements(parent) {
1915
+ const directChildren = Array.from(parent.children);
1916
+ if (directChildren.length || parent.tagName.toLowerCase() !== "template") return directChildren;
1917
+ const content = parent.content;
1918
+ if (content?.children.length) return Array.from(content.children);
1919
+ return directChildren;
1920
+ }
1921
+ function isCompositionTemplate(el) {
1922
+ if (el.tagName.toLowerCase() !== "template") return false;
1923
+ if (getContractAttribute(el, "data-composition-id") !== null) return true;
1924
+ for (const child of getChildElements(el)) {
1925
+ if (getContractAttribute(child, "data-composition-id") !== null) return true;
1926
+ }
1927
+ return false;
1928
+ }
1929
+ function walkCompositionDescendants(root, visit) {
1930
+ const rootElement = root.nodeType === 9 ? root.documentElement : root;
1931
+ if (!rootElement) return;
1932
+ const walk = (parent) => {
1933
+ for (const child of getChildElements(parent)) {
1934
+ const isTemplate = child.tagName.toLowerCase() === "template";
1935
+ if (isTemplate && !isCompositionTemplate(child)) continue;
1936
+ visit(child);
1937
+ walk(child);
1938
+ }
1939
+ };
1940
+ walk(rootElement);
1941
+ }
1942
+ function assignHfIds(body) {
1943
+ const assigned = /* @__PURE__ */ new Set();
1944
+ walkCompositionDescendants(body, (el) => {
1945
+ const existing = getContractAttribute(el, "data-hf-id");
1946
+ if (existing) assigned.add(existing);
1947
+ });
1948
+ walkCompositionDescendants(body, (el) => {
1949
+ if (EXCLUDED_TAGS.has(el.tagName.toLowerCase())) return;
1950
+ if (getContractAttribute(el, "data-hf-id")) return;
1951
+ el.setAttribute("data-hf-id", mintHfId(el, assigned));
1952
+ });
1953
+ }
1954
+ function ensureHfIds(html) {
1955
+ const { document, wrapped } = parseFragmentOrDocument(html);
1956
+ if (!document.body) return html;
1957
+ assignHfIds(document.body);
1958
+ return wrapped ? document.body.innerHTML || "" : document.toString();
1959
+ }
1960
+ function parseFragmentOrDocument(html) {
1961
+ const wrapped = !/^(?:<!doctype|<html[\s>/])/i.test(
1962
+ html.replace(/^(?:\s|<!--(?:>|->|[\s\S]*?-->))*/, "")
1963
+ );
1964
+ const { document } = wrapped ? parseHTML(`<!DOCTYPE html><html><head></head><body>${html}</body></html>`) : parseHTML(html);
1965
+ return { document, wrapped };
1966
+ }
1967
+ function stampHfIdsInPlace(html) {
1968
+ const { document, wrapped } = parseFragmentOrDocument(html);
1969
+ if (!document.body) return html;
1970
+ const elements = wrapped ? getChildElements(document.body).flatMap(inDocumentOrder) : inDocumentOrder(document.documentElement);
1971
+ const existing = elements.map((el) => el.getAttribute("data-hf-id"));
1972
+ const pinned = existing.map((id) => id !== null && id.length > 0);
1973
+ assignHfIds(document.body);
1974
+ const minted = elements.map((el, n) => pinned[n] ? null : el.getAttribute("data-hf-id"));
1975
+ const tags = startTags(html);
1976
+ const inserts = tags && alignInserts(html, tags, elements, minted, existing);
1977
+ return inserts ? spliceIds(html, inserts) : ensureHfIds(html);
1978
+ }
1979
+ function inDocumentOrder(el) {
1980
+ return [el, ...getChildElements(el).flatMap(inDocumentOrder)];
1981
+ }
1982
+ var RAW_TEXT = /* @__PURE__ */ new Set(["script", "style", "textarea", "title", "xmp", "noembed", "noframes"]);
1983
+ var IMPLIED = /* @__PURE__ */ new Set(["html", "head", "body", "tbody"]);
1984
+ function startTags(html) {
1985
+ const lower = html.toLowerCase();
1986
+ const tags = [];
1987
+ let i = html.indexOf("<");
1988
+ while (i >= 0) {
1989
+ const name = html.startsWith("<!--", i) ? null : /^<([a-zA-Z][^\s/>]*)/.exec(html.slice(i, i + 128));
1990
+ if (!name) {
1991
+ i = nextTagAfter(html, i);
1992
+ continue;
1993
+ }
1994
+ const end = closingBracket(html, i + name[0].length);
1995
+ if (end < 0) return null;
1996
+ const tag = name[1].toLowerCase();
1997
+ tags.push({ name: tag, nameEnd: i + name[0].length, bracket: end });
1998
+ const after = RAW_TEXT.has(tag) ? rawTextEnd(lower, tag, end) : end;
1999
+ i = after < 0 ? -1 : html.indexOf("<", after + 1);
2000
+ }
2001
+ return tags;
2002
+ }
2003
+ function rawTextEnd(lower, tag, from) {
2004
+ const marker = `</${tag}`;
2005
+ for (let at = lower.indexOf(marker, from); at >= 0; at = lower.indexOf(marker, at + marker.length)) {
2006
+ const next = lower[at + marker.length];
2007
+ if (next !== void 0 && /[\s/>]/.test(next)) return at;
2008
+ }
2009
+ return -1;
2010
+ }
2011
+ function nextTagAfter(html, lt) {
2012
+ const comment = html.startsWith("<!--", lt);
2013
+ const end = comment ? html.indexOf("-->", lt + 4) : html.indexOf(">", lt);
2014
+ return end < 0 ? -1 : html.indexOf("<", end + 1);
2015
+ }
2016
+ function closingBracket(html, from) {
2017
+ let quote = "";
2018
+ for (let i = from; i < html.length; i++) {
2019
+ const c = html[i];
2020
+ if (quote) quote = c === quote ? "" : quote;
2021
+ else if (c === '"' || c === "'") quote = c;
2022
+ else if (c === ">") return i;
2023
+ }
2024
+ return -1;
2025
+ }
2026
+ function alignInserts(html, tags, elements, minted, existing) {
2027
+ const walked = walkAlign(html, tags, elements, minted, existing);
2028
+ if (!walked) return null;
2029
+ return walked.next === tags.length ? walked.inserts : null;
2030
+ }
2031
+ function walkAlign(html, tags, elements, minted, existing) {
2032
+ const state = { inserts: [], next: 0 };
2033
+ for (const [n, el] of elements.entries()) {
2034
+ if (!take(state, html, tags, el, minted[n] ?? null, existing[n] === "")) return null;
2035
+ }
2036
+ return state;
2037
+ }
2038
+ function take(state, html, tags, el, id, fillEmpty) {
2039
+ const step = alignOne(html, tags[state.next], el, id, fillEmpty);
2040
+ if (!step) return false;
2041
+ if (step.insert) state.inserts.push(step.insert);
2042
+ if (step.next) state.next += 1;
2043
+ return true;
2044
+ }
2045
+ function alignOne(html, tag, el, id, fillEmpty) {
2046
+ if (tag?.name === el.tagName.toLowerCase()) return matched(html, tag, id, fillEmpty);
2047
+ if (IMPLIED.has(el.tagName.toLowerCase()) && !id) return { insert: null, next: false };
2048
+ return null;
2049
+ }
2050
+ function matched(html, tag, id, fillEmpty) {
2051
+ if (!id) return { insert: null, next: true };
2052
+ const placed = placeId(html, tag, id, fillEmpty);
2053
+ if (!placed) return null;
2054
+ return { insert: placed, next: true };
2055
+ }
2056
+ function placeId(html, tag, id, fillEmpty) {
2057
+ if (!fillEmpty) return { at: tag.nameEnd, text: ` data-hf-id="${id}"` };
2058
+ const emptyAt = emptyHfIdValue(html, tag);
2059
+ if (emptyAt === null) return null;
2060
+ return { at: emptyAt, text: id };
2061
+ }
2062
+ function emptyHfIdValue(html, tag) {
2063
+ const open = outsideQuotes(html.slice(tag.nameEnd, tag.bracket));
2064
+ const match = /\sdata-hf-id\s*=\s*(["'])\1/i.exec(open);
2065
+ if (!match) return null;
2066
+ return tag.nameEnd + match.index + match[0].length - 1;
2067
+ }
2068
+ function outsideQuotes(open) {
2069
+ let quote = "";
2070
+ let out = "";
2071
+ for (const c of open) {
2072
+ out += quotedChar(quote, c);
2073
+ quote = quoteOf(quote, c);
2074
+ }
2075
+ return out;
2076
+ }
2077
+ function quoteOf(quote, c) {
2078
+ if (quote) return c === quote ? "" : quote;
2079
+ return c === '"' || c === "'" ? c : "";
2080
+ }
2081
+ function quotedChar(quote, c) {
2082
+ if (!quote || c === quote) return c;
2083
+ return " ".repeat(c.length);
2084
+ }
2085
+ function spliceIds(html, inserts) {
2086
+ let out = "";
2087
+ let from = 0;
2088
+ for (const { at, text } of inserts) {
2089
+ out += html.slice(from, at) + text;
2090
+ from = at;
2091
+ }
2092
+ return out + html.slice(from);
2093
+ }
2094
+
1865
2095
  // ../core/dist/compiler/htmlBundler.js
1866
2096
  var DEFAULT_RUNTIME_SCRIPT_URL = "";
1867
2097
  function getRuntimeScriptUrl() {
@@ -3142,6 +3372,11 @@ export {
3142
3372
  validateHyperframeHtmlContract,
3143
3373
  ensureExternalLinkTag,
3144
3374
  inlineSubCompositions,
3375
+ EXCLUDED_TAGS,
3376
+ mintHfId,
3377
+ walkCompositionDescendants,
3378
+ ensureHfIds,
3379
+ stampHfIdsInPlace,
3145
3380
  assignBundledRuntimeCompositionIds,
3146
3381
  prepareFlattenedInnerRoot,
3147
3382
  parsesAsScript,
@@ -102,9 +102,81 @@ function isLowMemorySystem(totalMb = getSystemTotalMb()) {
102
102
  return totalMb <= LOW_MEMORY_TOTAL_MB_THRESHOLD;
103
103
  }
104
104
 
105
+ // ../engine/src/services/wslHost.ts
106
+ import { accessSync, constants, existsSync, readFileSync as readFileSync2, statSync } from "fs";
107
+ import { platform, release } from "os";
108
+ function groupName(gid) {
109
+ try {
110
+ const line = readFileSync2("/etc/group", "utf-8").split("\n").find((entry) => entry.split(":")[2] === String(gid));
111
+ return line?.split(":")[0] || String(gid);
112
+ } catch {
113
+ return String(gid);
114
+ }
115
+ }
116
+ var realHost = {
117
+ get platform() {
118
+ return platform();
119
+ },
120
+ get release() {
121
+ return release();
122
+ },
123
+ readProcVersion: () => readFileSync2("/proc/version", "utf-8"),
124
+ renderNodeAccess: (path) => {
125
+ if (!existsSync(path)) return { state: "missing" };
126
+ try {
127
+ accessSync(path, constants.R_OK | constants.W_OK);
128
+ return { state: "read-write" };
129
+ } catch {
130
+ const gid = statSync(path, { throwIfNoEntry: false })?.gid ?? -1;
131
+ return {
132
+ state: "denied",
133
+ group: groupName(gid),
134
+ userInGroup: process.getgroups?.().includes(gid) ?? false
135
+ };
136
+ }
137
+ }
138
+ };
139
+ function detectWsl(host = realHost) {
140
+ if (host.platform !== "linux") return false;
141
+ try {
142
+ const osRelease = host.release.toLowerCase();
143
+ if (osRelease.includes("microsoft") || osRelease.includes("wsl")) return true;
144
+ const procVersion = host.readProcVersion().toLowerCase();
145
+ return procVersion.includes("microsoft") || procVersion.includes("wsl");
146
+ } catch {
147
+ return false;
148
+ }
149
+ }
150
+ var RENDER_NODE = "/dev/dri/renderD128";
151
+ var NATIVE_WINDOWS = "render from native Windows (project copied to a Windows drive, run from PowerShell), where Chrome uses the GPU through Direct3D.";
152
+ function describeWslGpuAccess(host = realHost) {
153
+ if (!detectWsl(host)) return null;
154
+ const access = host.renderNodeAccess(RENDER_NODE);
155
+ if (access.state === "denied" && !access.userInGroup) {
156
+ return [
157
+ ` Your Linux user cannot read and write ${RENDER_NODE} and is not in its group ("${access.group}"), which can stop Mesa from reaching the GPU.`,
158
+ ` Fix: run \`sudo usermod -aG ${access.group} $USER\`, then \`wsl --shutdown\` from Windows, reopen WSL and render again.`,
159
+ ` Or ${NATIVE_WINDOWS}`
160
+ ];
161
+ }
162
+ if (access.state === "denied") {
163
+ return [
164
+ ` Your Linux user is in the "${access.group}" group but still cannot read and write ${RENDER_NODE}; check its permissions with \`ls -l ${RENDER_NODE}\`.`,
165
+ ` Or ${NATIVE_WINDOWS}`
166
+ ];
167
+ }
168
+ const seen = access.state === "missing" ? "does not exist" : "is readable and writable";
169
+ return [
170
+ ` ${RENDER_NODE} ${seen}, so file permissions are not the cause.`,
171
+ ` To use the GPU, ${NATIVE_WINDOWS}`
172
+ ];
173
+ }
174
+
105
175
  export {
106
176
  getCgroupMemoryLimitMb,
107
177
  getSystemTotalMb,
108
178
  LOW_MEMORY_TOTAL_MB_THRESHOLD,
109
- isLowMemorySystem
179
+ isLowMemorySystem,
180
+ detectWsl,
181
+ describeWslGpuAccess
110
182
  };
@@ -10,21 +10,21 @@ import {
10
10
  seekCompositionTimeline,
11
11
  waitForCompositionFonts,
12
12
  waitForRuntimeReady
13
- } from "./chunk-HZWXDKYB.js";
13
+ } from "./chunk-SH43VDEF.js";
14
14
  import {
15
15
  gotoWhenSent,
16
16
  launchManagedBrowser,
17
17
  resolveManagedGpuMode
18
- } from "./chunk-6K2N6WPO.js";
18
+ } from "./chunk-EAR5LFOH.js";
19
19
  import {
20
- resolveDiagnosticNavigationTimeoutMs
21
- } from "./chunk-Z5ENX63S.js";
20
+ pageNavigationTimeoutMs
21
+ } from "./chunk-SEHRMJTO.js";
22
22
  import {
23
23
  resolveProject
24
- } from "./chunk-DQRZWV3B.js";
24
+ } from "./chunk-HIYAJFRH.js";
25
25
  import {
26
26
  serveStaticProjectHtml
27
- } from "./chunk-AG2O2USE.js";
27
+ } from "./chunk-X3BE2HX4.js";
28
28
  import {
29
29
  defineCommand
30
30
  } from "./chunk-S3S4TGEH.js";
@@ -38,7 +38,7 @@ import {
38
38
  import {
39
39
  printDeprecationNotice,
40
40
  withMeta
41
- } from "./chunk-QQI7R2QL.js";
41
+ } from "./chunk-JKPI7VLI.js";
42
42
  import {
43
43
  normalizeErrorMessage
44
44
  } from "./chunk-KNU5COPB.js";
@@ -709,7 +709,7 @@ async function collectTweenBoundaries(page) {
709
709
  });
710
710
  }
711
711
  async function bundleProjectHtml(projectDir) {
712
- const { bundleToSingleHtml } = await import("./compiler-I4GWSEK3.js");
712
+ const { bundleToSingleHtml } = await import("./compiler-O5R3ZZDV.js");
713
713
  return bundleToSingleHtml(projectDir);
714
714
  }
715
715
  async function alignViewportToComposition(page, url) {
@@ -723,18 +723,18 @@ async function alignViewportToComposition(page, url) {
723
723
  };
724
724
  });
725
725
  await page.setViewport(size);
726
- await gotoWhenSent(page, url, resolveDiagnosticNavigationTimeoutMs());
726
+ await gotoWhenSent(page, url, pageNavigationTimeoutMs());
727
727
  }
728
728
  async function runLayoutAudit(projectDir, opts) {
729
729
  const { ensureBrowser } = await import("./manager-HEUPD2YB.js");
730
730
  const puppeteer = await import("puppeteer-core");
731
- const { buildChromeArgs } = await import("./src-RY4V2ZZT.js");
731
+ const { buildChromeArgs } = await import("./src-MRYINZ62.js");
732
732
  const {
733
733
  assertWebGpuAdapterAvailable,
734
734
  compositionRequiresWebGpu,
735
735
  resolveLocalBrowserGpuMode,
736
736
  resolveLocalWebGpu
737
- } = await import("./gpuPolicy-HWH4OW6H.js");
737
+ } = await import("./gpuPolicy-MCIQK5Z7.js");
738
738
  const html = await bundleProjectHtml(projectDir);
739
739
  const server = await serveStaticProjectHtml(
740
740
  projectDir,
@@ -759,7 +759,7 @@ async function runLayoutAudit(projectDir, opts) {
759
759
  const page = await chromeBrowser.newPage();
760
760
  await installPageFunctionGuard(page);
761
761
  await page.setViewport({ width: 1920, height: 1080 });
762
- await gotoWhenSent(page, server.url, resolveDiagnosticNavigationTimeoutMs());
762
+ await gotoWhenSent(page, server.url, pageNavigationTimeoutMs());
763
763
  await assertWebGpuAdapterAvailable(page, requiresWebGpu, softwareWebGpu);
764
764
  await alignViewportToComposition(page, server.url);
765
765
  await waitForRuntimeReady(page, opts.timeout);
@@ -6,7 +6,7 @@ var __filename = __hf_fileURLToPath(import.meta.url);
6
6
  var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  resolveProject
9
- } from "./chunk-DQRZWV3B.js";
9
+ } from "./chunk-HIYAJFRH.js";
10
10
  import {
11
11
  DEFAULT_HISTORY_ROOT,
12
12
  HistoryBusyError,
@@ -7,7 +7,7 @@ var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  getMimeType,
9
9
  injectMediaCodecMapIntoHtml
10
- } from "./chunk-YHECAUDC.js";
10
+ } from "./chunk-CI7ZHFSV.js";
11
11
  import {
12
12
  PROXY_VARIANT_CONFIG,
13
13
  ProxyCapacityError,
@@ -18,10 +18,10 @@ import {
18
18
  recordProxyRequest,
19
19
  resolveProxy,
20
20
  resolveProxyVariantRequest
21
- } from "./chunk-FXHGO3NH.js";
21
+ } from "./chunk-APMA7XXB.js";
22
22
  import {
23
23
  resolveAutoProxy
24
- } from "./chunk-MFWQEG2W.js";
24
+ } from "./chunk-UDJHYQSZ.js";
25
25
  import {
26
26
  decodeWellFormedEscapes
27
27
  } from "./chunk-BSQ7XANM.js";
@@ -21,7 +21,7 @@ import {
21
21
  } from "./chunk-PBN6GBJE.js";
22
22
 
23
23
  // src/cloud/poll.ts
24
- var DEFAULT_POLL_INTERVAL_MS = 1e4;
24
+ var DEFAULT_POLL_INTERVAL_MS = 2e3;
25
25
  var DEFAULT_MAX_WAIT_MS = 60 * 60 * 1e3;
26
26
  var TERMINAL_STATUSES = /* @__PURE__ */ new Set(["completed", "failed"]);
27
27
  var PollTimeoutError = class extends Error {