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 { IsValidMessageType, parseMessageType } from "../../../util/messageType.mjs";
import { DidCommMessage } from "../../../DidCommMessage.mjs";
import { SignatureDecorator } from "../../../decorators/signature/SignatureDecorator.mjs";
import { Expose, Type } from "class-transformer";
import { IsInstance, ValidateNested } from "class-validator";

//#region ../didcomm/src/modules/connections/messages/DidCommConnectionResponseMessage.ts
var _ref;
/**
* Message part of connection protocol used to complete the connection
*
* @see https://github.com/hyperledger/aries-rfcs/blob/master/features/0160-connection-protocol/README.md#2-connection-response
*/
var DidCommConnectionResponseMessage = class DidCommConnectionResponseMessage extends DidCommMessage {
	/**
	* Create new ConnectionResponseMessage instance.
	* @param options
	*/
	constructor(options) {
		super();
		this.allowDidSovPrefix = true;
		this.type = DidCommConnectionResponseMessage.type.messageTypeUri;
		if (options) {
			this.id = options.id || this.generateId();
			this.connectionSig = options.connectionSig;
			this.setThread({ threadId: options.threadId });
		}
	}
};
DidCommConnectionResponseMessage.type = parseMessageType("https://didcomm.org/connections/1.0/response");
__decorate([IsValidMessageType(DidCommConnectionResponseMessage.type), __decorateMetadata("design:type", Object)], DidCommConnectionResponseMessage.prototype, "type", void 0);
__decorate([
	Type(() => SignatureDecorator),
	ValidateNested(),
	IsInstance(SignatureDecorator),
	Expose({ name: "connection~sig" }),
	__decorateMetadata("design:type", typeof (_ref = typeof SignatureDecorator !== "undefined" && SignatureDecorator) === "function" ? _ref : Object)
], DidCommConnectionResponseMessage.prototype, "connectionSig", void 0);

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