"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 channel_exports = {};
__export(channel_exports, {
  Channel: () => Channel,
  ChannelCluster: () => ChannelCluster
});
module.exports = __toCommonJS(channel_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_TlvNumber = require("../tlv/TlvNumber.js");
var import_TlvString = require("../tlv/TlvString.js");
var import_TlvNullable = require("../tlv/TlvNullable.js");
var import_BitmapSchema = require("../schema/BitmapSchema.js");
var import_content_launcher = require("./content-launcher.js");
var import_TlvBoolean = require("../tlv/TlvBoolean.js");
var import_ClusterRegistry = require("../cluster/ClusterRegistry.js");
/**
 * @license
 * Copyright 2022-2025 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
var Channel;
((Channel2) => {
  let Feature;
  ((Feature2) => {
    Feature2["ChannelList"] = "ChannelList";
    Feature2["LineupInfo"] = "LineupInfo";
    Feature2["ElectronicGuide"] = "ElectronicGuide";
    Feature2["RecordProgram"] = "RecordProgram";
  })(Feature = Channel2.Feature || (Channel2.Feature = {}));
  let ChannelType;
  ((ChannelType2) => {
    ChannelType2[ChannelType2["Satellite"] = 0] = "Satellite";
    ChannelType2[ChannelType2["Cable"] = 1] = "Cable";
    ChannelType2[ChannelType2["Terrestrial"] = 2] = "Terrestrial";
    ChannelType2[ChannelType2["Ott"] = 3] = "Ott";
  })(ChannelType = Channel2.ChannelType || (Channel2.ChannelType = {}));
  Channel2.TlvChannelInfo = (0, import_TlvObject.TlvObject)({
    /**
     * This field shall indicate the channel major number value (for example, using ATSC format). When the channel
     * number is expressed as a string, such as "13.1" or "256", the major number would be 13 or 256, respectively.
     * This field is required but shall be set to 0 for channels such as over-the-top channels that are not
     * represented by a major or minor number.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.5.5.1
     */
    majorNumber: (0, import_TlvObject.TlvField)(0, import_TlvNumber.TlvUInt16),
    /**
     * This field shall indicate the channel minor number value (for example, using ATSC format). When the channel
     * number is expressed as a string, such as "13.1" or "256", the minor number would be 1 or 0, respectively.
     * This field is required but shall be set to 0 for channels such as over-the-top channels that are not
     * represented by a major or minor number.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.5.5.2
     */
    minorNumber: (0, import_TlvObject.TlvField)(1, import_TlvNumber.TlvUInt16),
    /**
     * This field shall indicate the marketing name for the channel, such as “The CW" or "Comedy Central". This
     * field is optional, but SHOULD be provided when known.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.5.5.3
     */
    name: (0, import_TlvObject.TlvOptionalField)(2, import_TlvString.TlvString),
    /**
     * This field shall indicate the call sign of the channel, such as "PBS". This field is optional, but SHOULD be
     * provided when known.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.5.5.4
     */
    callSign: (0, import_TlvObject.TlvOptionalField)(3, import_TlvString.TlvString),
    /**
     * This field shall indicate the local affiliate call sign, such as "KCTS". This field is optional, but
     *
     * SHOULD be provided when known.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.5.5.5
     */
    affiliateCallSign: (0, import_TlvObject.TlvOptionalField)(4, import_TlvString.TlvString),
    /**
     * This shall indicate the unique identifier for a specific channel. This field is optional, but SHOULD be
     * provided when MajorNumber and MinorNumber are not available.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.5.5.6
     */
    identifier: (0, import_TlvObject.TlvOptionalField)(5, import_TlvString.TlvString),
    /**
     * This shall indicate the type or grouping of a specific channel. This field is optional, but SHOULD be
     * provided when known.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.5.5.7
     */
    type: (0, import_TlvObject.TlvOptionalField)(6, (0, import_TlvNumber.TlvEnum)())
  });
  let LineupInfoType;
  ((LineupInfoType2) => {
    LineupInfoType2[LineupInfoType2["Mso"] = 0] = "Mso";
  })(LineupInfoType = Channel2.LineupInfoType || (Channel2.LineupInfoType = {}));
  Channel2.TlvLineupInfo = (0, import_TlvObject.TlvObject)({
    /**
     * This field shall indicate the name of the operator, for example “Comcast”.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.5.6.1
     */
    operatorName: (0, import_TlvObject.TlvField)(0, import_TlvString.TlvString),
    /**
     * This field shall indicate the name of the provider lineup, for example "Comcast King County". This field is
     * optional, but SHOULD be provided when known.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.5.6.2
     */
    lineupName: (0, import_TlvObject.TlvOptionalField)(1, import_TlvString.TlvString),
    /**
     * This field shall indicate the postal code (zip code) for the location of the device, such as "98052". This
     * field is optional, but SHOULD be provided when known.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.5.6.3
     */
    postalCode: (0, import_TlvObject.TlvOptionalField)(2, import_TlvString.TlvString),
    /**
     * This field shall indicate the type of lineup. This field is optional, but SHOULD be provided when known.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.5.6.4
     */
    lineupInfoType: (0, import_TlvObject.TlvField)(3, (0, import_TlvNumber.TlvEnum)())
  });
  Channel2.TlvChangeChannelRequest = (0, import_TlvObject.TlvObject)({
    /**
     * This field shall contain a user-input string to match in order to identify the target channel.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.7.1.1
     */
    match: (0, import_TlvObject.TlvField)(0, import_TlvString.TlvString)
  });
  let Status;
  ((Status2) => {
    Status2[Status2["Success"] = 0] = "Success";
    Status2[Status2["MultipleMatches"] = 1] = "MultipleMatches";
    Status2[Status2["NoMatches"] = 2] = "NoMatches";
  })(Status = Channel2.Status || (Channel2.Status = {}));
  Channel2.TlvChangeChannelResponse = (0, import_TlvObject.TlvObject)({
    /**
     * This field shall indicate the status of the command which resulted in this response.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.7.2.1
     */
    status: (0, import_TlvObject.TlvField)(0, (0, import_TlvNumber.TlvEnum)()),
    /**
     * This field shall indicate Optional app-specific data.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.7.2.2
     */
    data: (0, import_TlvObject.TlvOptionalField)(1, import_TlvString.TlvString)
  });
  Channel2.TlvPageToken = (0, import_TlvObject.TlvObject)({
    /**
     * This field shall indicate the maximum number of entries that should be retrieved from the program guide in a
     * single response. It allows clients to specify the size of the paginated result set based on their needs.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.5.11.1
     */
    limit: (0, import_TlvObject.TlvOptionalField)(0, import_TlvNumber.TlvUInt16),
    /**
     * This field shall indicate the cursor that pinpoints the start of the upcoming data page. In a Cursor- based
     * pagination system, the field acts as a reference point, ensuring the set of results corresponds directly to
     * the data following the specified cursor. In a Offset-based pagination system, the field, along with limit,
     * indicate the offset from which entries in the program guide will be retrieved.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.5.11.2
     */
    after: (0, import_TlvObject.TlvOptionalField)(1, import_TlvString.TlvString.bound({ maxLength: 8192 })),
    /**
     * This field shall indicate the cursor that pinpoints the end of the upcoming data page. In a Cursor- based
     * pagination system, the field acts as a reference point, ensuring the set of results corresponds directly to
     * the data preceding the specified cursor. In a Offset-based pagination system, the field, along with limit,
     * indicate the offset from which entries in the program guide will be retrieved.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.5.11.3
     */
    before: (0, import_TlvObject.TlvOptionalField)(2, import_TlvString.TlvString.bound({ maxLength: 8192 }))
  });
  Channel2.RecordingFlag = {
    /**
     * The program is scheduled for recording.
     */
    scheduled: (0, import_BitmapSchema.BitFlag)(0),
    /**
     * The program series is scheduled for recording.
     */
    recordSeries: (0, import_BitmapSchema.BitFlag)(1),
    /**
     * The program is recorded and available to be played.
     */
    recorded: (0, import_BitmapSchema.BitFlag)(2)
  };
  Channel2.TlvGetProgramGuideRequest = (0, import_TlvObject.TlvObject)({
    /**
     * This field shall indicate the beginning of the time window for which program guide entries are to be
     * retrieved, as a UTC time. Entries with a start time on or after this value will be included in the results.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.7.5.1
     */
    startTime: (0, import_TlvObject.TlvField)(0, import_TlvNumber.TlvEpochS),
    /**
     * This field shall indicate the end of the time window for which program guide entries are to be retrieved, as
     * a UTC time. Entries with an end time on or before this value will be included in the results. This field can
     * represent a past or future value but shall be greater than the StartTime.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.7.5.2
     */
    endTime: (0, import_TlvObject.TlvField)(1, import_TlvNumber.TlvEpochS),
    /**
     * This field shall indicate the set of channels for which program guide entries should be fetched. By
     * providing a list of channels in this field, the response will only include entries corresponding to the
     * specified channels.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.7.5.3
     */
    channelList: (0, import_TlvObject.TlvOptionalField)(2, (0, import_TlvArray.TlvArray)(Channel2.TlvChannelInfo, { maxLength: 255 })),
    /**
     * This field shall indicate the pagination token used for managing pagination progression.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.7.5.4
     */
    pageToken: (0, import_TlvObject.TlvOptionalField)(3, (0, import_TlvNullable.TlvNullable)(Channel2.TlvPageToken)),
    /**
     * This field shall indicate the flags of the programs for which entries should be fetched.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.7.5.5
     */
    recordingFlag: (0, import_TlvObject.TlvOptionalField)(5, (0, import_TlvNullable.TlvNullable)((0, import_TlvNumber.TlvBitmap)(import_TlvNumber.TlvUInt8, Channel2.RecordingFlag))),
    /**
     * This field shall indicate the list of additional external content identifiers.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.7.5.6
     */
    externalIdList: (0, import_TlvObject.TlvOptionalField)(6, (0, import_TlvArray.TlvArray)(import_content_launcher.ContentLauncher.TlvAdditionalInfo, { maxLength: 255 })),
    /**
     * This field shall indicate Optional app-specific data.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.7.5.7
     */
    data: (0, import_TlvObject.TlvOptionalField)(7, import_TlvString.TlvByteString.bound({ maxLength: 8092 }))
  });
  Channel2.TlvChannelPaging = (0, import_TlvObject.TlvObject)({
    /**
     * This field shall indicate the token to retrieve the preceding page. Absence of this field denotes the
     * response as the initial page.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.5.12.1
     */
    previousToken: (0, import_TlvObject.TlvOptionalField)(0, (0, import_TlvNullable.TlvNullable)(Channel2.TlvPageToken)),
    /**
     * This field shall indicate the token to retrieve the next page. Absence of this field denotes the response as
     * the last page.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.5.12.2
     */
    nextToken: (0, import_TlvObject.TlvOptionalField)(1, (0, import_TlvNullable.TlvNullable)(Channel2.TlvPageToken))
  });
  Channel2.TlvSeriesInfo = (0, import_TlvObject.TlvObject)({
    /**
     * This field shall represent the season of the series associated to the program.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.5.9.1
     */
    season: (0, import_TlvObject.TlvField)(0, import_TlvString.TlvString.bound({ maxLength: 256 })),
    /**
     * This field shall represent the episode of the program.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.5.9.2
     */
    episode: (0, import_TlvObject.TlvField)(1, import_TlvString.TlvString.bound({ maxLength: 256 }))
  });
  Channel2.TlvProgramCategory = (0, import_TlvObject.TlvObject)({
    /**
     * This field shall represent the category or genre of the program. Ex. News.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.5.8.1
     */
    category: (0, import_TlvObject.TlvField)(0, import_TlvString.TlvString.bound({ maxLength: 256 })),
    /**
     * This field shall represent the sub-category or sub-genre of the program. Ex. Local.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.5.8.2
     */
    subCategory: (0, import_TlvObject.TlvOptionalField)(1, import_TlvString.TlvString.bound({ maxLength: 256 }))
  });
  Channel2.TlvProgramCast = (0, import_TlvObject.TlvObject)({
    /**
     * This field shall represent the name of the cast member.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.5.10.1
     */
    name: (0, import_TlvObject.TlvField)(0, import_TlvString.TlvString.bound({ maxLength: 256 })),
    /**
     * This field shall represent the role of the cast member. Ex. Actor, Director.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.5.10.2
     */
    role: (0, import_TlvObject.TlvField)(1, import_TlvString.TlvString.bound({ maxLength: 256 }))
  });
  Channel2.TlvProgram = (0, import_TlvObject.TlvObject)({
    /**
     * This field shall indicate a unique identifier for a program within an electronic program guide list. The
     * identifier shall be unique across multiple channels.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.5.7.1
     */
    identifier: (0, import_TlvObject.TlvField)(0, import_TlvString.TlvString.bound({ maxLength: 255 })),
    /**
     * This field shall indicate the channel associated to the program.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.5.7.2
     */
    channel: (0, import_TlvObject.TlvField)(1, Channel2.TlvChannelInfo),
    /**
     * This field shall indicate an epoch time in seconds indicating the start time of a program, as a UTC time.
     * This field can represent a past or future value.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.5.7.3
     */
    startTime: (0, import_TlvObject.TlvField)(2, import_TlvNumber.TlvEpochS),
    /**
     * This field shall indicate an epoch time in seconds indicating the end time of a program, as a UTC time. This
     * field can represent a past or future value but shall be greater than the StartTime.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.5.7.4
     */
    endTime: (0, import_TlvObject.TlvField)(3, import_TlvNumber.TlvEpochS),
    /**
     * This field shall indicate the title or name for the specific program. For example, “MCIS: Los Angeles”.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.5.7.5
     */
    title: (0, import_TlvObject.TlvField)(4, import_TlvString.TlvString.bound({ maxLength: 255 })),
    /**
     * This field shall indicate the subtitle for the specific program. For example, “Maybe Today" which is an
     * episode name for “MCIS: Los Angeles”. This field is optional but shall be provided if applicable and known.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.5.7.6
     */
    subtitle: (0, import_TlvObject.TlvOptionalField)(5, import_TlvString.TlvString.bound({ maxLength: 255 })),
    /**
     * This field shall indicate the brief description for the specific program. For example, a description of an
     * episode. This field is optional but shall be provided if known.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.5.7.7
     */
    description: (0, import_TlvObject.TlvOptionalField)(6, import_TlvString.TlvString.bound({ maxLength: 8192 })),
    /**
     * This field shall indicate the audio language for the specific program. The value is a string containing one
     * of the standard Tags for Identifying Languages RFC 5646. This field is optional but shall be provided if
     * known.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.5.7.8
     */
    audioLanguages: (0, import_TlvObject.TlvOptionalField)(7, (0, import_TlvArray.TlvArray)(import_TlvString.TlvString, { maxLength: 10 })),
    /**
     * This field shall be used for indicating the level of parental guidance recommended for of a particular
     * program. This can be any rating system used in the country or region where the program is
     *
     * broadcast. For example, in the United States “TV-PG” may contain material that parents can find not suitable
     * for younger children but can be accepted in general for older children. This field is optional but shall be
     * provided if known.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.5.7.9
     */
    ratings: (0, import_TlvObject.TlvOptionalField)(8, (0, import_TlvArray.TlvArray)(import_TlvString.TlvString, { maxLength: 255 })),
    /**
     * This field shall represent a url of a thumbnail that clients can use to render an image for the program.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.5.7.10
     */
    thumbnailUrl: (0, import_TlvObject.TlvOptionalField)(9, import_TlvString.TlvString.bound({ maxLength: 8192 })),
    /**
     * This field shall represent a url of a poster that clients can use to render an image for the program on the
     * detail view.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.5.7.11
     */
    posterArtUrl: (0, import_TlvObject.TlvOptionalField)(10, import_TlvString.TlvString.bound({ maxLength: 8192 })),
    /**
     * This field shall represent the DVB-I url associated to the program.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.5.7.12
     */
    dvbiUrl: (0, import_TlvObject.TlvOptionalField)(11, import_TlvString.TlvString.bound({ maxLength: 8192 })),
    /**
     * This field shall be a string, in ISO 8601 format, representing the date on which the program was released.
     * This field is optional but when provided, the year shall be provided as part of the string.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.5.7.13
     */
    releaseDate: (0, import_TlvObject.TlvOptionalField)(12, import_TlvString.TlvString.bound({ maxLength: 30 })),
    /**
     * This field shall represent a string providing additional information on the parental guidance. This field is
     * optional.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.5.7.14
     */
    parentalGuidanceText: (0, import_TlvObject.TlvOptionalField)(13, import_TlvString.TlvString.bound({ maxLength: 255 })),
    /**
     * This field shall represent the recording status of the program. This field is required if the RecordProgram
     * feature is set.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.5.7.15
     */
    recordingFlag: (0, import_TlvObject.TlvOptionalField)(14, (0, import_TlvNumber.TlvBitmap)(import_TlvNumber.TlvUInt8, Channel2.RecordingFlag)),
    /**
     * This field shall represent the information of a series such as season and episode number. This field is
     * optional but SHOULD be provided if the program represents a series and this information is available.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.5.7.16
     */
    seriesInfo: (0, import_TlvObject.TlvOptionalField)(15, (0, import_TlvNullable.TlvNullable)(Channel2.TlvSeriesInfo)),
    /**
     * This field shall represent the category of a particular program. This field is optional but shall be
     * provided if known.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.5.7.17
     */
    categoryList: (0, import_TlvObject.TlvOptionalField)(16, (0, import_TlvArray.TlvArray)(Channel2.TlvProgramCategory, { maxLength: 255 })),
    /**
     * This field shall represent a list of the cast or the crew on the program. A single cast member may have more
     * than one role. This field is optional but shall be provided if known.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.5.7.18
     */
    castList: (0, import_TlvObject.TlvOptionalField)(17, (0, import_TlvArray.TlvArray)(Channel2.TlvProgramCast, { maxLength: 255 })),
    /**
     * This field shall indicate the list of additional external content identifiers.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.5.7.19
     */
    externalIdList: (0, import_TlvObject.TlvOptionalField)(18, (0, import_TlvArray.TlvArray)(import_content_launcher.ContentLauncher.TlvAdditionalInfo, { maxLength: 255 }))
  });
  Channel2.TlvProgramGuideResponse = (0, import_TlvObject.TlvObject)({
    /**
     * This field shall indicate the necessary pagination attributes that define information for both the
     * succeeding and preceding data pages.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.7.6.1
     */
    paging: (0, import_TlvObject.TlvField)(0, Channel2.TlvChannelPaging),
    /**
     * This field shall indicate the list of programs.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.7.6.2
     */
    programList: (0, import_TlvObject.TlvField)(1, (0, import_TlvArray.TlvArray)(Channel2.TlvProgram))
  });
  Channel2.TlvRecordProgramRequest = (0, import_TlvObject.TlvObject)({
    /**
     * This field shall indicate the program identifier for the program that should be recorded. This value is
     * provided by the identifier field in ProgramStruct.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.7.7.1
     */
    programIdentifier: (0, import_TlvObject.TlvField)(0, import_TlvString.TlvString.bound({ maxLength: 255 })),
    /**
     * This field shall indicate whether the whole series associated to the program should be recorded. For
     * example, invoking record program on an episode with that flag set to true, the target should schedule record
     * the whole series.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.7.7.2
     */
    shouldRecordSeries: (0, import_TlvObject.TlvField)(1, import_TlvBoolean.TlvBoolean),
    /**
     * This field, if present, shall indicate the list of additional external content identifiers.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.7.7.3
     */
    externalIdList: (0, import_TlvObject.TlvOptionalField)(2, (0, import_TlvArray.TlvArray)(import_content_launcher.ContentLauncher.TlvAdditionalInfo, { maxLength: 255 })),
    /**
     * This field, if present, shall indicate app-specific data.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.7.7.4
     */
    data: (0, import_TlvObject.TlvOptionalField)(3, import_TlvString.TlvByteString.bound({ maxLength: 8092 }))
  });
  Channel2.TlvCancelRecordProgramRequest = (0, import_TlvObject.TlvObject)({
    /**
     * This field shall indicate the program identifier for the program that should be cancelled from recording.
     * This value is provided by the identifier field in ProgramStruct.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.7.8.1
     */
    programIdentifier: (0, import_TlvObject.TlvField)(0, import_TlvString.TlvString.bound({ maxLength: 255 })),
    /**
     * This field shall indicate whether the whole series associated to the program should be cancelled from
     * recording. For example, invoking record program on an episode with that flag set to true, the target should
     * schedule record the whole series.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.7.8.2
     */
    shouldRecordSeries: (0, import_TlvObject.TlvField)(1, import_TlvBoolean.TlvBoolean),
    /**
     * This field, if present, shall indicate the list of additional external content identifiers.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.7.8.3
     */
    externalIdList: (0, import_TlvObject.TlvOptionalField)(2, (0, import_TlvArray.TlvArray)(import_content_launcher.ContentLauncher.TlvAdditionalInfo, { maxLength: 255 })),
    /**
     * This field, if present, shall indicate app-specific data.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.7.8.4
     */
    data: (0, import_TlvObject.TlvOptionalField)(3, import_TlvString.TlvByteString.bound({ maxLength: 8092 }))
  });
  Channel2.TlvChangeChannelByNumberRequest = (0, import_TlvObject.TlvObject)({
    /**
     * This field shall indicate the channel major number value (ATSC format) to which the channel should change.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.7.3.1
     */
    majorNumber: (0, import_TlvObject.TlvField)(0, import_TlvNumber.TlvUInt16),
    /**
     * This field shall indicate the channel minor number value (ATSC format) to which the channel should change.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.7.3.2
     */
    minorNumber: (0, import_TlvObject.TlvField)(1, import_TlvNumber.TlvUInt16)
  });
  Channel2.TlvSkipChannelRequest = (0, import_TlvObject.TlvObject)({
    /**
     * This field shall indicate the number of steps to increase (Count is positive) or decrease (Count is
     * negative) the current channel.
     *
     * @see {@link MatterSpecification.v13.Cluster} § 6.6.7.4.1
     */
    count: (0, import_TlvObject.TlvField)(0, import_TlvNumber.TlvInt16)
  });
  Channel2.ChannelListComponent = import_MutableCluster.MutableCluster.Component({
    attributes: {
      /**
       * This attribute shall provide the list of supported channels.
       *
       * @see {@link MatterSpecification.v13.Cluster} § 6.6.6.1
       */
      channelList: (0, import_Cluster.Attribute)(0, (0, import_TlvArray.TlvArray)(Channel2.TlvChannelInfo), { default: [] })
    }
  });
  Channel2.LineupInfoComponent = import_MutableCluster.MutableCluster.Component({
    attributes: {
      /**
       * This attribute shall identify the channel lineup using external data sources.
       *
       * @see {@link MatterSpecification.v13.Cluster} § 6.6.6.2
       */
      lineup: (0, import_Cluster.Attribute)(1, (0, import_TlvNullable.TlvNullable)(Channel2.TlvLineupInfo), { default: null })
    }
  });
  Channel2.ChannelListOrLineupInfoComponent = import_MutableCluster.MutableCluster.Component({
    commands: {
      /**
       * Change the channel to the channel case-insensitive exact matching the value passed as an argument.
       *
       * The match priority order shall be: Identifier, AffiliateCallSign, CallSign, Name, Number. In the match
       * string, the Channel number should be presented in the "Major.Minor" format, such as "13.1".
       *
       * Upon receipt, this shall generate a ChangeChannelResponse command.
       *
       * Upon success, the CurrentChannel attribute, if supported, shall be updated to reflect the change.
       *
       * @see {@link MatterSpecification.v13.Cluster} § 6.6.7.1
       */
      changeChannel: (0, import_Cluster.Command)(0, Channel2.TlvChangeChannelRequest, 1, Channel2.TlvChangeChannelResponse)
    }
  });
  Channel2.ElectronicGuideComponent = import_MutableCluster.MutableCluster.Component({
    commands: {
      /**
       * This command retrieves the program guide. It accepts several filter parameters to return specific
       * schedule and program information from a content app. The command shall receive in response a
       * ProgramGuideResponse. Standard error codes shall be used when arguments provided are not
       *
       * valid. For example, if StartTime is greater than EndTime, the status code INVALID_ACTION shall be
       * returned.
       *
       * @see {@link MatterSpecification.v13.Cluster} § 6.6.7.5
       */
      getProgramGuide: (0, import_Cluster.Command)(4, Channel2.TlvGetProgramGuideRequest, 5, Channel2.TlvProgramGuideResponse)
    }
  });
  Channel2.RecordProgramAndElectronicGuideComponent = import_MutableCluster.MutableCluster.Component({
    commands: {
      /**
       * Record a specific program or series when it goes live. This functionality enables DVR recording features.
       *
       * @see {@link MatterSpecification.v13.Cluster} § 6.6.7.7
       */
      recordProgram: (0, import_Cluster.Command)(6, Channel2.TlvRecordProgramRequest, 6, import_Cluster.TlvNoResponse),
      /**
       * Cancel recording for a specific program or series.
       *
       * @see {@link MatterSpecification.v13.Cluster} § 6.6.7.8
       */
      cancelRecordProgram: (0, import_Cluster.Command)(7, Channel2.TlvCancelRecordProgramRequest, 7, import_Cluster.TlvNoResponse)
    }
  });
  Channel2.Base = import_MutableCluster.MutableCluster.Component({
    id: 1284,
    name: "Channel",
    revision: 2,
    features: {
      /**
       * ChannelList
       *
       * Provides list of available channels.
       */
      channelList: (0, import_BitmapSchema.BitFlag)(0),
      /**
       * LineupInfo
       *
       * Provides lineup info, which is a reference to an external source of lineup information.
       */
      lineupInfo: (0, import_BitmapSchema.BitFlag)(1),
      /**
       * ElectronicGuide
       *
       * Provides electronic program guide information.
       */
      electronicGuide: (0, import_BitmapSchema.BitFlag)(2),
      /**
       * RecordProgram
       *
       * Provides ability to record program.
       */
      recordProgram: (0, import_BitmapSchema.BitFlag)(3)
    },
    attributes: {
      /**
       * This attribute shall contain the current channel. When supported but a channel is not currently tuned to
       * (if a content application is in foreground), the value of the field shall be null.
       *
       * @see {@link MatterSpecification.v13.Cluster} § 6.6.6.3
       */
      currentChannel: (0, import_Cluster.OptionalAttribute)(2, (0, import_TlvNullable.TlvNullable)(Channel2.TlvChannelInfo), { default: null })
    },
    commands: {
      /**
       * Change the channel to the channel with the given Number in the ChannelList attribute.
       *
       * @see {@link MatterSpecification.v13.Cluster} § 6.6.7.3
       */
      changeChannelByNumber: (0, import_Cluster.Command)(2, Channel2.TlvChangeChannelByNumberRequest, 2, import_Cluster.TlvNoResponse),
      /**
       * This command provides channel up and channel down functionality, but allows channel index jumps of size
       * Count.
       *
       * When the value of the increase or decrease is larger than the number of channels remaining in the given
       * direction, then the behavior shall be to return to the beginning (or end) of the channel list and
       * continue. For example, if the current channel is at index 0 and count value of -1 is given, then the
       * current channel should change to the last channel.
       *
       * @see {@link MatterSpecification.v13.Cluster} § 6.6.7.4
       */
      skipChannel: (0, import_Cluster.Command)(3, Channel2.TlvSkipChannelRequest, 3, import_Cluster.TlvNoResponse)
    },
    /**
     * This metadata controls which ChannelCluster elements matter.js activates for specific feature combinations.
     */
    extensions: import_MutableCluster.MutableCluster.Extensions(
      { flags: { channelList: true }, component: Channel2.ChannelListComponent },
      { flags: { lineupInfo: true }, component: Channel2.LineupInfoComponent },
      { flags: { channelList: true }, component: Channel2.ChannelListOrLineupInfoComponent },
      { flags: { lineupInfo: true }, component: Channel2.ChannelListOrLineupInfoComponent },
      { flags: { electronicGuide: true }, component: Channel2.ElectronicGuideComponent },
      {
        flags: { recordProgram: true, electronicGuide: true },
        component: Channel2.RecordProgramAndElectronicGuideComponent
      }
    )
  });
  Channel2.ClusterInstance = (0, import_MutableCluster.MutableCluster)(Channel2.Base);
  Channel2.Cluster = Channel2.ClusterInstance;
  const CL = { channelList: true };
  const LI = { lineupInfo: true };
  const EG = { electronicGuide: true };
  const RP_EG = { recordProgram: true, electronicGuide: true };
  Channel2.CompleteInstance = (0, import_MutableCluster.MutableCluster)({
    id: Channel2.Cluster.id,
    name: Channel2.Cluster.name,
    revision: Channel2.Cluster.revision,
    features: Channel2.Cluster.features,
    attributes: {
      ...Channel2.Cluster.attributes,
      channelList: import_MutableCluster.MutableCluster.AsConditional(
        Channel2.ChannelListComponent.attributes.channelList,
        { mandatoryIf: [CL] }
      ),
      lineup: import_MutableCluster.MutableCluster.AsConditional(Channel2.LineupInfoComponent.attributes.lineup, { mandatoryIf: [LI] })
    },
    commands: {
      ...Channel2.Cluster.commands,
      changeChannel: import_MutableCluster.MutableCluster.AsConditional(
        Channel2.ChannelListOrLineupInfoComponent.commands.changeChannel,
        { mandatoryIf: [CL, LI] }
      ),
      getProgramGuide: import_MutableCluster.MutableCluster.AsConditional(
        Channel2.ElectronicGuideComponent.commands.getProgramGuide,
        { mandatoryIf: [EG] }
      ),
      recordProgram: import_MutableCluster.MutableCluster.AsConditional(
        Channel2.RecordProgramAndElectronicGuideComponent.commands.recordProgram,
        { mandatoryIf: [RP_EG] }
      ),
      cancelRecordProgram: import_MutableCluster.MutableCluster.AsConditional(
        Channel2.RecordProgramAndElectronicGuideComponent.commands.cancelRecordProgram,
        { mandatoryIf: [RP_EG] }
      )
    }
  });
  Channel2.Complete = Channel2.CompleteInstance;
})(Channel || (Channel = {}));
const ChannelCluster = Channel.Cluster;
import_ClusterRegistry.ClusterRegistry.register(Channel.Complete);
//# sourceMappingURL=channel.js.map
