const require_rolldown_runtime = require('../../../../../../../../_virtual/rolldown_runtime.js');
const require_index = require('../../../../../../../../node_modules/.pnpm/class-transformer@0.5.1/node_modules/class-transformer/cjs/index.js');
const require_index$1 = require('../../../../../../../../node_modules/.pnpm/class-validator@0.14.1/node_modules/class-validator/cjs/index.js');
const require_decorateMetadata = require('../../../../../../../../_virtual/_@oxc-project_runtime@0.94.0/helpers/decorateMetadata.js');
const require_decorate = require('../../../../../../../../_virtual/_@oxc-project_runtime@0.94.0/helpers/decorate.js');
const require_DidCommAttachment = require('../../../../../decorators/attachment/DidCommAttachment.js');
const require_messageType = require('../../../../../util/messageType.js');
const require_DidCommMessage = require('../../../../../DidCommMessage.js');
const require_DidCommCredentialFormatSpec = require('../../../models/DidCommCredentialFormatSpec.js');
require('../../../models/index.js');
const require_DidCommCredentialV2Preview = require('./DidCommCredentialV2Preview.js');

//#region ../didcomm/src/modules/credentials/protocol/v2/messages/DidCommOfferCredentialV2Message.ts
var import_cjs = /* @__PURE__ */ require_rolldown_runtime.__toESM(require_index.require_cjs());
var import_cjs$1 = /* @__PURE__ */ require_rolldown_runtime.__toESM(require_index$1.require_cjs());
var _ref;
var DidCommOfferCredentialV2Message = class DidCommOfferCredentialV2Message extends require_DidCommMessage.DidCommMessage {
	constructor(options) {
		super();
		this.type = DidCommOfferCredentialV2Message.type.messageTypeUri;
		if (options) {
			this.id = options.id ?? this.generateId();
			this.comment = options.comment;
			this.goalCode = options.goalCode;
			this.goal = options.goal;
			this.formats = options.formats;
			this.credentialPreview = options.credentialPreview;
			this.offerAttachments = options.offerAttachments;
		}
	}
	getOfferAttachmentById(id) {
		return this.offerAttachments.find((attachment) => attachment.id === id);
	}
};
DidCommOfferCredentialV2Message.type = require_messageType.parseMessageType("https://didcomm.org/issue-credential/2.0/offer-credential");
require_decorate.__decorate([
	(0, import_cjs.Type)(() => require_DidCommCredentialFormatSpec.DidCommCredentialFormatSpec),
	(0, import_cjs$1.ValidateNested)(),
	(0, import_cjs$1.IsArray)(),
	(0, import_cjs$1.IsInstance)(require_DidCommCredentialFormatSpec.DidCommCredentialFormatSpec, { each: true }),
	require_decorateMetadata.__decorateMetadata("design:type", Array)
], DidCommOfferCredentialV2Message.prototype, "formats", void 0);
require_decorate.__decorate([require_messageType.IsValidMessageType(DidCommOfferCredentialV2Message.type), require_decorateMetadata.__decorateMetadata("design:type", Object)], DidCommOfferCredentialV2Message.prototype, "type", void 0);
require_decorate.__decorate([
	(0, import_cjs$1.IsString)(),
	(0, import_cjs$1.IsOptional)(),
	require_decorateMetadata.__decorateMetadata("design:type", String)
], DidCommOfferCredentialV2Message.prototype, "comment", void 0);
require_decorate.__decorate([
	(0, import_cjs.Expose)({ name: "goal_code" }),
	(0, import_cjs$1.IsString)(),
	(0, import_cjs$1.IsOptional)(),
	require_decorateMetadata.__decorateMetadata("design:type", String)
], DidCommOfferCredentialV2Message.prototype, "goalCode", void 0);
require_decorate.__decorate([
	(0, import_cjs$1.IsString)(),
	(0, import_cjs$1.IsOptional)(),
	require_decorateMetadata.__decorateMetadata("design:type", String)
], DidCommOfferCredentialV2Message.prototype, "goal", void 0);
require_decorate.__decorate([
	(0, import_cjs$1.IsOptional)(),
	(0, import_cjs.Expose)({ name: "credential_preview" }),
	(0, import_cjs.Type)(() => require_DidCommCredentialV2Preview.DidCommCredentialV2Preview),
	(0, import_cjs$1.ValidateNested)(),
	(0, import_cjs$1.IsInstance)(require_DidCommCredentialV2Preview.DidCommCredentialV2Preview),
	require_decorateMetadata.__decorateMetadata("design:type", typeof (_ref = typeof require_DidCommCredentialV2Preview.DidCommCredentialV2Preview !== "undefined" && require_DidCommCredentialV2Preview.DidCommCredentialV2Preview) === "function" ? _ref : Object)
], DidCommOfferCredentialV2Message.prototype, "credentialPreview", void 0);
require_decorate.__decorate([
	(0, import_cjs.Expose)({ name: "offers~attach" }),
	(0, import_cjs.Type)(() => require_DidCommAttachment.DidCommAttachment),
	(0, import_cjs$1.IsArray)(),
	(0, import_cjs$1.ValidateNested)({ each: true }),
	(0, import_cjs$1.IsInstance)(require_DidCommAttachment.DidCommAttachment, { each: true }),
	require_decorateMetadata.__decorateMetadata("design:type", Array)
], DidCommOfferCredentialV2Message.prototype, "offerAttachments", void 0);
require_decorate.__decorate([
	(0, import_cjs.Expose)({ name: "replacement_id" }),
	(0, import_cjs$1.IsString)(),
	(0, import_cjs$1.IsOptional)(),
	require_decorateMetadata.__decorateMetadata("design:type", String)
], DidCommOfferCredentialV2Message.prototype, "replacementId", void 0);

//#endregion
exports.DidCommOfferCredentialV2Message = DidCommOfferCredentialV2Message;