"use client";
'use strict';

var React = require('react');
var lucideReact = require('lucide-react');
var clsx = require('clsx');
var tailwindMerge = require('tailwind-merge');
var classVarianceAuthority = require('class-variance-authority');
var jsxRuntime = require('react/jsx-runtime');

function _interopNamespace(e) {
  if (e && e.__esModule) return e;
  var n = Object.create(null);
  if (e) {
    Object.keys(e).forEach(function (k) {
      if (k !== 'default') {
        var d = Object.getOwnPropertyDescriptor(e, k);
        Object.defineProperty(n, k, d.get ? d : {
          enumerable: true,
          get: function () { return e[k]; }
        });
      }
    });
  }
  n.default = e;
  return Object.freeze(n);
}

var React__namespace = /*#__PURE__*/_interopNamespace(React);

var __defProp = Object.defineProperty;
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
function cn(...inputs) {
  return tailwindMerge.twMerge(clsx.clsx(inputs));
}
__name(cn, "cn");
var badgeVariants = classVarianceAuthority.cva(
  "focus:ring-ring border-divider inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:ring-2 focus:ring-offset-2 focus:outline-hidden",
  {
    variants: {
      variant: {
        default: "bg-primary text-primary-foreground hover:bg-primary/80 border-transparent shadow",
        secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80 border-transparent",
        destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/80 border-transparent shadow",
        outline: "hover:bg-bg-secondary text-text-secondary hover:text-text-default border border-gray-500 bg-transparent shadow-xs",
        inputAdornment: "bg-gray-600 px-2 font-medium text-white",
        tags: "text-text-secondary border-divider bg-bg-quaternary rounded-lg px-2 py-1 font-normal capitalize"
      }
    },
    defaultVariants: {
      variant: "default"
    }
  }
);
var Badge = React__namespace.forwardRef(
  ({ className, variant, ...props }, ref) => {
    return /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn(badgeVariants({ variant }), className), ...props });
  }
);
Badge.displayName = "Badge";
var Tags = React__namespace.forwardRef(
  ({ className, tags, onRemove, variant = "default", ...props }, ref) => {
    return /* @__PURE__ */ jsxRuntime.jsx(
      "div",
      {
        ref,
        className: cn("flex flex-wrap gap-2", className),
        ...props,
        children: tags.map((tag) => /* @__PURE__ */ jsxRuntime.jsxs(
          Badge,
          {
            variant,
            className: cn("gap-1", onRemove && "pr-1"),
            children: [
              tag.label,
              onRemove && /* @__PURE__ */ jsxRuntime.jsxs(
                "button",
                {
                  type: "button",
                  onClick: () => onRemove(tag.id),
                  className: "ml-1 rounded-full p-0.5 hover:bg-black/10 dark:hover:bg-white/10",
                  children: [
                    /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-3 w-3" }),
                    /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "sr-only", children: [
                      "Remove ",
                      tag.label
                    ] })
                  ]
                }
              )
            ]
          },
          tag.id
        ))
      }
    );
  }
);
Tags.displayName = "Tags";

exports.Tags = Tags;
