//#region libs/shared/common/src/functions/utils/time.utils.ts
var e = 1e3 * 60 * 60 * 24, t = (e = 1e3) => new Promise((t) => {
	setTimeout(() => {
		t(void 0);
	}, e);
}), n = () => Math.floor(Date.now() / 1e3), r = (e) => new Date(e).toISOString(), i = () => {
	let e = /* @__PURE__ */ new Date(), t = new Date(Date.UTC(e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate(), 6, 0, 0, 0));
	return e < t ? new Date(t.setUTCDate(t.getUTCDate() - 1)) : t;
}, a = () => {
	let e = i(), t = new Date(e);
	return t.setUTCDate(t.getUTCDate() - 6), t;
}, o = () => {
	let e = i(), t = (e.getUTCDay() + 6) % 7, n = new Date(e);
	return n.setUTCDate(e.getUTCDate() - t), n.setUTCHours(6, 0, 0, 0), n;
}, s = () => {
	let e = o();
	return e.setUTCDate(e.getUTCDate() - 7), e;
}, c = () => {
	let e = /* @__PURE__ */ new Date(), t = new Date(e);
	return t.setUTCHours(6, 0, 0, 0), t <= e && t.setUTCDate(t.getUTCDate() + 1), t.getTime() - e.getTime();
}, l = () => {
	let e = /* @__PURE__ */ new Date(), t = new Date(e);
	return t.setUTCHours(8, 0, 0, 0), t <= e && t.setUTCDate(t.getUTCDate() + 1), t.getTime() - e.getTime();
}, u = () => {
	let e = /* @__PURE__ */ new Date(), t = new Date(Date.UTC(e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate(), 6, 0, 0, 0));
	return e < t && t.setUTCDate(t.getUTCDate() - 1), t;
}, d = (e = /* @__PURE__ */ new Date()) => new Date(Date.UTC(e.getUTCFullYear(), e.getUTCMonth(), e.getUTCDate())), f = () => {
	let e = /* @__PURE__ */ new Date(), t = new Date(e);
	return t.setUTCHours(6, 0, 0, 0), t <= e && t.setUTCDate(t.getUTCDate() + 1), t.toISOString();
}, p = (e) => {
	let t = (/* @__PURE__ */ new Date()).getFullYear() === e.getFullYear() ? {
		month: "long",
		day: "numeric"
	} : {
		month: "long",
		day: "numeric",
		year: "numeric"
	};
	return e.toLocaleDateString(void 0, t);
}, m = (e) => {
	try {
		let t = new Date(e);
		if (Number.isNaN(t.getTime())) return "";
		let n = t.getDate(), r = t.getFullYear();
		return `${t.toLocaleString("en-US", { month: "short" })} ${n}, ${r}, ${String(t.getHours()).padStart(2, "0")}:${String(t.getMinutes()).padStart(2, "0")}`;
	} catch {
		return "";
	}
}, h = (e) => {
	let t = /* @__PURE__ */ new Date(), n = new Date(e), r = t.getTime() - n.getTime(), i = Math.floor(r / 1e3), a = Math.floor(i / 60), o = Math.floor(a / 60), s = Math.floor(o / 24), c = Math.floor(s / 7), l = Math.floor(s / 30), u = Math.floor(s / 365);
	return i < 60 ? `${Math.max(1, i)} sec${i === 1 ? "" : "s"} ago` : a < 60 ? `${a} min${a === 1 ? "" : "s"} ago` : o < 24 ? `${o} hour${o === 1 ? "" : "s"} ago` : s < 7 ? `${s} day${s === 1 ? "" : "s"} ago` : c < 4 ? `${c} week${c === 1 ? "" : "s"} ago` : l < 12 ? `${l} month${l === 1 ? "" : "s"} ago` : `${u} year${u === 1 ? "" : "s"} ago`;
}, g = (e, t) => e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth() && e.getDate() === t.getDate(), _ = (e) => e.toLocaleDateString("en-US", {
	month: "short",
	day: "numeric",
	year: "numeric"
}), v = (t, n) => ((/* @__PURE__ */ new Date()).getTime() - t.getTime()) / e <= n;
//#endregion
export { e as MS_PER_DAY, h as calculateRelativeTime, p as formatDate, _ as formatTimestampDate, m as formatTxTimestamp, u as getCurrentDayStart, n as getCurrentTimeInSeconds, o as getCurrentWeekStart, l as getDelayUntilUtc8, a as getEffectiveSevenDaysAgo, i as getEffectiveToday, c as getNextDayDelay, f as getNextDayISO, s as getPreviousWeekStart, d as getUtcDayStart, g as isSameDay, v as isWithinDays, r as msToISOString, t as waitLittle };
