import { loadModule as i } from "../../../../../node_modules/vue3-sfc-loader/dist/vue3-sfc-loader.esm.mjs";
import * as Vue from "vue";
const options = {
  moduleCache: {
    vue: Vue
  },
  getFile: (url) => {
    return fetch(url).then((response) => {
      if (!response.ok) throw new Error(`Failed to fetch ${url}`);
      return response.text();
    });
  },
  addStyle: (style) => {
    const styleElement = document.createElement("style");
    styleElement.textContent = style;
    document.head.appendChild(styleElement);
  },
  log: (level) => {
    console.log(`[vue3-sfc-loader] ${level}`);
  }
};
async function loadVueComponent(sfcCode) {
  const url = `virtual.vue?t=${Date.now()}`;
  return await i(url, {
    ...options,
    getFile: () => Promise.resolve(sfcCode)
  });
}
export {
  loadVueComponent
};
