@editframe/elements 0.37.3-beta → 0.38.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.
- package/dist/EF_FRAMEGEN.js +17 -14
- package/dist/EF_FRAMEGEN.js.map +1 -1
- package/dist/EF_RENDERING.js.map +1 -1
- package/dist/canvas/EFCanvas.d.ts +9 -2
- package/dist/canvas/EFCanvas.js +14 -4
- package/dist/canvas/EFCanvas.js.map +1 -1
- package/dist/canvas/EFCanvasItem.d.ts +2 -2
- package/dist/canvas/overlays/SelectionOverlay.d.ts +10 -2
- package/dist/canvas/overlays/SelectionOverlay.js +5 -12
- package/dist/canvas/overlays/SelectionOverlay.js.map +1 -1
- package/dist/canvas/overlays/overlayState.js.map +1 -1
- package/dist/canvas/selection/SelectionController.js.map +1 -1
- package/dist/elements/EFAudio.d.ts +1 -11
- package/dist/elements/EFAudio.js +2 -10
- package/dist/elements/EFAudio.js.map +1 -1
- package/dist/elements/EFCaptions.d.ts +5 -9
- package/dist/elements/EFCaptions.js +34 -11
- package/dist/elements/EFCaptions.js.map +1 -1
- package/dist/elements/EFImage.d.ts +10 -8
- package/dist/elements/EFImage.js +117 -32
- package/dist/elements/EFImage.js.map +1 -1
- package/dist/elements/EFMedia/AssetMediaEngine.js +2 -2
- package/dist/elements/EFMedia/AssetMediaEngine.js.map +1 -1
- package/dist/elements/EFMedia/BaseMediaEngine.js +15 -92
- package/dist/elements/EFMedia/BaseMediaEngine.js.map +1 -1
- package/dist/elements/EFMedia/BufferedSeekingInput.js +10 -11
- package/dist/elements/EFMedia/BufferedSeekingInput.js.map +1 -1
- package/dist/elements/EFMedia/{AssetIdMediaEngine.js → FileMediaEngine.js} +44 -24
- package/dist/elements/EFMedia/FileMediaEngine.js.map +1 -0
- package/dist/elements/EFMedia/JitMediaEngine.js +14 -13
- package/dist/elements/EFMedia/JitMediaEngine.js.map +1 -1
- package/dist/elements/EFMedia/shared/AudioSpanUtils.js +3 -3
- package/dist/elements/EFMedia/shared/AudioSpanUtils.js.map +1 -1
- package/dist/elements/EFMedia/shared/ThumbnailExtractor.js +12 -7
- package/dist/elements/EFMedia/shared/ThumbnailExtractor.js.map +1 -1
- package/dist/elements/EFMedia/shared/timeoutUtils.js +44 -0
- package/dist/elements/EFMedia/shared/timeoutUtils.js.map +1 -0
- package/dist/elements/EFMedia/videoTasks/MainVideoInputCache.js +1 -1
- package/dist/elements/EFMedia/videoTasks/MainVideoInputCache.js.map +1 -1
- package/dist/elements/EFMedia/videoTasks/ScrubInputCache.js +4 -4
- package/dist/elements/EFMedia/videoTasks/ScrubInputCache.js.map +1 -1
- package/dist/elements/EFMedia.d.ts +14 -8
- package/dist/elements/EFMedia.js +52 -19
- package/dist/elements/EFMedia.js.map +1 -1
- package/dist/elements/EFPanZoom.d.ts +2 -2
- package/dist/elements/EFPanZoom.js +1 -1
- package/dist/elements/EFPanZoom.js.map +1 -1
- package/dist/elements/EFSourceMixin.js +16 -8
- package/dist/elements/EFSourceMixin.js.map +1 -1
- package/dist/elements/EFSurface.d.ts +5 -8
- package/dist/elements/EFSurface.js +4 -43
- package/dist/elements/EFSurface.js.map +1 -1
- package/dist/elements/EFTemporal.d.ts +33 -8
- package/dist/elements/EFTemporal.js +92 -40
- package/dist/elements/EFTemporal.js.map +1 -1
- package/dist/elements/EFText.d.ts +3 -0
- package/dist/elements/EFText.js +54 -21
- package/dist/elements/EFText.js.map +1 -1
- package/dist/elements/EFTextSegment.js +8 -4
- package/dist/elements/EFTextSegment.js.map +1 -1
- package/dist/elements/EFTimegroup.d.ts +26 -43
- package/dist/elements/EFTimegroup.js +295 -314
- package/dist/elements/EFTimegroup.js.map +1 -1
- package/dist/elements/EFVideo.d.ts +44 -42
- package/dist/elements/EFVideo.js +259 -172
- package/dist/elements/EFVideo.js.map +1 -1
- package/dist/elements/EFWaveform.d.ts +3 -8
- package/dist/elements/EFWaveform.js +18 -13
- package/dist/elements/EFWaveform.js.map +1 -1
- package/dist/elements/ElementPositionInfo.js.map +1 -1
- package/dist/elements/FetchMixin.js.map +1 -1
- package/dist/elements/TargetController.d.ts +0 -3
- package/dist/elements/TargetController.js +12 -35
- package/dist/elements/TargetController.js.map +1 -1
- package/dist/elements/TimegroupController.js.map +1 -1
- package/dist/elements/cloneFactoryRegistry.d.ts +14 -0
- package/dist/elements/cloneFactoryRegistry.js +15 -0
- package/dist/elements/cloneFactoryRegistry.js.map +1 -0
- package/dist/elements/renderTemporalAudio.js +8 -6
- package/dist/elements/renderTemporalAudio.js.map +1 -1
- package/dist/elements/setupTemporalHierarchy.js +62 -0
- package/dist/elements/setupTemporalHierarchy.js.map +1 -0
- package/dist/elements/updateAnimations.js +62 -87
- package/dist/elements/updateAnimations.js.map +1 -1
- package/dist/getRenderInfo.d.ts +3 -2
- package/dist/getRenderInfo.js +20 -4
- package/dist/getRenderInfo.js.map +1 -1
- package/dist/gui/ContextMixin.js +68 -12
- package/dist/gui/ContextMixin.js.map +1 -1
- package/dist/gui/Controllable.js +1 -1
- package/dist/gui/Controllable.js.map +1 -1
- package/dist/gui/EFActiveRootTemporal.d.ts +2 -2
- package/dist/gui/EFActiveRootTemporal.js.map +1 -1
- package/dist/gui/EFControls.d.ts +2 -2
- package/dist/gui/EFControls.js +2 -2
- package/dist/gui/EFControls.js.map +1 -1
- package/dist/gui/EFDial.d.ts +2 -2
- package/dist/gui/EFDial.js +12 -9
- package/dist/gui/EFDial.js.map +1 -1
- package/dist/gui/EFFilmstrip.d.ts +2 -0
- package/dist/gui/EFFilmstrip.js +18 -10
- package/dist/gui/EFFilmstrip.js.map +1 -1
- package/dist/gui/EFFitScale.d.ts +28 -4
- package/dist/gui/EFFitScale.js +88 -26
- package/dist/gui/EFFitScale.js.map +1 -1
- package/dist/gui/EFFocusOverlay.d.ts +2 -2
- package/dist/gui/EFFocusOverlay.js +3 -3
- package/dist/gui/EFFocusOverlay.js.map +1 -1
- package/dist/gui/EFOverlayItem.d.ts +2 -2
- package/dist/gui/EFOverlayLayer.d.ts +2 -2
- package/dist/gui/EFPause.d.ts +2 -2
- package/dist/gui/EFPause.js +1 -1
- package/dist/gui/EFPlay.d.ts +2 -2
- package/dist/gui/EFPlay.js +1 -1
- package/dist/gui/EFPreview.js +1 -1
- package/dist/gui/EFResizableBox.d.ts +2 -2
- package/dist/gui/EFResizableBox.js +5 -5
- package/dist/gui/EFResizableBox.js.map +1 -1
- package/dist/gui/EFScrubber.d.ts +2 -2
- package/dist/gui/EFScrubber.js +8 -13
- package/dist/gui/EFScrubber.js.map +1 -1
- package/dist/gui/EFTimeDisplay.d.ts +6 -2
- package/dist/gui/EFTimeDisplay.js +25 -7
- package/dist/gui/EFTimeDisplay.js.map +1 -1
- package/dist/gui/EFTimelineRuler.d.ts +2 -2
- package/dist/gui/EFTimelineRuler.js +3 -3
- package/dist/gui/EFTimelineRuler.js.map +1 -1
- package/dist/gui/EFToggleLoop.d.ts +2 -2
- package/dist/gui/EFToggleLoop.js +1 -1
- package/dist/gui/EFTogglePlay.d.ts +2 -2
- package/dist/gui/EFTogglePlay.js +1 -1
- package/dist/gui/EFTransformHandles.d.ts +2 -2
- package/dist/gui/EFTransformHandles.js +6 -6
- package/dist/gui/EFTransformHandles.js.map +1 -1
- package/dist/gui/EFWorkbench.d.ts +40 -36
- package/dist/gui/EFWorkbench.js +436 -822
- package/dist/gui/EFWorkbench.js.map +1 -1
- package/dist/gui/FitScaleHelpers.js.map +1 -1
- package/dist/gui/PlaybackController.d.ts +3 -8
- package/dist/gui/PlaybackController.js +59 -56
- package/dist/gui/PlaybackController.js.map +1 -1
- package/dist/gui/TWMixin.js +1 -1
- package/dist/gui/TWMixin.js.map +1 -1
- package/dist/gui/TargetOrContextMixin.js +43 -6
- package/dist/gui/TargetOrContextMixin.js.map +1 -1
- package/dist/gui/ef-theme.css +136 -0
- package/dist/gui/hierarchy/EFHierarchy.d.ts +2 -2
- package/dist/gui/hierarchy/EFHierarchy.js +14 -24
- package/dist/gui/hierarchy/EFHierarchy.js.map +1 -1
- package/dist/gui/hierarchy/EFHierarchyItem.d.ts +3 -3
- package/dist/gui/hierarchy/EFHierarchyItem.js +22 -10
- package/dist/gui/hierarchy/EFHierarchyItem.js.map +1 -1
- package/dist/gui/icons.js.map +1 -1
- package/dist/gui/previewSettingsContext.d.ts +18 -0
- package/dist/gui/previewSettingsContext.js.map +1 -1
- package/dist/gui/theme.js +34 -0
- package/dist/gui/theme.js.map +1 -0
- package/dist/gui/timeline/EFTimeline.d.ts +2 -2
- package/dist/gui/timeline/EFTimeline.js +70 -52
- package/dist/gui/timeline/EFTimeline.js.map +1 -1
- package/dist/gui/timeline/EFTimelineRow.d.ts +5 -3
- package/dist/gui/timeline/EFTimelineRow.js +55 -32
- package/dist/gui/timeline/EFTimelineRow.js.map +1 -1
- package/dist/gui/timeline/TrimHandles.d.ts +23 -9
- package/dist/gui/timeline/TrimHandles.js +224 -51
- package/dist/gui/timeline/TrimHandles.js.map +1 -1
- package/dist/gui/timeline/flattenHierarchy.js.map +1 -1
- package/dist/gui/timeline/timelineEditingContext.d.ts +34 -0
- package/dist/gui/timeline/timelineEditingContext.js +24 -0
- package/dist/gui/timeline/timelineEditingContext.js.map +1 -0
- package/dist/gui/timeline/timelineStateContext.js.map +1 -1
- package/dist/gui/timeline/tracks/AudioTrack.js +1 -1
- package/dist/gui/timeline/tracks/AudioTrack.js.map +1 -1
- package/dist/gui/timeline/tracks/CaptionsTrack.d.ts +2 -3
- package/dist/gui/timeline/tracks/CaptionsTrack.js +17 -75
- package/dist/gui/timeline/tracks/CaptionsTrack.js.map +1 -1
- package/dist/gui/timeline/tracks/EFThumbnailStrip.d.ts +52 -0
- package/dist/gui/timeline/tracks/EFThumbnailStrip.js +596 -0
- package/dist/gui/timeline/tracks/EFThumbnailStrip.js.map +1 -0
- package/dist/gui/timeline/tracks/HTMLTrack.js.map +1 -1
- package/dist/gui/timeline/tracks/ImageTrack.js.map +1 -1
- package/dist/gui/timeline/tracks/TextTrack.d.ts +3 -2
- package/dist/gui/timeline/tracks/TextTrack.js +17 -43
- package/dist/gui/timeline/tracks/TextTrack.js.map +1 -1
- package/dist/gui/timeline/tracks/TimegroupTrack.d.ts +3 -4
- package/dist/gui/timeline/tracks/TimegroupTrack.js +33 -23
- package/dist/gui/timeline/tracks/TimegroupTrack.js.map +1 -1
- package/dist/gui/timeline/tracks/TrackItem.d.ts +7 -9
- package/dist/gui/timeline/tracks/TrackItem.js +18 -17
- package/dist/gui/timeline/tracks/TrackItem.js.map +1 -1
- package/dist/gui/timeline/tracks/VideoTrack.d.ts +3 -3
- package/dist/gui/timeline/tracks/VideoTrack.js +11 -14
- package/dist/gui/timeline/tracks/VideoTrack.js.map +1 -1
- package/dist/gui/timeline/tracks/WaveformTrack.js.map +1 -1
- package/dist/gui/timeline/tracks/renderTrackChildren.js.map +1 -1
- package/dist/gui/timeline/tracks/waveformUtils.js +1 -1
- package/dist/gui/timeline/tracks/waveformUtils.js.map +1 -1
- package/dist/gui/tree/EFTree.d.ts +2 -2
- package/dist/gui/tree/EFTree.js +8 -14
- package/dist/gui/tree/EFTree.js.map +1 -1
- package/dist/gui/tree/EFTreeItem.d.ts +2 -2
- package/dist/gui/tree/EFTreeItem.js +3 -3
- package/dist/gui/tree/EFTreeItem.js.map +1 -1
- package/dist/gui/tree/treeContext.js.map +1 -1
- package/dist/index.d.ts +10 -8
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/dist/node.d.ts +2 -2
- package/dist/node.js +2 -2
- package/dist/preview/AdaptiveResolutionTracker.js +3 -3
- package/dist/preview/AdaptiveResolutionTracker.js.map +1 -1
- package/dist/preview/FrameController.d.ts +2 -17
- package/dist/preview/FrameController.js +40 -63
- package/dist/preview/FrameController.js.map +1 -1
- package/dist/preview/QualityUpgradeScheduler.d.ts +76 -0
- package/dist/preview/QualityUpgradeScheduler.js +158 -0
- package/dist/preview/QualityUpgradeScheduler.js.map +1 -0
- package/dist/preview/RenderContext.d.ts +119 -1
- package/dist/preview/RenderContext.js +21 -3
- package/dist/preview/RenderContext.js.map +1 -1
- package/dist/preview/RenderProfiler.js.map +1 -1
- package/dist/preview/RenderStats.js +85 -0
- package/dist/preview/RenderStats.js.map +1 -0
- package/dist/preview/encoding/canvasEncoder.js +2 -52
- package/dist/preview/encoding/canvasEncoder.js.map +1 -1
- package/dist/preview/encoding/mainThreadEncoder.js.map +1 -1
- package/dist/preview/encoding/workerEncoder.js.map +1 -1
- package/dist/preview/logger.js.map +1 -1
- package/dist/preview/previewSettings.d.ts +34 -0
- package/dist/preview/previewSettings.js +29 -17
- package/dist/preview/previewSettings.js.map +1 -1
- package/dist/preview/previewTypes.js +4 -4
- package/dist/preview/previewTypes.js.map +1 -1
- package/dist/preview/renderElementToCanvas.d.ts +44 -0
- package/dist/preview/renderElementToCanvas.js +72 -0
- package/dist/preview/renderElementToCanvas.js.map +1 -0
- package/dist/preview/renderTimegroupToCanvas.d.ts +134 -32
- package/dist/preview/renderTimegroupToCanvas.js +321 -146
- package/dist/preview/renderTimegroupToCanvas.js.map +1 -1
- package/dist/preview/renderTimegroupToCanvas.types.d.ts +51 -0
- package/dist/preview/renderTimegroupToVideo.d.ts +20 -35
- package/dist/preview/renderTimegroupToVideo.js +94 -106
- package/dist/preview/renderTimegroupToVideo.js.map +1 -1
- package/dist/preview/renderTimegroupToVideo.types.d.ts +42 -0
- package/dist/preview/renderVideoToVideo.js +286 -0
- package/dist/preview/renderVideoToVideo.js.map +1 -0
- package/dist/preview/renderers.d.ts +56 -0
- package/dist/preview/renderers.js +13 -1
- package/dist/preview/renderers.js.map +1 -1
- package/dist/preview/rendering/ScaleConfig.js +74 -0
- package/dist/preview/rendering/ScaleConfig.js.map +1 -0
- package/dist/preview/rendering/inlineImages.d.ts +13 -0
- package/dist/preview/rendering/inlineImages.js +7 -44
- package/dist/preview/rendering/inlineImages.js.map +1 -1
- package/dist/preview/rendering/loadImage.d.ts +8 -0
- package/dist/preview/rendering/loadImage.js +22 -0
- package/dist/preview/rendering/loadImage.js.map +1 -0
- package/dist/preview/rendering/renderToImageNative.js +3 -3
- package/dist/preview/rendering/renderToImageNative.js.map +1 -1
- package/dist/preview/rendering/serializeTimelineDirect.js +224 -68
- package/dist/preview/rendering/serializeTimelineDirect.js.map +1 -1
- package/dist/preview/statsTrackingStrategy.js +1 -101
- package/dist/preview/statsTrackingStrategy.js.map +1 -1
- package/dist/preview/workers/WorkerPool.js +0 -1
- package/dist/preview/workers/WorkerPool.js.map +1 -1
- package/dist/preview/workers/encoderWorkerInline.js +21 -54
- package/dist/preview/workers/encoderWorkerInline.js.map +1 -1
- package/dist/render/EFRenderAPI.d.ts +2 -1
- package/dist/render/EFRenderAPI.js +12 -36
- package/dist/render/EFRenderAPI.js.map +1 -1
- package/dist/render/getRenderData.js +4 -4
- package/dist/render/getRenderData.js.map +1 -1
- package/dist/style.css +114 -163
- package/dist/transcoding/cache/RequestDeduplicator.js +1 -0
- package/dist/transcoding/cache/RequestDeduplicator.js.map +1 -1
- package/dist/transcoding/types/index.d.ts +1 -1
- package/dist/transcoding/utils/UrlGenerator.js +10 -3
- package/dist/transcoding/utils/UrlGenerator.js.map +1 -1
- package/dist/utils/LRUCache.js +1 -0
- package/dist/utils/LRUCache.js.map +1 -1
- package/dist/utils/frameTime.js +23 -1
- package/dist/utils/frameTime.js.map +1 -1
- package/package.json +45 -8
- package/scripts/build-css.js +8 -1
- package/test/setup.ts +0 -1
- package/test/useAssetMSW.ts +50 -0
- package/test/visualRegressionUtils.ts +23 -9
- package/tsdown.config.ts +6 -1
- package/dist/_virtual/rolldown_runtime.js +0 -27
- package/dist/elements/EFMedia/AssetIdMediaEngine.js.map +0 -1
- package/dist/elements/EFThumbnailStrip.d.ts +0 -167
- package/dist/elements/EFThumbnailStrip.js +0 -731
- package/dist/elements/EFThumbnailStrip.js.map +0 -1
- package/dist/elements/SessionThumbnailCache.js +0 -154
- package/dist/elements/SessionThumbnailCache.js.map +0 -1
- package/dist/node_modules/react/cjs/react-jsx-runtime.development.js +0 -688
- package/dist/node_modules/react/cjs/react-jsx-runtime.development.js.map +0 -1
- package/dist/node_modules/react/cjs/react.development.js +0 -1521
- package/dist/node_modules/react/cjs/react.development.js.map +0 -1
- package/dist/node_modules/react/index.js +0 -13
- package/dist/node_modules/react/index.js.map +0 -1
- package/dist/node_modules/react/jsx-runtime.js +0 -13
- package/dist/node_modules/react/jsx-runtime.js.map +0 -1
- package/dist/preview/encoding/types.d.ts +0 -1
- package/dist/preview/renderTimegroupPreview.js +0 -686
- package/dist/preview/renderTimegroupPreview.js.map +0 -1
- package/dist/preview/rendering/renderToImage.d.ts +0 -2
- package/dist/preview/rendering/renderToImage.js +0 -95
- package/dist/preview/rendering/renderToImage.js.map +0 -1
- package/dist/preview/rendering/renderToImageForeignObject.js +0 -163
- package/dist/preview/rendering/renderToImageForeignObject.js.map +0 -1
- package/dist/preview/rendering/renderToImageNative.d.ts +0 -1
- package/dist/preview/rendering/svgSerializer.js +0 -43
- package/dist/preview/rendering/svgSerializer.js.map +0 -1
- package/dist/preview/rendering/types.d.ts +0 -2
- package/dist/preview/thumbnailCacheSettings.js +0 -52
- package/dist/preview/thumbnailCacheSettings.js.map +0 -1
- package/dist/sandbox/PlaybackControls.d.ts +0 -1
- package/dist/sandbox/PlaybackControls.js +0 -10
- package/dist/sandbox/PlaybackControls.js.map +0 -1
- package/dist/sandbox/ScenarioRunner.d.ts +0 -1
- package/dist/sandbox/ScenarioRunner.js +0 -1
- package/dist/sandbox/defineSandbox.d.ts +0 -1
- package/dist/sandbox/index.d.ts +0 -3
- package/dist/sandbox/index.js +0 -2
- package/test/EFVideo.framegen.browsertest.ts +0 -80
- package/test/thumbnail-performance-test.html +0 -116
package/dist/style.css
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
/* Import theme tokens first so they're available to all components */
|
|
2
|
+
@import "./gui/ef-theme.css";
|
|
3
|
+
|
|
1
4
|
/* biome-ignore lint/suspicious/noUnknownAtRules: @tailwind is a valid Tailwind CSS directive */
|
|
2
|
-
*, ::before, ::after
|
|
5
|
+
*, ::before, ::after{
|
|
3
6
|
--tw-border-spacing-x: 0;
|
|
4
7
|
--tw-border-spacing-y: 0;
|
|
5
8
|
--tw-translate-x: 0;
|
|
@@ -52,7 +55,7 @@
|
|
|
52
55
|
--tw-contain-paint: ;
|
|
53
56
|
--tw-contain-style: ;
|
|
54
57
|
}
|
|
55
|
-
::backdrop
|
|
58
|
+
::backdrop{
|
|
56
59
|
--tw-border-spacing-x: 0;
|
|
57
60
|
--tw-border-spacing-y: 0;
|
|
58
61
|
--tw-translate-x: 0;
|
|
@@ -433,348 +436,296 @@ video {
|
|
|
433
436
|
display: none;
|
|
434
437
|
}
|
|
435
438
|
/* biome-ignore lint/suspicious/noUnknownAtRules: @tailwind is a valid Tailwind CSS directive */
|
|
436
|
-
.\!container
|
|
439
|
+
.\!container{
|
|
437
440
|
width: 100% !important;
|
|
438
441
|
}
|
|
439
|
-
.container
|
|
442
|
+
.container{
|
|
440
443
|
width: 100%;
|
|
441
444
|
}
|
|
442
|
-
@media (min-width: 640px)
|
|
443
|
-
.\!container
|
|
445
|
+
@media (min-width: 640px){
|
|
446
|
+
.\!container{
|
|
444
447
|
max-width: 640px !important;
|
|
445
448
|
}
|
|
446
|
-
.container
|
|
449
|
+
.container{
|
|
447
450
|
max-width: 640px;
|
|
448
451
|
}
|
|
449
452
|
}
|
|
450
|
-
@media (min-width: 768px)
|
|
451
|
-
.\!container
|
|
453
|
+
@media (min-width: 768px){
|
|
454
|
+
.\!container{
|
|
452
455
|
max-width: 768px !important;
|
|
453
456
|
}
|
|
454
|
-
.container
|
|
457
|
+
.container{
|
|
455
458
|
max-width: 768px;
|
|
456
459
|
}
|
|
457
460
|
}
|
|
458
|
-
@media (min-width: 1024px)
|
|
459
|
-
.\!container
|
|
461
|
+
@media (min-width: 1024px){
|
|
462
|
+
.\!container{
|
|
460
463
|
max-width: 1024px !important;
|
|
461
464
|
}
|
|
462
|
-
.container
|
|
465
|
+
.container{
|
|
463
466
|
max-width: 1024px;
|
|
464
467
|
}
|
|
465
468
|
}
|
|
466
|
-
@media (min-width: 1280px)
|
|
467
|
-
.\!container
|
|
469
|
+
@media (min-width: 1280px){
|
|
470
|
+
.\!container{
|
|
468
471
|
max-width: 1280px !important;
|
|
469
472
|
}
|
|
470
|
-
.container
|
|
473
|
+
.container{
|
|
471
474
|
max-width: 1280px;
|
|
472
475
|
}
|
|
473
476
|
}
|
|
474
|
-
@media (min-width: 1536px)
|
|
475
|
-
.\!container
|
|
477
|
+
@media (min-width: 1536px){
|
|
478
|
+
.\!container{
|
|
476
479
|
max-width: 1536px !important;
|
|
477
480
|
}
|
|
478
|
-
.container
|
|
481
|
+
.container{
|
|
479
482
|
max-width: 1536px;
|
|
480
483
|
}
|
|
481
484
|
}
|
|
482
485
|
/* biome-ignore lint/suspicious/noUnknownAtRules: @tailwind is a valid Tailwind CSS directive */
|
|
483
|
-
|
|
484
|
-
visibility: visible !important;
|
|
485
|
-
}
|
|
486
|
-
.visible {
|
|
486
|
+
.visible{
|
|
487
487
|
visibility: visible;
|
|
488
488
|
}
|
|
489
|
-
.invisible
|
|
489
|
+
.invisible{
|
|
490
490
|
visibility: hidden;
|
|
491
491
|
}
|
|
492
|
-
.collapse
|
|
492
|
+
.collapse{
|
|
493
493
|
visibility: collapse;
|
|
494
494
|
}
|
|
495
|
-
.static
|
|
495
|
+
.static{
|
|
496
496
|
position: static;
|
|
497
497
|
}
|
|
498
|
-
.fixed
|
|
498
|
+
.fixed{
|
|
499
499
|
position: fixed;
|
|
500
500
|
}
|
|
501
|
-
.absolute
|
|
501
|
+
.absolute{
|
|
502
502
|
position: absolute;
|
|
503
503
|
}
|
|
504
|
-
.relative
|
|
504
|
+
.relative{
|
|
505
505
|
position: relative;
|
|
506
506
|
}
|
|
507
|
-
.sticky
|
|
507
|
+
.sticky{
|
|
508
508
|
position: sticky;
|
|
509
509
|
}
|
|
510
|
-
.inset-0
|
|
510
|
+
.inset-0{
|
|
511
511
|
inset: 0px;
|
|
512
512
|
}
|
|
513
|
-
.left-0
|
|
513
|
+
.left-0{
|
|
514
514
|
left: 0px;
|
|
515
515
|
}
|
|
516
|
-
.
|
|
516
|
+
.right-0{
|
|
517
|
+
right: 0px;
|
|
518
|
+
}
|
|
519
|
+
.top-0{
|
|
517
520
|
top: 0px;
|
|
518
521
|
}
|
|
519
|
-
.
|
|
522
|
+
.top-8{
|
|
523
|
+
top: 2rem;
|
|
524
|
+
}
|
|
525
|
+
.isolate{
|
|
520
526
|
isolation: isolate;
|
|
521
527
|
}
|
|
522
|
-
.z-\[5\]
|
|
528
|
+
.z-\[5\]{
|
|
523
529
|
z-index: 5;
|
|
524
530
|
}
|
|
525
|
-
.mb-0
|
|
531
|
+
.mb-0{
|
|
526
532
|
margin-bottom: 0px;
|
|
527
533
|
}
|
|
528
|
-
.mb-\[1px\]
|
|
534
|
+
.mb-\[1px\]{
|
|
529
535
|
margin-bottom: 1px;
|
|
530
536
|
}
|
|
531
|
-
.block
|
|
537
|
+
.block{
|
|
532
538
|
display: block;
|
|
533
539
|
}
|
|
534
|
-
.inline-block
|
|
540
|
+
.inline-block{
|
|
535
541
|
display: inline-block;
|
|
536
542
|
}
|
|
537
|
-
.inline
|
|
543
|
+
.inline{
|
|
538
544
|
display: inline;
|
|
539
545
|
}
|
|
540
|
-
.flex
|
|
546
|
+
.flex{
|
|
541
547
|
display: flex;
|
|
542
548
|
}
|
|
543
|
-
.inline-flex
|
|
549
|
+
.inline-flex{
|
|
544
550
|
display: inline-flex;
|
|
545
551
|
}
|
|
546
|
-
.table
|
|
552
|
+
.table{
|
|
547
553
|
display: table;
|
|
548
554
|
}
|
|
549
|
-
.grid
|
|
555
|
+
.grid{
|
|
550
556
|
display: grid;
|
|
551
557
|
}
|
|
552
|
-
.inline-grid
|
|
558
|
+
.inline-grid{
|
|
553
559
|
display: inline-grid;
|
|
554
560
|
}
|
|
555
|
-
.contents
|
|
561
|
+
.contents{
|
|
556
562
|
display: contents;
|
|
557
563
|
}
|
|
558
|
-
.hidden
|
|
564
|
+
.hidden{
|
|
559
565
|
display: none;
|
|
560
566
|
}
|
|
561
|
-
.size-full
|
|
567
|
+
.size-full{
|
|
562
568
|
width: 100%;
|
|
563
569
|
height: 100%;
|
|
564
570
|
}
|
|
565
|
-
.h-\[1\.1rem\]
|
|
571
|
+
.h-\[1\.1rem\]{
|
|
566
572
|
height: 1.1rem;
|
|
567
573
|
}
|
|
568
|
-
.h-\[1080px\]
|
|
574
|
+
.h-\[1080px\]{
|
|
569
575
|
height: 1080px;
|
|
570
576
|
}
|
|
571
|
-
.h-\[
|
|
572
|
-
height: 200px;
|
|
573
|
-
}
|
|
574
|
-
.h-\[270px\] {
|
|
575
|
-
height: 270px;
|
|
576
|
-
}
|
|
577
|
-
.h-\[300px\] {
|
|
578
|
-
height: 300px;
|
|
579
|
-
}
|
|
580
|
-
.h-\[360px\] {
|
|
581
|
-
height: 360px;
|
|
582
|
-
}
|
|
583
|
-
.h-\[400px\] {
|
|
584
|
-
height: 400px;
|
|
585
|
-
}
|
|
586
|
-
.h-\[500px\] {
|
|
577
|
+
.h-\[500px\]{
|
|
587
578
|
height: 500px;
|
|
588
579
|
}
|
|
589
|
-
.h-\[5px\]
|
|
580
|
+
.h-\[5px\]{
|
|
590
581
|
height: 5px;
|
|
591
582
|
}
|
|
592
|
-
.h-
|
|
583
|
+
.h-\[calc\(50vh-4rem\)\]{
|
|
584
|
+
height: calc(50vh - 4rem);
|
|
585
|
+
}
|
|
586
|
+
.h-full{
|
|
593
587
|
height: 100%;
|
|
594
588
|
}
|
|
595
|
-
.w-1
|
|
589
|
+
.w-1{
|
|
596
590
|
width: 0.25rem;
|
|
597
591
|
}
|
|
598
|
-
.w-\[1000px\]
|
|
592
|
+
.w-\[1000px\]{
|
|
599
593
|
width: 1000px;
|
|
600
594
|
}
|
|
601
|
-
.w-\[
|
|
602
|
-
width: 1080px;
|
|
603
|
-
}
|
|
604
|
-
.w-\[1920px\] {
|
|
595
|
+
.w-\[1920px\]{
|
|
605
596
|
width: 1920px;
|
|
606
597
|
}
|
|
607
|
-
.w-\[
|
|
608
|
-
width: 200px;
|
|
609
|
-
}
|
|
610
|
-
.w-\[420px\] {
|
|
598
|
+
.w-\[420px\]{
|
|
611
599
|
width: 420px;
|
|
612
600
|
}
|
|
613
|
-
.w
|
|
614
|
-
width: 480px;
|
|
615
|
-
}
|
|
616
|
-
.w-\[600px\] {
|
|
617
|
-
width: 600px;
|
|
618
|
-
}
|
|
619
|
-
.w-\[640px\] {
|
|
620
|
-
width: 640px;
|
|
621
|
-
}
|
|
622
|
-
.w-full {
|
|
601
|
+
.w-full{
|
|
623
602
|
width: 100%;
|
|
624
603
|
}
|
|
625
|
-
.flex-
|
|
604
|
+
.flex-1{
|
|
605
|
+
flex: 1 1 0%;
|
|
606
|
+
}
|
|
607
|
+
.flex-shrink{
|
|
626
608
|
flex-shrink: 1;
|
|
627
609
|
}
|
|
628
|
-
.shrink
|
|
610
|
+
.shrink{
|
|
629
611
|
flex-shrink: 1;
|
|
630
612
|
}
|
|
631
|
-
.\!transform
|
|
613
|
+
.\!transform{
|
|
632
614
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)) !important;
|
|
633
615
|
}
|
|
634
|
-
.transform
|
|
616
|
+
.transform{
|
|
635
617
|
transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
|
|
636
618
|
}
|
|
637
|
-
.
|
|
638
|
-
cursor: grabbing;
|
|
639
|
-
}
|
|
640
|
-
.cursor-pointer {
|
|
641
|
-
cursor: pointer;
|
|
642
|
-
}
|
|
643
|
-
.resize {
|
|
619
|
+
.resize{
|
|
644
620
|
resize: both;
|
|
645
621
|
}
|
|
646
|
-
.flex-
|
|
647
|
-
flex-direction: row;
|
|
648
|
-
}
|
|
649
|
-
.flex-wrap {
|
|
622
|
+
.flex-wrap{
|
|
650
623
|
flex-wrap: wrap;
|
|
651
624
|
}
|
|
652
|
-
.items-center
|
|
625
|
+
.items-center{
|
|
653
626
|
align-items: center;
|
|
654
627
|
}
|
|
655
|
-
.
|
|
656
|
-
gap: 0.5rem;
|
|
657
|
-
}
|
|
658
|
-
.overflow-hidden {
|
|
628
|
+
.overflow-hidden{
|
|
659
629
|
overflow: hidden;
|
|
660
630
|
}
|
|
661
|
-
.overflow-visible
|
|
631
|
+
.overflow-visible{
|
|
662
632
|
overflow: visible;
|
|
663
633
|
}
|
|
664
|
-
.whitespace-nowrap
|
|
634
|
+
.whitespace-nowrap{
|
|
665
635
|
white-space: nowrap;
|
|
666
636
|
}
|
|
667
|
-
.text-nowrap
|
|
637
|
+
.text-nowrap{
|
|
668
638
|
text-wrap: nowrap;
|
|
669
639
|
}
|
|
670
|
-
.rounded
|
|
640
|
+
.rounded{
|
|
671
641
|
border-radius: 0.25rem;
|
|
672
642
|
}
|
|
673
|
-
.border
|
|
643
|
+
.border{
|
|
674
644
|
border-width: 1px;
|
|
675
645
|
}
|
|
676
|
-
.bg-
|
|
677
|
-
--tw-bg-opacity: 1;
|
|
678
|
-
background-color: rgb(0 0 0 / var(--tw-bg-opacity, 1));
|
|
679
|
-
}
|
|
680
|
-
.bg-lime-400 {
|
|
681
|
-
--tw-bg-opacity: 1;
|
|
682
|
-
background-color: rgb(163 230 53 / var(--tw-bg-opacity, 1));
|
|
683
|
-
}
|
|
684
|
-
.bg-slate-500 {
|
|
646
|
+
.bg-slate-500{
|
|
685
647
|
--tw-bg-opacity: 1;
|
|
686
648
|
background-color: rgb(100 116 139 / var(--tw-bg-opacity, 1));
|
|
687
649
|
}
|
|
688
|
-
.
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
}
|
|
692
|
-
.object-contain {
|
|
693
|
-
-o-object-fit: contain;
|
|
694
|
-
object-fit: contain;
|
|
650
|
+
.object-cover{
|
|
651
|
+
-o-object-fit: cover;
|
|
652
|
+
object-fit: cover;
|
|
695
653
|
}
|
|
696
|
-
.
|
|
697
|
-
padding: 1rem;
|
|
698
|
-
}
|
|
699
|
-
.px-0\.5 {
|
|
654
|
+
.px-0\.5{
|
|
700
655
|
padding-left: 0.125rem;
|
|
701
656
|
padding-right: 0.125rem;
|
|
702
657
|
}
|
|
703
|
-
.text-center
|
|
658
|
+
.text-center{
|
|
704
659
|
text-align: center;
|
|
705
660
|
}
|
|
706
|
-
.text
|
|
661
|
+
.text-3xl{
|
|
662
|
+
font-size: 1.875rem;
|
|
663
|
+
line-height: 2.25rem;
|
|
664
|
+
}
|
|
665
|
+
.text-\[8px\]{
|
|
707
666
|
font-size: 8px;
|
|
708
667
|
}
|
|
709
|
-
.text-sm
|
|
668
|
+
.text-sm{
|
|
710
669
|
font-size: 0.875rem;
|
|
711
670
|
line-height: 1.25rem;
|
|
712
671
|
}
|
|
713
|
-
.text-xs
|
|
672
|
+
.text-xs{
|
|
714
673
|
font-size: 0.75rem;
|
|
715
674
|
line-height: 1rem;
|
|
716
675
|
}
|
|
717
|
-
.font-bold
|
|
676
|
+
.font-bold{
|
|
718
677
|
font-weight: 700;
|
|
719
678
|
}
|
|
720
|
-
.uppercase
|
|
679
|
+
.uppercase{
|
|
721
680
|
text-transform: uppercase;
|
|
722
681
|
}
|
|
723
|
-
.capitalize
|
|
682
|
+
.capitalize{
|
|
724
683
|
text-transform: capitalize;
|
|
725
684
|
}
|
|
726
|
-
.italic
|
|
685
|
+
.italic{
|
|
727
686
|
font-style: italic;
|
|
728
687
|
}
|
|
729
|
-
.text-
|
|
730
|
-
--tw-text-opacity: 1;
|
|
731
|
-
color: rgb(0 0 0 / var(--tw-text-opacity, 1));
|
|
732
|
-
}
|
|
733
|
-
.text-green-200 {
|
|
734
|
-
--tw-text-opacity: 1;
|
|
735
|
-
color: rgb(187 247 208 / var(--tw-text-opacity, 1));
|
|
736
|
-
}
|
|
737
|
-
.text-green-900 {
|
|
688
|
+
.text-white{
|
|
738
689
|
--tw-text-opacity: 1;
|
|
739
|
-
color: rgb(
|
|
690
|
+
color: rgb(255 255 255 / var(--tw-text-opacity, 1));
|
|
740
691
|
}
|
|
741
|
-
.opacity-50
|
|
692
|
+
.opacity-50{
|
|
742
693
|
opacity: 0.5;
|
|
743
694
|
}
|
|
744
|
-
.shadow
|
|
695
|
+
.shadow{
|
|
745
696
|
--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
|
|
746
697
|
--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);
|
|
747
698
|
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
|
|
748
699
|
}
|
|
749
|
-
.outline
|
|
700
|
+
.outline{
|
|
750
701
|
outline-style: solid;
|
|
751
702
|
}
|
|
752
|
-
.blur
|
|
703
|
+
.blur{
|
|
753
704
|
--tw-blur: blur(8px);
|
|
754
705
|
filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
|
|
755
706
|
}
|
|
756
|
-
.
|
|
757
|
-
--tw-
|
|
707
|
+
.grayscale{
|
|
708
|
+
--tw-grayscale: grayscale(100%);
|
|
758
709
|
filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
|
|
759
710
|
}
|
|
760
|
-
.filter
|
|
711
|
+
.filter{
|
|
761
712
|
filter: var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow);
|
|
762
713
|
}
|
|
763
|
-
.backdrop-filter
|
|
714
|
+
.backdrop-filter{
|
|
764
715
|
backdrop-filter: var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);
|
|
765
716
|
}
|
|
766
|
-
.transition
|
|
717
|
+
.transition{
|
|
767
718
|
transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter;
|
|
768
719
|
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
769
720
|
transition-duration: 150ms;
|
|
770
721
|
}
|
|
771
|
-
.ease-in
|
|
722
|
+
.ease-in{
|
|
772
723
|
transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
|
|
773
724
|
}
|
|
774
|
-
.ease-in-out
|
|
725
|
+
.ease-in-out{
|
|
775
726
|
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
|
|
776
727
|
}
|
|
777
|
-
.ease-out
|
|
728
|
+
.ease-out{
|
|
778
729
|
transition-timing-function: cubic-bezier(0, 0, 0.2, 1);
|
|
779
730
|
}
|
|
780
731
|
|
|
@@ -17,6 +17,7 @@ var RequestDeduplicator = class {
|
|
|
17
17
|
if (existingRequest) return existingRequest;
|
|
18
18
|
const requestPromise = requestFactory();
|
|
19
19
|
this.pendingRequests.set(key, requestPromise);
|
|
20
|
+
requestPromise.catch(() => {});
|
|
20
21
|
try {
|
|
21
22
|
const result = await requestPromise;
|
|
22
23
|
this.pendingRequests.delete(key);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RequestDeduplicator.js","names":[],"sources":["../../../src/transcoding/cache/RequestDeduplicator.ts"],"sourcesContent":["/**\n * Request deduplication utility\n * Manages pending requests to prevent concurrent duplicate requests\n */\n\nexport class RequestDeduplicator {\n private pendingRequests = new Map<string, Promise<any>>();\n\n /**\n * Execute a request with deduplication\n * If a request with the same key is already pending, return the existing promise\n * Otherwise, execute the request factory and track the promise\n */\n async executeRequest<T>(\n key: string,\n requestFactory: () => Promise<T>,\n ): Promise<T> {\n // Check if there's already a pending request for this key\n const existingRequest = this.pendingRequests.get(key);\n if (existingRequest) {\n return existingRequest;\n }\n\n // Create and track the new request\n const requestPromise = requestFactory();\n this.pendingRequests.set(key, requestPromise);\n\n try {\n const result = await requestPromise;\n this.pendingRequests.delete(key);\n return result;\n } catch (error) {\n this.pendingRequests.delete(key);\n throw error;\n }\n }\n\n /**\n * Clear all pending requests (used in cache clearing)\n */\n clear(): void {\n this.pendingRequests.clear();\n }\n\n /**\n * Get number of pending requests\n */\n getPendingCount(): number {\n return this.pendingRequests.size;\n }\n\n /**\n * Check if a request is pending\n */\n isPending(key: string): boolean {\n return this.pendingRequests.has(key);\n }\n\n /**\n * Get all pending request keys\n */\n getPendingKeys(): string[] {\n return Array.from(this.pendingRequests.keys());\n }\n}\n"],"mappings":";;;;;AAKA,IAAa,sBAAb,MAAiC;;yCACL,IAAI,KAA2B;;;;;;;CAOzD,MAAM,eACJ,KACA,gBACY;EAEZ,MAAM,kBAAkB,KAAK,gBAAgB,IAAI,IAAI;AACrD,MAAI,gBACF,QAAO;EAIT,MAAM,iBAAiB,gBAAgB;AACvC,OAAK,gBAAgB,IAAI,KAAK,eAAe;
|
|
1
|
+
{"version":3,"file":"RequestDeduplicator.js","names":[],"sources":["../../../src/transcoding/cache/RequestDeduplicator.ts"],"sourcesContent":["/**\n * Request deduplication utility\n * Manages pending requests to prevent concurrent duplicate requests\n */\n\nexport class RequestDeduplicator {\n private pendingRequests = new Map<string, Promise<any>>();\n\n /**\n * Execute a request with deduplication\n * If a request with the same key is already pending, return the existing promise\n * Otherwise, execute the request factory and track the promise\n */\n async executeRequest<T>(\n key: string,\n requestFactory: () => Promise<T>,\n ): Promise<T> {\n // Check if there's already a pending request for this key\n const existingRequest = this.pendingRequests.get(key);\n if (existingRequest) {\n return existingRequest;\n }\n\n // Create and track the new request\n const requestPromise = requestFactory();\n this.pendingRequests.set(key, requestPromise);\n\n // Prevent unhandled rejection on the raw factory promise. Chrome's V8\n // may detect a rejection as unhandled if no synchronous .catch() is\n // attached before any microtask boundary, even when the promise is\n // currently being await-ed. The error still propagates via the try/catch.\n requestPromise.catch(() => {});\n\n try {\n const result = await requestPromise;\n this.pendingRequests.delete(key);\n return result;\n } catch (error) {\n this.pendingRequests.delete(key);\n throw error;\n }\n }\n\n /**\n * Clear all pending requests (used in cache clearing)\n */\n clear(): void {\n this.pendingRequests.clear();\n }\n\n /**\n * Get number of pending requests\n */\n getPendingCount(): number {\n return this.pendingRequests.size;\n }\n\n /**\n * Check if a request is pending\n */\n isPending(key: string): boolean {\n return this.pendingRequests.has(key);\n }\n\n /**\n * Get all pending request keys\n */\n getPendingKeys(): string[] {\n return Array.from(this.pendingRequests.keys());\n }\n}\n"],"mappings":";;;;;AAKA,IAAa,sBAAb,MAAiC;;yCACL,IAAI,KAA2B;;;;;;;CAOzD,MAAM,eACJ,KACA,gBACY;EAEZ,MAAM,kBAAkB,KAAK,gBAAgB,IAAI,IAAI;AACrD,MAAI,gBACF,QAAO;EAIT,MAAM,iBAAiB,gBAAgB;AACvC,OAAK,gBAAgB,IAAI,KAAK,eAAe;AAM7C,iBAAe,YAAY,GAAG;AAE9B,MAAI;GACF,MAAM,SAAS,MAAM;AACrB,QAAK,gBAAgB,OAAO,IAAI;AAChC,UAAO;WACA,OAAO;AACd,QAAK,gBAAgB,OAAO,IAAI;AAChC,SAAM;;;;;;CAOV,QAAc;AACZ,OAAK,gBAAgB,OAAO;;;;;CAM9B,kBAA0B;AACxB,SAAO,KAAK,gBAAgB;;;;;CAM9B,UAAU,KAAsB;AAC9B,SAAO,KAAK,gBAAgB,IAAI,IAAI;;;;;CAMtC,iBAA2B;AACzB,SAAO,MAAM,KAAK,KAAK,gBAAgB,MAAM,CAAC"}
|
|
@@ -40,7 +40,7 @@ interface MediaEngine {
|
|
|
40
40
|
id?: RenditionId;
|
|
41
41
|
trackId: number | undefined;
|
|
42
42
|
src: string;
|
|
43
|
-
}, signal
|
|
43
|
+
}, signal: AbortSignal) => Promise<ArrayBuffer>;
|
|
44
44
|
computeSegmentId: (desiredSeekTimeMs: number, rendition: MediaRendition) => number | undefined;
|
|
45
45
|
/**
|
|
46
46
|
* Get the video rendition if available, otherwise return undefined.
|
|
@@ -15,10 +15,17 @@ var UrlGenerator = class {
|
|
|
15
15
|
generateSegmentUrl(segmentId, renditionId, metadata) {
|
|
16
16
|
const audioRendition = metadata.audioRendition;
|
|
17
17
|
const videoRendition = metadata.videoRendition;
|
|
18
|
-
|
|
18
|
+
let rendition;
|
|
19
|
+
if (renditionId === "audio") rendition = audioRendition;
|
|
20
|
+
else rendition = videoRendition;
|
|
19
21
|
if (!rendition) {
|
|
20
|
-
console.error("Rendition not found",
|
|
21
|
-
|
|
22
|
+
console.error("Rendition not found", {
|
|
23
|
+
renditionId,
|
|
24
|
+
hasAudio: !!audioRendition,
|
|
25
|
+
hasVideo: !!videoRendition,
|
|
26
|
+
metadata
|
|
27
|
+
});
|
|
28
|
+
throw new Error(`Rendition ${renditionId} not found (hasAudio=${!!audioRendition}, hasVideo=${!!videoRendition})`);
|
|
22
29
|
}
|
|
23
30
|
return (segmentId === "init" ? metadata.templates.initSegment : metadata.templates.mediaSegment).replace("{rendition}", renditionId).replace("{segmentId}", segmentId.toString()).replace("{src}", metadata.src).replace("{trackId}", rendition.trackId?.toString() ?? "");
|
|
24
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UrlGenerator.js","names":["baseUrl: () => string"],"sources":["../../../src/transcoding/utils/UrlGenerator.ts"],"sourcesContent":["/**\n * URL generation utilities for transcoding endpoints\n */\n\nimport type { RenditionId } from \"../types/index.js\";\nimport type { MediaEngine } from \"../types/index.ts\";\n\nexport class UrlGenerator {\n constructor(private baseUrl: () => string) {}\n\n /**\n * Get the base URL for constructing absolute URLs\n */\n getBaseUrl(): string {\n return this.baseUrl();\n }\n\n /**\n * Generate video segment URL\n */\n generateSegmentUrl(\n segmentId: \"init\" | number,\n renditionId: RenditionId,\n metadata: MediaEngine,\n ): string {\n const audioRendition = metadata.audioRendition;\n const videoRendition = metadata.videoRendition;\n
|
|
1
|
+
{"version":3,"file":"UrlGenerator.js","names":["baseUrl: () => string"],"sources":["../../../src/transcoding/utils/UrlGenerator.ts"],"sourcesContent":["/**\n * URL generation utilities for transcoding endpoints\n */\n\nimport type { RenditionId } from \"../types/index.js\";\nimport type { MediaEngine } from \"../types/index.ts\";\n\nexport class UrlGenerator {\n constructor(private baseUrl: () => string) {}\n\n /**\n * Get the base URL for constructing absolute URLs\n */\n getBaseUrl(): string {\n return this.baseUrl();\n }\n\n /**\n * Generate video segment URL\n */\n generateSegmentUrl(\n segmentId: \"init\" | number,\n renditionId: RenditionId,\n metadata: MediaEngine,\n ): string {\n // Determine which rendition to use based on renditionId\n // Audio renditions: \"audio\"\n // Video renditions: \"high\", \"scrub\", \"low\", \"medium\", etc.\n const audioRendition = metadata.audioRendition;\n const videoRendition = metadata.videoRendition;\n\n let rendition;\n if (renditionId === \"audio\") {\n rendition = audioRendition;\n } else {\n // For all other rendition IDs (high, scrub, low, medium), use video rendition\n rendition = videoRendition;\n }\n\n if (!rendition) {\n console.error(\"Rendition not found\", {\n renditionId,\n hasAudio: !!audioRendition,\n hasVideo: !!videoRendition,\n metadata,\n });\n throw new Error(\n `Rendition ${renditionId} not found (hasAudio=${!!audioRendition}, hasVideo=${!!videoRendition})`,\n );\n }\n\n const template =\n segmentId === \"init\"\n ? metadata.templates.initSegment\n : metadata.templates.mediaSegment;\n return template\n .replace(\"{rendition}\", renditionId)\n .replace(\"{segmentId}\", segmentId.toString())\n .replace(\"{src}\", metadata.src)\n .replace(\"{trackId}\", rendition.trackId?.toString() ?? \"\");\n }\n\n /**\n * Generate init segment URL\n */\n generateInitSegmentUrl(mediaUrl: string, rendition: string): string {\n return `${this.baseUrl()}/api/v1/transcode/${rendition}/init.mp4?url=${encodeURIComponent(mediaUrl)}`;\n }\n\n /**\n * Generate manifest URL\n */\n generateManifestUrl(mediaUrl: string): string {\n return `${this.baseUrl()}/api/v1/transcode/manifest.json?url=${encodeURIComponent(mediaUrl)}`;\n }\n\n /**\n * Generate track fragment index URL using production API format\n * @deprecated Use MD5-based URL generation in AssetMediaEngine.fetch() instead\n */\n generateTrackFragmentIndexUrl(mediaUrl: string): string {\n // Normalize the path: remove leading slash and any double slashes\n let normalizedSrc = mediaUrl.startsWith(\"/\") ? mediaUrl.slice(1) : mediaUrl;\n // Remove any remaining leading slashes (handles cases like \"//assets/video.mp4\")\n normalizedSrc = normalizedSrc.replace(/^\\/+/, \"\");\n // Legacy format - kept for backward compatibility but should not be used\n return `@ef-track-fragment-index/${normalizedSrc}`;\n }\n\n /**\n * Generate quality presets URL\n */\n generatePresetsUrl(): string {\n return `${this.baseUrl()}/api/v1/transcode/presets`;\n }\n}\n"],"mappings":";AAOA,IAAa,eAAb,MAA0B;CACxB,YAAY,AAAQA,SAAuB;EAAvB;;;;;CAKpB,aAAqB;AACnB,SAAO,KAAK,SAAS;;;;;CAMvB,mBACE,WACA,aACA,UACQ;EAIR,MAAM,iBAAiB,SAAS;EAChC,MAAM,iBAAiB,SAAS;EAEhC,IAAI;AACJ,MAAI,gBAAgB,QAClB,aAAY;MAGZ,aAAY;AAGd,MAAI,CAAC,WAAW;AACd,WAAQ,MAAM,uBAAuB;IACnC;IACA,UAAU,CAAC,CAAC;IACZ,UAAU,CAAC,CAAC;IACZ;IACD,CAAC;AACF,SAAM,IAAI,MACR,aAAa,YAAY,uBAAuB,CAAC,CAAC,eAAe,aAAa,CAAC,CAAC,eAAe,GAChG;;AAOH,UAHE,cAAc,SACV,SAAS,UAAU,cACnB,SAAS,UAAU,cAEtB,QAAQ,eAAe,YAAY,CACnC,QAAQ,eAAe,UAAU,UAAU,CAAC,CAC5C,QAAQ,SAAS,SAAS,IAAI,CAC9B,QAAQ,aAAa,UAAU,SAAS,UAAU,IAAI,GAAG;;;;;CAM9D,uBAAuB,UAAkB,WAA2B;AAClE,SAAO,GAAG,KAAK,SAAS,CAAC,oBAAoB,UAAU,gBAAgB,mBAAmB,SAAS;;;;;CAMrG,oBAAoB,UAA0B;AAC5C,SAAO,GAAG,KAAK,SAAS,CAAC,sCAAsC,mBAAmB,SAAS;;;;;;CAO7F,8BAA8B,UAA0B;EAEtD,IAAI,gBAAgB,SAAS,WAAW,IAAI,GAAG,SAAS,MAAM,EAAE,GAAG;AAEnE,kBAAgB,cAAc,QAAQ,QAAQ,GAAG;AAEjD,SAAO,4BAA4B;;;;;CAMrC,qBAA6B;AAC3B,SAAO,GAAG,KAAK,SAAS,CAAC"}
|
package/dist/utils/LRUCache.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LRUCache.js","names":[],"sources":["../../src/utils/LRUCache.ts"],"sourcesContent":["/**\n * A simple LRU (Least Recently Used) cache implementation\n */\nexport class LRUCache<K, V> {\n private cache = new Map<K, V>();\n private readonly maxSize: number;\n\n constructor(maxSize: number) {\n this.maxSize = maxSize;\n }\n\n get(key: K): V | undefined {\n const value = this.cache.get(key);\n if (value) {\n // Refresh position by removing and re-adding\n this.cache.delete(key);\n this.cache.set(key, value);\n }\n return value;\n }\n\n set(key: K, value: V): void {\n if (this.cache.has(key)) {\n this.cache.delete(key);\n } else if (this.cache.size >= this.maxSize) {\n // Remove oldest entry (first item in map)\n const firstKey = this.cache.keys().next().value;\n if (firstKey) {\n this.cache.delete(firstKey);\n }\n }\n this.cache.set(key, value);\n }\n\n has(key: K): boolean {\n return this.cache.has(key);\n }\n\n delete(key: K): boolean {\n return this.cache.delete(key);\n }\n\n clear(): void {\n this.cache.clear();\n }\n\n get size(): number {\n return this.cache.size;\n }\n}\n\n/**\n * Size-aware LRU cache that tracks memory usage in bytes\n * Evicts entries when total size exceeds the maximum\n */\nexport class SizeAwareLRUCache<K> {\n private cache = new Map<K, Promise<ArrayBuffer>>();\n private sizes = new Map<K, number>();\n private currentSize = 0;\n private readonly maxSizeBytes: number;\n\n constructor(maxSizeBytes: number) {\n this.maxSizeBytes = maxSizeBytes;\n }\n\n get(key: K): Promise<ArrayBuffer> | undefined {\n const value = this.cache.get(key);\n if (value) {\n // Refresh position by removing and re-adding\n const size = this.sizes.get(key) || 0;\n this.cache.delete(key);\n this.cache.set(key, value);\n this.sizes.delete(key);\n this.sizes.set(key, size);\n }\n return value;\n }\n\n set(key: K, value: Promise<ArrayBuffer>): void {\n // If key already exists, remove it first\n if (this.cache.has(key)) {\n const oldSize = this.sizes.get(key) || 0;\n this.currentSize -= oldSize;\n this.cache.delete(key);\n this.sizes.delete(key);\n }\n\n // Track the size when the promise resolves\n const sizeTrackingPromise = value\n .then((buffer) => {\n const bufferSize = buffer.byteLength;\n this.sizes.set(key, bufferSize);\n this.currentSize += bufferSize;\n\n // Evict oldest entries if we exceed the size limit\n this.evictIfNecessary();\n\n return buffer;\n })\n .catch((error) => {\n // If the promise fails, clean up the entry\n this.cache.delete(key);\n this.sizes.delete(key);\n throw error;\n });\n\n this.cache.set(key, sizeTrackingPromise);\n }\n\n private evictIfNecessary(): void {\n while (this.currentSize > this.maxSizeBytes && this.cache.size > 0) {\n // Remove oldest entry (first item in map)\n const firstKey = this.cache.keys().next().value;\n if (firstKey) {\n const size = this.sizes.get(firstKey) || 0;\n this.currentSize -= size;\n this.cache.delete(firstKey);\n this.sizes.delete(firstKey);\n } else {\n break;\n }\n }\n }\n\n has(key: K): boolean {\n return this.cache.has(key);\n }\n\n delete(key: K): boolean {\n const size = this.sizes.get(key) || 0;\n this.currentSize -= size;\n this.sizes.delete(key);\n return this.cache.delete(key);\n }\n\n clear(): void {\n this.cache.clear();\n this.sizes.clear();\n this.currentSize = 0;\n }\n\n get size(): number {\n return this.cache.size;\n }\n\n get currentSizeBytes(): number {\n return this.currentSize;\n }\n\n get maxSize(): number {\n return this.maxSizeBytes;\n }\n}\n\n/**\n * Red-Black Tree node colors\n */\nenum Color {\n RED = \"RED\",\n BLACK = \"BLACK\",\n}\n\n/**\n * Red-Black Tree node for ordered key storage\n */\nclass RBTreeNode<K> {\n constructor(\n public key: K,\n public color: Color = Color.RED,\n public left: RBTreeNode<K> | null = null,\n public right: RBTreeNode<K> | null = null,\n public parent: RBTreeNode<K> | null = null,\n ) {}\n}\n\n/**\n * Red-Black Tree implementation for O(log n) operations\n * Supports insert, delete, search, range queries, and nearest neighbor\n */\nclass RedBlackTree<K> {\n private root: RBTreeNode<K> | null = null;\n private readonly compareFn: (a: K, b: K) => number;\n\n constructor(compareFn: (a: K, b: K) => number) {\n this.compareFn = compareFn;\n }\n\n insert(key: K): void {\n const node = new RBTreeNode(key);\n\n if (!this.root) {\n this.root = node;\n node.color = Color.BLACK;\n return;\n }\n\n this.insertNode(node);\n this.fixInsert(node);\n }\n\n delete(key: K): boolean {\n const node = this.findNode(key);\n if (!node) return false;\n\n this.deleteNode(node);\n return true;\n }\n\n find(key: K): K | null {\n const node = this.findNode(key);\n return node ? node.key : null;\n }\n\n findNearestInRange(center: K, distance: K): K[] {\n // Calculate the range bounds\n const start = this.subtractDistance(center, distance);\n const end = this.addDistance(center, distance);\n\n // Use existing range search (O(log n + k))\n return this.findRange(start, end);\n }\n\n private subtractDistance(center: K, distance: K): K {\n if (typeof center === \"number\" && typeof distance === \"number\") {\n return (center - distance) as K;\n }\n\n // For strings, we can't easily subtract distance, so just return center\n // This means string searches will be exact matches only\n return center;\n }\n\n private addDistance(center: K, distance: K): K {\n if (typeof center === \"number\" && typeof distance === \"number\") {\n return (center + distance) as K;\n }\n\n // For strings, we can't easily add distance, so just return center\n // This means string searches will be exact matches only\n return center;\n }\n\n findRange(start: K, end: K): K[] {\n const result: K[] = [];\n this.inorderRange(this.root, start, end, result);\n return result;\n }\n\n getAllSorted(): K[] {\n const result: K[] = [];\n this.inorder(this.root, result);\n return result;\n }\n\n private findNode(key: K): RBTreeNode<K> | null {\n let current = this.root;\n\n while (current) {\n const cmp = this.compareFn(key, current.key);\n if (cmp === 0) return current;\n current = cmp < 0 ? current.left : current.right;\n }\n\n return null;\n }\n\n private insertNode(node: RBTreeNode<K>): void {\n let parent = null;\n let current = this.root;\n\n while (current) {\n parent = current;\n const cmp = this.compareFn(node.key, current.key);\n current = cmp < 0 ? current.left : current.right;\n }\n\n node.parent = parent;\n if (!parent) {\n this.root = node;\n } else {\n const cmp = this.compareFn(node.key, parent.key);\n if (cmp < 0) {\n parent.left = node;\n } else {\n parent.right = node;\n }\n }\n }\n\n private fixInsert(node: RBTreeNode<K>): void {\n while (node.parent && node.parent.color === Color.RED) {\n if (node.parent === node.parent.parent?.left) {\n const uncle = node.parent.parent.right;\n\n if (uncle?.color === Color.RED) {\n node.parent.color = Color.BLACK;\n uncle.color = Color.BLACK;\n node.parent.parent.color = Color.RED;\n node = node.parent.parent;\n } else {\n if (node === node.parent.right) {\n node = node.parent;\n this.rotateLeft(node);\n }\n\n if (node.parent) {\n node.parent.color = Color.BLACK;\n if (node.parent.parent) {\n node.parent.parent.color = Color.RED;\n this.rotateRight(node.parent.parent);\n }\n }\n }\n } else {\n const uncle = node.parent.parent?.left;\n\n if (uncle?.color === Color.RED) {\n node.parent.color = Color.BLACK;\n uncle.color = Color.BLACK;\n if (node.parent.parent) {\n node.parent.parent.color = Color.RED;\n node = node.parent.parent;\n }\n } else {\n if (node === node.parent.left) {\n node = node.parent;\n this.rotateRight(node);\n }\n\n if (node.parent) {\n node.parent.color = Color.BLACK;\n if (node.parent.parent) {\n node.parent.parent.color = Color.RED;\n this.rotateLeft(node.parent.parent);\n }\n }\n }\n }\n }\n\n if (this.root) {\n this.root.color = Color.BLACK;\n }\n }\n\n private deleteNode(node: RBTreeNode<K>): void {\n let y = node;\n let yOriginalColor = y.color;\n let x: RBTreeNode<K> | null;\n\n if (!node.left) {\n x = node.right;\n this.transplant(node, node.right);\n } else if (!node.right) {\n x = node.left;\n this.transplant(node, node.left);\n } else {\n y = this.minimum(node.right);\n yOriginalColor = y.color;\n x = y.right;\n\n if (y.parent === node) {\n if (x) x.parent = y;\n } else {\n this.transplant(y, y.right);\n y.right = node.right;\n if (y.right) y.right.parent = y;\n }\n\n this.transplant(node, y);\n y.left = node.left;\n if (y.left) y.left.parent = y;\n y.color = node.color;\n }\n\n if (yOriginalColor === Color.BLACK && x) {\n this.fixDelete(x);\n }\n }\n\n private fixDelete(node: RBTreeNode<K>): void {\n while (node !== this.root && node.color === Color.BLACK) {\n if (node === node.parent?.left) {\n let sibling = node.parent.right;\n\n if (sibling?.color === Color.RED) {\n sibling.color = Color.BLACK;\n node.parent.color = Color.RED;\n this.rotateLeft(node.parent);\n sibling = node.parent.right;\n }\n\n if (\n sibling?.left?.color !== Color.RED &&\n sibling?.right?.color !== Color.RED\n ) {\n if (sibling) {\n sibling.color = Color.RED;\n }\n node = node.parent;\n } else {\n if (sibling?.right?.color !== Color.RED) {\n if (sibling.left) sibling.left.color = Color.BLACK;\n sibling.color = Color.RED;\n this.rotateRight(sibling);\n sibling = node.parent.right;\n }\n\n if (sibling) {\n sibling.color = node.parent.color;\n node.parent.color = Color.BLACK;\n if (sibling.right) sibling.right.color = Color.BLACK;\n this.rotateLeft(node.parent);\n }\n if (!this.root) {\n throw new Error(\"Root is null\");\n }\n node = this.root;\n }\n } else {\n let sibling = node.parent?.left;\n\n if (sibling?.color === Color.RED) {\n sibling.color = Color.BLACK;\n if (node.parent) node.parent.color = Color.RED;\n if (node.parent) this.rotateRight(node.parent);\n sibling = node.parent?.left;\n }\n\n if (\n sibling?.right?.color !== Color.RED &&\n sibling?.left?.color !== Color.RED\n ) {\n if (sibling) {\n sibling.color = Color.RED;\n }\n if (node.parent === null) {\n throw new Error(\"Node parent is null\");\n }\n node = node.parent;\n } else {\n if (sibling?.left?.color !== Color.RED) {\n if (sibling.right) sibling.right.color = Color.BLACK;\n sibling.color = Color.RED;\n this.rotateLeft(sibling);\n sibling = node.parent?.left;\n }\n\n if (sibling) {\n sibling.color = node.parent?.color || Color.BLACK;\n if (node.parent) node.parent.color = Color.BLACK;\n if (sibling.left) sibling.left.color = Color.BLACK;\n if (node.parent) this.rotateRight(node.parent);\n }\n if (!this.root) {\n throw new Error(\"Root is null\");\n }\n node = this.root;\n }\n }\n }\n\n node.color = Color.BLACK;\n }\n\n private rotateLeft(node: RBTreeNode<K>): void {\n const rightChild = node.right;\n if (!rightChild) {\n throw new Error(\"Right child is null\");\n }\n node.right = rightChild.left;\n\n if (rightChild.left) {\n rightChild.left.parent = node;\n }\n\n rightChild.parent = node.parent;\n\n if (!node.parent) {\n this.root = rightChild;\n } else if (node === node.parent.left) {\n node.parent.left = rightChild;\n } else {\n node.parent.right = rightChild;\n }\n\n rightChild.left = node;\n node.parent = rightChild;\n }\n\n private rotateRight(node: RBTreeNode<K>): void {\n const leftChild = node.left;\n if (!leftChild) {\n throw new Error(\"Left child is null\");\n }\n node.left = leftChild.right;\n\n if (leftChild.right) {\n leftChild.right.parent = node;\n }\n\n leftChild.parent = node.parent;\n\n if (!node.parent) {\n this.root = leftChild;\n } else if (node === node.parent.right) {\n node.parent.right = leftChild;\n } else {\n node.parent.left = leftChild;\n }\n\n leftChild.right = node;\n node.parent = leftChild;\n }\n\n private transplant(u: RBTreeNode<K>, v: RBTreeNode<K> | null): void {\n if (!u.parent) {\n this.root = v;\n } else if (u === u.parent.left) {\n u.parent.left = v;\n } else {\n u.parent.right = v;\n }\n\n if (v) {\n v.parent = u.parent;\n }\n }\n\n private minimum(node: RBTreeNode<K>): RBTreeNode<K> {\n while (node.left) {\n node = node.left;\n }\n return node;\n }\n\n private inorder(node: RBTreeNode<K> | null, result: K[]): void {\n if (node) {\n this.inorder(node.left, result);\n result.push(node.key);\n this.inorder(node.right, result);\n }\n }\n\n private inorderRange(\n node: RBTreeNode<K> | null,\n start: K,\n end: K,\n result: K[],\n ): void {\n if (!node) return;\n\n const startCmp = this.compareFn(node.key, start);\n const endCmp = this.compareFn(node.key, end);\n\n if (startCmp > 0) {\n this.inorderRange(node.left, start, end, result);\n }\n\n if (startCmp >= 0 && endCmp <= 0) {\n result.push(node.key);\n }\n\n if (endCmp < 0) {\n this.inorderRange(node.right, start, end, result);\n }\n }\n}\n\n/**\n * LRU cache with binary search capabilities using Red-Black tree\n * All operations are O(log n) for ordered queries and O(1) for LRU operations\n */\nexport class OrderedLRUCache<K extends number | string, V> {\n private cache = new Map<K, V>();\n private tree: RedBlackTree<K>;\n private readonly maxSize: number;\n private readonly compareFn: (a: K, b: K) => number;\n\n constructor(maxSize: number, compareFn?: (a: K, b: K) => number) {\n this.maxSize = maxSize;\n this.compareFn = compareFn || ((a, b) => (a < b ? -1 : a > b ? 1 : 0));\n this.tree = new RedBlackTree(this.compareFn);\n }\n\n /**\n * Get value by exact key (O(1))\n */\n get(key: K): V | undefined {\n const value = this.cache.get(key);\n if (value) {\n // Refresh position by removing and re-adding\n this.cache.delete(key);\n this.cache.set(key, value);\n }\n return value;\n }\n\n /**\n * Set key-value pair (O(log n) for tree operations, O(1) for cache)\n */\n set(key: K, value: V): void {\n const isUpdate = this.cache.has(key);\n\n if (isUpdate) {\n this.cache.delete(key);\n } else {\n if (this.cache.size >= this.maxSize) {\n // Remove oldest entry (first item in map)\n const firstKey = this.cache.keys().next().value;\n if (firstKey) {\n this.cache.delete(firstKey);\n this.tree.delete(firstKey);\n }\n }\n // Add to tree index for new keys\n this.tree.insert(key);\n }\n\n this.cache.set(key, value);\n }\n\n /**\n * Find exact key using tree search (O(log n))\n */\n findExact(key: K): V | undefined {\n const foundKey = this.tree.find(key);\n if (foundKey !== null) {\n return this.get(key);\n }\n return undefined;\n }\n\n /**\n * Find keys within distance of center point (O(log n + k) where k is result count)\n * Returns empty array if no keys found in range\n */\n findNearestInRange(center: K, distance: K): Array<{ key: K; value: V }> {\n const nearestKeys = this.tree.findNearestInRange(center, distance);\n const result: Array<{ key: K; value: V }> = [];\n\n for (const key of nearestKeys) {\n const value = this.get(key);\n if (value !== undefined) {\n result.push({ key, value });\n }\n }\n\n return result;\n }\n\n /**\n * Find all key-value pairs in range [start, end] (O(log n + k) where k is result count)\n */\n findRange(start: K, end: K): Array<{ key: K; value: V }> {\n const keys = this.tree.findRange(start, end);\n const result: Array<{ key: K; value: V }> = [];\n\n for (const key of keys) {\n const value = this.get(key);\n if (value !== undefined) {\n result.push({ key, value });\n }\n }\n\n return result;\n }\n\n /**\n * Get all keys in sorted order (O(n))\n */\n getSortedKeys(): ReadonlyArray<K> {\n return this.tree.getAllSorted();\n }\n\n has(key: K): boolean {\n return this.cache.has(key);\n }\n\n delete(key: K): boolean {\n const deleted = this.cache.delete(key);\n if (deleted) {\n this.tree.delete(key);\n }\n return deleted;\n }\n\n clear(): void {\n this.cache.clear();\n this.tree = new RedBlackTree(this.compareFn);\n }\n\n get size(): number {\n return this.cache.size;\n }\n}\n"],"mappings":";;;;AAGA,IAAa,WAAb,MAA4B;CAI1B,YAAY,SAAiB;+BAHb,IAAI,KAAW;AAI7B,OAAK,UAAU;;CAGjB,IAAI,KAAuB;EACzB,MAAM,QAAQ,KAAK,MAAM,IAAI,IAAI;AACjC,MAAI,OAAO;AAET,QAAK,MAAM,OAAO,IAAI;AACtB,QAAK,MAAM,IAAI,KAAK,MAAM;;AAE5B,SAAO;;CAGT,IAAI,KAAQ,OAAgB;AAC1B,MAAI,KAAK,MAAM,IAAI,IAAI,CACrB,MAAK,MAAM,OAAO,IAAI;WACb,KAAK,MAAM,QAAQ,KAAK,SAAS;GAE1C,MAAM,WAAW,KAAK,MAAM,MAAM,CAAC,MAAM,CAAC;AAC1C,OAAI,SACF,MAAK,MAAM,OAAO,SAAS;;AAG/B,OAAK,MAAM,IAAI,KAAK,MAAM;;CAG5B,IAAI,KAAiB;AACnB,SAAO,KAAK,MAAM,IAAI,IAAI;;CAG5B,OAAO,KAAiB;AACtB,SAAO,KAAK,MAAM,OAAO,IAAI;;CAG/B,QAAc;AACZ,OAAK,MAAM,OAAO;;CAGpB,IAAI,OAAe;AACjB,SAAO,KAAK,MAAM;;;;;;;AAQtB,IAAa,oBAAb,MAAkC;CAMhC,YAAY,cAAsB;+BALlB,IAAI,KAA8B;+BAClC,IAAI,KAAgB;qBACd;AAIpB,OAAK,eAAe;;CAGtB,IAAI,KAA0C;EAC5C,MAAM,QAAQ,KAAK,MAAM,IAAI,IAAI;AACjC,MAAI,OAAO;GAET,MAAM,OAAO,KAAK,MAAM,IAAI,IAAI,IAAI;AACpC,QAAK,MAAM,OAAO,IAAI;AACtB,QAAK,MAAM,IAAI,KAAK,MAAM;AAC1B,QAAK,MAAM,OAAO,IAAI;AACtB,QAAK,MAAM,IAAI,KAAK,KAAK;;AAE3B,SAAO;;CAGT,IAAI,KAAQ,OAAmC;AAE7C,MAAI,KAAK,MAAM,IAAI,IAAI,EAAE;GACvB,MAAM,UAAU,KAAK,MAAM,IAAI,IAAI,IAAI;AACvC,QAAK,eAAe;AACpB,QAAK,MAAM,OAAO,IAAI;AACtB,QAAK,MAAM,OAAO,IAAI;;EAIxB,MAAM,sBAAsB,MACzB,MAAM,WAAW;GAChB,MAAM,aAAa,OAAO;AAC1B,QAAK,MAAM,IAAI,KAAK,WAAW;AAC/B,QAAK,eAAe;AAGpB,QAAK,kBAAkB;AAEvB,UAAO;IACP,CACD,OAAO,UAAU;AAEhB,QAAK,MAAM,OAAO,IAAI;AACtB,QAAK,MAAM,OAAO,IAAI;AACtB,SAAM;IACN;AAEJ,OAAK,MAAM,IAAI,KAAK,oBAAoB;;CAG1C,AAAQ,mBAAyB;AAC/B,SAAO,KAAK,cAAc,KAAK,gBAAgB,KAAK,MAAM,OAAO,GAAG;GAElE,MAAM,WAAW,KAAK,MAAM,MAAM,CAAC,MAAM,CAAC;AAC1C,OAAI,UAAU;IACZ,MAAM,OAAO,KAAK,MAAM,IAAI,SAAS,IAAI;AACzC,SAAK,eAAe;AACpB,SAAK,MAAM,OAAO,SAAS;AAC3B,SAAK,MAAM,OAAO,SAAS;SAE3B;;;CAKN,IAAI,KAAiB;AACnB,SAAO,KAAK,MAAM,IAAI,IAAI;;CAG5B,OAAO,KAAiB;EACtB,MAAM,OAAO,KAAK,MAAM,IAAI,IAAI,IAAI;AACpC,OAAK,eAAe;AACpB,OAAK,MAAM,OAAO,IAAI;AACtB,SAAO,KAAK,MAAM,OAAO,IAAI;;CAG/B,QAAc;AACZ,OAAK,MAAM,OAAO;AAClB,OAAK,MAAM,OAAO;AAClB,OAAK,cAAc;;CAGrB,IAAI,OAAe;AACjB,SAAO,KAAK,MAAM;;CAGpB,IAAI,mBAA2B;AAC7B,SAAO,KAAK;;CAGd,IAAI,UAAkB;AACpB,SAAO,KAAK"}
|
|
1
|
+
{"version":3,"file":"LRUCache.js","names":[],"sources":["../../src/utils/LRUCache.ts"],"sourcesContent":["/**\n * A simple LRU (Least Recently Used) cache implementation\n */\nexport class LRUCache<K, V> {\n private cache = new Map<K, V>();\n private readonly maxSize: number;\n\n constructor(maxSize: number) {\n this.maxSize = maxSize;\n }\n\n get(key: K): V | undefined {\n const value = this.cache.get(key);\n if (value) {\n // Refresh position by removing and re-adding\n this.cache.delete(key);\n this.cache.set(key, value);\n }\n return value;\n }\n\n set(key: K, value: V): void {\n if (this.cache.has(key)) {\n this.cache.delete(key);\n } else if (this.cache.size >= this.maxSize) {\n // Remove oldest entry (first item in map)\n const firstKey = this.cache.keys().next().value;\n if (firstKey) {\n this.cache.delete(firstKey);\n }\n }\n this.cache.set(key, value);\n }\n\n has(key: K): boolean {\n return this.cache.has(key);\n }\n\n delete(key: K): boolean {\n return this.cache.delete(key);\n }\n\n clear(): void {\n this.cache.clear();\n }\n\n get size(): number {\n return this.cache.size;\n }\n}\n\n/**\n * Size-aware LRU cache that tracks memory usage in bytes\n * Evicts entries when total size exceeds the maximum\n */\nexport class SizeAwareLRUCache<K> {\n private cache = new Map<K, Promise<ArrayBuffer>>();\n private sizes = new Map<K, number>();\n private currentSize = 0;\n private readonly maxSizeBytes: number;\n\n constructor(maxSizeBytes: number) {\n this.maxSizeBytes = maxSizeBytes;\n }\n\n get(key: K): Promise<ArrayBuffer> | undefined {\n const value = this.cache.get(key);\n if (value) {\n // Refresh position by removing and re-adding\n const size = this.sizes.get(key) || 0;\n this.cache.delete(key);\n this.cache.set(key, value);\n this.sizes.delete(key);\n this.sizes.set(key, size);\n }\n return value;\n }\n\n set(key: K, value: Promise<ArrayBuffer>): void {\n // If key already exists, remove it first\n if (this.cache.has(key)) {\n const oldSize = this.sizes.get(key) || 0;\n this.currentSize -= oldSize;\n this.cache.delete(key);\n this.sizes.delete(key);\n }\n\n // Track the size when the promise resolves\n const sizeTrackingPromise = value\n .then((buffer) => {\n const bufferSize = buffer.byteLength;\n this.sizes.set(key, bufferSize);\n this.currentSize += bufferSize;\n\n // Evict oldest entries if we exceed the size limit\n this.evictIfNecessary();\n\n return buffer;\n })\n .catch((error) => {\n // If the promise fails, clean up the entry\n this.cache.delete(key);\n this.sizes.delete(key);\n throw error;\n });\n\n // Suppress unhandled rejection on the derived promise. This promise sits in\n // the cache and may reject before any caller retrieves and awaits it.\n // Zone.js checks for handlers synchronously at rejection time — without this,\n // the re-thrown error triggers an unhandledrejection event. Callers who later\n // await the cached promise still see the rejection (this just adds a no-op branch).\n sizeTrackingPromise.catch(() => {});\n\n this.cache.set(key, sizeTrackingPromise);\n }\n\n private evictIfNecessary(): void {\n while (this.currentSize > this.maxSizeBytes && this.cache.size > 0) {\n // Remove oldest entry (first item in map)\n const firstKey = this.cache.keys().next().value;\n if (firstKey) {\n const size = this.sizes.get(firstKey) || 0;\n this.currentSize -= size;\n this.cache.delete(firstKey);\n this.sizes.delete(firstKey);\n } else {\n break;\n }\n }\n }\n\n has(key: K): boolean {\n return this.cache.has(key);\n }\n\n delete(key: K): boolean {\n const size = this.sizes.get(key) || 0;\n this.currentSize -= size;\n this.sizes.delete(key);\n return this.cache.delete(key);\n }\n\n clear(): void {\n this.cache.clear();\n this.sizes.clear();\n this.currentSize = 0;\n }\n\n get size(): number {\n return this.cache.size;\n }\n\n get currentSizeBytes(): number {\n return this.currentSize;\n }\n\n get maxSize(): number {\n return this.maxSizeBytes;\n }\n}\n\n/**\n * Red-Black Tree node colors\n */\nenum Color {\n RED = \"RED\",\n BLACK = \"BLACK\",\n}\n\n/**\n * Red-Black Tree node for ordered key storage\n */\nclass RBTreeNode<K> {\n constructor(\n public key: K,\n public color: Color = Color.RED,\n public left: RBTreeNode<K> | null = null,\n public right: RBTreeNode<K> | null = null,\n public parent: RBTreeNode<K> | null = null,\n ) {}\n}\n\n/**\n * Red-Black Tree implementation for O(log n) operations\n * Supports insert, delete, search, range queries, and nearest neighbor\n */\nclass RedBlackTree<K> {\n private root: RBTreeNode<K> | null = null;\n private readonly compareFn: (a: K, b: K) => number;\n\n constructor(compareFn: (a: K, b: K) => number) {\n this.compareFn = compareFn;\n }\n\n insert(key: K): void {\n const node = new RBTreeNode(key);\n\n if (!this.root) {\n this.root = node;\n node.color = Color.BLACK;\n return;\n }\n\n this.insertNode(node);\n this.fixInsert(node);\n }\n\n delete(key: K): boolean {\n const node = this.findNode(key);\n if (!node) return false;\n\n this.deleteNode(node);\n return true;\n }\n\n find(key: K): K | null {\n const node = this.findNode(key);\n return node ? node.key : null;\n }\n\n findNearestInRange(center: K, distance: K): K[] {\n // Calculate the range bounds\n const start = this.subtractDistance(center, distance);\n const end = this.addDistance(center, distance);\n\n // Use existing range search (O(log n + k))\n return this.findRange(start, end);\n }\n\n private subtractDistance(center: K, distance: K): K {\n if (typeof center === \"number\" && typeof distance === \"number\") {\n return (center - distance) as K;\n }\n\n // For strings, we can't easily subtract distance, so just return center\n // This means string searches will be exact matches only\n return center;\n }\n\n private addDistance(center: K, distance: K): K {\n if (typeof center === \"number\" && typeof distance === \"number\") {\n return (center + distance) as K;\n }\n\n // For strings, we can't easily add distance, so just return center\n // This means string searches will be exact matches only\n return center;\n }\n\n findRange(start: K, end: K): K[] {\n const result: K[] = [];\n this.inorderRange(this.root, start, end, result);\n return result;\n }\n\n getAllSorted(): K[] {\n const result: K[] = [];\n this.inorder(this.root, result);\n return result;\n }\n\n private findNode(key: K): RBTreeNode<K> | null {\n let current = this.root;\n\n while (current) {\n const cmp = this.compareFn(key, current.key);\n if (cmp === 0) return current;\n current = cmp < 0 ? current.left : current.right;\n }\n\n return null;\n }\n\n private insertNode(node: RBTreeNode<K>): void {\n let parent = null;\n let current = this.root;\n\n while (current) {\n parent = current;\n const cmp = this.compareFn(node.key, current.key);\n current = cmp < 0 ? current.left : current.right;\n }\n\n node.parent = parent;\n if (!parent) {\n this.root = node;\n } else {\n const cmp = this.compareFn(node.key, parent.key);\n if (cmp < 0) {\n parent.left = node;\n } else {\n parent.right = node;\n }\n }\n }\n\n private fixInsert(node: RBTreeNode<K>): void {\n while (node.parent && node.parent.color === Color.RED) {\n if (node.parent === node.parent.parent?.left) {\n const uncle = node.parent.parent.right;\n\n if (uncle?.color === Color.RED) {\n node.parent.color = Color.BLACK;\n uncle.color = Color.BLACK;\n node.parent.parent.color = Color.RED;\n node = node.parent.parent;\n } else {\n if (node === node.parent.right) {\n node = node.parent;\n this.rotateLeft(node);\n }\n\n if (node.parent) {\n node.parent.color = Color.BLACK;\n if (node.parent.parent) {\n node.parent.parent.color = Color.RED;\n this.rotateRight(node.parent.parent);\n }\n }\n }\n } else {\n const uncle = node.parent.parent?.left;\n\n if (uncle?.color === Color.RED) {\n node.parent.color = Color.BLACK;\n uncle.color = Color.BLACK;\n if (node.parent.parent) {\n node.parent.parent.color = Color.RED;\n node = node.parent.parent;\n }\n } else {\n if (node === node.parent.left) {\n node = node.parent;\n this.rotateRight(node);\n }\n\n if (node.parent) {\n node.parent.color = Color.BLACK;\n if (node.parent.parent) {\n node.parent.parent.color = Color.RED;\n this.rotateLeft(node.parent.parent);\n }\n }\n }\n }\n }\n\n if (this.root) {\n this.root.color = Color.BLACK;\n }\n }\n\n private deleteNode(node: RBTreeNode<K>): void {\n let y = node;\n let yOriginalColor = y.color;\n let x: RBTreeNode<K> | null;\n\n if (!node.left) {\n x = node.right;\n this.transplant(node, node.right);\n } else if (!node.right) {\n x = node.left;\n this.transplant(node, node.left);\n } else {\n y = this.minimum(node.right);\n yOriginalColor = y.color;\n x = y.right;\n\n if (y.parent === node) {\n if (x) x.parent = y;\n } else {\n this.transplant(y, y.right);\n y.right = node.right;\n if (y.right) y.right.parent = y;\n }\n\n this.transplant(node, y);\n y.left = node.left;\n if (y.left) y.left.parent = y;\n y.color = node.color;\n }\n\n if (yOriginalColor === Color.BLACK && x) {\n this.fixDelete(x);\n }\n }\n\n private fixDelete(node: RBTreeNode<K>): void {\n while (node !== this.root && node.color === Color.BLACK) {\n if (node === node.parent?.left) {\n let sibling = node.parent.right;\n\n if (sibling?.color === Color.RED) {\n sibling.color = Color.BLACK;\n node.parent.color = Color.RED;\n this.rotateLeft(node.parent);\n sibling = node.parent.right;\n }\n\n if (\n sibling?.left?.color !== Color.RED &&\n sibling?.right?.color !== Color.RED\n ) {\n if (sibling) {\n sibling.color = Color.RED;\n }\n node = node.parent;\n } else {\n if (sibling?.right?.color !== Color.RED) {\n if (sibling.left) sibling.left.color = Color.BLACK;\n sibling.color = Color.RED;\n this.rotateRight(sibling);\n sibling = node.parent.right;\n }\n\n if (sibling) {\n sibling.color = node.parent.color;\n node.parent.color = Color.BLACK;\n if (sibling.right) sibling.right.color = Color.BLACK;\n this.rotateLeft(node.parent);\n }\n if (!this.root) {\n throw new Error(\"Root is null\");\n }\n node = this.root;\n }\n } else {\n let sibling = node.parent?.left;\n\n if (sibling?.color === Color.RED) {\n sibling.color = Color.BLACK;\n if (node.parent) node.parent.color = Color.RED;\n if (node.parent) this.rotateRight(node.parent);\n sibling = node.parent?.left;\n }\n\n if (\n sibling?.right?.color !== Color.RED &&\n sibling?.left?.color !== Color.RED\n ) {\n if (sibling) {\n sibling.color = Color.RED;\n }\n if (node.parent === null) {\n throw new Error(\"Node parent is null\");\n }\n node = node.parent;\n } else {\n if (sibling?.left?.color !== Color.RED) {\n if (sibling.right) sibling.right.color = Color.BLACK;\n sibling.color = Color.RED;\n this.rotateLeft(sibling);\n sibling = node.parent?.left;\n }\n\n if (sibling) {\n sibling.color = node.parent?.color || Color.BLACK;\n if (node.parent) node.parent.color = Color.BLACK;\n if (sibling.left) sibling.left.color = Color.BLACK;\n if (node.parent) this.rotateRight(node.parent);\n }\n if (!this.root) {\n throw new Error(\"Root is null\");\n }\n node = this.root;\n }\n }\n }\n\n node.color = Color.BLACK;\n }\n\n private rotateLeft(node: RBTreeNode<K>): void {\n const rightChild = node.right;\n if (!rightChild) {\n throw new Error(\"Right child is null\");\n }\n node.right = rightChild.left;\n\n if (rightChild.left) {\n rightChild.left.parent = node;\n }\n\n rightChild.parent = node.parent;\n\n if (!node.parent) {\n this.root = rightChild;\n } else if (node === node.parent.left) {\n node.parent.left = rightChild;\n } else {\n node.parent.right = rightChild;\n }\n\n rightChild.left = node;\n node.parent = rightChild;\n }\n\n private rotateRight(node: RBTreeNode<K>): void {\n const leftChild = node.left;\n if (!leftChild) {\n throw new Error(\"Left child is null\");\n }\n node.left = leftChild.right;\n\n if (leftChild.right) {\n leftChild.right.parent = node;\n }\n\n leftChild.parent = node.parent;\n\n if (!node.parent) {\n this.root = leftChild;\n } else if (node === node.parent.right) {\n node.parent.right = leftChild;\n } else {\n node.parent.left = leftChild;\n }\n\n leftChild.right = node;\n node.parent = leftChild;\n }\n\n private transplant(u: RBTreeNode<K>, v: RBTreeNode<K> | null): void {\n if (!u.parent) {\n this.root = v;\n } else if (u === u.parent.left) {\n u.parent.left = v;\n } else {\n u.parent.right = v;\n }\n\n if (v) {\n v.parent = u.parent;\n }\n }\n\n private minimum(node: RBTreeNode<K>): RBTreeNode<K> {\n while (node.left) {\n node = node.left;\n }\n return node;\n }\n\n private inorder(node: RBTreeNode<K> | null, result: K[]): void {\n if (node) {\n this.inorder(node.left, result);\n result.push(node.key);\n this.inorder(node.right, result);\n }\n }\n\n private inorderRange(\n node: RBTreeNode<K> | null,\n start: K,\n end: K,\n result: K[],\n ): void {\n if (!node) return;\n\n const startCmp = this.compareFn(node.key, start);\n const endCmp = this.compareFn(node.key, end);\n\n if (startCmp > 0) {\n this.inorderRange(node.left, start, end, result);\n }\n\n if (startCmp >= 0 && endCmp <= 0) {\n result.push(node.key);\n }\n\n if (endCmp < 0) {\n this.inorderRange(node.right, start, end, result);\n }\n }\n}\n\n/**\n * LRU cache with binary search capabilities using Red-Black tree\n * All operations are O(log n) for ordered queries and O(1) for LRU operations\n */\nexport class OrderedLRUCache<K extends number | string, V> {\n private cache = new Map<K, V>();\n private tree: RedBlackTree<K>;\n private readonly maxSize: number;\n private readonly compareFn: (a: K, b: K) => number;\n\n constructor(maxSize: number, compareFn?: (a: K, b: K) => number) {\n this.maxSize = maxSize;\n this.compareFn = compareFn || ((a, b) => (a < b ? -1 : a > b ? 1 : 0));\n this.tree = new RedBlackTree(this.compareFn);\n }\n\n /**\n * Get value by exact key (O(1))\n */\n get(key: K): V | undefined {\n const value = this.cache.get(key);\n if (value) {\n // Refresh position by removing and re-adding\n this.cache.delete(key);\n this.cache.set(key, value);\n }\n return value;\n }\n\n /**\n * Set key-value pair (O(log n) for tree operations, O(1) for cache)\n */\n set(key: K, value: V): void {\n const isUpdate = this.cache.has(key);\n\n if (isUpdate) {\n this.cache.delete(key);\n } else {\n if (this.cache.size >= this.maxSize) {\n // Remove oldest entry (first item in map)\n const firstKey = this.cache.keys().next().value;\n if (firstKey) {\n this.cache.delete(firstKey);\n this.tree.delete(firstKey);\n }\n }\n // Add to tree index for new keys\n this.tree.insert(key);\n }\n\n this.cache.set(key, value);\n }\n\n /**\n * Find exact key using tree search (O(log n))\n */\n findExact(key: K): V | undefined {\n const foundKey = this.tree.find(key);\n if (foundKey !== null) {\n return this.get(key);\n }\n return undefined;\n }\n\n /**\n * Find keys within distance of center point (O(log n + k) where k is result count)\n * Returns empty array if no keys found in range\n */\n findNearestInRange(center: K, distance: K): Array<{ key: K; value: V }> {\n const nearestKeys = this.tree.findNearestInRange(center, distance);\n const result: Array<{ key: K; value: V }> = [];\n\n for (const key of nearestKeys) {\n const value = this.get(key);\n if (value !== undefined) {\n result.push({ key, value });\n }\n }\n\n return result;\n }\n\n /**\n * Find all key-value pairs in range [start, end] (O(log n + k) where k is result count)\n */\n findRange(start: K, end: K): Array<{ key: K; value: V }> {\n const keys = this.tree.findRange(start, end);\n const result: Array<{ key: K; value: V }> = [];\n\n for (const key of keys) {\n const value = this.get(key);\n if (value !== undefined) {\n result.push({ key, value });\n }\n }\n\n return result;\n }\n\n /**\n * Get all keys in sorted order (O(n))\n */\n getSortedKeys(): ReadonlyArray<K> {\n return this.tree.getAllSorted();\n }\n\n has(key: K): boolean {\n return this.cache.has(key);\n }\n\n delete(key: K): boolean {\n const deleted = this.cache.delete(key);\n if (deleted) {\n this.tree.delete(key);\n }\n return deleted;\n }\n\n clear(): void {\n this.cache.clear();\n this.tree = new RedBlackTree(this.compareFn);\n }\n\n get size(): number {\n return this.cache.size;\n }\n}\n"],"mappings":";;;;AAGA,IAAa,WAAb,MAA4B;CAI1B,YAAY,SAAiB;+BAHb,IAAI,KAAW;AAI7B,OAAK,UAAU;;CAGjB,IAAI,KAAuB;EACzB,MAAM,QAAQ,KAAK,MAAM,IAAI,IAAI;AACjC,MAAI,OAAO;AAET,QAAK,MAAM,OAAO,IAAI;AACtB,QAAK,MAAM,IAAI,KAAK,MAAM;;AAE5B,SAAO;;CAGT,IAAI,KAAQ,OAAgB;AAC1B,MAAI,KAAK,MAAM,IAAI,IAAI,CACrB,MAAK,MAAM,OAAO,IAAI;WACb,KAAK,MAAM,QAAQ,KAAK,SAAS;GAE1C,MAAM,WAAW,KAAK,MAAM,MAAM,CAAC,MAAM,CAAC;AAC1C,OAAI,SACF,MAAK,MAAM,OAAO,SAAS;;AAG/B,OAAK,MAAM,IAAI,KAAK,MAAM;;CAG5B,IAAI,KAAiB;AACnB,SAAO,KAAK,MAAM,IAAI,IAAI;;CAG5B,OAAO,KAAiB;AACtB,SAAO,KAAK,MAAM,OAAO,IAAI;;CAG/B,QAAc;AACZ,OAAK,MAAM,OAAO;;CAGpB,IAAI,OAAe;AACjB,SAAO,KAAK,MAAM;;;;;;;AAQtB,IAAa,oBAAb,MAAkC;CAMhC,YAAY,cAAsB;+BALlB,IAAI,KAA8B;+BAClC,IAAI,KAAgB;qBACd;AAIpB,OAAK,eAAe;;CAGtB,IAAI,KAA0C;EAC5C,MAAM,QAAQ,KAAK,MAAM,IAAI,IAAI;AACjC,MAAI,OAAO;GAET,MAAM,OAAO,KAAK,MAAM,IAAI,IAAI,IAAI;AACpC,QAAK,MAAM,OAAO,IAAI;AACtB,QAAK,MAAM,IAAI,KAAK,MAAM;AAC1B,QAAK,MAAM,OAAO,IAAI;AACtB,QAAK,MAAM,IAAI,KAAK,KAAK;;AAE3B,SAAO;;CAGT,IAAI,KAAQ,OAAmC;AAE7C,MAAI,KAAK,MAAM,IAAI,IAAI,EAAE;GACvB,MAAM,UAAU,KAAK,MAAM,IAAI,IAAI,IAAI;AACvC,QAAK,eAAe;AACpB,QAAK,MAAM,OAAO,IAAI;AACtB,QAAK,MAAM,OAAO,IAAI;;EAIxB,MAAM,sBAAsB,MACzB,MAAM,WAAW;GAChB,MAAM,aAAa,OAAO;AAC1B,QAAK,MAAM,IAAI,KAAK,WAAW;AAC/B,QAAK,eAAe;AAGpB,QAAK,kBAAkB;AAEvB,UAAO;IACP,CACD,OAAO,UAAU;AAEhB,QAAK,MAAM,OAAO,IAAI;AACtB,QAAK,MAAM,OAAO,IAAI;AACtB,SAAM;IACN;AAOJ,sBAAoB,YAAY,GAAG;AAEnC,OAAK,MAAM,IAAI,KAAK,oBAAoB;;CAG1C,AAAQ,mBAAyB;AAC/B,SAAO,KAAK,cAAc,KAAK,gBAAgB,KAAK,MAAM,OAAO,GAAG;GAElE,MAAM,WAAW,KAAK,MAAM,MAAM,CAAC,MAAM,CAAC;AAC1C,OAAI,UAAU;IACZ,MAAM,OAAO,KAAK,MAAM,IAAI,SAAS,IAAI;AACzC,SAAK,eAAe;AACpB,SAAK,MAAM,OAAO,SAAS;AAC3B,SAAK,MAAM,OAAO,SAAS;SAE3B;;;CAKN,IAAI,KAAiB;AACnB,SAAO,KAAK,MAAM,IAAI,IAAI;;CAG5B,OAAO,KAAiB;EACtB,MAAM,OAAO,KAAK,MAAM,IAAI,IAAI,IAAI;AACpC,OAAK,eAAe;AACpB,OAAK,MAAM,OAAO,IAAI;AACtB,SAAO,KAAK,MAAM,OAAO,IAAI;;CAG/B,QAAc;AACZ,OAAK,MAAM,OAAO;AAClB,OAAK,MAAM,OAAO;AAClB,OAAK,cAAc;;CAGrB,IAAI,OAAe;AACjB,SAAO,KAAK,MAAM;;CAGpB,IAAI,mBAA2B;AAC7B,SAAO,KAAK;;CAGd,IAAI,UAAkB;AACpB,SAAO,KAAK"}
|