/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import { Hours, ImplementationError, Millis, Seconds } from "#general";
function SessionIntervals(intervals) {
  const {
    idleInterval = SessionIntervals.defaults.idleInterval,
    activeInterval = SessionIntervals.defaults.activeInterval,
    activeThreshold = SessionIntervals.defaults.activeThreshold
  } = intervals ?? {};
  if (idleInterval > Hours.one) {
    throw new ImplementationError("Session Idle Interval must be less than 1 hour");
  }
  if (activeInterval > Hours.one) {
    throw new ImplementationError("Session Active Interval must be less than 1 hour");
  }
  if (activeThreshold > Seconds(65535)) {
    throw new ImplementationError("Session Active Threshold must be less than 65535 seconds");
  }
  return { idleInterval, activeInterval, activeThreshold };
}
((SessionIntervals2) => {
  SessionIntervals2.defaults = {
    idleInterval: Millis(500),
    activeInterval: Millis(300),
    activeThreshold: Seconds(4)
  };
})(SessionIntervals || (SessionIntervals = {}));
export {
  SessionIntervals
};
//# sourceMappingURL=SessionIntervals.js.map
