const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');

//#region ../../node_modules/samlify/build/src/validator.js
var require_validator = /* @__PURE__ */ require_rolldown_runtime.__commonJS({ "../../node_modules/samlify/build/src/validator.js": ((exports) => {
	var __read = exports && exports.__read || function(o, n) {
		var m = typeof Symbol === "function" && o[Symbol.iterator];
		if (!m) return o;
		var i = m.call(o), r, ar = [], e;
		try {
			while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
		} catch (error) {
			e = { error };
		} finally {
			try {
				if (r && !r.done && (m = i["return"])) m.call(i);
			} finally {
				if (e) throw e.error;
			}
		}
		return ar;
	};
	Object.defineProperty(exports, "__esModule", { value: true });
	exports.verifyTime = void 0;
	function verifyTime(utcNotBefore, utcNotOnOrAfter, drift) {
		if (drift === void 0) drift = [0, 0];
		var now = /* @__PURE__ */ new Date();
		if (!utcNotBefore && !utcNotOnOrAfter) {
			console.warn("You intend to have time validation however the document doesn't include the valid range.");
			return true;
		}
		var notBeforeLocal = null;
		var notOnOrAfterLocal = null;
		var _a = __read(drift, 2), notBeforeDrift = _a[0], notOnOrAfterDrift = _a[1];
		if (utcNotBefore && !utcNotOnOrAfter) {
			notBeforeLocal = new Date(utcNotBefore);
			return +notBeforeLocal + notBeforeDrift <= +now;
		}
		if (!utcNotBefore && utcNotOnOrAfter) {
			notOnOrAfterLocal = new Date(utcNotOnOrAfter);
			return +now < +notOnOrAfterLocal + notOnOrAfterDrift;
		}
		notBeforeLocal = new Date(utcNotBefore);
		notOnOrAfterLocal = new Date(utcNotOnOrAfter);
		return +notBeforeLocal + notBeforeDrift <= +now && +now < +notOnOrAfterLocal + notOnOrAfterDrift;
	}
	exports.verifyTime = verifyTime;
}) });

//#endregion
Object.defineProperty(exports, 'default', {
  enumerable: true,
  get: function () {
    return require_validator();
  }
});
//# sourceMappingURL=validator.cjs.map