import { r as useWorkspace } from "./store-DpSUVhjp.js";
import { t as _plugin_vue_export_helper_default } from "./_plugin-vue_export-helper-BmmBcIzD.js";
import { n as DataTableCell_default, r as DataTable_default, t as DataTableRow_default } from "./DataTableRow-c3XveEUO.js";
import { n as DataTableCheckbox_default } from "./DataTable-BqbZKW3K.js";
import { t as DataTableInput_default } from "./DataTableInput-yaU5g-kP.js";
import { t as ViewLayoutCollapse_default } from "./ViewLayoutCollapse-CiTb-Uml.js";
import { a as formatScheme, i as formatComplexScheme, o as getSchemeOptions, s as getSecurityRequirements, t as authorizeOauth2 } from "./libs-spbv4P0g.js";
import { Fragment, capitalize, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, mergeProps, normalizeClass, onMounted, openBlock, ref, renderList, renderSlot, toDisplayString, unref, useId, watch, withCtx, withModifiers } from "vue";
import { ScalarButton, ScalarComboboxMultiselect, ScalarIcon, ScalarIconButton, ScalarListboxCheckbox, ScalarMarkdownSummary, ScalarModal, useLoadingState, useModal } from "@scalar/components";
import { useToasts } from "@scalar/use-toasts";
import { isDefined } from "@scalar/oas-utils/helpers";
import { CLIENT_LS_KEYS, safeLocalStorage } from "@scalar/helpers/object/local-storage";
import { pkceOptions } from "@scalar/oas-utils/entities/spec";
import { isDefined as isDefined$1 } from "@scalar/helpers/array/is-defined";
import { Disclosure, DisclosureButton, DisclosurePanel } from "@headlessui/vue";
import { ScalarIconCaretDown, ScalarIconTrash } from "@scalar/icons";
//#region src/views/Request/RequestSection/RequestAuth/DeleteRequestAuthModal.vue?vue&type=script&setup=true&lang.ts
var _hoisted_1$6 = { class: "text-c-2 mb-4 text-sm leading-normal" };
var _hoisted_2$5 = { class: "flex justify-between gap-2" };
//#endregion
//#region src/views/Request/RequestSection/RequestAuth/DeleteRequestAuthModal.vue
var DeleteRequestAuthModal_default = /* @__PURE__ */ defineComponent({
	__name: "DeleteRequestAuthModal",
	props: {
		state: {},
		scheme: {}
	},
	emits: ["close", "delete"],
	setup(__props, { emit: __emit }) {
		const props = __props;
		const emit = __emit;
		const { securitySchemeMutators } = useWorkspace();
		const deleteScheme = () => {
			if (props.scheme?.id) securitySchemeMutators.delete(props.scheme.id);
			emit("delete");
		};
		return (_ctx, _cache) => {
			return openBlock(), createBlock(unref(ScalarModal), {
				size: "xxs",
				state: __props.state,
				title: "Delete Security Scheme"
			}, {
				default: withCtx(() => [createElementVNode("p", _hoisted_1$6, " This cannot be undone. You're about to delete the " + toDisplayString(__props.scheme?.label) + " security scheme from the collection. ", 1), createElementVNode("div", _hoisted_2$5, [createVNode(unref(ScalarButton), {
					class: "flex h-8 cursor-pointer items-center gap-1.5 px-3 shadow-none focus:outline-none",
					type: "button",
					variant: "outlined",
					onClick: _cache[0] || (_cache[0] = ($event) => emit("close"))
				}, {
					default: withCtx(() => [..._cache[1] || (_cache[1] = [createTextVNode(" Cancel ", -1)])]),
					_: 1
				}), createVNode(unref(ScalarButton), {
					class: "flex h-8 cursor-pointer items-center gap-1.5 px-3 shadow-none focus:outline-none",
					type: "submit",
					onClick: deleteScheme
				}, {
					default: withCtx(() => [createTextVNode(" Delete " + toDisplayString(__props.scheme?.label), 1)]),
					_: 1
				})])]),
				_: 1
			}, 8, ["state"]);
		};
	}
});
//#endregion
//#region src/views/Request/RequestSection/helpers/update-scheme.ts
/** Update the security scheme with side effects */
var updateScheme = (uid, path, value, { securitySchemeMutators, securitySchemes }, persistAuth = false) => {
	securitySchemeMutators.edit(uid, path, value);
	if (!persistAuth) return;
	try {
		const auth = JSON.parse(safeLocalStorage().getItem(CLIENT_LS_KEYS.AUTH) ?? "{}");
		const scheme = securitySchemes[uid];
		if (auth && scheme?.nameKey) {
			const nameScheme = auth[scheme.nameKey] ||= {};
			nameScheme[path] = value;
			safeLocalStorage().setItem(CLIENT_LS_KEYS.AUTH, JSON.stringify(auth));
		}
	} catch (e) {
		console.error(e);
	}
};
//#endregion
//#region src/views/Request/RequestSection/RequestAuth/helpers/restore-auth-from-local-storage.ts
/**
* Manually restore the auth from local storage
*
* Only use this if you need to restore auth manually, in the client web + app we load the whole store from
* local storage so it isn't needed there.
*/
var restoreAuthFromLocalStorage = (store, collectionUid) => {
	try {
		const { collectionMutators, securitySchemes, securitySchemeMutators } = store;
		const auth = JSON.parse(safeLocalStorage().getItem(CLIENT_LS_KEYS.AUTH) ?? "{}");
		/** Map the security scheme name key to the uid */
		const dict = Object.keys(securitySchemes).reduce((acc, key) => {
			const scheme = securitySchemes[key];
			if (scheme) acc[scheme.nameKey] = scheme.uid;
			return acc;
		}, {});
		/** Now we can use the dict to restore the auth from local storage */
		Object.entries(auth).forEach(([key, entry]) => {
			const uid = dict[key];
			if (uid) Object.entries(entry).forEach(([path, value]) => {
				securitySchemeMutators.edit(uid, path, value);
			});
		});
		const uids = JSON.parse(safeLocalStorage().getItem(CLIENT_LS_KEYS.SELECTED_SECURITY_SCHEMES) ?? "[]").map((nameKeys) => {
			if (Array.isArray(nameKeys)) return nameKeys.map((key) => dict[key]).filter(isDefined$1);
			return dict[nameKeys];
		}).filter(isDefined$1);
		collectionMutators.edit(collectionUid, "selectedSecuritySchemeUids", uids);
	} catch (e) {
		console.error(e);
	}
};
//#endregion
//#region src/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue?vue&type=script&setup=true&lang.ts
var _hoisted_1$5 = { class: "flex h-fit w-full" };
var _hoisted_2$4 = { class: "flex-1" };
var _hoisted_3$3 = { class: "flex items-center gap-1.75" };
var _hoisted_4$1 = {
	class: "grid auto-rows-auto",
	style: { gridTemplateColumns: "1fr auto" }
};
var _hoisted_5$1 = { key: 0 };
var _hoisted_6 = { class: "font-code text-xs" };
//#endregion
//#region src/views/Request/RequestSection/RequestAuth/OAuthScopesInput.vue
var OAuthScopesInput_default = /* @__PURE__ */ defineComponent({
	__name: "OAuthScopesInput",
	props: {
		flow: {},
		updateScheme: { type: Function }
	},
	setup(__props) {
		const scopes = computed(() => Object.entries(__props.flow?.scopes ?? {}).map(([key, val]) => ({
			id: key,
			label: key,
			description: val
		})));
		/** An array of the selected scope ids */
		const selectedScopes = computed(() => __props.flow?.selectedScopes || []);
		function setScope(id, checked) {
			if (checked) __props.updateScheme(`flows.${__props.flow.type}.selectedScopes`, [...selectedScopes.value, id]);
			else __props.updateScheme(`flows.${__props.flow.type}.selectedScopes`, selectedScopes.value.filter((scope) => scope !== id));
		}
		const allScopesSelected = computed(() => __props.flow?.selectedScopes?.length === Object.keys(__props.flow?.scopes ?? {}).length);
		const selectAllScopes = () => {
			__props.updateScheme(`flows.${__props.flow.type}.selectedScopes`, Object.keys(__props.flow?.scopes ?? {}));
		};
		const deselectAllScopes = () => {
			__props.updateScheme(`flows.${__props.flow.type}.selectedScopes`, []);
		};
		return (_ctx, _cache) => {
			return openBlock(), createBlock(unref(DataTableCell_default), { class: "h-auto !max-h-[initial] min-h-8 items-center" }, {
				default: withCtx(() => [createElementVNode("div", _hoisted_1$5, [_cache[2] || (_cache[2] = createElementVNode("div", { class: "text-c-1 h-full items-center" }, null, -1)), createVNode(unref(Disclosure), {
					as: "div",
					class: "bl flex w-full flex-col"
				}, {
					default: withCtx(() => [createVNode(unref(DisclosureButton), { class: normalizeClass(["group/scopes-accordion hover:text-c-1 flex h-auto min-h-8 cursor-pointer items-center gap-1.5 pr-2.25 pl-3 text-left", (__props.flow?.selectedScopes?.length || 0) > 0 ? "text-c-1" : "text-c-3"]) }, {
						default: withCtx(({ open }) => [createElementVNode("div", _hoisted_2$4, " Scopes Selected " + toDisplayString(__props.flow?.selectedScopes?.length || 0) + " / " + toDisplayString(Object.keys(__props.flow?.scopes ?? {}).length || 0), 1), createElementVNode("div", _hoisted_3$3, [
							allScopesSelected.value ? (openBlock(), createBlock(unref(ScalarButton), {
								key: 0,
								class: "pr-0.75 pl-1 transition-none",
								size: "sm",
								variant: "ghost",
								onClick: withModifiers(deselectAllScopes, ["stop"])
							}, {
								default: withCtx(() => [..._cache[0] || (_cache[0] = [createTextVNode(" Deselect All ", -1)])]),
								_: 1
							})) : createCommentVNode("", true),
							!allScopesSelected.value ? (openBlock(), createBlock(unref(ScalarButton), {
								key: 1,
								class: "pr-0.75 pl-1 transition-none",
								size: "sm",
								variant: "ghost",
								onClick: withModifiers(selectAllScopes, ["stop"])
							}, {
								default: withCtx(() => [..._cache[1] || (_cache[1] = [createTextVNode(" Select All ", -1)])]),
								_: 1
							})) : createCommentVNode("", true),
							createVNode(unref(ScalarIcon), {
								class: "text-c-3 group-hover/scopes-accordion:text-c-2",
								icon: open ? "ChevronDown" : "ChevronRight",
								size: "md"
							}, null, 8, ["icon"])
						])]),
						_: 1
					}, 8, ["class"]), createVNode(unref(DisclosurePanel), { as: "template" }, {
						default: withCtx(() => [createElementVNode("table", _hoisted_4$1, [(openBlock(true), createElementBlock(Fragment, null, renderList(scopes.value, ({ id, label, description }) => {
							return openBlock(), createBlock(unref(DataTableRow_default), {
								key: id,
								class: "text-c-2",
								onClick: ($event) => setScope(id, !selectedScopes.value.includes(id))
							}, {
								default: withCtx(() => [createVNode(unref(DataTableCell_default), { class: "hover:text-c-1 box-border !max-h-[initial] w-full cursor-pointer px-3 py-1.5" }, {
									default: withCtx(() => [description ? (openBlock(), createElementBlock("div", _hoisted_5$1, [createElementVNode("span", _hoisted_6, toDisplayString(label), 1), createTextVNode(" – " + toDisplayString(description), 1)])) : createCommentVNode("", true)]),
									_: 2
								}, 1024), createVNode(unref(DataTableCheckbox_default), {
									modelValue: selectedScopes.value.includes(id),
									"onUpdate:modelValue": () => {}
								}, null, 8, ["modelValue"])]),
								_: 2
							}, 1032, ["onClick"]);
						}), 128))])]),
						_: 1
					})]),
					_: 1
				})])]),
				_: 1
			});
		};
	}
});
//#endregion
//#region src/views/Request/RequestSection/RequestAuth/RequestAuthDataTableInput.vue?vue&type=script&setup=true&lang.ts
var _hoisted_1$4 = ["for"];
//#endregion
//#region src/views/Request/RequestSection/RequestAuth/RequestAuthDataTableInput.vue
var RequestAuthDataTableInput_default = /* @__PURE__ */ defineComponent({
	__name: "RequestAuthDataTableInput",
	props: {
		type: {},
		containerClass: {},
		required: {
			type: Boolean,
			default: false
		},
		modelValue: {},
		readOnly: {
			type: Boolean,
			default: false
		},
		environment: {},
		envVariables: {},
		workspace: {}
	},
	emits: [
		"update:modelValue",
		"inputFocus",
		"inputBlur",
		"selectVariable"
	],
	setup(__props, { emit: __emit }) {
		const props = __props;
		const emit = __emit;
		const id = useId();
		return (_ctx, _cache) => {
			return openBlock(), createBlock(DataTableInput_default, mergeProps({
				id: unref(id),
				canAddCustomEnumValue: !props.readOnly,
				containerClass: props.containerClass
			}, _ctx.$attrs, {
				envVariables: props.envVariables,
				environment: props.environment,
				lineWrapping: "",
				modelValue: props.modelValue,
				readOnly: props.readOnly,
				required: props.required,
				type: props.type,
				workspace: props.workspace,
				onInputBlur: _cache[0] || (_cache[0] = ($event) => emit("inputBlur")),
				onInputFocus: _cache[1] || (_cache[1] = ($event) => emit("inputFocus")),
				onSelectVariable: _cache[2] || (_cache[2] = ($event) => emit("selectVariable", $event)),
				"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => emit("update:modelValue", $event))
			}), {
				default: withCtx(() => [createElementVNode("label", { for: unref(id) }, [renderSlot(_ctx.$slots, "default")], 8, _hoisted_1$4)]),
				icon: withCtx(() => [renderSlot(_ctx.$slots, "icon")]),
				_: 3
			}, 16, [
				"id",
				"canAddCustomEnumValue",
				"containerClass",
				"envVariables",
				"environment",
				"modelValue",
				"readOnly",
				"required",
				"type",
				"workspace"
			]);
		};
	}
});
//#endregion
//#region src/views/Request/RequestSection/RequestAuth/OAuth2.vue?vue&type=script&setup=true&lang.ts
var _hoisted_1$3 = { class: "flex h-8 items-center justify-end border-t" };
var _hoisted_2$3 = { class: "flex h-8 w-full items-center justify-end border-t" };
//#endregion
//#region src/views/Request/RequestSection/RequestAuth/OAuth2.vue
var OAuth2_default = /* @__PURE__ */ defineComponent({
	__name: "OAuth2",
	props: {
		collection: {},
		environment: {},
		envVariables: {},
		flow: {},
		persistAuth: {
			type: Boolean,
			default: false
		},
		scheme: {},
		server: {},
		workspace: {}
	},
	emits: ["authorized"],
	setup(__props, { emit: __emit }) {
		const emits = __emit;
		const loader = useLoadingState();
		const { toast } = useToasts();
		const storeContext = useWorkspace();
		/** Update the current scheme */
		const updateScheme$2 = (path, value) => updateScheme(__props.scheme.uid, path, value, storeContext, __props.persistAuth);
		/** Authorize the user using specified flow */
		const handleAuthorize = async () => {
			if (loader.isActive || !__props.collection?.uid) return;
			if (!__props.server) {
				toast("No server selected", "error");
				return;
			}
			loader.start();
			const [error, accessToken] = await authorizeOauth2(__props.flow, __props.server, __props.workspace?.proxyUrl);
			await loader.clear();
			if (accessToken) {
				updateScheme$2(`flows.${__props.flow.type}.token`, accessToken);
				emits("authorized");
			} else {
				console.error(error);
				toast(error?.message ?? "Failed to authorize", "error");
			}
		};
		/** To make prop drilling a little easier */
		const dataTableInputProps = {
			environment: __props.environment,
			envVariables: __props.envVariables,
			workspace: __props.workspace
		};
		return (_ctx, _cache) => {
			return openBlock(), createElementBlock(Fragment, null, [__props.flow.token ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [createVNode(unref(DataTableRow_default), null, {
				default: withCtx(() => [createVNode(RequestAuthDataTableInput_default, mergeProps(dataTableInputProps, {
					class: "border-r-transparent",
					modelValue: __props.flow.token,
					placeholder: "QUxMIFlPVVIgQkFTRSBBUkUgQkVMT05HIFRPIFVT",
					type: "password",
					"onUpdate:modelValue": _cache[0] || (_cache[0] = (v) => updateScheme$2(`flows.${__props.flow.type}.token`, v))
				}), {
					default: withCtx(() => [..._cache[10] || (_cache[10] = [createTextVNode(" Access Token ", -1)])]),
					_: 1
				}, 16, ["modelValue"])]),
				_: 1
			}), createVNode(unref(DataTableRow_default), { class: "min-w-full" }, {
				default: withCtx(() => [createElementVNode("div", _hoisted_1$3, [createVNode(unref(ScalarButton), {
					class: "mr-1 p-0 px-2 py-0.5",
					loader: unref(loader),
					size: "sm",
					variant: "outlined",
					onClick: _cache[1] || (_cache[1] = ($event) => updateScheme$2(`flows.${__props.flow.type}.token`, ""))
				}, {
					default: withCtx(() => [..._cache[11] || (_cache[11] = [createTextVNode(" Clear ", -1)])]),
					_: 1
				}, 8, ["loader"]), renderSlot(_ctx.$slots, "oauth-actions")])]),
				_: 3
			})], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
				createVNode(unref(DataTableRow_default), null, {
					default: withCtx(() => ["authorizationUrl" in __props.flow ? (openBlock(), createBlock(RequestAuthDataTableInput_default, mergeProps({ key: 0 }, dataTableInputProps, {
						containerClass: "border-r-0",
						modelValue: __props.flow.authorizationUrl,
						placeholder: "https://galaxy.scalar.com/authorize",
						"onUpdate:modelValue": _cache[2] || (_cache[2] = (v) => updateScheme$2(`flows.${__props.flow.type}.authorizationUrl`, v))
					}), {
						default: withCtx(() => [..._cache[12] || (_cache[12] = [createTextVNode(" Auth URL ", -1)])]),
						_: 1
					}, 16, ["modelValue"])) : createCommentVNode("", true), "tokenUrl" in __props.flow ? (openBlock(), createBlock(RequestAuthDataTableInput_default, mergeProps({ key: 1 }, dataTableInputProps, {
						modelValue: __props.flow.tokenUrl,
						placeholder: "https://galaxy.scalar.com/token",
						"onUpdate:modelValue": _cache[3] || (_cache[3] = (v) => updateScheme$2(`flows.${__props.flow.type}.tokenUrl`, v))
					}), {
						default: withCtx(() => [..._cache[13] || (_cache[13] = [createTextVNode(" Token URL ", -1)])]),
						_: 1
					}, 16, ["modelValue"])) : createCommentVNode("", true)]),
					_: 1
				}),
				"x-scalar-redirect-uri" in __props.flow ? (openBlock(), createBlock(unref(DataTableRow_default), { key: 0 }, {
					default: withCtx(() => [createVNode(RequestAuthDataTableInput_default, mergeProps(dataTableInputProps, {
						modelValue: __props.flow["x-scalar-redirect-uri"],
						placeholder: "https://galaxy.scalar.com/callback",
						"onUpdate:modelValue": _cache[4] || (_cache[4] = (v) => updateScheme$2(`flows.${__props.flow.type}.x-scalar-redirect-uri`, v))
					}), {
						default: withCtx(() => [..._cache[14] || (_cache[14] = [createTextVNode(" Redirect URL ", -1)])]),
						_: 1
					}, 16, ["modelValue"])]),
					_: 1
				})) : createCommentVNode("", true),
				__props.flow.type === "password" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [createVNode(unref(DataTableRow_default), null, {
					default: withCtx(() => [createVNode(RequestAuthDataTableInput_default, mergeProps(dataTableInputProps, {
						class: "text-c-2",
						modelValue: __props.flow.username,
						placeholder: "janedoe",
						"onUpdate:modelValue": _cache[5] || (_cache[5] = (v) => updateScheme$2(`flows.${__props.flow.type}.username`, v))
					}), {
						default: withCtx(() => [..._cache[15] || (_cache[15] = [createTextVNode(" Username ", -1)])]),
						_: 1
					}, 16, ["modelValue"])]),
					_: 1
				}), createVNode(unref(DataTableRow_default), null, {
					default: withCtx(() => [createVNode(RequestAuthDataTableInput_default, mergeProps(dataTableInputProps, {
						modelValue: __props.flow.password,
						placeholder: "********",
						type: "password",
						"onUpdate:modelValue": _cache[6] || (_cache[6] = (v) => updateScheme$2(`flows.${__props.flow.type}.password`, v))
					}), {
						default: withCtx(() => [..._cache[16] || (_cache[16] = [createTextVNode(" Password ", -1)])]),
						_: 1
					}, 16, ["modelValue"])]),
					_: 1
				})], 64)) : createCommentVNode("", true),
				createVNode(unref(DataTableRow_default), null, {
					default: withCtx(() => [createVNode(RequestAuthDataTableInput_default, mergeProps(dataTableInputProps, {
						modelValue: __props.flow["x-scalar-client-id"],
						placeholder: "12345",
						"onUpdate:modelValue": _cache[7] || (_cache[7] = (v) => updateScheme$2(`flows.${__props.flow.type}.x-scalar-client-id`, v))
					}), {
						default: withCtx(() => [..._cache[17] || (_cache[17] = [createTextVNode(" Client ID ", -1)])]),
						_: 1
					}, 16, ["modelValue"])]),
					_: 1
				}),
				"clientSecret" in __props.flow ? (openBlock(), createBlock(unref(DataTableRow_default), { key: 2 }, {
					default: withCtx(() => [createVNode(RequestAuthDataTableInput_default, mergeProps(dataTableInputProps, {
						modelValue: __props.flow.clientSecret,
						placeholder: "XYZ123",
						type: "password",
						"onUpdate:modelValue": _cache[8] || (_cache[8] = (v) => updateScheme$2(`flows.${__props.flow.type}.clientSecret`, v))
					}), {
						default: withCtx(() => [..._cache[18] || (_cache[18] = [createTextVNode(" Client Secret ", -1)])]),
						_: 1
					}, 16, ["modelValue"])]),
					_: 1
				})) : createCommentVNode("", true),
				"x-usePkce" in __props.flow ? (openBlock(), createBlock(unref(DataTableRow_default), { key: 3 }, {
					default: withCtx(() => [createVNode(RequestAuthDataTableInput_default, mergeProps(dataTableInputProps, {
						enum: unref(pkceOptions),
						modelValue: __props.flow["x-usePkce"],
						readOnly: "",
						"onUpdate:modelValue": _cache[9] || (_cache[9] = (v) => updateScheme$2(`flows.${__props.flow.type}.x-usePkce`, v))
					}), {
						default: withCtx(() => [..._cache[19] || (_cache[19] = [createTextVNode(" Use PKCE ", -1)])]),
						_: 1
					}, 16, ["enum", "modelValue"])]),
					_: 1
				})) : createCommentVNode("", true),
				Object.keys(__props.flow.scopes ?? {}).length ? (openBlock(), createBlock(unref(DataTableRow_default), { key: 4 }, {
					default: withCtx(() => [createVNode(OAuthScopesInput_default, {
						flow: __props.flow,
						updateScheme: updateScheme$2
					}, null, 8, ["flow"])]),
					_: 1
				})) : createCommentVNode("", true)
			], 64)), !__props.flow.token ? (openBlock(), createBlock(unref(DataTableRow_default), {
				key: 2,
				class: "min-w-full"
			}, {
				default: withCtx(() => [createElementVNode("div", _hoisted_2$3, [createVNode(unref(ScalarButton), {
					class: "mr-0.75 p-0 px-2 py-0.5",
					loader: unref(loader),
					size: "sm",
					variant: "outlined",
					onClick: handleAuthorize
				}, {
					default: withCtx(() => [..._cache[20] || (_cache[20] = [createTextVNode(" Authorize ", -1)])]),
					_: 1
				}, 8, ["loader"])])]),
				_: 1
			})) : createCommentVNode("", true)], 64);
		};
	}
});
//#endregion
//#region src/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue?vue&type=script&setup=true&lang.ts
var _hoisted_1$2 = { class: "bg-b-1 text-c-2 outline-b-3 top-0 z-1 h-full w-full overflow-hidden px-3 py-1.25 text-ellipsis group-hover/auth:absolute group-hover/auth:h-auto group-hover/auth:border-b *:first:line-clamp-1 *:first:text-ellipsis group-hover/auth:*:first:line-clamp-none" };
var _hoisted_2$2 = {
	key: 0,
	class: "flex min-h-8 border-t text-base"
};
var _hoisted_3$2 = { class: "flex h-8 max-w-full gap-2.5 overflow-x-auto px-3" };
var _hoisted_4 = ["onClick"];
var _hoisted_5 = { class: "relative z-10" };
//#endregion
//#region src/views/Request/RequestSection/RequestAuth/RequestAuthTab.vue
var RequestAuthTab_default = /* @__PURE__ */ defineComponent({
	__name: "RequestAuthTab",
	props: {
		collection: {},
		environment: {},
		envVariables: {},
		layout: {},
		persistAuth: {
			type: Boolean,
			default: false
		},
		securitySchemeUids: {},
		server: {},
		workspace: {}
	},
	emits: ["authorized"],
	setup(__props, { emit: __emit }) {
		const emits = __emit;
		const storeContext = useWorkspace();
		const { securitySchemes } = storeContext;
		const security = computed(() => __props.securitySchemeUids.map((uid) => ({ scheme: securitySchemes[uid] })));
		const activeFlow = ref("");
		const generateLabel = (scheme) => {
			const description = scheme.description ? `: ${scheme.description}` : "";
			const baseLabel = `${capitalize(scheme.nameKey)}${description || `: ${scheme.type}`}`;
			if (scheme.type === "apiKey") return `${capitalize(scheme.nameKey)}${description || `: ${scheme.in}`}`;
			if (scheme.type === "oauth2") {
				const firstFlow = Object.values(scheme.flows ?? {})[0];
				return `${capitalize(scheme.nameKey)}: ${activeFlow.value ? activeFlow.value : firstFlow?.type ?? ""}${description}`;
			}
			if (scheme.type === "http") return `${capitalize(scheme.nameKey)}: ${scheme.scheme}${description}`;
			return `${baseLabel}${description}`;
		};
		/** Wrapper for the updateScheme function */
		const updateScheme$1 = (uid, path, value) => {
			updateScheme(uid, path, value, storeContext, __props.persistAuth);
		};
		onMounted(() => {
			if (!__props.persistAuth) return;
			restoreAuthFromLocalStorage(storeContext, __props.collection.uid);
		});
		/** To make prop drilling a little easier */
		const dataTableInputProps = {
			environment: __props.environment,
			envVariables: __props.envVariables,
			workspace: __props.workspace
		};
		return (_ctx, _cache) => {
			return openBlock(true), createElementBlock(Fragment, null, renderList(security.value, ({ scheme }) => {
				return openBlock(), createElementBlock(Fragment, { key: scheme?.uid }, [
					security.value.length > 1 && scheme ? (openBlock(), createBlock(unref(DataTableRow_default), { key: 0 }, {
						default: withCtx(() => [createVNode(unref(DataTableCell_default), {
							"aria-label": generateLabel(scheme),
							class: "text-c-2 group/auth flex items-center leading-[22px] whitespace-nowrap outline-none hover:whitespace-normal"
						}, {
							default: withCtx(() => [createElementVNode("p", _hoisted_1$2, toDisplayString(generateLabel(scheme)), 1)]),
							_: 2
						}, 1032, ["aria-label"])]),
						_: 2
					}, 1024)) : createCommentVNode("", true),
					scheme?.description && security.value.length <= 1 ? (openBlock(), createBlock(unref(DataTableRow_default), { key: 1 }, {
						default: withCtx(() => [createVNode(unref(DataTableCell_default), {
							"aria-label": scheme.description,
							class: "max-h-[auto]"
						}, {
							default: withCtx(() => [createVNode(unref(ScalarMarkdownSummary), {
								class: "auth-description bg-b-1 text-c-2 min-w-0 flex-1 px-3 py-1.25",
								value: scheme.description
							}, null, 8, ["value"])]),
							_: 2
						}, 1032, ["aria-label"])]),
						_: 2
					}, 1024)) : createCommentVNode("", true),
					scheme?.type === "http" ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [scheme.scheme === "bearer" ? (openBlock(), createBlock(unref(DataTableRow_default), { key: 0 }, {
						default: withCtx(() => [createVNode(RequestAuthDataTableInput_default, mergeProps({ ref_for: true }, dataTableInputProps, {
							containerClass: __props.layout === "reference" && "border-t",
							modelValue: scheme.token,
							placeholder: "Token",
							type: "password",
							"onUpdate:modelValue": (v) => updateScheme$1(scheme.uid, "token", v)
						}), {
							default: withCtx(() => [..._cache[1] || (_cache[1] = [createTextVNode(" Bearer Token ", -1)])]),
							_: 1
						}, 16, [
							"containerClass",
							"modelValue",
							"onUpdate:modelValue"
						])]),
						_: 2
					}, 1024)) : scheme?.scheme === "basic" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [createVNode(unref(DataTableRow_default), null, {
						default: withCtx(() => [createVNode(RequestAuthDataTableInput_default, mergeProps({ ref_for: true }, dataTableInputProps, {
							class: "text-c-2",
							modelValue: scheme.username,
							placeholder: "janedoe",
							required: "",
							"onUpdate:modelValue": (v) => updateScheme$1(scheme.uid, "username", v)
						}), {
							default: withCtx(() => [..._cache[2] || (_cache[2] = [createTextVNode(" Username ", -1)])]),
							_: 1
						}, 16, ["modelValue", "onUpdate:modelValue"])]),
						_: 2
					}, 1024), createVNode(unref(DataTableRow_default), null, {
						default: withCtx(() => [createVNode(RequestAuthDataTableInput_default, mergeProps({ ref_for: true }, dataTableInputProps, {
							modelValue: scheme.password,
							placeholder: "********",
							type: "password",
							"onUpdate:modelValue": (v) => updateScheme$1(scheme.uid, "password", v)
						}), {
							default: withCtx(() => [..._cache[3] || (_cache[3] = [createTextVNode(" Password ", -1)])]),
							_: 1
						}, 16, ["modelValue", "onUpdate:modelValue"])]),
						_: 2
					}, 1024)], 64)) : createCommentVNode("", true)], 64)) : scheme?.type === "apiKey" ? (openBlock(), createElementBlock(Fragment, { key: 3 }, [createVNode(unref(DataTableRow_default), null, {
						default: withCtx(() => [createVNode(RequestAuthDataTableInput_default, mergeProps({ ref_for: true }, dataTableInputProps, {
							containerClass: __props.layout === "reference" && "border-t",
							modelValue: scheme.name,
							placeholder: "api-key",
							"onUpdate:modelValue": (v) => updateScheme$1(scheme.uid, "name", v)
						}), {
							default: withCtx(() => [..._cache[4] || (_cache[4] = [createTextVNode(" Name ", -1)])]),
							_: 1
						}, 16, [
							"containerClass",
							"modelValue",
							"onUpdate:modelValue"
						])]),
						_: 2
					}, 1024), createVNode(unref(DataTableRow_default), null, {
						default: withCtx(() => [createVNode(RequestAuthDataTableInput_default, mergeProps({ ref_for: true }, dataTableInputProps, {
							modelValue: scheme.value,
							placeholder: "QUxMIFlPVVIgQkFTRSBBUkUgQkVMT05HIFRPIFVT",
							type: "password",
							"onUpdate:modelValue": (v) => updateScheme$1(scheme.uid, "value", v)
						}), {
							default: withCtx(() => [..._cache[5] || (_cache[5] = [createTextVNode(" Value ", -1)])]),
							_: 1
						}, 16, ["modelValue", "onUpdate:modelValue"])]),
						_: 2
					}, 1024)], 64)) : scheme?.type === "oauth2" ? (openBlock(), createElementBlock(Fragment, { key: 4 }, [createVNode(unref(DataTableRow_default), null, {
						default: withCtx(() => [Object.keys(scheme.flows).length > 1 ? (openBlock(), createElementBlock("div", _hoisted_2$2, [createElementVNode("div", _hoisted_3$2, [(openBlock(true), createElementBlock(Fragment, null, renderList(scheme?.flows, (_, key, ind) => {
							return openBlock(), createElementBlock("button", {
								key,
								class: normalizeClass(["floating-bg text-c-3 relative cursor-pointer border-b-[1px] border-transparent py-1 text-base font-medium", {
									"!text-c-1 !rounded-none border-b-[1px] !border-current": __props.layout !== "reference" && (activeFlow.value === key || ind === 0 && !activeFlow.value),
									"!text-c-1 !rounded-none border-b-[1px] !border-current opacity-100": __props.layout === "reference" && (activeFlow.value === key || ind === 0 && !activeFlow.value)
								}]),
								type: "button",
								onClick: ($event) => activeFlow.value = key
							}, [createElementVNode("span", _hoisted_5, toDisplayString(key), 1)], 10, _hoisted_4);
						}), 128))])])) : createCommentVNode("", true)]),
						_: 2
					}, 1024), (openBlock(true), createElementBlock(Fragment, null, renderList(scheme?.flows, (flow, key, ind) => {
						return openBlock(), createElementBlock(Fragment, { key }, [activeFlow.value === key || ind === 0 && !activeFlow.value ? (openBlock(), createBlock(OAuth2_default, mergeProps({
							key: 0,
							ref_for: true
						}, dataTableInputProps, {
							collection: __props.collection,
							flow,
							persistAuth: __props.persistAuth,
							scheme,
							server: __props.server,
							workspace: __props.workspace,
							onAuthorized: _cache[0] || (_cache[0] = ($event) => emits("authorized"))
						}), {
							"oauth-actions": withCtx(() => [renderSlot(_ctx.$slots, "oauth-actions")]),
							_: 3
						}, 16, [
							"collection",
							"flow",
							"persistAuth",
							"scheme",
							"server",
							"workspace"
						])) : createCommentVNode("", true)], 64);
					}), 128))], 64)) : scheme?.type === "openIdConnect" ? (openBlock(), createElementBlock("div", {
						key: 5,
						class: normalizeClass(["text-c-3 bg-b-1 flex min-h-[calc(4rem+1px)] items-center justify-center border-t border-b-0 px-4 text-base", { "rounded-b-lg": __props.layout === "reference" }])
					}, " Coming soon ", 2)) : createCommentVNode("", true)
				], 64);
			}), 128);
		};
	}
});
//#endregion
//#region src/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue?vue&type=script&setup=true&lang.ts
var _hoisted_1$1 = ["onClick"];
var _hoisted_2$1 = { class: "relative z-10 font-medium whitespace-nowrap" };
var _hoisted_3$1 = {
	key: 0,
	class: "absolute inset-x-1 bottom-[var(--scalar-border-width)] left-1/2 z-1 h-px w-full -translate-x-1/2 bg-current"
};
//#endregion
//#region src/views/Request/RequestSection/RequestAuth/RequestAuthDataTable.vue
var RequestAuthDataTable_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
	__name: "RequestAuthDataTable",
	props: {
		collection: {},
		environment: {},
		envVariables: {},
		layout: { default: "client" },
		persistAuth: {
			type: Boolean,
			default: false
		},
		selectedSchemeOptions: { default: () => [] },
		server: {},
		workspace: {}
	},
	emits: ["authorized", "activeSchemes"],
	setup(__props, { emit: __emit }) {
		const emits = __emit;
		const { securitySchemes } = useWorkspace();
		const deleteSchemeModal = useModal();
		const selectedScheme = ref(null);
		/** Add new ref for active tab */
		const activeAuthIndex = ref(0);
		/** Return currently selected schemes including complex auth */
		const activeScheme = computed(() => {
			if (!__props.selectedSchemeOptions || __props.selectedSchemeOptions.length === 0) return [];
			const option = __props.selectedSchemeOptions[activeAuthIndex.value];
			if (!option) return [];
			const keys = option.id.split(",").filter(Boolean);
			return keys.length > 1 ? keys : [option.id];
		});
		/** Emit active schemes */
		watch(activeScheme, (newActiveSchemes) => {
			emits("activeSchemes", newActiveSchemes.map((scheme) => securitySchemes[scheme]).filter(isDefined$1));
		}, { immediate: true });
		/** Return true if there are any active schemes */
		const hasActiveSchemes = computed(() => activeScheme.value.length > 0);
		watch(() => __props.selectedSchemeOptions, (newOptions) => {
			if (!newOptions || !newOptions[activeAuthIndex.value]) activeAuthIndex.value = Math.max(0, activeAuthIndex.value - 1);
		});
		return (_ctx, _cache) => {
			return openBlock(), createElementBlock("form", { onSubmit: _cache[2] || (_cache[2] = withModifiers(() => {}, ["prevent"])) }, [
				__props.selectedSchemeOptions.length > 1 ? (openBlock(), createElementBlock("div", {
					key: 0,
					class: normalizeClass(["box-content flex flex-wrap gap-x-2.5 overflow-hidden border border-b-0 px-3", __props.layout === "client" && "border-x-0"])
				}, [(openBlock(true), createElementBlock(Fragment, null, renderList(__props.selectedSchemeOptions, (option, index) => {
					return openBlock(), createElementBlock("div", {
						key: option.id,
						class: normalizeClass(["relative z-1 -mb-[var(--scalar-border-width)] flex h-8 cursor-pointer", [activeAuthIndex.value === index ? "text-c-1" : "text-c-3"]])
					}, [createElementVNode("button", {
						class: "floating-bg relative cursor-pointer border-b-[1px] border-transparent py-1 text-sm font-medium",
						type: "button",
						onClick: ($event) => activeAuthIndex.value = index
					}, [createElementVNode("span", _hoisted_2$1, toDisplayString(option.label), 1)], 8, _hoisted_1$1), activeAuthIndex.value === index ? (openBlock(), createElementBlock("div", _hoisted_3$1)) : createCommentVNode("", true)], 2);
				}), 128))], 2)) : createCommentVNode("", true),
				hasActiveSchemes.value ? (openBlock(), createBlock(unref(DataTable_default), {
					key: 1,
					class: normalizeClass(["flex-1", __props.layout === "reference" && "bg-b-1 rounded-b-lg border border-t-0"]),
					columns: [""],
					presentational: ""
				}, {
					default: withCtx(() => [createVNode(RequestAuthTab_default, {
						collection: __props.collection,
						envVariables: __props.envVariables,
						environment: __props.environment,
						layout: __props.layout,
						persistAuth: __props.persistAuth,
						securitySchemeUids: activeScheme.value,
						server: __props.server,
						workspace: __props.workspace,
						onAuthorized: _cache[0] || (_cache[0] = ($event) => emits("authorized"))
					}, {
						"oauth-actions": withCtx(() => [renderSlot(_ctx.$slots, "oauth-actions", {}, void 0, true)]),
						_: 3
					}, 8, [
						"collection",
						"envVariables",
						"environment",
						"layout",
						"persistAuth",
						"securitySchemeUids",
						"server",
						"workspace"
					])]),
					_: 3
				}, 8, ["class"])) : (openBlock(), createElementBlock("div", {
					key: 2,
					class: normalizeClass(["text-c-3 bg-b-1 flex min-h-16 items-center justify-center border-t px-4 text-sm", __props.layout === "reference" && "min-h-[calc(4rem+0.5px)] rounded-b-lg border"])
				}, " No authentication selected ", 2)),
				createVNode(DeleteRequestAuthModal_default, {
					scheme: selectedScheme.value,
					state: unref(deleteSchemeModal),
					onClose: _cache[1] || (_cache[1] = ($event) => unref(deleteSchemeModal).hide())
				}, null, 8, ["scheme", "state"])
			], 32);
		};
	}
}), [["__scopeId", "data-v-0bb98074"]]);
//#endregion
//#region src/views/Request/RequestSection/RequestAuth/RequestAuth.vue?vue&type=script&setup=true&lang.ts
var _hoisted_1 = ["id"];
var _hoisted_2 = { class: "flex flex-1" };
var _hoisted_3 = { class: "min-w-0 flex-1 truncate" };
//#endregion
//#region src/views/Request/RequestSection/RequestAuth/RequestAuth.vue
var RequestAuth_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/* @__PURE__ */ defineComponent({
	__name: "RequestAuth",
	props: {
		collection: {},
		isReadOnly: {
			type: Boolean,
			default: false
		},
		environment: {},
		envVariables: {},
		layout: {},
		operation: {},
		persistAuth: {
			type: Boolean,
			default: false
		},
		selectedSecuritySchemeUids: {},
		server: {},
		title: {},
		workspace: {}
	},
	emits: ["authorized", "activeSchemes"],
	setup(__props, { emit: __emit }) {
		const emits = __emit;
		const { securitySchemes, securitySchemeMutators, requestMutators, collectionMutators } = useWorkspace();
		const titleId = useId();
		const comboboxButtonRef = ref(null);
		const deleteSchemeModal = useModal();
		const selectedScheme = ref(null);
		const isViewLayoutOpen = ref(false);
		/** Security requirements for the request */
		const securityRequirements = computed(() => {
			const requirements = getSecurityRequirements(__props.operation, __props.collection);
			return {
				filteredRequirements: requirements.filter((r) => Object.keys(r).length),
				requirements
			};
		});
		/** Indicates if auth is required */
		const authIndicator = computed(() => {
			const { filteredRequirements, requirements } = securityRequirements.value;
			if (!requirements.length) return null;
			const isOptional = !requirements.some((req) => Object.keys(req).length > 1) && filteredRequirements.length < requirements.length;
			return {
				icon: isOptional ? "Unlock" : "Lock",
				text: isOptional ? "Optional" : "Required"
			};
		});
		/**
		* Currently selected auth schemes on the collection, we store complex auth joined by a comma to represent the array
		* in the string
		*/
		const selectedSchemeOptions = computed(() => __props.selectedSecuritySchemeUids.map((s) => {
			if (Array.isArray(s)) return formatComplexScheme(s, securitySchemes);
			const scheme = securitySchemes[s ?? ""];
			if (!scheme) return;
			return formatScheme(scheme);
		}).filter(isDefined));
		/** Update the selected auth types */
		function updateSelectedAuth(entries) {
			const addNewOption = entries.find((e) => e.payload);
			const _entries = entries.filter((e) => !e.payload).map(({ id }) => {
				const arr = id.split(",");
				return arr.length > 1 ? arr : id;
			});
			if (addNewOption?.payload) {
				const scheme = securitySchemeMutators.add(addNewOption.payload, __props.collection?.uid);
				if (scheme) _entries.push(scheme.uid);
			}
			editSelectedSchemeUids(_entries);
		}
		const editSelectedSchemeUids = (uids) => {
			if (__props.collection.useCollectionSecurity) {
				collectionMutators.edit(__props.collection.uid, "selectedSecuritySchemeUids", uids);
				if (!__props.persistAuth) return;
				const nameKeys = uids.map((uids) => {
					if (Array.isArray(uids)) return uids.map((uid) => securitySchemes[uid]?.nameKey);
					return securitySchemes[uids]?.nameKey;
				});
				safeLocalStorage().setItem(CLIENT_LS_KEYS.SELECTED_SECURITY_SCHEMES, JSON.stringify(nameKeys));
			} else if (__props.operation?.uid) requestMutators.edit(__props.operation.uid, "selectedSecuritySchemeUids", uids);
		};
		function handleDeleteScheme({ id, label }) {
			selectedScheme.value = {
				id,
				label
			};
			deleteSchemeModal.show();
		}
		const unselectAuth = (unSelectUid) => {
			if (!unSelectUid) return;
			editSelectedSchemeUids(__props.selectedSecuritySchemeUids.filter((uid) => {
				const arr = unSelectUid.split(",");
				if (arr.length > 1 && Array.isArray(uid) && arr.length === uid.length) return uid.every((u) => !arr.includes(u));
				return uid !== unSelectUid;
			}));
			comboboxButtonRef.value?.$el.focus();
			deleteSchemeModal.hide();
		};
		/** Options for the security scheme dropdown */
		const schemeOptions = computed(() => getSchemeOptions(securityRequirements.value.filteredRequirements, __props.collection?.securitySchemes ?? [], securitySchemes, __props.isReadOnly));
		const openAuthCombobox = (event) => {
			if (isViewLayoutOpen.value) event.stopPropagation();
			comboboxButtonRef.value?.$el.click();
		};
		return (_ctx, _cache) => {
			return openBlock(), createBlock(ViewLayoutCollapse_default, {
				class: "group/params relative",
				itemCount: selectedSchemeOptions.value.length,
				layout: __props.layout,
				"onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => isViewLayoutOpen.value = $event)
			}, {
				title: withCtx(() => [createElementVNode("div", {
					id: unref(titleId),
					class: "inline-flex items-center gap-0.5 leading-[20px]"
				}, [createElementVNode("span", null, toDisplayString(__props.title), 1), authIndicator.value ? (openBlock(), createElementBlock("span", {
					key: 0,
					class: normalizeClass(["text-c-3 hover:bg-b-3 hover:text-c-1 -mr-1 cursor-pointer rounded px-1 py-0.5 text-xs leading-[normal]", { "text-c-1": authIndicator.value.text === "Required" }]),
					onClick: openAuthCombobox
				}, toDisplayString(authIndicator.value.text), 3)) : createCommentVNode("", true)], 8, _hoisted_1)]),
				actions: withCtx(() => [createElementVNode("div", _hoisted_2, [createVNode(unref(ScalarComboboxMultiselect), {
					class: "w-72 text-xs",
					modelValue: selectedSchemeOptions.value,
					multiple: "",
					options: schemeOptions.value,
					placement: "bottom-end",
					teleport: "",
					onDelete: handleDeleteScheme,
					"onUpdate:modelValue": updateSelectedAuth
				}, {
					option: withCtx(({ option, selected }) => [
						createVNode(unref(ScalarListboxCheckbox), {
							multiselect: "",
							selected
						}, null, 8, ["selected"]),
						createElementVNode("div", _hoisted_3, toDisplayString(option.label), 1),
						option.isDeletable ?? !__props.isReadOnly ? (openBlock(), createBlock(unref(ScalarIconButton), {
							key: 0,
							class: "-m-0.5 shrink-0 p-0.5 opacity-0 group-hover/item:opacity-100",
							icon: unref(ScalarIconTrash),
							label: `Delete ${option.label}`,
							size: "xs",
							onClick: withModifiers(($event) => handleDeleteScheme(option), ["stop"])
						}, null, 8, [
							"icon",
							"label",
							"onClick"
						])) : createCommentVNode("", true)
					]),
					default: withCtx(() => [createVNode(unref(ScalarButton), {
						ref_key: "comboboxButtonRef",
						ref: comboboxButtonRef,
						"aria-describedby": unref(titleId),
						class: "group/combobox-button hover:text-c-1 text-c-2 flex h-fit w-full items-center gap-1 px-0.75 py-0.25 text-base font-normal transition-transform",
						variant: "ghost"
					}, {
						default: withCtx(() => [selectedSchemeOptions.value.length === 1 ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [_cache[5] || (_cache[5] = createElementVNode("span", { class: "sr-only" }, "Selected Auth Type:", -1)), createTextVNode(" " + toDisplayString(selectedSchemeOptions.value[0]?.label), 1)], 64)) : selectedSchemeOptions.value.length > 1 ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [_cache[6] || (_cache[6] = createTextVNode(" Multiple ", -1)), _cache[7] || (_cache[7] = createElementVNode("span", { class: "sr-only" }, "Auth Types Selected", -1))], 64)) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [_cache[8] || (_cache[8] = createElementVNode("span", { class: "sr-only" }, "Select", -1)), _cache[9] || (_cache[9] = createTextVNode(" Auth Type ", -1))], 64)), createVNode(unref(ScalarIconCaretDown), {
							class: "size-3 shrink-0 transition-transform duration-100 group-aria-expanded/combobox-button:rotate-180",
							weight: "bold"
						})]),
						_: 1
					}, 8, ["aria-describedby"])]),
					_: 1
				}, 8, ["modelValue", "options"])])]),
				default: withCtx(() => [createVNode(RequestAuthDataTable_default, {
					collection: __props.collection,
					envVariables: __props.envVariables,
					environment: __props.environment,
					layout: __props.layout,
					persistAuth: __props.persistAuth,
					selectedSchemeOptions: selectedSchemeOptions.value,
					server: __props.server,
					workspace: __props.workspace,
					onActiveSchemes: _cache[0] || (_cache[0] = ($event) => emits("activeSchemes", $event)),
					onAuthorized: _cache[1] || (_cache[1] = ($event) => emits("authorized"))
				}, {
					"oauth-actions": withCtx(() => [renderSlot(_ctx.$slots, "oauth-actions", {}, void 0, true)]),
					_: 3
				}, 8, [
					"collection",
					"envVariables",
					"environment",
					"layout",
					"persistAuth",
					"selectedSchemeOptions",
					"server",
					"workspace"
				]), createVNode(DeleteRequestAuthModal_default, {
					scheme: selectedScheme.value,
					state: unref(deleteSchemeModal),
					onClose: _cache[2] || (_cache[2] = ($event) => unref(deleteSchemeModal).hide()),
					onDelete: _cache[3] || (_cache[3] = ($event) => unselectAuth(selectedScheme.value?.id))
				}, null, 8, ["scheme", "state"])]),
				_: 3
			}, 8, ["itemCount", "layout"]);
		};
	}
}), [["__scopeId", "data-v-3f1067a4"]]);
//#endregion
export { RequestAuthDataTable_default as n, restoreAuthFromLocalStorage as r, RequestAuth_default as t };

//# sourceMappingURL=RequestAuth-BzBfIysT.js.map