hyperframes 0.8.141 → 0.8.143

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 (200) hide show
  1. package/dist/{add-KH2CF4FD.js → add-Q5EYDUAY.js} +18 -17
  2. package/dist/{animatedGifPrep-QO4BSKR7.js → animatedGifPrep-H2DUQEZ3.js} +15 -15
  3. package/dist/{asset-4RDZILVJ.js → asset-C7JBYYX4.js} +4 -4
  4. package/dist/{assetCataloger-WGR4LYYN.js → assetCataloger-FRO4G6OU.js} +8 -7
  5. package/dist/{auth-WYQCOYE5.js → auth-FRWLCO36.js} +5 -4
  6. package/dist/{autoUpdate-PC5TN3NL.js → autoUpdate-E4OZXQK6.js} +2 -2
  7. package/dist/{backgroundChecks-7M3T44EP.js → backgroundChecks-FSUVHN5L.js} +3 -3
  8. package/dist/backgroundChecksWorker.js +3 -3
  9. package/dist/{batchRender-GOLLOE4V.js → batchRender-4U73BYTU.js} +11 -10
  10. package/dist/{beats-XJ7WP6QS.js → beats-U6KJWF35.js} +32 -28
  11. package/dist/{benchmark-HCGFBEZJ.js → benchmark-5ONT7V7B.js} +15 -14
  12. package/dist/{browser-VQKO2FKG.js → browser-R4DU46IE.js} +4 -4
  13. package/dist/{bundleWithLocalizedFonts-FH7PHTTX.js → bundleWithLocalizedFonts-VH55VOAL.js} +2 -2
  14. package/dist/{capture-TFZZSF6F.js → capture-26G2DPSI.js} +83 -41
  15. package/dist/{capture-XD3P3YQR.js → capture-OGQAEYKO.js} +24 -8
  16. package/dist/{catalog-4S33QWJJ.js → catalog-RKORTIUE.js} +19 -18
  17. package/dist/{catch-up-RW7YXXNT.js → catch-up-4OBERRQO.js} +5 -5
  18. package/dist/{check-XVTRRN4Y.js → check-P2XDN57S.js} +89 -85
  19. package/dist/{checkBrowser-HZXJ2EDU.js → checkBrowser-NTGJGAEA.js} +42 -42
  20. package/dist/{chunk-AVWEIOEN.js → chunk-2LBBHMKT.js} +1 -1
  21. package/dist/{chunk-E6SDW5FV.js → chunk-33RZPZ4K.js} +192 -45
  22. package/dist/{chunk-6IFXWJDX.js → chunk-3NE7ZYU2.js} +2 -2
  23. package/dist/{chunk-TQFG7HTI.js → chunk-3RM2ETQT.js} +0 -168
  24. package/dist/{chunk-PFCFR3KZ.js → chunk-442JNXRM.js} +1 -1
  25. package/dist/{chunk-6E6CM7WS.js → chunk-4M4EC7JX.js} +19 -12
  26. package/dist/{chunk-HKCNZITN.js → chunk-4OA4LDTU.js} +2 -2
  27. package/dist/{chunk-XTFJOR3K.js → chunk-4SFGME7K.js} +1 -1
  28. package/dist/{chunk-34TXESM7.js → chunk-5FISWJ37.js} +12 -4
  29. package/dist/{chunk-JYYOAKHS.js → chunk-6IIGT7BX.js} +1 -1
  30. package/dist/chunk-6TPZSTCL.js +3681 -0
  31. package/dist/{chunk-P6E4HFFU.js → chunk-6XMFEICO.js} +263 -75
  32. package/dist/{chunk-6Q6FR4KH.js → chunk-7UYBQ6NF.js} +296 -89
  33. package/dist/{chunk-BRITLL56.js → chunk-B4P5VDFQ.js} +1 -1
  34. package/dist/{chunk-U7E736AJ.js → chunk-BFDJ63J5.js} +32 -14
  35. package/dist/{chunk-WCJGTLPF.js → chunk-BHVFTYSI.js} +6 -3
  36. package/dist/{chunk-IO7ZIDRP.js → chunk-BT27OYYX.js} +53 -12
  37. package/dist/{chunk-KFH6UD26.js → chunk-BYK73CR7.js} +4 -4
  38. package/dist/{chunk-L3JSAB4L.js → chunk-CLOH4LIB.js} +3 -3
  39. package/dist/{chunk-R7UDXKI3.js → chunk-DF2BHILQ.js} +3 -3
  40. package/dist/{chunk-246MOR5U.js → chunk-DKSDVDXG.js} +175 -162
  41. package/dist/{chunk-35RSNI77.js → chunk-F26LCYRY.js} +42 -34
  42. package/dist/{chunk-5Z63TBTX.js → chunk-FH7WODJH.js} +1 -1
  43. package/dist/{chunk-NORZWWLK.js → chunk-FVYXDXEV.js} +2 -2
  44. package/dist/{chunk-YURXPGAM.js → chunk-GNBGPUJ7.js} +6 -8
  45. package/dist/{chunk-RVCWIIZ7.js → chunk-GV5R5B7Q.js} +1 -1
  46. package/dist/{chunk-GS6FE3IW.js → chunk-HC7EVDEL.js} +1 -1
  47. package/dist/{chunk-K2GOFLTX.js → chunk-HLYOEIWM.js} +14 -6
  48. package/dist/{chunk-XDSOIJC3.js → chunk-HMT2RPZU.js} +6 -6
  49. package/dist/{chunk-IKVBTDLO.js → chunk-HW4AKJ5F.js} +1 -1
  50. package/dist/{chunk-OLDDJS3S.js → chunk-I7QGQAZM.js} +8 -8
  51. package/dist/{chunk-JFKL3WAE.js → chunk-IWFLMU2N.js} +104 -19
  52. package/dist/{chunk-IHFUKJOR.js → chunk-K2FLNJVB.js} +8 -2
  53. package/dist/chunk-KJJLA674.js +121 -0
  54. package/dist/{chunk-XWVGSEUT.js → chunk-KO5QBV73.js} +1 -1
  55. package/dist/{chunk-INI3TM6I.js → chunk-KQLGTGE5.js} +3 -3
  56. package/dist/{chunk-E4BSCXMU.js → chunk-LVX6NK36.js} +3 -3
  57. package/dist/{chunk-BM5PX3DJ.js → chunk-LW6HO6U3.js} +4 -4
  58. package/dist/{chunk-OZUQF4NB.js → chunk-MQZVBHEY.js} +123 -8
  59. package/dist/{chunk-IV7EI5E2.js → chunk-N3DQEVSI.js} +2 -2
  60. package/dist/{chunk-A4KQZXZI.js → chunk-NE55C6S5.js} +4 -2
  61. package/dist/{chunk-EDYBFSPE.js → chunk-OBXQRJWQ.js} +7 -10
  62. package/dist/{chunk-RCFCZT5O.js → chunk-OSSHSIMD.js} +1 -1
  63. package/dist/chunk-P36MALQF.js +15 -0
  64. package/dist/{chunk-EKA4ZZBI.js → chunk-P7THMINS.js} +3 -3
  65. package/dist/{chunk-3NBKW2QJ.js → chunk-PAGIICKN.js} +2 -2
  66. package/dist/{chunk-O3SKIXQK.js → chunk-PJU63L6W.js} +1 -1
  67. package/dist/{chunk-RPYPW5NN.js → chunk-POLR33RB.js} +20 -13
  68. package/dist/{chunk-7M4KAPAA.js → chunk-PUGIRFPX.js} +2 -2
  69. package/dist/{chunk-7XTZVLE6.js → chunk-QFN7NVWM.js} +1 -1
  70. package/dist/{chunk-D2KNWIQ6.js → chunk-QFSCCQIR.js} +1 -1
  71. package/dist/{chunk-J5IPIQU2.js → chunk-QRKLPWEX.js} +1 -1
  72. package/dist/{chunk-N77KD7ZZ.js → chunk-QVYVUCWD.js} +1 -1
  73. package/dist/{chunk-GK4AIFIH.js → chunk-SDYDNHEE.js} +34 -3
  74. package/dist/{chunk-2NCHQUPX.js → chunk-SQLK7SJL.js} +1 -1
  75. package/dist/{chunk-PMRBLBUP.js → chunk-T42U2W2R.js} +14 -2
  76. package/dist/{chunk-Q65ZQFF2.js → chunk-TAMQYQGJ.js} +1 -1
  77. package/dist/{chunk-PXSM4HPB.js → chunk-U3X3TPBW.js} +1 -1
  78. package/dist/{chunk-3A5AAPMP.js → chunk-UICWP23D.js} +1 -1
  79. package/dist/{chunk-A7YQNIQT.js → chunk-UM2GRYM3.js} +113 -10
  80. package/dist/{chunk-TC2FBZJZ.js → chunk-VIVBA6E6.js} +2 -2
  81. package/dist/{chunk-W6HTOVHU.js → chunk-W35EKBS6.js} +2 -2
  82. package/dist/{chunk-YEIFI443.js → chunk-WPNE5NEP.js} +1 -1
  83. package/dist/{chunk-WY5OODN5.js → chunk-XONFUK3M.js} +3693 -28
  84. package/dist/{chunk-IYFKBFTW.js → chunk-Y6QL2LGO.js} +8 -5
  85. package/dist/{chunk-THXFSPLV.js → chunk-ZIRIDSDB.js} +1 -1
  86. package/dist/chunk-ZLW2V65P.js +209 -0
  87. package/dist/{chunk-4BB7V6AI.js → chunk-ZQQ3SEIE.js} +33 -32
  88. package/dist/{clean-L2E4VD57.js → clean-YHGPY33K.js} +23 -23
  89. package/dist/cli.js +57 -159
  90. package/dist/{cloud-IDUQRYLO.js → cloud-DOFI5ISR.js} +4 -4
  91. package/dist/{cloudrun-R3JXWXGG.js → cloudrun-KTZ4XDHL.js} +13 -12
  92. package/dist/commands/contrast-audit.browser.js +60 -4
  93. package/dist/commands/layout-audit.browser.js +88 -20
  94. package/dist/{compare-VYBWSP3Y.js → compare-SMMIZN2C.js} +37 -37
  95. package/dist/{compiler-ACHWOU5N.js → compiler-TEXQWW6N.js} +14 -11
  96. package/dist/{component-PYYV2V3F.js → component-B3GCNGSS.js} +5 -5
  97. package/dist/{compositions-B5GQSXH7.js → compositions-OQNZZTKF.js} +38 -34
  98. package/dist/{delete-EAX2U3WI.js → delete-EL5LVSEP.js} +6 -6
  99. package/dist/{deterministicFonts-F6WIVL2W.js → deterministicFonts-U2BIMGPG.js} +3 -3
  100. package/dist/{dist-NZSQCYOF.js → dist-5UVIRMSM.js} +7 -7
  101. package/dist/{dist-ROUDWGLO.js → dist-XN234YFQ.js} +41 -39
  102. package/dist/{doctor-PJX7MLFG.js → doctor-UOL3OI2A.js} +17 -17
  103. package/dist/{dom-IROKGVJI.js → dom-37K6YOH4.js} +2 -2
  104. package/dist/{events-SBC54MHO.js → events-K2DB2PBC.js} +2 -2
  105. package/dist/{events-YFFXKAQQ.js → events-NIZBS6S7.js} +3 -3
  106. package/dist/{feedback-UETLWREV.js → feedback-QMP4E6L7.js} +16 -15
  107. package/dist/{figma-QDSJPIRW.js → figma-2AUJRNVC.js} +3 -3
  108. package/dist/fontLocalizeCli.js +18 -18
  109. package/dist/{get-B5TS6C7H.js → get-P5NC7SRM.js} +6 -6
  110. package/dist/{gpuPolicy-LYOVBAJP.js → gpuPolicy-7N5MCE2G.js} +15 -15
  111. package/dist/{grade-compare-LBIHMAUN.js → grade-compare-HV5AFZ6P.js} +37 -37
  112. package/dist/{help-XBP6A6LT.js → help-3TSTXBLN.js} +1 -1
  113. package/dist/{history-2S42ZXKL.js → history-D65XFJ6D.js} +6 -6
  114. package/dist/hyperframe-runtime.js +25 -25
  115. package/dist/hyperframe.manifest.json +1 -1
  116. package/dist/hyperframe.runtime.iife.js +25 -25
  117. package/dist/hyperframes-player.global.js +3 -3
  118. package/dist/hyperframes-slideshow.global.js +23 -23
  119. package/dist/{info-I2VDAWT7.js → info-TXV7MLFO.js} +17 -16
  120. package/dist/{init-BGHSDODI.js → init-OSDMJZJV.js} +38 -38
  121. package/dist/{inspect-MZK5B5RP.js → inspect-RQQSAYIJ.js} +38 -38
  122. package/dist/{installer-LL4QAKFW.js → installer-CDOB32HE.js} +11 -10
  123. package/dist/{keyframes-2EBF7OSS.js → keyframes-V75Q6GRM.js} +10 -10
  124. package/dist/{lambda-XKFPAOFE.js → lambda-RODV4RCX.js} +12 -11
  125. package/dist/{layout-TP5ERKEF.js → layout-IZAI5SFC.js} +38 -38
  126. package/dist/{lint-FQ6CEI7E.js → lint-PLXOXY5R.js} +14 -14
  127. package/dist/{lintProject-LM3XZRPZ.js → lintProject-OQ6H6XBR.js} +7 -7
  128. package/dist/{list-FRNUJXZ3.js → list-BQBPNKDZ.js} +7 -7
  129. package/dist/{login-C25QU3BQ.js → login-NP6F4FHC.js} +20 -24
  130. package/dist/{logout-GJXZQKOA.js → logout-B4KS4A7S.js} +6 -6
  131. package/dist/{manager-DXB7JDHU.js → manager-GXYF4AVO.js} +2 -2
  132. package/dist/{manager-524RPYO7.js → manager-RFZNG5YT.js} +2 -2
  133. package/dist/{media-treatment-DCANGWSV.js → media-treatment-PXGMZ4A4.js} +55 -34
  134. package/dist/{models-GOD6ARB3.js → models-CEZM6XZ7.js} +17 -17
  135. package/dist/{motionShot-FSKETANX.js → motionShot-R4GHYWYM.js} +25 -25
  136. package/dist/{normalize-IGLHCWTF.js → normalize-H6KUHHEI.js} +18 -7
  137. package/dist/{normalize-audio-C2IM7OID.js → normalize-audio-MQ7NFCOV.js} +10 -6
  138. package/dist/{open-VVISXIII.js → open-AKQTGNXF.js} +5 -5
  139. package/dist/{pipeline-7YHZPYIS.js → pipeline-SYJYP2RM.js} +17 -17
  140. package/dist/{play-DSELK7G3.js → play-NBH4B7PL.js} +31 -30
  141. package/dist/{present-N72YFDKP.js → present-XAX55CFS.js} +26 -26
  142. package/dist/{preview-XTYN4NJ2.js → preview-OLANKNFA.js} +26 -26
  143. package/dist/{producer-NDCU3MHK.js → producer-Q6YNZZUJ.js} +1 -1
  144. package/dist/{projectConfig-MH4QU4AC.js → projectConfig-EM26P45P.js} +13 -12
  145. package/dist/{publication-KUSHI5MG.js → publication-OXWJZKSX.js} +8 -7
  146. package/dist/{publish-3XEEFWMF.js → publish-4VBWP2UB.js} +23 -22
  147. package/dist/{refresh-MFITBIKV.js → refresh-PVHBEABE.js} +2 -2
  148. package/dist/{remove-background-2QKJ7XOD.js → remove-background-REB7427G.js} +19 -19
  149. package/dist/{render-75E342ZU.js → render-3CVZ2SZG.js} +13 -12
  150. package/dist/{render-S73DW4KK.js → render-K25YOG3M.js} +22 -21
  151. package/dist/{render-2DVYTVLQ.js → render-TSE75QUL.js} +35 -35
  152. package/dist/{render-batch-YURBS54Q.js → render-batch-GGUOK3DS.js} +13 -12
  153. package/dist/{renderCancellation-373ASJTO.js → renderCancellation-PZRWB53I.js} +15 -15
  154. package/dist/renderSetupWorker.js +7 -7
  155. package/dist/{resolver-FE3GBZ4T.js → resolver-S5VK6UCB.js} +10 -9
  156. package/dist/{screenshotCapture-ECBTLCU6.js → screenshotCapture-TEUIWXWN.js} +53 -33
  157. package/dist/{sherpa-B2D3AGP6.js → sherpa-LVIUEAGF.js} +18 -18
  158. package/dist/skills/hyperframes-cli/references/cloud.md +1 -1
  159. package/dist/skills/hyperframes-cli/references/doctor-browser.md +24 -1
  160. package/dist/skills/media-use/references/grading.md +4 -2
  161. package/dist/skills/media-use/scripts/lib/cache.mjs +28 -14
  162. package/dist/skills/media-use/scripts/lib/cache.test.mjs +110 -0
  163. package/dist/skills/media-use/scripts/lib/duck.mjs +2 -1
  164. package/dist/skills/media-use/scripts/lib/duck.test.mjs +87 -0
  165. package/dist/skills/media-use/scripts/lib/probe.mjs +6 -1
  166. package/dist/skills/media-use/scripts/lib/probe.test.mjs +73 -0
  167. package/dist/skills/media-use/scripts/lib/words.mjs +1 -1
  168. package/dist/{skills-ICJ22CZZ.js → skills-I65FU5HD.js} +5 -5
  169. package/dist/{skillsUpdateCheck-GXZN56I5.js → skillsUpdateCheck-J57RNNIV.js} +3 -3
  170. package/dist/{slideshow-EJ4IMY6P.js → slideshow-4OJEPWNZ.js} +1 -1
  171. package/dist/{snapshot-XHKOAWF4.js → snapshot-YROOGY22.js} +42 -39
  172. package/dist/{src-I7UC3JTL.js → src-JO5JOV7Y.js} +16 -14
  173. package/dist/{src-74PFDTDX.js → src-X426BZAG.js} +17 -17
  174. package/dist/{staticProjectServer-2DGKD6TF.js → staticProjectServer-5VMBS262.js} +23 -23
  175. package/dist/{status-JA6SKQVH.js → status-LXPGSSKY.js} +6 -4
  176. package/dist/studio/assets/{hyperframes-player-5Vx2AiUz.js → hyperframes-player-BXSuksFh.js} +3 -3
  177. package/dist/studio/assets/{index-BAnh7cSQ.js → index-BgOVCqjo.js} +1 -1
  178. package/dist/studio/assets/{index-P8fgj_Xa.js → index-FgyO_5Kv.js} +1 -1
  179. package/dist/studio/assets/{index-C0thd4eM.js → index-J7jpL4pj.js} +157 -157
  180. package/dist/studio/index.html +1 -1
  181. package/dist/studio/index.js +148 -175
  182. package/dist/studio/index.js.map +1 -1
  183. package/dist/{studio-api-PROBO7JG.js → studio-api-VRBZUGAE.js} +22 -18
  184. package/dist/{studioServer-ID6UV2NE.js → studioServer-DBNKZ6I6.js} +50 -50
  185. package/dist/{synthesize-77PTU6C5.js → synthesize-C3IWDAXF.js} +2 -2
  186. package/dist/{telemetry-65LFHIWH.js → telemetry-CXAX3TO3.js} +3 -3
  187. package/dist/{timeline-6UV3JJXD.js → timeline-VQ34WH7J.js} +91 -70
  188. package/dist/{tokens-HIL4TZXI.js → tokens-62R7VFAZ.js} +4 -4
  189. package/dist/{transcribe-TIO6W3EQ.js → transcribe-7KR7IPJA.js} +18 -18
  190. package/dist/{transcribe-V7F6QDSN.js → transcribe-XOHPPL2O.js} +11 -11
  191. package/dist/{tts-TOHSPWEG.js → tts-MUV42JXT.js} +6 -6
  192. package/dist/{updateCheck-GZELANMA.js → updateCheck-POYNH3B5.js} +2 -2
  193. package/dist/{upgrade-BX3KDDZJ.js → upgrade-NBNOT7J2.js} +2 -2
  194. package/dist/{urlDownloader-R76OHFIE.js → urlDownloader-3NS63A7B.js} +14 -14
  195. package/dist/{validate-7UX4I443.js → validate-Y2QDHAEP.js} +40 -28
  196. package/dist/{video-RVGYEFQU.js → video-SJDMTSTL.js} +15 -15
  197. package/package.json +1 -1
  198. package/dist/chunk-24OWOBQH.js +0 -3656
  199. package/dist/chunk-SYKKFAUW.js +0 -3711
  200. /package/dist/{chunk-HBBJFK6I.js → chunk-APDLWWFG.js} +0 -0
@@ -21,7 +21,7 @@ import {
21
21
  splitElementInHtml,
22
22
  unwrapElementsFromHtml,
23
23
  wrapElementsInHtml
24
- } from "./chunk-A7YQNIQT.js";
24
+ } from "./chunk-UM2GRYM3.js";
25
25
  import {
26
26
  MAX_WINDOW_IDLE_MS,
27
27
  STUDIO_SIGNATURE_MANIFEST_PATHS,
@@ -39,9 +39,11 @@ import {
39
39
  DEFAULT_TARGET_LUFS,
40
40
  absoluteLoudnessPlan,
41
41
  measureAudio,
42
+ requestSubPath,
43
+ requestedProjectPath,
42
44
  requiredFfmpeg,
43
45
  resolveLocalAudioPath
44
- } from "./chunk-U7E736AJ.js";
46
+ } from "./chunk-BFDJ63J5.js";
45
47
  import {
46
48
  PROXY_PARAMS_VERSION,
47
49
  PROXY_PENDING_RETRY_AFTER_SECONDS,
@@ -63,7 +65,7 @@ import {
63
65
  scanProjectMediaCodecMap,
64
66
  shouldPrewarmProxy,
65
67
  waitForProxy
66
- } from "./chunk-4BB7V6AI.js";
68
+ } from "./chunk-ZQQ3SEIE.js";
67
69
  import {
68
70
  STUDIO_MOTION_PATH,
69
71
  createStudioMotionRenderBodyScript,
@@ -96,10 +98,10 @@ import {
96
98
  } from "./chunk-TJSTGSAW.js";
97
99
  import {
98
100
  addScenePartsManifest
99
- } from "./chunk-35RSNI77.js";
101
+ } from "./chunk-F26LCYRY.js";
100
102
  import {
101
103
  ensureHfIds
102
- } from "./chunk-A4KQZXZI.js";
104
+ } from "./chunk-NE55C6S5.js";
103
105
  import {
104
106
  PREVIEW_PROXY_BOX_PARAM,
105
107
  formatPreviewProxyBox,
@@ -109,12 +111,7 @@ import {
109
111
  parseFps,
110
112
  parsePreviewProxyBox,
111
113
  sameInstant
112
- } from "./chunk-6E6CM7WS.js";
113
- import {
114
- MagicString,
115
- VALID_CANVAS_RESOLUTIONS,
116
- unrollComputedTimeline
117
- } from "./chunk-OZUQF4NB.js";
114
+ } from "./chunk-4M4EC7JX.js";
118
115
  import {
119
116
  AFTER_FONTS_SCRIPT_TYPE,
120
117
  RUNTIME_BOOTSTRAP_ATTR,
@@ -128,7 +125,15 @@ import {
128
125
  resolveRateSpec,
129
126
  sourceTimeAt,
130
127
  stripEmbeddedRuntimeScripts
131
- } from "./chunk-SYKKFAUW.js";
128
+ } from "./chunk-6TPZSTCL.js";
129
+ import {
130
+ HTML_ATTRIBUTE_ENTITIES,
131
+ MagicString,
132
+ VALID_CANVAS_RESOLUTIONS,
133
+ decodeAuthoredAttribute,
134
+ scanHtmlOpeningTags,
135
+ unrollComputedTimeline
136
+ } from "./chunk-MQZVBHEY.js";
132
137
  import {
133
138
  ProjectRootMissingError,
134
139
  folderGone,
@@ -140,20 +145,24 @@ import {
140
145
  import {
141
146
  isWithinProjectRoot,
142
147
  readProjectFile
143
- } from "./chunk-JFKL3WAE.js";
148
+ } from "./chunk-IWFLMU2N.js";
144
149
  import {
145
150
  FFPROBE_PATH_ENV,
146
151
  findFfBinary
147
152
  } from "./chunk-PJ3HDUCY.js";
148
153
  import {
154
+ decodeCssEscapes,
155
+ decodeWellFormedEscapes,
156
+ decodedUrlPath,
157
+ encodeUrlPath,
149
158
  readMediaOffsetSeconds,
150
159
  rewriteAssetPaths,
151
160
  rewriteCssAssetUrls,
152
161
  rewriteInlineStyleAssetUrls
153
- } from "./chunk-TQFG7HTI.js";
162
+ } from "./chunk-ZLW2V65P.js";
154
163
  import {
155
164
  parseHTML
156
- } from "./chunk-GK4AIFIH.js";
165
+ } from "./chunk-SDYDNHEE.js";
157
166
  import {
158
167
  ancestor,
159
168
  full,
@@ -291,7 +300,7 @@ function clearElementScreenshotIsolation() {
291
300
  page.__hfThumbnailFaded = [];
292
301
  }
293
302
 
294
- // ../studio-server/dist/chunk-5VCIZYUE.js
303
+ // ../studio-server/dist/chunk-AYKLBPP2.js
295
304
  import { resolve } from "path";
296
305
  function isAutoProxyEnabled(adapter) {
297
306
  return adapter.autoProxy !== false;
@@ -381,7 +390,7 @@ import {
381
390
  readdirSync as readdirSync2,
382
391
  realpathSync
383
392
  } from "fs";
384
- import { resolve as resolve2, dirname as dirname3, join as join6 } from "path";
393
+ import { resolve as resolve2, dirname as dirname3, join as join6, sep as sep2 } from "path";
385
394
  import { readFileSync as readFileSync2 } from "fs";
386
395
  import { createHash as createHash2 } from "crypto";
387
396
  import { existsSync, readFileSync as readFileSync3 } from "fs";
@@ -1950,8 +1959,8 @@ function upsertProp(ms, objNode, key, value) {
1950
1959
  if (existing) {
1951
1960
  ms.overwrite(existing.value.start, existing.value.end, valueToCode(value));
1952
1961
  } else {
1953
- const sep3 = objNode.properties.length > 0 ? ", " : "";
1954
- ms.appendLeft(objNode.end - 1, `${sep3}${safeKey(key)}: ${valueToCode(value)}`);
1962
+ const sep4 = objNode.properties.length > 0 ? ", " : "";
1963
+ ms.appendLeft(objNode.end - 1, `${sep4}${safeKey(key)}: ${valueToCode(value)}`);
1955
1964
  }
1956
1965
  }
1957
1966
  function isEditableVarKey(key) {
@@ -2569,8 +2578,8 @@ function insertNewKeyframe(ms, kfNode, percentage, pctKey, valueCode) {
2569
2578
  if (insertBeforeProp) {
2570
2579
  ms.appendLeft(insertBeforeProp.start, `${JSON.stringify(pctKey)}: ${valueCode}, `);
2571
2580
  } else {
2572
- const sep3 = allProps.length > 0 ? ", " : "";
2573
- ms.appendLeft(kfNode.end - 1, `${sep3}${JSON.stringify(pctKey)}: ${valueCode}`);
2581
+ const sep4 = allProps.length > 0 ? ", " : "";
2582
+ ms.appendLeft(kfNode.end - 1, `${sep4}${JSON.stringify(pctKey)}: ${valueCode}`);
2574
2583
  }
2575
2584
  }
2576
2585
  function collapseKeyframesToFlat(ms, varsNode, source, remainingRecord) {
@@ -3048,8 +3057,8 @@ function enableArcPath(ms, call, animation, config) {
3048
3057
  const k = propKeyName2(p);
3049
3058
  return k !== "x" && k !== "y";
3050
3059
  });
3051
- const sep3 = survivesRemoval ? ", " : "";
3052
- ms.appendRight(vars.start + 1, ` motionPath: ${motionPathCode}${sep3}`);
3060
+ const sep4 = survivesRemoval ? ", " : "";
3061
+ ms.appendRight(vars.start + 1, ` motionPath: ${motionPathCode}${sep4}`);
3053
3062
  stripXYFromKeyframes(ms, findPropertyNode2(call.varsArg, "keyframes"));
3054
3063
  removePropsByKey(ms, call.varsArg, /* @__PURE__ */ new Set(["x", "y"]));
3055
3064
  return true;
@@ -3590,7 +3599,7 @@ import { readFileSync as readFileSync7 } from "fs";
3590
3599
  import { join as join9 } from "path";
3591
3600
  import { streamSSE } from "hono/streaming";
3592
3601
  import { existsSync as existsSync6, lstatSync as lstatSync3, readFileSync as readFileSync8, unlinkSync as unlinkSync3, readdirSync as readdirSync3, statSync as statSync5 } from "fs";
3593
- import { join as join10 } from "path";
3602
+ import { dirname as dirname5, join as join10 } from "path";
3594
3603
  import { HTTPException } from "hono/http-exception";
3595
3604
  import { open, stat } from "fs/promises";
3596
3605
  import { createHash as createHash3 } from "crypto";
@@ -3612,7 +3621,7 @@ import { existsSync as existsSync7, readFileSync as readFileSync10, statSync as
3612
3621
  import { join as join12, resolve as resolve5 } from "path";
3613
3622
  import { execFile } from "child_process";
3614
3623
  import { readFileSync as readFileSync11, rmSync as rmSync5, statSync as statSync8 } from "fs";
3615
- import { basename as basename2, dirname as dirname5, join as join13, relative as relative4, sep as sep2 } from "path";
3624
+ import { basename as basename2, dirname as dirname6, join as join13, relative as relative4, sep as sep3 } from "path";
3616
3625
  import { createHash as createHash5, randomBytes } from "crypto";
3617
3626
  import { existsSync as existsSync8 } from "fs";
3618
3627
  import { existsSync as existsSync9, readFileSync as readFileSync12, statSync as statSync9 } from "fs";
@@ -3622,7 +3631,7 @@ import { promisify } from "util";
3622
3631
  import { closeSync as closeSync3, constants as constants2, fstatSync as fstatSync3, openSync as openSync3, readSync } from "fs";
3623
3632
  import { streamSSE as streamSSE2 } from "hono/streaming";
3624
3633
  import { existsSync as existsSync10 } from "fs";
3625
- import { basename as basename3, dirname as dirname6, extname, join as join15, posix } from "path";
3634
+ import { basename as basename3, dirname as dirname7, extname, join as join15, posix } from "path";
3626
3635
  import { existsSync as existsSync11, readFileSync as readFileSync13 } from "fs";
3627
3636
  import { homedir } from "os";
3628
3637
  import { join as join16 } from "path";
@@ -4572,12 +4581,6 @@ function resolveGsapWriter(env) {
4572
4581
  if (configured === "recast" || configured === "acorn") return configured;
4573
4582
  throw new Error(`Invalid ${GSAP_WRITER_MIGRATION.flag}=${configured}; expected recast or acorn`);
4574
4583
  }
4575
- function requestSubPath(url, route) {
4576
- const routeSegments = route.split("/");
4577
- const segments = new URL(url).pathname.split("/");
4578
- const start = segments.indexOf(routeSegments[0] ?? "");
4579
- return decodeURIComponent(segments.slice(start + routeSegments.length).join("/"));
4580
- }
4581
4584
  async function loadGsapParser() {
4582
4585
  return import("./gsapParser-UP3PNPC2.js");
4583
4586
  }
@@ -4879,15 +4882,114 @@ var escapeRegExp = (text2) => text2.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
4879
4882
  var SEPARATOR = String.raw`\\{0,2}[\\/]`;
4880
4883
  var REFERENCE_START = String.raw`(?<![\w./\\+-])`;
4881
4884
  var FILE_END = String.raw`(?![\w-]|\.\w)`;
4885
+ var ENTITY_SPELLINGS = HTML_ATTRIBUTE_ENTITIES;
4886
+ function referenceSpellings(char) {
4887
+ const spellings = [escapeRegExp(char)];
4888
+ const encoded = encodeUrlPath(char);
4889
+ if (encoded !== char)
4890
+ spellings.push(encoded.replace(/[A-F]/g, (hex) => `[${hex}${hex.toLowerCase()}]`));
4891
+ if (ENTITY_SPELLINGS[char]) spellings.push(...ENTITY_SPELLINGS[char]);
4892
+ if (["'", '"', "`", "$", " ", "(", ")"].includes(char)) {
4893
+ spellings.push(escapeRegExp(`&#92;${char}`), escapeRegExp(`&#92;${escapeHtmlReference(char)}`));
4894
+ }
4895
+ const scriptSpelling = escapeQuotedReference(char, '"');
4896
+ if (scriptSpelling !== char) spellings.push(escapeRegExp(scriptSpelling));
4897
+ if (["'", "`", "$", " ", "(", ")"].includes(char)) spellings.push(escapeRegExp(`\\${char}`));
4898
+ if (/[\t\n\f\r =<>`]/.test(char)) spellings.push(`&#${char.codePointAt(0)};`);
4899
+ if (char.charCodeAt(0) < 32 || char.charCodeAt(0) === 127) {
4900
+ spellings.push(escapeRegExp(`\\${char.charCodeAt(0).toString(16)} `));
4901
+ }
4902
+ return spellings.length === 1 ? spellings[0] : `(?:${spellings.join("|")})`;
4903
+ }
4904
+ function escapeHtmlReference(path) {
4905
+ return path.replace(/[&"']/g, (char) => ENTITY_SPELLINGS[char][0]);
4906
+ }
4907
+ function escapeQuotedReference(path, quote) {
4908
+ const escaped = JSON.stringify(path).slice(1, -1);
4909
+ return quote === '"' ? escaped : escaped.replace(new RegExp(escapeRegExp(quote), "g"), `\\${quote}`);
4910
+ }
4911
+ function escapeRawUrlPath(path) {
4912
+ const encodeSpaces = path.startsWith(" ") || path.endsWith(" ");
4913
+ return path.replace(/[\s\S]/g, (char) => {
4914
+ if (char.charCodeAt(0) < 32 || ":?%#\\".includes(char) || encodeSpaces && char === " ") {
4915
+ return encodeUrlPath(char);
4916
+ }
4917
+ return char;
4918
+ });
4919
+ }
4920
+ function spellLike(reference, path, oldPath, context) {
4921
+ const { syntax, quote, url, encodeAll } = context;
4922
+ if (url && (encodeAll || reference !== oldPath && /%[0-9A-Fa-f]{2}/.test(reference)))
4923
+ return encodeUrlPath(path);
4924
+ switch (syntax) {
4925
+ case "html": {
4926
+ const escaped = escapeHtmlReference(url ? escapeRawUrlPath(path) : path);
4927
+ return ["'", '"'].includes(quote) ? escaped : escaped.replace(/[\t\n\f\r =<>`]/g, (char) => `&#${char.codePointAt(0)};`);
4928
+ }
4929
+ case "script": {
4930
+ if (!["'", '"', "`"].includes(quote)) return path;
4931
+ const escaped = escapeQuotedReference(path, quote);
4932
+ return quote === "`" ? escaped.replace(/\$\{/g, "\\${") : escaped;
4933
+ }
4934
+ case "css":
4935
+ return url ? encodeUrlPath(path) : path;
4936
+ case "plain":
4937
+ return path;
4938
+ }
4939
+ }
4940
+ function referenceSyntax(file) {
4941
+ if (/\.html$/i.test(file)) return "html";
4942
+ if (/\.css$/i.test(file)) return "css";
4943
+ if (/\.(?:[cm]?js|jsx|tsx?|json)$/i.test(file)) return "script";
4944
+ return "plain";
4945
+ }
4946
+ function decodeQuotedReference(text2, syntax) {
4947
+ if (syntax === "css") return decodeCssEscapes(text2);
4948
+ if (syntax === "script") {
4949
+ const controls = { b: "\b", f: "\f", n: "\n", r: "\r", t: " " };
4950
+ return text2.replace(
4951
+ /\\(?:u([0-9a-fA-F]{4})|([bfnrt"'`$\\/]))/g,
4952
+ (_escaped, hex, char) => {
4953
+ if (hex !== void 0) return String.fromCharCode(Number.parseInt(hex, 16));
4954
+ return controls[char] ?? char;
4955
+ }
4956
+ );
4957
+ }
4958
+ return text2;
4959
+ }
4882
4960
  function referencePattern(oldPath, isDirectory) {
4883
- const name = oldPath.split("/").map(escapeRegExp).join(SEPARATOR);
4961
+ const name = oldPath.split("/").map((segment) => Array.from(segment, referenceSpellings).join("")).join(SEPARATOR);
4884
4962
  const end = isDirectory ? `(?=${SEPARATOR})` : FILE_END;
4885
4963
  return new RegExp(
4886
4964
  String.raw`${REFERENCE_START}(?<lead>(?:\.{1,2}${SEPARATOR}|${SEPARATOR}){0,4})${name}${end}`,
4887
4965
  "g"
4888
4966
  );
4889
4967
  }
4968
+ function rewriteEntityAttributes(text2, rewrite) {
4969
+ const parts = [];
4970
+ let cursor = 0;
4971
+ for (const tag of scanHtmlOpeningTags(text2)) {
4972
+ for (const attr of tag.attributes) {
4973
+ if (attr.kind !== "value") continue;
4974
+ const decoded = decodeAuthoredAttribute(attr.value);
4975
+ if (decoded === attr.value) continue;
4976
+ let value = escapeHtmlReference(decoded);
4977
+ if (!attr.quote)
4978
+ value = value.replace(/[\t\n\f\r =<>`]/g, (char) => `&#${char.codePointAt(0)};`);
4979
+ const source = `<x ${attr.name}=${attr.quote}${value}${attr.quote}>`;
4980
+ const updated = rewrite(source);
4981
+ if (updated === source) continue;
4982
+ const replacement = scanHtmlOpeningTags(updated)[0].attributes[0];
4983
+ if (replacement.kind !== "value") throw new Error("Reference rewrite removed its attribute");
4984
+ parts.push(text2.slice(cursor, attr.valueStart), replacement.value);
4985
+ cursor = attr.valueEnd;
4986
+ }
4987
+ }
4988
+ parts.push(text2.slice(cursor));
4989
+ return parts.join("");
4990
+ }
4890
4991
  function referenceRewriter(oldPath, newPath, isDirectory, existing = []) {
4992
+ const oldIdentity = sep2 === "\\" ? oldPath.replace(/\\/g, "/") : oldPath;
4891
4993
  const pattern = referencePattern(oldPath, isDirectory);
4892
4994
  const around = /* @__PURE__ */ new Map();
4893
4995
  const afterLengths = /* @__PURE__ */ new Set();
@@ -4901,24 +5003,123 @@ function referenceRewriter(oldPath, newPath, isDirectory, existing = []) {
4901
5003
  before
4902
5004
  );
4903
5005
  afterLengths.add(after.length);
4904
- window2 = Math.max(window2, path.length * 3);
4905
- }
4906
- }
4907
- const normalized = (text2) => text2.replace(/\\{0,2}[\\/]/g, "/");
4908
- return (text2) => text2.replace(pattern, (...args) => {
4909
- const [match, offset] = [args[0], args.at(-3)];
4910
- const { lead } = args.at(-1);
4911
- const at = offset + lead.length;
4912
- const head = normalized(text2.slice(Math.max(0, at - window2), at));
4913
- const tail = normalized(text2.slice(offset + match.length, offset + match.length + window2));
4914
- const inLonger = [...afterLengths].some((after) => {
4915
- const befores = tail.length >= after && around.get(tail.slice(0, after));
4916
- return befores && [...befores].some(
4917
- ([length, set]) => head.length >= length && set.has(head.slice(head.length - length))
5006
+ window2 = Math.max(window2, path.length * 9);
5007
+ }
5008
+ }
5009
+ const normalized = (text2, context, full2 = false) => {
5010
+ let value = text2;
5011
+ if (context.syntax === "html" || context.htmlAttribute) {
5012
+ value = decodeAuthoredAttribute(value);
5013
+ }
5014
+ value = decodeQuotedReference(value, context.syntax);
5015
+ if (context.url) {
5016
+ value = value.replace(/\\/g, "/");
5017
+ value = full2 ? decodedUrlPath(value) : decodeWellFormedEscapes(value);
5018
+ }
5019
+ return sep2 === "\\" ? value.replace(/\\/g, "/") : value;
5020
+ };
5021
+ return function rewriteText(text2, syntax = "html", normalizeEntities = true) {
5022
+ if (syntax === "html" && normalizeEntities) {
5023
+ text2 = rewriteEntityAttributes(text2, (source) => rewriteText(source, "html", false));
5024
+ }
5025
+ pattern.lastIndex = 0;
5026
+ if (!pattern.test(text2)) return text2;
5027
+ pattern.lastIndex = 0;
5028
+ const tags = syntax === "html" ? scanHtmlOpeningTags(text2) : [];
5029
+ const inlineRegions = tags.filter(
5030
+ (tag) => tag.closed && ["script", "style"].includes(tag.name) && tag.rawTextEnd !== null
5031
+ ).map((tag) => ({
5032
+ start: tag.end,
5033
+ end: tag.rawTextEnd,
5034
+ syntax: tag.name === "style" ? "css" : "script"
5035
+ }));
5036
+ const attributes = tags.flatMap(
5037
+ (tag) => tag.attributes.flatMap((attr) => attr.kind === "value" ? [attr] : [])
5038
+ );
5039
+ const cssContexts = syntax === "css" ? [{ start: 0, end: text2.length, htmlAttribute: false }] : [
5040
+ ...inlineRegions.filter((region) => region.syntax === "css").map((region) => ({ ...region, htmlAttribute: false })),
5041
+ ...attributes.filter((attr) => attr.name === "style").map((attr) => ({ ...attr, htmlAttribute: true }))
5042
+ ];
5043
+ const cssFields = (pattern2) => cssContexts.flatMap(
5044
+ (context) => [...text2.slice(context.start, context.end).matchAll(pattern2)].map((match) => {
5045
+ const prefix = /^(?:url\(\s*|@import\s+)/i.exec(match[0])[0];
5046
+ const rest = match[0].slice(prefix.length);
5047
+ const delimiter = context.htmlAttribute ? /^(?:["']|&quot;|&#39;|&apos;)/.exec(rest)?.[0] : /^["']/.exec(rest)?.[0];
5048
+ const start = context.start + match.index + prefix.length + (delimiter?.length ?? 0);
5049
+ return {
5050
+ start,
5051
+ end: context.start + match.index + match[0].length,
5052
+ syntax: "css",
5053
+ htmlAttribute: context.htmlAttribute,
5054
+ encodeAll: true
5055
+ };
5056
+ })
5057
+ );
5058
+ const urlRegions = [
5059
+ ...attributes.filter((attr) => ["src", "href", "poster", "xlink:href"].includes(attr.name)).map((attr) => ({
5060
+ start: attr.valueStart + (/^[\t\n\f\r ]*/.exec(attr.value)?.[0].length ?? 0),
5061
+ end: attr.valueEnd,
5062
+ syntax: "html",
5063
+ htmlAttribute: true,
5064
+ encodeAll: false
5065
+ })),
5066
+ ...attributes.filter((attr) => attr.name === "srcset").flatMap(
5067
+ (attr) => [...attr.value.matchAll(/(^|,)[\t\n\f\r ]*([^,\t\n\f\r ]+)/g)].map((match) => ({
5068
+ start: attr.valueStart + match.index + match[0].length - match[2].length,
5069
+ end: attr.valueStart + match.index + match[0].length,
5070
+ syntax: "html",
5071
+ htmlAttribute: true,
5072
+ encodeAll: true
5073
+ }))
5074
+ ),
5075
+ ...cssFields(
5076
+ /\burl\((?:\s*"(?:\\.|[^"\\])*"\s*|\s*'(?:\\.|[^'\\])*'\s*|(?:\\.|[^)\\])*)\)/gi
5077
+ ),
5078
+ ...cssFields(/@import\s+(?:"[^"]*"|'[^']*')/gi)
5079
+ ].sort((a, b) => a.start - b.start);
5080
+ let urlIndex = 0;
5081
+ let regionIndex = 0;
5082
+ return text2.replace(pattern, (...args) => {
5083
+ const [match, offset] = [args[0], args.at(-3)];
5084
+ const { lead } = args.at(-1);
5085
+ while (inlineRegions[regionIndex] && inlineRegions[regionIndex].end <= offset) regionIndex++;
5086
+ const region = inlineRegions[regionIndex];
5087
+ const matchSyntax = region && offset >= region.start ? region.syntax : syntax;
5088
+ while (urlRegions[urlIndex] && urlRegions[urlIndex].end <= offset) urlIndex++;
5089
+ const urlRegion = urlRegions[urlIndex];
5090
+ const url = matchSyntax !== "script" && !!urlRegion && offset >= urlRegion.start;
5091
+ const context = {
5092
+ syntax: url ? urlRegion.syntax : matchSyntax,
5093
+ url,
5094
+ htmlAttribute: url && urlRegion.htmlAttribute,
5095
+ encodeAll: url && urlRegion.encodeAll,
5096
+ quote: text2[offset - 1] ?? ""
5097
+ };
5098
+ if (url && offset !== urlRegion.start) return match;
5099
+ const reference = match.slice(lead.length);
5100
+ if (normalized(reference, context, true) !== oldIdentity) return match;
5101
+ if (isDirectory && !normalized(
5102
+ text2.slice(offset + match.length, offset + match.length + 4),
5103
+ context
5104
+ ).startsWith("/"))
5105
+ return match;
5106
+ const at = offset + lead.length;
5107
+ const head = normalized(text2.slice(Math.max(0, at - window2), at), context);
5108
+ const tail = normalized(
5109
+ text2.slice(offset + match.length, offset + match.length + window2),
5110
+ context,
5111
+ context.url
4918
5112
  );
5113
+ const inLonger = [...afterLengths].some((after) => {
5114
+ const befores = tail.length >= after && around.get(tail.slice(0, after));
5115
+ return befores && [...befores].some(
5116
+ ([length, set]) => head.length >= length && set.has(head.slice(head.length - length))
5117
+ );
5118
+ });
5119
+ if (inLonger) return match;
5120
+ return `${lead}${spellLike(reference, newPath, oldPath, context)}`;
4919
5121
  });
4920
- return inLonger ? match : `${lead}${newPath}`;
4921
- });
5122
+ };
4922
5123
  }
4923
5124
  function occurrences(text2, part) {
4924
5125
  const at = [];
@@ -4951,7 +5152,7 @@ function updateReferences(projectDir, oldPath, newPath, isDirectory) {
4951
5152
  if (!isSafePath(projectDir, file) || isPrivateProjectFile(projectDir, file)) continue;
4952
5153
  const content = readableText(file);
4953
5154
  if (content === null) continue;
4954
- const updated = rewrite(content);
5155
+ const updated = rewrite(content, referenceSyntax(file));
4955
5156
  if (updated !== content) {
4956
5157
  replaceFileAtomically(file, updated, statSync3(file).mode);
4957
5158
  updatedCount++;
@@ -5240,7 +5441,7 @@ async function prepareGsapMutationScript(c, res, firstMutation) {
5240
5441
  let block = extractGsapScriptBlock(html);
5241
5442
  if (!block && (firstMutation.type === "add" || firstMutation.type === "add-with-keyframes")) {
5242
5443
  const compId = html.match(/data-composition-id="([^"]+)"/)?.[1] ?? "main";
5243
- const { GSAP_CDN } = await import("./dist-ROUDWGLO.js");
5444
+ const { GSAP_CDN } = await import("./dist-XN234YFQ.js");
5244
5445
  const bootstrap = [
5245
5446
  `<script src="${GSAP_CDN}"></script>`,
5246
5447
  "<script>",
@@ -6828,10 +7029,11 @@ function registerFileRoutes(api, adapter) {
6828
7029
  const res = await resolveProjectFile(c, adapter, { mustExist: true });
6829
7030
  if ("error" in res) return res.error;
6830
7031
  const body = await c.req.json();
6831
- if (!body.newPath || body.newPath.includes("\0")) {
7032
+ const newPath = body !== null && typeof body === "object" && "newPath" in body ? body.newPath : void 0;
7033
+ if (typeof newPath !== "string" || !newPath || newPath.includes("\0") || /[\uD800-\uDFFF]/u.test(newPath)) {
6832
7034
  return c.json({ error: "newPath required" }, 400);
6833
7035
  }
6834
- const newAbs = resolveWithinProject(res.project.dir, body.newPath);
7036
+ const newAbs = resolveWithinProject(res.project.dir, newPath);
6835
7037
  if (!newAbs) {
6836
7038
  return c.json({ error: "forbidden" }, 403);
6837
7039
  }
@@ -6841,8 +7043,8 @@ function registerFileRoutes(api, adapter) {
6841
7043
  const isDirectory = statSync3(res.absPath, { throwIfNoEntry: false })?.isDirectory() ?? false;
6842
7044
  ensureDir(res.project.dir, newAbs);
6843
7045
  renameSync2(res.absPath, newAbs);
6844
- const updatedFiles = updateReferences(res.project.dir, res.filePath, body.newPath, isDirectory);
6845
- return c.json({ ok: true, path: body.newPath, updatedReferences: updatedFiles });
7046
+ const updatedFiles = updateReferences(res.project.dir, res.filePath, newPath, isDirectory);
7047
+ return c.json({ ok: true, path: newPath, updatedReferences: updatedFiles });
6846
7048
  });
6847
7049
  api.post("/projects/:id/duplicate-file", async (c) => {
6848
7050
  const project = await adapter.resolveProject(c.req.param("id"));
@@ -7666,6 +7868,21 @@ function registerLintRoutes(api, adapter) {
7666
7868
  });
7667
7869
  }
7668
7870
  var VALID_RESOLUTIONS = new Set(VALID_CANVAS_RESOLUTIONS);
7871
+ var RENDER_MIME = {
7872
+ ".mp4": "video/mp4",
7873
+ ".webm": "video/webm",
7874
+ ".mov": "video/quicktime"
7875
+ };
7876
+ var RENDER_EXTENSIONS = Object.keys(RENDER_MIME);
7877
+ var RENDER_ARTIFACT_EXTENSIONS = [...RENDER_EXTENSIONS, ".meta.json"];
7878
+ function resolveRenderArtifacts(directories, jobId) {
7879
+ const artifacts = [...new Set(directories)].filter(existsSync6).flatMap(
7880
+ (directory) => RENDER_ARTIFACT_EXTENSIONS.map(
7881
+ (extension) => resolveWithinProject(directory, `${jobId}${extension}`)
7882
+ )
7883
+ );
7884
+ return artifacts.every((path) => path !== null) ? artifacts : null;
7885
+ }
7669
7886
  function contentDispositionHeader(disposition, filename) {
7670
7887
  const fallback = filename.replace(/[^\x20-\x7e]|["\\]/g, "_");
7671
7888
  const encoded = encodeURIComponent(filename).replace(
@@ -7783,12 +8000,6 @@ function registerRenderRoutes(api, adapter) {
7783
8000
  }
7784
8001
  return c.json({ status: job.status });
7785
8002
  });
7786
- const RENDER_MIME = {
7787
- ".mp4": "video/mp4",
7788
- ".webm": "video/webm",
7789
- ".mov": "video/quicktime"
7790
- };
7791
- const RENDER_EXTENSIONS = Object.keys(RENDER_MIME);
7792
8003
  const isPlainFile = (path) => {
7793
8004
  try {
7794
8005
  return lstatSync3(path).isFile();
@@ -7834,17 +8045,22 @@ function registerRenderRoutes(api, adapter) {
7834
8045
  }
7835
8046
  });
7836
8047
  });
7837
- api.delete("/render/:jobId", (c) => {
8048
+ async function renderDirectories(jobId) {
8049
+ const outputPath = renderJobs.get(jobId)?.outputPath;
8050
+ if (outputPath) return [dirname5(outputPath)];
8051
+ const projects = await adapter.listProjects();
8052
+ return projects.map((project) => adapter.rendersDir(project));
8053
+ }
8054
+ api.delete("/render/:jobId", async (c) => {
7838
8055
  const { jobId } = c.req.param();
7839
- for (const [, state] of renderJobs) {
7840
- if (state.id === jobId && state.outputPath) {
7841
- const dir = state.outputPath.replace(/\/[^/]+$/, "");
7842
- for (const ext of [".mp4", ".webm", ".mov", ".meta.json"]) {
7843
- const fp = join10(dir, `${jobId}${ext}`);
7844
- if (existsSync6(fp)) unlinkSync3(fp);
7845
- }
7846
- break;
7847
- }
8056
+ if (jobId.includes("/") || jobId.includes("\\") || jobId.includes("\0")) {
8057
+ return c.json({ error: "forbidden" }, 403);
8058
+ }
8059
+ const directories = await renderDirectories(jobId);
8060
+ const artifacts = resolveRenderArtifacts(directories, jobId);
8061
+ if (!artifacts) return c.json({ error: "forbidden" }, 403);
8062
+ for (const path of artifacts) {
8063
+ if (existsSync6(path)) unlinkSync3(path);
7848
8064
  }
7849
8065
  renderJobs.delete(jobId);
7850
8066
  return c.json({ deleted: true });
@@ -8060,12 +8276,7 @@ async function generateThumbnail(path, signal) {
8060
8276
  async function resolveSource(adapter, id, url) {
8061
8277
  const project = await adapter.resolveProject(id);
8062
8278
  if (!project) throw new HTTPException(404);
8063
- let relative5;
8064
- try {
8065
- relative5 = requestSubPath(url, "projects/:id/image-thumbnail");
8066
- } catch {
8067
- throw new HTTPException(400);
8068
- }
8279
+ const relative5 = requestSubPath(url, "projects/:id/image-thumbnail");
8069
8280
  if (!/\.jpe?g$/i.test(relative5)) throw new HTTPException(415);
8070
8281
  const path = pinWithinProject(project.dir, relative5);
8071
8282
  if (!path) throw new HTTPException(404);
@@ -8585,14 +8796,14 @@ async function extractThenPublishWhole(extract, mediaPath, mediaTime, imagePath)
8585
8796
  }
8586
8797
  }
8587
8798
  async function extractStill(projectDir, absPath, source, playhead, tools) {
8588
- const fileDir = dirname5(absPath);
8799
+ const fileDir = dirname6(absPath);
8589
8800
  const mediaPath = pinWithinProject(projectDir, relative4(projectDir, join13(fileDir, source.src)));
8590
8801
  if (!mediaPath) return { error: `forbidden media path: ${source.src}`, status: 403 };
8591
8802
  const freezeDir = join13(projectDir, ...FREEZE_DIR);
8592
8803
  const fileName = freezeStillFileName(source.id, playhead, tools.stillToken());
8593
8804
  mkdirWithinProject(projectDir, freezeDir);
8594
8805
  const imagePath = pinWithinProject(projectDir, join13(...FREEZE_DIR, fileName));
8595
- if (!imagePath || dirname5(imagePath) !== freezeDir) {
8806
+ if (!imagePath || dirname6(imagePath) !== freezeDir) {
8596
8807
  return { error: `forbidden freeze path: ${fileName}`, status: 403 };
8597
8808
  }
8598
8809
  const failed = await extractThenPublishWhole(
@@ -8602,7 +8813,7 @@ async function extractStill(projectDir, absPath, source, playhead, tools) {
8602
8813
  imagePath
8603
8814
  );
8604
8815
  if (failed) return failed;
8605
- const depth = relative4(projectDir, fileDir).split(sep2).filter(Boolean).length;
8816
+ const depth = relative4(projectDir, fileDir).split(sep3).filter(Boolean).length;
8606
8817
  const stillPath = `${FREEZE_DIR.join("/")}/${fileName}`;
8607
8818
  return { imageSrc: `${"../".repeat(depth)}${stillPath}`, stillPath, imagePath };
8608
8819
  }
@@ -9145,9 +9356,6 @@ function isVideoPath(path) {
9145
9356
  function isImagePath(path) {
9146
9357
  return IMAGE_EXTENSIONS.has(extname(path).toLowerCase());
9147
9358
  }
9148
- function normalizeProjectAssetPath(path) {
9149
- return path.trim().replace(/^[.]\//, "").replace(/[?#].*$/, "");
9150
- }
9151
9359
  function containsNullByte(path) {
9152
9360
  return path.includes("\0");
9153
9361
  }
@@ -9212,7 +9420,7 @@ function registerMediaRoutes(api, adapter, options = {}) {
9212
9420
  api.get("/projects/:id/media/metadata", async (c) => {
9213
9421
  const project = await adapter.resolveProject(c.req.param("id"));
9214
9422
  if (!project) return c.json({ error: "not found" }, 404);
9215
- const assetPath = normalizeProjectAssetPath(c.req.query("path") ?? "");
9423
+ const assetPath = requestedProjectPath(project.dir, c.req.query("path") ?? "");
9216
9424
  if (!assetPath) return c.json({ error: "path required" }, 400);
9217
9425
  if (containsNullByte(assetPath)) return c.json({ error: "forbidden" }, 403);
9218
9426
  if (/^(?:https?:|data:|blob:)/i.test(assetPath)) {
@@ -9234,7 +9442,7 @@ function registerMediaRoutes(api, adapter, options = {}) {
9234
9442
  const project = await adapter.resolveProject(c.req.param("id"));
9235
9443
  if (!project) return c.json({ error: "not found" }, 404);
9236
9444
  const body = await c.req.json().catch(() => ({}));
9237
- const inputAssetPath = body.inputPath ? normalizeProjectAssetPath(body.inputPath) : "";
9445
+ const inputAssetPath = body.inputPath ? requestedProjectPath(project.dir, body.inputPath) : "";
9238
9446
  if (!inputAssetPath) return c.json({ error: "inputPath required" }, 400);
9239
9447
  if (containsNullByte(inputAssetPath)) return c.json({ error: "forbidden" }, 403);
9240
9448
  if (/^(?:https?:|data:|blob:)/i.test(inputAssetPath)) {
@@ -9248,7 +9456,7 @@ function registerMediaRoutes(api, adapter, options = {}) {
9248
9456
  if (!inputIsVideo && !inputIsImage) {
9249
9457
  return c.json({ error: "background removal supports video or image assets only" }, 400);
9250
9458
  }
9251
- const requestedOutput = body.outputPath ? posix.normalize(normalizeProjectAssetPath(body.outputPath)) : "";
9459
+ const requestedOutput = body.outputPath ? posix.normalize(requestedProjectPath(project.dir, body.outputPath)) : "";
9252
9460
  if (requestedOutput && containsNullByte(requestedOutput)) {
9253
9461
  return c.json({ error: "forbidden" }, 403);
9254
9462
  }
@@ -9278,8 +9486,8 @@ function registerMediaRoutes(api, adapter, options = {}) {
9278
9486
  return c.json({ error: "forbidden" }, 403);
9279
9487
  }
9280
9488
  }
9281
- mkdirWithinProject(project.dir, dirname6(outputPath));
9282
- if (backgroundOutputPath) mkdirWithinProject(project.dir, dirname6(backgroundOutputPath));
9489
+ mkdirWithinProject(project.dir, dirname7(outputPath));
9490
+ if (backgroundOutputPath) mkdirWithinProject(project.dir, dirname7(backgroundOutputPath));
9283
9491
  const jobId = makeJobId(project.id, mediaJobs);
9284
9492
  const state = adapter.startBackgroundRemoval({
9285
9493
  project,
@@ -9679,7 +9887,6 @@ export {
9679
9887
  buildSubCompositionHtml,
9680
9888
  compositionsAffectedBy,
9681
9889
  applyFileMutations,
9682
- requestSubPath,
9683
9890
  MAX_UPLOAD_BYTES,
9684
9891
  affectsPreview,
9685
9892
  PREVIEW_BUNDLE_OPTIONS,
@@ -9,7 +9,7 @@ import {
9
9
  buildAuthHeaders,
10
10
  refreshTokens,
11
11
  resolveCredential
12
- } from "./chunk-246MOR5U.js";
12
+ } from "./chunk-DKSDVDXG.js";
13
13
 
14
14
  // src/cloud/auth.ts
15
15
  async function resolveCloudAuthHeaders() {