/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import { decamelize } from "#general";
import { ClusterModel, Matter } from "#model";
import { Status } from "#types";
class ExpandedStatus {
  id;
  status;
  clusterStatus;
  constructor({ matter, status, cluster, clusterStatus }) {
    this.status = status ?? Status.Failure;
    this.clusterStatus = clusterStatus;
    let statusStr;
    if (status !== Status.Failure) {
      const name = Status[this.status];
      if (name === void 0) {
        statusStr = `unknown-${this.status}`;
      } else {
        statusStr = decamelize(name);
      }
    }
    if (clusterStatus === void 0) {
      this.id = statusStr ?? "failure";
      return;
    }
    let clusterStr;
    if (typeof cluster === "number") {
      matter ??= Matter;
      const model = matter.get(ClusterModel, cluster);
      if (model === void 0) {
        clusterStr = `cluster-${cluster}`;
      } else {
        clusterStr = decamelize(model.name);
      }
    } else if (cluster) {
      clusterStr = decamelize(cluster.name);
    } else {
      clusterStr = "unknown-cluster";
    }
    if (statusStr === void 0) {
      this.id = clusterStr;
      return;
    }
    this.id = `${statusStr}+${clusterStr}`;
  }
}
export {
  ExpandedStatus
};
//# sourceMappingURL=ExpandedStatus.js.map
