

const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.js');
const require_decorateMetadata = require('../../../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorateMetadata.js');
const require_decorate = require('../../../../_virtual/_@oxc-project_runtime@0.97.0/helpers/decorate.js');
const require_array = require('../../../../utils/array.js');
const require_JsonTransformer = require('../../../../utils/JsonTransformer.js');
const require_validators = require('../../../../utils/validators.js');
require('../../../../utils/index.js');
const require_constants = require('../../constants.js');
const require_validators$1 = require('../../validators.js');
const require_W3cV2EnvelopedVerifiableCredential = require('../credential/W3cV2EnvelopedVerifiableCredential.js');
const require_W3cV2Holder = require('./W3cV2Holder.js');
let class_transformer = require("class-transformer");
let class_validator = require("class-validator");

//#region src/modules/vc/models/presentation/W3cV2Presentation.ts
var _ref;
var W3cV2Presentation = class {
	constructor(options) {
		if (options) {
			this.id = options.id;
			this.context = options.context ?? [require_constants.CREDENTIALS_CONTEXT_V2_URL];
			this.type = options.type ?? [require_constants.VERIFIABLE_PRESENTATION_TYPE];
			this.verifiableCredential = require_array.mapSingleOrArray(options.verifiableCredential, (options$1) => new require_W3cV2EnvelopedVerifiableCredential.W3cV2EnvelopedVerifiableCredential(options$1));
			if (options.holder) this.holder = typeof options.holder === "string" ? options.holder : new require_W3cV2Holder.W3cV2Holder(options.holder);
		}
	}
	get holderId() {
		if (!this.holder) return void 0;
		return this.holder instanceof require_W3cV2Holder.W3cV2Holder ? this.holder.id : this.holder;
	}
	toJSON() {
		return require_JsonTransformer.JsonTransformer.toJSON(this);
	}
};
require_decorate.__decorate([
	(0, class_transformer.Expose)({ name: "@context" }),
	require_validators$1.IsCredentialJsonLdContext({ credentialContext: require_constants.CREDENTIALS_CONTEXT_V2_URL }),
	require_decorateMetadata.__decorateMetadata("design:type", typeof (_ref = typeof Array !== "undefined" && Array) === "function" ? _ref : Object)
], W3cV2Presentation.prototype, "context", void 0);
require_decorate.__decorate([
	(0, class_validator.IsOptional)(),
	require_validators.IsUri(),
	require_decorateMetadata.__decorateMetadata("design:type", String)
], W3cV2Presentation.prototype, "id", void 0);
require_decorate.__decorate([require_validators$1.IsVerifiablePresentationType(), require_decorateMetadata.__decorateMetadata("design:type", Object)], W3cV2Presentation.prototype, "type", void 0);
require_decorate.__decorate([
	require_W3cV2Holder.W3cV2HolderTransformer(),
	require_W3cV2Holder.IsW3cV2Holder(),
	(0, class_validator.IsOptional)(),
	require_decorateMetadata.__decorateMetadata("design:type", Object)
], W3cV2Presentation.prototype, "holder", void 0);
require_decorate.__decorate([
	require_W3cV2EnvelopedVerifiableCredential.W3cV2EnvelopedVerifiableCredentialTransformer(),
	require_validators.IsInstanceOrArrayOfInstances({ classType: require_W3cV2EnvelopedVerifiableCredential.W3cV2EnvelopedVerifiableCredential }),
	(0, class_validator.ValidateNested)({ each: true }),
	require_decorateMetadata.__decorateMetadata("design:type", Object)
], W3cV2Presentation.prototype, "verifiableCredential", void 0);
require_decorate.__decorate([require_validators.IsNever(), require_decorateMetadata.__decorateMetadata("design:type", void 0)], W3cV2Presentation.prototype, "vc", void 0);
require_decorate.__decorate([require_validators.IsNever(), require_decorateMetadata.__decorateMetadata("design:type", void 0)], W3cV2Presentation.prototype, "vp", void 0);

//#endregion
exports.W3cV2Presentation = W3cV2Presentation;