import { T as PathId, g as getEnvColor, h as parseEnvVariables, w as useActiveEntities } from "./store-DpSUVhjp.js";
import { a as useLayout } from "./useSidebar-DLTwHDI-.js";
import { t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper-BmmBcIzD.js";
import { Fragment, computed, createApp, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, h, mergeProps, nextTick, normalizeClass, normalizeStyle, onMounted, openBlock, ref, renderList, renderSlot, toDisplayString, toRef, unref, useAttrs, vModelText, watch, withCtx, withDirectives, withKeys, withModifiers } from "vue";
import { ScalarButton, ScalarComboboxMultiselect, ScalarDropdown, ScalarDropdownDivider, ScalarDropdownItem, ScalarIcon, ScalarTeleport, ScalarTooltip } from "@scalar/components";
import { useRouter } from "vue-router";
import { REGEX } from "@scalar/oas-utils/helpers";
import { ScalarIconGlobe, ScalarIconPlus } from "@scalar/icons";
import { Decoration, EditorView, RangeSetBuilder, ViewPlugin, WidgetType, colorPicker, useCodeMirror, useDropdown } from "@scalar/use-codemirror";
import { nanoid } from "nanoid";
import { onClickOutside } from "@vueuse/core";
import Fuse from "fuse.js";
//#region src/views/Environment/EnvironmentVariableDropdown.vue?vue&type=script&setup=true&lang.ts
var _hoisted_1$2 = {
	key: 0,
	class: "gap-1/2 flex flex-col"
};
var _hoisted_2$2 = ["onClick"];
var _hoisted_3$2 = { class: "flex items-center gap-2 whitespace-nowrap" };
var _hoisted_4$2 = { class: "w-20 overflow-hidden text-right text-ellipsis whitespace-nowrap" };
//#endregion
//#region src/views/Environment/EnvironmentVariableDropdown.vue
var EnvironmentVariableDropdown_default = /* @__PURE__ */ defineComponent({
	__name: "EnvironmentVariableDropdown",
	props: {
		query: {},
		environment: {},
		envVariables: {},
		dropdownPosition: {}
	},
	emits: ["select"],
	setup(__props, { expose: __expose, emit: __emit }) {
		const props = __props;
		const emit = __emit;
		const isOpen = ref(true);
		const dropdownRef = ref(null);
		const selectedVariableIndex = ref(0);
		const router = useRouter();
		const { activeCollection } = useActiveEntities();
		const redirectToEnvironment = () => {
			if (!router) return;
			const { currentRoute, push } = router;
			const workspaceId = currentRoute.value.params.workspace;
			if (!activeCollection.value || activeCollection.value.info?.title === "Drafts") push({
				name: "environment.default",
				params: { [PathId.Workspace]: workspaceId }
			});
			else push({
				name: "collection.environment",
				params: { [PathId.Collection]: activeCollection.value.uid }
			});
			isOpen.value = false;
		};
		const fuse = new Fuse(parseEnvVariables(props.envVariables), { keys: ["key", "value"] });
		const filteredVariables = computed(() => {
			const searchQuery = props.query;
			if (!searchQuery)
 /** return the last 4 environment variables on first display */
			return parseEnvVariables(props.envVariables).slice(-4).filter(({ key, value }) => key !== "" || value !== "");
			/** filter environment variables by name */
			const result = fuse.search(searchQuery, { limit: 10 });
			if (result.length > 0) return result.map((res) => res.item).filter(({ key, value }) => key !== "" || value !== "");
			return [];
		});
		const selectVariable = (variableKey) => {
			emit("select", variableKey);
		};
		const handleArrowKey = (direction) => {
			const offset = direction === "up" ? -1 : 1;
			const length = filteredVariables.value.length;
			if (length === 0) return;
			selectedVariableIndex.value = (selectedVariableIndex.value + offset + length) % length;
		};
		const handleSelect = () => {
			if (selectedVariableIndex.value >= 0) {
				const selectedVariable = filteredVariables.value[selectedVariableIndex.value];
				if (selectedVariable) selectVariable(selectedVariable.key);
			}
		};
		__expose({
			handleArrowKey,
			handleSelect
		});
		onMounted(() => {
			selectedVariableIndex.value = 0;
		});
		const dropdownStyle = computed(() => {
			return {
				left: (props.dropdownPosition?.left ?? 0) + "px",
				top: (props.dropdownPosition?.top ?? 0) + 5 + "px"
			};
		});
		onClickOutside(dropdownRef, () => {
			isOpen.value = false;
		}, { ignore: [dropdownRef] });
		return (_ctx, _cache) => {
			return isOpen.value ? (openBlock(), createBlock(unref(ScalarTeleport), {
				key: 0,
				class: "scalar-client"
			}, {
				default: withCtx(() => [createElementVNode("div", {
					ref_key: "dropdownRef",
					ref: dropdownRef,
					class: "custom-scroll fixed top-0 left-0 flex max-h-[60svh] w-56 flex-col rounded border p-0.75",
					style: normalizeStyle(dropdownStyle.value)
				}, [filteredVariables.value.length ? (openBlock(), createElementBlock("ul", _hoisted_1$2, [(openBlock(true), createElementBlock(Fragment, null, renderList(filteredVariables.value, (item, index) => {
					return openBlock(), createElementBlock("li", {
						key: item.key,
						class: normalizeClass(["font-code text-xxs hover:bg-b-2 flex h-8 cursor-pointer items-center justify-between gap-1.5 rounded p-1.5 transition-colors duration-150", { "bg-b-2": index === selectedVariableIndex.value }]),
						onClick: ($event) => selectVariable(item.key)
					}, [createElementVNode("div", _hoisted_3$2, [item.source === "collection" && __props.environment.name !== "No Environment" ? (openBlock(), createElementBlock("span", {
						key: 0,
						class: "h-2.25 w-2.25 min-w-2.25 rounded-full",
						style: normalizeStyle({ backgroundColor: unref(getEnvColor)(__props.environment) })
					}, null, 4)) : (openBlock(), createBlock(unref(ScalarIconGlobe), {
						key: 1,
						class: "-ml-0.25 size-2.5",
						icon: "Globe"
					})), createTextVNode(" " + toDisplayString(item.key), 1)]), createElementVNode("span", _hoisted_4$2, toDisplayString(item.value), 1)], 10, _hoisted_2$2);
				}), 128))])) : unref(router) ? (openBlock(), createBlock(unref(ScalarButton), {
					key: 1,
					class: "font-code text-xxs bg-b-inherit hover:bg-b-2 flex h-8 w-full justify-start gap-2 px-1.5 transition-colors duration-150",
					variant: "outlined",
					onClick: redirectToEnvironment
				}, {
					default: withCtx(() => [createVNode(unref(ScalarIconPlus), { class: "size-3" }), _cache[0] || (_cache[0] = createTextVNode(" Add Variable ", -1))]),
					_: 1
				})) : createCommentVNode("", true), _cache[1] || (_cache[1] = createElementVNode("div", { class: "bg-b-1 brightness-lifted absolute inset-0 -z-1 rounded shadow-lg" }, null, -1))], 4)]),
				_: 1
			})) : createCommentVNode("", true);
		};
	}
});
//#endregion
//#region src/components/DataTable/DataTableInputSelect.vue?vue&type=script&setup=true&lang.ts
var _hoisted_1$1 = { class: "group-[.alert]:outline-orange group-[.error]:outline-red w-full pr-10 -outline-offset-1 has-[:focus-visible]:rounded-[4px] has-[:focus-visible]:outline" };
var _hoisted_2$1 = { class: "text-c-1 whitespace-nowrap" };
var _hoisted_3$1 = { class: "text-c-1 overflow-hidden text-ellipsis" };
var _hoisted_4$1 = { class: "overflow-hidden text-ellipsis" };
var _hoisted_5$1 = { class: "flex h-4 w-4 items-center justify-center" };
//#endregion
//#region src/components/DataTable/DataTableInputSelect.vue
var DataTableInputSelect_default = /* @__PURE__ */ defineComponent({
	__name: "DataTableInputSelect",
	props: {
		modelValue: {},
		value: {},
		default: {},
		canAddCustomValue: {
			type: Boolean,
			default: true
		},
		type: {}
	},
	emits: ["update:modelValue"],
	setup(__props, { emit: __emit }) {
		const props = __props;
		const emit = __emit;
		const options = computed(() => props.value ?? []);
		const addingCustomValue = ref(false);
		const customValue = ref("");
		const inputRef = ref(null);
		watch(customValue, (newValue) => {
			emit("update:modelValue", newValue);
		});
		const updateSelected = (value) => {
			emit("update:modelValue", value);
			addingCustomValue.value = false;
		};
		const addCustomValue = () => {
			if (customValue.value.trim()) updateSelected(customValue.value);
		};
		const handleBlur = () => {
			if (!customValue.value.trim()) emit("update:modelValue", "");
			addingCustomValue.value = false;
		};
		const isSelected = (value) => {
			return props.modelValue.toString() === value;
		};
		watch(addingCustomValue, (newValue) => {
			if (newValue) nextTick(() => {
				inputRef.value?.focus();
			});
		});
		const initialValue = computed(() => {
			return props.modelValue !== void 0 ? props.modelValue : props.default;
		});
		/** Currently selected array example values */
		const selectedArrayOptions = computed(() => {
			const selectedValues = new Set(props.modelValue.toString().split(", "));
			return options.value.filter((option) => selectedValues.has(option)).map((option) => ({
				id: option,
				label: option,
				value: option
			}));
		});
		/** Options for the array type */
		const arrayOptions = computed(() => options.value.map((option) => ({
			id: option,
			label: option,
			value: option
		})));
		/** Update the model value when the selected options change */
		const updateSelectedOptions = (selectedOptions) => {
			emit("update:modelValue", selectedOptions.map((option) => option.value).join(", "));
		};
		return (_ctx, _cache) => {
			return openBlock(), createElementBlock("div", _hoisted_1$1, [__props.type === "array" ? (openBlock(), createBlock(unref(ScalarComboboxMultiselect), {
				key: 0,
				modelValue: selectedArrayOptions.value,
				options: arrayOptions.value,
				"onUpdate:modelValue": updateSelectedOptions
			}, {
				default: withCtx(() => [createVNode(unref(ScalarButton), {
					class: "custom-scroll h-full justify-start gap-1.5 px-2 py-1.5 pr-6 font-normal outline-none",
					fullWidth: "",
					variant: "ghost"
				}, {
					default: withCtx(() => [createElementVNode("span", _hoisted_2$1, toDisplayString(selectedArrayOptions.value.length > 0 ? selectedArrayOptions.value.map((option) => option.label).join(", ") : "Select a value"), 1), createVNode(unref(ScalarIcon), {
						icon: "ChevronDown",
						size: "md",
						class: "min-w-4"
					})]),
					_: 1
				})]),
				_: 1
			}, 8, ["modelValue", "options"])) : addingCustomValue.value ? withDirectives((openBlock(), createElementBlock("input", {
				key: 1,
				ref_key: "inputRef",
				ref: inputRef,
				"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => customValue.value = $event),
				class: "text-c-1 w-full min-w-0 border-none px-2 py-1.5 outline-none",
				placeholder: "Value",
				type: "text",
				onBlur: handleBlur,
				onKeyup: withKeys(addCustomValue, ["enter"])
			}, null, 544)), [[vModelText, customValue.value]]) : (openBlock(), createBlock(unref(ScalarDropdown), {
				key: 2,
				resize: "",
				value: initialValue.value
			}, {
				items: withCtx(() => [(openBlock(true), createElementBlock(Fragment, null, renderList(options.value, (option) => {
					return openBlock(), createBlock(unref(ScalarDropdownItem), {
						key: option,
						class: "group/item flex items-center gap-1.5 overflow-hidden text-ellipsis whitespace-nowrap",
						value: option,
						onClick: ($event) => updateSelected(option)
					}, {
						default: withCtx(() => [createElementVNode("div", { class: normalizeClass(["flex h-4 w-4 items-center justify-center rounded-full p-[3px]", isSelected(option) ? "bg-c-accent text-b-1" : "shadow-border text-transparent"]) }, [createVNode(unref(ScalarIcon), {
							class: "size-2.5",
							icon: "Checkmark",
							thickness: "3"
						})], 2), createElementVNode("span", _hoisted_4$1, toDisplayString(option), 1)]),
						_: 2
					}, 1032, ["value", "onClick"]);
				}), 128)), __props.canAddCustomValue ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [options.value.length ? (openBlock(), createBlock(unref(ScalarDropdownDivider), { key: 0 })) : createCommentVNode("", true), createVNode(unref(ScalarDropdownItem), {
					class: "flex items-center gap-1.5",
					onClick: _cache[1] || (_cache[1] = ($event) => addingCustomValue.value = true)
				}, {
					default: withCtx(() => [createElementVNode("div", _hoisted_5$1, [createVNode(unref(ScalarIcon), {
						icon: "Add",
						size: "sm"
					})]), _cache[2] || (_cache[2] = createElementVNode("span", null, "Add value", -1))]),
					_: 1
				})], 64)) : createCommentVNode("", true)]),
				default: withCtx(() => [createVNode(unref(ScalarButton), {
					class: "size-full justify-start gap-1.5 overflow-auto px-2 py-1.5 font-normal whitespace-nowrap outline-none",
					variant: "ghost"
				}, {
					default: withCtx(() => [createElementVNode("span", _hoisted_3$1, toDisplayString(initialValue.value || "Select a value"), 1), createVNode(unref(ScalarIcon), {
						icon: "ChevronDown",
						size: "md"
					})]),
					_: 1
				})]),
				_: 1
			}, 8, ["value"]))]);
		};
	}
});
//#endregion
//#region src/components/CodeInput/codeVariableWidget.ts
/**
* Displays the value of a variable of the active environment in a pill
*/
var PillWidget = class PillWidget extends WidgetType {
	app;
	uid;
	environment;
	envVariables;
	isReadOnly;
	constructor(variableName, environment, envVariables, isReadOnly) {
		super();
		this.variableName = variableName;
		this.variableName = variableName;
		this.environment = environment;
		this.envVariables = envVariables;
		this.isReadOnly = isReadOnly ?? false;
		this.uid = nanoid();
	}
	toDOM() {
		const span = document.createElement("span");
		span.className = "cm-pill";
		span.textContent = `${this.variableName}`;
		this.app = createApp(defineComponent({
			props: { variableName: {
				type: String,
				default: null
			} },
			render: () => {
				const val = this.envVariables ? parseEnvVariables(this.envVariables).find((thing) => thing.key === this.variableName) : void 0;
				const isGlobal = val?.source === "global";
				const pillColor = isGlobal ? "var(--scalar-color-1)" : val && this.environment && this.environment.name !== "No Environment" ? getEnvColor(this.environment) : "var(--scalar-color-1)";
				span.style.setProperty("--tw-bg-base", pillColor);
				span.style.opacity = val?.value ? "1" : "0.5";
				const tooltipContent = val?.value || "No value";
				const tooltipTrigger = h("div", { class: "flex items-center gap-1 whitespace-nowrap" }, [(isGlobal || this.environment?.name === "No Environment" && val?.value) && h(ScalarIconGlobe, {
					class: "size-3 -ml-1",
					icon: "Globe"
				}), h("span", this.variableName)]);
				return h(ScalarTooltip, {
					content: tooltipContent,
					delay: 0,
					placement: "bottom",
					offset: 6
				}, { default: () => tooltipTrigger });
			}
		}), { variableName: this.variableName });
		this.app.mount(span);
		return span;
	}
	destroy() {
		if (this.app) this.app.unmount();
	}
	eq(other) {
		return other instanceof PillWidget && other.variableName === this.variableName && other.uid === this.uid;
	}
	ignoreEvent() {
		return false;
	}
};
/**
* Styles the active environment variable pill
*/
var pillPlugin = (props) => ViewPlugin.fromClass(class {
	decorations;
	constructor(view) {
		this.decorations = this.buildDecorations(view);
	}
	update(update) {
		if (update.docChanged || update.viewportChanged) requestAnimationFrame(() => {
			this.decorations = this.buildDecorations(update.view);
			update.view.update([]);
		});
	}
	buildDecorations(view) {
		const builder = new RangeSetBuilder();
		for (const { from, to } of view.visibleRanges) {
			const text = view.state.doc.sliceString(from, to);
			let match;
			while ((match = REGEX.VARIABLES.exec(text)) !== null) {
				const start = from + match.index;
				const end = start + match[0].length;
				const variableName = match[1] ?? "";
				builder.add(start, end, Decoration.widget({
					widget: new PillWidget(variableName, props.environment, props.envVariables, props.isReadOnly),
					side: 1
				}));
			}
		}
		return builder.finish();
	}
}, { decorations: (v) => v.decorations });
var backspaceCommand = EditorView.domEventHandlers({ keydown(event, view) {
	if (event.key === "Backspace") {
		const { state } = view;
		const { from, to } = state.selection.main;
		if (from === 0 && to === state.doc.length) {
			view.dispatch({
				changes: {
					from: 0,
					to: state.doc.length
				},
				selection: { anchor: 0 }
			});
			event.preventDefault();
			return true;
		}
		if (from === to && from > 0) {
			if (state.doc.sliceString(from - 2, from) === "}}") {
				view.dispatch({
					changes: {
						from: from - 2,
						to
					},
					selection: { anchor: from - 2 }
				});
				event.preventDefault();
				return true;
			}
		}
	}
	return false;
} });
//#endregion
//#region src/components/CodeInput/CodeInput.vue?vue&type=script&setup=true&lang.ts
var _hoisted_1 = { class: "whitespace-nowrap" };
var _hoisted_2 = ["id"];
var _hoisted_3 = {
	key: 0,
	class: "z-context text-c-2 absolute right-1.5 bottom-1 hidden font-sans group-has-[:focus-visible]/input:block",
	role: "alert"
};
var _hoisted_4 = {
	key: 5,
	class: "centered-y text-orange absolute right-7 text-xs"
};
var _hoisted_5 = {
	key: 6,
	class: "centered-y absolute right-0 flex h-full items-center p-1.5 group-has-[.cm-focused]:z-1"
};
var _hoisted_6 = {
	key: 7,
	class: "required centered-y text-xxs text-c-3 group-[.error]:text-red bg-b-1 pointer-events-none absolute right-0 mr-0.5 pt-px pr-2 opacity-100 shadow-[-8px_0_4px_var(--scalar-background-1)] transition-opacity duration-150 group-[.alert]:bg-transparent group-[.alert]:shadow-none group-[.error]:bg-transparent group-[.error]:shadow-none peer-has-[.cm-focused]:opacity-0"
};
//#endregion
//#region src/components/CodeInput/CodeInput.vue
var CodeInput_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
	inheritAttrs: false,
	__name: "CodeInput",
	props: {
		colorPicker: {
			type: Boolean,
			default: false
		},
		disabled: {
			type: Boolean,
			default: false
		},
		modelValue: {},
		error: { type: Boolean },
		emitOnBlur: {
			type: Boolean,
			default: true
		},
		extensions: { default: () => [] },
		lineNumbers: { type: Boolean },
		lint: { type: Boolean },
		disableTabIndent: {
			type: Boolean,
			default: false
		},
		language: {},
		handleFieldSubmit: {},
		handleFieldChange: {},
		placeholder: {},
		required: { type: Boolean },
		disableEnter: {
			type: Boolean,
			default: false
		},
		disableCloseBrackets: {
			type: Boolean,
			default: false
		},
		enum: {},
		examples: {},
		type: {},
		nullable: {
			type: Boolean,
			default: false
		},
		withVariables: {
			type: Boolean,
			default: true
		},
		importCurl: { type: Boolean },
		default: {},
		environment: {},
		envVariables: {},
		lineWrapping: {
			type: Boolean,
			default: false
		}
	},
	emits: [
		"submit",
		"update:modelValue",
		"curl",
		"blur"
	],
	setup(__props, { expose: __expose, emit: __emit }) {
		const props = __props;
		const emit = __emit;
		const attrs = useAttrs();
		const uid = attrs.id || `id-${nanoid()}`;
		const isFocused = ref(false);
		const showDropdown = ref(false);
		const dropdownQuery = ref("");
		const dropdownPosition = ref({
			left: 0,
			top: 0
		});
		const dropdownRef = ref(null);
		const { layout } = useLayout();
		/** Change is emitted during typing. This does not trigger validation */
		function handleChange(value) {
			if (value === props.modelValue) return null;
			if (props.importCurl && value.trim().toLowerCase().startsWith("curl")) {
				emit("curl", value);
				codeMirror.value?.dispatch({ changes: {
					from: 0,
					to: codeMirror.value.state.doc.length,
					insert: String(props.modelValue)
				} });
				return null;
			}
			return props.handleFieldChange ? props.handleFieldChange(value) : emit("update:modelValue", value);
		}
		/** Submit is emitted on blur and enter. This will trigger validation */
		function handleSubmit(value) {
			return props.handleFieldSubmit ? props.handleFieldSubmit(value) : emit("submit", value);
		}
		/** Optional submit on blur.  */
		function handleBlur(value) {
			isFocused.value = false;
			if (props.emitOnBlur && props.modelValue) handleSubmit(value);
			emit("blur", value);
		}
		const extensions = [...props.extensions];
		if (props.colorPicker) extensions.push(colorPicker);
		const pillPluginExtension = computed(() => pillPlugin({
			environment: props.environment,
			envVariables: props.envVariables,
			isReadOnly: layout === "modal"
		}));
		const baseExtensions = computed(() => [
			...extensions,
			pillPluginExtension.value,
			backspaceCommand
		]);
		const codeMirrorRef = ref(null);
		const { codeMirror } = useCodeMirror({
			content: toRef(() => props.modelValue !== void 0 ? String(props.modelValue) : ""),
			onChange: (value) => {
				handleChange(value);
				updateDropdownVisibility();
			},
			onFocus: () => isFocused.value = true,
			onBlur: (val) => handleBlur(val),
			codeMirrorRef,
			disableTabIndent: toRef(() => props.disableTabIndent),
			disableEnter: toRef(() => props.disableEnter),
			disableCloseBrackets: toRef(() => props.disableCloseBrackets),
			lineNumbers: toRef(() => props.lineNumbers),
			language: toRef(() => props.language),
			lint: toRef(() => props.lint),
			extensions: baseExtensions,
			placeholder: toRef(() => props.placeholder)
		});
		codeMirror.value?.focus();
		watch(codeMirror, () => {
			if (codeMirror.value && Object.hasOwn(attrs, "autofocus")) codeMirror.value.focus();
		});
		const { handleDropdownSelect, updateDropdownVisibility } = useDropdown({
			codeMirror,
			query: dropdownQuery,
			showDropdown,
			dropdownPosition
		});
		const booleanOptions = computed(() => props.nullable ? [
			"true",
			"false",
			"null"
		] : ["true", "false"]);
		const handleKeyDown = (key, event) => {
			if (showDropdown.value) {
				if (key === "down") {
					event.preventDefault();
					dropdownRef.value?.handleArrowKey("down");
				} else if (key === "up") {
					event.preventDefault();
					dropdownRef.value?.handleArrowKey("up");
				} else if (key === "enter") {
					event.preventDefault();
					dropdownRef.value?.handleSelect();
				}
			} else if (key === "escape") {
				if (!props.disableTabIndent) event.stopPropagation();
			} else if (key === "enter" && event.target instanceof HTMLDivElement) handleSubmit(event.target.textContent ?? "");
		};
		const defaultType = computed(() => {
			return Array.isArray(props.type) ? props.type.find((type) => type !== "null") ?? "string" : props.type;
		});
		const displayVariablesDropdown = computed(() => showDropdown.value && props.withVariables && layout !== "modal" && props.environment);
		__expose({
			focus: () => {
				codeMirror.value?.focus();
			},
			handleChange,
			handleSubmit,
			handleBlur,
			booleanOptions,
			codeMirror,
			modelValue: props.modelValue
		});
		return (_ctx, _cache) => {
			return openBlock(), createElementBlock(Fragment, null, [
				__props.disabled ? (openBlock(), createElementBlock("div", {
					key: 0,
					class: normalizeClass(["text-c-2 flex cursor-default items-center justify-center", unref(layout) === "modal" ? "font-code pr-2 pl-1 text-base" : "px-2"]),
					"data-testid": "code-input-disabled"
				}, [createElementVNode("span", _hoisted_1, toDisplayString(__props.modelValue), 1)], 2)) : props.enum && props.enum.length ? (openBlock(), createBlock(DataTableInputSelect_default, {
					key: 1,
					default: props.default,
					modelValue: __props.modelValue,
					type: defaultType.value,
					value: props.enum,
					"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => emit("update:modelValue", $event))
				}, null, 8, [
					"default",
					"modelValue",
					"type",
					"value"
				])) : __props.type === "boolean" || __props.type?.includes("boolean") ? (openBlock(), createBlock(DataTableInputSelect_default, {
					key: 2,
					default: props.default,
					modelValue: __props.modelValue,
					value: booleanOptions.value,
					"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => emit("update:modelValue", $event))
				}, null, 8, [
					"default",
					"modelValue",
					"value"
				])) : props.examples && props.examples.length ? (openBlock(), createBlock(DataTableInputSelect_default, {
					key: 3,
					default: props.default,
					modelValue: props.modelValue,
					value: props.examples,
					"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => emit("update:modelValue", $event))
				}, null, 8, [
					"default",
					"modelValue",
					"value"
				])) : (openBlock(), createElementBlock("div", mergeProps({
					key: 4,
					id: unref(uid)
				}, _ctx.$attrs, {
					ref_key: "codeMirrorRef",
					ref: codeMirrorRef,
					class: ["group/input group-[.alert]:outline-orange group-[.error]:outline-red font-code peer relative w-full overflow-hidden text-xs leading-[1.44] whitespace-nowrap -outline-offset-1 has-[:focus-visible]:rounded-[4px] has-[:focus-visible]:outline", {
						"line-wrapping has-[:focus-visible]:bg-b-1 has-[:focus-visible]:absolute has-[:focus-visible]:z-1": __props.lineWrapping,
						"flow-code-input--error": __props.error
					}],
					onKeydown: [
						_cache[3] || (_cache[3] = withKeys(withModifiers(($event) => handleKeyDown("down", $event), ["stop"]), ["down"])),
						_cache[4] || (_cache[4] = withKeys(($event) => handleKeyDown("enter", $event), ["enter"])),
						_cache[5] || (_cache[5] = withKeys(($event) => handleKeyDown("escape", $event), ["escape"])),
						_cache[6] || (_cache[6] = withKeys(withModifiers(($event) => handleKeyDown("up", $event), ["stop"]), ["up"]))
					]
				}), [!__props.disableTabIndent ? (openBlock(), createElementBlock("div", _hoisted_3, [..._cache[7] || (_cache[7] = [
					createTextVNode(" Press ", -1),
					createElementVNode("kbd", { class: "-mx-0.25 rounded border px-0.5 font-mono" }, "Esc", -1),
					createTextVNode(" then ", -1),
					createElementVNode("kbd", { class: "-mx-0.25 rounded border px-0.5 font-mono" }, "Tab", -1),
					createTextVNode(" to exit ", -1)
				])])) : createCommentVNode("", true)], 16, _hoisted_2)),
				_ctx.$slots.warning ? (openBlock(), createElementBlock("div", _hoisted_4, [renderSlot(_ctx.$slots, "warning", {}, void 0, true)])) : createCommentVNode("", true),
				_ctx.$slots.icon ? (openBlock(), createElementBlock("div", _hoisted_5, [renderSlot(_ctx.$slots, "icon", {}, void 0, true)])) : createCommentVNode("", true),
				__props.required ? (openBlock(), createElementBlock("div", _hoisted_6, " Required ")) : createCommentVNode("", true),
				displayVariablesDropdown.value ? (openBlock(), createBlock(EnvironmentVariableDropdown_default, {
					key: 8,
					ref_key: "dropdownRef",
					ref: dropdownRef,
					dropdownPosition: dropdownPosition.value,
					envVariables: __props.envVariables,
					environment: __props.environment,
					query: dropdownQuery.value,
					onSelect: unref(handleDropdownSelect)
				}, null, 8, [
					"dropdownPosition",
					"envVariables",
					"environment",
					"query",
					"onSelect"
				])) : createCommentVNode("", true)
			], 64);
		};
	}
}), [["__scopeId", "data-v-103d9d56"]]);
//#endregion
export { DataTableInputSelect_default as n, CodeInput_default as t };

//# sourceMappingURL=CodeInput-C-igR77V.js.map