Rocky_Mountain_Vending/.pnpm-store/v10/files/87/14127c014df6215a3e3e2c56830ba0a494c2c253a78adbf820d182bdc15a65848af279bca48f90df5b33d40617456e66bbb934f69aec1e059ac1ffd19cd22d
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

1 line
No EOL
6.8 KiB
Text

{"version":3,"sources":["../../src/build/duration-to-string.ts"],"sourcesContent":["// Time thresholds in seconds\nconst SECONDS_IN_MINUTE = 60\nconst MINUTES_THRESHOLD_SECONDS = 120 // 2 minutes\nconst SECONDS_THRESHOLD_HIGH = 40\nconst SECONDS_THRESHOLD_LOW = 2\nconst MILLISECONDS_PER_SECOND = 1000\n\n// Time thresholds and conversion factors for nanoseconds\nconst NANOSECONDS_PER_SECOND = 1_000_000_000\nconst NANOSECONDS_PER_MILLISECOND = 1_000_000\nconst NANOSECONDS_PER_MICROSECOND = 1_000\nconst NANOSECONDS_IN_MINUTE = 60_000_000_000 // 60 * 1_000_000_000\nconst MINUTES_THRESHOLD_NANOSECONDS = 120_000_000_000 // 2 minutes in nanoseconds\nconst SECONDS_THRESHOLD_HIGH_NANOSECONDS = 40_000_000_000 // 40 seconds in nanoseconds\nconst SECONDS_THRESHOLD_LOW_NANOSECONDS = 2_000_000_000 // 2 seconds in nanoseconds\nconst MILLISECONDS_THRESHOLD_NANOSECONDS = 2_000_000 // 2 milliseconds in nanoseconds\n\n/**\n * Converts a duration in seconds to a human-readable string format.\n * Formats duration based on magnitude for optimal readability:\n * - >= 2 minutes: show in minutes with 1 decimal place (e.g., \"2.5min\")\n * - >= 40 seconds: show in whole seconds (e.g., \"45s\")\n * - >= 2 seconds: show in seconds with 1 decimal place (e.g., \"3.2s\")\n * - < 2 seconds: show in milliseconds with 1 decimal place (e.g., \"1500.0ms\")\n *\n * @deprecated Use durationToStringWithNanoseconds instead, collect time in nanoseconds using process.hrtime.bigint().\n * @param compilerDuration - Duration in seconds as a number\n * @returns Formatted duration string with appropriate unit and precision\n */\nexport function durationToString(compilerDuration: number) {\n if (compilerDuration > MINUTES_THRESHOLD_SECONDS) {\n return `${(compilerDuration / SECONDS_IN_MINUTE).toFixed(1)}min`\n } else if (compilerDuration > SECONDS_THRESHOLD_HIGH) {\n return `${compilerDuration.toFixed(0)}s`\n } else if (compilerDuration > SECONDS_THRESHOLD_LOW) {\n return `${compilerDuration.toFixed(1)}s`\n } else {\n return `${(compilerDuration * MILLISECONDS_PER_SECOND).toFixed(1)}ms`\n }\n}\n\n/**\n * Converts a nanosecond duration to a human-readable string format.\n * Formats duration based on magnitude for optimal readability:\n * - >= 2 minutes: show in minutes with 1 decimal place (e.g., \"2.5min\")\n * - >= 40 seconds: show in whole seconds (e.g., \"45s\")\n * - >= 2 seconds: show in seconds with 1 decimal place (e.g., \"3.2s\")\n * - >= 2 milliseconds: show in whole milliseconds (e.g., \"250ms\")\n * - < 2 milliseconds: show in whole microseconds (e.g., \"500µs\")\n *\n * @param durationBigInt - Duration in nanoseconds as a BigInt\n * @returns Formatted duration string with appropriate unit and precision\n */\nfunction durationToStringWithNanoseconds(durationBigInt: bigint): string {\n const duration = Number(durationBigInt)\n if (duration >= MINUTES_THRESHOLD_NANOSECONDS) {\n return `${(duration / NANOSECONDS_IN_MINUTE).toFixed(1)}min`\n } else if (duration >= SECONDS_THRESHOLD_HIGH_NANOSECONDS) {\n return `${(duration / NANOSECONDS_PER_SECOND).toFixed(0)}s`\n } else if (duration >= SECONDS_THRESHOLD_LOW_NANOSECONDS) {\n return `${(duration / NANOSECONDS_PER_SECOND).toFixed(1)}s`\n } else if (duration >= MILLISECONDS_THRESHOLD_NANOSECONDS) {\n return `${(duration / NANOSECONDS_PER_MILLISECOND).toFixed(0)}ms`\n } else {\n return `${(duration / NANOSECONDS_PER_MICROSECOND).toFixed(0)}µs`\n }\n}\n\n/**\n * Converts a high-resolution time tuple to seconds.\n *\n * @param hrtime - High-resolution time tuple of [seconds, nanoseconds]\n * @returns Duration in seconds as a floating-point number\n */\nexport function hrtimeToSeconds(hrtime: [number, number]): number {\n // hrtime is a tuple of [seconds, nanoseconds]\n return hrtime[0] + hrtime[1] / NANOSECONDS_PER_SECOND\n}\n\n/**\n * Converts a BigInt nanosecond duration to a human-readable string format.\n * This is the preferred method for formatting high-precision durations.\n *\n * @param hrtime - Duration in nanoseconds as a BigInt (typically from process.hrtime.bigint())\n * @returns Formatted duration string with appropriate unit and precision\n */\nexport function hrtimeBigIntDurationToString(hrtime: bigint) {\n return durationToStringWithNanoseconds(hrtime)\n}\n\n/**\n * Converts a high-resolution time tuple to a human-readable string format.\n *\n * @deprecated Use hrtimeBigIntDurationToString with process.hrtime.bigint() for better precision.\n * @param hrtime - High-resolution time tuple of [seconds, nanoseconds]\n * @returns Formatted duration string with appropriate unit and precision\n */\nexport function hrtimeDurationToString(hrtime: [number, number]): string {\n return durationToString(hrtimeToSeconds(hrtime))\n}\n"],"names":["durationToString","hrtimeBigIntDurationToString","hrtimeDurationToString","hrtimeToSeconds","SECONDS_IN_MINUTE","MINUTES_THRESHOLD_SECONDS","SECONDS_THRESHOLD_HIGH","SECONDS_THRESHOLD_LOW","MILLISECONDS_PER_SECOND","NANOSECONDS_PER_SECOND","NANOSECONDS_PER_MILLISECOND","NANOSECONDS_PER_MICROSECOND","NANOSECONDS_IN_MINUTE","MINUTES_THRESHOLD_NANOSECONDS","SECONDS_THRESHOLD_HIGH_NANOSECONDS","SECONDS_THRESHOLD_LOW_NANOSECONDS","MILLISECONDS_THRESHOLD_NANOSECONDS","compilerDuration","toFixed","durationToStringWithNanoseconds","durationBigInt","duration","Number","hrtime"],"mappings":"AAAA,6BAA6B;;;;;;;;;;;;;;;;;;IA6BbA,gBAAgB;eAAhBA;;IAyDAC,4BAA4B;eAA5BA;;IAWAC,sBAAsB;eAAtBA;;I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