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_index$2 = require('./publicKey/index.js');
const require_index$3 = require('./authentication/index.js');
let __credo_ts_core = require("@credo-ts/core");
__credo_ts_core = require_rolldown_runtime.__toESM(__credo_ts_core);

//#region ../didcomm/src/modules/connections/models/did/DidDoc.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 DidDoc = class {
	constructor(options) {
		this.context = __credo_ts_core.DID_V1_CONTEXT_URL;
		this.publicKey = [];
		this.service = [];
		this.authentication = [];
		if (options) {
			this.id = options.id;
			this.publicKey = options.publicKey;
			this.service = options.service;
			this.authentication = options.authentication;
		}
	}
	/**
	* Gets the matching public key for a given key id
	*
	* @param id fully qualified key id
	*/
	getPublicKey(id) {
		return this.publicKey.find((item) => item.id === id);
	}
	/**
	* Returns all of the service endpoints matching the given type.
	*
	* @param type The type of service(s) to query.
	*/
	getServicesByType(type) {
		return this.service.filter((service) => service.type === type);
	}
	/**
	* Returns all of the service endpoints matching the given class
	*
	* @param classType The class to query services.
	*/
	getServicesByClassType(classType) {
		return this.service.filter((service) => service instanceof classType);
	}
	/**
	* Get all DIDComm services ordered by priority descending. This means the highest
	* priority will be the first entry.
	*/
	get didCommServices() {
		const didCommServiceTypes = [__credo_ts_core.IndyAgentService.type, __credo_ts_core.DidCommV1Service.type];
		return this.service.filter((service) => didCommServiceTypes.includes(service.type)).sort((a, b) => a.priority - b.priority);
	}
};
require_decorate.__decorate([
	(0, import_cjs.Expose)({ name: "@context" }),
	(0, import_cjs$1.Equals)("https://www.w3.org/ns/did/v1"),
	require_decorateMetadata.__decorateMetadata("design:type", Object)
], DidDoc.prototype, "context", void 0);
require_decorate.__decorate([(0, import_cjs$1.IsString)(), require_decorateMetadata.__decorateMetadata("design:type", String)], DidDoc.prototype, "id", void 0);
require_decorate.__decorate([
	(0, import_cjs$1.IsArray)(),
	(0, import_cjs$1.ValidateNested)(),
	require_index$2.PublicKeyTransformer(),
	require_decorateMetadata.__decorateMetadata("design:type", Array)
], DidDoc.prototype, "publicKey", void 0);
require_decorate.__decorate([
	(0, import_cjs$1.IsArray)(),
	(0, import_cjs$1.ValidateNested)(),
	(0, __credo_ts_core.ServiceTransformer)(),
	require_decorateMetadata.__decorateMetadata("design:type", Array)
], DidDoc.prototype, "service", void 0);
require_decorate.__decorate([
	(0, import_cjs$1.IsArray)(),
	(0, import_cjs$1.ValidateNested)(),
	require_index$3.AuthenticationTransformer(),
	require_decorateMetadata.__decorateMetadata("design:type", Array)
], DidDoc.prototype, "authentication", void 0);

//#endregion
exports.DidDoc = DidDoc;