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 { MessageIdRegExp } from "../../../../../BaseDidCommMessage.mjs";
import { IsValidMessageType, parseMessageType } from "../../../../../util/messageType.mjs";
import { DidCommMessage } from "../../../../../DidCommMessage.mjs";
import { utils } from "@credo-ts/core";
import { Expose, Type } from "class-transformer";
import { IsArray, IsInstance, IsObject, Matches, ValidateNested } from "class-validator";

//#region ../didcomm/src/modules/message-pickup/protocol/v1/messages/DidCommBatchMessage.ts
var DidCommBatchMessageMessage = class {
	constructor(options) {
		if (options) {
			this.id = options.id || utils.uuid();
			this.message = options.message;
		}
	}
};
__decorate([Matches(MessageIdRegExp), __decorateMetadata("design:type", String)], DidCommBatchMessageMessage.prototype, "id", void 0);
__decorate([IsObject(), __decorateMetadata("design:type", Object)], DidCommBatchMessageMessage.prototype, "message", void 0);
/**
* A message that contains multiple waiting messages.
*
* @see https://github.com/hyperledger/aries-rfcs/blob/master/features/0212-pickup/README.md#batch
*/
var DidCommBatchMessage = class DidCommBatchMessage extends DidCommMessage {
	constructor(options) {
		super();
		this.allowQueueTransport = false;
		this.type = DidCommBatchMessage.type.messageTypeUri;
		if (options) {
			this.id = options.id || this.generateId();
			this.messages = options.messages;
			if (options.threadId) this.setThread({ threadId: options.threadId });
		}
	}
};
DidCommBatchMessage.type = parseMessageType("https://didcomm.org/messagepickup/1.0/batch");
__decorate([IsValidMessageType(DidCommBatchMessage.type), __decorateMetadata("design:type", Object)], DidCommBatchMessage.prototype, "type", void 0);
__decorate([
	Type(() => DidCommBatchMessageMessage),
	IsArray(),
	ValidateNested(),
	IsInstance(DidCommBatchMessageMessage, { each: true }),
	Expose({ name: "messages~attach" }),
	__decorateMetadata("design:type", Array)
], DidCommBatchMessage.prototype, "messages", void 0);

//#endregion
export { DidCommBatchMessage, DidCommBatchMessageMessage };
//# sourceMappingURL=DidCommBatchMessage.mjs.map