import ContextMenu_default from "../../v2/components/context-menu/ContextMenu.vue.js";
import { createBlock, createElementVNode, createTextVNode, createVNode, defineComponent, normalizeClass, openBlock, toDisplayString, unref, withCtx } from "vue";
import { ScalarDropdownButton, ScalarDropdownDivider, ScalarDropdownMenu, ScalarFloating, ScalarHotkey, ScalarIcon, ScalarTooltip } from "@scalar/components";
import { LibraryIcon } from "@scalar/icons/library";
import { isMacOS } from "@scalar/helpers/general/is-mac-os";
//#region src/components/TopNav/TopNavItem.vue?vue&type=script&setup=true&lang.ts
var _hoisted_1 = { class: "nav-item-icon-copy flex flex-1 items-center justify-center gap-1.5" };
var _hoisted_2 = { class: "custom-scroll nav-item-copy text-sm" };
var TopNavItem_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
	__name: "TopNavItem",
	props: {
		hotkey: {},
		active: { type: Boolean },
		label: {},
		icon: {},
		isCollection: { type: Boolean }
	},
	emits: [
		"click",
		"close",
		"newTab",
		"copyUrl",
		"closeOtherTabs"
	],
	setup(__props) {
		return (_ctx, _cache) => {
			return openBlock(), createBlock(unref(ContextMenu_default), { triggerClass: "overflow-hidden w-full" }, {
				trigger: withCtx(() => [createVNode(unref(ScalarTooltip), {
					content: `${unref(isMacOS)() ? "⌘" : "^"} ${__props.hotkey}`,
					placement: "bottom"
				}, {
					default: withCtx(() => [createElementVNode("div", {
						class: normalizeClass(["nav-item app-no-drag-region", { "nav-item__active": __props.active }]),
						onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("click"))
					}, [createElementVNode("div", _hoisted_1, [__props.isCollection ? (openBlock(), createBlock(unref(LibraryIcon), {
						key: 0,
						class: "size-3.5 min-w-3.5 stroke-2",
						src: __props.icon
					}, null, 8, ["src"])) : (openBlock(), createBlock(unref(ScalarIcon), {
						key: 1,
						icon: __props.icon,
						size: "xs",
						thickness: "2.5"
					}, null, 8, ["icon"])), createElementVNode("span", _hoisted_2, toDisplayString(__props.label), 1)]), createElementVNode("button", {
						class: "nav-item-close",
						type: "button",
						onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("close"))
					}, [createVNode(unref(ScalarIcon), {
						icon: "Close",
						thickness: "1.75"
					})])], 2)]),
					_: 1
				}, 8, ["content"])]),
				content: withCtx(() => [createVNode(unref(ScalarFloating), { placement: "right-start" }, {
					floating: withCtx(() => [createVNode(unref(ScalarDropdownMenu), { class: "scalar-app scalar-client" }, {
						default: withCtx(() => [
							createVNode(unref(ScalarDropdownButton), {
								class: "flex items-center gap-1.5",
								onClick: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("newTab"))
							}, {
								default: withCtx(() => [
									createVNode(unref(ScalarIcon), {
										icon: "AddTab",
										size: "sm",
										thickness: "1.5"
									}),
									_cache[6] || (_cache[6] = createTextVNode(" New Tab ", -1)),
									createVNode(unref(ScalarHotkey), {
										class: "bg-b-2 ml-auto",
										hotkey: "T"
									})
								]),
								_: 1
							}),
							createVNode(unref(ScalarDropdownButton), {
								class: "flex items-center gap-1.5",
								onClick: _cache[3] || (_cache[3] = ($event) => _ctx.$emit("copyUrl"))
							}, {
								default: withCtx(() => [createVNode(unref(ScalarIcon), {
									icon: "Link",
									size: "sm",
									thickness: "1.5"
								}), _cache[7] || (_cache[7] = createTextVNode(" Copy URL ", -1))]),
								_: 1
							}),
							createVNode(unref(ScalarDropdownDivider)),
							createVNode(unref(ScalarDropdownButton), {
								class: "flex items-center gap-1.5",
								onClick: _cache[4] || (_cache[4] = ($event) => _ctx.$emit("close"))
							}, {
								default: withCtx(() => [
									createVNode(unref(ScalarIcon), {
										icon: "CloseTab",
										size: "sm",
										thickness: "1.5"
									}),
									_cache[8] || (_cache[8] = createTextVNode(" Close Tab ", -1)),
									createVNode(unref(ScalarHotkey), {
										class: "bg-b-2 ml-auto",
										hotkey: "W"
									})
								]),
								_: 1
							}),
							createVNode(unref(ScalarDropdownButton), {
								class: "flex items-center gap-1.5",
								onClick: _cache[5] || (_cache[5] = ($event) => _ctx.$emit("closeOtherTabs"))
							}, {
								default: withCtx(() => [createVNode(unref(ScalarIcon), {
									icon: "CloseTabs",
									size: "sm",
									thickness: "1.5"
								}), _cache[9] || (_cache[9] = createTextVNode(" Close Other Tabs ", -1))]),
								_: 1
							})
						]),
						_: 1
					})]),
					_: 1
				})]),
				_: 1
			});
		};
	}
});
//#endregion
export { TopNavItem_vue_vue_type_script_setup_true_lang_default as default };

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