/**
 * @license
 * Copyright 2022-2025 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import { MatterDefinition } from "../MatterDefinition.js";
import {
  ClusterElement as Cluster,
  AttributeElement as Attribute,
  FieldElement as Field,
  CommandElement as Command,
  DatatypeElement as Datatype
} from "../../elements/index.js";
const IcdManagement = Cluster(
  { name: "IcdManagement", id: 70, classification: "node" },
  Attribute({ name: "ClusterRevision", id: 65533, type: "ClusterRevision", default: 3 }),
  Attribute(
    { name: "FeatureMap", id: 65532, type: "FeatureMap" },
    Field({ name: "CIP", conformance: "LITS, O", constraint: "0", title: "CheckInProtocolSupport" }),
    Field({ name: "UAT", conformance: "LITS, O", constraint: "1", title: "UserActiveModeTrigger" }),
    Field({ name: "LITS", conformance: "O", constraint: "2", title: "LongIdleTimeSupport" }),
    Field({ name: "DSLS", conformance: "[LITS]", constraint: "3", title: "DynamicSitLitSupport" })
  ),
  Attribute({
    name: "IdleModeDuration",
    id: 0,
    type: "uint32",
    access: "R V",
    conformance: "M",
    constraint: "1 to 64800",
    default: 1,
    quality: "F"
  }),
  Attribute({
    name: "ActiveModeDuration",
    id: 1,
    type: "uint32",
    access: "R V",
    conformance: "M",
    default: 300,
    quality: "F"
  }),
  Attribute({
    name: "ActiveModeThreshold",
    id: 2,
    type: "uint16",
    access: "R V",
    conformance: "M",
    default: 300,
    quality: "F"
  }),
  Attribute(
    {
      name: "RegisteredClients",
      id: 3,
      type: "list",
      access: "R F A",
      conformance: "CIP",
      constraint: "desc",
      default: [],
      quality: "N"
    },
    Field({ name: "entry", type: "MonitoringRegistrationStruct" })
  ),
  Attribute(
    { name: "IcdCounter", id: 4, type: "uint32", access: "R A", conformance: "CIP", default: 0, quality: "N C" }
  ),
  Attribute({
    name: "ClientsSupportedPerFabric",
    id: 5,
    type: "uint16",
    access: "R V",
    conformance: "CIP",
    constraint: "min 1",
    default: 1,
    quality: "F"
  }),
  Attribute({
    name: "UserActiveModeTriggerHint",
    id: 6,
    type: "UserActiveModeTriggerBitmap",
    access: "R V",
    conformance: "UAT",
    constraint: "desc",
    default: 0,
    quality: "F"
  }),
  Attribute({
    name: "UserActiveModeTriggerInstruction",
    id: 7,
    type: "string",
    access: "R V",
    conformance: "desc",
    constraint: "max 128",
    quality: "F"
  }),
  Attribute({ name: "OperatingMode", id: 8, type: "OperatingModeEnum", access: "R V", conformance: "LITS" }),
  Attribute({
    name: "MaximumCheckInBackoff",
    id: 9,
    type: "uint32",
    access: "R V",
    conformance: "CIP",
    constraint: "idleModeDuration to 64800",
    default: 1,
    quality: "F"
  }),
  Command(
    {
      name: "RegisterClient",
      id: 0,
      access: "F M",
      conformance: "CIP",
      direction: "request",
      response: "RegisterClientResponse"
    },
    Field({ name: "CheckInNodeId", id: 0, type: "node-id", conformance: "M" }),
    Field({ name: "MonitoredSubject", id: 1, type: "subject-id", conformance: "M" }),
    Field({ name: "Key", id: 2, type: "octstr", conformance: "M", constraint: "16" }),
    Field({ name: "VerificationKey", id: 3, type: "octstr", conformance: "O", constraint: "16" }),
    Field({ name: "ClientType", id: 4, type: "ClientTypeEnum", conformance: "M" })
  ),
  Command(
    { name: "RegisterClientResponse", id: 1, conformance: "CIP", direction: "response" },
    Field({ name: "IcdCounter", id: 0, type: "uint32", conformance: "M" })
  ),
  Command(
    {
      name: "UnregisterClient",
      id: 2,
      access: "F M",
      conformance: "CIP",
      direction: "request",
      response: "status"
    },
    Field({ name: "CheckInNodeId", id: 0, type: "node-id", conformance: "M" }),
    Field({ name: "VerificationKey", id: 1, type: "octstr", conformance: "O", constraint: "16" })
  ),
  Command(
    {
      name: "StayActiveRequest",
      id: 3,
      access: "O",
      conformance: "LITS, O",
      direction: "request",
      response: "StayActiveResponse"
    },
    Field({ name: "StayActiveDuration", id: 0, type: "uint32", conformance: "M" })
  ),
  Command(
    { name: "StayActiveResponse", id: 4, conformance: "LITS, O", direction: "response" },
    Field({ name: "PromisedActiveDuration", id: 0, type: "uint32", conformance: "M", constraint: "desc" })
  ),
  Datatype(
    { name: "UserActiveModeTriggerBitmap", type: "map32" },
    Field({ name: "PowerCycle", constraint: "0" }),
    Field({ name: "SettingsMenu", constraint: "1" }),
    Field({ name: "CustomInstruction", constraint: "2" }),
    Field({ name: "DeviceManual", constraint: "3" }),
    Field({ name: "ActuateSensor", constraint: "4" }),
    Field({ name: "ActuateSensorSeconds", constraint: "5" }),
    Field({ name: "ActuateSensorTimes", constraint: "6" }),
    Field({ name: "ActuateSensorLightsBlink", constraint: "7" }),
    Field({ name: "ResetButton", constraint: "8" }),
    Field({ name: "ResetButtonLightsBlink", constraint: "9" }),
    Field({ name: "ResetButtonSeconds", constraint: "10" }),
    Field({ name: "ResetButtonTimes", constraint: "11" }),
    Field({ name: "SetupButton", constraint: "12" }),
    Field({ name: "SetupButtonSeconds", constraint: "13" }),
    Field({ name: "SetupButtonLightsBlink", constraint: "14" }),
    Field({ name: "SetupButtonTimes", constraint: "15" }),
    Field({ name: "AppDefinedButton", constraint: "16" })
  ),
  Datatype(
    { name: "ClientTypeEnum", type: "enum8" },
    Field({ name: "Permanent", id: 0, conformance: "M" }),
    Field({ name: "Ephemeral", id: 1, conformance: "M" })
  ),
  Datatype(
    { name: "OperatingModeEnum", type: "enum8" },
    Field({ name: "Sit", id: 0, conformance: "M" }),
    Field({ name: "Lit", id: 1, conformance: "M" })
  ),
  Datatype(
    { name: "MonitoringRegistrationStruct", type: "struct" },
    Field({ name: "CheckInNodeId", id: 1, type: "node-id", access: "S", conformance: "M", quality: "N" }),
    Field({ name: "MonitoredSubject", id: 2, type: "subject-id", access: "S", conformance: "M", quality: "N" }),
    Field({ name: "Key", id: 3, access: "F", conformance: "D" }),
    Field({
      name: "ClientType",
      id: 4,
      type: "ClientTypeEnum",
      access: "S",
      conformance: "M",
      default: 0,
      quality: "N"
    }),
    Field({ name: "FabricIndex", id: 254, type: "FabricIndex" })
  )
);
MatterDefinition.children.push(IcdManagement);
export {
  IcdManagement
};
//# sourceMappingURL=icd-management.element.js.map
