"use client";
import * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';
import * as React from 'react';
import { clsx } from 'clsx';
import { twMerge } from 'tailwind-merge';
import * as TogglePrimitive from '@radix-ui/react-toggle';
import { cva } from 'class-variance-authority';
import { jsx } from 'react/jsx-runtime';

var __defProp = Object.defineProperty;
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
function cn(...inputs) {
  return twMerge(clsx(inputs));
}
__name(cn, "cn");
var toggleVariants = cva(
  "ring-offset-background hover:bg-muted hover:text-text-secondary focus-visible:ring-ring data-[state=on]:bg-bg-quaternary inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50 data-[state=on]:text-white",
  {
    variants: {
      variant: {
        default: "bg-bg-tertiary",
        outline: "border-divider hover:bg-bg-tertiary border bg-transparent hover:text-white"
      },
      size: {
        default: "h-10 px-3",
        sm: "h-9 px-2.5",
        lg: "h-11 px-5"
      }
    },
    defaultVariants: {
      variant: "default",
      size: "default"
    }
  }
);
var Toggle = /* @__PURE__ */ __name(({
  className,
  variant,
  size,
  ...props
}) => /* @__PURE__ */ jsx(
  TogglePrimitive.Root,
  {
    className: cn(toggleVariants({ variant, size, className })),
    ...props
  }
), "Toggle");
Toggle.displayName = TogglePrimitive.Root.displayName;
var ToggleGroupContext = React.createContext({
  size: "default",
  variant: "default"
});
var ToggleGroup = /* @__PURE__ */ __name(({
  className,
  variant,
  size,
  children,
  ...props
}) => /* @__PURE__ */ jsx(
  ToggleGroupPrimitive.Root,
  {
    className: cn("flex items-center justify-center gap-1", className),
    ...props,
    children: /* @__PURE__ */ jsx(ToggleGroupContext.Provider, { value: { variant, size }, children })
  }
), "ToggleGroup");
ToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName;
var ToggleGroupItem = /* @__PURE__ */ __name(({
  className,
  children,
  variant,
  size,
  ...props
}) => {
  const context = React.useContext(ToggleGroupContext);
  return /* @__PURE__ */ jsx(
    ToggleGroupPrimitive.Item,
    {
      className: cn(
        toggleVariants({
          variant: context.variant || variant,
          size: context.size || size
        }),
        className
      ),
      ...props,
      children
    }
  );
}, "ToggleGroupItem");
ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName;

export { ToggleGroup, ToggleGroupItem };
