/**
 * @license
 * Copyright 2025-2026 Open Home Foundation
 * SPDX-License-Identifier: Apache-2.0
 */
import { ClusterId } from "@matter/main";
import {
  AcceptedCommandList,
  AttributeList,
  AttributeModel,
  ClusterRevision,
  CommandModel,
  EventModel,
  FeatureMap,
  GeneratedCommandList,
  Matter
} from "@matter/main/model";
const GlobalAttributes = Object.freeze({
  clusterRevision: ClusterRevision,
  [ClusterRevision.id]: ClusterRevision,
  featureMap: FeatureMap,
  [FeatureMap.id]: FeatureMap,
  attributeList: AttributeList,
  [AttributeList.id]: AttributeList,
  acceptedCommandList: AcceptedCommandList,
  [AcceptedCommandList.id]: AcceptedCommandList,
  generatedCommandList: GeneratedCommandList,
  [GeneratedCommandList.id]: GeneratedCommandList
});
const clusterMapBuilder = {};
Matter.clusters.forEach((cluster) => {
  if (cluster.id === void 0) {
    return;
  }
  const aces = cluster.allAces;
  const commands = {};
  const attributes = {};
  const events = {};
  aces.forEach((ace) => {
    const name = ace.name.toLowerCase();
    if (ace instanceof CommandModel) {
      commands[name] = ace;
      commands[ace.id] = ace;
    } else if (ace instanceof AttributeModel) {
      attributes[name] = ace;
      attributes[ace.id] = ace;
    } else if (ace instanceof EventModel) {
      events[name] = ace;
      events[ace.id] = ace;
    }
  });
  const clusterData = Object.freeze({
    clusterId: ClusterId(cluster.id),
    model: cluster,
    commands: Object.freeze(commands),
    attributes: Object.freeze(attributes),
    events: Object.freeze(events)
  });
  clusterMapBuilder[cluster.name.toLowerCase()] = clusterData;
  clusterMapBuilder[cluster.id] = clusterData;
});
const ClusterMap = Object.freeze(clusterMapBuilder);
export {
  ClusterMap,
  GlobalAttributes
};
//# sourceMappingURL=ModelMapper.js.map
