import { validationMessageValidator as e } from "../../common/validators/index.js";
import { filterFormattedMessages as t, getUniqueString as n, getValidationState as r } from "../../common/utils/index.js";
import { t as i } from "../../_plugin-vue_export-helper-BTgDAbhb.js";
import { Fragment as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, normalizeClass as l, openBlock as u, renderList as d } from "vue";
//#region components/validation_messages/validation_messages.vue
var f = {
	compatConfig: { MODE: 3 },
	name: "DtValidationMessages",
	props: {
		id: {
			type: String,
			default() {
				return n();
			}
		},
		validationMessages: {
			type: Array,
			default: () => [],
			validator: (t) => e(t)
		},
		showMessages: {
			type: Boolean,
			default: !0
		}
	},
	computed: {
		isFilteredValidationMessagesEmpty() {
			return this.filteredValidationMessages.length === 0;
		},
		filteredValidationMessages() {
			return t(this.validationMessages);
		},
		validationState() {
			return r(this.validationMessages);
		}
	},
	methods: {
		getMessageKey(e, t) {
			return `validation-message-${e}-${t}-${this.id}`;
		},
		messageTypeClass(e) {
			return {
				error: "base-input__message--error d-validation-message--error",
				warning: "base-input__message--warning d-validation-message--warning",
				success: "base-input__message--success d-validation-message--success"
			}[e];
		}
	}
}, p = {
	key: 0,
	class: "base-input__messages d-validation-message__container",
	"data-qa": "validation-messages-container"
}, m = ["innerHTML"];
function h(e, t, n, r, i, f) {
	return n.showMessages && !f.isFilteredValidationMessagesEmpty ? (u(), s("div", p, [(u(!0), s(a, null, d(f.filteredValidationMessages, ({ message: e, type: t }, n) => (u(), s("div", {
		key: f.getMessageKey(t, n),
		role: "status",
		"aria-live": "polite",
		"data-qa": "validation-message",
		class: l([
			"base-input__message",
			"d-validation-message",
			f.messageTypeClass(t)
		])
	}, [c("p", { innerHTML: e }, null, 8, m)], 2))), 128))])) : o("", !0);
}
var g = /* @__PURE__ */ i(f, [["render", h]]);
//#endregion
export { g as default };

//# sourceMappingURL=validation-messages.js.map