import "vant/lib/index.css";
import '@vant/touch-emulator';
import "@varlet/ui/es/popup/style/index";
import "@varlet/ui/es/snackbar/style/index";
import "@varlet/ui/es/cell/style/index";
import "@varlet/ui/es/switch/style/index";
import { createApp } from "vue";
import { setStoreData, storeData } from "../store";
import "../style.css";
import App from "./App";
import router from "./router";
import "./theme.css";
import "./custom-plugins/guide-driver/index.less"
import { getQuery } from "/src/utils/queryString";
import { getRequestHostname } from "/src/utils"

(function () {
	const query = getQuery();
	const u = navigator.userAgent;
	const instance: any =
		(window as any).DAYA ||
		(window as any).webkit?.messageHandlers?.DAYA ||
		(window as any).COLEXIU ||
		(window as any).webkit?.messageHandlers?.COLEXIU ||
		(window as any).ORCHESTRA ||
		(window as any).webkit?.messageHandlers?.ORCHESTRA;
	const apiPrefix = getRequestHostname()
	setStoreData({
		isApp: instance ? true : false,
		platformApi: apiPrefix,
		platformType: "",
		proxy: import.meta.env.DEV ? "/instrument" : "",
		isTeacher: u.includes('DAYAAPPTEACHER'),
	});
})();

createApp(App).use(router).mount("#app");
