

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 { isJsonObject } from "../../../../types.mjs";
import { IsString, ValidateBy, buildMessage, isString } from "class-validator";

//#region src/modules/dids/domain/service/DidDocumentService.ts
var DidDocumentService = class {
	constructor(options) {
		if (options) {
			this.id = options.id;
			this.serviceEndpoint = options.serviceEndpoint;
			this.type = options.type;
		}
	}
};
__decorate([IsString(), __decorateMetadata("design:type", String)], DidDocumentService.prototype, "id", void 0);
__decorate([IsStringOrJsonObjectSingleOrArray(), __decorateMetadata("design:type", Object)], DidDocumentService.prototype, "serviceEndpoint", void 0);
__decorate([IsString(), __decorateMetadata("design:type", String)], DidDocumentService.prototype, "type", void 0);
/**
* Checks if a given value is a string, a json object, or an array of strings and json objects
*/
function IsStringOrJsonObjectSingleOrArray(validationOptions) {
	return ValidateBy({
		name: "isStringOrJsonObjectSingleOrArray",
		validator: {
			validate: (value) => isString(value) || isJsonObject(value) || Array.isArray(value) && value.every((v) => isString(v) || isJsonObject(v)),
			defaultMessage: buildMessage((eachPrefix) => `${eachPrefix}$property must be a string, JSON object, or an array consisting of strings and JSON objects`, validationOptions)
		}
	}, validationOptions);
}

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