@vosjs/studio-core 0.15.0 → 0.16.0

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/index.d.ts CHANGED
@@ -1429,6 +1429,13 @@ interface ProjectDoc {
1429
1429
  * its). Absent = one media; a document with none lowers byte-identically.
1430
1430
  */
1431
1431
  media?: Media[];
1432
+ /**
1433
+ * The frame that stands for this document (OUTPUT seconds): the cover the
1434
+ * shelf shows, the still a kit leads with. Absent, `docStillTime` derives
1435
+ * it: the document's own last freeze (a poster's rest), else the hero
1436
+ * moment after the opening has entered. A template never sets it.
1437
+ */
1438
+ still?: number;
1432
1439
  /**
1433
1440
  * Speed-change spans (SOURCE time, footage-anchored — see SpeedSpan).
1434
1441
  * Optional for backward compatibility with persisted docs; absent = all 1×.
@@ -3088,6 +3095,30 @@ declare function applyLook(frame: FrameStyle, look: Look, size: {
3088
3095
  * what it has. A legacy end card yields null: its words rise over a
3089
3096
  * receding card, which is footage under a fading title, not a poster.
3090
3097
  */
3098
+ /** The freezes the document owns: the ones no template laid (no `from`). */
3099
+ declare function ownFreezes(doc: ProjectDoc): FreezeSpan[];
3100
+ /** The still a document with nothing to say gets: the old default. */
3101
+ declare const STILL_DEFAULT = 0.5;
3102
+ /**
3103
+ * The output moment that STANDS for a document: its cover on the shelf,
3104
+ * the still a kit leads with. One ladder, one derivation, read by the
3105
+ * fleet thumbnail, the stills export and the kit alike; a template can
3106
+ * never move it, because everything a template lays is stamped `from`.
3107
+ *
3108
+ * 1. `doc.still`, the author's own choice, clamped to the output.
3109
+ * 2. The last freeze the document OWNS (no `from`), where it begins: a
3110
+ * poster's rest, or a moment the author froze on purpose.
3111
+ * 3. The hero: the first moment at which the card and every clip present
3112
+ * at the cold open have finished entering, plus a beat, never past the
3113
+ * footage. Read from `anim` seconds, so it is the same everywhere.
3114
+ * 4. The old default, for a document with none of the above.
3115
+ */
3116
+ declare function docStillTime(doc: ProjectDoc): number;
3117
+ /**
3118
+ * Where the LAST freeze of any origin begins, or null with none: the
3119
+ * poster's rest as first spelled. Prefer `docStillTime`, which ignores a
3120
+ * template's freezes and always answers.
3121
+ */
3091
3122
  declare function docRestTime(doc: ProjectDoc): number | null;
3092
3123
  /**
3093
3124
  * Every freeze the document carries, the spelled ones and the legacy
@@ -3832,4 +3863,4 @@ declare function rejectSpan(rejected: RejectedSpan[] | undefined, lane: Rejected
3832
3863
  anchor?: StepAnchor;
3833
3864
  }, note?: string): RejectedSpan;
3834
3865
 
3835
- export { ASPECT_RATIOS, AUDIO_PLAN_STEP, type AnchorKind, type Anim, type AnimKind, type AnimStep, type AppliedTemplate, type ApplyTemplateOptions, type AspectRatioOption, type AudioClip, type AudioPlanPoint, type AudioPlanTrack, BACKGROUND_Z, BASE_FRAME_STYLE, type Backdrop, type BackgroundMedia, type BakedText3dAsset, type BakedText3dMaterial, type BrowserBarStyle, type BuildDigestInput, CAMERA_FAR, CAMERA_NEAR, CAM_CHAIN_GAP, CAM_EASE, CAM_PAN, CAM_PAN_EASE, CAM_RAMP_IN, CAM_RAMP_OUT, CAM_SIZE_MAX, CAM_SIZE_MIN, CAM_SPAN_MIN, CAPTURE_COVERAGE_MIN, CARD_EDGE_OVERDRAW, CARD_ENTER_KINDS, CARD_EXIT_KINDS, CARD_FADE_SECONDS, CARD_FOV, CARD_Z, CHANNEL_SPECS_HASH, CHANNEL_SPECS_VERIFIED, CLICK_FX_INTENSITY, CLICK_FX_PRE, CLICK_HIGHLIGHT_FADE, CLICK_PAIR_MAX, CLICK_PULSE_DUR, CLICK_RECT_MAX_FRAC, CLICK_RIPPLE_DUR, CLICK_SYNTH_RELEASE, CROP_MAX_PX, CROP_MIN_FRAC, CROP_MIN_PX, CROP_PAD, CURSOR_IDLE_EPS_FRAC, CURSOR_IDLE_FADE_IN, CURSOR_IDLE_FADE_OUT, CURSOR_IDLE_HOLD, type CamBubbleRect, type CamPoseSpan, type CamStyle, type CaptureNormalization, type CardLayout, type ClickFxStyle, type CopiedLayout, type CopyLayoutOptions, type CopyStyleOptions, type CursorEvent, type CursorFadeKey, type CursorIdleOptions, type CursorStyle, type CursorTrack, DARK_GROUND, DEFAULT_BROWSER_BAR, DEFAULT_CAM_POSE, DEFAULT_CAM_STYLE, DEFAULT_CLICK_FX, DEFAULT_CURSOR_STYLE, DEFAULT_DUCK, DEFAULT_FRAME_STYLE, DEFAULT_SPEED_PARAMS, DEFAULT_TILT_POSE, DEFAULT_ZOOM_LEVEL, DEFAULT_ZOOM_STYLE, DESTINATIONS, DIGEST_CROP_MAX, DIGEST_FULL_MAX, DIGEST_VERSION, DOC_SCHEMA_VERSION, DRAG_FIT_LEVEL, type Destination, type Digest, type DigestImageRef, type DigestPlan, type DigestTakeFacts, type DocSegment, type DuckOptions, END_CARD_FROM, END_CARD_RECEDE, END_CARD_SECONDS, ENTRANCE_SECONDS, EXPORT_RESOLUTION_OPTIONS, EXPORT_SHORT_EDGE, type EndCard, type EnvelopePoint, type ExportResolution, type ExtractClickOptions, FOLLOW_RECENTER, FOLLOW_SAFE_RATIO, FRAME_BORDER_COLOR_DEFAULT, FRAME_BORDER_DEFAULT, FRAME_BORDER_WIDTH_DEFAULT, FREEZE_DEFAULT_SECONDS, FREEZE_SECONDS_MAX, FREEZE_SECONDS_MIN, type FocusBounds, type FollowEvent, type FollowOptions, type FrameEntrance, type FrameGeometry, type FrameStyle, type FreezeExtent, type FreezeSpan, HOUSE_GRADIENT, IDLE_KINDS, type IdleKind, type IngestOptions, LAYOUT_FRAME_FIELDS, LOOK_KINDS, type LayoutParts, type Look, type LookBrand, type LookKind, type LookPlacement, type LowerProgramOptions, type LoweredAudioClip, type LoweredClick, type LoweredComposition, type LoweredZoomSpan, MEDIA_ENTER_KINDS, MEDIA_EXIT_KINDS, MEDIA_FRAME_KEYS, MINIMAL_BAR_THEMES, MOTION_DELTA, MOTION_EASE, type Media, type MediaFrame, type MediaFrameKey, type MediaOverlayClip, type MediaSegment, type MicRms, type MinimalBarTheme, type Moment, type MomentKind, type MomentsOptions, type MotionKey, type MotionPose, type MotionPose3D, type MusicBedInput, type NormRect, OBJECT_DEFAULT_SCALE, OVERLAY_FONT_FACES, OVERLAY_LINE_HEIGHT, OVERLAY_MEDIA_DEFAULT_RADIUS, OVERLAY_MEDIA_DEFAULT_WIDTH, OVERLAY_MIN_DURATION, OVERLAY_SCALE_MAX, OVERLAY_SIZE_MAX, OVERLAY_SIZE_MIN, OVERLAY_TRANSITION_DUR, OVERLAY_Z, type ObjectAnimation, type ObjectAsset, type ObjectClip, type ObjectPrimitiveShape, type OverlayClip, type OverlayFontFace, type OverlayKind, type OverlayPresetStyle, type OverlayRect, type OverlayTransform, type OverlayTransition, PLATE_GROUND, PLAYBACK_ACTIVITY, PRIMARY_MEDIA, PROGRAM_RETIME, type PlanOptions, type PlanTiltOptions, type PlaneSize, type ProgramAnchorDoc, type ProgramTweenEdit, type ProjectDoc, type PxRect, REJECT_OVERLAP, REST_TILT_ID, type RecordingArtifact, type RecordingMeta, type Rect, type RejectedLane, type RejectedSpan, type ResolvedOverlayBox, type ResolvedOverlayStyle, SCENE_MOTION, SCENE_QUIET, SPEED_RATE_MAX, SPEED_RATE_MIN, SPEED_SPAN_MIN, STAGE_CLIP_PREFIX, STUDIO_ENTRY_ID, STYLE_FIELDS, type SmoothOptions, type SmoothPoint, type SpeedParams, type SpeedSpan, type StepAnchor, type StepSpan, type StudioAudioPlan, type StudioDoc, type StudioEntry, type StyleField, TEXT3D_DEPTH_DEFAULT, TEXT3D_DEPTH_MAX, TEXT3D_DEPTH_MIN, TEXT_ENTER_KINDS, TEXT_EXIT_KINDS, TEXT_PRESETS, TILT_AUTO_DEAD_ZONE, TILT_AUTO_MIN, TILT_CHAIN_GAP, TILT_DEG_MAX, TILT_EASE, TILT_INTENSITY_MAX, TILT_PAN, TILT_PAN_EASE, TILT_RAMP_IN, TILT_RAMP_OUT, TILT_SPAN_MIN, TILT_UI_DEG_MAX, TRANSITION_SPEED_MULT, type TemplateAnchor, type Text3dMaterial, type TextFxDirection, type TextFxKind, type TextFxSpec, type TextFxUnit, type TextOverlayBox, type TextOverlayClip, type TextOverlayPreset, type TextOverlayStroke, type TiltPersonality, type TiltSpan, type TiltStyleName, type TranscriptSegment, type TransitionSpeed, WINDOW_FOCUS_MIN, ZOOM_CHAIN_GAP, ZOOM_EASE, ZOOM_LEVELS, ZOOM_LEVEL_MAX, ZOOM_LEVEL_MIN, ZOOM_PAN, ZOOM_PAN_EASE, ZOOM_RAMP_IN, ZOOM_RAMP_IN_OVERLAP, ZOOM_RAMP_OUT, ZOOM_SPAN_MIN, ZOOM_STYLES, ZOOM_STYLE_OPTIONS, type ZoomSpan, type ZoomStyleName, type ZoomStyleParams, type ZoomWindow, anchorKindOf, anchorSourceDuration, animStep, applyLook, applyTemplate, aspectRatioValue, audioLane, backdropMedia, buildDigest, camBubbleRect, camBubbleRectAt, camLane, camMoveLane, camRectFromPose, camRestPose, camTrackFromDoc, cardEnter, cardExit, cardFields, cardInset, cardPointToScreen, cardPoseTrack, clampCamFrac, clampCamSize, clampFocus, clampFreezeSeconds, clampSpeedRate, clampTiltDeg, clampZoomLevel, clipEnvelope, clipLength, clipsFrom, computeCardLayout, computeMicRms, computePeaks, copyLayout, copyStyle, cropBox, cursorIdleFade, deriveViewportCrop, destinationById, destinationsForChannel, docCardLayout, docFreezes, docMediaList, docOutputDuration, docRestTime, docToCropSpace, docToFullSpace, dropTemplate, duckCurve, effectiveSegments, endCardClips, enterKey, enterOf, entranceSeconds, envelopeAt, envelopeValueAt, exitKey, exitOf, exitSeconds, expandEndCard, expectedFrameSize, exportSizeFor, extractClicks, focusBounds, followFocusEvents, frameGeometry, freezeLane, freezeOutputExtents, hexToRgbTriplet, houseLook, idleGaps, idleKey, isLookKind, isMusicBed, isPlayback, isProgramDoc, isRecordingDoc, isRejected, isStageClip, isUnitStep, lastLayerEnd, layoutOf, levelForFocusFraction, lookFromBrand, lookKindForGround, lowerProgramDoc, lowerStudioDoc, lowerToComposition, mediaAtOutput, mediaDuration, mediaFrame, mediaKey, mediaSource, micLane, migrateHostedDoc, migrateMotion, momentsFromDoc, motionTrack, musicBedClip, nextMediaId, normalizeCaptureSpace, objectMotionBase, objectMotionPoseAt, objectsLane, outputDurationOf, outputEnd, outputRangeToSource, overlapFraction, overlayFaceFor, overlayFontFaces, overlayFontString, overlayFxSpec, overlayHit, overlayLines, overlayMotionBase, overlayMotionPoseAt, overlayRect, overlaysLane, pageDisplayUrl, parsePoseId, pickStyle, placeFreezes, planAutoSpeed, planAutoTilt, planAutoZoom, planForDigest, planeSizeAtDepth, platformBarKind, programDuration, projectFromArtifact, ratedSegments, recommendedExportResolution, refillAudioBeds, rejectSpan, removeSourceRange, removeSpeedInRange, resolveExportSize, resolveOverlayBox, resolveOverlayStyle, resolveText3dAsset, resolveZoomStyle, restLeanOf, sameMedia, sceneChanges, scrollRuns, setSpeedInRange, smoothCursor, spanOutputExtent, speedLane, studioAudioPlan, studioEntry, studioLayerData, tiltLane, tiltTrackFromDoc, transitionMult, videoLane, voiceKey, withBackdrop, withFreezes, withHolds, withoutRejected, wrapProgramLength, zoomCoversRect, zoomLane, zoomSpanForRange, zoomTrackFromDoc, zoomWindow };
3866
+ export { ASPECT_RATIOS, AUDIO_PLAN_STEP, type AnchorKind, type Anim, type AnimKind, type AnimStep, type AppliedTemplate, type ApplyTemplateOptions, type AspectRatioOption, type AudioClip, type AudioPlanPoint, type AudioPlanTrack, BACKGROUND_Z, BASE_FRAME_STYLE, type Backdrop, type BackgroundMedia, type BakedText3dAsset, type BakedText3dMaterial, type BrowserBarStyle, type BuildDigestInput, CAMERA_FAR, CAMERA_NEAR, CAM_CHAIN_GAP, CAM_EASE, CAM_PAN, CAM_PAN_EASE, CAM_RAMP_IN, CAM_RAMP_OUT, CAM_SIZE_MAX, CAM_SIZE_MIN, CAM_SPAN_MIN, CAPTURE_COVERAGE_MIN, CARD_EDGE_OVERDRAW, CARD_ENTER_KINDS, CARD_EXIT_KINDS, CARD_FADE_SECONDS, CARD_FOV, CARD_Z, CHANNEL_SPECS_HASH, CHANNEL_SPECS_VERIFIED, CLICK_FX_INTENSITY, CLICK_FX_PRE, CLICK_HIGHLIGHT_FADE, CLICK_PAIR_MAX, CLICK_PULSE_DUR, CLICK_RECT_MAX_FRAC, CLICK_RIPPLE_DUR, CLICK_SYNTH_RELEASE, CROP_MAX_PX, CROP_MIN_FRAC, CROP_MIN_PX, CROP_PAD, CURSOR_IDLE_EPS_FRAC, CURSOR_IDLE_FADE_IN, CURSOR_IDLE_FADE_OUT, CURSOR_IDLE_HOLD, type CamBubbleRect, type CamPoseSpan, type CamStyle, type CaptureNormalization, type CardLayout, type ClickFxStyle, type CopiedLayout, type CopyLayoutOptions, type CopyStyleOptions, type CursorEvent, type CursorFadeKey, type CursorIdleOptions, type CursorStyle, type CursorTrack, DARK_GROUND, DEFAULT_BROWSER_BAR, DEFAULT_CAM_POSE, DEFAULT_CAM_STYLE, DEFAULT_CLICK_FX, DEFAULT_CURSOR_STYLE, DEFAULT_DUCK, DEFAULT_FRAME_STYLE, DEFAULT_SPEED_PARAMS, DEFAULT_TILT_POSE, DEFAULT_ZOOM_LEVEL, DEFAULT_ZOOM_STYLE, DESTINATIONS, DIGEST_CROP_MAX, DIGEST_FULL_MAX, DIGEST_VERSION, DOC_SCHEMA_VERSION, DRAG_FIT_LEVEL, type Destination, type Digest, type DigestImageRef, type DigestPlan, type DigestTakeFacts, type DocSegment, type DuckOptions, END_CARD_FROM, END_CARD_RECEDE, END_CARD_SECONDS, ENTRANCE_SECONDS, EXPORT_RESOLUTION_OPTIONS, EXPORT_SHORT_EDGE, type EndCard, type EnvelopePoint, type ExportResolution, type ExtractClickOptions, FOLLOW_RECENTER, FOLLOW_SAFE_RATIO, FRAME_BORDER_COLOR_DEFAULT, FRAME_BORDER_DEFAULT, FRAME_BORDER_WIDTH_DEFAULT, FREEZE_DEFAULT_SECONDS, FREEZE_SECONDS_MAX, FREEZE_SECONDS_MIN, type FocusBounds, type FollowEvent, type FollowOptions, type FrameEntrance, type FrameGeometry, type FrameStyle, type FreezeExtent, type FreezeSpan, HOUSE_GRADIENT, IDLE_KINDS, type IdleKind, type IngestOptions, LAYOUT_FRAME_FIELDS, LOOK_KINDS, type LayoutParts, type Look, type LookBrand, type LookKind, type LookPlacement, type LowerProgramOptions, type LoweredAudioClip, type LoweredClick, type LoweredComposition, type LoweredZoomSpan, MEDIA_ENTER_KINDS, MEDIA_EXIT_KINDS, MEDIA_FRAME_KEYS, MINIMAL_BAR_THEMES, MOTION_DELTA, MOTION_EASE, type Media, type MediaFrame, type MediaFrameKey, type MediaOverlayClip, type MediaSegment, type MicRms, type MinimalBarTheme, type Moment, type MomentKind, type MomentsOptions, type MotionKey, type MotionPose, type MotionPose3D, type MusicBedInput, type NormRect, OBJECT_DEFAULT_SCALE, OVERLAY_FONT_FACES, OVERLAY_LINE_HEIGHT, OVERLAY_MEDIA_DEFAULT_RADIUS, OVERLAY_MEDIA_DEFAULT_WIDTH, OVERLAY_MIN_DURATION, OVERLAY_SCALE_MAX, OVERLAY_SIZE_MAX, OVERLAY_SIZE_MIN, OVERLAY_TRANSITION_DUR, OVERLAY_Z, type ObjectAnimation, type ObjectAsset, type ObjectClip, type ObjectPrimitiveShape, type OverlayClip, type OverlayFontFace, type OverlayKind, type OverlayPresetStyle, type OverlayRect, type OverlayTransform, type OverlayTransition, PLATE_GROUND, PLAYBACK_ACTIVITY, PRIMARY_MEDIA, PROGRAM_RETIME, type PlanOptions, type PlanTiltOptions, type PlaneSize, type ProgramAnchorDoc, type ProgramTweenEdit, type ProjectDoc, type PxRect, REJECT_OVERLAP, REST_TILT_ID, type RecordingArtifact, type RecordingMeta, type Rect, type RejectedLane, type RejectedSpan, type ResolvedOverlayBox, type ResolvedOverlayStyle, SCENE_MOTION, SCENE_QUIET, SPEED_RATE_MAX, SPEED_RATE_MIN, SPEED_SPAN_MIN, STAGE_CLIP_PREFIX, STILL_DEFAULT, STUDIO_ENTRY_ID, STYLE_FIELDS, type SmoothOptions, type SmoothPoint, type SpeedParams, type SpeedSpan, type StepAnchor, type StepSpan, type StudioAudioPlan, type StudioDoc, type StudioEntry, type StyleField, TEXT3D_DEPTH_DEFAULT, TEXT3D_DEPTH_MAX, TEXT3D_DEPTH_MIN, TEXT_ENTER_KINDS, TEXT_EXIT_KINDS, TEXT_PRESETS, TILT_AUTO_DEAD_ZONE, TILT_AUTO_MIN, TILT_CHAIN_GAP, TILT_DEG_MAX, TILT_EASE, TILT_INTENSITY_MAX, TILT_PAN, TILT_PAN_EASE, TILT_RAMP_IN, TILT_RAMP_OUT, TILT_SPAN_MIN, TILT_UI_DEG_MAX, TRANSITION_SPEED_MULT, type TemplateAnchor, type Text3dMaterial, type TextFxDirection, type TextFxKind, type TextFxSpec, type TextFxUnit, type TextOverlayBox, type TextOverlayClip, type TextOverlayPreset, type TextOverlayStroke, type TiltPersonality, type TiltSpan, type TiltStyleName, type TranscriptSegment, type TransitionSpeed, WINDOW_FOCUS_MIN, ZOOM_CHAIN_GAP, ZOOM_EASE, ZOOM_LEVELS, ZOOM_LEVEL_MAX, ZOOM_LEVEL_MIN, ZOOM_PAN, ZOOM_PAN_EASE, ZOOM_RAMP_IN, ZOOM_RAMP_IN_OVERLAP, ZOOM_RAMP_OUT, ZOOM_SPAN_MIN, ZOOM_STYLES, ZOOM_STYLE_OPTIONS, type ZoomSpan, type ZoomStyleName, type ZoomStyleParams, type ZoomWindow, anchorKindOf, anchorSourceDuration, animStep, applyLook, applyTemplate, aspectRatioValue, audioLane, backdropMedia, buildDigest, camBubbleRect, camBubbleRectAt, camLane, camMoveLane, camRectFromPose, camRestPose, camTrackFromDoc, cardEnter, cardExit, cardFields, cardInset, cardPointToScreen, cardPoseTrack, clampCamFrac, clampCamSize, clampFocus, clampFreezeSeconds, clampSpeedRate, clampTiltDeg, clampZoomLevel, clipEnvelope, clipLength, clipsFrom, computeCardLayout, computeMicRms, computePeaks, copyLayout, copyStyle, cropBox, cursorIdleFade, deriveViewportCrop, destinationById, destinationsForChannel, docCardLayout, docFreezes, docMediaList, docOutputDuration, docRestTime, docStillTime, docToCropSpace, docToFullSpace, dropTemplate, duckCurve, effectiveSegments, endCardClips, enterKey, enterOf, entranceSeconds, envelopeAt, envelopeValueAt, exitKey, exitOf, exitSeconds, expandEndCard, expectedFrameSize, exportSizeFor, extractClicks, focusBounds, followFocusEvents, frameGeometry, freezeLane, freezeOutputExtents, hexToRgbTriplet, houseLook, idleGaps, idleKey, isLookKind, isMusicBed, isPlayback, isProgramDoc, isRecordingDoc, isRejected, isStageClip, isUnitStep, lastLayerEnd, layoutOf, levelForFocusFraction, lookFromBrand, lookKindForGround, lowerProgramDoc, lowerStudioDoc, lowerToComposition, mediaAtOutput, mediaDuration, mediaFrame, mediaKey, mediaSource, micLane, migrateHostedDoc, migrateMotion, momentsFromDoc, motionTrack, musicBedClip, nextMediaId, normalizeCaptureSpace, objectMotionBase, objectMotionPoseAt, objectsLane, outputDurationOf, outputEnd, outputRangeToSource, overlapFraction, overlayFaceFor, overlayFontFaces, overlayFontString, overlayFxSpec, overlayHit, overlayLines, overlayMotionBase, overlayMotionPoseAt, overlayRect, overlaysLane, ownFreezes, pageDisplayUrl, parsePoseId, pickStyle, placeFreezes, planAutoSpeed, planAutoTilt, planAutoZoom, planForDigest, planeSizeAtDepth, platformBarKind, programDuration, projectFromArtifact, ratedSegments, recommendedExportResolution, refillAudioBeds, rejectSpan, removeSourceRange, removeSpeedInRange, resolveExportSize, resolveOverlayBox, resolveOverlayStyle, resolveText3dAsset, resolveZoomStyle, restLeanOf, sameMedia, sceneChanges, scrollRuns, setSpeedInRange, smoothCursor, spanOutputExtent, speedLane, studioAudioPlan, studioEntry, studioLayerData, tiltLane, tiltTrackFromDoc, transitionMult, videoLane, voiceKey, withBackdrop, withFreezes, withHolds, withoutRejected, wrapProgramLength, zoomCoversRect, zoomLane, zoomSpanForRange, zoomTrackFromDoc, zoomWindow };
package/dist/index.js CHANGED
@@ -590,6 +590,50 @@ function nextMediaId(doc) {
590
590
  }
591
591
 
592
592
  // src/lower/motion.ts
593
+ function ownFreezes(doc) {
594
+ return docFreezes(doc).filter((f) => !f.from);
595
+ }
596
+ var STILL_DEFAULT = 0.5;
597
+ var HERO_BEAT = 0.25;
598
+ var OPENING_WINDOW = 3;
599
+ var OPENING_ENTER_SECONDS = 0.6;
600
+ var r3 = (v) => Math.round(v * 1e3) / 1e3;
601
+ function docStillTime(doc) {
602
+ const segs = docSegmentsOf(doc);
603
+ const rated = withFreezes(
604
+ splitBySpeed(segs, doc.speed ?? []),
605
+ docFreezes(doc)
606
+ );
607
+ const footage = totalDuration(rated);
608
+ const end = outputEnd(doc, footage);
609
+ const clampOut = (v) => Math.max(0, Math.min(end, v));
610
+ if (typeof doc.still === "number" && Number.isFinite(doc.still))
611
+ return r3(clampOut(doc.still));
612
+ if (!doc.endCard) {
613
+ const own = ownFreezes(doc);
614
+ if (own.length) {
615
+ const marks = freezeOutputExtents(
616
+ splitBySpeed(segs, doc.speed ?? []),
617
+ own
618
+ );
619
+ let rest = null;
620
+ for (const m of marks.values())
621
+ if (rest === null || m.t > rest) rest = m.t;
622
+ if (rest !== null && rest >= 0) return r3(clampOut(rest));
623
+ }
624
+ }
625
+ if (!(footage > 0)) return r3(clampOut(STILL_DEFAULT));
626
+ let hero = entranceSeconds(cardEnter(doc.frame));
627
+ for (const clip of doc.overlays ?? []) {
628
+ if (clip.start > OPENING_WINDOW) continue;
629
+ const step = enterOf(clip.anim);
630
+ const seconds = !step || step.kind === "none" ? 0 : Math.max(0, step.seconds ?? OPENING_ENTER_SECONDS);
631
+ hero = Math.max(hero, clip.start + seconds);
632
+ }
633
+ hero = Math.max(STILL_DEFAULT, hero + HERO_BEAT);
634
+ hero = Math.min(hero, Math.max(0, footage - 1 / 30));
635
+ return r3(clampOut(hero));
636
+ }
593
637
  function docRestTime(doc) {
594
638
  if (doc.endCard) return null;
595
639
  const freezes = docFreezes(doc);
@@ -6043,15 +6087,20 @@ function copyLayout(from, to, opts = {}) {
6043
6087
  const freeze = trailingFreeze(from);
6044
6088
  const last = doc.segments.at(-1);
6045
6089
  if (freeze && last) {
6046
- const own2 = (doc.freeze ?? []).filter(
6047
- (f) => Math.abs(f.at - last.out) > 1e-9
6048
- );
6090
+ const atEnd = (f) => Math.abs(f.at - last.out) <= 1e-9 && sameMedia(f.media, last.media);
6091
+ const own2 = (doc.freeze ?? []).filter((f) => !atEnd(f));
6092
+ const kept = (doc.freeze ?? []).find((f) => atEnd(f) && !f.from);
6049
6093
  const taken = new Set(own2.map((f) => f.id));
6050
6094
  let n = 0;
6051
6095
  while (taken.has(`f${n}`)) n++;
6052
6096
  doc.freeze = [
6053
6097
  ...own2,
6054
- { id: `f${n}`, at: last.out, seconds: freeze.seconds }
6098
+ kept ? { ...kept, seconds: Math.max(kept.seconds, freeze.seconds) } : {
6099
+ id: `f${n}`,
6100
+ at: last.out,
6101
+ seconds: freeze.seconds,
6102
+ ...last.media ? { media: last.media } : {}
6103
+ }
6055
6104
  ].sort((a, b) => a.at - b.at);
6056
6105
  doc.segments = doc.segments.map((s) => {
6057
6106
  if (s.hold === void 0) return s;
@@ -6095,15 +6144,21 @@ function applyTemplate(template, take, opts) {
6095
6144
  const tail = trailingFreeze(template);
6096
6145
  const lastSeg = doc.segments.at(-1);
6097
6146
  if (tail && opts.at === "end" && lastSeg) {
6098
- const own2 = (doc.freeze ?? []).filter(
6099
- (f) => Math.abs(f.at - lastSeg.out) > 1e-9
6100
- );
6147
+ const atEnd = (f) => Math.abs(f.at - lastSeg.out) <= 1e-9 && sameMedia(f.media, lastSeg.media);
6148
+ const kept = (doc.freeze ?? []).find((f) => atEnd(f) && !f.from);
6149
+ const own2 = (doc.freeze ?? []).filter((f) => !atEnd(f));
6101
6150
  const taken = new Set(own2.map((f) => f.id));
6102
6151
  let n = 0;
6103
6152
  while (taken.has(`f${n}`)) n++;
6104
6153
  doc.freeze = [
6105
6154
  ...own2,
6106
- { id: `f${n}`, at: lastSeg.out, seconds: tail.seconds, from }
6155
+ kept ? { ...kept, seconds: Math.max(kept.seconds, tail.seconds) } : {
6156
+ id: `f${n}`,
6157
+ at: lastSeg.out,
6158
+ seconds: tail.seconds,
6159
+ from,
6160
+ ...lastSeg.media ? { media: lastSeg.media } : {}
6161
+ }
6107
6162
  ].sort((a, b) => a.at - b.at);
6108
6163
  }
6109
6164
  const templateEnd = totalDuration4(ratedSegments(template));
@@ -8498,6 +8553,7 @@ export {
8498
8553
  SPEED_RATE_MIN,
8499
8554
  SPEED_SPAN_MIN,
8500
8555
  STAGE_CLIP_PREFIX,
8556
+ STILL_DEFAULT,
8501
8557
  STUDIO_ENTRY_ID,
8502
8558
  STYLE_FIELDS,
8503
8559
  TEXT3D_DEPTH_DEFAULT,
@@ -8580,6 +8636,7 @@ export {
8580
8636
  docMediaList,
8581
8637
  docOutputDuration,
8582
8638
  docRestTime,
8639
+ docStillTime,
8583
8640
  docToCropSpace,
8584
8641
  docToFullSpace,
8585
8642
  dropTemplate,
@@ -8653,6 +8710,7 @@ export {
8653
8710
  overlayMotionPoseAt,
8654
8711
  overlayRect,
8655
8712
  overlaysLane,
8713
+ ownFreezes,
8656
8714
  pageDisplayUrl,
8657
8715
  parsePoseId,
8658
8716
  pickStyle,