"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 KeypadInput_exports = {};
__export(KeypadInput_exports, {
  KeypadInput: () => KeypadInput
});
module.exports = __toCommonJS(KeypadInput_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 KeypadInput = (0, import_elements.ClusterElement)(
  {
    name: "KeypadInput",
    id: 1289,
    classification: "application",
    pics: "KEYPADINPUT",
    details: "This cluster provides an interface for key code based input and control on a device like a Video Player or an endpoint like a Content App. This may include text or action commands such as UP, DOWN, and SELECT.\nThis cluster would be supported on Video Player devices as well as devices that support remote control input from a keypad or remote. This cluster provides the list of supported keypad inputs and provides a command for sending them.\nThe cluster server for Keypad Input is implemented by a device that can receive keypad input, such as a Video Player, or an endpoint that can receive keypad input, such as a Content App.\nThe key codes used are those defined in the HDMI CEC specification (see HDMI).\nDevices may understand a subset of these key codes. Feature flags are used to indicate a specific subset that is supported. Device may support additional codes beyond what is indicated in feature flags.",
    xref: { document: "cluster", section: "6.8" }
  },
  (0, import_elements.AttributeElement)({ name: "ClusterRevision", id: 65533, type: "ClusterRevision", default: 1 }),
  (0, import_elements.AttributeElement)(
    { name: "FeatureMap", id: 65532, type: "FeatureMap", xref: { document: "cluster", section: "6.8.4" } },
    (0, import_elements.FieldElement)({
      name: "NV",
      constraint: "0",
      description: "NavigationKeyCodes",
      details: "Supports UP, DOWN, LEFT, RIGHT, SELECT, BACK, EXIT, MENU"
    }),
    (0, import_elements.FieldElement)({
      name: "LK",
      constraint: "1",
      description: "LocationKeys",
      details: "Supports CEC keys 0x0A (Settings) and 0x09 (Home)"
    }),
    (0, import_elements.FieldElement)({ name: "NK", constraint: "2", description: "NumberKeys", details: "Supports numeric input 0..9" })
  ),
  (0, import_elements.CommandElement)(
    {
      name: "SendKey",
      id: 0,
      access: "O",
      conformance: "M",
      direction: "request",
      response: "SendKeyResponse",
      details: "Upon receipt, this shall process a keycode as input to the media endpoint.\nIf a device has multiple media endpoints implementing this cluster, such as a casting video player endpoint with one or more content app endpoints, then only the endpoint receiving the command shall process the keycode as input. In other words, a specific content app endpoint shall NOT process a keycode received by a different content app endpoint.\nIf a second SendKey request with the same KeyCode value is received within 200 ms, then the endpoint will consider the first key press to be a press and hold. When such a repeat KeyCode value is not received within 200 ms, then the endpoint will consider the last key press to be a release.",
      xref: { document: "cluster", section: "6.8.6.1" }
    },
    (0, import_elements.FieldElement)({
      name: "KeyCode",
      id: 0,
      type: "CecKeyCodeEnum",
      conformance: "M",
      details: "This field shall indicate the key code to process.",
      xref: { document: "cluster", section: "6.8.6.1.1" }
    })
  ),
  (0, import_elements.CommandElement)(
    {
      name: "SendKeyResponse",
      id: 1,
      conformance: "M",
      direction: "response",
      details: "This command shall be generated in response to a SendKey command.",
      xref: { document: "cluster", section: "6.8.6.2" }
    },
    (0, import_elements.FieldElement)({
      name: "Status",
      id: 0,
      type: "StatusEnum",
      conformance: "M",
      details: "This field shall indicate the status of the request.",
      xref: { document: "cluster", section: "6.8.6.2.1" }
    })
  ),
  (0, import_elements.DatatypeElement)(
    { name: "StatusEnum", type: "enum8", xref: { document: "cluster", section: "6.8.5.1" } },
    (0, import_elements.FieldElement)({ name: "Success", id: 0, conformance: "M", description: "Succeeded" }),
    (0, import_elements.FieldElement)({ name: "UnsupportedKey", id: 1, conformance: "M", description: "Key code is not supported." }),
    (0, import_elements.FieldElement)({
      name: "InvalidKeyInCurrentState",
      id: 2,
      conformance: "M",
      description: "Requested key code is invalid in the context of the responder\u2019s current state."
    })
  ),
  (0, import_elements.DatatypeElement)(
    { name: "CecKeyCodeEnum", type: "enum8", xref: { document: "cluster", section: "6.8.5.2" } },
    (0, import_elements.FieldElement)({ name: "Select", id: 0, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "Up", id: 1, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "Down", id: 2, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "Left", id: 3, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "Right", id: 4, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "RightUp", id: 5, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "RightDown", id: 6, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "LeftUp", id: 7, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "LeftDown", id: 8, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "RootMenu", id: 9, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "SetupMenu", id: 10, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "ContentsMenu", id: 11, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "FavoriteMenu", id: 12, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "Exit", id: 13, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "MediaTopMenu", id: 16, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "MediaContextSensitiveMenu", id: 17, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "NumberEntryMode", id: 29, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "Number11", id: 30, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "Number12", id: 31, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "Number0OrNumber10", id: 32, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "Numbers1", id: 33, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "Numbers2", id: 34, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "Numbers3", id: 35, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "Numbers4", id: 36, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "Numbers5", id: 37, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "Numbers6", id: 38, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "Numbers7", id: 39, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "Numbers8", id: 40, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "Numbers9", id: 41, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "Dot", id: 42, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "Enter", id: 43, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "Clear", id: 44, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "NextFavorite", id: 47, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "ChannelUp", id: 48, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "ChannelDown", id: 49, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "PreviousChannel", id: 50, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "SoundSelect", id: 51, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "InputSelect", id: 52, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "DisplayInformation", id: 53, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "Help", id: 54, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "PageUp", id: 55, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "PageDown", id: 56, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "Power", id: 64, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "VolumeUp", id: 65, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "VolumeDown", id: 66, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "Mute", id: 67, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "Play", id: 68, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "Stop", id: 69, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "Pause", id: 70, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "Record", id: 71, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "Rewind", id: 72, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "FastForward", id: 73, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "Eject", id: 74, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "Forward", id: 75, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "Backward", id: 76, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "StopRecord", id: 77, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "PauseRecord", id: 78, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "Angle", id: 80, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "SubPicture", id: 81, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "VideoOnDemand", id: 82, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "ElectronicProgramGuide", id: 83, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "TimerProgramming", id: 84, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "InitialConfiguration", id: 85, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "SelectBroadcastType", id: 86, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "SelectSoundPresentation", id: 87, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "PlayFunction", id: 96, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "PausePlayFunction", id: 97, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "RecordFunction", id: 98, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "PauseRecordFunction", id: 99, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "StopFunction", id: 100, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "MuteFunction", id: 101, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "RestoreVolumeFunction", id: 102, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "TuneFunction", id: 103, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "SelectMediaFunction", id: 104, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "SelectAvInputFunction", id: 105, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "SelectAudioInputFunction", id: 106, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "PowerToggleFunction", id: 107, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "PowerOffFunction", id: 108, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "PowerOnFunction", id: 109, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "F1Blue", id: 113, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "F2Red", id: 114, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "F3Green", id: 115, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "F4Yellow", id: 116, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "F5", id: 117, conformance: "M" }),
    (0, import_elements.FieldElement)({ name: "Data", id: 118, conformance: "M" })
  )
);
import_MatterDefinition.MatterDefinition.children.push(KeypadInput);
//# sourceMappingURL=KeypadInput.js.map
