import { defineComponent, ref, watchEffect, openBlock, createElementBlock, normalizeClass, unref, Fragment, renderList, toDisplayString } from "vue";
import "../../../../adapter-vue.mjs";
import "../../emoji-config/index.mjs";
import { isPC } from "../../../../utils/env.mjs";
const _hoisted_1 = {
  key: 0,
  class: "text"
};
const _hoisted_2 = ["src", "alt"];
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "message-text",
  props: {
    content: { default: () => ({}) }
  },
  setup(__props) {
    const props = __props;
    const data = ref();
    watchEffect(() => {
      var _a;
      data.value = props.content;
      (_a = data.value.text) == null ? void 0 : _a.forEach((item) => {
        if (item.name === "img" && (item == null ? void 0 : item.type) === "custom") {
          {
            console.warn("CUSTOM_BASIC_EMOJI_URL is required for custom emoji, please check your CUSTOM_BASIC_EMOJI_URL.");
          }
        }
      });
    });
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", {
        class: normalizeClass(["message-text-container", unref(isPC) && "text-select"])
      }, [
        (openBlock(true), createElementBlock(Fragment, null, renderList(unref(data).text, (item, index) => {
          return openBlock(), createElementBlock("span", { key: index }, [
            item.name === "text" ? (openBlock(), createElementBlock("span", _hoisted_1, toDisplayString(item.text), 1)) : (openBlock(), createElementBlock("img", {
              key: 1,
              class: "emoji",
              src: item.src,
              alt: item.emojiKey
            }, null, 8, _hoisted_2))
          ]);
        }), 128))
      ], 2);
    };
  }
});
export {
  _sfc_main as default
};
