import { parameterIsInvalid } from "../libs/request.js";
import { computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, defineComponent, openBlock, toDisplayString, unref, withCtx } from "vue";
import { ScalarPopover } from "@scalar/components";
import { ScalarIconInfo, ScalarIconWarning } from "@scalar/icons";
//#region src/views/Request/RequestSection/RequestTableTooltip.vue?vue&type=script&setup=true&lang.ts
var _hoisted_1 = ["aria-label", "role"];
var _hoisted_2 = { class: "w-content text-xxs text-c-1 grid min-w-48 gap-1.5 rounded px-1.5 pt-2 pb-1.5 leading-none" };
var _hoisted_3 = {
	key: 0,
	class: "text-error-1"
};
var _hoisted_4 = {
	key: 1,
	class: "schema text-c-2 flex items-center"
};
var _hoisted_5 = { key: 0 };
var _hoisted_6 = { key: 1 };
var _hoisted_7 = { key: 2 };
var _hoisted_8 = { key: 3 };
var _hoisted_9 = { key: 4 };
var _hoisted_10 = {
	key: 2,
	class: "text-sm leading-snug text-pretty",
	style: { maxWidth: "16rem" }
};
var RequestTableTooltip_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
	__name: "RequestTableTooltip",
	props: { item: {} },
	setup(__props) {
		const isInvalid = computed(() => !!parameterIsInvalid(__props.item).value);
		return (_ctx, _cache) => {
			return openBlock(), createBlock(unref(ScalarPopover), {
				teleport: "",
				offset: 4,
				placement: "left"
			}, {
				popover: withCtx(() => [createElementVNode("div", _hoisted_2, [isInvalid.value ? (openBlock(), createElementBlock("div", _hoisted_3, toDisplayString(unref(parameterIsInvalid)(__props.item).value), 1)) : __props.item.type || __props.item.format || __props.item.minimum || __props.item.maximum || __props.item.default ? (openBlock(), createElementBlock("div", _hoisted_4, [
					__props.item.type ? (openBlock(), createElementBlock("span", _hoisted_5, toDisplayString(__props.item.type), 1)) : createCommentVNode("", true),
					__props.item.format ? (openBlock(), createElementBlock("span", _hoisted_6, toDisplayString(__props.item.format), 1)) : createCommentVNode("", true),
					__props.item.minimum ? (openBlock(), createElementBlock("span", _hoisted_7, "min: " + toDisplayString(__props.item.minimum), 1)) : createCommentVNode("", true),
					__props.item.maximum ? (openBlock(), createElementBlock("span", _hoisted_8, "max: " + toDisplayString(__props.item.maximum), 1)) : createCommentVNode("", true),
					__props.item.default ? (openBlock(), createElementBlock("span", _hoisted_9, "default: " + toDisplayString(__props.item.default), 1)) : createCommentVNode("", true)
				])) : createCommentVNode("", true), __props.item.description && !isInvalid.value ? (openBlock(), createElementBlock("span", _hoisted_10, toDisplayString(__props.item.description), 1)) : createCommentVNode("", true)])]),
				default: withCtx(() => [createElementVNode("button", {
					type: "button",
					"aria-label": isInvalid.value ? "Input is invalid" : "More Information",
					class: "text-c-2 hover:text-c-1 hover:bg-b-2 rounded p-1",
					role: isInvalid.value ? "alert" : "none"
				}, [isInvalid.value ? (openBlock(), createBlock(unref(ScalarIconWarning), {
					key: 0,
					class: "text-orange size-3.5 brightness-90 hover:brightness-75"
				})) : (openBlock(), createBlock(unref(ScalarIconInfo), {
					key: 1,
					class: "text-c-2 hover:text-c-1 size-3.5"
				}))], 8, _hoisted_1)]),
				_: 1
			});
		};
	}
});
//#endregion
export { RequestTableTooltip_vue_vue_type_script_setup_true_lang_default as default };

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