"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 media_input_exports = {};
__export(media_input_exports, {
  MediaInput: () => MediaInput,
  MediaInputCluster: () => MediaInputCluster
});
module.exports = __toCommonJS(media_input_exports);
var import_MutableCluster = require("../cluster/mutation/MutableCluster.js");
var import_Cluster = require("../cluster/Cluster.js");
var import_TlvObject = require("../tlv/TlvObject.js");
var import_TlvNumber = require("../tlv/TlvNumber.js");
var import_TlvString = require("../tlv/TlvString.js");
var import_model = require("#model");
var import_BitmapSchema = require("../schema/BitmapSchema.js");
var import_TlvArray = require("../tlv/TlvArray.js");
var import_TlvNoArguments = require("../tlv/TlvNoArguments.js");
var import_ClusterRegistry = require("../cluster/ClusterRegistry.js");
/**
 * @license
 * Copyright 2022-2025 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
var MediaInput;
((MediaInput2) => {
  let Feature;
  ((Feature2) => {
    Feature2["NameUpdates"] = "NameUpdates";
  })(Feature = MediaInput2.Feature || (MediaInput2.Feature = {}));
  MediaInput2.TlvRenameInputRequest = (0, import_TlvObject.TlvObject)({ index: (0, import_TlvObject.TlvField)(0, import_TlvNumber.TlvUInt8), name: (0, import_TlvObject.TlvField)(1, import_TlvString.TlvString) });
  let InputType;
  ((InputType2) => {
    InputType2[InputType2["Internal"] = 0] = "Internal";
    InputType2[InputType2["Aux"] = 1] = "Aux";
    InputType2[InputType2["Coax"] = 2] = "Coax";
    InputType2[InputType2["Composite"] = 3] = "Composite";
    InputType2[InputType2["Hdmi"] = 4] = "Hdmi";
    InputType2[InputType2["Input"] = 5] = "Input";
    InputType2[InputType2["Line"] = 6] = "Line";
    InputType2[InputType2["Optical"] = 7] = "Optical";
    InputType2[InputType2["Video"] = 8] = "Video";
    InputType2[InputType2["Scart"] = 9] = "Scart";
    InputType2[InputType2["Usb"] = 10] = "Usb";
    InputType2[InputType2["Other"] = 11] = "Other";
  })(InputType = MediaInput2.InputType || (MediaInput2.InputType = {}));
  MediaInput2.TlvInputInfo = (0, import_TlvObject.TlvObject)({
    /**
     * This field shall indicate the unique index into the list of Inputs.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 6.9.5.2.1
     */
    index: (0, import_TlvObject.TlvField)(0, import_TlvNumber.TlvUInt8),
    /**
     * ### This field shall indicate the type of input
     *
     * @see {@link MatterSpecification.v142.Cluster} § 6.9.5.2.2
     */
    inputType: (0, import_TlvObject.TlvField)(1, (0, import_TlvNumber.TlvEnum)()),
    /**
     * This field shall indicate the input name, such as “HDMI 1”. This field may be blank, but SHOULD be provided
     * when known.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 6.9.5.2.3
     */
    name: (0, import_TlvObject.TlvField)(2, import_TlvString.TlvString),
    /**
     * This field shall indicate the user editable input description, such as “Living room Playstation”. This field
     * may be blank, but SHOULD be provided when known.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 6.9.5.2.4
     */
    description: (0, import_TlvObject.TlvField)(3, import_TlvString.TlvString)
  });
  MediaInput2.TlvSelectInputRequest = (0, import_TlvObject.TlvObject)({
    /**
     * This field shall indicate the index field of the InputInfoStruct from the InputList attribute in which to
     * change to.
     *
     * @see {@link MatterSpecification.v142.Cluster} § 6.9.7.1.1
     */
    index: (0, import_TlvObject.TlvField)(0, import_TlvNumber.TlvUInt8)
  });
  MediaInput2.NameUpdatesComponent = import_MutableCluster.MutableCluster.Component({
    commands: {
      /**
       * Upon receipt, this command shall rename the input at a specific index in the Input List. Updates to the
       * input name shall appear in the device’s settings menus.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 6.9.7.4
       */
      renameInput: (0, import_Cluster.Command)(3, MediaInput2.TlvRenameInputRequest, 3, import_Cluster.TlvNoResponse, { invokeAcl: import_model.AccessLevel.Manage })
    }
  });
  MediaInput2.Base = import_MutableCluster.MutableCluster.Component({
    id: 1287,
    name: "MediaInput",
    revision: 1,
    features: {
      /**
       * Supports updates to the input names
       */
      nameUpdates: (0, import_BitmapSchema.BitFlag)(0)
    },
    attributes: {
      /**
       * This attribute shall provide a list of the media inputs supported by the device.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 6.9.6.1
       */
      inputList: (0, import_Cluster.Attribute)(0, (0, import_TlvArray.TlvArray)(MediaInput2.TlvInputInfo), { default: [] }),
      /**
       * This attribute shall contain the value of the index field of the currently selected InputInfoStruct.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 6.9.6.2
       */
      currentInput: (0, import_Cluster.Attribute)(1, import_TlvNumber.TlvUInt8)
    },
    commands: {
      /**
       * Upon receipt, this command shall change the media input on the device to the input at a specific index in
       * the Input List.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 6.9.7.1
       */
      selectInput: (0, import_Cluster.Command)(0, MediaInput2.TlvSelectInputRequest, 0, import_Cluster.TlvNoResponse),
      /**
       * Upon receipt, this command shall display the active status of the input list on screen.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 6.9.7.2
       */
      showInputStatus: (0, import_Cluster.Command)(1, import_TlvNoArguments.TlvNoArguments, 1, import_Cluster.TlvNoResponse),
      /**
       * Upon receipt, this command shall hide the input list from the screen.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 6.9.7.3
       */
      hideInputStatus: (0, import_Cluster.Command)(2, import_TlvNoArguments.TlvNoArguments, 2, import_Cluster.TlvNoResponse)
    },
    /**
     * This metadata controls which MediaInputCluster elements matter.js activates for specific feature
     * combinations.
     */
    extensions: import_MutableCluster.MutableCluster.Extensions({ flags: { nameUpdates: true }, component: MediaInput2.NameUpdatesComponent })
  });
  MediaInput2.ClusterInstance = (0, import_MutableCluster.MutableCluster)(MediaInput2.Base);
  MediaInput2.Cluster = MediaInput2.ClusterInstance;
  const NU = { nameUpdates: true };
  MediaInput2.CompleteInstance = (0, import_MutableCluster.MutableCluster)({
    id: MediaInput2.Cluster.id,
    name: MediaInput2.Cluster.name,
    revision: MediaInput2.Cluster.revision,
    features: MediaInput2.Cluster.features,
    attributes: MediaInput2.Cluster.attributes,
    commands: {
      ...MediaInput2.Cluster.commands,
      renameInput: import_MutableCluster.MutableCluster.AsConditional(MediaInput2.NameUpdatesComponent.commands.renameInput, { mandatoryIf: [NU] })
    }
  });
  MediaInput2.Complete = MediaInput2.CompleteInstance;
})(MediaInput || (MediaInput = {}));
const MediaInputCluster = MediaInput.Cluster;
import_ClusterRegistry.ClusterRegistry.register(MediaInput.Complete);
//# sourceMappingURL=media-input.js.map
