Rocky_Mountain_Vending/.pnpm-store/v10/files/3b/b91918b67ecd5d29c410dc338e1225de388cda388d065f773d43ab02c74ff1a2e007b28638f3546dc76552e597e4a1672c5c9d7298299315f2d18565bcfbf4
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

45 lines
No EOL
1.8 KiB
Text

// Copyright 2023 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
import * as Platform from '../../../core/platform/platform.js';
// Cache film strips based on:
// 1. The trace parsed data object
// 2. The start time.
const filmStripCache = new WeakMap();
export function fromParsedTrace(parsedTrace, customZeroTime) {
const frames = [];
const zeroTime = typeof customZeroTime !== 'undefined' ? customZeroTime : parsedTrace.Meta.traceBounds.min;
const spanTime = parsedTrace.Meta.traceBounds.range;
const fromCache = filmStripCache.get(parsedTrace)?.get(zeroTime);
if (fromCache) {
return fromCache;
}
const screenshots = parsedTrace.Screenshots.screenshots ?? parsedTrace.Screenshots.legacySyntheticScreenshots ?? [];
for (const screenshotEvent of screenshots) {
if (screenshotEvent.ts < zeroTime) {
continue;
}
const frame = {
index: frames.length,
screenshotEvent,
};
frames.push(frame);
}
const result = {
zeroTime,
spanTime,
frames: Array.from(frames),
};
const cachedForData = Platform.MapUtilities.getWithDefault(filmStripCache, parsedTrace, () => new Map());
cachedForData.set(zeroTime, result);
return result;
}
export function frameClosestToTimestamp(filmStrip, searchTimestamp) {
const closestFrameIndexBeforeTimestamp = Platform.ArrayUtilities.nearestIndexFromEnd(filmStrip.frames, frame => frame.screenshotEvent.ts < searchTimestamp);
if (closestFrameIndexBeforeTimestamp === null) {
return null;
}
return filmStrip.frames[closestFrameIndexBeforeTimestamp];
}
//# sourceMappingURL=FilmStrip.js.map