import { cx as e } from "../../../theme/tools.js";
import { Input as t } from "../../atoms/input/Input.js";
import { popoverContent as n, popoverItem as r, popoverItemActive as i, popoverItemDescription as a, popoverItemName as o, popoverList as s, popoverSearch as c } from "./breadcrumbNavigation.css.js";
import { useDropdown as l } from "../dropdown/Dropdown.js";
import { useMemo as u, useState as d } from "react";
import { jsx as f, jsxs as p } from "react/jsx-runtime";
import m from "@plumile/router/routing/Link.js";
//#region src/atomic/molecules/breadcrumb_navigation/BreadcrumbMenuPopover.tsx
var h = ({ items: h, selectedId: g, searchPlaceholder: _, searchAriaLabel: v, emptyLabel: y, emptyMatchesLabel: b }) => {
	let { close: x } = l(), [S, C] = d(""), w = S.trim().toLowerCase(), T = u(() => w === "" ? h : h.filter((e) => e.name.toLowerCase().includes(w)), [h, w]), E;
	return E = w === "" ? y : b, /* @__PURE__ */ p("div", {
		className: n,
		children: [/* @__PURE__ */ f("div", {
			className: c,
			children: /* @__PURE__ */ f(t, {
				type: "search",
				size: "small",
				fullWidth: !0,
				placeholder: _,
				value: S,
				onChange: (e) => {
					C(e.target.value);
				},
				"aria-label": v
			})
		}), /* @__PURE__ */ p("ul", {
			className: s,
			children: [T.length === 0 && /* @__PURE__ */ f("li", {
				className: "_1u1q111s txvbqbww8 txvbqb9j txvbqb1bg3",
				children: E
			}), T.map((t) => {
				let n = e(r, { [i]: t.id === g }), s = null;
				return t.description != null && t.description !== "" && (s = /* @__PURE__ */ f("span", {
					className: a,
					children: t.description
				})), /* @__PURE__ */ f("li", { children: /* @__PURE__ */ p(m, {
					to: t.to,
					className: n,
					onClick: () => {
						x();
					},
					children: [/* @__PURE__ */ f("span", {
						className: o,
						children: t.name
					}), s]
				}) }, t.id);
			})]
		})]
	});
};
//#endregion
export { h as BreadcrumbMenuPopover };

//# sourceMappingURL=BreadcrumbMenuPopover.js.map