"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 operational_state_element_exports = {};
__export(operational_state_element_exports, {
  OperationalState: () => OperationalState
});
module.exports = __toCommonJS(operational_state_element_exports);
var import_MatterDefinition = require("../MatterDefinition.js");
var import_elements = require("../../elements/index.js");
/**
 * @license
 * Copyright 2022-2025 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
const OperationalState = (0, import_elements.ClusterElement)(
  { name: "OperationalState", id: 96, classification: "application" },
  (0, import_elements.AttributeElement)({ name: "ClusterRevision", id: 65533, type: "ClusterRevision", default: 3 }),
  (0, import_elements.AttributeElement)(
    {
      name: "PhaseList",
      id: 0,
      type: "list",
      access: "R V",
      conformance: "M",
      constraint: "max 32[max 64]",
      quality: "X"
    },
    (0, import_elements.FieldElement)({ name: "entry", type: "string" })
  ),
  (0, import_elements.AttributeElement)({ name: "CurrentPhase", id: 1, type: "uint8", access: "R V", conformance: "M", constraint: "desc", quality: "X" }),
  (0, import_elements.AttributeElement)({
    name: "CountdownTime",
    id: 2,
    type: "elapsed-s",
    access: "R V",
    conformance: "O",
    constraint: "max 259200",
    default: null,
    quality: "X Q"
  }),
  (0, import_elements.AttributeElement)(
    { name: "OperationalStateList", id: 3, type: "list", access: "R V", conformance: "M", constraint: "desc" },
    (0, import_elements.FieldElement)({ name: "entry", type: "OperationalStateStruct" })
  ),
  (0, import_elements.AttributeElement)({ name: "OperationalState", id: 4, type: "OperationalStateEnum", access: "R V", conformance: "M" }),
  (0, import_elements.AttributeElement)({
    name: "OperationalError",
    id: 5,
    type: "ErrorStateStruct",
    access: "R V",
    conformance: "M",
    constraint: "desc"
  }),
  (0, import_elements.EventElement)(
    { name: "OperationalError", id: 0, access: "V", conformance: "M", priority: "critical" },
    (0, import_elements.FieldElement)({ name: "ErrorState", id: 0, type: "ErrorStateStruct", conformance: "M" })
  ),
  (0, import_elements.EventElement)(
    { name: "OperationCompletion", id: 1, access: "V", conformance: "O", priority: "info" },
    (0, import_elements.FieldElement)({ name: "CompletionErrorCode", id: 0, type: "enum8", conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "TotalOperationalTime", id: 1, type: "elapsed-s", conformance: "O", quality: "X" }),
    (0, import_elements.FieldElement)({ name: "PausedTime", id: 2, type: "elapsed-s", conformance: "O", quality: "X" })
  ),
  (0, import_elements.CommandElement)({
    name: "Pause",
    id: 0,
    access: "O",
    conformance: "Resume, O",
    direction: "request",
    response: "OperationalCommandResponse"
  }),
  (0, import_elements.CommandElement)({
    name: "Stop",
    id: 1,
    access: "O",
    conformance: "Start, O",
    direction: "request",
    response: "OperationalCommandResponse"
  }),
  (0, import_elements.CommandElement)({
    name: "Start",
    id: 2,
    access: "O",
    conformance: "O",
    direction: "request",
    response: "OperationalCommandResponse"
  }),
  (0, import_elements.CommandElement)({
    name: "Resume",
    id: 3,
    access: "O",
    conformance: "Pause, O",
    direction: "request",
    response: "OperationalCommandResponse"
  }),
  (0, import_elements.CommandElement)(
    {
      name: "OperationalCommandResponse",
      id: 4,
      access: "O",
      conformance: "Pause | Stop | Start | Resume",
      direction: "response"
    },
    (0, import_elements.FieldElement)({ name: "CommandResponseState", id: 0, type: "ErrorStateStruct", conformance: "M" })
  ),
  (0, import_elements.DatatypeElement)(
    { name: "OperationalStateEnum", type: "enum8" },
    (0, import_elements.FieldElement)({ name: "Stopped", id: 0, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "Running", id: 1, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "Paused", id: 2, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "Error", id: 3, conformance: "M" })
  ),
  (0, import_elements.DatatypeElement)(
    { name: "OperationalStateStruct", type: "struct" },
    (0, import_elements.FieldElement)({ name: "OperationalStateId", id: 0, type: "OperationalStateEnum", conformance: "M", default: 0 }),
    (0, import_elements.FieldElement)({
      name: "OperationalStateLabel",
      id: 1,
      type: "string",
      conformance: "OperationalStateID >= 128 & OperationalStateID <= 191",
      constraint: "max 64"
    })
  ),
  (0, import_elements.DatatypeElement)(
    { name: "ErrorStateEnum", type: "enum8" },
    (0, import_elements.FieldElement)({ name: "NoError", id: 0, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "UnableToStartOrResume", id: 1, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "UnableToCompleteOperation", id: 2, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "CommandInvalidInState", id: 3, conformance: "M" })
  ),
  (0, import_elements.DatatypeElement)(
    { name: "ErrorStateStruct", type: "struct" },
    (0, import_elements.FieldElement)({ name: "ErrorStateId", id: 0, type: "ErrorStateEnum", conformance: "M", default: 0 }),
    (0, import_elements.FieldElement)({
      name: "ErrorStateLabel",
      id: 1,
      type: "string",
      conformance: "ErrorStateID >= 128 & ErrorStateID <= 191",
      constraint: "max 64"
    }),
    (0, import_elements.FieldElement)({ name: "ErrorStateDetails", id: 2, type: "string", conformance: "O", constraint: "max 64" })
  )
);
import_MatterDefinition.MatterDefinition.children.push(OperationalState);
//# sourceMappingURL=operational-state.element.js.map
