"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var DoorLockServer_exports = {};
__export(DoorLockServer_exports, {
  DoorLockServer: () => DoorLockServer
});
module.exports = __toCommonJS(DoorLockServer_exports);
var import_general = require("@matter/general");
var import_door_lock = require("@matter/types/clusters/door-lock");
var import_DoorLockBehavior = require("./DoorLockBehavior.js");
/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
const LockState = import_door_lock.DoorLock.LockState;
class DoorLockServer extends import_DoorLockBehavior.DoorLockBehavior {
  initialize() {
    if (!Object.values(this.state.supportedOperatingModes).some((v) => v)) {
      this.state.supportedOperatingModes = { vacation: true, privacy: true, passage: true, alwaysSet: 2047 };
    } else {
      if (this.state.supportedOperatingModes.alwaysSet !== 2047) {
        throw new import_general.ImplementationError(
          `DoorLockServer: The "alwaysSet" bit-range in supportedOperatingModes must be set. Please check the specification about the meaning of this field because bits are inverted here!`
        );
      }
    }
  }
  lockDoor() {
    this.state.lockState = LockState.Locked;
  }
  unlockDoor() {
    this.state.lockState = LockState.Unlocked;
  }
}
//# sourceMappingURL=DoorLockServer.js.map
