"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 scenes_management_exports = {};
__export(scenes_management_exports, {
  ScenesManagement: () => ScenesManagement,
  ScenesManagementCluster: () => ScenesManagementCluster
});
module.exports = __toCommonJS(scenes_management_exports);
var import_MutableCluster = require("../cluster/mutation/MutableCluster.js");
var import_BitmapSchema = require("../schema/BitmapSchema.js");
var import_Cluster = require("../cluster/Cluster.js");
var import_NodeId = require("../datatype/NodeId.js");
var import_TlvNullable = require("../tlv/TlvNullable.js");
var import_TlvNumber = require("../tlv/TlvNumber.js");
var import_TlvArray = require("../tlv/TlvArray.js");
var import_TlvObject = require("../tlv/TlvObject.js");
var import_GroupId = require("../datatype/GroupId.js");
var import_TlvBoolean = require("../tlv/TlvBoolean.js");
var import_FabricIndex = require("../datatype/FabricIndex.js");
var import_TlvString = require("../tlv/TlvString.js");
var import_ClusterId = require("../datatype/ClusterId.js");
var import_AttributeId = require("../datatype/AttributeId.js");
var import_model = require("#model");
var import_ClusterRegistry = require("../cluster/ClusterRegistry.js");
/**
 * @license
 * Copyright 2022-2025 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
var ScenesManagement;
((ScenesManagement2) => {
  let Feature;
  ((Feature2) => {
    Feature2["SceneNames"] = "SceneNames";
  })(Feature = ScenesManagement2.Feature || (ScenesManagement2.Feature = {}));
  ScenesManagement2.TlvSceneInfo = (0, import_TlvObject.TlvObject)({
    /**
     * This field shall indicate the number of scenes currently used in the server’s Scene Table on the endpoint
     * where the Scenes Management cluster appears.
     *
     * This only includes the count for the associated fabric.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 1.4.7.2.1
     */
    sceneCount: (0, import_TlvObject.TlvField)(0, import_TlvNumber.TlvUInt8),
    /**
     * This field shall indicate the scene identifier of the scene last invoked on the associated fabric. If no
     * scene has been invoked, the value of this field shall be 0xFF, the undefined scene identifier.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 1.4.7.2.2
     */
    currentScene: (0, import_TlvObject.TlvField)(1, import_TlvNumber.TlvUInt8),
    /**
     * This field shall indicate the group identifier of the scene last invoked on the associated fabric, or 0 if
     * the scene last invoked is not associated with a group.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 1.4.7.2.3
     */
    currentGroup: (0, import_TlvObject.TlvField)(2, import_GroupId.TlvGroupId),
    /**
     * This field shall indicate whether the state of the server corresponds to that associated with the
     * CurrentScene and CurrentGroup fields of the SceneInfoStruct they belong to. TRUE indicates that these fields
     * are valid, FALSE indicates that they are not valid.
     *
     * This field shall be set to False for all other fabrics when an attribute with the Scenes ("S") designation
     * in the Quality column of another cluster present on the same endpoint is modified or when the current scene
     * is modified by a fabric through the RecallScene or StoreScene commands, regardless of the fabric-scoped
     * access quality of the command.
     *
     * In the event where the SceneValid field is set to False for a fabric, the CurrentScene and CurrentGroup
     * fields shall be the last invoked scene and group for that fabric. In the event where no scene was previously
     * invoked for that fabric, the CurrentScene and CurrentGroup fields shall be their default values.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 1.4.7.2.4
     */
    sceneValid: (0, import_TlvObject.TlvField)(3, import_TlvBoolean.TlvBoolean),
    /**
     * This field shall indicate the remaining capacity of the Scene Table on this endpoint for the accessing
     * fabric. Note that this value may change between reads, even if no entries are added or deleted on the
     * accessing fabric, due to other clients associated with other fabrics adding or deleting entries that impact
     * the resource usage on the device.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 1.4.7.2.5
     */
    remainingCapacity: (0, import_TlvObject.TlvField)(4, import_TlvNumber.TlvUInt8.bound({ max: 253 })),
    fabricIndex: (0, import_TlvObject.TlvField)(254, import_FabricIndex.TlvFabricIndex)
  });
  ScenesManagement2.TlvAttributeValuePair = (0, import_TlvObject.TlvObject)({
    /**
     * This field shall be present for all instances in a given ExtensionFieldSetStruct.
     *
     * The data type of AttributeValue shall be the data type of the attribute indicated by AttributeID.
     *
     * The AttributeID field shall NOT refer to an attribute without the Scenes ("S") designation in the Quality
     * column of the cluster specification.
     *
     *   1.4.7.3.2. ValueUnsigned8, ValueSigned8, ValueUnsigned16, ValueSigned16, ValueUnsigned32, ValueSigned32,
     *              ValueUnsigned64, ValueSigned64 Fields
     *
     * These fields shall indicate the attribute value as part of an extension field set, associated with a given
     * AttributeID under an ExtensionFieldSetStruct’s ClusterID. The proper field shall be present that maps to the
     * data type of the attribute indicated.
     *
     *   • Data types bool, map8, and uint8 shall map to ValueUnsigned8.
     *
     *   • Data types int8 shall map to ValueSigned8.
     *
     *   • Data types map16 and uint16 shall map to ValueUnsigned16.
     *
     *   • Data types int16 shall map to ValueSigned16.
     *
     *   • Data types map32, uint24, and uint32 shall map to ValueUnsigned32.
     *
     *   • Data types int24 and int32 shall map to ValueSigned32.
     *
     *   • Data types map64, uint48, uint56 and uint64 shall map to ValueUnsigned64.
     *
     *   • Data types int48, int56 and int64 shall map to ValueSigned64.
     *
     *   • For nullable attributes, any value that is not a valid numeric value for the attribute’s type after
     *     accounting for range reductions due to being nullable and constraints shall be considered to have the
     *     null value for the type.
     *
     *   • For non-nullable attributes, any value that is not a valid numeric value for the attribute’s type after
     *     accounting for constraints shall be considered to have the maximum legal value in the attribute’s
     *     constrained range.
     *
     * Examples of processing are:
     *
     *   • ColorControl cluster CurrentX (AttributeID 0x0003) has a type of uint16 and is not nullable.
     *
     *     ◦ AttributeValue of 0xAB12 would be used as-is, as it is in range.
     *
     *     ◦ AttributeValue of 0xAA0011 is outside of the range of uint16, and would be saturated to the maximum of
     *       the attribute’s constraint range: 0xFEFF.
     *
     *   • LevelControl cluster CurrentLevel (AttributeID 0x0000) has a type of uint8 and is nullable.
     *
     *     ◦ AttributeValue of 0xA1 would be used as-is, as it is in range.
     *
     *     ◦ AttributeValue of 0xBB12 is outside the range of nullable uint8, and would be considered as the null
     *       value.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 1.4.7.3.1
     */
    attributeId: (0, import_TlvObject.TlvField)(0, import_AttributeId.TlvAttributeId),
    valueUnsigned8: (0, import_TlvObject.TlvOptionalField)(1, import_TlvNumber.TlvUInt8),
    valueSigned8: (0, import_TlvObject.TlvOptionalField)(2, import_TlvNumber.TlvInt8),
    valueUnsigned16: (0, import_TlvObject.TlvOptionalField)(3, import_TlvNumber.TlvUInt16),
    valueSigned16: (0, import_TlvObject.TlvOptionalField)(4, import_TlvNumber.TlvInt16),
    valueUnsigned32: (0, import_TlvObject.TlvOptionalField)(5, import_TlvNumber.TlvUInt32),
    valueSigned32: (0, import_TlvObject.TlvOptionalField)(6, import_TlvNumber.TlvInt32),
    valueUnsigned64: (0, import_TlvObject.TlvOptionalField)(7, import_TlvNumber.TlvUInt64),
    valueSigned64: (0, import_TlvObject.TlvOptionalField)(8, import_TlvNumber.TlvInt64)
  });
  ScenesManagement2.TlvExtensionFieldSet = (0, import_TlvObject.TlvObject)({
    /**
     * This field shall indicate the cluster-id of the cluster whose attributes are in the AttributeValueList field.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 1.4.7.4.1
     */
    clusterId: (0, import_TlvObject.TlvField)(0, import_ClusterId.TlvClusterId),
    /**
     * This field shall indicate a set of attributes and their values which are stored as part of a scene.
     *
     * Attributes which do not have the Scenes ("S") designation in the Quality column of their cluster
     * specification shall NOT be used in the AttributeValueList field.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 1.4.7.4.2
     */
    attributeValueList: (0, import_TlvObject.TlvField)(1, (0, import_TlvArray.TlvArray)(ScenesManagement2.TlvAttributeValuePair))
  });
  ScenesManagement2.TlvAddSceneRequest = (0, import_TlvObject.TlvObject)({
    /**
     * This field shall indicate the group identifier in the Group Table.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 1.4.9.2.1
     */
    groupId: (0, import_TlvObject.TlvField)(0, import_GroupId.TlvGroupId),
    /**
     * This field shall indicate the scene identifier in the Scene Table.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 1.4.9.2.2
     */
    sceneId: (0, import_TlvObject.TlvField)(1, import_TlvNumber.TlvUInt8.bound({ max: 254 })),
    /**
     * This field shall indicate the transition time of the scene, measured in milliseconds.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 1.4.9.2.3
     */
    transitionTime: (0, import_TlvObject.TlvField)(2, import_TlvNumber.TlvUInt32.bound({ max: 6e7 })),
    /**
     * This field shall indicate the name of the scene.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 1.4.9.2.4
     */
    sceneName: (0, import_TlvObject.TlvField)(3, import_TlvString.TlvString.bound({ maxLength: 16 })),
    /**
     * This field shall contains the list of extension fields.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 1.4.9.2.5
     */
    extensionFieldSetStructs: (0, import_TlvObject.TlvField)(4, (0, import_TlvArray.TlvArray)(ScenesManagement2.TlvExtensionFieldSet))
  });
  ScenesManagement2.TlvAddSceneResponse = (0, import_TlvObject.TlvObject)({
    /**
     * This field shall be set according to the Effect on Receipt section for AddScene command.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 1.4.9.3.1
     */
    status: (0, import_TlvObject.TlvField)(0, (0, import_TlvNumber.TlvEnum)()),
    /**
     * The GroupID field shall be set to the corresponding field of the received AddScene command.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 1.4.9.3.2
     */
    groupId: (0, import_TlvObject.TlvField)(1, import_GroupId.TlvGroupId),
    /**
     * The SceneID field shall be set to the corresponding field of the received AddScene command.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 1.4.9.3.3
     */
    sceneId: (0, import_TlvObject.TlvField)(2, import_TlvNumber.TlvUInt8.bound({ max: 254 }))
  });
  ScenesManagement2.TlvViewSceneRequest = (0, import_TlvObject.TlvObject)({
    /**
     * This field shall indicate the group identifier in the Group Table.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 1.4.9.4.1
     */
    groupId: (0, import_TlvObject.TlvField)(0, import_GroupId.TlvGroupId),
    /**
     * This field shall indicate the scene identifier in the Scene Table.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 1.4.9.4.2
     */
    sceneId: (0, import_TlvObject.TlvField)(1, import_TlvNumber.TlvUInt8.bound({ max: 254 }))
  });
  ScenesManagement2.TlvViewSceneResponse = (0, import_TlvObject.TlvObject)({
    /**
     * This field shall be set according to the Effect on Receipt section for ViewScene command.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 1.4.9.5.1
     */
    status: (0, import_TlvObject.TlvField)(0, (0, import_TlvNumber.TlvEnum)()),
    /**
     * The GroupID field shall be set to the corresponding field of the received ViewScene command.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 1.4.9.5.2
     */
    groupId: (0, import_TlvObject.TlvField)(1, import_GroupId.TlvGroupId),
    /**
     * The SceneID field shall be set to the corresponding field of the received ViewScene command.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 1.4.9.5.3
     */
    sceneId: (0, import_TlvObject.TlvField)(2, import_TlvNumber.TlvUInt8.bound({ max: 254 })),
    /**
     * If the status is SUCCESS, this field shall be copied from the corresponding field in the Scene Table entry,
     * otherwise it shall be omitted.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 1.4.9.5.4
     */
    transitionTime: (0, import_TlvObject.TlvOptionalField)(3, import_TlvNumber.TlvUInt32.bound({ max: 6e7 })),
    /**
     * If the status is SUCCESS, this field shall be copied from the corresponding field in the Scene Table entry,
     * otherwise it shall be omitted.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 1.4.9.5.5
     */
    sceneName: (0, import_TlvObject.TlvOptionalField)(4, import_TlvString.TlvString.bound({ maxLength: 16 })),
    /**
     * If the status is SUCCESS, this field shall be copied from the corresponding field in the Scene Table entry,
     * otherwise it shall be omitted.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 1.4.9.5.6
     */
    extensionFieldSetStructs: (0, import_TlvObject.TlvOptionalField)(5, (0, import_TlvArray.TlvArray)(ScenesManagement2.TlvExtensionFieldSet))
  });
  ScenesManagement2.TlvRemoveSceneRequest = (0, import_TlvObject.TlvObject)({
    /**
     * This field shall indicate the group identifier in the Group Table.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 1.4.9.6.1
     */
    groupId: (0, import_TlvObject.TlvField)(0, import_GroupId.TlvGroupId),
    /**
     * This field shall indicate the scene identifier in the Scene Table.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 1.4.9.6.2
     */
    sceneId: (0, import_TlvObject.TlvField)(1, import_TlvNumber.TlvUInt8.bound({ max: 254 }))
  });
  ScenesManagement2.TlvRemoveSceneResponse = (0, import_TlvObject.TlvObject)({
    /**
     * This field shall be set according to the Effect on Receipt section for RemoveScene command.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 1.4.9.7.1
     */
    status: (0, import_TlvObject.TlvField)(0, (0, import_TlvNumber.TlvEnum)()),
    /**
     * The GroupID field shall be set to the corresponding field of the received RemoveScene command.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 1.4.9.7.2
     */
    groupId: (0, import_TlvObject.TlvField)(1, import_GroupId.TlvGroupId),
    /**
     * The SceneID field shall be set to the corresponding field of the received RemoveScene command.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 1.4.9.7.3
     */
    sceneId: (0, import_TlvObject.TlvField)(2, import_TlvNumber.TlvUInt8.bound({ max: 254 }))
  });
  ScenesManagement2.TlvRemoveAllScenesRequest = (0, import_TlvObject.TlvObject)({
    /**
     * This field shall indicate the group identifier in the Group Table.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 1.4.9.8.1
     */
    groupId: (0, import_TlvObject.TlvField)(0, import_GroupId.TlvGroupId)
  });
  ScenesManagement2.TlvRemoveAllScenesResponse = (0, import_TlvObject.TlvObject)({
    /**
     * This field shall be set according to the Effect on Receipt section for RemoveAllScenes command.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 1.4.9.9.1
     */
    status: (0, import_TlvObject.TlvField)(0, (0, import_TlvNumber.TlvEnum)()),
    /**
     * The GroupID field shall be set to the corresponding field of the received RemoveAllScenes command.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 1.4.9.9.2
     */
    groupId: (0, import_TlvObject.TlvField)(1, import_GroupId.TlvGroupId)
  });
  ScenesManagement2.TlvStoreSceneRequest = (0, import_TlvObject.TlvObject)({
    /**
     * This field shall indicate the group identifier in the Group Table.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 1.4.9.10.1
     */
    groupId: (0, import_TlvObject.TlvField)(0, import_GroupId.TlvGroupId),
    /**
     * This field shall indicate the scene identifier in the Scene Table.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 1.4.9.10.2
     */
    sceneId: (0, import_TlvObject.TlvField)(1, import_TlvNumber.TlvUInt8.bound({ max: 254 }))
  });
  ScenesManagement2.TlvStoreSceneResponse = (0, import_TlvObject.TlvObject)({
    /**
     * This field shall be set according to the Effect on Receipt section for StoreScene command.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 1.4.9.11.1
     */
    status: (0, import_TlvObject.TlvField)(0, (0, import_TlvNumber.TlvEnum)()),
    /**
     * The GroupID field shall be set to the corresponding field of the received StoreScene command.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 1.4.9.11.2
     */
    groupId: (0, import_TlvObject.TlvField)(1, import_GroupId.TlvGroupId),
    /**
     * The SceneID field shall be set to the corresponding field of the received StoreScene command.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 1.4.9.11.3
     */
    sceneId: (0, import_TlvObject.TlvField)(2, import_TlvNumber.TlvUInt8.bound({ max: 254 }))
  });
  ScenesManagement2.TlvRecallSceneRequest = (0, import_TlvObject.TlvObject)({
    /**
     * This field shall indicate the group identifier in the Group Table.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 1.4.9.12.1
     */
    groupId: (0, import_TlvObject.TlvField)(0, import_GroupId.TlvGroupId),
    /**
     * This field shall indicate the scene identifier in the Scene Table.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 1.4.9.12.2
     */
    sceneId: (0, import_TlvObject.TlvField)(1, import_TlvNumber.TlvUInt8.bound({ max: 254 })),
    /**
     * This field shall indicate the transition time of the scene, measured in milliseconds.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 1.4.9.12.3
     */
    transitionTime: (0, import_TlvObject.TlvOptionalField)(2, (0, import_TlvNullable.TlvNullable)(import_TlvNumber.TlvUInt32.bound({ max: 6e7 })))
  });
  ScenesManagement2.TlvGetSceneMembershipRequest = (0, import_TlvObject.TlvObject)({
    /**
     * This field shall indicate the group identifier in the Group Table.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 1.4.9.13.1
     */
    groupId: (0, import_TlvObject.TlvField)(0, import_GroupId.TlvGroupId)
  });
  ScenesManagement2.TlvGetSceneMembershipResponse = (0, import_TlvObject.TlvObject)({
    /**
     * This field shall be set according to the Effect on Receipt section for GetSceneMembership command.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 1.4.9.14.1
     */
    status: (0, import_TlvObject.TlvField)(0, (0, import_TlvNumber.TlvEnum)()),
    /**
     * This field shall contain the remaining capacity of the Scene Table of the server (for all groups for the
     * accessing fabric). The following values apply:
     *
     *   • 0 - No further scenes may be added.
     *
     *   • 0 < Capacity < 0xFE - Capacity holds the number of scenes that may be added.
     *
     *   • 0xFE - At least 1 further scene may be added (exact number is unknown).
     *
     *   • null - It is unknown if any further scenes may be added.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 1.4.9.14.2
     */
    capacity: (0, import_TlvObject.TlvField)(1, (0, import_TlvNullable.TlvNullable)(import_TlvNumber.TlvUInt8)),
    /**
     * This field shall be set to the corresponding field of the received GetSceneMembership command.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 1.4.9.14.3
     */
    groupId: (0, import_TlvObject.TlvField)(2, import_GroupId.TlvGroupId),
    /**
     * If the status is not SUCCESS then this field shall be omitted, else this field shall contain the identifiers
     * of all the scenes in the Scene Table with the corresponding Group ID.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 1.4.9.14.4
     */
    sceneList: (0, import_TlvObject.TlvOptionalField)(3, (0, import_TlvArray.TlvArray)(import_TlvNumber.TlvUInt8))
  });
  ScenesManagement2.CopyMode = {
    /**
     * Copy all scenes in the scene table
     */
    copyAllScenes: (0, import_BitmapSchema.BitFlag)(0)
  };
  ScenesManagement2.TlvCopySceneRequest = (0, import_TlvObject.TlvObject)({
    /**
     * This field shall contain the information of how the scene copy is to proceed.
     *
     * The CopyAllScenes bit of the Mode indicates whether all scenes are to be copied. If this value is set to 1,
     * all scenes are to be copied and the SceneIdentifierFrom and SceneIdentifierTo fields shall be ignored.
     * Otherwise this bit is set to 0.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 1.4.9.15.1
     */
    mode: (0, import_TlvObject.TlvField)(0, (0, import_TlvNumber.TlvBitmap)(import_TlvNumber.TlvUInt8, ScenesManagement2.CopyMode)),
    /**
     * This field shall indicate the identifier of the group from which the scene is to be copied. Together with
     * the SceneIdentifierFrom field, this field uniquely identifies the scene to copy from the Scene Table.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 1.4.9.15.2
     */
    groupIdentifierFrom: (0, import_TlvObject.TlvField)(1, import_GroupId.TlvGroupId),
    /**
     * This field shall indicate the identifier of the scene from which the scene is to be copied. Together with
     * the GroupIdentifierFrom field, this field uniquely identifies the scene to copy from the Scene Table.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 1.4.9.15.3
     */
    sceneIdentifierFrom: (0, import_TlvObject.TlvField)(2, import_TlvNumber.TlvUInt8.bound({ max: 254 })),
    /**
     * This field shall indicate the identifier of the group to which the scene is to be copied. Together with the
     * SceneIdentifierTo field, this field uniquely identifies the scene to copy to the Scene Table.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 1.4.9.15.4
     */
    groupIdentifierTo: (0, import_TlvObject.TlvField)(3, import_GroupId.TlvGroupId),
    /**
     * This field shall indicate the identifier of the scene to which the scene is to be copied. Together with the
     * GroupIdentifierTo field, this field uniquely identifies the scene to copy to the Scene Table.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 1.4.9.15.5
     */
    sceneIdentifierTo: (0, import_TlvObject.TlvField)(4, import_TlvNumber.TlvUInt8.bound({ max: 254 }))
  });
  ScenesManagement2.TlvCopySceneResponse = (0, import_TlvObject.TlvObject)({
    /**
     * This field shall be set according to the Effect on Receipt section for the CopyScene command.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 1.4.9.16.1
     */
    status: (0, import_TlvObject.TlvField)(0, (0, import_TlvNumber.TlvEnum)()),
    /**
     * This field shall be set to the same values as in the corresponding fields of the received CopyScene command.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 1.4.9.16.2
     */
    groupIdentifierFrom: (0, import_TlvObject.TlvField)(1, import_GroupId.TlvGroupId),
    /**
     * This field shall be set to the same values as in the corresponding fields of the received CopyScene
     *
     * command.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 1.4.9.16.3
     */
    sceneIdentifierFrom: (0, import_TlvObject.TlvField)(2, import_TlvNumber.TlvUInt8.bound({ max: 254 }))
  });
  ScenesManagement2.TlvLogicalSceneTable = (0, import_TlvObject.TlvObject)({
    /**
     * This field is the group identifier for which this scene applies, or 0 if the scene is not associated with a
     * group.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 1.4.7.5.1
     */
    sceneGroupId: (0, import_TlvObject.TlvField)(0, import_GroupId.TlvGroupId),
    /**
     * This field is unique within this group, which is used to identify this scene.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 1.4.7.5.2
     */
    sceneId: (0, import_TlvObject.TlvField)(1, import_TlvNumber.TlvUInt8.bound({ max: 254 })),
    /**
     * The field is the name of the scene.
     *
     * If scene names are not supported, any commands that write a scene name shall simply discard the name, and
     * any command that returns a scene name shall return an empty string.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 1.4.7.5.3
     */
    sceneName: (0, import_TlvObject.TlvOptionalField)(2, import_TlvString.TlvString.bound({ maxLength: 16 })),
    /**
     * This field is the amount of time, in milliseconds, it will take for a cluster to change from its current
     * state to the requested state.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 1.4.7.5.4
     */
    sceneTransitionTime: (0, import_TlvObject.TlvField)(3, import_TlvNumber.TlvUInt32.bound({ max: 6e7 })),
    /**
     * See the Scene Table Extensions subsections of individual clusters. A Scene Table Extension shall only use
     * attributes with the Scene quality. Each ExtensionFieldSetStruct holds a set of values of these attributes
     * for a cluster implemented on the same endpoint where the Scene ("S") designation appears in the quality
     * column. A scene is the aggregate of all such fields across all clusters on the endpoint.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 1.4.7.5.5
     */
    extensionFields: (0, import_TlvObject.TlvField)(4, (0, import_TlvArray.TlvArray)(ScenesManagement2.TlvExtensionFieldSet))
  });
  ScenesManagement2.Base = import_MutableCluster.MutableCluster.Component({
    id: 98,
    name: "ScenesManagement",
    revision: 1,
    features: {
      /**
       * SceneNames
       *
       * This feature indicates the ability to store a name for a scene when a scene is added.
       *
       * @see {@link MatterSpecification.v13.Cluster} § 1.4.4.1
       */
      sceneNames: (0, import_BitmapSchema.BitFlag)(0)
    },
    attributes: {
      /**
       * Indicates the Node ID of the node that last configured the Scene Table.
       *
       * The null value indicates that the server has not been configured, or that the identifier of the node
       * that last configured the Scenes Management cluster is not known.
       *
       * The Node ID is scoped to the accessing fabric.
       *
       * @see {@link MatterSpecification.v13.Cluster} § 1.4.8.1
       */
      lastConfiguredBy: (0, import_Cluster.OptionalAttribute)(0, (0, import_TlvNullable.TlvNullable)(import_NodeId.TlvNodeId), { default: null }),
      /**
       * Indicates the number of entries in the Scene Table on this endpoint. This is the total across all
       * fabrics; note that a single fabric cannot use all those entries (see Handling of fabric- scoping). The
       * minimum size of this table, (i.e., the minimum number of scenes to support across all fabrics per
       * endpoint) shall be 16, unless a device type in which this cluster is used, defines a larger value in the
       * device type definition.
       *
       * @see {@link MatterSpecification.v13.Cluster} § 1.4.8.2
       */
      sceneTableSize: (0, import_Cluster.FixedAttribute)(1, import_TlvNumber.TlvUInt16, { default: 16 }),
      /**
       * Indicates a list of fabric scoped information about scenes on this endpoint.
       *
       * The number of list entries for this attribute shall NOT exceed the number of supported fabrics by the
       * device.
       *
       * @see {@link MatterSpecification.v13.Cluster} § 1.4.8.3
       */
      fabricSceneInfo: (0, import_Cluster.FabricScopedAttribute)(2, (0, import_TlvArray.TlvArray)(ScenesManagement2.TlvSceneInfo), { default: [] })
    },
    commands: {
      /**
       * It is not mandatory for an extension field set to be included in the command for every cluster on that
       * endpoint that has a defined extension field set. Extension field sets may be omitted, including the case
       * of no extension field sets at all.
       *
       * @see {@link MatterSpecification.v13.Cluster} § 1.4.9.2
       */
      addScene: (0, import_Cluster.Command)(0, ScenesManagement2.TlvAddSceneRequest, 0, ScenesManagement2.TlvAddSceneResponse, { invokeAcl: import_model.AccessLevel.Manage }),
      /**
       * @see {@link MatterSpecification.v13.Cluster} § 1.4.9.4
       */
      viewScene: (0, import_Cluster.Command)(1, ScenesManagement2.TlvViewSceneRequest, 1, ScenesManagement2.TlvViewSceneResponse),
      /**
       * @see {@link MatterSpecification.v13.Cluster} § 1.4.9.6
       */
      removeScene: (0, import_Cluster.Command)(
        2,
        ScenesManagement2.TlvRemoveSceneRequest,
        2,
        ScenesManagement2.TlvRemoveSceneResponse,
        { invokeAcl: import_model.AccessLevel.Manage }
      ),
      /**
       * @see {@link MatterSpecification.v13.Cluster} § 1.4.9.8
       */
      removeAllScenes: (0, import_Cluster.Command)(
        3,
        ScenesManagement2.TlvRemoveAllScenesRequest,
        3,
        ScenesManagement2.TlvRemoveAllScenesResponse,
        { invokeAcl: import_model.AccessLevel.Manage }
      ),
      /**
       * @see {@link MatterSpecification.v13.Cluster} § 1.4.9.10
       */
      storeScene: (0, import_Cluster.Command)(
        4,
        ScenesManagement2.TlvStoreSceneRequest,
        4,
        ScenesManagement2.TlvStoreSceneResponse,
        { invokeAcl: import_model.AccessLevel.Manage }
      ),
      /**
       * @see {@link MatterSpecification.v13.Cluster} § 1.4.9.12
       */
      recallScene: (0, import_Cluster.Command)(5, ScenesManagement2.TlvRecallSceneRequest, 5, import_Cluster.TlvNoResponse),
      /**
       * This command can be used to get the used scene identifiers within a certain group, for the endpoint that
       * implements this cluster.
       *
       * @see {@link MatterSpecification.v13.Cluster} § 1.4.9.13
       */
      getSceneMembership: (0, import_Cluster.Command)(6, ScenesManagement2.TlvGetSceneMembershipRequest, 6, ScenesManagement2.TlvGetSceneMembershipResponse),
      /**
       * This command allows a client to efficiently copy scenes from one group/scene identifier pair to another
       * group/scene identifier pair.
       *
       * @see {@link MatterSpecification.v13.Cluster} § 1.4.9.15
       */
      copyScene: (0, import_Cluster.OptionalCommand)(
        64,
        ScenesManagement2.TlvCopySceneRequest,
        64,
        ScenesManagement2.TlvCopySceneResponse,
        { invokeAcl: import_model.AccessLevel.Manage }
      )
    },
    /**
     * This metadata controls which ScenesManagementCluster elements matter.js activates for specific feature
     * combinations.
     */
    extensions: import_MutableCluster.MutableCluster.Extensions()
  });
  ScenesManagement2.ClusterInstance = (0, import_MutableCluster.MutableCluster)(ScenesManagement2.Base);
  ScenesManagement2.Cluster = ScenesManagement2.ClusterInstance;
  ScenesManagement2.Complete = ScenesManagement2.Cluster;
})(ScenesManagement || (ScenesManagement = {}));
const ScenesManagementCluster = ScenesManagement.Cluster;
import_ClusterRegistry.ClusterRegistry.register(ScenesManagement.Complete);
//# sourceMappingURL=scenes-management.js.map
