hyperframes 0.7.76 → 0.7.77

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.76" : "0.0.0-dev";
53
+ VERSION = true ? "0.7.77" : "0.0.0-dev";
54
54
  }
55
55
  });
56
56
 
@@ -88675,57 +88675,15 @@ var init_system = __esm({
88675
88675
  }
88676
88676
  });
88677
88677
 
88678
- // src/telemetry/client.ts
88678
+ // src/telemetry/transport.ts
88679
88679
  import { spawn as spawn5 } from "child_process";
88680
88680
  import { randomUUID as randomUUID3 } from "crypto";
88681
- function shouldTrack() {
88682
- if (telemetryEnabled !== null) return telemetryEnabled;
88683
- if (process.env["HYPERFRAMES_NO_TELEMETRY"] === "1" || process.env["DO_NOT_TRACK"] === "1") {
88684
- telemetryEnabled = false;
88685
- return false;
88686
- }
88687
- if (isDevMode()) {
88688
- telemetryEnabled = false;
88689
- return false;
88690
- }
88691
- if (!POSTHOG_API_KEY.startsWith("phc_")) {
88692
- telemetryEnabled = false;
88693
- return false;
88694
- }
88695
- const config = readConfig();
88696
- telemetryEnabled = config.telemetryEnabled;
88697
- return telemetryEnabled;
88698
- }
88699
- function trackEvent(event, properties = {}, distinctId) {
88700
- if (!shouldTrack()) return;
88701
- const sys = getSystemMeta();
88681
+ function enqueue(event, properties, distinctId) {
88702
88682
  eventQueue.push({
88703
88683
  uuid: randomUUID3(),
88704
88684
  event,
88705
88685
  distinctId,
88706
- properties: {
88707
- ...properties,
88708
- cli_version: VERSION,
88709
- os: process.platform,
88710
- arch: process.arch,
88711
- node_version: process.version,
88712
- os_release: sys.os_release,
88713
- cpu_count: sys.cpu_count,
88714
- cpu_model: sys.cpu_model ?? void 0,
88715
- cpu_speed: sys.cpu_speed ?? void 0,
88716
- memory_total_mb: sys.memory_total_mb,
88717
- is_docker: sys.is_docker,
88718
- is_ci: sys.is_ci,
88719
- ci_name: sys.ci_name ?? void 0,
88720
- is_wsl: sys.is_wsl,
88721
- is_tty: sys.is_tty,
88722
- sandbox_runtime: sys.sandbox_runtime ?? void 0,
88723
- agent_runtime: sys.agent_runtime ?? void 0,
88724
- // New-agent discovery signals — populated only when agent_runtime is null.
88725
- agent_hint: sys.agent_hint ?? void 0,
88726
- term_program: sys.term_program ?? void 0,
88727
- agent_env_hints: sys.agent_env_hints ?? void 0
88728
- },
88686
+ properties,
88729
88687
  timestamp: (/* @__PURE__ */ new Date()).toISOString()
88730
88688
  });
88731
88689
  }
@@ -88778,6 +88736,68 @@ function flushSync() {
88778
88736
  } catch {
88779
88737
  }
88780
88738
  }
88739
+ var POSTHOG_API_KEY, POSTHOG_HOST, FLUSH_TIMEOUT_MS, eventQueue;
88740
+ var init_transport = __esm({
88741
+ "src/telemetry/transport.ts"() {
88742
+ "use strict";
88743
+ init_config();
88744
+ POSTHOG_API_KEY = "phc_zjjbX0PnWxERXrMHhkEJWj9A9BhGVLRReICgsfTMmpx";
88745
+ POSTHOG_HOST = "https://us.i.posthog.com";
88746
+ FLUSH_TIMEOUT_MS = 5e3;
88747
+ eventQueue = [];
88748
+ }
88749
+ });
88750
+
88751
+ // src/telemetry/client.ts
88752
+ function shouldTrack() {
88753
+ if (telemetryEnabled !== null) return telemetryEnabled;
88754
+ if (process.env["HYPERFRAMES_NO_TELEMETRY"] === "1" || process.env["DO_NOT_TRACK"] === "1") {
88755
+ telemetryEnabled = false;
88756
+ return false;
88757
+ }
88758
+ if (isDevMode()) {
88759
+ telemetryEnabled = false;
88760
+ return false;
88761
+ }
88762
+ if (!POSTHOG_API_KEY.startsWith("phc_")) {
88763
+ telemetryEnabled = false;
88764
+ return false;
88765
+ }
88766
+ const config = readConfig();
88767
+ telemetryEnabled = config.telemetryEnabled;
88768
+ return telemetryEnabled;
88769
+ }
88770
+ function trackEvent(event, properties = {}, distinctId) {
88771
+ if (!shouldTrack()) return;
88772
+ const sys = getSystemMeta();
88773
+ enqueue(
88774
+ event,
88775
+ {
88776
+ ...properties,
88777
+ cli_version: VERSION,
88778
+ os: process.platform,
88779
+ arch: process.arch,
88780
+ node_version: process.version,
88781
+ os_release: sys.os_release,
88782
+ cpu_count: sys.cpu_count,
88783
+ cpu_model: sys.cpu_model ?? void 0,
88784
+ cpu_speed: sys.cpu_speed ?? void 0,
88785
+ memory_total_mb: sys.memory_total_mb,
88786
+ is_docker: sys.is_docker,
88787
+ is_ci: sys.is_ci,
88788
+ ci_name: sys.ci_name ?? void 0,
88789
+ is_wsl: sys.is_wsl,
88790
+ is_tty: sys.is_tty,
88791
+ sandbox_runtime: sys.sandbox_runtime ?? void 0,
88792
+ agent_runtime: sys.agent_runtime ?? void 0,
88793
+ // New-agent discovery signals — populated only when agent_runtime is null.
88794
+ agent_hint: sys.agent_hint ?? void 0,
88795
+ term_program: sys.term_program ?? void 0,
88796
+ agent_env_hints: sys.agent_env_hints ?? void 0
88797
+ },
88798
+ distinctId
88799
+ );
88800
+ }
88781
88801
  function showTelemetryNotice() {
88782
88802
  if (!shouldTrack()) return false;
88783
88803
  const config = readConfig();
@@ -88795,7 +88815,7 @@ function showTelemetryNotice() {
88795
88815
  diag.notice();
88796
88816
  return true;
88797
88817
  }
88798
- var POSTHOG_API_KEY, POSTHOG_HOST, FLUSH_TIMEOUT_MS, eventQueue, telemetryEnabled;
88818
+ var telemetryEnabled;
88799
88819
  var init_client = __esm({
88800
88820
  "src/telemetry/client.ts"() {
88801
88821
  "use strict";
@@ -88805,10 +88825,8 @@ var init_client = __esm({
88805
88825
  init_diagnostics2();
88806
88826
  init_env();
88807
88827
  init_system();
88808
- POSTHOG_API_KEY = "phc_zjjbX0PnWxERXrMHhkEJWj9A9BhGVLRReICgsfTMmpx";
88809
- POSTHOG_HOST = "https://us.i.posthog.com";
88810
- FLUSH_TIMEOUT_MS = 5e3;
88811
- eventQueue = [];
88828
+ init_transport();
88829
+ init_transport();
88812
88830
  telemetryEnabled = null;
88813
88831
  }
88814
88832
  });
@@ -89121,11 +89139,10 @@ function trackSkillsInstallSkipped(props) {
89121
89139
  trackEvent("cli skill install skipped", { reason: props.reason });
89122
89140
  }
89123
89141
  function trackRenderFeedback(props) {
89124
- trackEvent("survey sent", {
89125
- $survey_id: "render_satisfaction",
89126
- $survey_response: props.rating,
89142
+ trackEvent("cli_render_feedback", {
89143
+ rating: props.rating,
89127
89144
  rating_scale: FEEDBACK_RATING_SCALE,
89128
- ...props.comment ? { $survey_response_2: props.comment } : {},
89145
+ ...props.comment ? { comment: props.comment } : {},
89129
89146
  ...props.renderDurationMs !== void 0 ? { render_duration_ms: props.renderDurationMs } : {},
89130
89147
  ...props.doctorSummary ? { doctor_summary: props.doctorSummary } : {},
89131
89148
  ...props.feedbackId ? { feedback_id: props.feedbackId } : {},
@@ -92120,7 +92137,11 @@ function downloadFile(url, dest, options = {}) {
92120
92137
  const timeoutMs = options.timeoutMs ?? DEFAULT_DOWNLOAD_TIMEOUT_MS;
92121
92138
  return new Promise((resolve77, reject) => {
92122
92139
  const follow = (u) => {
92140
+ let activeResponse;
92141
+ let responsePipelineStarted = false;
92142
+ let requestError;
92123
92143
  const request = httpsGet(u, (res) => {
92144
+ activeResponse = res;
92124
92145
  if (res.statusCode === 301 || res.statusCode === 302) {
92125
92146
  const location = res.headers.location;
92126
92147
  if (location) {
@@ -92136,18 +92157,24 @@ function downloadFile(url, dest, options = {}) {
92136
92157
  return;
92137
92158
  }
92138
92159
  const file = createWriteStream2(tmp);
92160
+ responsePipelineStarted = true;
92139
92161
  pipeline2(res, file).then(() => {
92140
92162
  renameSync5(tmp, dest);
92141
92163
  resolve77();
92142
92164
  }).catch((err) => {
92143
92165
  removePartialFile(tmp);
92144
- reject(err);
92166
+ reject(requestError ?? err);
92145
92167
  });
92146
92168
  });
92147
92169
  request.setTimeout(timeoutMs, () => {
92148
92170
  request.destroy(new Error(`Download timed out after ${timeoutMs}ms`));
92149
92171
  });
92150
92172
  request.on("error", (err) => {
92173
+ if (responsePipelineStarted) {
92174
+ requestError = err;
92175
+ activeResponse?.destroy(err);
92176
+ return;
92177
+ }
92151
92178
  removePartialFile(tmp);
92152
92179
  reject(err);
92153
92180
  });
@@ -105263,6 +105290,14 @@ function bakeVisibilityOnDelete(document2, anim) {
105263
105290
  } catch {
105264
105291
  }
105265
105292
  }
105293
+ function resolveReplacementEaseEach(scriptText, request) {
105294
+ if (request.easeEach !== void 0) return request.easeEach;
105295
+ const original = parseGsapScriptAcorn2(scriptText).animations.find(
105296
+ (animation) => animation.id === request.animationId
105297
+ );
105298
+ if (!original?.arcPath?.enabled) return void 0;
105299
+ return original?.keyframes?.easeEach ?? original?.ease;
105300
+ }
105266
105301
  async function executeGsapMutation(body, block, respond2, writer) {
105267
105302
  if (writer === "recast") {
105268
105303
  return executeGsapMutationRecast(body, block, respond2);
@@ -105617,7 +105652,8 @@ function executeGsapMutationAcorn(body, block, respond2) {
105617
105652
  body.position,
105618
105653
  body.duration,
105619
105654
  body.keyframes,
105620
- body.ease
105655
+ body.ease,
105656
+ resolveReplacementEaseEach(block.scriptText, body)
105621
105657
  );
105622
105658
  return added.script;
105623
105659
  }
@@ -105947,7 +105983,8 @@ async function executeGsapMutationRecast(body, block, respond2) {
105947
105983
  body.position,
105948
105984
  body.duration,
105949
105985
  body.keyframes,
105950
- body.ease
105986
+ body.ease,
105987
+ resolveReplacementEaseEach(block.scriptText, body)
105951
105988
  );
105952
105989
  return added.script;
105953
105990
  }
@@ -138769,7 +138806,7 @@ function createPageDriver(page, setTime) {
138769
138806
  setTime(time);
138770
138807
  await seekCompositionTimeline(page, time, DENSE_GEOMETRY_SEEK_OPTIONS);
138771
138808
  },
138772
- collectLayout: (time, tolerance) => collectLayout(page, time, tolerance),
138809
+ collectLayout: (time, tolerance, layout2) => collectLayout(page, time, tolerance, layout2),
138773
138810
  collectOverlap: (time) => collectOverlap(page, time),
138774
138811
  collectLayoutGeometry: () => collectLayoutGeometry(page),
138775
138812
  collectRotationSample: (time) => collectRotationSample(page, time),
@@ -138855,7 +138892,7 @@ async function collectTweenBoundaries2(page) {
138855
138892
  return boundaries.filter(Number.isFinite);
138856
138893
  });
138857
138894
  }
138858
- async function collectLayout(page, time, tolerance) {
138895
+ async function collectLayout(page, time, tolerance, layout2) {
138859
138896
  const raw = await page.evaluate(
138860
138897
  (options) => {
138861
138898
  const audit = Reflect.get(window, "__hyperframesLayoutAudit");
@@ -138863,7 +138900,11 @@ async function collectLayout(page, time, tolerance) {
138863
138900
  const result = Reflect.apply(audit, window, [options]);
138864
138901
  return Array.isArray(result) ? result : [];
138865
138902
  },
138866
- { time, tolerance }
138903
+ {
138904
+ time,
138905
+ tolerance,
138906
+ ...typeof layout2?.proseCoverageFloor === "number" ? { proseCoverageFloor: layout2.proseCoverageFloor } : {}
138907
+ }
138867
138908
  );
138868
138909
  return anchorLayoutIssues(page, raw.flatMap(parseLayoutIssue));
138869
138910
  }
@@ -139635,7 +139676,7 @@ async function collectGridSamples(driver, options, grid, motion) {
139635
139676
  await driver.seek(time);
139636
139677
  const issuesAtTime = [];
139637
139678
  if (layoutSet.has(time)) {
139638
- const layoutIssues = await driver.collectLayout(time, options.tolerance);
139679
+ const layoutIssues = await driver.collectLayout(time, options.tolerance, options.layout);
139639
139680
  collected.layoutIssues.push(...layoutIssues);
139640
139681
  issuesAtTime.push(...layoutIssues);
139641
139682
  collected.geometrySignatures.push(await driver.collectLayoutGeometry());
@@ -140476,7 +140517,8 @@ __export(check_exports, {
140476
140517
  createCheckCommand: () => createCheckCommand,
140477
140518
  default: () => check_default,
140478
140519
  examples: () => examples12,
140479
- parseFrameCheck: () => parseFrameCheck
140520
+ parseFrameCheck: () => parseFrameCheck,
140521
+ parseLayout: () => parseLayout
140480
140522
  });
140481
140523
  function createCheckCommand(dependencies = DEFAULT_COMMAND_DEPENDENCIES) {
140482
140524
  return defineCommand({
@@ -140552,6 +140594,10 @@ function createCheckCommand(dependencies = DEFAULT_COMMAND_DEPENDENCIES) {
140552
140594
  "frame-check": {
140553
140595
  type: "string",
140554
140596
  description: 'Bare --frame-check uses defaults (tol=2px, severity=warning, seek=.5; breach floor=max(120px, 6% of shorter canvas edge)); or pass "severity=error;seek=.25,.75;tol=4" to tune'
140597
+ },
140598
+ layout: {
140599
+ type: "string",
140600
+ description: 'Layout knobs: "proseCoverageFloor=0.05" (0\u20131; default 0.15).'
140555
140601
  }
140556
140602
  },
140557
140603
  async run({ args }) {
@@ -140599,6 +140645,7 @@ function parseCheckOptions(args) {
140599
140645
  snapshots: args.snapshots === true,
140600
140646
  captionZone: parseCaptionZone(args["caption-zone"]),
140601
140647
  frameCheck: parseFrameCheck(args["frame-check"]),
140648
+ layout: parseLayout(args.layout),
140602
140649
  autoProxy: args.proxy
140603
140650
  };
140604
140651
  }
@@ -140627,8 +140674,8 @@ function parseFrameCheckFields(value) {
140627
140674
  }
140628
140675
  function parseFrameCheckTolerance(raw) {
140629
140676
  if (raw === void 0) return void 0;
140630
- const tol = Number.parseFloat(raw);
140631
- if (!Number.isFinite(tol) || tol < 0) throw frameCheckError();
140677
+ const tol = parseNumberStrict(raw);
140678
+ if (tol === null || tol < 0) throw frameCheckError();
140632
140679
  return tol;
140633
140680
  }
140634
140681
  function frameCheckError() {
@@ -140636,6 +140683,45 @@ function frameCheckError() {
140636
140683
  'Invalid --frame-check: use bare --frame-check or "severity=warning|error;seek=.25,.75;tol=4" (all fields optional)'
140637
140684
  );
140638
140685
  }
140686
+ function parseLayout(value) {
140687
+ if (value === void 0 || value === null || value === false) return void 0;
140688
+ if (value === true || value === "") throw layoutError();
140689
+ if (typeof value !== "string") throw layoutError();
140690
+ const fields = parseLayoutFields(value);
140691
+ const proseCoverageFloor = parseProseCoverageFloor(fields.get("proseCoverageFloor"));
140692
+ if (proseCoverageFloor === void 0) throw layoutError();
140693
+ return { proseCoverageFloor };
140694
+ }
140695
+ function parseLayoutFields(value) {
140696
+ const fields = /* @__PURE__ */ new Map();
140697
+ for (const part of value.split(";")) {
140698
+ const trimmed = part.trim();
140699
+ if (!trimmed) continue;
140700
+ const separator = trimmed.indexOf("=");
140701
+ if (separator <= 0) throw layoutError();
140702
+ const key2 = trimmed.slice(0, separator).trim();
140703
+ const entry = trimmed.slice(separator + 1).trim();
140704
+ if (!LAYOUT_FIELDS.has(key2) || fields.has(key2)) throw layoutError();
140705
+ fields.set(key2, entry);
140706
+ }
140707
+ return fields;
140708
+ }
140709
+ function parseProseCoverageFloor(raw) {
140710
+ if (raw === void 0) return void 0;
140711
+ const floor = parseNumberStrict(raw);
140712
+ if (floor === null || floor < 0 || floor > 1) throw layoutError();
140713
+ return floor;
140714
+ }
140715
+ function layoutError() {
140716
+ return new Error(
140717
+ 'Invalid --layout: use "proseCoverageFloor=0.05" with a fraction from 0 to 1 (inclusive)'
140718
+ );
140719
+ }
140720
+ function parseNumberStrict(raw) {
140721
+ if (raw === "") return null;
140722
+ const value = Number(raw);
140723
+ return Number.isFinite(value) ? value : null;
140724
+ }
140639
140725
  function parseCaptionZone(value) {
140640
140726
  if (value === void 0 || value === null) return void 0;
140641
140727
  const fields = parseCaptionFields(captionZoneString(value));
@@ -140687,8 +140773,8 @@ function requiredCaptionFraction(fields, key2) {
140687
140773
  }
140688
140774
  function captionFraction(value) {
140689
140775
  if (value === void 0 || value === "") return null;
140690
- const parsed = Number(value);
140691
- return Number.isFinite(parsed) && parsed >= 0 && parsed <= 1 ? parsed : null;
140776
+ const parsed = parseNumberStrict(value);
140777
+ return parsed !== null && parsed >= 0 && parsed <= 1 ? parsed : null;
140692
140778
  }
140693
140779
  function captionSeverity(value) {
140694
140780
  if (value === void 0) return void 0;
@@ -140808,7 +140894,7 @@ function printCounts(section2) {
140808
140894
  ` ${c.dim(`${section2.errorCount} error(s), ${section2.warningCount} warning(s), ${section2.infoCount} info(s)`)}`
140809
140895
  );
140810
140896
  }
140811
- var examples12, DEFAULT_COMMAND_DEPENDENCIES, CAPTION_ZONE_FIELDS, FRAME_CHECK_FIELDS, check_default;
140897
+ var examples12, DEFAULT_COMMAND_DEPENDENCIES, CAPTION_ZONE_FIELDS, FRAME_CHECK_FIELDS, LAYOUT_FIELDS, check_default;
140812
140898
  var init_check = __esm({
140813
140899
  "src/commands/check.ts"() {
140814
140900
  "use strict";
@@ -140834,6 +140920,7 @@ var init_check = __esm({
140834
140920
  };
140835
140921
  CAPTION_ZONE_FIELDS = /* @__PURE__ */ new Set(["x0", "y0", "x1", "y1", "severity", "seek"]);
140836
140922
  FRAME_CHECK_FIELDS = /* @__PURE__ */ new Set(["severity", "seek", "tol"]);
140923
+ LAYOUT_FIELDS = /* @__PURE__ */ new Set(["proseCoverageFloor"]);
140837
140924
  check_default = createCheckCommand();
140838
140925
  }
140839
140926
  });
@@ -935,7 +935,8 @@
935
935
  // (the pre-#U10 behaviour). Longer prose survives a nibbled edge; only flag
936
936
  // once a real share of it is covered — see `occludedTextIssue`.
937
937
  const ATOMIC_LABEL_MAX_CHARS = 16;
938
- const PROSE_COVERAGE_FLOOR = 0.15;
938
+ // Default prose floor — callers may lower via auditLayout({ proseCoverageFloor }).
939
+ const DEFAULT_PROSE_COVERAGE_FLOOR = 0.15;
939
940
 
940
941
  function isAtomicLabel(text) {
941
942
  return text.length > 0 && text.length <= ATOMIC_LABEL_MAX_CHARS && !/\s/.test(text);
@@ -995,12 +996,8 @@
995
996
  return false;
996
997
  }
997
998
 
998
- // Catches the blind spot the overflow checks miss: text that fits its box
999
- // perfectly but is covered by a later sibling/overlay. An atomic label
1000
- // (short, no whitespace) flags at any coverage; ordinary prose only flags
1001
- // once coveredFraction clears PROSE_COVERAGE_FLOOR, since a sliver of edge
1002
- // cover on a paragraph is usually a styling artifact, not a reading defect.
1003
- function occludedTextIssue(element, time) {
999
+ // text_occluded: atomic labels flag at any hit; prose needs coveredFraction >= proseCoverageFloor (default 0.15).
1000
+ function occludedTextIssue(element, time, proseCoverageFloor) {
1004
1001
  if (hasAllowOcclusionFlag(element)) return null;
1005
1002
  if (!hasVisibleTextInk(element)) return null;
1006
1003
  const textRect = textRectFor(element, true);
@@ -1012,7 +1009,7 @@
1012
1009
  textRects.length > 0 ? textRects : [textRect],
1013
1010
  );
1014
1011
  if (!occluder) return null;
1015
- if (!isAtomicLabel(text) && coveredFraction < PROSE_COVERAGE_FLOOR) return null;
1012
+ if (!isAtomicLabel(text) && coveredFraction < proseCoverageFloor) return null;
1016
1013
  return {
1017
1014
  code: "text_occluded",
1018
1015
  severity: "error",
@@ -1420,6 +1417,10 @@
1420
1417
  const time = options && typeof options.time === "number" ? options.time : 0;
1421
1418
  const tolerance =
1422
1419
  options && typeof options.tolerance === "number" ? Math.max(0, options.tolerance) : 2;
1420
+ const proseCoverageFloor =
1421
+ options && typeof options.proseCoverageFloor === "number"
1422
+ ? Math.min(1, Math.max(0, options.proseCoverageFloor))
1423
+ : DEFAULT_PROSE_COVERAGE_FLOOR;
1423
1424
  const root =
1424
1425
  document.querySelector("[data-composition-id][data-width][data-height]") ||
1425
1426
  document.querySelector("[data-composition-id]") ||
@@ -1437,7 +1438,7 @@
1437
1438
  const clipped = clippedTextIssue(element, time, tolerance);
1438
1439
  if (clipped) issues.push(clipped);
1439
1440
  issues.push(...textOverflowIssues(element, root, rootRect, time, tolerance));
1440
- const occluded = occludedTextIssue(element, time);
1441
+ const occluded = occludedTextIssue(element, time, proseCoverageFloor);
1441
1442
  if (occluded) issues.push(occluded);
1442
1443
  const invisible = invisibleTextIssue(element, time);
1443
1444
  if (invisible) issues.push(invisible);
@@ -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.76/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=`
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.77/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;
@@ -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-BdOfFsR8.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=`
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-Bp4jAYZG.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-BdOfFsR8.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-Bp4jAYZG.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-BdOfFsR8.js";/*!
1
+ import{n as Qi}from"./index-Bp4jAYZG.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