"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 binding_exports = {};
__export(binding_exports, {
  Binding: () => Binding,
  BindingCluster: () => BindingCluster
});
module.exports = __toCommonJS(binding_exports);
var import_MutableCluster = require("../cluster/mutation/MutableCluster.js");
var import_Cluster = require("../cluster/Cluster.js");
var import_TlvArray = require("../tlv/TlvArray.js");
var import_TlvObject = require("../tlv/TlvObject.js");
var import_NodeId = require("../datatype/NodeId.js");
var import_GroupId = require("../datatype/GroupId.js");
var import_EndpointNumber = require("../datatype/EndpointNumber.js");
var import_ClusterId = require("../datatype/ClusterId.js");
var import_FabricIndex = require("../datatype/FabricIndex.js");
var import_model = require("@matter/model");
var import_ClusterRegistry = require("../cluster/ClusterRegistry.js");
/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
var Binding;
((Binding2) => {
  Binding2.TlvTarget = (0, import_TlvObject.TlvObject)({
    /**
     * This field is the remote target node ID. If the Endpoint field is present, this field shall be present.
     *
     * @see {@link MatterSpecification.v142.Core} § 9.6.5.1.1
     */
    node: (0, import_TlvObject.TlvOptionalField)(1, import_NodeId.TlvNodeId),
    /**
     * This field is the target group ID that represents remote endpoints. If the Endpoint field is present, this
     * field shall NOT be present.
     *
     * @see {@link MatterSpecification.v142.Core} § 9.6.5.1.2
     */
    group: (0, import_TlvObject.TlvOptionalField)(2, import_GroupId.TlvGroupId),
    /**
     * This field is the remote endpoint that the local endpoint is bound to. If the Group field is present, this
     * field shall NOT be present.
     *
     * @see {@link MatterSpecification.v142.Core} § 9.6.5.1.3
     */
    endpoint: (0, import_TlvObject.TlvOptionalField)(3, import_EndpointNumber.TlvEndpointNumber),
    /**
     * This field is the cluster ID (client & server) on the local and target endpoint(s). If this field is present,
     * the client cluster shall also exist on this endpoint (with this Binding cluster). If this field is present,
     * the target shall be this cluster on the target endpoint(s).
     *
     * @see {@link MatterSpecification.v142.Core} § 9.6.5.1.4
     */
    cluster: (0, import_TlvObject.TlvOptionalField)(4, import_ClusterId.TlvClusterId),
    fabricIndex: (0, import_TlvObject.TlvField)(254, import_FabricIndex.TlvFabricIndex)
  });
  Binding2.ClusterInstance = (0, import_MutableCluster.MutableCluster)({
    id: 30,
    name: "Binding",
    revision: 1,
    attributes: {
      /**
       * Each entry shall represent a binding.
       *
       * @see {@link MatterSpecification.v142.Core} § 9.6.6.1
       */
      binding: (0, import_Cluster.WritableFabricScopedAttribute)(
        0,
        (0, import_TlvArray.TlvArray)(Binding2.TlvTarget),
        { persistent: true, default: [], writeAcl: import_model.AccessLevel.Manage }
      )
    }
  });
  Binding2.Cluster = Binding2.ClusterInstance;
  Binding2.Complete = Binding2.Cluster;
})(Binding || (Binding = {}));
const BindingCluster = Binding.Cluster;
import_ClusterRegistry.ClusterRegistry.register(Binding.Complete);
//# sourceMappingURL=binding.js.map
