__vite_ssr_exportName__("videoAge", () => { try { return videoAge } catch {} });
__vite_ssr_exportName__("videoLength", () => { try { return videoLength } catch {} });
/** How long ago a video went up, in whole hours or (from two days) whole days. */
function videoAge(publishedAt, now) {
	const published = new Date(publishedAt).getTime();
	const hours = Number.isNaN(published) ? 0 : Math.max(0, Math.floor((now - published) / 36e5));
	return hours < 48 ? { hours } : { days: Math.floor(hours / 24) };
};
/** A video's length as h:mm:ss (or m:ss under an hour). */
function videoLength(seconds) {
	const whole = Math.max(0, Math.round(seconds));
	const hours = Math.floor(whole / 3600);
	const minutes = Math.floor(whole % 3600 / 60);
	const rest = String(whole % 60).padStart(2, "0");
	return hours > 0 ? `${hours}:${String(minutes).padStart(2, "0")}:${rest}` : `${minutes}:${rest}`;
}

//# vitestCache=W3siZmlsZSI6IjEiLCJpZCI6IjEiLCJpbXBvcnRzIjoiMiIsIm1hcHBpbmdzIjpmYWxzZSwiZGVwcyI6IjMiLCJkeW5hbWljRGVwcyI6IjQiLCJzdGF0aWNNb2NrcyI6bnVsbCwiaGFzQ292ZXJhZ2VEYXRhIjpmYWxzZX0sIkQ6L0dpdEh1Yi9WaWNlQ3V0L3dlYi9zcmMvZW50aXRpZXMvZm91bmQtdmlkZW8vYWdlLnRzIix7InVybHMiOiI1IiwiaWRzIjoiNiJ9LFtdLFtdLFtdLHt9XQ==
//# vitestSourceMap={"version":3,"mappings":"AAAA,CAAA;;;AACO,SAAS,SAAS,aAAqB,KAAmD;CAC/F,MAAM,YAAY,IAAI,KAAK,WAAW,CAAC,CAAC,QAAQ;CAChD,MAAM,QAAQ,OAAO,MAAM,SAAS,IAAI,IAAI,KAAK,IAAI,GAAG,KAAK,OAAO,MAAM,aAAa,IAAS,CAAC;CACjG,OAAO,QAAQ,KAAK,EAAE,MAAM,IAAI,EAAE,MAAM,KAAK,MAAM,QAAQ,EAAE,EAAE;AACjE;;AAGO,SAAS,YAAY,SAAyB;CACnD,MAAM,QAAQ,KAAK,IAAI,GAAG,KAAK,MAAM,OAAO,CAAC;CAC7C,MAAM,QAAQ,KAAK,MAAM,QAAQ,IAAI;CACrC,MAAM,UAAU,KAAK,MAAO,QAAQ,OAAQ,EAAE;CAC9C,MAAM,OAAO,OAAO,QAAQ,EAAE,CAAC,CAAC,SAAS,GAAG,GAAG;CAC/C,OAAO,QAAQ,IAAI,GAAG,MAAM,GAAG,OAAO,OAAO,CAAC,CAAC,SAAS,GAAG,GAAG,EAAE,GAAG,SAAS,GAAG,QAAQ,GAAG;AAC5F","names":[],"ignoreList":[],"sources":["age.ts"],"sourcesContent":["/** How long ago a video went up, in whole hours or (from two days) whole days. */\nexport function videoAge(publishedAt: string, now: number): { hours: number } | { days: number } {\n  const published = new Date(publishedAt).getTime();\n  const hours = Number.isNaN(published) ? 0 : Math.max(0, Math.floor((now - published) / 3_600_000));\n  return hours < 48 ? { hours } : { days: Math.floor(hours / 24) };\n}\n\n/** A video's length as h:mm:ss (or m:ss under an hour). */\nexport function videoLength(seconds: number): string {\n  const whole = Math.max(0, Math.round(seconds));\n  const hours = Math.floor(whole / 3600);\n  const minutes = Math.floor((whole % 3600) / 60);\n  const rest = String(whole % 60).padStart(2, \"0\");\n  return hours > 0 ? `${hours}:${String(minutes).padStart(2, \"0\")}:${rest}` : `${minutes}:${rest}`;\n}\n"],"file":"/web/src/entities/found-video/age.ts"}