"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 laundry_washer_controls_exports = {};
__export(laundry_washer_controls_exports, {
  LaundryWasherControls: () => LaundryWasherControls,
  LaundryWasherControlsCluster: () => LaundryWasherControlsCluster
});
module.exports = __toCommonJS(laundry_washer_controls_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_TlvString = require("../tlv/TlvString.js");
var import_TlvNumber = require("../tlv/TlvNumber.js");
var import_TlvNullable = require("../tlv/TlvNullable.js");
var import_BitmapSchema = require("../schema/BitmapSchema.js");
var import_ClusterRegistry = require("../cluster/ClusterRegistry.js");
/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
var LaundryWasherControls;
((LaundryWasherControls2) => {
  let Feature;
  ((Feature2) => {
    Feature2["Spin"] = "Spin";
    Feature2["Rinse"] = "Rinse";
  })(Feature = LaundryWasherControls2.Feature || (LaundryWasherControls2.Feature = {}));
  let NumberOfRinses;
  ((NumberOfRinses2) => {
    NumberOfRinses2[NumberOfRinses2["None"] = 0] = "None";
    NumberOfRinses2[NumberOfRinses2["Normal"] = 1] = "Normal";
    NumberOfRinses2[NumberOfRinses2["Extra"] = 2] = "Extra";
    NumberOfRinses2[NumberOfRinses2["Max"] = 3] = "Max";
  })(NumberOfRinses = LaundryWasherControls2.NumberOfRinses || (LaundryWasherControls2.NumberOfRinses = {}));
  LaundryWasherControls2.SpinComponent = import_MutableCluster.MutableCluster.Component({
    attributes: {
      /**
       * Indicates the list of spin speeds available to the appliance in the currently selected mode. The spin
       * speed values are determined by the manufacturer. At least one spin speed value shall be provided in the
       * SpinSpeeds list. The list of spin speeds may change depending on the currently selected Laundry Washer
       * mode. For example, Quick mode might have a completely different list of SpinSpeeds than Delicates mode.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 8.6.6.1
       */
      spinSpeeds: (0, import_Cluster.Attribute)(0, (0, import_TlvArray.TlvArray)(import_TlvString.TlvString, { maxLength: 16 }), { default: [] }),
      /**
       * Indicates the currently selected spin speed. It is the index into the SpinSpeeds list of the selected
       * spin speed, as such, this attribute can be an integer between 0 and the number of entries in SpinSpeeds -
       * 1. If a value is received that is outside of the defined constraints, a CONSTRAINT_ERROR shall be sent as
       * the response. If a value is attempted to be written that doesn’t match a valid index (e.g. an index of 5
       * when the list has 4 values), a CONSTRAINT_ERROR shall be sent as the response. If null is written to this
       * attribute, there will be no spin speed for the selected cycle. If the value is null, there will be no
       * spin speed on the current mode.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 8.6.6.2
       */
      spinSpeedCurrent: (0, import_Cluster.WritableAttribute)(1, (0, import_TlvNullable.TlvNullable)(import_TlvNumber.TlvUInt8.bound({ max: 15 })))
    }
  });
  LaundryWasherControls2.RinseComponent = import_MutableCluster.MutableCluster.Component({
    attributes: {
      /**
       * Indicates how many times a rinse cycle shall be performed on a device for the current mode of operation.
       * A value of None shall indicate that no rinse cycle will be performed. This value may be set by the client
       * to adjust the number of rinses that are performed for the current mode of operation. If the device is not
       * in a compatible state to accept the provided value, an INVALID_IN_STATE error shall be sent as the
       * response.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 8.6.6.3
       */
      numberOfRinses: (0, import_Cluster.WritableAttribute)(2, (0, import_TlvNumber.TlvEnum)()),
      /**
       * Indicates the amount of rinses allowed for a specific mode. Each entry shall indicate a
       * NumberOfRinsesEnum value that is possible in the selected mode on the device. The value of this attribute
       * may change at runtime based on the currently selected mode. Each entry shall be distinct.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 8.6.6.4
       */
      supportedRinses: (0, import_Cluster.Attribute)(3, (0, import_TlvArray.TlvArray)((0, import_TlvNumber.TlvEnum)(), { maxLength: 4 }), { default: [] })
    }
  });
  LaundryWasherControls2.Base = import_MutableCluster.MutableCluster.Component({
    id: 83,
    name: "LaundryWasherControls",
    revision: 2,
    features: {
      /**
       * This feature indicates multiple spin speeds are supported in at least one supported mode. Note that some
       * modes may not support multiple spin speeds even if this feature is supported.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 8.6.4.1
       */
      spin: (0, import_BitmapSchema.BitFlag)(0),
      /**
       * This feature indicates multiple rinse cycles are supported in at least one supported mode. Note that some
       * modes may not support selection of the number of rinse cycles even if this feature is supported.
       *
       * @see {@link MatterSpecification.v142.Cluster} § 8.6.4.2
       */
      rinse: (0, import_BitmapSchema.BitFlag)(1)
    },
    /**
     * This metadata controls which LaundryWasherControlsCluster elements matter.js activates for specific feature
     * combinations.
     */
    extensions: import_MutableCluster.MutableCluster.Extensions(
      { flags: { spin: true }, component: LaundryWasherControls2.SpinComponent },
      { flags: { rinse: true }, component: LaundryWasherControls2.RinseComponent },
      { flags: { spin: false, rinse: false }, component: false }
    )
  });
  LaundryWasherControls2.ClusterInstance = import_MutableCluster.MutableCluster.ExtensibleOnly(LaundryWasherControls2.Base);
  LaundryWasherControls2.Cluster = LaundryWasherControls2.ClusterInstance;
  const SPIN = { spin: true };
  const RINSE = { rinse: true };
  LaundryWasherControls2.CompleteInstance = (0, import_MutableCluster.MutableCluster)({
    id: LaundryWasherControls2.Base.id,
    name: LaundryWasherControls2.Base.name,
    revision: LaundryWasherControls2.Base.revision,
    features: LaundryWasherControls2.Base.features,
    attributes: {
      spinSpeeds: import_MutableCluster.MutableCluster.AsConditional(LaundryWasherControls2.SpinComponent.attributes.spinSpeeds, { mandatoryIf: [SPIN] }),
      spinSpeedCurrent: import_MutableCluster.MutableCluster.AsConditional(
        LaundryWasherControls2.SpinComponent.attributes.spinSpeedCurrent,
        { mandatoryIf: [SPIN] }
      ),
      numberOfRinses: import_MutableCluster.MutableCluster.AsConditional(
        LaundryWasherControls2.RinseComponent.attributes.numberOfRinses,
        { mandatoryIf: [RINSE] }
      ),
      supportedRinses: import_MutableCluster.MutableCluster.AsConditional(
        LaundryWasherControls2.RinseComponent.attributes.supportedRinses,
        { mandatoryIf: [RINSE] }
      )
    }
  });
  LaundryWasherControls2.Complete = LaundryWasherControls2.CompleteInstance;
})(LaundryWasherControls || (LaundryWasherControls = {}));
const LaundryWasherControlsCluster = LaundryWasherControls.Cluster;
import_ClusterRegistry.ClusterRegistry.register(LaundryWasherControls.Complete);
//# sourceMappingURL=laundry-washer-controls.js.map
