/**
 * @license
 * Copyright 2022-2025 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import { Access, Conformance, Constraint, Quality } from "../aspects/index.js";
import { RequirementElement } from "../elements/index.js";
import { Aspects } from "./Aspects.js";
import { Model } from "./Model.js";
const CONSTRAINT = Symbol("constraint");
const CONFORMANCE = Symbol("conformance");
const ACCESS = Symbol("access");
const QUALITY = Symbol("quality");
class RequirementModel extends Model {
  tag = RequirementElement.Tag;
  get children() {
    return super.children;
  }
  set children(children) {
    super.children = children;
  }
  get discriminator() {
    return this.element;
  }
  get access() {
    return Aspects.getAspect(this, ACCESS, Access);
  }
  set access(definition) {
    Aspects.setAspect(this, ACCESS, Access, definition);
  }
  get constraint() {
    return Aspects.getAspect(this, CONSTRAINT, Constraint);
  }
  set constraint(definition) {
    Aspects.setAspect(this, CONSTRAINT, Constraint, definition);
  }
  get conformance() {
    return Aspects.getAspect(this, CONFORMANCE, Conformance);
  }
  set conformance(definition) {
    Aspects.setAspect(this, CONFORMANCE, Conformance, definition);
  }
  get quality() {
    return Aspects.getAspect(this, QUALITY, Quality);
  }
  set quality(definition) {
    Aspects.setAspect(this, QUALITY, Quality, definition);
  }
  static {
    Model.types[RequirementElement.Tag] = this;
  }
  get requirements() {
    return this.all(RequirementModel);
  }
  valueOf() {
    const result = super.valueOf();
    for (const k of ["conformance", "access", "quality", "constraint"]) {
      const v = this[k];
      if (v && !v.empty) {
        result[k] = v.valueOf();
      }
    }
    return result;
  }
  /**
   * Is the element mandatory?
   */
  get isMandatory() {
    return this.conformance.isMandatory;
  }
}
export {
  RequirementModel
};
//# sourceMappingURL=RequirementModel.js.map
