

const require_DidKey = require('./DidKey.js');

//#region src/modules/dids/methods/key/KeyDidResolver.ts
var KeyDidResolver = class {
	constructor() {
		this.supportedMethods = ["key"];
		this.allowsCaching = false;
		this.allowsLocalDidRecord = false;
	}
	async resolve(_agentContext, did) {
		const didDocumentMetadata = {};
		try {
			return {
				didDocument: require_DidKey.DidKey.fromDid(did).didDocument,
				didDocumentMetadata,
				didResolutionMetadata: { contentType: "application/did+ld+json" }
			};
		} catch (error) {
			return {
				didDocument: null,
				didDocumentMetadata,
				didResolutionMetadata: {
					error: "notFound",
					message: `resolver_error: Unable to resolve did '${did}': ${error}`
				}
			};
		}
	}
};

//#endregion
exports.KeyDidResolver = KeyDidResolver;