import { defineComponent as r, openBlock as u, createElementBlock as d, onMounted as h } from "vue";
const p = { class: "shj-for-ue" }, v = r({ name: "zv-scene-ue-shj" }), g = /* @__PURE__ */ r({
  ...v,
  props: {
    basicOption: {},
    sources: {},
    useEvents: {},
    uuid: {}
  },
  emits: ["ue-scene-on-message"],
  setup(c, { emit: a }) {
    const n = c, i = a;
    return (() => {
      h(() => {
        n.useEvents.length > 0 && n.useEvents.forEach((e) => {
          e && e.receivingMethod && (window.ue.interface[e.receivingMethod] = (s) => {
            try {
              if (!JSON.parse(s).data)
                throw new Error("");
              const o = n.useEvents.filter((t) => t.receivingMethod === e.receivingMethod && t.eventType === "on-message");
              i("ue-scene-on-message", JSON.parse(s).data), window.SHJParseEvent(o, "ue-scene-on-message", JSON.parse(s).data);
            } catch {
            }
          });
        });
      });
    })(), (e, s) => (u(), d("div", p));
  }
});
export {
  g as default
};
