/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */
import { Access } from "#aspects/index.js";
import { FieldSemantics } from "#decoration/semantics/FieldSemantics.js";
import { AttributeModel } from "#models/AttributeModel.js";
import { ValueModel } from "#models/ValueModel.js";
import { Decorator } from "@matter/general";
import { element } from "./element.js";
const defaultAttributeAccess = Decorator((_target, context) => {
  const model = FieldSemantics.of(context).mutableModel;
  if (model instanceof ValueModel && model.access.rw === void 0) {
    model.access = new Access({ ...model.access, rw: Access.Rw.Read, readPriv: Access.Privilege.View });
  }
});
const attribute = (...modifiers) => element(AttributeModel, defaultAttributeAccess, ...modifiers);
export {
  attribute
};
//# sourceMappingURL=attribute.js.map
