import { useTyping } from "./hooks/useTyping.js";
import { computed, createVNode, defineComponent } from "vue";
//#region components/bubble/TypingContent.tsx
var TypingContent = /* @__PURE__ */ defineComponent({
	name: "XBubbleTypingContent",
	props: {
		prefixCls: {
			type: String,
			required: true
		},
		streaming: {
			type: Boolean,
			default: false
		},
		content: {
			type: String,
			required: true
		},
		typing: {
			type: [Boolean, Object],
			required: true
		},
		onTyping: {
			type: Function,
			default: void 0
		},
		onTypingComplete: {
			type: Function,
			default: void 0
		}
	},
	setup(props) {
		const { renderedData, animating, animationCfg } = useTyping({
			content: () => props.content,
			streaming: () => props.streaming,
			typing: () => props.typing,
			onTyping: props.onTyping,
			onTypingComplete: props.onTypingComplete
		});
		const isTyping = computed(() => animationCfg.value?.effect === "typing");
		return () => createVNode("div", { "class": [isTyping.value && animating.value ? `${props.prefixCls}-typing` : null, animationCfg.value?.effect === "fade-in" ? `${props.prefixCls}-fade-in` : null] }, [renderedData.value.map((item) => animationCfg.value?.effect === "fade-in" && !item.done ? createVNode("span", {
			"key": item.id,
			"class": "fade-in"
		}, [item.text]) : item.text)]);
	}
});
//#endregion
export { TypingContent };
