{"version":3,"file":"useTimelinePlayheadTime.mjs","names":[],"sources":["../../../src/hooks/playback/useTimelinePlayheadTime.ts"],"sourcesContent":["import type { TimelineEngine } from '@techsquidtv/canvas-timeline-core';\nimport { useTimelineExternalStore } from '#react/hooks/core/useTimelineExternalStore';\nimport type { RationalTime } from '@techsquidtv/canvas-timeline-utils';\n\nconst playheadTimeEvents = ['playhead:scrub', 'render'] as const;\nconst getTimelinePlayheadTime = (engine: TimelineEngine) => engine.playheadTime;\n\n/**\n * Hook to subscribe directly to playhead scrubbing changes.\n * Bypasses root-level context state updates to keep scrubbing high-performance.\n *\n * @returns The current RationalTime of the playhead.\n */\nexport function useTimelinePlayheadTime(): RationalTime {\n  return useTimelineExternalStore(playheadTimeEvents, getTimelinePlayheadTime);\n}\n"],"mappings":";;AAIA,MAAM,qBAAqB,CAAC,kBAAkB,QAAQ;AACtD,MAAM,2BAA2B,WAA2B,OAAO;;;;;;;AAQnE,SAAgB,0BAAwC;CACtD,OAAO,yBAAyB,oBAAoB,uBAAuB;AAC7E"}