"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 ClusterType_exports = {};
__export(ClusterType_exports, {
  ClusterType: () => ClusterType
});
module.exports = __toCommonJS(ClusterType_exports);
var import_ClusterId = require("../datatype/ClusterId.js");
var import_Cluster = require("./Cluster.js");
/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
function ClusterType(options) {
  const cluster = {
    id: (0, import_ClusterId.ClusterId)(options.id),
    name: options.name,
    revision: options.revision,
    features: options.features ?? {},
    supportedFeatures: options.supportedFeatures ?? {},
    attributes: {
      ...options.attributes,
      ...(0, import_Cluster.GlobalAttributes)(options.features ?? {})
    },
    commands: options.commands ?? {},
    events: options.events ?? {},
    unknown: false
  };
  if (options.base) {
    cluster.base = options.base;
  }
  if (options.extensions) {
    cluster.extensions = options.extensions;
  }
  return cluster;
}
((ClusterType2) => {
  ClusterType2.Unknown = ClusterType2({
    id: 0,
    revision: 0,
    name: "Unknown",
    attributes: {},
    commands: {},
    events: {}
  });
})(ClusterType || (ClusterType = {}));
//# sourceMappingURL=ClusterType.js.map
