const require_rolldown_runtime = require('../../../../../_virtual/rolldown_runtime.js');
const require_index = 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');
let __credo_ts_core = require("@credo-ts/core");
__credo_ts_core = require_rolldown_runtime.__toESM(__credo_ts_core);

//#region ../didcomm/src/decorators/service/ServiceDecorator.ts
var import_cjs = /* @__PURE__ */ require_rolldown_runtime.__toESM(require_index.require_cjs());
/**
* Represents `~service` decorator
*
* Based on specification Aries RFC 0056: Service Decorator
* @see https://github.com/hyperledger/aries-rfcs/tree/master/features/0056-service-decorator
*/
var ServiceDecorator = class ServiceDecorator {
	constructor(options) {
		if (options) {
			this.recipientKeys = options.recipientKeys;
			this.routingKeys = options.routingKeys;
			this.serviceEndpoint = options.serviceEndpoint;
		}
	}
	get resolvedDidCommService() {
		return {
			id: __credo_ts_core.utils.uuid(),
			recipientKeys: this.recipientKeys.map(__credo_ts_core.verkeyToPublicJwk),
			routingKeys: this.routingKeys?.map(__credo_ts_core.verkeyToPublicJwk) ?? [],
			serviceEndpoint: this.serviceEndpoint
		};
	}
	static fromResolvedDidCommService(service) {
		return new ServiceDecorator({
			recipientKeys: service.recipientKeys.map((k) => __credo_ts_core.TypedArrayEncoder.toBase58(k.publicKey.publicKey)),
			routingKeys: service.routingKeys.map((k) => __credo_ts_core.TypedArrayEncoder.toBase58(k.publicKey.publicKey)),
			serviceEndpoint: service.serviceEndpoint
		});
	}
};
require_decorate.__decorate([
	(0, import_cjs.IsArray)(),
	(0, import_cjs.IsString)({ each: true }),
	require_decorateMetadata.__decorateMetadata("design:type", Array)
], ServiceDecorator.prototype, "recipientKeys", void 0);
require_decorate.__decorate([
	(0, import_cjs.IsArray)(),
	(0, import_cjs.IsString)({ each: true }),
	(0, import_cjs.IsOptional)(),
	require_decorateMetadata.__decorateMetadata("design:type", Array)
], ServiceDecorator.prototype, "routingKeys", void 0);
require_decorate.__decorate([(0, import_cjs.IsString)(), require_decorateMetadata.__decorateMetadata("design:type", String)], ServiceDecorator.prototype, "serviceEndpoint", void 0);

//#endregion
exports.ServiceDecorator = ServiceDecorator;