const require_runtime = require("../../_virtual/_rolldown/runtime.js");
let dayjs = require("dayjs");
dayjs = require_runtime.__toESM(dayjs);
//#region src/components/select-time/utils.ts
const sliceDayIntoFiveMinutes = (slice) => {
	const startTime = (0, dayjs.default)().startOf("day");
	const endTime = (0, dayjs.default)().endOf("day");
	const timeSlice = slice || 5;
	let timeSlices = [];
	let currentTime = startTime;
	while (currentTime.isBefore(endTime)) {
		const timeLabel = currentTime.format("HH:mm");
		const timeValue = currentTime.format("HH:mm");
		timeSlices.push({
			label: timeLabel,
			value: timeValue
		});
		currentTime = currentTime.add(timeSlice, "minute");
	}
	return timeSlices;
};
const findNextSlice = ({ timeSlices = [], index = 0, date = "" }) => {
	const currentTimeValue = date || (0, dayjs.default)().format("HH:mm");
	for (let i = 0; i < timeSlices.length; i++) if (timeSlices[i].value !== "now") {
		if (timeSlices[i].value >= currentTimeValue) return timeSlices[i].value;
	}
	return timeSlices[index].value;
};
//#endregion
exports.findNextSlice = findNextSlice;
exports.sliceDayIntoFiveMinutes = sliceDayIntoFiveMinutes;
