import { __decorateMetadata } from "../../../../../../../../_virtual/_@oxc-project_runtime@0.94.0/helpers/decorateMetadata.mjs";
import { __decorate } from "../../../../../../../../_virtual/_@oxc-project_runtime@0.94.0/helpers/decorate.mjs";
import { DidCommAttachment } from "../../../../../decorators/attachment/DidCommAttachment.mjs";
import { IsValidMessageType, parseMessageType } from "../../../../../util/messageType.mjs";
import { DidCommMessage } from "../../../../../DidCommMessage.mjs";
import { DidCommCredentialFormatSpec } from "../../../models/DidCommCredentialFormatSpec.mjs";
import "../../../models/index.mjs";
import { DidCommCredentialV2Preview } from "./DidCommCredentialV2Preview.mjs";
import { Expose, Type } from "class-transformer";
import { IsArray, IsInstance, IsOptional, IsString, ValidateNested } from "class-validator";

//#region ../didcomm/src/modules/credentials/protocol/v2/messages/DidCommProposeCredentialV2Message.ts
var _ref;
var DidCommProposeCredentialV2Message = class DidCommProposeCredentialV2Message extends DidCommMessage {
	constructor(options) {
		super();
		this.type = DidCommProposeCredentialV2Message.type.messageTypeUri;
		if (options) {
			this.id = options.id ?? this.generateId();
			this.comment = options.comment;
			this.goalCode = options.goalCode;
			this.goal = options.goal;
			this.credentialPreview = options.credentialPreview;
			this.formats = options.formats;
			this.proposalAttachments = options.proposalAttachments;
			this.appendedAttachments = options.attachments;
		}
	}
	getProposalAttachmentById(id) {
		return this.proposalAttachments.find((attachment) => attachment.id === id);
	}
};
DidCommProposeCredentialV2Message.type = parseMessageType("https://didcomm.org/issue-credential/2.0/propose-credential");
__decorate([
	Type(() => DidCommCredentialFormatSpec),
	ValidateNested({ each: true }),
	IsArray(),
	IsInstance(DidCommCredentialFormatSpec, { each: true }),
	__decorateMetadata("design:type", Array)
], DidCommProposeCredentialV2Message.prototype, "formats", void 0);
__decorate([IsValidMessageType(DidCommProposeCredentialV2Message.type), __decorateMetadata("design:type", Object)], DidCommProposeCredentialV2Message.prototype, "type", void 0);
__decorate([
	Expose({ name: "credential_preview" }),
	Type(() => DidCommCredentialV2Preview),
	ValidateNested(),
	IsOptional(),
	IsInstance(DidCommCredentialV2Preview),
	__decorateMetadata("design:type", typeof (_ref = typeof DidCommCredentialV2Preview !== "undefined" && DidCommCredentialV2Preview) === "function" ? _ref : Object)
], DidCommProposeCredentialV2Message.prototype, "credentialPreview", void 0);
__decorate([
	Expose({ name: "filters~attach" }),
	Type(() => DidCommAttachment),
	IsArray(),
	ValidateNested({ each: true }),
	IsInstance(DidCommAttachment, { each: true }),
	__decorateMetadata("design:type", Array)
], DidCommProposeCredentialV2Message.prototype, "proposalAttachments", void 0);
__decorate([
	IsOptional(),
	IsString(),
	__decorateMetadata("design:type", String)
], DidCommProposeCredentialV2Message.prototype, "comment", void 0);
__decorate([
	Expose({ name: "goal_code" }),
	IsString(),
	IsOptional(),
	__decorateMetadata("design:type", String)
], DidCommProposeCredentialV2Message.prototype, "goalCode", void 0);
__decorate([
	IsString(),
	IsOptional(),
	__decorateMetadata("design:type", String)
], DidCommProposeCredentialV2Message.prototype, "goal", void 0);

//#endregion
export { DidCommProposeCredentialV2Message };
//# sourceMappingURL=DidCommProposeCredentialV2Message.mjs.map