demoman 0.7.0 → 0.7.1

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.
@@ -15464,7 +15464,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
15464
15464
  type: { cursorTravels: true, approach: "nearest" },
15465
15465
  moveTo: { cursorTravels: true, approach: "nearest" },
15466
15466
  scrollTo: { cursorTravels: false, approach: "landing" },
15467
- waitFor: { cursorTravels: false, approach: "none" }
15467
+ waitFor: { cursorTravels: false, approach: "none" },
15468
+ drag: { cursorTravels: true, approach: "nearest" }
15468
15469
  };
15469
15470
 
15470
15471
  // ../../packages/compositor/dist/bundle.js
@@ -15507,7 +15508,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
15507
15508
  var AnchorRectSchema = external_exports.object({
15508
15509
  actionId: external_exports.string().min(1),
15509
15510
  anchorId: external_exports.string().min(1),
15510
- rect: RectSchema
15511
+ rect: RectSchema,
15512
+ /** A drag's end, measured with its start; absent for every other verb. */
15513
+ end: RectSchema.optional()
15514
+ });
15515
+ var HeldPressSchema = external_exports.object({
15516
+ actionId: external_exports.string().min(1),
15517
+ pressMs: external_exports.number().nonnegative(),
15518
+ releaseMs: external_exports.number().nonnegative()
15511
15519
  });
15512
15520
  var ViewportTransformSchema = external_exports.object({
15513
15521
  sourceTimeMs: external_exports.number().nonnegative(),
@@ -15550,7 +15558,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
15550
15558
  /** The typed text; null for every verb that types nothing, and for a
15551
15559
  * redacted field whose value was never recorded. */
15552
15560
  text: external_exports.string().nullable(),
15553
- cut: external_exports.boolean()
15561
+ cut: external_exports.boolean().optional()
15554
15562
  });
15555
15563
  var DegradationSchema = external_exports.object({
15556
15564
  startMs: external_exports.number().nonnegative(),
@@ -15625,7 +15633,16 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
15625
15633
  // `buildLaneModel` turns a nonzero count into a capture-lane clip and a
15626
15634
  // lane-label chip under this name. Named here so the two surfaces share
15627
15635
  // one word for one condition.
15628
- "pacingUnplaced"
15636
+ "pacingUnplaced",
15637
+ // A drag whose press and release both arrived and that changed nothing
15638
+ // on screen: no native drag began and the pixels between its ends were
15639
+ // the same after as before. The page ignored it, so the step is listed
15640
+ // as diverged rather than read as done (2026-10-21).
15641
+ "notDragged",
15642
+ // A native drag's picture could not be drawn in the page (the element
15643
+ // the page named for it was gone, or copying it threw). The drag still
15644
+ // ran; the film shows the card jump to its drop instead of travelling.
15645
+ "dragPictureMissing"
15629
15646
  ]),
15630
15647
  note: external_exports.string()
15631
15648
  });
@@ -15681,6 +15698,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
15681
15698
  // written without this field, and they are all still readable.
15682
15699
  cursorGaps: external_exports.array(CursorGapSchema).default([]),
15683
15700
  anchorRects: external_exports.array(AnchorRectSchema),
15701
+ // Optional, and absent is none: only a run with a drag writes any.
15702
+ heldPresses: external_exports.array(HeldPressSchema).optional(),
15684
15703
  // Optional, and absent is identity: every bundle written before
15685
15704
  // 2026-10-11 carries none, and identity is what they were drawn as.
15686
15705
  // See `ViewportTransformSchema`.
@@ -15960,7 +15979,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
15960
15979
  });
15961
15980
 
15962
15981
  // ../../packages/scene-schema/dist/document.js
15963
- var CURRENT_SCHEMA_VERSION = 10;
15982
+ var CURRENT_SCHEMA_VERSION = 12;
15964
15983
  var Rect = external_exports.object({
15965
15984
  x: external_exports.number(),
15966
15985
  y: external_exports.number(),
@@ -16131,17 +16150,43 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16131
16150
  kind: external_exports.literal("waitFor"),
16132
16151
  condition: external_exports.enum(["visible", "hidden", "loaded"]).optional()
16133
16152
  });
16153
+ var Spot = external_exports.object({
16154
+ x: external_exports.number().min(0).max(1),
16155
+ y: external_exports.number().min(0).max(1)
16156
+ });
16157
+ var Drag = external_exports.object({
16158
+ ...actionBase,
16159
+ kind: external_exports.literal("drag"),
16160
+ /** Null when the end was an offset, which names no element. */
16161
+ toAnchorId: external_exports.string().min(1).nullable(),
16162
+ toRect: Rect.optional(),
16163
+ fromAt: Spot.optional(),
16164
+ /** Where it pressed when the walk chose the spot itself — a native
16165
+ * range's thumb, where a press at the centre would jump its value — as a
16166
+ * spot in `rect`. Absent: `fromAt`, else the centre. Never written back
16167
+ * into a script: a re-run reads the thumb afresh. */
16168
+ pressedAt: Spot.optional(),
16169
+ to: external_exports.union([
16170
+ external_exports.object({ at: Spot.optional() }).strict(),
16171
+ external_exports.object({ by: external_exports.object({ x: external_exports.number(), y: external_exports.number() }) }).strict()
16172
+ ])
16173
+ });
16134
16174
  var Action = external_exports.discriminatedUnion("kind", [
16135
16175
  MoveTo,
16136
16176
  Click,
16137
16177
  TypeAction,
16138
16178
  ScrollTo,
16139
- WaitFor
16179
+ WaitFor,
16180
+ Drag
16140
16181
  ]);
16141
16182
  var MarkerSchema2 = external_exports.object({
16142
16183
  actionId: external_exports.string().min(1),
16143
16184
  offsetMs: external_exports.number()
16144
16185
  });
16186
+ var SourcePointSchema = external_exports.object({
16187
+ actionId: external_exports.string().min(1),
16188
+ sourceOffsetMs: external_exports.number()
16189
+ });
16145
16190
  var Point = external_exports.object({ x: external_exports.number(), y: external_exports.number() });
16146
16191
  var CameraEvent = external_exports.object({
16147
16192
  id: external_exports.string().min(1),
@@ -16178,12 +16223,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16178
16223
  named.push(["afterActionId", skip.afterActionId]);
16179
16224
  return named;
16180
16225
  }
16181
- var Replacement = external_exports.object({
16182
- id: external_exports.string().min(1),
16183
- targetAnchorId: external_exports.string().min(1).nullable(),
16184
- find: external_exports.string().nullable(),
16185
- replace: external_exports.string()
16186
- });
16187
16226
  var Mask = external_exports.object({
16188
16227
  id: external_exports.string().min(1),
16189
16228
  rect: Rect,
@@ -16203,12 +16242,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16203
16242
  afterActionId: external_exports.string().min(1),
16204
16243
  durationMs: external_exports.number().nonnegative()
16205
16244
  });
16206
- var Cut = external_exports.object({
16207
- id: external_exports.string().min(1),
16208
- actionId: external_exports.string().min(1),
16209
- /** The author chose to keep a jump rather than have export rebuild it. */
16210
- keepJump: external_exports.literal(true).optional()
16211
- });
16212
16245
  var NetworkEntry = external_exports.object({
16213
16246
  id: external_exports.string().min(1),
16214
16247
  method: external_exports.enum(["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"]),
@@ -16418,11 +16451,21 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16418
16451
  /** See `ZoomSkipped`. */
16419
16452
  zoomsSkipped: external_exports.array(ZoomSkipped).optional(),
16420
16453
  edits: external_exports.object({
16421
- replacements: external_exports.array(Replacement),
16422
16454
  masks: external_exports.array(Mask),
16423
16455
  holds: external_exports.array(Hold),
16424
16456
  gaps: external_exports.array(Gap).default([]),
16425
- cuts: external_exports.array(Cut).default([]),
16457
+ /** Where the author split the clip. A split alone removes nothing. */
16458
+ splits: external_exports.array(external_exports.object({ id: external_exports.string().min(1), at: SourcePointSchema })).default([]),
16459
+ /**
16460
+ * Stretches of the frames the author removed. A null side is that end
16461
+ * of the take. Its edits stay in the document; what it removes is
16462
+ * resolved against the frames by the compositor.
16463
+ */
16464
+ removed: external_exports.array(external_exports.object({
16465
+ id: external_exports.string().min(1),
16466
+ start: SourcePointSchema.nullable(),
16467
+ end: SourcePointSchema.nullable()
16468
+ })).default([]),
16426
16469
  /**
16427
16470
  * A cut on the OUTPUT axis, never on the action log: a step outside
16428
16471
  * the trim still exists and a Rebuild still performs it (that is what
@@ -16473,19 +16516,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16473
16516
  unique(doc.edits.holds, "hold", ["edits", "holds"]);
16474
16517
  unique(doc.edits.gaps, "gap", ["edits", "gaps"]);
16475
16518
  unique(doc.edits.gaps.map((g) => ({ id: g.afterActionId })), "gap for an action", ["edits", "gaps"]);
16476
- unique(doc.edits.cuts, "cut", ["edits", "cuts"]);
16477
- unique(doc.edits.cuts.map((c) => ({ id: c.actionId })), "cut for an action", ["edits", "cuts"]);
16519
+ unique(doc.edits.splits, "split", ["edits", "splits"]);
16520
+ unique(doc.edits.removed, "removed piece", ["edits", "removed"]);
16478
16521
  const anchorIds = new Set(doc.anchors.map((a) => a.id));
16479
16522
  const actionIds = new Set(doc.actions.map((a) => a.id));
16480
- doc.edits.cuts.forEach((c, i) => {
16481
- if (!actionIds.has(c.actionId)) {
16482
- ctx.addIssue({
16483
- code: "custom",
16484
- message: `unknown action "${c.actionId}"`,
16485
- path: ["edits", "cuts", i, "actionId"]
16486
- });
16487
- }
16488
- });
16489
16523
  doc.actions.forEach((a, i) => {
16490
16524
  if (a.anchorId !== null && !anchorIds.has(a.anchorId)) {
16491
16525
  ctx.addIssue({
@@ -16575,24 +16609,36 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16575
16609
  });
16576
16610
  }
16577
16611
  }
16578
- doc.edits.replacements.forEach((r, i) => {
16579
- if (r.targetAnchorId !== null && !anchorIds.has(r.targetAnchorId)) {
16612
+ doc.edits.holds.forEach((h, i) => {
16613
+ if (!actionIds.has(h.marker.actionId)) {
16580
16614
  ctx.addIssue({
16581
16615
  code: "custom",
16582
- message: `unknown anchor "${r.targetAnchorId}"`,
16583
- path: ["edits", "replacements", i, "targetAnchorId"]
16616
+ message: `unknown action "${h.marker.actionId}"`,
16617
+ path: ["edits", "holds", i, "marker", "actionId"]
16584
16618
  });
16585
16619
  }
16586
16620
  });
16587
- doc.edits.holds.forEach((h, i) => {
16588
- if (!actionIds.has(h.marker.actionId)) {
16621
+ (doc.edits.splits ?? []).forEach((split, i) => {
16622
+ if (!actionIds.has(split.at.actionId)) {
16589
16623
  ctx.addIssue({
16590
16624
  code: "custom",
16591
- message: `unknown action "${h.marker.actionId}"`,
16592
- path: ["edits", "holds", i, "marker", "actionId"]
16625
+ message: `unknown action "${split.at.actionId}"`,
16626
+ path: ["edits", "splits", i, "at", "actionId"]
16593
16627
  });
16594
16628
  }
16595
16629
  });
16630
+ (doc.edits.removed ?? []).forEach((range, i) => {
16631
+ for (const side of ["start", "end"]) {
16632
+ const point2 = range[side];
16633
+ if (point2 !== null && !actionIds.has(point2.actionId)) {
16634
+ ctx.addIssue({
16635
+ code: "custom",
16636
+ message: `unknown action "${point2.actionId}"`,
16637
+ path: ["edits", "removed", i, side, "actionId"]
16638
+ });
16639
+ }
16640
+ }
16641
+ });
16596
16642
  doc.edits.gaps.forEach((g, i) => {
16597
16643
  if (!actionIds.has(g.afterActionId)) {
16598
16644
  ctx.addIssue({
@@ -16604,12 +16650,52 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16604
16650
  });
16605
16651
  });
16606
16652
 
16653
+ // ../../packages/scene-schema/dist/drag.js
16654
+ function spotIn(rect2, at) {
16655
+ if (at === void 0) {
16656
+ return { x: rect2.x + rect2.width / 2, y: rect2.y + rect2.height / 2 };
16657
+ }
16658
+ return { x: rect2.x + at.x * rect2.width, y: rect2.y + at.y * rect2.height };
16659
+ }
16660
+ function dragEndPoint(start, to, toRect) {
16661
+ if ("by" in to)
16662
+ return { x: start.x + to.by.x, y: start.y + to.by.y };
16663
+ return toRect == null ? null : spotIn(toRect, to.at);
16664
+ }
16665
+ function dragPoints(action, rect2, toRect) {
16666
+ if (rect2 === void 0)
16667
+ return null;
16668
+ const start = spotIn(rect2, action.pressedAt ?? action.fromAt);
16669
+ const end = dragEndPoint(start, action.to, toRect);
16670
+ return end === null ? null : { start, end };
16671
+ }
16672
+
16673
+ // ../../packages/scene-schema/dist/removed.js
16674
+ function stepsInsideRemoved(doc) {
16675
+ const index = new Map(doc.actions.map((a, i) => [a.id, i]));
16676
+ const inside = /* @__PURE__ */ new Set();
16677
+ for (const range of doc.edits.removed ?? []) {
16678
+ const s = range.start === null ? null : index.get(range.start.actionId);
16679
+ const e = range.end === null ? null : index.get(range.end.actionId);
16680
+ if (s === void 0 || e === void 0)
16681
+ continue;
16682
+ doc.actions.forEach((action, i) => {
16683
+ const afterStart = range.start === null || s === null || s < i || i === s && range.start.sourceOffsetMs <= 0;
16684
+ const beforeEnd = range.end === null || e === null || i < e || i === e && range.end.sourceOffsetMs > 0;
16685
+ if (afterStart && beforeEnd)
16686
+ inside.add(action.id);
16687
+ });
16688
+ }
16689
+ return inside;
16690
+ }
16691
+
16607
16692
  // ../../packages/scene-schema/dist/script.js
16608
16693
  var SCRIPT_VERSION = 1;
16609
16694
  var SCRIPT_VERSION_KIT = 2;
16610
16695
  var SCRIPT_VERSION_MOTION = 3;
16611
16696
  var SCRIPT_VERSION_DEVICE = 4;
16612
16697
  var SCRIPT_VERSION_ACCOUNT = 5;
16698
+ var SCRIPT_VERSION_DRAG = 6;
16613
16699
  var ACCOUNT_NAME = /^[a-z0-9][a-z0-9_-]{0,63}$/;
16614
16700
  var ACCOUNT_NAME_RULE = 'lower-case letters, digits, "-" and "_", starting with a letter or digit, at most 64 characters';
16615
16701
  var ScriptTargetSchema = external_exports.union([
@@ -16619,6 +16705,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16619
16705
  external_exports.object({ treePath: external_exports.string().min(1) }).strict()
16620
16706
  ]);
16621
16707
  var RecordedSchema = external_exports.string().min(1).optional();
16708
+ var DragSpotSchema = external_exports.object({ x: external_exports.number().min(0).max(1), y: external_exports.number().min(0).max(1) }).strict();
16709
+ var DragFromSchema = external_exports.object({ on: ScriptTargetSchema, at: DragSpotSchema.optional() }).strict();
16710
+ var DragToSchema = external_exports.union([
16711
+ DragFromSchema,
16712
+ external_exports.object({
16713
+ by: external_exports.object({ x: external_exports.number().finite(), y: external_exports.number().finite() }).strict()
16714
+ }).strict()
16715
+ ]);
16622
16716
  var ScriptStepSchema = external_exports.discriminatedUnion("do", [
16623
16717
  external_exports.object({
16624
16718
  do: external_exports.literal("click"),
@@ -16669,6 +16763,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16669
16763
  until: external_exports.enum(["visible", "hidden"]),
16670
16764
  recorded: RecordedSchema
16671
16765
  }).strict(),
16766
+ external_exports.object({
16767
+ do: external_exports.literal("drag"),
16768
+ from: DragFromSchema,
16769
+ to: DragToSchema,
16770
+ recorded: RecordedSchema
16771
+ }).strict(),
16672
16772
  external_exports.object({ do: external_exports.literal("waitForLoad"), recorded: RecordedSchema }).strict(),
16673
16773
  external_exports.object({ do: external_exports.literal("pause"), ms: external_exports.number().positive() }).strict()
16674
16774
  ]);
@@ -16678,6 +16778,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16678
16778
  hover: true,
16679
16779
  scrollTo: true,
16680
16780
  waitFor: true,
16781
+ drag: true,
16681
16782
  waitForLoad: true,
16682
16783
  pause: false
16683
16784
  };
@@ -16690,7 +16791,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16690
16791
  SCRIPT_VERSION_KIT,
16691
16792
  SCRIPT_VERSION_MOTION,
16692
16793
  SCRIPT_VERSION_DEVICE,
16693
- SCRIPT_VERSION_ACCOUNT
16794
+ SCRIPT_VERSION_ACCOUNT,
16795
+ SCRIPT_VERSION_DRAG
16694
16796
  ]),
16695
16797
  name: external_exports.string().min(1),
16696
16798
  target: external_exports.url(),
@@ -16766,17 +16868,36 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16766
16868
  if (script.device !== void 0 && script.scriptVersion < SCRIPT_VERSION_DEVICE) {
16767
16869
  ctx.addIssue({
16768
16870
  code: "custom",
16769
- message: `a script that names device declares scriptVersion ${SCRIPT_VERSION_DEVICE}: a build from before devices would drop it and film the desktop`,
16871
+ message: `a script that names device declares scriptVersion ${SCRIPT_VERSION_DEVICE}: a build from before devices would drop it and record the desktop`,
16770
16872
  path: ["scriptVersion"]
16771
16873
  });
16772
16874
  }
16773
16875
  if (script.account !== void 0 && script.scriptVersion < SCRIPT_VERSION_ACCOUNT) {
16774
16876
  ctx.addIssue({
16775
16877
  code: "custom",
16776
- message: `a script that names account declares scriptVersion ${SCRIPT_VERSION_ACCOUNT}: a build from before accounts would drop it and film as whoever is signed in`,
16878
+ message: `a script that names account declares scriptVersion ${SCRIPT_VERSION_ACCOUNT}: a build from before accounts would drop it and record as whoever is signed in`,
16777
16879
  path: ["scriptVersion"]
16778
16880
  });
16779
16881
  }
16882
+ script.steps.forEach((step, index) => {
16883
+ if (step.do !== "drag")
16884
+ return;
16885
+ if (script.scriptVersion < SCRIPT_VERSION_DRAG) {
16886
+ ctx.addIssue({
16887
+ code: "custom",
16888
+ message: `a script that uses drag declares scriptVersion ${SCRIPT_VERSION_DRAG}: a build from before drag would refuse the step`,
16889
+ path: ["scriptVersion"]
16890
+ });
16891
+ }
16892
+ const nowhere = "by" in step.to ? step.to.by.x === 0 && step.to.by.y === 0 : JSON.stringify(step.to.on) === JSON.stringify(step.from.on) && (step.to.at?.x ?? 0.5) === (step.from.at?.x ?? 0.5) && (step.to.at?.y ?? 0.5) === (step.from.at?.y ?? 0.5);
16893
+ if (nowhere) {
16894
+ ctx.addIssue({
16895
+ code: "custom",
16896
+ message: `step ${index + 1} is a drag that starts and ends at the same point: give \`to\` another target, spot or offset, or make it a click`,
16897
+ path: ["steps", index, "to"]
16898
+ });
16899
+ }
16900
+ });
16780
16901
  script.steps.forEach((step, index) => {
16781
16902
  if (step.do !== "type" || !/\{secret:/.test(step.text))
16782
16903
  return;
@@ -16844,55 +16965,48 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16844
16965
  const markerAt = new Map(bundle.markers.map((m) => [m.actionId, m.sourceTimeMs]));
16845
16966
  const resolved = [];
16846
16967
  const unplacedCuts = [];
16847
- for (const run of plan.cuts ?? []) {
16848
- const { ids, actionIds } = run;
16849
- const first = actionIds[0];
16850
- const unplaced = (reason) => {
16851
- unplacedCuts.push({ ids, actionIds, reason });
16968
+ for (const piece of plan.removed ?? []) {
16969
+ const ids = [piece.id];
16970
+ const sourceOf = (point2, ifNull) => {
16971
+ if (point2 === null)
16972
+ return ifNull;
16973
+ const marker = markerAt.get(point2.actionId);
16974
+ if (marker === void 0) {
16975
+ return `these frames carry no marker for "${point2.actionId}", so where this piece ${ifNull === 0 ? "starts" : "ends"} is unknown and no frames were removed`;
16976
+ }
16977
+ return clamp(marker + point2.sourceOffsetMs, 0, sourceDurationMs);
16852
16978
  };
16853
- if (first === void 0) {
16854
- unplaced("this cut names no step");
16855
- continue;
16856
- }
16857
- const srcStartMs = markerAt.get(first);
16858
- if (srcStartMs === void 0) {
16859
- unplaced(`these frames carry no marker for "${first}", so they never contained that step and no frames were removed`);
16979
+ const start = sourceOf(piece.start, 0);
16980
+ const end = sourceOf(piece.end, sourceDurationMs);
16981
+ if (typeof start === "string" || typeof end === "string") {
16982
+ unplacedCuts.push({
16983
+ ids,
16984
+ reason: typeof start === "string" ? start : end
16985
+ });
16860
16986
  continue;
16861
16987
  }
16862
- let srcEndMs;
16863
- if (run.untilActionId === null) {
16864
- srcEndMs = sourceDurationMs;
16865
- } else {
16866
- const end = markerAt.get(run.untilActionId);
16867
- if (end === void 0) {
16868
- unplaced(`these frames carry no marker for "${run.untilActionId}", the step this cut runs up to, so where the cut ends is unknown and no frames were removed`);
16869
- continue;
16870
- }
16871
- srcEndMs = end;
16872
- }
16873
- if (srcEndMs <= srcStartMs) {
16874
- unplaced(`this cut's two markers land at the same instant (${Math.round(srcStartMs)}ms) or out of order, so it covers no frames`);
16988
+ if (end <= start) {
16989
+ unplacedCuts.push({
16990
+ ids,
16991
+ reason: `this piece's two ends land at the same instant (${Math.round(start)}ms) or out of order, so it covers no frames`
16992
+ });
16875
16993
  continue;
16876
16994
  }
16877
16995
  resolved.push({
16878
16996
  ids,
16879
- actionIds,
16880
- srcStartMs,
16881
- srcEndMs,
16882
- keepJump: run.keepJump,
16883
- trailing: run.untilActionId === null
16997
+ srcStartMs: start,
16998
+ srcEndMs: end,
16999
+ trailing: end >= sourceDurationMs
16884
17000
  });
16885
17001
  }
16886
17002
  resolved.sort((a, b) => a.srcStartMs - b.srcStartMs);
16887
17003
  const cuts = [];
16888
17004
  for (const cut of resolved) {
16889
17005
  const previous = cuts[cuts.length - 1];
16890
- if (previous && cut.srcStartMs < previous.srcEndMs) {
16891
- unplacedCuts.push({
16892
- ids: cut.ids,
16893
- actionIds: cut.actionIds,
16894
- reason: `this cut's frames overlap the cut before it (${Math.round(previous.srcStartMs)}\u2013${Math.round(previous.srcEndMs)}ms), which means these frames run the take's steps out of order \u2014 nothing was removed for it`
16895
- });
17006
+ if (previous && cut.srcStartMs <= previous.srcEndMs) {
17007
+ previous.ids.push(...cut.ids);
17008
+ previous.srcEndMs = Math.max(previous.srcEndMs, cut.srcEndMs);
17009
+ previous.trailing ||= cut.trailing;
16896
17010
  continue;
16897
17011
  }
16898
17012
  cuts.push(cut);
@@ -17091,10 +17205,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
17091
17205
  ...cuts,
17092
17206
  ...interruptions.map((span) => ({
17093
17207
  ids: [],
17094
- actionIds: [],
17095
17208
  srcStartMs: span.startMs,
17096
17209
  srcEndMs: span.endMs,
17097
- keepJump: false,
17098
17210
  trailing: false
17099
17211
  }))
17100
17212
  ].sort((a, b) => a.srcStartMs - b.srcStartMs);
@@ -17251,7 +17363,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
17251
17363
  stiffness: lerp(8, 5.5, smoothness),
17252
17364
  zoomInMs: lerp(1e3, 1600, smoothness),
17253
17365
  zoomOutMs: lerp(700, 1150, smoothness),
17254
- followPanMs: lerp(500, 900, smoothness)
17366
+ followRatePerS: lerp(13, 7, smoothness)
17255
17367
  };
17256
17368
  }
17257
17369
  var DEFAULT_TIMINGS = motionTimings(MOTION_DEFAULTS.smoothness);
@@ -17343,6 +17455,25 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
17343
17455
  };
17344
17456
  function planCameraIntents(scene, cutSteps, attached) {
17345
17457
  const order = new Map(scene.actions.map((a, i) => [a.id, i]));
17458
+ const actionOf = new Map(scene.actions.map((a) => [a.id, a]));
17459
+ const fitOf = (event) => {
17460
+ const action = actionOf.get(event.marker.actionId);
17461
+ if (event.point === void 0 || action?.kind !== "drag")
17462
+ return {};
17463
+ const ends = dragPoints(action, action.rect, action.toRect);
17464
+ if (ends === null)
17465
+ return {};
17466
+ const x = Math.min(ends.start.x, ends.end.x);
17467
+ const y = Math.min(ends.start.y, ends.end.y);
17468
+ return {
17469
+ fit: {
17470
+ x,
17471
+ y,
17472
+ width: Math.max(ends.start.x, ends.end.x) - x,
17473
+ height: Math.max(ends.start.y, ends.end.y) - y
17474
+ }
17475
+ };
17476
+ };
17346
17477
  return scene.camera.flatMap((event) => {
17347
17478
  if (cutSteps.has(event.marker.actionId)) {
17348
17479
  attached.push({
@@ -17361,16 +17492,18 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
17361
17492
  actionId: event.marker.actionId,
17362
17493
  offsetMs: event.marker.offsetMs,
17363
17494
  scale: clamp(event.scale ?? 1, 1, CAMERA_DEFAULTS.maxScale),
17364
- end: event.end ?? null
17495
+ end: event.end ?? null,
17496
+ ...fitOf(event)
17365
17497
  })).filter((intent) => intent.scale > 1).sort((a, b) => {
17366
17498
  const byAction = (order.get(a.actionId) ?? 0) - (order.get(b.actionId) ?? 0);
17367
17499
  return byAction !== 0 ? byAction : a.offsetMs - b.offsetMs;
17368
17500
  });
17369
17501
  }
17370
- function solveCamera(intents, rectOf, timeline, markerSourceMs, viewport, fitWindow = null, motion = MOTION_DEFAULTS, actEnds = /* @__PURE__ */ new Map()) {
17502
+ function solveCamera(intents, rectOf, timeline, markerSourceMs, viewport, fitWindow = null, motion = MOTION_DEFAULTS, actEnds = /* @__PURE__ */ new Map(), holds = []) {
17371
17503
  const timings = motionTimings(motion.smoothness);
17372
17504
  const neutral = { x: viewport.width / 2, y: viewport.height / 2 };
17373
17505
  const seeds = [];
17506
+ const actEndOf = /* @__PURE__ */ new Map();
17374
17507
  for (const intent of intents) {
17375
17508
  const rect2 = intent.point ? { x: intent.point.x, y: intent.point.y, width: 0, height: 0 } : intent.anchorId ? rectOf(intent.anchorId, intent.actionId) : null;
17376
17509
  if (!rect2)
@@ -17383,21 +17516,21 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
17383
17516
  const resolvedEndMs = intent.end ? markerOutputMs(intent.end, timeline, markerSourceMs) : null;
17384
17517
  const asked = clamp(intent.scale, 1, CAMERA_DEFAULTS.maxScale);
17385
17518
  const requested = Math.max(asked, clamp(intent.requestedScale ?? intent.scale, 1, CAMERA_DEFAULTS.maxScale));
17386
- const scale = fitWindow === null ? asked : clamp(fitScaleFor(rect2, fitWindow), 1, asked);
17387
- let notBeforeMs = Number.NEGATIVE_INFINITY;
17519
+ const scale = fitWindow === null ? asked : clamp(fitScaleFor(intent.fit ?? rect2, fitWindow), 1, asked);
17520
+ let actEndMs = Number.NEGATIVE_INFINITY;
17388
17521
  for (const [actionId, endMs] of actEnds) {
17389
17522
  const at = markerSourceMs.get(actionId);
17390
17523
  if (at === void 0 || at >= sourceMs)
17391
17524
  continue;
17392
- notBeforeMs = Math.max(notBeforeMs, toOutputMs(timeline, endMs) + CAMERA_DEFAULTS.actSettleMs);
17525
+ actEndMs = Math.max(actEndMs, toOutputMs(timeline, endMs));
17393
17526
  }
17394
- const transitionMs = outputMs - timings.zoomInMs < notBeforeMs ? Math.max(MIN_PAN_MS, Math.min(timings.zoomInMs, outputMs - notBeforeMs)) : timings.zoomInMs;
17395
- seeds.push({
17527
+ const seed = {
17396
17528
  id: intent.id,
17397
17529
  outputTimeMs: outputMs,
17398
17530
  center: rectCenter(rect2),
17399
17531
  scale,
17400
- transitionMs,
17532
+ // Shortened below for an earlier act, once every seed is known.
17533
+ transitionMs: timings.zoomInMs,
17401
17534
  stiffness: timings.stiffness,
17402
17535
  zoom: true,
17403
17536
  authoredEndMs: resolvedEndMs,
@@ -17409,7 +17542,18 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
17409
17542
  } : null,
17410
17543
  actionMs,
17411
17544
  plannedTransitionMs: timings.zoomInMs
17412
- });
17545
+ };
17546
+ seeds.push(seed);
17547
+ actEndOf.set(seed, actEndMs);
17548
+ }
17549
+ seeds.sort((a, b) => a.outputTimeMs - b.outputTimeMs);
17550
+ for (const [i, seed] of seeds.entries()) {
17551
+ const before = seeds[i - 1];
17552
+ const pans = before !== void 0 && !returnsBetween(heldUntilOf(before, seed.actionMs, holds), seed.outputTimeMs, timings);
17553
+ const notBeforeMs = (actEndOf.get(seed) ?? Number.NEGATIVE_INFINITY) + (pans ? 0 : CAMERA_DEFAULTS.actSettleMs);
17554
+ if (seed.outputTimeMs - timings.zoomInMs < notBeforeMs) {
17555
+ seed.transitionMs = Math.max(MIN_PAN_MS, Math.min(timings.zoomInMs, seed.outputTimeMs - notBeforeMs));
17556
+ }
17413
17557
  }
17414
17558
  return insertNeutralKeys([
17415
17559
  {
@@ -17429,7 +17573,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
17429
17573
  plannedTransitionMs: 0
17430
17574
  },
17431
17575
  ...seeds
17432
- ].sort((a, b) => a.outputTimeMs - b.outputTimeMs), timeline.outputDurationMs, timings);
17576
+ ].sort((a, b) => a.outputTimeMs - b.outputTimeMs), timeline.outputDurationMs, timings, holds);
17433
17577
  }
17434
17578
  function fitScaleFor(rect2, window2) {
17435
17579
  const margin = 2 * CAMERA_DEFAULTS.fitMarginPx;
@@ -17437,7 +17581,15 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
17437
17581
  return Math.floor(fit * 100) / 100;
17438
17582
  }
17439
17583
  var MIN_PAN_MS = 150;
17440
- function insertNeutralKeys(seeds, outputDurationMs, timings) {
17584
+ function heldUntilOf(seed, nextActionMs, holds) {
17585
+ const outBy = Math.min(seed.outputTimeMs + CAMERA_DEFAULTS.neutral.zoomHoldMs, nextActionMs);
17586
+ return Math.max(seed.outputTimeMs, ...holds.filter((h) => h.startMs >= seed.actionMs && h.startMs < outBy).map((h) => h.endMs));
17587
+ }
17588
+ function returnsBetween(heldUntilMs, nextArrivalMs, timings) {
17589
+ const { minPlateauMs } = CAMERA_DEFAULTS.neutral;
17590
+ return nextArrivalMs - timings.zoomInMs - minPlateauMs >= heldUntilMs + minPlateauMs + timings.zoomOutMs;
17591
+ }
17592
+ function insertNeutralKeys(seeds, outputDurationMs, timings, holds = []) {
17441
17593
  const { neutral } = CAMERA_DEFAULTS;
17442
17594
  const { zoomOutMs } = timings;
17443
17595
  const keys = [];
@@ -17457,21 +17609,25 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
17457
17609
  stiffness: timings.stiffness
17458
17610
  });
17459
17611
  for (const [i, seed] of seeds.entries()) {
17612
+ const previousMs = keys[keys.length - 1]?.outputTimeMs ?? seed.outputTimeMs;
17613
+ const departMs = Math.max(previousMs, seed.outputTimeMs - seed.transitionMs);
17460
17614
  keys.push(strip(seed));
17461
17615
  if (!seed.zoom)
17462
17616
  continue;
17463
- const earliestMs = seed.outputTimeMs + neutral.minPlateauMs + zoomOutMs;
17464
- const idealMs = seed.outputTimeMs + neutral.zoomHoldMs + zoomOutMs;
17617
+ const next = seeds[i + 1];
17618
+ const heldUntil = heldUntilOf(seed, next?.actionMs ?? Number.POSITIVE_INFINITY, holds);
17619
+ const earliestMs = heldUntil + neutral.minPlateauMs + zoomOutMs;
17620
+ const idealMs = heldUntil + neutral.zoomHoldMs + zoomOutMs;
17465
17621
  const wantedMs = seed.authoredEndMs ?? idealMs;
17466
17622
  const resolvedAuthored = seed.authoredEndMs !== null;
17467
17623
  const authored = resolvedAuthored || seed.endUnplaced;
17468
17624
  const movedFromWanted = (endMs) => resolvedAuthored && Math.abs(endMs - wantedMs) > 1e-6;
17469
- const next = seeds[i + 1];
17470
17625
  if (!next) {
17471
17626
  const atMs2 = Math.min(Math.max(wantedMs, earliestMs), outputDurationMs);
17472
17627
  if (atMs2 <= seed.outputTimeMs) {
17473
17628
  segments.push({
17474
17629
  id: seed.id,
17630
+ departMs,
17475
17631
  startMs: seed.outputTimeMs,
17476
17632
  endMs: outputDurationMs,
17477
17633
  endAuthored: authored,
@@ -17484,6 +17640,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
17484
17640
  keys.push(pullOut(atMs2, seed.center));
17485
17641
  segments.push({
17486
17642
  id: seed.id,
17643
+ departMs,
17487
17644
  startMs: seed.outputTimeMs,
17488
17645
  endMs: atMs2,
17489
17646
  endAuthored: authored,
@@ -17494,14 +17651,18 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
17494
17651
  continue;
17495
17652
  }
17496
17653
  const latestMs = next.outputTimeMs - next.plannedTransitionMs - neutral.minPlateauMs;
17497
- if (latestMs < earliestMs) {
17498
- const settledMs = Math.max(seed.outputTimeMs, seed.actionMs) + neutral.minPlateauMs;
17654
+ if (!returnsBetween(heldUntil, next.outputTimeMs, {
17655
+ zoomInMs: next.plannedTransitionMs,
17656
+ zoomOutMs
17657
+ })) {
17658
+ const settledMs = Math.max(seed.outputTimeMs, seed.actionMs, heldUntil) + neutral.minPlateauMs;
17499
17659
  seeds[i + 1] = {
17500
17660
  ...next,
17501
17661
  transitionMs: Math.max(MIN_PAN_MS, Math.min(next.transitionMs, next.outputTimeMs - settledMs))
17502
17662
  };
17503
17663
  segments.push({
17504
17664
  id: seed.id,
17665
+ departMs,
17505
17666
  startMs: seed.outputTimeMs,
17506
17667
  endMs: next.outputTimeMs,
17507
17668
  endAuthored: authored,
@@ -17515,6 +17676,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
17515
17676
  keys.push(pullOut(atMs, lerpVec(seed.center, next.center, 0.5)));
17516
17677
  segments.push({
17517
17678
  id: seed.id,
17679
+ departMs,
17518
17680
  startMs: seed.outputTimeMs,
17519
17681
  endMs: atMs,
17520
17682
  endAuthored: authored,
@@ -17593,6 +17755,89 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
17593
17755
  return { center: last2.center, scale: last2.scale };
17594
17756
  }
17595
17757
 
17758
+ // ../../packages/compositor/dist/plan/camera-follow.js
17759
+ var FOLLOW_STEP_MS = 8;
17760
+ function departs(keys, i) {
17761
+ const key = keys[i];
17762
+ const before = keys[i - 1];
17763
+ if (!before)
17764
+ return key.outputTimeMs;
17765
+ return key.outputTimeMs - Math.min(key.transitionMs, key.outputTimeMs - before.outputTimeMs);
17766
+ }
17767
+ function solveFollow(args) {
17768
+ const { keys, cursorAt, holds, outputDurationMs } = args;
17769
+ const omega = args.rate / 1e3;
17770
+ const held = (t) => holds.some((h) => h.startMs <= t && t < h.endMs);
17771
+ const stretches = [];
17772
+ for (let i = 1; i < keys.length; i++) {
17773
+ const landing = keys[i];
17774
+ if (landing.scale <= 1 || keys[i - 1].scale > 1)
17775
+ continue;
17776
+ let last2 = i;
17777
+ while ((keys[last2 + 1]?.scale ?? 0) > 1)
17778
+ last2++;
17779
+ const out = last2 + 1 < keys.length ? last2 + 1 : null;
17780
+ const endMs = out === null ? outputDurationMs : keys[out].outputTimeMs;
17781
+ const pullOutDepartMs = out === null ? outputDurationMs : departs(keys, out);
17782
+ const departures = keys.slice(i + 1, last2 + 1).map((key, k) => ({ at: departs(keys, i + 1 + k), center: key.center }));
17783
+ let aimed = -1;
17784
+ const aimAt = (t) => {
17785
+ while (aimed + 1 < departures.length && (departures[aimed + 1]?.at ?? Number.POSITIVE_INFINITY) <= t) {
17786
+ aimed++;
17787
+ }
17788
+ return departures[aimed]?.center ?? landing.center;
17789
+ };
17790
+ const targetAt = (t) => (cursorAt !== null && !held(t) ? cursorAt(t) : null) ?? aimAt(t);
17791
+ let x = landing.center;
17792
+ let v = { x: 0, y: 0 };
17793
+ const centers = [x];
17794
+ for (let t = landing.outputTimeMs; t < endMs; t += FOLLOW_STEP_MS) {
17795
+ const target = targetAt(t);
17796
+ const dt = Math.min(FOLLOW_STEP_MS, endMs - t);
17797
+ const e = Math.exp(-omega * dt);
17798
+ const step = (y, vel) => {
17799
+ const k = vel + omega * y;
17800
+ return { y: (y + k * dt) * e, v: (vel - omega * k * dt) * e };
17801
+ };
17802
+ const sx = step(x.x - target.x, v.x);
17803
+ const sy = step(x.y - target.y, v.y);
17804
+ x = { x: target.x + sx.y, y: target.y + sy.y };
17805
+ v = { x: sx.v, y: sy.v };
17806
+ centers.push(x);
17807
+ }
17808
+ stretches.push({
17809
+ startMs: landing.outputTimeMs,
17810
+ pullOutDepartMs,
17811
+ endMs,
17812
+ centers
17813
+ });
17814
+ i = last2;
17815
+ }
17816
+ return stretches;
17817
+ }
17818
+ function sampleTrack(track, outputTimeMs) {
17819
+ const base = sampleCamera(track.cameraKeys, outputTimeMs);
17820
+ if (base.scale <= 1)
17821
+ return base;
17822
+ const stretch = track.cameraFollow.find((s) => s.startMs <= outputTimeMs && outputTimeMs <= s.endMs);
17823
+ if (!stretch)
17824
+ return base;
17825
+ const last2 = stretch.centers.length - 1;
17826
+ const i = Math.min(Math.floor((outputTimeMs - stretch.startMs) / FOLLOW_STEP_MS), last2);
17827
+ const timeOf = (k) => Math.min(stretch.startMs + k * FOLLOW_STEP_MS, stretch.endMs);
17828
+ const here = stretch.centers[i];
17829
+ const next = stretch.centers[i + 1];
17830
+ const spring = next === void 0 ? here : lerpVec(here, next, (outputTimeMs - timeOf(i)) / (timeOf(i + 1) - timeOf(i)));
17831
+ if (outputTimeMs < stretch.pullOutDepartMs) {
17832
+ return { center: spring, scale: base.scale };
17833
+ }
17834
+ const from = sampleCamera(track.cameraKeys, stretch.pullOutDepartMs).scale;
17835
+ if (from <= 1)
17836
+ return base;
17837
+ const w = (base.scale - 1) / (from - 1);
17838
+ return { center: lerpVec(base.center, spring, w), scale: base.scale };
17839
+ }
17840
+
17596
17841
  // ../../packages/compositor/dist/plan/cursor.js
17597
17842
  var CURSOR_DEFAULTS2 = {
17598
17843
  // Half the pace these once set (240-700ms, 180ms + 0.35ms/px): the author
@@ -17679,170 +17924,22 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
17679
17924
  // ../../packages/compositor/dist/version.js
17680
17925
  var COMPOSITOR_VERSION = "1.1.0";
17681
17926
 
17682
- // ../../packages/compositor/dist/plan/scene-walk.js
17683
- function nextKeptActionId(scene, actionId, cutSteps) {
17684
- const idx = scene.actions.findIndex((a) => a.id === actionId);
17685
- if (idx === -1)
17686
- return null;
17687
- for (let i = idx + 1; i < scene.actions.length; i++) {
17688
- const action = scene.actions[i];
17689
- if (action && !cutSteps.has(action.id))
17690
- return action.id;
17691
- }
17692
- return null;
17693
- }
17694
- function pageKey(url3) {
17695
- const hash2 = url3.indexOf("#");
17696
- return hash2 === -1 ? url3 : url3.slice(0, hash2);
17697
- }
17698
- function pageChangeAfter(scene, actionId) {
17699
- const index = scene.actions.findIndex((a) => a.id === actionId);
17700
- const step = scene.actions[index];
17701
- if (step === void 0)
17702
- return null;
17703
- const trace = scene.sideChannels.urlTrace;
17704
- let here = scene.meta.capture.originUrl;
17705
- for (const entry2 of trace)
17706
- if (entry2.timestamp <= step.timestamp)
17707
- here = entry2.url;
17708
- const anchorPage = (anchorId) => anchorId === null ? null : scene.anchors.find((a) => a.id === anchorId)?.resolution.url ?? null;
17709
- const stepPage = anchorPage(step.anchorId);
17710
- const nav = trace.find((entry2) => entry2.timestamp > step.timestamp && pageKey(entry2.url) !== pageKey(here));
17711
- let leaveAt = nav === void 0 ? null : nav.timestamp;
17712
- if (stepPage !== null) {
17713
- for (let i = index + 1; i < scene.actions.length; i++) {
17714
- const later = scene.actions[i];
17715
- if (later === void 0)
17716
- continue;
17717
- const page = anchorPage(later.anchorId);
17718
- if (page !== null && pageKey(page) !== pageKey(stepPage)) {
17719
- if (leaveAt === null || later.timestamp < leaveAt)
17720
- leaveAt = later.timestamp;
17721
- break;
17722
- }
17723
- }
17724
- }
17725
- if (leaveAt === null)
17726
- return null;
17727
- let from = step;
17728
- for (let i = index + 1; i < scene.actions.length; i++) {
17729
- const later = scene.actions[i];
17730
- if (later === void 0 || later.timestamp > leaveAt)
17731
- break;
17732
- from = later;
17733
- }
17734
- return { actionId: from.id, offsetMs: Math.max(0, leaveAt - from.timestamp) };
17735
- }
17736
-
17737
17927
  // ../../packages/compositor/dist/plan/cosmetics.js
17738
- function planCosmetics(scene, cutSteps, attached, overlays) {
17739
- const replacements = scene.edits.replacements.filter((r) => r.targetAnchorId !== null).map((r) => ({
17740
- id: r.id,
17741
- kind: "replacement",
17742
- anchorId: r.targetAnchorId,
17743
- rect: null,
17744
- text: r.replace,
17745
- range: null,
17746
- reveal: null
17747
- }));
17748
- const retexts = overlays.flatMap((overlay) => {
17749
- if (cutSteps.has(overlay.actionId)) {
17750
- attached.push({
17751
- id: `retext:${overlay.actionId}`,
17752
- kind: "retext",
17753
- actionId: overlay.actionId
17754
- });
17755
- return [];
17756
- }
17757
- const until = nextKeptActionId(scene, overlay.actionId, cutSteps);
17758
- return [
17759
- {
17760
- id: `retext:${overlay.actionId}`,
17761
- kind: "replacement",
17762
- anchorId: overlay.anchorId,
17763
- rect: null,
17764
- text: overlay.text,
17765
- // From the step until the take leaves its page: the field holds its
17766
- // value while it is on screen, and not a moment after — the end of
17767
- // the video only when the take never leaves (`pageChangeAfter`).
17768
- range: {
17769
- start: { actionId: overlay.actionId, offsetMs: 0 },
17770
- end: pageChangeAfter(scene, overlay.actionId)
17771
- },
17772
- // Typed across the step's own stretch — the same span a cut of this
17773
- // step would remove, and the closest thing the take has to "how long
17774
- // the author spent typing".
17775
- reveal: {
17776
- start: { actionId: overlay.actionId, offsetMs: 0 },
17777
- end: until === null ? null : { actionId: until, offsetMs: 0 }
17778
- }
17779
- }
17780
- ];
17781
- });
17782
- const masks = scene.edits.masks.flatMap((m) => {
17928
+ function planCosmetics(scene, cutSteps, attached) {
17929
+ return scene.edits.masks.flatMap((m) => {
17783
17930
  const range = m.start && m.end ? { start: m.start, end: m.end } : null;
17784
17931
  if (range && cutSteps.has(range.start.actionId)) {
17785
17932
  attached.push({ id: m.id, kind: "mask", actionId: range.start.actionId });
17786
17933
  return [];
17787
17934
  }
17788
- return [
17789
- {
17790
- id: m.id,
17791
- kind: "mask",
17792
- anchorId: null,
17793
- rect: m.rect,
17794
- text: null,
17795
- range,
17796
- reveal: null
17797
- }
17798
- ];
17935
+ return [{ id: m.id, kind: "mask", rect: m.rect, range }];
17799
17936
  });
17800
- return [...replacements, ...retexts, ...masks];
17801
17937
  }
17802
17938
 
17803
17939
  // ../../packages/compositor/dist/plan/plan.js
17804
17940
  var RETIMING_DEFAULTS = {
17805
17941
  motionDiffThreshold: 0.02
17806
17942
  };
17807
- function planCuts(scene) {
17808
- const cutOf = new Map((scene.edits.cuts ?? []).map((cut) => [cut.actionId, cut]));
17809
- if (cutOf.size === 0)
17810
- return [];
17811
- const cutSteps = new Set(cutOf.keys());
17812
- const runs = [];
17813
- const { actions } = scene;
17814
- let i = 0;
17815
- while (i < actions.length) {
17816
- const here = actions[i];
17817
- if (!here || !cutOf.has(here.id)) {
17818
- i += 1;
17819
- continue;
17820
- }
17821
- let j = i;
17822
- const ids = [];
17823
- const actionIds = [];
17824
- let keepJump = true;
17825
- while (j < actions.length) {
17826
- const step = actions[j];
17827
- const cut = step ? cutOf.get(step.id) : void 0;
17828
- if (!step || !cut)
17829
- break;
17830
- ids.push(cut.id);
17831
- actionIds.push(step.id);
17832
- keepJump &&= cut.keepJump === true;
17833
- j += 1;
17834
- }
17835
- const lastActionId = actionIds[actionIds.length - 1];
17836
- runs.push({
17837
- ids,
17838
- actionIds,
17839
- untilActionId: lastActionId === void 0 ? null : nextKeptActionId(scene, lastActionId, cutSteps),
17840
- keepJump
17841
- });
17842
- i = j;
17843
- }
17844
- return runs;
17845
- }
17846
17943
  function planScene(scene, opts = {}) {
17847
17944
  const anchorRects = /* @__PURE__ */ new Map();
17848
17945
  for (const anchor2 of scene.anchors) {
@@ -17857,8 +17954,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
17857
17954
  }
17858
17955
  const rectOf = (anchorId, actionId) => actionRects.get(actionId) ?? anchorRects.get(anchorId) ?? null;
17859
17956
  const lastAction = scene.actions[scene.actions.length - 1];
17860
- const cuts = planCuts(scene);
17861
- const cutSteps = new Set(cuts.flatMap((run) => run.actionIds));
17957
+ const removed = scene.edits.removed ?? [];
17958
+ const cutSteps = stepsInsideRemoved(scene);
17862
17959
  const attachedToCuts = [];
17863
17960
  const gapAfter = new Map((scene.edits.gaps ?? []).map((gap) => [gap.afterActionId, gap]));
17864
17961
  const paces = [];
@@ -17909,7 +18006,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
17909
18006
  // the author never recorded.
17910
18007
  cursorSegments: planCursorSegments(scene, rectOf),
17911
18008
  cameraIntents: planCameraIntents(scene, cutSteps, attachedToCuts),
17912
- cosmetics: planCosmetics(scene, cutSteps, attachedToCuts, opts.retexts ?? []),
18009
+ cosmetics: planCosmetics(scene, cutSteps, attachedToCuts),
17913
18010
  holds: (scene.edits.holds ?? []).flatMap((hold) => {
17914
18011
  if (cutSteps.has(hold.marker.actionId)) {
17915
18012
  attachedToCuts.push({
@@ -17929,7 +18026,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
17929
18026
  ];
17930
18027
  }),
17931
18028
  paces,
17932
- cuts,
18029
+ removed,
18030
+ removedSteps: [...cutSteps],
17933
18031
  attachedToCuts,
17934
18032
  trim: {
17935
18033
  head: scene.edits.trim?.head ?? null,
@@ -17941,186 +18039,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
17941
18039
  };
17942
18040
  }
17943
18041
 
17944
- // ../../packages/compositor/dist/render/draw-cursor.js
17945
- var PULSE_DURATION_MS = 400;
17946
- var PRESS_DURATION_MS = 110;
17947
- var CURSOR_UPRIGHT = Object.freeze({
17948
- press: 1,
17949
- angleRad: 0
17950
- });
17951
- var ARROW = [
17952
- { x: 0, y: 0 },
17953
- { x: 0, y: 0.75 },
17954
- { x: 0.19, y: 0.58 },
17955
- { x: 0.31, y: 0.87 },
17956
- { x: 0.45, y: 0.81 },
17957
- { x: 0.33, y: 0.53 },
17958
- { x: 0.56, y: 0.52 }
17959
- ];
17960
- var TOUCH_RADIUS = 0.42;
17961
- var CURSOR_ART = {
17962
- light: { height: 40, hotspot: { x: 0, y: 0 }, ink: bounds(ARROW) },
17963
- dark: { height: 40, hotspot: { x: 0, y: 0 }, ink: bounds(ARROW) },
17964
- touch: {
17965
- height: 40,
17966
- hotspot: { x: 0.5, y: 0.5 },
17967
- ink: {
17968
- min: { x: 0.5 - TOUCH_RADIUS, y: 0.5 - TOUCH_RADIUS },
17969
- max: { x: 0.5 + TOUCH_RADIUS, y: 0.5 + TOUCH_RADIUS }
17970
- }
17971
- }
17972
- };
17973
- function bounds(points) {
17974
- const xs = points.map((p) => p.x);
17975
- const ys = points.map((p) => p.y);
17976
- return {
17977
- min: { x: Math.min(...xs), y: Math.min(...ys) },
17978
- max: { x: Math.max(...xs), y: Math.max(...ys) }
17979
- };
17980
- }
17981
- var INK = {
17982
- light: { fill: "#ffffff", stroke: "#111827" },
17983
- dark: { fill: "#111827", stroke: "#ffffff" },
17984
- touch: { fill: "rgba(255, 255, 255, 0.45)", stroke: "#111827" }
17985
- };
17986
- function drawCursor(ctx, at, scale, pose, style = "light") {
17987
- const size = CURSOR_ART[style].height * scale * pose.press;
17988
- const ink = INK[style];
17989
- ctx.save();
17990
- ctx.translate(at.x, at.y);
17991
- if (style !== "touch" && pose.angleRad !== 0)
17992
- ctx.rotate(pose.angleRad);
17993
- ctx.beginPath();
17994
- if (style === "touch") {
17995
- ctx.arc(0, 0, size * TOUCH_RADIUS, 0, Math.PI * 2);
17996
- } else {
17997
- const first = ARROW[0];
17998
- if (first) {
17999
- ctx.moveTo(first.x * size, first.y * size);
18000
- for (const point2 of ARROW.slice(1))
18001
- ctx.lineTo(point2.x * size, point2.y * size);
18002
- }
18003
- }
18004
- ctx.closePath();
18005
- ctx.shadowColor = "rgba(15, 23, 42, 0.35)";
18006
- ctx.shadowBlur = 3 * scale;
18007
- ctx.shadowOffsetY = 1.5 * scale;
18008
- ctx.fillStyle = ink.fill;
18009
- ctx.fill();
18010
- ctx.shadowColor = "transparent";
18011
- ctx.lineWidth = Math.max(1, 1.4 * scale);
18012
- ctx.lineJoin = "round";
18013
- ctx.strokeStyle = ink.stroke;
18014
- ctx.stroke();
18015
- ctx.restore();
18016
- }
18017
- var CURSOR_EXPOSURE_MS = 32;
18018
- var CURSOR_TRAIL_MIN_TRAVEL_PX = 1;
18019
- var TRAIL_PEAK_ALPHA = 0.55;
18020
- function cursorTrailStamps(motionBlur) {
18021
- if (motionBlur <= 0)
18022
- return 0;
18023
- return Math.ceil(2 + 8 * clamp(motionBlur, 0, 1));
18024
- }
18025
- function drawCursorTrail(ctx, positions, scale, style) {
18026
- if (positions.length === 0)
18027
- return;
18028
- const priorAlpha = ctx.globalAlpha;
18029
- positions.forEach((position, i) => {
18030
- const t = (i + 1) / (positions.length + 1);
18031
- ctx.globalAlpha = priorAlpha * t * t * TRAIL_PEAK_ALPHA;
18032
- const pose = { press: 1, angleRad: position.angleRad ?? 0 };
18033
- drawCursor(ctx, position, scale, pose, style);
18034
- });
18035
- ctx.globalAlpha = priorAlpha;
18036
- }
18037
- function drawClickPulse(ctx, at, scale, t) {
18038
- if (t < 0 || t > 1)
18039
- return;
18040
- const eased = 1 - (1 - t) ** 3;
18041
- const radius = 16 * scale * (1 + 2.2 * eased);
18042
- const alpha = 1 - t;
18043
- const core = Math.max(1, 2.5 * scale);
18044
- const edge = Math.max(0.75, 1.25 * scale);
18045
- const offset = (core + edge) / 2;
18046
- ctx.save();
18047
- ring(ctx, at, radius - offset, edge, `rgba(15, 23, 42, ${0.75 * alpha})`);
18048
- ring(ctx, at, radius + offset, edge, `rgba(15, 23, 42, ${0.75 * alpha})`);
18049
- ring(ctx, at, radius, core, `rgba(255, 255, 255, ${0.95 * alpha})`);
18050
- ctx.restore();
18051
- }
18052
- function ring(ctx, at, radius, width, style) {
18053
- if (radius <= 0)
18054
- return;
18055
- ctx.beginPath();
18056
- ctx.arc(at.x, at.y, radius, 0, Math.PI * 2);
18057
- ctx.lineWidth = width;
18058
- ctx.strokeStyle = style;
18059
- ctx.stroke();
18060
- }
18061
-
18062
- // ../../packages/compositor/dist/plan/camera-follow.js
18063
- var FOLLOW_STEP_MS = 33;
18064
- var FOLLOW_SAFE_INSET = 0.25;
18065
- var FOLLOW_MIN_MOVE_PX = 4;
18066
- var FOLLOW_CLICK_LEAD_MS = 100;
18067
- function followCursor(args) {
18068
- const { keys, cursorAt, outputDurationMs, viewport, timings, minPlateauMs } = args;
18069
- const shown = args.fitWindow ?? viewport;
18070
- const panMs = timings.followPanMs;
18071
- const crossesClick = (startMs) => args.clickOutputMs.some((click) => startMs < click + PULSE_DURATION_MS && startMs + panMs > click - FOLLOW_CLICK_LEAD_MS);
18072
- const out = [];
18073
- for (const [i, key] of keys.entries()) {
18074
- out.push(key);
18075
- if (key.scale <= 1)
18076
- continue;
18077
- const next = keys[i + 1];
18078
- const plateauEndMs = next ? next.outputTimeMs - Math.min(next.transitionMs, next.outputTimeMs - key.outputTimeMs) : outputDurationMs;
18079
- const window2 = {
18080
- width: shown.width / key.scale,
18081
- height: shown.height / key.scale
18082
- };
18083
- const halfWidth = Math.min(window2.width, viewport.width) / 2;
18084
- const halfHeight = Math.min(window2.height, viewport.height) / 2;
18085
- const inside = (p) => ({
18086
- x: clamp(p.x, halfWidth, viewport.width - halfWidth),
18087
- y: clamp(p.y, halfHeight, viewport.height - halfHeight)
18088
- });
18089
- const safeX = window2.width * (0.5 - FOLLOW_SAFE_INSET);
18090
- const safeY = window2.height * (0.5 - FOLLOW_SAFE_INSET);
18091
- let zone = inside(key.center);
18092
- let held = key.center;
18093
- let t = key.outputTimeMs;
18094
- while (t + panMs + minPlateauMs <= plateauEndMs) {
18095
- const pointer = cursorAt(t);
18096
- if (pointer === null)
18097
- break;
18098
- const leftX = Math.abs(pointer.x - zone.x) > safeX;
18099
- const leftY = Math.abs(pointer.y - zone.y) > safeY;
18100
- const wanted = inside(pointer);
18101
- if (!(leftX || leftY) || Math.hypot(wanted.x - zone.x, wanted.y - zone.y) < FOLLOW_MIN_MOVE_PX || crossesClick(t)) {
18102
- t += FOLLOW_STEP_MS;
18103
- continue;
18104
- }
18105
- t += panMs;
18106
- held = {
18107
- x: leftX ? wanted.x : held.x + (wanted.x - zone.x),
18108
- y: leftY ? wanted.y : held.y + (wanted.y - zone.y)
18109
- };
18110
- zone = wanted;
18111
- out.push({
18112
- outputTimeMs: t,
18113
- center: held,
18114
- scale: key.scale,
18115
- transitionMs: panMs,
18116
- stiffness: timings.stiffness,
18117
- followPan: true
18118
- });
18119
- }
18120
- }
18121
- return out;
18122
- }
18123
-
18124
18042
  // ../../packages/compositor/dist/plan/smooth.js
18125
18043
  var CURSOR_SMOOTHING_MS = 30;
18126
18044
  var KERNEL_REACH_SIGMAS = 3;
@@ -18912,7 +18830,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
18912
18830
  return samples;
18913
18831
  const bridges = [];
18914
18832
  for (const cut of timeline.cuts) {
18915
- if (cut.trailing)
18833
+ if (cut.trailing || cut.srcStartMs <= 0)
18916
18834
  continue;
18917
18835
  const from = sampleCursor(samples, cut.srcStartMs);
18918
18836
  if (from === null)
@@ -19003,7 +18921,22 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
19003
18921
  function scaleText(scale) {
19004
18922
  return String(Number(scale.toFixed(2)));
19005
18923
  }
19006
- function resolvePlan(plan, given, givenScene, hints = [], cameraFitWindow = null) {
18924
+ function resolveCameraFollow(args) {
18925
+ const { keys, plan, bundle, timeline, cursor, motion } = args;
18926
+ const zoomedActions = new Set(plan.cameraIntents.map((i) => i.actionId));
18927
+ return solveFollow({
18928
+ keys,
18929
+ cursorAt: motion.follow && args.drawsPointer ? (outputMs) => sampleCursor(cursor, toSourceMs(timeline, outputMs)) : null,
18930
+ holds: (bundle.heldPresses ?? []).filter((h) => zoomedActions.has(h.actionId)).map((h) => ({
18931
+ startMs: toOutputMs(timeline, h.pressMs),
18932
+ endMs: toOutputMs(timeline, h.releaseMs)
18933
+ })),
18934
+ outputDurationMs: timeline.outputDurationMs,
18935
+ rate: motionTimings(motion.smoothness).followRatePerS
18936
+ });
18937
+ }
18938
+ function resolvePlan(givenPlan, given, givenScene, hints = [], cameraFitWindow = null) {
18939
+ let plan = givenPlan;
19007
18940
  const { bundle, scene } = inScreenSpace(given, givenScene);
19008
18941
  const anchorRects = /* @__PURE__ */ new Map();
19009
18942
  for (const anchor2 of scene?.anchors ?? []) {
@@ -19036,13 +18969,33 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
19036
18969
  ) : travelled;
19037
18970
  const settleMs = bundle.source === "capture" ? springSettleMs(CURSOR_SPRING_TAU_MS) : 0;
19038
18971
  const leadMs = bundle.source === "capture" ? springLeadMs(CURSOR_SPRING_TAU_MS) : 0;
19039
- const timeline = buildTimeline(plan, bundle, [
18972
+ const motionHints = [
19040
18973
  ...hints,
19041
18974
  ...cursorMotionSpans(travelled).map((span) => ({
19042
18975
  startMs: Math.max(0, span.startMs - leadMs),
19043
18976
  endMs: span.endMs + settleMs
19044
18977
  }))
19045
- ]);
18978
+ ];
18979
+ let timeline = buildTimeline(plan, bundle, motionHints);
18980
+ const unplacedIds = new Set(timeline.unplacedCuts.flatMap((u) => u.ids));
18981
+ if (unplacedIds.size > 0 && givenScene !== void 0) {
18982
+ const kept = planScene({
18983
+ ...givenScene,
18984
+ edits: {
18985
+ ...givenScene.edits,
18986
+ removed: (givenScene.edits.removed ?? []).filter((r) => !unplacedIds.has(r.id))
18987
+ }
18988
+ }, { retiming: plan.retiming });
18989
+ plan = {
18990
+ ...plan,
18991
+ cameraIntents: kept.cameraIntents,
18992
+ cosmetics: kept.cosmetics,
18993
+ holds: kept.holds,
18994
+ removedSteps: kept.removedSteps,
18995
+ attachedToCuts: kept.attachedToCuts
18996
+ };
18997
+ timeline = buildTimeline(plan, bundle, motionHints);
18998
+ }
19046
18999
  const bridged = bridgeCutSeams(cursor, timeline, CUT_BRIDGE_MS);
19047
19000
  const trim = resolveRange({
19048
19001
  id: "trim",
@@ -19054,9 +19007,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
19054
19007
  });
19055
19008
  const clampedRanges = trim.clamped ? [trim.clamped] : [];
19056
19009
  const motion = scene?.motion ?? MOTION_DEFAULTS;
19057
- const cutIds = new Set(plan.cuts.flatMap((run) => run.actionIds));
19010
+ const cutIds = new Set(plan.removedSteps ?? []);
19058
19011
  const actEnds = new Map(bundle.markers.flatMap((m) => m.actEndSourceTimeMs === void 0 || cutIds.has(m.actionId) ? [] : [[m.actionId, m.actEndSourceTimeMs]]));
19059
- const camera = solveCamera(plan.cameraIntents, rectOf, timeline, markerSourceMs, plan.viewport, cameraFitWindow, motion, actEnds);
19012
+ const holdOutputMs = (bundle.heldPresses ?? []).map((h) => ({
19013
+ startMs: toOutputMs(timeline, h.pressMs),
19014
+ endMs: toOutputMs(timeline, h.releaseMs)
19015
+ }));
19016
+ const camera = solveCamera(plan.cameraIntents, rectOf, timeline, markerSourceMs, plan.viewport, cameraFitWindow, motion, actEnds, holdOutputMs);
19060
19017
  const intentAction = new Map(plan.cameraIntents.map((intent) => [intent.id, intent.actionId]));
19061
19018
  const loweredZooms = [];
19062
19019
  for (const segment of camera.segments) {
@@ -19089,7 +19046,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
19089
19046
  note: `zoom "${segment.id}" was asked to end at an instant the camera cannot reach \u2014 too close to its own push-in or to the next zoom \u2014 so it returns at ${Math.round(segment.endMs)}ms instead`
19090
19047
  });
19091
19048
  }
19092
- const clickKinds = new Set(bundle.source === "replay" ? ["click", "type"] : ["click"]);
19049
+ const clickKinds = new Set(bundle.source === "replay" ? ["click", "type", "drag"] : ["click"]);
19093
19050
  const clickActionIds = new Set((scene?.actions ?? []).filter((a) => clickKinds.has(a.kind)).map((a) => a.id));
19094
19051
  const clickOutputMs = bundle.markers.filter((m) => clickActionIds.has(m.actionId)).map((m) => toOutputMs(timeline, m.sourceTimeMs)).sort((a, b) => a - b);
19095
19052
  const touch = scene?.meta.capture.device?.touch === true;
@@ -19097,36 +19054,22 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
19097
19054
  const at = sampleCursor(bridged, m.sourceTimeMs);
19098
19055
  return at === null ? [] : [{ outputMs: toOutputMs(timeline, m.sourceTimeMs), at }];
19099
19056
  }).sort((a, b) => a.outputMs - b.outputMs) : [];
19100
- const cameraKeys = motion.follow ? followCursor({
19057
+ const cameraFollow = resolveCameraFollow({
19101
19058
  keys: camera.keys,
19102
- cursorAt: (outputMs) => sampleCursor(bridged, toSourceMs(timeline, outputMs)),
19103
- outputDurationMs: timeline.outputDurationMs,
19104
- viewport: plan.viewport,
19105
- fitWindow: cameraFitWindow,
19106
- timings: motionTimings(motion.smoothness),
19107
- minPlateauMs: CAMERA_DEFAULTS.neutral.minPlateauMs,
19108
- clickOutputMs
19109
- }) : camera.keys;
19110
- const cosmetics = plan.cosmetics.flatMap((binding) => {
19111
- const rectStep = binding.kind === "replacement" ? binding.range?.start?.actionId ?? "" : "";
19112
- const rect2 = binding.rect ?? (binding.anchorId ? rectOf(binding.anchorId, rectStep) : null);
19113
- if (!rect2) {
19114
- clampedRanges.push({
19115
- id: binding.id,
19116
- kind: binding.kind === "mask" ? "mask" : binding.range !== null ? "retext" : "replacement",
19117
- note: `${binding.kind === "mask" ? "mask" : binding.range !== null ? "retext" : "replacement"} "${binding.id}" is not drawn: nothing recorded where its element is on screen`
19118
- });
19119
- return [];
19120
- }
19059
+ plan,
19060
+ bundle,
19061
+ timeline,
19062
+ cursor: bridged,
19063
+ motion,
19064
+ drawsPointer: !touch && !(scene?.cursor ?? CURSOR_DEFAULTS).hidden
19065
+ });
19066
+ const cosmetics = plan.cosmetics.map((binding) => {
19121
19067
  let range = null;
19122
19068
  let unplaced = [];
19123
19069
  if (binding.range) {
19124
19070
  const resolved = resolveRange({
19125
19071
  id: binding.id,
19126
- // A replacement carrying a range is a retext overlay — the only
19127
- // shape that pairs the two (`plan/types.ts`) — so it reports under
19128
- // its own name rather than as a mask.
19129
- kind: binding.kind === "mask" ? "mask" : "retext",
19072
+ kind: "mask",
19130
19073
  start: binding.range.start,
19131
19074
  end: binding.range.end,
19132
19075
  timeline,
@@ -19137,39 +19080,23 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
19137
19080
  unplaced = resolved.unplaced;
19138
19081
  range = resolved.range;
19139
19082
  }
19140
- let reveal = null;
19141
- if (binding.reveal) {
19142
- const resolved = resolveRange({
19143
- id: binding.id,
19144
- kind: "retext",
19145
- start: binding.reveal.start,
19146
- end: binding.reveal.end,
19147
- timeline,
19148
- markerSourceMs
19149
- });
19150
- if (resolved.clamped)
19151
- clampedRanges.push(resolved.clamped);
19152
- reveal = resolved.range;
19153
- }
19154
- return [
19155
- {
19156
- id: binding.id,
19157
- kind: binding.kind,
19158
- rect: rect2,
19159
- text: binding.text,
19160
- range,
19161
- unplaced,
19162
- reveal
19163
- }
19164
- ];
19083
+ return {
19084
+ id: binding.id,
19085
+ kind: "mask",
19086
+ rect: binding.rect,
19087
+ range,
19088
+ unplaced
19089
+ };
19165
19090
  });
19166
19091
  return {
19167
19092
  plan,
19168
19093
  timeline,
19169
- cameraKeys,
19094
+ cameraKeys: camera.keys,
19095
+ cameraFollow,
19170
19096
  cameraSegments: camera.segments,
19171
19097
  cursor: bridged,
19172
19098
  clickOutputMs,
19099
+ holdOutputMs,
19173
19100
  touch,
19174
19101
  taps,
19175
19102
  cursorLook: scene?.cursor ?? CURSOR_DEFAULTS,
@@ -46891,7 +46818,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
46891
46818
  { x: canvas.width, y: canvas.height }
46892
46819
  ];
46893
46820
  const passAt = (at) => {
46894
- const then = frameCamera(sampleCamera(args.keys, at), args.base, frameRect, args.viewport, canvas);
46821
+ const then = frameCamera(sampleTrack(args.camera, at), args.base, frameRect, args.viewport, canvas);
46895
46822
  const r = then.scale / current.scale;
46896
46823
  return {
46897
46824
  scale: r,
@@ -46977,6 +46904,124 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
46977
46904
  ctx.restore();
46978
46905
  }
46979
46906
 
46907
+ // ../../packages/compositor/dist/render/draw-cursor.js
46908
+ var PULSE_DURATION_MS = 400;
46909
+ var PRESS_DURATION_MS = 110;
46910
+ var CURSOR_UPRIGHT = Object.freeze({
46911
+ press: 1,
46912
+ angleRad: 0
46913
+ });
46914
+ var ARROW = [
46915
+ { x: 0, y: 0 },
46916
+ { x: 0, y: 0.75 },
46917
+ { x: 0.19, y: 0.58 },
46918
+ { x: 0.31, y: 0.87 },
46919
+ { x: 0.45, y: 0.81 },
46920
+ { x: 0.33, y: 0.53 },
46921
+ { x: 0.56, y: 0.52 }
46922
+ ];
46923
+ var TOUCH_RADIUS = 0.42;
46924
+ var CURSOR_ART = {
46925
+ light: { height: 40, hotspot: { x: 0, y: 0 }, ink: bounds(ARROW) },
46926
+ dark: { height: 40, hotspot: { x: 0, y: 0 }, ink: bounds(ARROW) },
46927
+ touch: {
46928
+ height: 40,
46929
+ hotspot: { x: 0.5, y: 0.5 },
46930
+ ink: {
46931
+ min: { x: 0.5 - TOUCH_RADIUS, y: 0.5 - TOUCH_RADIUS },
46932
+ max: { x: 0.5 + TOUCH_RADIUS, y: 0.5 + TOUCH_RADIUS }
46933
+ }
46934
+ }
46935
+ };
46936
+ function bounds(points) {
46937
+ const xs = points.map((p) => p.x);
46938
+ const ys = points.map((p) => p.y);
46939
+ return {
46940
+ min: { x: Math.min(...xs), y: Math.min(...ys) },
46941
+ max: { x: Math.max(...xs), y: Math.max(...ys) }
46942
+ };
46943
+ }
46944
+ var INK = {
46945
+ light: { fill: "#ffffff", stroke: "#111827" },
46946
+ dark: { fill: "#111827", stroke: "#ffffff" },
46947
+ touch: { fill: "rgba(255, 255, 255, 0.45)", stroke: "#111827" }
46948
+ };
46949
+ function drawCursor(ctx, at, scale, pose, style = "light") {
46950
+ const size = CURSOR_ART[style].height * scale * pose.press;
46951
+ const ink = INK[style];
46952
+ ctx.save();
46953
+ ctx.translate(at.x, at.y);
46954
+ if (style !== "touch" && pose.angleRad !== 0)
46955
+ ctx.rotate(pose.angleRad);
46956
+ ctx.beginPath();
46957
+ if (style === "touch") {
46958
+ ctx.arc(0, 0, size * TOUCH_RADIUS, 0, Math.PI * 2);
46959
+ } else {
46960
+ const first = ARROW[0];
46961
+ if (first) {
46962
+ ctx.moveTo(first.x * size, first.y * size);
46963
+ for (const point2 of ARROW.slice(1))
46964
+ ctx.lineTo(point2.x * size, point2.y * size);
46965
+ }
46966
+ }
46967
+ ctx.closePath();
46968
+ ctx.shadowColor = "rgba(15, 23, 42, 0.35)";
46969
+ ctx.shadowBlur = 3 * scale;
46970
+ ctx.shadowOffsetY = 1.5 * scale;
46971
+ ctx.fillStyle = ink.fill;
46972
+ ctx.fill();
46973
+ ctx.shadowColor = "transparent";
46974
+ ctx.lineWidth = Math.max(1, 1.4 * scale);
46975
+ ctx.lineJoin = "round";
46976
+ ctx.strokeStyle = ink.stroke;
46977
+ ctx.stroke();
46978
+ ctx.restore();
46979
+ }
46980
+ var CURSOR_EXPOSURE_MS = 32;
46981
+ var CURSOR_TRAIL_MIN_TRAVEL_PX = 1;
46982
+ var TRAIL_PEAK_ALPHA = 0.55;
46983
+ function cursorTrailStamps(motionBlur) {
46984
+ if (motionBlur <= 0)
46985
+ return 0;
46986
+ return Math.ceil(2 + 8 * clamp(motionBlur, 0, 1));
46987
+ }
46988
+ function drawCursorTrail(ctx, positions, scale, style) {
46989
+ if (positions.length === 0)
46990
+ return;
46991
+ const priorAlpha = ctx.globalAlpha;
46992
+ positions.forEach((position, i) => {
46993
+ const t = (i + 1) / (positions.length + 1);
46994
+ ctx.globalAlpha = priorAlpha * t * t * TRAIL_PEAK_ALPHA;
46995
+ const pose = { press: 1, angleRad: position.angleRad ?? 0 };
46996
+ drawCursor(ctx, position, scale, pose, style);
46997
+ });
46998
+ ctx.globalAlpha = priorAlpha;
46999
+ }
47000
+ function drawClickPulse(ctx, at, scale, t) {
47001
+ if (t < 0 || t > 1)
47002
+ return;
47003
+ const eased = 1 - (1 - t) ** 3;
47004
+ const radius = 16 * scale * (1 + 2.2 * eased);
47005
+ const alpha = 1 - t;
47006
+ const core = Math.max(1, 2.5 * scale);
47007
+ const edge = Math.max(0.75, 1.25 * scale);
47008
+ const offset = (core + edge) / 2;
47009
+ ctx.save();
47010
+ ring(ctx, at, radius - offset, edge, `rgba(15, 23, 42, ${0.75 * alpha})`);
47011
+ ring(ctx, at, radius + offset, edge, `rgba(15, 23, 42, ${0.75 * alpha})`);
47012
+ ring(ctx, at, radius, core, `rgba(255, 255, 255, ${0.95 * alpha})`);
47013
+ ctx.restore();
47014
+ }
47015
+ function ring(ctx, at, radius, width, style) {
47016
+ if (radius <= 0)
47017
+ return;
47018
+ ctx.beginPath();
47019
+ ctx.arc(at.x, at.y, radius, 0, Math.PI * 2);
47020
+ ctx.lineWidth = width;
47021
+ ctx.strokeStyle = style;
47022
+ ctx.stroke();
47023
+ }
47024
+
46980
47025
  // ../../packages/compositor/dist/render/cursor-pose.js
46981
47026
  var PRESS_DEPTH = 0.14;
46982
47027
  var RELEASE_DECAY_MS = 80;
@@ -46986,13 +47031,16 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
46986
47031
  const x = clamp(u, 0, 1);
46987
47032
  return x * x * (3 - 2 * x);
46988
47033
  };
46989
- function cursorPressScale(outputTimeMs, clickOutputMs, bounce) {
47034
+ function cursorPressScale(outputTimeMs, clickOutputMs, bounce, holds = []) {
46990
47035
  const depth = PRESS_DEPTH * clamp(bounce, 0, 2);
46991
47036
  if (depth <= 0)
46992
47037
  return 1;
47038
+ if (holds.some((h) => outputTimeMs >= h.startMs && outputTimeMs < h.endMs)) {
47039
+ return 1 - depth;
47040
+ }
46993
47041
  let previous = Number.NEGATIVE_INFINITY;
46994
47042
  let next = Number.POSITIVE_INFINITY;
46995
- for (const click of clickOutputMs) {
47043
+ for (const click of [...clickOutputMs, ...holds.map((h) => h.endMs)]) {
46996
47044
  if (click <= outputTimeMs)
46997
47045
  previous = Math.max(previous, click);
46998
47046
  else
@@ -47058,89 +47106,17 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
47058
47106
  return sum / weights;
47059
47107
  }
47060
47108
 
47061
- // ../../packages/compositor/dist/render/retext.js
47062
- function revealedText(text, reveal, outputTimeMs) {
47063
- if (reveal === null)
47064
- return text;
47065
- const span = reveal.endMs - reveal.startMs;
47066
- if (span <= 0)
47067
- return text;
47068
- if (outputTimeMs >= reveal.endMs)
47069
- return text;
47070
- if (outputTimeMs <= reveal.startMs)
47071
- return "";
47072
- const chars = [...text];
47073
- const shown = Math.ceil(chars.length * (outputTimeMs - reveal.startMs) / span);
47074
- return chars.slice(0, shown).join("");
47075
- }
47076
-
47077
47109
  // ../../packages/compositor/dist/render/draw-cosmetics.js
47078
47110
  var MASK_FILL = "#4b5563";
47079
- var TEXT_INK = "#111827";
47080
- var TEXT_FONT = "system-ui, -apple-system, 'Segoe UI', sans-serif";
47081
- function sampleEdgeColor(ctx, rect2) {
47082
- const inset = 3;
47083
- const probes = [
47084
- [rect2.x - inset, rect2.y + rect2.height / 2],
47085
- [rect2.x + rect2.width + inset, rect2.y + rect2.height / 2],
47086
- [rect2.x + rect2.width / 2, rect2.y - inset],
47087
- [rect2.x + rect2.width / 2, rect2.y + rect2.height + inset]
47088
- ];
47089
- let r = 0;
47090
- let g = 0;
47091
- let b = 0;
47092
- let n = 0;
47093
- for (const [px, py] of probes) {
47094
- if (px < 0 || py < 0 || px >= ctx.canvas.width || py >= ctx.canvas.height)
47095
- continue;
47096
- const data = ctx.getImageData(Math.round(px), Math.round(py), 1, 1).data;
47097
- r += data[0];
47098
- g += data[1];
47099
- b += data[2];
47100
- n++;
47101
- }
47102
- if (n === 0)
47103
- return "rgb(255, 255, 255)";
47104
- return `rgb(${Math.round(r / n)}, ${Math.round(g / n)}, ${Math.round(b / n)})`;
47105
- }
47106
- function drawReplacement(ctx, rect2, text) {
47107
- ctx.save();
47108
- ctx.fillStyle = sampleEdgeColor(ctx, rect2);
47109
- ctx.fillRect(rect2.x, rect2.y, rect2.width, rect2.height);
47110
- let fontSize = Math.max(8, rect2.height * 0.62);
47111
- const padding = rect2.height * 0.15;
47112
- const maxWidth = Math.max(1, rect2.width - padding * 2);
47113
- ctx.textBaseline = "middle";
47114
- ctx.textAlign = "left";
47115
- for (let i = 0; i < 24; i++) {
47116
- ctx.font = `${fontSize}px ${TEXT_FONT}`;
47117
- if (ctx.measureText(text).width <= maxWidth || fontSize <= 8)
47118
- break;
47119
- fontSize *= 0.9;
47120
- }
47121
- ctx.fillStyle = TEXT_INK;
47122
- ctx.fillText(text, rect2.x + padding, rect2.y + rect2.height / 2, maxWidth);
47123
- ctx.restore();
47124
- }
47125
47111
  function drawMask(ctx, rect2) {
47126
47112
  ctx.save();
47127
47113
  ctx.fillStyle = MASK_FILL;
47128
47114
  ctx.fillRect(rect2.x, rect2.y, rect2.width, rect2.height);
47129
47115
  ctx.restore();
47130
47116
  }
47131
- function drawCosmetics(ctx, cosmetics, toOutput, outputTimeMs) {
47132
- const ordered = [
47133
- ...cosmetics.filter((c) => c.kind === "replacement"),
47134
- ...cosmetics.filter((c) => c.kind === "mask")
47135
- ];
47136
- for (const cosmetic of ordered) {
47137
- const rect2 = toOutput(cosmetic.rect);
47138
- if (cosmetic.kind === "mask")
47139
- drawMask(ctx, rect2);
47140
- else if (cosmetic.text !== null) {
47141
- drawReplacement(ctx, rect2, revealedText(cosmetic.text, cosmetic.reveal, outputTimeMs));
47142
- }
47143
- }
47117
+ function drawCosmetics(ctx, cosmetics, toOutput) {
47118
+ for (const cosmetic of cosmetics)
47119
+ drawMask(ctx, toOutput(cosmetic.rect));
47144
47120
  }
47145
47121
 
47146
47122
  // ../../packages/compositor/dist/render/presentation.js
@@ -47337,7 +47313,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
47337
47313
  const { frameRect } = presentation;
47338
47314
  const sourceMs = toSourceMs(resolved.timeline, outputTimeMs);
47339
47315
  const base = contentScale(frameRect, viewport);
47340
- const camera = frameCamera(sampleCamera(resolved.cameraKeys, outputTimeMs), base, frameRect, viewport, target);
47316
+ const camera = frameCamera(sampleTrack(resolved, outputTimeMs), base, frameRect, viewport, target);
47341
47317
  const fetchStartedAt = args.onStage ? performance.now() : 0;
47342
47318
  const frame2 = await frames.at(sourceMs);
47343
47319
  args.onStage?.("fetch", performance.now() - fetchStartedAt);
@@ -47367,8 +47343,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
47367
47343
  // A ranged cosmetic paints inside its range only: `[startMs, endMs)`
47368
47344
  // on the untrimmed output axis, the same clock `outputTimeMs` is on.
47369
47345
  resolved.cosmetics.filter((c) => c.range === null || outputTimeMs >= c.range.startMs && outputTimeMs < c.range.endMs),
47370
- (rect2) => cssRectToOutput(rect2, camera, frameRect, viewport),
47371
- outputTimeMs
47346
+ (rect2) => cssRectToOutput(rect2, camera, frameRect, viewport)
47372
47347
  ));
47373
47348
  ctx.restore();
47374
47349
  ctx.save();
@@ -47376,7 +47351,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
47376
47351
  stage("logo", () => drawLogo(ctx, target, presentation));
47377
47352
  ctx.restore();
47378
47353
  stage("blur", () => paintCameraBlur(ctx, cameraBlurTransforms({
47379
- keys: resolved.cameraKeys,
47354
+ camera: resolved,
47380
47355
  outputTimeMs,
47381
47356
  blur: resolved.motion.blur,
47382
47357
  current: camera,
@@ -47413,7 +47388,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
47413
47388
  drawClickPulse(ctx, at, uiScale, t);
47414
47389
  }
47415
47390
  drawCursor(ctx, at, uiScale, {
47416
- press: cursorPressScale(outputTimeMs, resolved.clickOutputMs, look.clickBounce ?? CURSOR_POLISH_DEFAULTS.clickBounce),
47391
+ press: cursorPressScale(outputTimeMs, resolved.clickOutputMs, look.clickBounce ?? CURSOR_POLISH_DEFAULTS.clickBounce, resolved.holdOutputMs),
47417
47392
  angleRad
47418
47393
  }, look.style);
47419
47394
  ctx.globalAlpha = priorAlpha;
@@ -47450,22 +47425,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
47450
47425
  function clampToSourceDetail(args) {
47451
47426
  const { keys, timeline, bundle, outputPxPerCssPx, viewport } = args;
47452
47427
  const violations = [];
47453
- const clampKey = (key, before) => {
47428
+ const clampKey = (key) => {
47454
47429
  const sourceWidth = sourceWidthAt(bundle, toSourceMs(timeline, key.outputTimeMs));
47455
- if (key.followPan && before) {
47456
- const granted2 = Math.min(key.scale, before.scale);
47457
- const neededWidth2 = outputPxPerCssPx * granted2 * viewport.width;
47458
- if (sourceWidth !== 0 && sourceWidth < neededWidth2) {
47459
- violations.push({
47460
- outputTimeMs: key.outputTimeMs,
47461
- requestedScale: granted2,
47462
- grantedScale: granted2,
47463
- sourceWidth,
47464
- neededWidth: neededWidth2
47465
- });
47466
- }
47467
- return { ...key, scale: granted2 };
47468
- }
47469
47430
  if (sourceWidth === 0)
47470
47431
  return key;
47471
47432
  const stillWidth = keyframeAt(bundle, toSourceMs(timeline, key.outputTimeMs))?.width;
@@ -47490,10 +47451,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
47490
47451
  }
47491
47452
  return { ...key, scale: granted };
47492
47453
  };
47493
- const clamped = [];
47494
- for (const key of keys) {
47495
- clamped.push(clampKey(key, clamped[clamped.length - 1]));
47496
- }
47454
+ const clamped = keys.map(clampKey);
47497
47455
  violations.push(...spansUnderZoom(clamped, violations, timeline, bundle, outputPxPerCssPx, viewport));
47498
47456
  return { keys: clamped, violations };
47499
47457
  }
@@ -47575,7 +47533,19 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
47575
47533
  viewport: plan.viewport
47576
47534
  });
47577
47535
  return {
47578
- resolved: { ...resolved, cameraKeys: detail.keys },
47536
+ resolved: {
47537
+ ...resolved,
47538
+ cameraKeys: detail.keys,
47539
+ cameraFollow: resolveCameraFollow({
47540
+ keys: detail.keys,
47541
+ plan: resolved.plan,
47542
+ bundle,
47543
+ timeline: resolved.timeline,
47544
+ cursor: resolved.cursor,
47545
+ motion: resolved.motion,
47546
+ drawsPointer: !resolved.touch && !resolved.cursorLook.hidden
47547
+ })
47548
+ },
47579
47549
  presentation,
47580
47550
  violations: detail.violations
47581
47551
  };
@@ -47639,9 +47609,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
47639
47609
  const ctx = canvas.getContext("2d");
47640
47610
  const step = 1e3 / target.fps;
47641
47611
  if (composed.timeline.outputDurationMs === 0 && composed.timeline.cuts.length > 0) {
47642
- const steps = composed.timeline.cuts.flatMap((c) => c.actionIds);
47643
- const plural = steps.length === 1 ? "is" : "are";
47644
- throw new Error(`nothing left to render: ${steps.join(", ")} ${plural} cut, and that leaves no frames at all. Restore a step to export it.`);
47612
+ throw new Error("nothing left to render: the removed pieces leave no frames. Restore one to export it.");
47645
47613
  }
47646
47614
  const { startMs, endMs } = composed.range;
47647
47615
  if (composed.timeline.outputDurationMs > 0 && endMs <= startMs) {
@@ -47693,8 +47661,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
47693
47661
  detailViolations: violations,
47694
47662
  unavailableSpans: ports.frames.unavailable?.() ?? [],
47695
47663
  loweredZooms: composed.loweredZooms,
47696
- clampedRanges: composed.clampedRanges,
47697
- cosmeticIds: composed.cosmetics.map((c) => c.id)
47664
+ clampedRanges: composed.clampedRanges
47698
47665
  };
47699
47666
  }
47700
47667
  function stillSourceMs(bundle, marker) {
@@ -47704,14 +47671,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
47704
47671
  var STILL_SEAM_NUDGE_MS = 1e-3;
47705
47672
  var STILL_PLACEMENT_TOLERANCE_MS = 1;
47706
47673
  function stillBeats(bundle, timeline) {
47707
- const cutSteps = new Set(timeline.cuts.flatMap((c) => c.actionIds));
47708
47674
  const beats = [];
47709
47675
  const unplaced = [];
47710
47676
  for (const marker of bundle.markers) {
47711
- if (cutSteps.has(marker.actionId)) {
47677
+ const ms = marker.sourceTimeMs;
47678
+ if (timeline.cuts.some((c) => ms >= c.srcStartMs && ms < c.srcEndMs)) {
47712
47679
  unplaced.push({
47713
47680
  actionId: marker.actionId,
47714
- reason: "the step is cut, so the video holds none of its frames"
47681
+ reason: "the step is in a removed piece, so the video holds none of its frames"
47715
47682
  });
47716
47683
  continue;
47717
47684
  }
@@ -47749,7 +47716,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
47749
47716
  const times = supplied ?? beats.map((b) => b.outputTimeMs);
47750
47717
  if (atMarkers && times.length === 0) {
47751
47718
  const why = unplaced.map((u) => `${u.actionId} (${u.reason})`).join(", ");
47752
- throw new Error(unplaced.length === 0 ? "nothing left to render: this take has no steps, so there is no still to take of it." : `nothing left to render: no step in this take has a still left \u2014 ${why}. Restore a step, or rebuild the take, to export stills.`);
47719
+ throw new Error(unplaced.length === 0 ? "nothing left to render: this take has no steps, so there is no still to take of it." : `nothing left to render: no step in this take has a still left \u2014 ${why}. Restore a removed piece to export stills.`);
47753
47720
  }
47754
47721
  const unsmeared = {
47755
47722
  ...composed,
@@ -47766,13 +47733,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
47766
47733
  transitionMs: 0,
47767
47734
  stiffness: composed.cameraKeys[0]?.stiffness ?? 0
47768
47735
  };
47769
- return { ...unsmeared, cameraKeys: [key] };
47736
+ return { ...unsmeared, cameraKeys: [key], cameraFollow: [] };
47770
47737
  };
47771
47738
  const drawnShort = /* @__PURE__ */ new Map();
47772
47739
  const framed = (actionId, outputTimeMs) => {
47773
47740
  if (framing === "video")
47774
47741
  return unsmeared;
47775
- const keys = composed.cameraKeys;
47776
47742
  const segments = composed.cameraSegments;
47777
47743
  const zoom = (actionId === void 0 ? void 0 : segments.find((s) => stepOf.get(s.id) === actionId)) ?? segments.find((s) => s.startMs <= outputTimeMs && outputTimeMs < s.endMs);
47778
47744
  if (framing === "step" && zoom !== void 0) {
@@ -47780,7 +47746,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
47780
47746
  if (v.outputTimeMs === zoom.startMs)
47781
47747
  drawnShort.set(v.outputTimeMs, v);
47782
47748
  }
47783
- return held(sampleCamera(keys, zoom.startMs));
47749
+ return held(sampleCamera(composed.cameraKeys, zoom.startMs));
47784
47750
  }
47785
47751
  const sourceWidth = sourceWidthAt(bundle, toSourceMs(composed.timeline, outputTimeMs));
47786
47752
  const neededWidth = contentScale(presentation.frameRect, plan.viewport) * plan.viewport.width;
@@ -47799,7 +47765,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
47799
47765
  scale: 1
47800
47766
  });
47801
47767
  }
47802
- const at = sampleCamera(keys, zoom?.startMs ?? outputTimeMs);
47768
+ const at = sampleCamera(composed.cameraKeys, zoom?.startMs ?? outputTimeMs);
47803
47769
  return held({ center: at.center, scale: 1 });
47804
47770
  };
47805
47771
  for (const [i, outputTimeMs] of times.entries()) {
@@ -47822,8 +47788,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
47822
47788
  unavailableSpans: ports.frames.unavailable?.() ?? [],
47823
47789
  unplacedStills: unplaced,
47824
47790
  loweredZooms: composed.loweredZooms,
47825
- clampedRanges: composed.clampedRanges,
47826
- cosmeticIds: composed.cosmetics.map((c) => c.id)
47791
+ clampedRanges: composed.clampedRanges
47827
47792
  };
47828
47793
  }
47829
47794
 
@@ -47958,7 +47923,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
47958
47923
  };
47959
47924
  }
47960
47925
  };
47961
- const plan = planScene(scene, { retexts: input.retexts });
47926
+ const plan = planScene(scene);
47962
47927
  const surface = createOffscreenSurface();
47963
47928
  const reclaimed = bundle.degradations.filter((d) => d.kind === "motionReclaimed").map((d) => ({
47964
47929
  ref: `${d.startMs}-${d.endMs}ms`,
@@ -47997,7 +47962,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
47997
47962
  loweredZooms: result2.loweredZooms,
47998
47963
  logoWarning: logoWarning2,
47999
47964
  clampedRanges: result2.clampedRanges,
48000
- cosmeticIds: result2.cosmeticIds,
48001
47965
  rendered: { width: at2.width, height: at2.height, fps: at2.fps },
48002
47966
  ...sized.cappedFrom === null ? {} : { stillsCapped: { askedWidth: sized.cappedFrom } }
48003
47967
  }
@@ -48121,7 +48085,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
48121
48085
  loweredZooms: result.loweredZooms,
48122
48086
  logoWarning,
48123
48087
  clampedRanges: result.clampedRanges,
48124
- cosmeticIds: result.cosmeticIds,
48125
48088
  rendered: { width: at.width, height: at.height, fps: at.fps },
48126
48089
  ...budget === void 0 ? {} : {
48127
48090
  gifBudget: {
@@ -48187,7 +48150,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
48187
48150
  bundle,
48188
48151
  frames: await framesFor(bundle, load),
48189
48152
  logo,
48190
- retexts: manifest.retexts,
48191
48153
  ...manifest.gifBudget === void 0 ? {} : { gifBudget: manifest.gifBudget },
48192
48154
  ...manifest.mp4Cap === void 0 ? {} : { mp4Cap: manifest.mp4Cap },
48193
48155
  ...manifest.stills === void 0 ? {} : { stills: manifest.stills },