"use client";
import { jsx, jsxs } from "react/jsx-runtime";
import {
  Activity,
  AlarmClock,
  AlertCircle,
  Archive,
  AtSign,
  Award,
  BadgeCheck,
  BarChart3,
  Bell,
  BookOpen,
  Bookmark,
  Brain,
  Briefcase,
  Building,
  Calculator,
  Calendar,
  CalendarCheck,
  CalendarClock,
  CalendarDays,
  Camera,
  ChartLine,
  ChartPie,
  Check,
  CheckCircle,
  CheckSquare,
  Circle,
  Clipboard,
  ClipboardList,
  Clock,
  Clock3,
  Cloud,
  Code2,
  Coins,
  Compass,
  Cpu,
  Database,
  DollarSign,
  Download,
  Edit,
  FileText,
  Filter,
  Flag,
  Flame,
  Folder,
  GitBranch,
  GitCommit,
  GitMerge,
  Glasses,
  Globe,
  Hammer,
  Handshake,
  Headphones,
  Heart,
  HelpCircle,
  Image,
  Inbox,
  Layers,
  LifeBuoy,
  Lightbulb,
  Link,
  Lock,
  Mail,
  MapPin,
  Megaphone,
  MessageSquare,
  Notebook,
  Package,
  Palette,
  Phone,
  PhoneCall,
  PieChart,
  Rocket,
  Search,
  Send,
  Server,
  Settings,
  Shield,
  ShoppingBag,
  ShoppingCart,
  Sliders,
  Sparkles,
  Star,
  Tag,
  Target,
  ThumbsUp,
  TrendingUp,
  Trophy,
  Truck,
  UserCheck,
  Users,
  Wallet,
  Wand,
  Wrench,
  Zap
} from "lucide-react";
const LUCIDE_ICON_MAP = {
  activity: Activity,
  "alarm-clock": AlarmClock,
  "alert-circle": AlertCircle,
  archive: Archive,
  "at-sign": AtSign,
  award: Award,
  "badge-check": BadgeCheck,
  "bar-chart-3": BarChart3,
  bell: Bell,
  "book-open": BookOpen,
  bookmark: Bookmark,
  brain: Brain,
  briefcase: Briefcase,
  building: Building,
  calculator: Calculator,
  calendar: Calendar,
  "calendar-check": CalendarCheck,
  "calendar-clock": CalendarClock,
  "calendar-days": CalendarDays,
  camera: Camera,
  "chart-line": ChartLine,
  "chart-pie": ChartPie,
  check: Check,
  "check-circle": CheckCircle,
  "check-square": CheckSquare,
  circle: Circle,
  clipboard: Clipboard,
  "clipboard-list": ClipboardList,
  clock: Clock,
  "clock-3": Clock3,
  cloud: Cloud,
  "code-2": Code2,
  coins: Coins,
  compass: Compass,
  cpu: Cpu,
  database: Database,
  "dollar-sign": DollarSign,
  download: Download,
  edit: Edit,
  "file-text": FileText,
  filter: Filter,
  flag: Flag,
  flame: Flame,
  folder: Folder,
  "git-branch": GitBranch,
  "git-commit": GitCommit,
  "git-merge": GitMerge,
  glasses: Glasses,
  globe: Globe,
  hammer: Hammer,
  handshake: Handshake,
  headphones: Headphones,
  heart: Heart,
  "help-circle": HelpCircle,
  image: Image,
  inbox: Inbox,
  layers: Layers,
  "life-buoy": LifeBuoy,
  lightbulb: Lightbulb,
  link: Link,
  lock: Lock,
  mail: Mail,
  "map-pin": MapPin,
  megaphone: Megaphone,
  "message-square": MessageSquare,
  notebook: Notebook,
  package: Package,
  palette: Palette,
  phone: Phone,
  "phone-call": PhoneCall,
  "pie-chart": PieChart,
  rocket: Rocket,
  search: Search,
  send: Send,
  server: Server,
  settings: Settings,
  shield: Shield,
  "shopping-bag": ShoppingBag,
  "shopping-cart": ShoppingCart,
  sliders: Sliders,
  sparkles: Sparkles,
  star: Star,
  tag: Tag,
  target: Target,
  "thumbs-up": ThumbsUp,
  "trending-up": TrendingUp,
  trophy: Trophy,
  truck: Truck,
  "user-check": UserCheck,
  users: Users,
  wallet: Wallet,
  wand: Wand,
  wrench: Wrench,
  zap: Zap
};
const ICON_SUGGESTIONS = [
  { value: "lucide:star", label: "Star", keywords: ["favorite", "rating"] },
  { value: "lucide:flag", label: "Flag", keywords: ["marker", "priority"] },
  { value: "lucide:circle", label: "Circle", keywords: ["shape"] },
  { value: "lucide:sparkles", label: "Sparkles", keywords: ["new", "shine"] },
  { value: "lucide:zap", label: "Lightning", keywords: ["zap", "bolt"] },
  { value: "lucide:flame", label: "Flame", keywords: ["hot"] },
  { value: "lucide:heart", label: "Heart", keywords: ["love", "favorite"] },
  { value: "lucide:target", label: "Target", keywords: ["bullseye", "aim"] },
  { value: "lucide:award", label: "Award", keywords: ["badge", "recognition"] },
  { value: "lucide:trophy", label: "Trophy", keywords: ["winner"] },
  { value: "lucide:briefcase", label: "Briefcase", keywords: ["business"] },
  { value: "lucide:rocket", label: "Rocket", keywords: ["launch", "growth"] },
  { value: "lucide:shopping-bag", label: "Shopping bag", keywords: ["retail", "store"] },
  { value: "lucide:thumbs-up", label: "Thumbs up", keywords: ["approve", "like"] },
  { value: "lucide:users", label: "Users", keywords: ["people", "team"] },
  { value: "lucide:lightbulb", label: "Lightbulb", keywords: ["idea", "insight"] },
  { value: "lucide:handshake", label: "Handshake", keywords: ["agreement", "deal"] },
  { value: "lucide:compass", label: "Compass", keywords: ["direction", "navigation"] },
  { value: "lucide:check-circle", label: "Check circle", keywords: ["confirmed"] },
  { value: "lucide:shield", label: "Shield", keywords: ["security", "protect"] },
  { value: "lucide:globe", label: "Globe", keywords: ["world", "global"] },
  { value: "lucide:calendar", label: "Calendar", keywords: ["date", "schedule"] },
  { value: "lucide:calendar-check", label: "Calendar check", keywords: ["confirmed", "schedule"] },
  { value: "lucide:calendar-clock", label: "Calendar clock", keywords: ["time"] },
  { value: "lucide:calendar-days", label: "Calendar days", keywords: ["monthly"] },
  { value: "lucide:clock", label: "Clock", keywords: ["time", "deadline"] },
  { value: "lucide:alarm-clock", label: "Alarm clock", keywords: ["reminder"] },
  { value: "lucide:bell", label: "Bell", keywords: ["notification"] },
  { value: "lucide:message-square", label: "Message", keywords: ["chat"] },
  { value: "lucide:clipboard-list", label: "Checklist", keywords: ["tasks"] },
  { value: "lucide:phone", label: "Phone", keywords: ["call"] },
  { value: "lucide:phone-call", label: "Phone call", keywords: ["outreach"] },
  { value: "lucide:send", label: "Send", keywords: ["message"] },
  { value: "lucide:mail", label: "Mail", keywords: ["email"] },
  { value: "\u2B50\uFE0F", label: "Star emoji", keywords: ["favorite", "rating"] },
  { value: "\u{1F525}", label: "Fire emoji", keywords: ["hot"] },
  { value: "\u{1F680}", label: "Rocket emoji", keywords: ["launch"] },
  { value: "\u{1F3AF}", label: "Bullseye emoji", keywords: ["target"] },
  { value: "\u{1F4BC}", label: "Briefcase emoji", keywords: ["business"] },
  { value: "\u2705", label: "Check emoji", keywords: ["ok"] },
  { value: "\u{1F4A1}", label: "Idea emoji", keywords: ["lightbulb"] },
  { value: "\u{1F91D}", label: "Handshake emoji", keywords: ["deal"] },
  { value: "\u{1F30D}", label: "Globe emoji", keywords: ["world"] },
  { value: "\u{1F5D3}\uFE0F", label: "Calendar emoji", keywords: ["schedule"] },
  { value: "\u260E\uFE0F", label: "Telephone emoji", keywords: ["call"] },
  { value: "\u{1F4AC}", label: "Speech bubble emoji", keywords: ["chat"] },
  { value: "\u{1F514}", label: "Bell emoji", keywords: ["notification"] },
  { value: "\u23F0", label: "Alarm clock emoji", keywords: ["reminder"] }
];
const EXTRA_LUCIDE_ICON_LIBRARY = [
  { slug: "activity", label: "Activity", keywords: ["metrics", "pulse"] },
  { slug: "alert-circle", label: "Alert", keywords: ["warning", "issue"] },
  { slug: "archive", label: "Archive", keywords: ["storage"] },
  { slug: "at-sign", label: "At sign", keywords: ["mention", "email"] },
  { slug: "badge-check", label: "Badge check", keywords: ["verified", "approval"] },
  { slug: "bar-chart-3", label: "Bar chart", keywords: ["analytics", "report"] },
  { slug: "book-open", label: "Book open", keywords: ["docs", "knowledge"] },
  { slug: "bookmark", label: "Bookmark", keywords: ["save"] },
  { slug: "brain", label: "Brain", keywords: ["intelligence", "thinking"] },
  { slug: "building", label: "Building", keywords: ["office", "hq"] },
  { slug: "calculator", label: "Calculator", keywords: ["finance", "math"] },
  { slug: "camera", label: "Camera", keywords: ["photo", "media"] },
  { slug: "chart-line", label: "Line chart", keywords: ["growth", "analytics"] },
  { slug: "chart-pie", label: "Pie chart", keywords: ["distribution", "analytics"] },
  { slug: "check", label: "Check", keywords: ["done"] },
  { slug: "check-square", label: "Check square", keywords: ["done"] },
  { slug: "circle", label: "Circle", keywords: ["shape"] },
  { slug: "clipboard", label: "Clipboard", keywords: ["tasks"] },
  { slug: "clock-3", label: "Clock three", keywords: ["time"] },
  { slug: "cloud", label: "Cloud", keywords: ["storage"] },
  { slug: "code-2", label: "Code", keywords: ["dev"] },
  { slug: "coins", label: "Coins", keywords: ["money"] },
  { slug: "compass", label: "Compass", keywords: ["direction"] },
  { slug: "cpu", label: "CPU", keywords: ["tech"] },
  { slug: "database", label: "Database", keywords: ["storage"] },
  { slug: "dollar-sign", label: "Dollar sign", keywords: ["money"] },
  { slug: "download", label: "Download", keywords: ["save"] },
  { slug: "edit", label: "Edit", keywords: ["pencil"] },
  { slug: "file-text", label: "File text", keywords: ["document"] },
  { slug: "filter", label: "Filter", keywords: ["refine"] },
  { slug: "folder", label: "Folder", keywords: ["files"] },
  { slug: "git-branch", label: "Git branch", keywords: ["git", "source control"] },
  { slug: "git-commit", label: "Git commit", keywords: ["git"] },
  { slug: "git-merge", label: "Git merge", keywords: ["git"] },
  { slug: "glasses", label: "Glasses", keywords: ["review"] },
  { slug: "life-buoy", label: "Life buoy", keywords: ["support"] },
  { slug: "link", label: "Link", keywords: ["url"] },
  { slug: "lock", label: "Lock", keywords: ["security"] },
  { slug: "map-pin", label: "Map pin", keywords: ["location"] },
  { slug: "megaphone", label: "Megaphone", keywords: ["announcement"] },
  { slug: "notebook", label: "Notebook", keywords: ["notes"] },
  { slug: "package", label: "Package", keywords: ["shipment"] },
  { slug: "palette", label: "Palette", keywords: ["design"] },
  { slug: "pie-chart", label: "Pie chart", keywords: ["analytics"] },
  { slug: "search", label: "Search", keywords: ["lookup"] },
  { slug: "server", label: "Server", keywords: ["infrastructure"] },
  { slug: "settings", label: "Settings", keywords: ["configuration"] },
  { slug: "shopping-cart", label: "Shopping cart", keywords: ["orders"] },
  { slug: "sliders", label: "Sliders", keywords: ["settings"] },
  { slug: "sparkles", label: "Sparkles", keywords: ["new"] },
  { slug: "star", label: "Star", keywords: ["favorite"] },
  { slug: "tag", label: "Tag", keywords: ["label"] },
  { slug: "trending-up", label: "Trending up", keywords: ["growth"] },
  { slug: "truck", label: "Truck", keywords: ["logistics"] },
  { slug: "user-check", label: "User check", keywords: ["verified"] },
  { slug: "wallet", label: "Wallet", keywords: ["finance"] },
  { slug: "wand", label: "Wand", keywords: ["magic"] },
  { slug: "wrench", label: "Wrench", keywords: ["tools"] },
  { slug: "zap", label: "Zap", keywords: ["lightning"] }
];
const EXTRA_EMOJI_ICON_LIBRARY = [
  { value: "\u{1F600}", label: "Grinning face", keywords: ["smile", "happy"] },
  { value: "\u{1F603}", label: "Smiling face", keywords: ["smile", "joy"] },
  { value: "\u{1F604}", label: "Grinning face with smiling eyes", keywords: ["smile", "joy"] },
  { value: "\u{1F601}", label: "Beaming face", keywords: ["smile", "excited"] },
  { value: "\u{1F606}", label: "Laughing face", keywords: ["laugh", "haha"] },
  { value: "\u{1F60E}", label: "Cool face", keywords: ["sunglasses", "cool"] },
  { value: "\u{1F914}", label: "Thinking face", keywords: ["ponder"] },
  { value: "\u{1F917}", label: "Hugging face", keywords: ["care"] },
  { value: "\u{1F928}", label: "Raised eyebrow", keywords: ["doubt"] },
  { value: "\u{1F634}", label: "Sleeping face", keywords: ["rest"] },
  { value: "\u{1F607}", label: "Smiling face with halo", keywords: ["angel"] },
  { value: "\u{1F642}", label: "Slight smile", keywords: ["smile"] },
  { value: "\u{1F643}", label: "Upside-down face", keywords: ["silly"] },
  { value: "\u{1F911}", label: "Money-mouth face", keywords: ["profit"] },
  { value: "\u{1F920}", label: "Cowboy face", keywords: ["fun"] },
  { value: "\u{1F973}", label: "Party face", keywords: ["celebration"] },
  { value: "\u{1F92F}", label: "Mind blown", keywords: ["surprised"] },
  { value: "\u{1F624}", label: "Triumphant face", keywords: ["determined"] },
  { value: "\u{1F62D}", label: "Crying face", keywords: ["sad"] },
  { value: "\u{1F64C}", label: "Raising hands", keywords: ["celebrate"] },
  { value: "\u{1F44F}", label: "Clapping hands", keywords: ["applause"] },
  { value: "\u{1F64F}", label: "Folded hands", keywords: ["please", "thanks"] },
  { value: "\u{1F44D}", label: "Thumbs up", keywords: ["approve"] },
  { value: "\u{1F44E}", label: "Thumbs down", keywords: ["disapprove"] },
  { value: "\u270C\uFE0F", label: "Victory hand", keywords: ["peace"] },
  { value: "\u{1F91D}", label: "Handshake emoji", keywords: ["deal"] },
  { value: "\u{1F4AA}", label: "Flexed biceps", keywords: ["strength"] },
  { value: "\u{1F4BC}", label: "Briefcase emoji", keywords: ["business"] },
  { value: "\u{1F4B0}", label: "Money bag", keywords: ["finance"] },
  { value: "\u{1F4B3}", label: "Credit card", keywords: ["payment"] },
  { value: "\u{1F4C8}", label: "Chart increasing", keywords: ["growth"] },
  { value: "\u{1F4C9}", label: "Chart decreasing", keywords: ["decline"] },
  { value: "\u{1F4CA}", label: "Bar chart", keywords: ["analytics"] },
  { value: "\u{1F4CB}", label: "Clipboard emoji", keywords: ["tasks"] },
  { value: "\u{1F4CC}", label: "Pushpin", keywords: ["pin"] },
  { value: "\u{1F4CD}", label: "Round pushpin", keywords: ["location"] },
  { value: "\u{1F4CE}", label: "Paperclip", keywords: ["attach"] },
  { value: "\u{1F4C1}", label: "File folder", keywords: ["files"] },
  { value: "\u{1F4C2}", label: "Open folder", keywords: ["files"] },
  { value: "\u{1F5C2}\uFE0F", label: "Card index dividers", keywords: ["organize"] },
  { value: "\u{1F4DD}", label: "Memo", keywords: ["note"] },
  { value: "\u{1F4C5}", label: "Calendar emoji", keywords: ["schedule"] },
  { value: "\u{1F4C6}", label: "Tear-off calendar", keywords: ["schedule"] },
  { value: "\u{1F4DE}", label: "Telephone receiver", keywords: ["phone"] },
  { value: "\u{1F4E0}", label: "Fax machine", keywords: ["fax"] },
  { value: "\u{1F4E7}", label: "Email emoji", keywords: ["mail"] },
  { value: "\u{1F4E8}", label: "Incoming envelope", keywords: ["mail"] },
  { value: "\u{1F4EE}", label: "Postbox", keywords: ["mail"] },
  { value: "\u{1F4AC}", label: "Speech bubble emoji", keywords: ["chat"] },
  { value: "\u{1F5E8}\uFE0F", label: "Left speech bubble", keywords: ["chat"] },
  { value: "\u{1F4AD}", label: "Thought balloon", keywords: ["thought"] },
  { value: "\u{1F551}", label: "Clock face", keywords: ["time"] },
  { value: "\u{1F552}", label: "Clock face three", keywords: ["time"] },
  { value: "\u{1F553}", label: "Clock face four", keywords: ["time"] },
  { value: "\u{1F6CE}\uFE0F", label: "Service bell", keywords: ["notification"] },
  { value: "\u{1F4E3}", label: "Megaphone emoji", keywords: ["announcement"] },
  { value: "\u{1F4E2}", label: "Loudspeaker", keywords: ["announcement"] },
  { value: "\u{1F381}", label: "Gift", keywords: ["reward"] },
  { value: "\u{1F389}", label: "Party popper", keywords: ["celebration"] },
  { value: "\u{1F3C6}", label: "Trophy emoji", keywords: ["winner"] },
  { value: "\u2699\uFE0F", label: "Gear", keywords: ["settings"] },
  { value: "\u{1F512}", label: "Lock emoji", keywords: ["secure"] },
  { value: "\u{1F511}", label: "Key", keywords: ["access"] },
  { value: "\u{1F4E1}", label: "Satellite antenna", keywords: ["signal"] },
  { value: "\u{1F4F6}", label: "Signal strength", keywords: ["signal"] },
  { value: "\u{1F9ED}", label: "Compass emoji", keywords: ["direction"] },
  { value: "\u{1F9E0}", label: "Brain emoji", keywords: ["intelligence"] },
  { value: "\u{1F6E0}\uFE0F", label: "Hammer and wrench", keywords: ["tools"] },
  { value: "\u{1F9F0}", label: "Toolbox", keywords: ["tools"] },
  { value: "\u{1F48E}", label: "Gem stone", keywords: ["premium"] },
  { value: "\u{1FA99}", label: "Coin", keywords: ["money"] },
  { value: "\u{1F9FE}", label: "Receipt", keywords: ["invoice"] },
  { value: "\u{1F6F0}\uFE0F", label: "Satellite", keywords: ["tech"] }
];
function mergeIconOptions(base, additions) {
  const seen = new Set(base.map((option) => option.value));
  const merged = [...base];
  for (const option of additions) {
    if (seen.has(option.value)) continue;
    merged.push(option);
    seen.add(option.value);
  }
  return merged;
}
const ICON_LIBRARY = mergeIconOptions(
  ICON_SUGGESTIONS,
  [
    ...EXTRA_LUCIDE_ICON_LIBRARY.map(({ slug, ...rest }) => ({
      value: `lucide:${slug}`,
      ...rest
    })),
    ...EXTRA_EMOJI_ICON_LIBRARY
  ]
);
function extractLucideSlug(icon) {
  if (!icon) return null;
  if (!icon.startsWith("lucide:")) return null;
  const slug = icon.slice("lucide:".length);
  return slug.length ? slug : null;
}
function renderDictionaryIcon(icon, className = "h-4 w-4") {
  if (!icon) return null;
  const slug = extractLucideSlug(icon);
  if (slug) {
    const IconComponent = LUCIDE_ICON_MAP[slug];
    if (!IconComponent) return null;
    return /* @__PURE__ */ jsx(IconComponent, { className, "aria-hidden": true });
  }
  return /* @__PURE__ */ jsx("span", { className: "text-base", children: icon });
}
function renderDictionaryColor(color, className = "h-4 w-4 rounded") {
  if (!color) return null;
  return /* @__PURE__ */ jsx(
    "span",
    {
      className: `inline-flex border border-border ${className}`,
      style: { backgroundColor: color },
      "aria-hidden": true
    }
  );
}
function normalizeDictionaryEntries(items, options = {}) {
  if (!Array.isArray(items)) return [];
  const entries = [];
  for (const item of items) {
    if (!item || typeof item !== "object") continue;
    const candidate = item;
    const rawValue = typeof candidate.value === "string" ? candidate.value.trim() : "";
    if (!rawValue) continue;
    const label = typeof candidate.label === "string" && candidate.label.trim().length ? candidate.label.trim() : rawValue;
    const color = typeof candidate.color === "string" && /^#([0-9a-fA-F]{6})$/.test(candidate.color) ? `#${candidate.color.slice(1).toLowerCase()}` : null;
    const icon = typeof candidate.icon === "string" && candidate.icon.trim().length ? candidate.icon.trim() : null;
    entries.push({ value: rawValue, label, color, icon });
  }
  if (options.sort === false) return entries;
  return entries.sort((a, b) => a.label.localeCompare(b.label, void 0, { sensitivity: "base" }));
}
function createDictionaryMap(entries) {
  return entries.reduce((acc, entry) => {
    acc[entry.value] = entry;
    return acc;
  }, {});
}
function DictionaryValue({
  value,
  map,
  fallback = null,
  className,
  iconWrapperClassName = "inline-flex h-6 w-6 items-center justify-center rounded border border-border bg-card",
  iconClassName = "h-4 w-4",
  colorClassName = "h-3 w-3 rounded-full"
}) {
  if (!value) return fallback ?? null;
  const entry = map?.[value];
  if (!entry) {
    return /* @__PURE__ */ jsx("span", { className, children: value });
  }
  const classes = ["inline-flex items-center gap-2", className].filter(Boolean).join(" ");
  const renderedIcon = renderDictionaryIcon(entry.icon, iconClassName);
  return /* @__PURE__ */ jsxs("span", { className: classes, children: [
    renderedIcon ? /* @__PURE__ */ jsx("span", { className: [iconWrapperClassName].filter(Boolean).join(" "), children: renderedIcon }) : null,
    /* @__PURE__ */ jsx("span", { children: entry.label }),
    entry.color ? renderDictionaryColor(entry.color, colorClassName) : null
  ] });
}
export {
  DictionaryValue,
  ICON_LIBRARY,
  ICON_SUGGESTIONS,
  createDictionaryMap,
  extractLucideSlug,
  normalizeDictionaryEntries,
  renderDictionaryColor,
  renderDictionaryIcon
};
//# sourceMappingURL=dictionaryAppearance.js.map
