hyperframes 0.7.100 → 0.7.101
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 +96 -63
- package/dist/hyperframes-player.global.js +1 -1
- package/dist/studio/assets/{hyperframes-player-D0x4bQn-.js → hyperframes-player-BxSY8bs4.js} +1 -1
- package/dist/studio/assets/{index-Cy1eXOyE.js → index-BlRPDw0A.js} +1 -1
- package/dist/studio/assets/{index-CVAZ9AJE.js → index-DF06yGPO.js} +117 -117
- package/dist/studio/assets/{index-F8iVj3EF.js → index-Dkz5RbFX.js} +1 -1
- package/dist/studio/index.html +1 -1
- package/dist/studio/index.js +33 -15
- package/dist/studio/index.js.map +1 -1
- package/package.json +1 -1
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.
|
|
53
|
+
VERSION = true ? "0.7.101" : "0.0.0-dev";
|
|
54
54
|
}
|
|
55
55
|
});
|
|
56
56
|
|
|
@@ -62453,7 +62453,19 @@ var init_canaryRegistry = __esm({
|
|
|
62453
62453
|
// ── Real rollouts ────────────────────────────────────────────────────────
|
|
62454
62454
|
{
|
|
62455
62455
|
name: "de-parallel-router",
|
|
62456
|
-
|
|
62456
|
+
// Ramp 5 -> 25 -> 100. This gates the DEFAULT-ON behaviour (uncapped, no
|
|
62457
|
+
// telemetry precondition), not the old capped trial — so 0 means the
|
|
62458
|
+
// router is off for everyone and is a full revert without a release.
|
|
62459
|
+
//
|
|
62460
|
+
// Calibration validated the bucketer first: 9.62%/49.76% against 10%/50%
|
|
62461
|
+
// targets at n=13,547, overrides and CI both attributable, sustained
|
|
62462
|
+
// cohort flips at 0.10% — an order of magnitude under this feature's own
|
|
62463
|
+
// ~2.79% revert rate.
|
|
62464
|
+
//
|
|
62465
|
+
// At each step split revert rate by cpu_count and is_docker. Hold at 5
|
|
62466
|
+
// until PRINFRA-372 is resolved: `--workers auto` crashes every worker on
|
|
62467
|
+
// macOS arm64 while `--workers 1` is clean, and the router forces 3.
|
|
62468
|
+
percentage: 5,
|
|
62457
62469
|
description: "Route auto multi-worker renders to verified parallel drawElement streaming (HF_DE_PARALLEL_ROUTER). Ramp only alongside the per-install circuit breaker.",
|
|
62458
62470
|
owner: "vance",
|
|
62459
62471
|
sunsetAfter: "2026-10-01"
|
|
@@ -90903,6 +90915,9 @@ function resolveCanary(name) {
|
|
|
90903
90915
|
decisions.set(name, decision);
|
|
90904
90916
|
return decision;
|
|
90905
90917
|
}
|
|
90918
|
+
function isCanaryEnabled(name) {
|
|
90919
|
+
return resolveCanary(name).enabled;
|
|
90920
|
+
}
|
|
90906
90921
|
function canaryDecisionsForStudio() {
|
|
90907
90922
|
const out = {};
|
|
90908
90923
|
for (const canary of CANARIES) {
|
|
@@ -125819,6 +125834,11 @@ function resolveInversionRetryPlan(args) {
|
|
|
125819
125834
|
deWorkerInversion: "reverted"
|
|
125820
125835
|
};
|
|
125821
125836
|
}
|
|
125837
|
+
function isDeParallelRouterEnabled(env) {
|
|
125838
|
+
const raw = env.HF_DE_PARALLEL_ROUTER?.trim().toLowerCase();
|
|
125839
|
+
if (raw === void 0 || raw === "") return true;
|
|
125840
|
+
return !(raw === "false" || raw === "0" || raw === "off" || raw === "no");
|
|
125841
|
+
}
|
|
125822
125842
|
function shouldPreferParallelDrawElement(args) {
|
|
125823
125843
|
return args.routerEnabled && args.parallelStreamingAvailable && args.workerCount > 1 && typeof args.requestedWorkers !== "number" && args.useDrawElement && !args.deCompileGate && !args.forceScreenshot && args.outputFormat === "mp4" && args.minFrames > 0 && args.totalFrames >= args.minFrames && !args.layeredOrEffectRoute && !args.supersampling && !args.probeDeGated && !args.experimentalParallelDeOptIn && // RAM floor: routed parallel DE runs 3 concurrent hardware-GPU Chrome
|
|
125824
125844
|
// instances. On a 16 GB machine that produced vertical black slabs in the
|
|
@@ -126427,7 +126447,7 @@ async function executeRenderPipeline(input2) {
|
|
|
126427
126447
|
});
|
|
126428
126448
|
const deInversionEligible = deShortBandRoute && deShortBand === "applied" ? invertAtBandFloor : invertAtBaseFloor;
|
|
126429
126449
|
const deInversionEffectiveMinFrames = deShortBandRoute && deShortBand === "applied" ? Math.min(deSingleMinFrames, deShortBandMinFrames) : deSingleMinFrames;
|
|
126430
|
-
const deParallelRouterEnabled = process.env
|
|
126450
|
+
const deParallelRouterEnabled = isDeParallelRouterEnabled(process.env);
|
|
126431
126451
|
const deParallelMinFramesRaw = process.env.HF_DE_PARALLEL_MIN_FRAMES;
|
|
126432
126452
|
const deParallelMinFramesNum = deParallelMinFramesRaw === void 0 || deParallelMinFramesRaw.trim() === "" ? 700 : Number(deParallelMinFramesRaw);
|
|
126433
126453
|
const deParallelMinFrames = Number.isFinite(deParallelMinFramesNum) ? deParallelMinFramesNum : 700;
|
|
@@ -139179,7 +139199,7 @@ async function executeRenderPlan(plan2, dependencies) {
|
|
|
139179
139199
|
protocolTimeout: plan2.protocolTimeout,
|
|
139180
139200
|
playerReadyTimeout: plan2.playerReadyTimeout,
|
|
139181
139201
|
exitAfterComplete: true,
|
|
139182
|
-
|
|
139202
|
+
manageDeParallelRouterBreaker: true
|
|
139183
139203
|
};
|
|
139184
139204
|
if (plan2.useDocker) {
|
|
139185
139205
|
options.pageSideCompositing = plan2.pageSideCompositing;
|
|
@@ -139297,7 +139317,7 @@ async function executeBatchRender(plan2, browserPath, batchModule, preparedBatch
|
|
|
139297
139317
|
exitAfterComplete: false,
|
|
139298
139318
|
throwOnError: true,
|
|
139299
139319
|
skipFeedback: true,
|
|
139300
|
-
|
|
139320
|
+
manageDeParallelRouterBreaker: plan2.batchConcurrency <= 1
|
|
139301
139321
|
};
|
|
139302
139322
|
const manifest = await batchModule.runBatchRender({
|
|
139303
139323
|
prepared: preparedBatch,
|
|
@@ -140189,9 +140209,10 @@ async function renderLocal(projectDir, outputPath, options) {
|
|
|
140189
140209
|
}
|
|
140190
140210
|
}
|
|
140191
140211
|
const producer = await loadProducer();
|
|
140192
|
-
const
|
|
140193
|
-
|
|
140194
|
-
|
|
140212
|
+
const deParallelRouterActive = options.manageDeParallelRouterBreaker === true ? applyDeParallelRouterCircuitBreaker(options.quiet) : (
|
|
140213
|
+
// Not managing the breaker: the router still runs (producer default),
|
|
140214
|
+
// we just don't enforce or record the per-install trip.
|
|
140215
|
+
false
|
|
140195
140216
|
);
|
|
140196
140217
|
const startTime = Date.now();
|
|
140197
140218
|
const logger = createRenderTelemetryLogger(
|
|
@@ -140234,7 +140255,7 @@ async function renderLocal(projectDir, outputPath, options) {
|
|
|
140234
140255
|
try {
|
|
140235
140256
|
await producer.executeRenderJob(job, projectDir, outputPath, onProgress);
|
|
140236
140257
|
} catch (error) {
|
|
140237
|
-
maybeConsumeDeParallelRouterTrial(
|
|
140258
|
+
maybeConsumeDeParallelRouterTrial(deParallelRouterActive, job, options.quiet);
|
|
140238
140259
|
handleRenderError(
|
|
140239
140260
|
error,
|
|
140240
140261
|
options,
|
|
@@ -140246,7 +140267,7 @@ async function renderLocal(projectDir, outputPath, options) {
|
|
|
140246
140267
|
);
|
|
140247
140268
|
}
|
|
140248
140269
|
markRenderSucceeded();
|
|
140249
|
-
maybeConsumeDeParallelRouterTrial(
|
|
140270
|
+
maybeConsumeDeParallelRouterTrial(deParallelRouterActive, job, options.quiet);
|
|
140250
140271
|
const elapsed = Date.now() - startTime;
|
|
140251
140272
|
if (job.outcome === "completed_with_warnings") {
|
|
140252
140273
|
for (const warning of job.warnings) {
|
|
@@ -140389,46 +140410,49 @@ function createNoopProducerLogger() {
|
|
|
140389
140410
|
};
|
|
140390
140411
|
}
|
|
140391
140412
|
function __resetDeParallelRouterTrialStateForTests() {
|
|
140392
|
-
|
|
140393
|
-
|
|
140394
|
-
|
|
140395
|
-
|
|
140396
|
-
|
|
140397
|
-
return
|
|
140398
|
-
|
|
140399
|
-
|
|
140400
|
-
|
|
140401
|
-
|
|
140402
|
-
|
|
140403
|
-
|
|
140404
|
-
|
|
140405
|
-
|
|
140406
|
-
|
|
140407
|
-
|
|
140408
|
-
|
|
140409
|
-
|
|
140410
|
-
|
|
140411
|
-
|
|
140412
|
-
|
|
140413
|
-
if (
|
|
140414
|
-
|
|
140413
|
+
deParallelRouterBreakerTrippedThisProcess = false;
|
|
140414
|
+
deParallelRouterUserManaged = false;
|
|
140415
|
+
deParallelRouterUserManagedResolved = false;
|
|
140416
|
+
}
|
|
140417
|
+
function hasDeParallelRouterBreakerTripped(config) {
|
|
140418
|
+
return deParallelRouterBreakerTrippedThisProcess || Boolean(config.deParallelRouterTrialFired);
|
|
140419
|
+
}
|
|
140420
|
+
function userValueEnablesDeParallelRouter() {
|
|
140421
|
+
const raw = process.env.HF_DE_PARALLEL_ROUTER?.trim().toLowerCase();
|
|
140422
|
+
if (raw === void 0 || raw === "") return true;
|
|
140423
|
+
return !(raw === "false" || raw === "0" || raw === "off" || raw === "no");
|
|
140424
|
+
}
|
|
140425
|
+
function applyDeParallelRouterBreaker() {
|
|
140426
|
+
if (deParallelRouterUserManaged) return;
|
|
140427
|
+
process.env.HF_DE_PARALLEL_ROUTER = "false";
|
|
140428
|
+
}
|
|
140429
|
+
function applyDeParallelRouterCircuitBreaker(quiet) {
|
|
140430
|
+
if (!deParallelRouterUserManagedResolved) {
|
|
140431
|
+
deParallelRouterUserManaged = (process.env.HF_DE_PARALLEL_ROUTER ?? "").trim() !== "";
|
|
140432
|
+
deParallelRouterUserManagedResolved = true;
|
|
140433
|
+
}
|
|
140434
|
+
if (deParallelRouterUserManaged) {
|
|
140435
|
+
return userValueEnablesDeParallelRouter();
|
|
140436
|
+
}
|
|
140437
|
+
if (deParallelRouterBreakerTrippedThisProcess) {
|
|
140438
|
+
applyDeParallelRouterBreaker();
|
|
140415
140439
|
return false;
|
|
140416
140440
|
}
|
|
140417
|
-
|
|
140418
|
-
|
|
140419
|
-
|
|
140420
|
-
|
|
140441
|
+
if (hasDeParallelRouterBreakerTripped(readConfigFresh())) {
|
|
140442
|
+
deParallelRouterBreakerTrippedThisProcess = true;
|
|
140443
|
+
applyDeParallelRouterBreaker();
|
|
140444
|
+
if (!quiet) {
|
|
140445
|
+
console.log(
|
|
140446
|
+
c.dim(
|
|
140447
|
+
" Parallel drawElement capture stays off for this install (a previous render had to fall back). Re-enable with HF_DE_PARALLEL_ROUTER=true."
|
|
140448
|
+
)
|
|
140449
|
+
);
|
|
140450
|
+
}
|
|
140421
140451
|
return false;
|
|
140422
140452
|
}
|
|
140423
|
-
if (
|
|
140424
|
-
|
|
140425
|
-
|
|
140426
|
-
if (!quiet) {
|
|
140427
|
-
console.log(
|
|
140428
|
-
c.dim(
|
|
140429
|
-
" Trying the experimental parallel drawElement capture path for this install (disabled automatically if it ever needs to fall back; opt out anytime: HF_DE_PARALLEL_ROUTER=false)"
|
|
140430
|
-
)
|
|
140431
|
-
);
|
|
140453
|
+
if (!isCanaryEnabled("de-parallel-router")) {
|
|
140454
|
+
applyDeParallelRouterBreaker();
|
|
140455
|
+
return false;
|
|
140432
140456
|
}
|
|
140433
140457
|
return true;
|
|
140434
140458
|
}
|
|
@@ -140450,27 +140474,36 @@ function persistDeParallelRouterTrialFired() {
|
|
|
140450
140474
|
}
|
|
140451
140475
|
return false;
|
|
140452
140476
|
}
|
|
140453
|
-
function maybeConsumeDeParallelRouterTrial(
|
|
140454
|
-
if (!
|
|
140477
|
+
function maybeConsumeDeParallelRouterTrial(routerActive, job, quiet) {
|
|
140478
|
+
if (!routerActive) return;
|
|
140455
140479
|
const outcome = resolveDeParallelRouterOutcome(job);
|
|
140456
140480
|
if (outcome === void 0) return;
|
|
140457
140481
|
const config = readConfigFresh();
|
|
140458
140482
|
const renderCount = (config.deParallelRouterTrialRenderCount ?? 0) + 1;
|
|
140459
140483
|
config.deParallelRouterTrialRenderCount = renderCount;
|
|
140460
|
-
const fired = outcome === "reverted"
|
|
140484
|
+
const fired = outcome === "reverted";
|
|
140461
140485
|
if (fired) {
|
|
140462
140486
|
config.deParallelRouterTrialFired = true;
|
|
140463
|
-
|
|
140464
|
-
|
|
140487
|
+
deParallelRouterBreakerTrippedThisProcess = true;
|
|
140488
|
+
applyDeParallelRouterBreaker();
|
|
140465
140489
|
}
|
|
140466
140490
|
writeConfig(config);
|
|
140467
|
-
if (fired && !
|
|
140468
|
-
|
|
140469
|
-
|
|
140470
|
-
|
|
140471
|
-
|
|
140472
|
-
|
|
140473
|
-
|
|
140491
|
+
if (fired && !deParallelRouterUserManaged) reportDeParallelRouterBreakerTrip(quiet);
|
|
140492
|
+
}
|
|
140493
|
+
function reportDeParallelRouterBreakerTrip(quiet) {
|
|
140494
|
+
const persisted = persistDeParallelRouterTrialFired();
|
|
140495
|
+
if (quiet) return;
|
|
140496
|
+
console.log(
|
|
140497
|
+
c.dim(
|
|
140498
|
+
" A frame failed verification, so parallel drawElement capture fell back to the screenshot path and is now off for this install. Re-enable: HF_DE_PARALLEL_ROUTER=true"
|
|
140499
|
+
)
|
|
140500
|
+
);
|
|
140501
|
+
if (persisted) return;
|
|
140502
|
+
console.warn(
|
|
140503
|
+
c.warn(
|
|
140504
|
+
" Could not persist the parallel drawElement circuit breaker to ~/.hyperframes/config.json (unwritable?). It stays off for this process; future runs may retry it. Set HF_DE_PARALLEL_ROUTER=false to opt out for good."
|
|
140505
|
+
)
|
|
140506
|
+
);
|
|
140474
140507
|
}
|
|
140475
140508
|
function handleRenderError(error, options, startTime, docker, hint2, failedStage, job) {
|
|
140476
140509
|
const message = normalizeErrorMessage(error);
|
|
@@ -140625,11 +140658,12 @@ function printRenderComplete(outputPath, elapsedMs, quiet, outputDurationSeconds
|
|
|
140625
140658
|
console.log(c.success("\u25C7") + " " + c.accent(outputPath));
|
|
140626
140659
|
console.log(" " + c.bold(fileSize) + c.dim(" \xB7 " + detail));
|
|
140627
140660
|
}
|
|
140628
|
-
var examples9, render_default, DOCKER_IMAGE_PREFIX,
|
|
140661
|
+
var examples9, render_default, DOCKER_IMAGE_PREFIX, deParallelRouterUserManaged, deParallelRouterUserManagedResolved, deParallelRouterBreakerTrippedThisProcess;
|
|
140629
140662
|
var init_render = __esm({
|
|
140630
140663
|
"src/commands/render.ts"() {
|
|
140631
140664
|
"use strict";
|
|
140632
140665
|
init_commandResult();
|
|
140666
|
+
init_canary2();
|
|
140633
140667
|
init_dist();
|
|
140634
140668
|
init_plan2();
|
|
140635
140669
|
init_projectConfig();
|
|
@@ -140643,7 +140677,6 @@ var init_render = __esm({
|
|
|
140643
140677
|
init_events();
|
|
140644
140678
|
init_feedback();
|
|
140645
140679
|
init_config();
|
|
140646
|
-
init_client();
|
|
140647
140680
|
init_renderObservability();
|
|
140648
140681
|
init_system();
|
|
140649
140682
|
init_version();
|
|
@@ -140898,9 +140931,9 @@ var init_render = __esm({
|
|
|
140898
140931
|
}
|
|
140899
140932
|
});
|
|
140900
140933
|
DOCKER_IMAGE_PREFIX = "hyperframes-renderer";
|
|
140901
|
-
|
|
140902
|
-
|
|
140903
|
-
|
|
140934
|
+
deParallelRouterUserManaged = false;
|
|
140935
|
+
deParallelRouterUserManagedResolved = false;
|
|
140936
|
+
deParallelRouterBreakerTrippedThisProcess = false;
|
|
140904
140937
|
}
|
|
140905
140938
|
});
|
|
140906
140939
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var HyperframesPlayer=(()=>{var J=Object.defineProperty;var Ge=Object.getOwnPropertyDescriptor;var qe=Object.getOwnPropertyNames;var Ye=Object.prototype.hasOwnProperty;var Xe=(i,e)=>{for(var t in e)J(i,t,{get:e[t],enumerable:!0})},Ze=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of qe(e))!Ye.call(i,n)&&n!==t&&J(i,n,{get:()=>e[n],enumerable:!(r=Ge(e,n))||r.enumerable});return i};var Qe=i=>Ze(J({},"__esModule",{value:!0}),i);var Lt={};Xe(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 Je="https://cdn.jsdelivr.net/npm/@hyperframes/core@0.7.
|
|
1
|
+
"use strict";var HyperframesPlayer=(()=>{var J=Object.defineProperty;var Ge=Object.getOwnPropertyDescriptor;var qe=Object.getOwnPropertyNames;var Ye=Object.prototype.hasOwnProperty;var Xe=(i,e)=>{for(var t in e)J(i,t,{get:e[t],enumerable:!0})},Ze=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of qe(e))!Ye.call(i,n)&&n!==t&&J(i,n,{get:()=>e[n],enumerable:!(r=Ge(e,n))||r.enumerable});return i};var Qe=i=>Ze(J({},"__esModule",{value:!0}),i);var Lt={};Xe(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 Je="https://cdn.jsdelivr.net/npm/@hyperframes/core@0.7.101/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 Ke(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=Ke(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=Je,(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;
|
package/dist/studio/assets/{hyperframes-player-D0x4bQn-.js → hyperframes-player-BxSY8bs4.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var ce=Object.defineProperty;var pe=(r,t,e)=>t in r?ce(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var c=(r,t,e)=>pe(r,typeof t!="symbol"?t+"":t,e);import{r as ne,i as me,a as fe}from"./index-
|
|
1
|
+
var ce=Object.defineProperty;var pe=(r,t,e)=>t in r?ce(r,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[t]=e;var c=(r,t,e)=>pe(r,typeof t!="symbol"?t+"":t,e);import{r as ne,i as me,a as fe}from"./index-DF06yGPO.js";function _e(r){return r.hasRuntime||r.runtimeInjected?!1:!!(r.hasNestedCompositions||r.hasTimelines&&r.attempts>=5)}function F(r){return typeof r=="object"&&r!==null}function ge(r){return F(r)&&typeof r.getDuration=="function"}function ye(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 ve(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 be=typeof __HYPERFRAMES_RUNTIME_CDN_URL__=="string"?__HYPERFRAMES_RUNTIME_CDN_URL__:ve("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 we(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 Ae{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(_e({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=we(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=be,(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 ye(d)?d:null}_resolvePlaybackDurationAdapter(t){const e=Reflect.get(t,"__player");if(ge(e))return{kind:"runtime",getDuration:()=>e.getDuration()};const i=this._resolveDirectTimelineAdapterFromWindow(t);return i?{kind:"direct-timeline",timeline:i,getDuration:()=>i.duration()}:null}}const Ee=`
|
|
2
2
|
:host {
|
|
3
3
|
display: block;
|
|
4
4
|
position: relative;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as P}from"./index-
|
|
1
|
+
import{g as P}from"./index-DF06yGPO.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};
|