import { getActiveProxyUrl } from "../../../helpers/get-active-proxy-url.js";
import CollectionSettings_default from "../../settings/CollectionSettings.vue.js";
import DocumentSettings_default from "../../settings/DocumentSettings.vue.js";
import { createBlock, defineComponent, openBlock, unref } from "vue";
//#region src/v2/features/collection/components/Settings.vue?vue&type=script&setup=true&lang.ts
var Settings_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
	__name: "Settings",
	props: {
		documentSlug: {},
		document: {},
		eventBus: {},
		layout: {},
		path: {},
		method: {},
		exampleName: {},
		environment: {},
		securitySchemes: {},
		workspaceStore: {},
		activeWorkspace: {},
		plugins: {},
		customThemes: {},
		currentTheme: {},
		isDarkMode: { type: Boolean },
		fetchRegistryDocument: { type: Function },
		telemetry: { type: Boolean },
		onUpdateTelemetry: { type: Function },
		collectionType: {}
	},
	setup(__props) {
		const handleUpdateWatchMode = (watchMode) => {
			__props.eventBus.emit("document:update:watch-mode", watchMode);
		};
		const handleUpdateThemeSlug = (themeSlug) => {
			__props.eventBus.emit("workspace:update:theme", themeSlug);
		};
		const handleUpdateActiveProxy = (proxy) => {
			__props.eventBus.emit("workspace:update:active-proxy", proxy);
		};
		const handleUpdateColorMode = (colorMode) => {
			__props.eventBus.emit("workspace:update:color-mode", colorMode);
		};
		return (_ctx, _cache) => {
			return __props.collectionType === "document" ? (openBlock(), createBlock(unref(DocumentSettings_default), {
				key: 0,
				documentUrl: __props.document?.["x-scalar-original-source-url"],
				isDraftDocument: __props.documentSlug === "drafts",
				title: __props.document?.info.title ?? "",
				watchMode: __props.document?.["x-scalar-watch-mode"],
				"onDelete:document": _cache[0] || (_cache[0] = ($event) => __props.eventBus.emit("document:delete:document", { name: __props.documentSlug })),
				"onUpdate:watchMode": handleUpdateWatchMode
			}, null, 8, [
				"documentUrl",
				"isDraftDocument",
				"title",
				"watchMode"
			])) : (openBlock(), createBlock(unref(CollectionSettings_default), {
				key: 1,
				activeProxyUrl: unref(getActiveProxyUrl)(__props.workspaceStore.workspace["x-scalar-active-proxy"], __props.layout),
				activeThemeSlug: __props.workspaceStore.workspace["x-scalar-theme"] ?? "none",
				colorMode: __props.workspaceStore.workspace["x-scalar-color-mode"] ?? "system",
				customThemes: __props.customThemes,
				telemetry: __props.telemetry,
				"onUpdate:colorMode": handleUpdateColorMode,
				"onUpdate:proxyUrl": handleUpdateActiveProxy,
				"onUpdate:telemetry": _cache[1] || (_cache[1] = (value) => __props.onUpdateTelemetry?.(value)),
				"onUpdate:themeSlug": handleUpdateThemeSlug
			}, null, 8, [
				"activeProxyUrl",
				"activeThemeSlug",
				"colorMode",
				"customThemes",
				"telemetry"
			]));
		};
	}
});
//#endregion
export { Settings_vue_vue_type_script_setup_true_lang_default as default };

//# sourceMappingURL=Settings.vue.script.js.map