import { useComponentBaseConfig } from "../config-provider/context.js";
import useCSSVarCls_default from "../config-provider/hooks/useCSSVarCls.js";
import style_default from "./style/index.js";
import { resolveMessageIcon } from "./PurePanel.js";
import { computed, createVNode, defineComponent } from "vue";
import { clsx } from "@v-c/util";
import { NotificationList } from "@v-c/notification";

//#region src/message/PureList.tsx
/**
* @private Internal component. Do not use in production.
* Mirrors ant-design 6.4 `message._InternalListDoNotUseOrYouWillBeFired`.
*/
const PureList = /* @__PURE__ */ defineComponent((props) => {
	const { getPrefixCls } = useComponentBaseConfig("message", props);
	const prefixCls = computed(() => getPrefixCls("message"));
	const rootCls = useCSSVarCls_default(prefixCls);
	const [hashId, cssVarCls] = style_default(prefixCls, rootCls);
	return () => {
		const noticePrefixCls = `${prefixCls.value}-notice`;
		const classes = props.classes ?? {};
		const configList = props.items.map((item) => {
			const { content, duration, key, type } = item;
			const typeIconCls = type ? `${noticePrefixCls}-icon-${type}` : void 0;
			return {
				key,
				duration,
				icon: resolveMessageIcon(prefixCls.value, void 0, type),
				title: content,
				class: `${noticePrefixCls}-${type}`,
				classNames: {
					wrapper: `${prefixCls.value}-${type}`,
					icon: typeIconCls
				}
			};
		});
		return createVNode(NotificationList, {
			"prefixCls": prefixCls.value,
			"placement": "top",
			"configList": configList,
			"class": clsx(hashId.value, cssVarCls.value, rootCls.value),
			"classNames": {
				list: classes.list,
				listContent: classes.listContent,
				wrapper: classes.wrapper,
				title: classes.title,
				icon: classes.icon,
				root: classes.root
			},
			"style": props.style,
			"stack": false
		}, null);
	};
}, {
	props: {
		items: {
			type: Array,
			required: true
		},
		classes: {
			type: [Object, Function],
			required: false
		},
		style: {
			type: Object,
			required: false
		}
	},
	name: "MessagePureList",
	inheritAttrs: false
});
var PureList_default = PureList;

//#endregion
export { PureList_default as default };