hyperframes 0.7.108 → 0.7.109

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.7.108" : "0.0.0-dev";
53
+ VERSION = true ? "0.7.109" : "0.0.0-dev";
54
54
  }
55
55
  });
56
56
 
@@ -71028,6 +71028,53 @@ var init_ffprobe = __esm({
71028
71028
  }
71029
71029
  });
71030
71030
 
71031
+ // ../engine/src/utils/renderProvenance.ts
71032
+ import { createRequire } from "module";
71033
+ function readEngineVersion() {
71034
+ try {
71035
+ const version2 = createRequire(import.meta.url)("../../package.json").version;
71036
+ return typeof version2 === "string" && version2.length > 0 ? version2 : UNKNOWN_VERSION;
71037
+ } catch {
71038
+ return UNKNOWN_VERSION;
71039
+ }
71040
+ }
71041
+ function isMovFamilyContainer(outputPath) {
71042
+ const lower3 = outputPath.toLowerCase();
71043
+ return lower3.endsWith(".mp4") || lower3.endsWith(".mov") || lower3.endsWith(".m4v");
71044
+ }
71045
+ function renderProvenanceArgs(outputPath) {
71046
+ const args = [
71047
+ "-metadata",
71048
+ `${PROVENANCE_RENDERER_TAG}=${PROVENANCE_RENDERER_NAME}`,
71049
+ "-metadata",
71050
+ `${PROVENANCE_VERSION_TAG}=${PROVENANCE_VERSION}`
71051
+ ];
71052
+ if (isMovFamilyContainer(outputPath)) {
71053
+ args.push("-movflags", "+use_metadata_tags");
71054
+ }
71055
+ return args;
71056
+ }
71057
+ function appendRenderProvenanceArgs(args, outputPath) {
71058
+ args.push(...renderProvenanceArgs(outputPath));
71059
+ }
71060
+ function readRenderProvenance(tags) {
71061
+ const renderer = readTagCI(tags, PROVENANCE_RENDERER_TAG);
71062
+ if (renderer === "") return null;
71063
+ return { renderer, version: readTagCI(tags, PROVENANCE_VERSION_TAG) };
71064
+ }
71065
+ var PROVENANCE_RENDERER_TAG, PROVENANCE_VERSION_TAG, PROVENANCE_RENDERER_NAME, UNKNOWN_VERSION, PROVENANCE_VERSION;
71066
+ var init_renderProvenance = __esm({
71067
+ "../engine/src/utils/renderProvenance.ts"() {
71068
+ "use strict";
71069
+ init_ffprobe();
71070
+ PROVENANCE_RENDERER_TAG = "hyperframes_renderer";
71071
+ PROVENANCE_VERSION_TAG = "hyperframes_version";
71072
+ PROVENANCE_RENDERER_NAME = "hyperframes";
71073
+ UNKNOWN_VERSION = "0.0.0-dev";
71074
+ PROVENANCE_VERSION = readEngineVersion();
71075
+ }
71076
+ });
71077
+
71031
71078
  // ../engine/src/services/chunkEncoder.ts
71032
71079
  import { copyFileSync, existsSync as existsSync7, mkdirSync as mkdirSync3, readdirSync as readdirSync2, statSync as statSync2, writeFileSync as writeFileSync3 } from "fs";
71033
71080
  import { join as join8, dirname as dirname4, extname } from "path";
@@ -71210,6 +71257,7 @@ function buildEncoderArgs(options, inputArgs, outputPath, gpuEncoder = null) {
71210
71257
  } else if (codec === "prores") {
71211
71258
  args.push("-c:v", "prores_ks", "-profile:v", preset2, "-vendor", "apl0");
71212
71259
  args.push("-pix_fmt", pixelFormat);
71260
+ appendRenderProvenanceArgs(args, outputPath);
71213
71261
  return [...args, "-y", outputPath];
71214
71262
  }
71215
71263
  if (codec === "h264" || codec === "h265") {
@@ -71262,6 +71310,7 @@ function buildEncoderArgs(options, inputArgs, outputPath, gpuEncoder = null) {
71262
71310
  args.push("-pix_fmt", pixelFormat);
71263
71311
  }
71264
71312
  args.push("-avoid_negative_ts", "make_zero");
71313
+ appendRenderProvenanceArgs(args, outputPath);
71265
71314
  args.push("-y", outputPath);
71266
71315
  return args;
71267
71316
  }
@@ -71395,18 +71444,9 @@ async function encodeFramesChunkedConcat(framesDir, framePattern, outputPath, op
71395
71444
  const concatListPath = join8(chunkDir, "concat-list.txt");
71396
71445
  const concatInput = chunkPaths.map((path2) => `file '${path2.replace(/'/g, "'\\''")}'`).join("\n");
71397
71446
  writeFileSync3(concatListPath, concatInput, "utf-8");
71398
- const concatArgs = [
71399
- "-f",
71400
- "concat",
71401
- "-safe",
71402
- "0",
71403
- "-i",
71404
- concatListPath,
71405
- "-c",
71406
- "copy",
71407
- "-y",
71408
- outputPath
71409
- ];
71447
+ const concatArgs = ["-f", "concat", "-safe", "0", "-i", concatListPath, "-c", "copy"];
71448
+ appendRenderProvenanceArgs(concatArgs, outputPath);
71449
+ concatArgs.push("-y", outputPath);
71410
71450
  const encodeTimeout = config?.ffmpegEncodeTimeout ?? DEFAULT_CONFIG2.ffmpegEncodeTimeout;
71411
71451
  const concatProcessResult = await runFfmpeg(concatArgs, { signal, timeout: encodeTimeout });
71412
71452
  const concatResult = {
@@ -71460,6 +71500,7 @@ async function muxVideoWithAudio(videoPath, audioPath, outputPath, signal, confi
71460
71500
  }
71461
71501
  const copiesContainerizedAac = !isWebm && shouldCopyAudio && config?.preserveAudioPrimingEditList === true;
71462
71502
  if (!copiesContainerizedAac) args.push("-avoid_negative_ts", "make_zero");
71503
+ appendRenderProvenanceArgs(args, outputPath);
71463
71504
  if (fps !== void 0) {
71464
71505
  args.push("-r", fpsToFfmpegArg(fps));
71465
71506
  }
@@ -71487,6 +71528,7 @@ async function applyFaststart(inputPath, outputPath, signal, config, fps) {
71487
71528
  return { success: true, outputPath, durationMs: 0 };
71488
71529
  }
71489
71530
  const args = ["-i", inputPath, "-c", "copy", "-movflags", "+faststart"];
71531
+ appendRenderProvenanceArgs(args, outputPath);
71490
71532
  if (fps !== void 0) {
71491
71533
  args.push("-r", fpsToFfmpegArg(fps));
71492
71534
  }
@@ -71520,6 +71562,7 @@ var init_chunkEncoder = __esm({
71520
71562
  init_ffprobe();
71521
71563
  init_dist3();
71522
71564
  init_vp9Options();
71565
+ init_renderProvenance();
71523
71566
  init_gpuEncoder();
71524
71567
  ENCODER_PRESETS = {
71525
71568
  draft: { preset: "ultrafast", quality: 28, codec: "h264" },
@@ -71720,6 +71763,7 @@ function buildStreamingArgs(options, outputPath, gpuEncoder = null) {
71720
71763
  } else if (codec === "prores") {
71721
71764
  args.push("-c:v", "prores_ks", "-profile:v", preset2, "-vendor", "apl0");
71722
71765
  args.push("-pix_fmt", pixelFormat);
71766
+ appendRenderProvenanceArgs(args, outputPath);
71723
71767
  return [...args, "-y", outputPath];
71724
71768
  }
71725
71769
  if (codec === "h264" || codec === "h265") {
@@ -71772,6 +71816,7 @@ function buildStreamingArgs(options, outputPath, gpuEncoder = null) {
71772
71816
  args.push("-pix_fmt", pixelFormat);
71773
71817
  }
71774
71818
  args.push("-avoid_negative_ts", "make_zero");
71819
+ appendRenderProvenanceArgs(args, outputPath);
71775
71820
  args.push("-y", outputPath);
71776
71821
  return args;
71777
71822
  }
@@ -71900,6 +71945,7 @@ var init_streamingEncoder = __esm({
71900
71945
  init_config2();
71901
71946
  init_dist3();
71902
71947
  init_vp9Options();
71948
+ init_renderProvenance();
71903
71949
  }
71904
71950
  });
71905
71951
 
@@ -91800,6 +91846,10 @@ __export(src_exports, {
91800
91846
  ManagedChildProcess: () => ManagedChildProcess,
91801
91847
  NOT_MEDIA_PAYLOAD: () => NOT_MEDIA_PAYLOAD,
91802
91848
  NotMediaPayloadError: () => NotMediaPayloadError,
91849
+ PROVENANCE_RENDERER_NAME: () => PROVENANCE_RENDERER_NAME,
91850
+ PROVENANCE_RENDERER_TAG: () => PROVENANCE_RENDERER_TAG,
91851
+ PROVENANCE_VERSION: () => PROVENANCE_VERSION,
91852
+ PROVENANCE_VERSION_TAG: () => PROVENANCE_VERSION_TAG,
91803
91853
  SwiftShaderAssertionError: () => SwiftShaderAssertionError,
91804
91854
  TRANSITIONS: () => TRANSITIONS,
91805
91855
  VIDEO_FRAME_FORMATS: () => VIDEO_FRAME_FORMATS,
@@ -91808,6 +91858,7 @@ __export(src_exports, {
91808
91858
  analyzeClipMediaFit: () => analyzeClipMediaFit,
91809
91859
  analyzeCompositionHdr: () => analyzeCompositionHdr,
91810
91860
  analyzeKeyframeIntervals: () => analyzeKeyframeIntervals,
91861
+ appendRenderProvenanceArgs: () => appendRenderProvenanceArgs,
91811
91862
  applyConcreteGpuScreenshotClamp: () => applyConcreteGpuScreenshotClamp,
91812
91863
  applyDomLayerMask: () => applyDomLayerMask,
91813
91864
  applyFaststart: () => applyFaststart,
@@ -91926,11 +91977,13 @@ __export(src_exports, {
91926
91977
  quantizeTimeToFrame: () => quantizeTimeToFrame,
91927
91978
  queryElementStacking: () => queryElementStacking,
91928
91979
  queryVideoElementBounds: () => queryVideoElementBounds,
91980
+ readRenderProvenance: () => readRenderProvenance,
91929
91981
  readWebGlVendorInfo: () => readWebGlVendorInfo,
91930
91982
  readWebGlVendorInfoFromCanvas: () => readWebGlVendorInfoFromCanvas,
91931
91983
  recaptureDrawElementFrameForVerify: () => recaptureDrawElementFrameForVerify,
91932
91984
  releaseBrowser: () => releaseBrowser,
91933
91985
  removeDomLayerMask: () => removeDomLayerMask,
91986
+ renderProvenanceArgs: () => renderProvenanceArgs,
91934
91987
  resampleRgb48leObjectFit: () => resampleRgb48leObjectFit,
91935
91988
  resolveBrowserGpuMode: () => resolveBrowserGpuMode,
91936
91989
  resolveConfig: () => resolveConfig,
@@ -92001,6 +92054,7 @@ var init_src = __esm({
92001
92054
  init_screenshotService();
92002
92055
  init_videoFrameInjector();
92003
92056
  init_hdr();
92057
+ init_renderProvenance();
92004
92058
  }
92005
92059
  });
92006
92060
 
@@ -100583,7 +100637,7 @@ var init_hfIds = __esm({
100583
100637
  }
100584
100638
  });
100585
100639
 
100586
- // ../studio-server/dist/chunk-Q7LK72M7.js
100640
+ // ../studio-server/dist/chunk-XVPRRS7M.js
100587
100641
  import postcss3 from "postcss";
100588
100642
  function parseStyleDecls(style) {
100589
100643
  const props = /* @__PURE__ */ new Map();
@@ -100873,7 +100927,7 @@ function splitElementInHtml(source, target, splitTime, newId, fallbackTiming) {
100873
100927
  clone2.removeAttribute("data-hf-id");
100874
100928
  for (const node of clone2.querySelectorAll("[data-hf-id]")) node.removeAttribute("data-hf-id");
100875
100929
  setElementDuration(clone2, splitTime, secondDuration);
100876
- const playbackStartAttr = el.hasAttribute("data-playback-start") ? "data-playback-start" : el.hasAttribute("data-media-start") ? "data-media-start" : fallbackTiming?.stampPlaybackStart ? "data-playback-start" : null;
100930
+ const playbackStartAttr = el.hasAttribute("data-playback-start") ? "data-playback-start" : el.hasAttribute("data-media-start") ? "data-media-start" : fallbackTiming?.stampPlaybackStart ? "data-playback-start" : el.matches("audio, video") ? "data-media-start" : null;
100877
100931
  if (playbackStartAttr) {
100878
100932
  const currentTrim = parseFloat(el.getAttribute(playbackStartAttr) ?? "") || fallbackTiming?.playbackStart || 0;
100879
100933
  const rateRaw = parseFloat(el.getAttribute("data-playback-rate") ?? "");
@@ -101025,8 +101079,8 @@ function unwrapElementsFromHtml(source, groupTarget) {
101025
101079
  };
101026
101080
  }
101027
101081
  var import_postcss_selector_parser2;
101028
- var init_chunk_Q7LK72M7 = __esm({
101029
- "../studio-server/dist/chunk-Q7LK72M7.js"() {
101082
+ var init_chunk_XVPRRS7M = __esm({
101083
+ "../studio-server/dist/chunk-XVPRRS7M.js"() {
101030
101084
  "use strict";
101031
101085
  init_esm10();
101032
101086
  import_postcss_selector_parser2 = __toESM(require_dist(), 1);
@@ -112875,7 +112929,7 @@ var init_dist9 = __esm({
112875
112929
  "../studio-server/dist/index.js"() {
112876
112930
  "use strict";
112877
112931
  init_chunk_X62ASOGO();
112878
- init_chunk_Q7LK72M7();
112932
+ init_chunk_XVPRRS7M();
112879
112933
  init_chunk_W2SBTCO2();
112880
112934
  init_chunk_LHYV3WLZ();
112881
112935
  init_chunk_ZPI6QXJH();
@@ -123900,7 +123954,18 @@ var init_extractVideosStage = __esm({
123900
123954
  // ../producer/src/services/render/stages/audioStage.ts
123901
123955
  import { join as join49 } from "path";
123902
123956
  async function runAudioStage(input2) {
123903
- const { projectDir, workDir, compiledDir, duration, audios, abortSignal, assertNotAborted, log: log2 } = input2;
123957
+ const {
123958
+ projectDir,
123959
+ workDir,
123960
+ compiledDir,
123961
+ duration,
123962
+ ffmpegProcessTimeout,
123963
+ audioGain,
123964
+ audios,
123965
+ abortSignal,
123966
+ assertNotAborted,
123967
+ log: log2
123968
+ } = input2;
123904
123969
  const stage3Start = Date.now();
123905
123970
  const audioOutputPath = join49(workDir, MIXED_AUDIO_FILENAME);
123906
123971
  let hasAudio = false;
@@ -123916,7 +123981,7 @@ async function runAudioStage(input2) {
123916
123981
  audioOutputPath,
123917
123982
  duration,
123918
123983
  abortSignal,
123919
- void 0,
123984
+ { ffmpegProcessTimeout, audioGain },
123920
123985
  compiledDir
123921
123986
  );
123922
123987
  } catch (err) {
@@ -125995,7 +126060,7 @@ var init_captureHdrSequentialLoop = __esm({
125995
126060
  import { Worker as Worker2 } from "worker_threads";
125996
126061
  import { fileURLToPath as fileURLToPath4, pathToFileURL as pathToFileURL2 } from "url";
125997
126062
  import { dirname as dirname23, join as join55 } from "path";
125998
- import { createRequire } from "module";
126063
+ import { createRequire as createRequire2 } from "module";
125999
126064
  import { existsSync as existsSync53 } from "fs";
126000
126065
  import { cpus as cpus3 } from "os";
126001
126066
  function resolveWorkerEntry(explicit) {
@@ -126021,7 +126086,7 @@ function buildExecArgv(entryIsTs) {
126021
126086
  );
126022
126087
  if (hasLoader) return inherited;
126023
126088
  try {
126024
- const require3 = createRequire(import.meta.url);
126089
+ const require3 = createRequire2(import.meta.url);
126025
126090
  const tsxEsm = require3.resolve("tsx/esm");
126026
126091
  inherited.push("--import", pathToFileURL2(tsxEsm).href);
126027
126092
  } catch {
@@ -128323,6 +128388,8 @@ async function executeRenderPipeline(input2) {
128323
128388
  workDir,
128324
128389
  compiledDir,
128325
128390
  duration: probeResult.duration,
128391
+ ffmpegProcessTimeout: cfg.ffmpegProcessTimeout,
128392
+ audioGain: cfg.audioGain,
128326
128393
  audios: composition.audios,
128327
128394
  abortSignal: executionSignal,
128328
128395
  assertNotAborted,
@@ -131878,6 +131945,8 @@ async function buildLocalExecutionPlan(projectDir, config, executionPlanDir, opt
131878
131945
  workDir,
131879
131946
  compiledDir,
131880
131947
  duration: job.duration,
131948
+ ffmpegProcessTimeout: cfg.ffmpegProcessTimeout,
131949
+ audioGain: cfg.audioGain,
131881
131950
  audios: composition.audios,
131882
131951
  abortSignal,
131883
131952
  assertNotAborted
@@ -132963,7 +133032,9 @@ async function assemble(planDir, chunkPaths, audioPath, outputPath, options) {
132963
133032
  den: plan2.dimensions.fpsDen
132964
133033
  });
132965
133034
  if (chunkPaths.length === 1) {
132966
- const remuxArgs = ["-i", chunkPaths[0], "-c", "copy", "-r", fpsArg, "-y", concatOutputPath];
133035
+ const remuxArgs = ["-i", chunkPaths[0], "-c", "copy", "-r", fpsArg];
133036
+ appendRenderProvenanceArgs(remuxArgs, concatOutputPath);
133037
+ remuxArgs.push("-y", concatOutputPath);
132967
133038
  const remuxResult = await runFfmpeg(remuxArgs, { signal: abortSignal });
132968
133039
  if (!remuxResult.success) {
132969
133040
  throw new Error(
@@ -132985,10 +133056,10 @@ async function assemble(planDir, chunkPaths, audioPath, outputPath, options) {
132985
133056
  "-i",
132986
133057
  concatListPath,
132987
133058
  "-c",
132988
- "copy",
132989
- "-y",
132990
- concatOutputPath
133059
+ "copy"
132991
133060
  ];
133061
+ appendRenderProvenanceArgs(concatArgs, concatOutputPath);
133062
+ concatArgs.push("-y", concatOutputPath);
132992
133063
  const concatResult = await runFfmpeg(concatArgs, { signal: abortSignal });
132993
133064
  if (!concatResult.success) {
132994
133065
  throw new Error(
@@ -133028,10 +133099,10 @@ async function assemble(planDir, chunkPaths, audioPath, outputPath, options) {
133028
133099
  "-fps_mode",
133029
133100
  "cfr",
133030
133101
  "-r",
133031
- fpsArg,
133032
- "-y",
133033
- cfrOutputPath
133102
+ fpsArg
133034
133103
  ];
133104
+ appendRenderProvenanceArgs(cfrArgs, cfrOutputPath);
133105
+ cfrArgs.push("-y", cfrOutputPath);
133035
133106
  const cfrResult = await runFfmpeg(cfrArgs, { signal: abortSignal });
133036
133107
  if (!cfrResult.success) {
133037
133108
  throw new Error(
@@ -134258,6 +134329,7 @@ function buildEncoderArgs2(format, width, height, fps, outputPath, quality = DEF
134258
134329
  "-metadata:s:v:0",
134259
134330
  "alpha_mode=1",
134260
134331
  "-an",
134332
+ ...renderProvenanceArgs(outputPath),
134261
134333
  outputPath
134262
134334
  ];
134263
134335
  }
@@ -134273,6 +134345,7 @@ function buildEncoderArgs2(format, width, height, fps, outputPath, quality = DEF
134273
134345
  "-pix_fmt",
134274
134346
  "yuva444p10le",
134275
134347
  "-an",
134348
+ ...renderProvenanceArgs(outputPath),
134276
134349
  outputPath
134277
134350
  ];
134278
134351
  }
@@ -135190,7 +135263,7 @@ import {
135190
135263
  } from "fs";
135191
135264
  import { resolve as resolve39, dirname as dirname33, basename as basename12, join as join79 } from "path";
135192
135265
  import { fileURLToPath as fileURLToPath8 } from "url";
135193
- import { createRequire as createRequire2 } from "module";
135266
+ import { createRequire as createRequire3 } from "module";
135194
135267
  function previewBaseUrl(port, host = "127.0.0.1") {
135195
135268
  return `http://${host}:${port}`;
135196
135269
  }
@@ -135594,7 +135667,7 @@ async function runDevMode(dir, options) {
135594
135667
  }
135595
135668
  function hasLocalStudio(dir) {
135596
135669
  try {
135597
- const req = createRequire2(join79(dir, "package.json"));
135670
+ const req = createRequire3(join79(dir, "package.json"));
135598
135671
  req.resolve("@hyperframes/studio/package.json");
135599
135672
  return true;
135600
135673
  } catch {
@@ -135602,7 +135675,7 @@ function hasLocalStudio(dir) {
135602
135675
  }
135603
135676
  }
135604
135677
  async function runLocalStudioMode(dir, options) {
135605
- const req = createRequire2(join79(dir, "package.json"));
135678
+ const req = createRequire3(join79(dir, "package.json"));
135606
135679
  const studioPkgPath = dirname33(req.resolve("@hyperframes/studio/package.json"));
135607
135680
  const pName = options?.projectName ?? basename12(dir);
135608
135681
  const projectsDir = join79(studioPkgPath, "data", "projects");
@@ -147984,7 +148057,7 @@ var init_beats = __esm({
147984
148057
 
147985
148058
  // src/beats/headlessAnalyzer.ts
147986
148059
  import { existsSync as existsSync89, readFileSync as readFileSync61 } from "fs";
147987
- import { createRequire as createRequire3 } from "module";
148060
+ import { createRequire as createRequire4 } from "module";
147988
148061
  import { dirname as dirname44, join as join97 } from "path";
147989
148062
  import { fileURLToPath as fileURLToPath13 } from "url";
147990
148063
  function findPrebuiltBundle() {
@@ -148092,7 +148165,7 @@ var require2, bundlePromise, MAX_AUDIO_BYTES;
148092
148165
  var init_headlessAnalyzer = __esm({
148093
148166
  "src/beats/headlessAnalyzer.ts"() {
148094
148167
  "use strict";
148095
- require2 = createRequire3(import.meta.url);
148168
+ require2 = createRequire4(import.meta.url);
148096
148169
  bundlePromise = null;
148097
148170
  MAX_AUDIO_BYTES = 80 * 1024 * 1024;
148098
148171
  }
@@ -194887,7 +194960,7 @@ ${c.error("\u2717")} Snapshot failed: ${msg}`);
194887
194960
  var init_sourceMutation = __esm({
194888
194961
  "../studio-server/dist/helpers/sourceMutation.js"() {
194889
194962
  "use strict";
194890
- init_chunk_Q7LK72M7();
194963
+ init_chunk_XVPRRS7M();
194891
194964
  }
194892
194965
  });
194893
194966
 
@@ -1,4 +1,4 @@
1
- "use strict";var HyperframesPlayer=(()=>{var J=Object.defineProperty;var Ye=Object.getOwnPropertyDescriptor;var Xe=Object.getOwnPropertyNames;var Ze=Object.prototype.hasOwnProperty;var Qe=(i,e)=>{for(var t in e)J(i,t,{get:e[t],enumerable:!0})},Je=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Xe(e))!Ze.call(i,n)&&n!==t&&J(i,n,{get:()=>e[n],enumerable:!(r=Ye(e,n))||r.enumerable});return i};var Ke=i=>Je(J({},"__esModule",{value:!0}),i);var Lt={};Qe(Lt,{HyperframesPlayer:()=>Q,SPEED_PRESETS:()=>te,formatSpeed:()=>N,formatTime:()=>$});function ye(i){return i.hasRuntime||i.runtimeInjected?!1:!!(i.hasNestedCompositions||i.hasTimelines&&i.attempts>=5)}function I(i){return typeof i=="object"&&i!==null}function Ee(i){return I(i)&&typeof i.getDuration=="function"}function Se(i){return I(i)&&typeof i.duration=="function"&&typeof i.time=="function"&&typeof i.seek=="function"&&typeof i.play=="function"&&typeof i.pause=="function"}var et="https://cdn.jsdelivr.net/npm/@hyperframes/core@0.7.108/dist/hyperframe.runtime.iife.js";function D(i){if(i===null)return null;let e=Number.parseInt(i,10);return Number.isFinite(e)&&e>0?e:null}function tt(i){let e=i?.querySelector("[data-composition-id][data-width][data-height]")??i?.querySelector("[data-width][data-height]");if(!e)return null;let t=D(e.getAttribute("data-width")),r=D(e.getAttribute("data-height"));return t!==null&&r!==null?{width:t,height:r}:null}var j=class{constructor(e,t){this._iframe=e;this._callbacks=t}_iframe;_callbacks;_interval=null;_runtimeInjected=!1;get runtimeInjected(){return this._runtimeInjected}start(){this.stop(),this._runtimeInjected=!1;let e=0;this._interval=setInterval(()=>{e++;try{let t=this._iframe.contentWindow;if(!t)return;let r=!!(t.__hf||t.__player),n=!!(t.__timelines&&Object.keys(t.__timelines).length>0),o=!!this._iframe.contentDocument?.querySelector("[data-composition-src]");if(ye({hasRuntime:r,hasTimelines:n,hasNestedCompositions:o,runtimeInjected:this._runtimeInjected,attempts:e})){this._injectRuntime();return}if(this._runtimeInjected&&!r)return;let s=this._resolvePlaybackDurationAdapter(t);if(s&&s.getDuration()>0){this.stop();let l=tt(this._iframe.contentDocument);this._callbacks.onReady({duration:s.getDuration(),adapter:s,compositionSize:l});return}}catch{}e>=40&&(this.stop(),this._callbacks.onError("Composition timeline not found after 8s"))},200)}stop(){this._interval!==null&&(clearInterval(this._interval),this._interval=null)}resolveDirectTimelineAdapter(){try{let e=this._iframe.contentWindow;return e?this._resolveDirectTimelineAdapterFromWindow(e):null}catch{return null}}resolveDirectTimelineAdapterFromWindow(e){return this._resolveDirectTimelineAdapterFromWindow(e)}hasRuntimeBridge(e){return Reflect.get(e,"__hf")!==void 0||I(Reflect.get(e,"__player"))}_injectRuntime(){this._runtimeInjected=!0;try{let e=this._iframe.contentDocument;if(!e)return;let t=e.createElement("script");t.src=et,(e.head||e.documentElement).appendChild(t),this._callbacks.onRuntimeInjected?.()}catch{}}_resolveDirectTimelineAdapterFromWindow(e){if(this.hasRuntimeBridge(e))return null;let t=Reflect.get(e,"__timelines");if(!I(t))return null;let r=Object.keys(t);if(r.length===0)return null;let n=this._iframe.contentDocument?.querySelector("[data-composition-id]")?.getAttribute("data-composition-id"),o=n&&n in t?n:r[r.length-1],s=t[o];return Se(s)?s:null}_resolvePlaybackDurationAdapter(e){let t=Reflect.get(e,"__player");if(Ee(t))return{kind:"runtime",getDuration:()=>t.getDuration()};let r=this._resolveDirectTimelineAdapterFromWindow(e);return r?{kind:"direct-timeline",timeline:r,getDuration:()=>r.duration()}:null}};var Te=`
1
+ "use strict";var HyperframesPlayer=(()=>{var J=Object.defineProperty;var Ye=Object.getOwnPropertyDescriptor;var Xe=Object.getOwnPropertyNames;var Ze=Object.prototype.hasOwnProperty;var Qe=(i,e)=>{for(var t in e)J(i,t,{get:e[t],enumerable:!0})},Je=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Xe(e))!Ze.call(i,n)&&n!==t&&J(i,n,{get:()=>e[n],enumerable:!(r=Ye(e,n))||r.enumerable});return i};var Ke=i=>Je(J({},"__esModule",{value:!0}),i);var Lt={};Qe(Lt,{HyperframesPlayer:()=>Q,SPEED_PRESETS:()=>te,formatSpeed:()=>N,formatTime:()=>$});function ye(i){return i.hasRuntime||i.runtimeInjected?!1:!!(i.hasNestedCompositions||i.hasTimelines&&i.attempts>=5)}function I(i){return typeof i=="object"&&i!==null}function Ee(i){return I(i)&&typeof i.getDuration=="function"}function Se(i){return I(i)&&typeof i.duration=="function"&&typeof i.time=="function"&&typeof i.seek=="function"&&typeof i.play=="function"&&typeof i.pause=="function"}var et="https://cdn.jsdelivr.net/npm/@hyperframes/core@0.7.109/dist/hyperframe.runtime.iife.js";function D(i){if(i===null)return null;let e=Number.parseInt(i,10);return Number.isFinite(e)&&e>0?e:null}function tt(i){let e=i?.querySelector("[data-composition-id][data-width][data-height]")??i?.querySelector("[data-width][data-height]");if(!e)return null;let t=D(e.getAttribute("data-width")),r=D(e.getAttribute("data-height"));return t!==null&&r!==null?{width:t,height:r}:null}var j=class{constructor(e,t){this._iframe=e;this._callbacks=t}_iframe;_callbacks;_interval=null;_runtimeInjected=!1;get runtimeInjected(){return this._runtimeInjected}start(){this.stop(),this._runtimeInjected=!1;let e=0;this._interval=setInterval(()=>{e++;try{let t=this._iframe.contentWindow;if(!t)return;let r=!!(t.__hf||t.__player),n=!!(t.__timelines&&Object.keys(t.__timelines).length>0),o=!!this._iframe.contentDocument?.querySelector("[data-composition-src]");if(ye({hasRuntime:r,hasTimelines:n,hasNestedCompositions:o,runtimeInjected:this._runtimeInjected,attempts:e})){this._injectRuntime();return}if(this._runtimeInjected&&!r)return;let s=this._resolvePlaybackDurationAdapter(t);if(s&&s.getDuration()>0){this.stop();let l=tt(this._iframe.contentDocument);this._callbacks.onReady({duration:s.getDuration(),adapter:s,compositionSize:l});return}}catch{}e>=40&&(this.stop(),this._callbacks.onError("Composition timeline not found after 8s"))},200)}stop(){this._interval!==null&&(clearInterval(this._interval),this._interval=null)}resolveDirectTimelineAdapter(){try{let e=this._iframe.contentWindow;return e?this._resolveDirectTimelineAdapterFromWindow(e):null}catch{return null}}resolveDirectTimelineAdapterFromWindow(e){return this._resolveDirectTimelineAdapterFromWindow(e)}hasRuntimeBridge(e){return Reflect.get(e,"__hf")!==void 0||I(Reflect.get(e,"__player"))}_injectRuntime(){this._runtimeInjected=!0;try{let e=this._iframe.contentDocument;if(!e)return;let t=e.createElement("script");t.src=et,(e.head||e.documentElement).appendChild(t),this._callbacks.onRuntimeInjected?.()}catch{}}_resolveDirectTimelineAdapterFromWindow(e){if(this.hasRuntimeBridge(e))return null;let t=Reflect.get(e,"__timelines");if(!I(t))return null;let r=Object.keys(t);if(r.length===0)return null;let n=this._iframe.contentDocument?.querySelector("[data-composition-id]")?.getAttribute("data-composition-id"),o=n&&n in t?n:r[r.length-1],s=t[o];return Se(s)?s:null}_resolvePlaybackDurationAdapter(e){let t=Reflect.get(e,"__player");if(Ee(t))return{kind:"runtime",getDuration:()=>t.getDuration()};let r=this._resolveDirectTimelineAdapterFromWindow(e);return r?{kind:"direct-timeline",timeline:r,getDuration:()=>r.duration()}:null}};var Te=`
2
2
  :host {
3
3
  display: block;
4
4
  position: relative;
@@ -1,4 +1,4 @@
1
- var me=Object.defineProperty;var fe=(r,t,e)=>t in r?me(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var c=(r,t,e)=>fe(r,typeof t!="symbol"?t+"":t,e);import{r as ne,i as _e,a as ge}from"./index-GqONLcOl.js";function ye(r){return r.hasRuntime||r.runtimeInjected?!1:!!(r.hasNestedCompositions||r.hasTimelines&&r.attempts>=5)}function F(r){return typeof r=="object"&&r!==null}function ve(r){return F(r)&&typeof r.getDuration=="function"}function be(r){return F(r)&&typeof r.duration=="function"&&typeof r.time=="function"&&typeof r.seek=="function"&&typeof r.play=="function"&&typeof r.pause=="function"}function we(r){if(!/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/.test(r))throw new Error(`Invalid HyperFrames runtime version: ${r}`);return`https://cdn.jsdelivr.net/npm/@hyperframes/core@${r}/dist/hyperframe.runtime.iife.js`}const Ae=typeof __HYPERFRAMES_RUNTIME_CDN_URL__=="string"?__HYPERFRAMES_RUNTIME_CDN_URL__:we("0.0.0-dev");function H(r){if(r===null)return null;const t=Number.parseInt(r,10);return Number.isFinite(t)&&t>0?t:null}function Ee(r){const t=(r==null?void 0:r.querySelector("[data-composition-id][data-width][data-height]"))??(r==null?void 0:r.querySelector("[data-width][data-height]"));if(!t)return null;const e=H(t.getAttribute("data-width")),i=H(t.getAttribute("data-height"));return e!==null&&i!==null?{width:e,height:i}:null}class Ce{constructor(t,e){c(this,"_interval",null);c(this,"_runtimeInjected",!1);this._iframe=t,this._callbacks=e}get runtimeInjected(){return this._runtimeInjected}start(){this.stop(),this._runtimeInjected=!1;let t=0;this._interval=setInterval(()=>{var e;t++;try{const i=this._iframe.contentWindow;if(!i)return;const s=!!(i.__hf||i.__player),o=!!(i.__timelines&&Object.keys(i.__timelines).length>0),d=!!((e=this._iframe.contentDocument)!=null&&e.querySelector("[data-composition-src]"));if(ye({hasRuntime:s,hasTimelines:o,hasNestedCompositions:d,runtimeInjected:this._runtimeInjected,attempts:t})){this._injectRuntime();return}if(this._runtimeInjected&&!s)return;const a=this._resolvePlaybackDurationAdapter(i);if(a&&a.getDuration()>0){this.stop();const h=Ee(this._iframe.contentDocument);this._callbacks.onReady({duration:a.getDuration(),adapter:a,compositionSize:h});return}}catch{}t>=40&&(this.stop(),this._callbacks.onError("Composition timeline not found after 8s"))},200)}stop(){this._interval!==null&&(clearInterval(this._interval),this._interval=null)}resolveDirectTimelineAdapter(){try{const t=this._iframe.contentWindow;return t?this._resolveDirectTimelineAdapterFromWindow(t):null}catch{return null}}resolveDirectTimelineAdapterFromWindow(t){return this._resolveDirectTimelineAdapterFromWindow(t)}hasRuntimeBridge(t){return Reflect.get(t,"__hf")!==void 0||F(Reflect.get(t,"__player"))}_injectRuntime(){var t,e;this._runtimeInjected=!0;try{const i=this._iframe.contentDocument;if(!i)return;const s=i.createElement("script");s.src=Ae,(i.head||i.documentElement).appendChild(s),(e=(t=this._callbacks).onRuntimeInjected)==null||e.call(t)}catch{}}_resolveDirectTimelineAdapterFromWindow(t){var a,h;if(this.hasRuntimeBridge(t))return null;const e=Reflect.get(t,"__timelines");if(!F(e))return null;const i=Object.keys(e);if(i.length===0)return null;const s=(h=(a=this._iframe.contentDocument)==null?void 0:a.querySelector("[data-composition-id]"))==null?void 0:h.getAttribute("data-composition-id"),o=s&&s in e?s:i[i.length-1],d=e[o];return be(d)?d:null}_resolvePlaybackDurationAdapter(t){const e=Reflect.get(t,"__player");if(ve(e))return{kind:"runtime",getDuration:()=>e.getDuration()};const i=this._resolveDirectTimelineAdapterFromWindow(t);return i?{kind:"direct-timeline",timeline:i,getDuration:()=>i.duration()}:null}}const Te=`
1
+ var me=Object.defineProperty;var fe=(r,t,e)=>t in r?me(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var c=(r,t,e)=>fe(r,typeof t!="symbol"?t+"":t,e);import{r as ne,i as _e,a as ge}from"./index-CfBGQdrX.js";function ye(r){return r.hasRuntime||r.runtimeInjected?!1:!!(r.hasNestedCompositions||r.hasTimelines&&r.attempts>=5)}function F(r){return typeof r=="object"&&r!==null}function ve(r){return F(r)&&typeof r.getDuration=="function"}function be(r){return F(r)&&typeof r.duration=="function"&&typeof r.time=="function"&&typeof r.seek=="function"&&typeof r.play=="function"&&typeof r.pause=="function"}function we(r){if(!/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/.test(r))throw new Error(`Invalid HyperFrames runtime version: ${r}`);return`https://cdn.jsdelivr.net/npm/@hyperframes/core@${r}/dist/hyperframe.runtime.iife.js`}const Ae=typeof __HYPERFRAMES_RUNTIME_CDN_URL__=="string"?__HYPERFRAMES_RUNTIME_CDN_URL__:we("0.0.0-dev");function H(r){if(r===null)return null;const t=Number.parseInt(r,10);return Number.isFinite(t)&&t>0?t:null}function Ee(r){const t=(r==null?void 0:r.querySelector("[data-composition-id][data-width][data-height]"))??(r==null?void 0:r.querySelector("[data-width][data-height]"));if(!t)return null;const e=H(t.getAttribute("data-width")),i=H(t.getAttribute("data-height"));return e!==null&&i!==null?{width:e,height:i}:null}class Ce{constructor(t,e){c(this,"_interval",null);c(this,"_runtimeInjected",!1);this._iframe=t,this._callbacks=e}get runtimeInjected(){return this._runtimeInjected}start(){this.stop(),this._runtimeInjected=!1;let t=0;this._interval=setInterval(()=>{var e;t++;try{const i=this._iframe.contentWindow;if(!i)return;const s=!!(i.__hf||i.__player),o=!!(i.__timelines&&Object.keys(i.__timelines).length>0),d=!!((e=this._iframe.contentDocument)!=null&&e.querySelector("[data-composition-src]"));if(ye({hasRuntime:s,hasTimelines:o,hasNestedCompositions:d,runtimeInjected:this._runtimeInjected,attempts:t})){this._injectRuntime();return}if(this._runtimeInjected&&!s)return;const a=this._resolvePlaybackDurationAdapter(i);if(a&&a.getDuration()>0){this.stop();const h=Ee(this._iframe.contentDocument);this._callbacks.onReady({duration:a.getDuration(),adapter:a,compositionSize:h});return}}catch{}t>=40&&(this.stop(),this._callbacks.onError("Composition timeline not found after 8s"))},200)}stop(){this._interval!==null&&(clearInterval(this._interval),this._interval=null)}resolveDirectTimelineAdapter(){try{const t=this._iframe.contentWindow;return t?this._resolveDirectTimelineAdapterFromWindow(t):null}catch{return null}}resolveDirectTimelineAdapterFromWindow(t){return this._resolveDirectTimelineAdapterFromWindow(t)}hasRuntimeBridge(t){return Reflect.get(t,"__hf")!==void 0||F(Reflect.get(t,"__player"))}_injectRuntime(){var t,e;this._runtimeInjected=!0;try{const i=this._iframe.contentDocument;if(!i)return;const s=i.createElement("script");s.src=Ae,(i.head||i.documentElement).appendChild(s),(e=(t=this._callbacks).onRuntimeInjected)==null||e.call(t)}catch{}}_resolveDirectTimelineAdapterFromWindow(t){var a,h;if(this.hasRuntimeBridge(t))return null;const e=Reflect.get(t,"__timelines");if(!F(e))return null;const i=Object.keys(e);if(i.length===0)return null;const s=(h=(a=this._iframe.contentDocument)==null?void 0:a.querySelector("[data-composition-id]"))==null?void 0:h.getAttribute("data-composition-id"),o=s&&s in e?s:i[i.length-1],d=e[o];return be(d)?d:null}_resolvePlaybackDurationAdapter(t){const e=Reflect.get(t,"__player");if(ve(e))return{kind:"runtime",getDuration:()=>e.getDuration()};const i=this._resolveDirectTimelineAdapterFromWindow(t);return i?{kind:"direct-timeline",timeline:i,getDuration:()=>i.duration()}:null}}const Te=`
2
2
  :host {
3
3
  display: block;
4
4
  position: relative;
@@ -1 +1 @@
1
- import{g as P}from"./index-GqONLcOl.js";function j(c,d){for(var s=0;s<d.length;s++){const a=d[s];if(typeof a!="string"&&!Array.isArray(a)){for(const i in a)if(i!=="default"&&!(i in c)){const l=Object.getOwnPropertyDescriptor(a,i);l&&Object.defineProperty(c,i,l.get?l:{enumerable:!0,get:()=>a[i]})}}}return Object.freeze(Object.defineProperty(c,Symbol.toStringTag,{value:"Module"}))}var v={},w;function k(){if(w)return v;w=1,Object.defineProperty(v,"__esModule",{value:!0}),v.default=d;var c=window.OfflineAudioContext||window.webkitOfflineAudioContext;function d(e){var r=a(e);return r.start(0),[i,y,O(e.sampleRate),s].reduce(function(t,o){return o(t)},r.buffer.getChannelData(0))}function s(e){return e.sort(function(r,t){return t.count-r.count}).splice(0,5)[0].tempo}function a(e){var r=e.length,t=e.numberOfChannels,o=e.sampleRate,n=new c(t,r,o),u=n.createBufferSource();u.buffer=e;var f=n.createBiquadFilter();return f.type="lowpass",u.connect(f),f.connect(n.destination),u}function i(e){for(var r=[],t=.9,o=.3,n=15;r.length<n&&t>=o;)r=l(e,t),t-=.05;if(r.length<n)throw new Error("Could not find enough samples for a reliable detection.");return r}function l(e,r){for(var t=[],o=0,n=e.length;o<n;o+=1)e[o]>r&&(t.push(o),o+=1e4);return t}function y(e){var r=[];return e.forEach(function(t,o){for(var n=function(x){var g=e[o+x]-t,_=r.some(function(h){if(h.interval===g)return h.count+=1});_||r.push({interval:g,count:1})},u=0;u<10;u+=1)n(u)}),r}function O(e){return function(r){var t=[];return r.forEach(function(o){if(o.interval!==0){for(var n=60/(o.interval/e);n<90;)n*=2;for(;n>180;)n/=2;n=Math.round(n);var u=t.some(function(f){if(f.tempo===n)return f.count+=o.count});u||t.push({tempo:n,count:o.count})}}),t}}return v}var p,b;function q(){return b||(b=1,p=k().default),p}var m=q();const A=P(m),D=j({__proto__:null,default:A},[m]);export{D as i};
1
+ import{g as P}from"./index-CfBGQdrX.js";function j(c,d){for(var s=0;s<d.length;s++){const a=d[s];if(typeof a!="string"&&!Array.isArray(a)){for(const i in a)if(i!=="default"&&!(i in c)){const l=Object.getOwnPropertyDescriptor(a,i);l&&Object.defineProperty(c,i,l.get?l:{enumerable:!0,get:()=>a[i]})}}}return Object.freeze(Object.defineProperty(c,Symbol.toStringTag,{value:"Module"}))}var v={},w;function k(){if(w)return v;w=1,Object.defineProperty(v,"__esModule",{value:!0}),v.default=d;var c=window.OfflineAudioContext||window.webkitOfflineAudioContext;function d(e){var r=a(e);return r.start(0),[i,y,O(e.sampleRate),s].reduce(function(t,o){return o(t)},r.buffer.getChannelData(0))}function s(e){return e.sort(function(r,t){return t.count-r.count}).splice(0,5)[0].tempo}function a(e){var r=e.length,t=e.numberOfChannels,o=e.sampleRate,n=new c(t,r,o),u=n.createBufferSource();u.buffer=e;var f=n.createBiquadFilter();return f.type="lowpass",u.connect(f),f.connect(n.destination),u}function i(e){for(var r=[],t=.9,o=.3,n=15;r.length<n&&t>=o;)r=l(e,t),t-=.05;if(r.length<n)throw new Error("Could not find enough samples for a reliable detection.");return r}function l(e,r){for(var t=[],o=0,n=e.length;o<n;o+=1)e[o]>r&&(t.push(o),o+=1e4);return t}function y(e){var r=[];return e.forEach(function(t,o){for(var n=function(x){var g=e[o+x]-t,_=r.some(function(h){if(h.interval===g)return h.count+=1});_||r.push({interval:g,count:1})},u=0;u<10;u+=1)n(u)}),r}function O(e){return function(r){var t=[];return r.forEach(function(o){if(o.interval!==0){for(var n=60/(o.interval/e);n<90;)n*=2;for(;n>180;)n/=2;n=Math.round(n);var u=t.some(function(f){if(f.tempo===n)return f.count+=o.count});u||t.push({tempo:n,count:o.count})}}),t}}return v}var p,b;function q(){return b||(b=1,p=k().default),p}var m=q();const A=P(m),D=j({__proto__:null,default:A},[m]);export{D as i};
@@ -1,4 +1,4 @@
1
- import{n as Qi}from"./index-GqONLcOl.js";/*!
1
+ import{n as Qi}from"./index-CfBGQdrX.js";/*!
2
2
  * Copyright (c) 2026-present, Vanilagy and contributors
3
3
  *
4
4
  * This Source Code Form is subject to the terms of the Mozilla Public