import { _ as __rest } from './tslib.es6-es.js';
import React__default from 'react';
import classnames from 'classnames';
import { n as normalizeBaseUiButtonProps, i as isAtlantisButtonRenderTarget, s as stripNativeTypeFromButtonRenderTarget, r as renderAtlantisButtonTarget } from './buttonRenderAdapter-es.js';
import { C as ComboboxRoot$1, a as ComboboxLabel$1, b as ComboboxValue$1, c as ComboboxInput$1, d as ComboboxInputGroup$1, e as ComboboxTrigger$1, f as ComboboxList$1, g as ComboboxStatus$1, h as ComboboxPortal$1, i as ComboboxBackdrop$1, j as ComboboxPositioner$1, k as ComboboxPopup$1, l as ComboboxArrow$1, m as ComboboxIcon$1, n as ComboboxGroup$1, o as ComboboxGroupLabel$1, p as ComboboxItem$1, q as ComboboxItemIndicator$1, r as ComboboxChips$1, s as ComboboxChip$1, t as ComboboxChipRemove$1, u as ComboboxRow$1, v as ComboboxCollection$1, w as ComboboxEmpty$1, x as ComboboxClear$1, y as useComboboxFilter, z as useFilteredItems$1 } from './ComboboxChipRemove-es.js';
import { S as Separator } from './Separator-es.js';

var styles = {"label":"qWsLxPjCBI8-","inputGroup":"EySvIEsW9Q4-","trigger":"F94vaco3HkM-","clear":"IYgNfHHPVFY-","input":"L-KgsoDZ360-","icon":"KBJi5F0wWc0-","positioner":"qfx6EynKdsk-","popup":"LOetsPPEwOk-","list":"TCtrYZwnZYo-","empty":"M166bxiQs88-","item":"Cm53I7O4mMw-","row":"jvrxEbmYGpM-","itemIndicator":"GwotZ3R-quw-","group":"u5M1OKpKSWw-","separator":"mpkTjdLrAUI-","groupLabel":"_6UKKWI-irfo-","backdrop":"UnM-udfURI4-","arrow":"RZ4T5-BjTDY-","chips":"pkc7PhhfCuk-","chip":"fdKYm3GTKwk-","chipRemove":"vzuaMzxA96M-","spinning":"bk68oghmmqo-"};

// Matches var(--space-smaller). Base UI expects this offset as a pixel number.
const POSITIONER_SIDE_OFFSET = 4;
function mergeClassName(baseClassName, className) {
    if (typeof className === "function") {
        return state => classnames(baseClassName, className(state));
    }
    return classnames(baseClassName, className);
}
function ComboboxRoot(props) {
    return React__default.createElement(ComboboxRoot$1, Object.assign({}, props));
}
function ComboboxLabel(_a) {
    var { className } = _a, labelProps = __rest(_a, ["className"]);
    return (React__default.createElement(ComboboxLabel$1, Object.assign({}, labelProps, { className: mergeClassName(styles.label, className) })));
}
function ComboboxValue(props) {
    return React__default.createElement(ComboboxValue$1, Object.assign({}, props));
}
function ComboboxInput(_a) {
    var { className } = _a, inputProps = __rest(_a, ["className"]);
    return (React__default.createElement(ComboboxInput$1, Object.assign({}, inputProps, { className: mergeClassName(styles.input, className) })));
}
function ComboboxInputGroup(_a) {
    var { className } = _a, inputGroupProps = __rest(_a, ["className"]);
    return (React__default.createElement(ComboboxInputGroup$1, Object.assign({}, inputGroupProps, { className: mergeClassName(styles.inputGroup, className) })));
}
function ComboboxTrigger(_a) {
    var { className, render } = _a, triggerProps = __rest(_a, ["className", "render"]);
    return (React__default.createElement(ComboboxTrigger$1, Object.assign({}, triggerProps, { render: resolveComboboxTriggerRender(render), className: render ? className : mergeClassName(styles.trigger, className) })));
}
function resolveComboboxTriggerRender(render) {
    if (!render) {
        return render;
    }
    if (typeof render === "function") {
        return (props, state) => {
            const renderedElement = render(normalizeBaseUiButtonProps(props), state);
            return isAtlantisButtonRenderTarget(renderedElement)
                ? stripNativeTypeFromButtonRenderTarget(renderedElement)
                : renderedElement;
        };
    }
    return isAtlantisButtonRenderTarget(render)
        ? renderAtlantisButtonTarget(render)
        : render;
}
function ComboboxList(_a) {
    var { className } = _a, listProps = __rest(_a, ["className"]);
    return (React__default.createElement(ComboboxList$1, Object.assign({}, listProps, { className: mergeClassName(styles.list, className) })));
}
function ComboboxStatus(props) {
    return React__default.createElement(ComboboxStatus$1, Object.assign({}, props));
}
function ComboboxPortal(props) {
    return React__default.createElement(ComboboxPortal$1, Object.assign({}, props));
}
function ComboboxBackdrop(_a) {
    var { className } = _a, backdropProps = __rest(_a, ["className"]);
    return (React__default.createElement(ComboboxBackdrop$1, Object.assign({}, backdropProps, { className: mergeClassName(styles.backdrop, className) })));
}
function ComboboxPositioner(_a) {
    var { className, sideOffset = POSITIONER_SIDE_OFFSET } = _a, positionerProps = __rest(_a, ["className", "sideOffset"]);
    return (React__default.createElement(ComboboxPositioner$1, Object.assign({}, positionerProps, { sideOffset: sideOffset, className: mergeClassName(styles.positioner, className) })));
}
function ComboboxPopup(_a) {
    var { className } = _a, popupProps = __rest(_a, ["className"]);
    return (React__default.createElement(ComboboxPopup$1, Object.assign({}, popupProps, { className: mergeClassName(styles.popup, className) })));
}
function ComboboxArrow(_a) {
    var { className } = _a, arrowProps = __rest(_a, ["className"]);
    return (React__default.createElement(ComboboxArrow$1, Object.assign({}, arrowProps, { className: mergeClassName(styles.arrow, className) })));
}
function ComboboxIcon(_a) {
    var { className } = _a, iconProps = __rest(_a, ["className"]);
    return (React__default.createElement(ComboboxIcon$1, Object.assign({}, iconProps, { className: mergeClassName(styles.icon, className) })));
}
function ComboboxGroup(_a) {
    var { className } = _a, groupProps = __rest(_a, ["className"]);
    return (React__default.createElement(ComboboxGroup$1, Object.assign({}, groupProps, { className: mergeClassName(styles.group, className) })));
}
function ComboboxGroupLabel(_a) {
    var { className } = _a, groupLabelProps = __rest(_a, ["className"]);
    return (React__default.createElement(ComboboxGroupLabel$1, Object.assign({}, groupLabelProps, { className: mergeClassName(styles.groupLabel, className) })));
}
function ComboboxItem(_a) {
    var { className } = _a, itemProps = __rest(_a, ["className"]);
    return (React__default.createElement(ComboboxItem$1, Object.assign({}, itemProps, { className: mergeClassName(styles.item, className) })));
}
function ComboboxItemIndicator(_a) {
    var { className } = _a, itemIndicatorProps = __rest(_a, ["className"]);
    return (React__default.createElement(ComboboxItemIndicator$1, Object.assign({}, itemIndicatorProps, { className: mergeClassName(styles.itemIndicator, className) })));
}
function ComboboxChips(_a) {
    var { className } = _a, chipsProps = __rest(_a, ["className"]);
    return (React__default.createElement(ComboboxChips$1, Object.assign({}, chipsProps, { className: mergeClassName(styles.chips, className) })));
}
function ComboboxChip(_a) {
    var { className } = _a, chipProps = __rest(_a, ["className"]);
    return (React__default.createElement(ComboboxChip$1, Object.assign({}, chipProps, { className: mergeClassName(styles.chip, className) })));
}
function ComboboxChipRemove(_a) {
    var { className } = _a, chipRemoveProps = __rest(_a, ["className"]);
    return (React__default.createElement(ComboboxChipRemove$1, Object.assign({}, chipRemoveProps, { className: mergeClassName(styles.chipRemove, className) })));
}
function ComboboxRow(_a) {
    var { className } = _a, rowProps = __rest(_a, ["className"]);
    return (React__default.createElement(ComboboxRow$1, Object.assign({}, rowProps, { className: mergeClassName(styles.row, className) })));
}
function ComboboxCollection(props) {
    return React__default.createElement(ComboboxCollection$1, Object.assign({}, props));
}
function ComboboxEmpty(_a) {
    var { className } = _a, emptyProps = __rest(_a, ["className"]);
    return (React__default.createElement(ComboboxEmpty$1, Object.assign({}, emptyProps, { className: mergeClassName(styles.empty, className) })));
}
function ComboboxClear(_a) {
    var { className } = _a, clearProps = __rest(_a, ["className"]);
    return (React__default.createElement(ComboboxClear$1, Object.assign({}, clearProps, { className: mergeClassName(styles.clear, className) })));
}
function ComboboxSeparator(_a) {
    var { className } = _a, separatorProps = __rest(_a, ["className"]);
    return (React__default.createElement(Separator, Object.assign({}, separatorProps, { className: mergeClassName(styles.separator, className) })));
}
const useFilter = useComboboxFilter;
const useFilteredItems = useFilteredItems$1;

var ComboboxPrimitive = /*#__PURE__*/Object.freeze({
  __proto__: null,
  Arrow: ComboboxArrow,
  Backdrop: ComboboxBackdrop,
  Chip: ComboboxChip,
  ChipRemove: ComboboxChipRemove,
  Chips: ComboboxChips,
  Clear: ComboboxClear,
  Collection: ComboboxCollection,
  Empty: ComboboxEmpty,
  Group: ComboboxGroup,
  GroupLabel: ComboboxGroupLabel,
  Icon: ComboboxIcon,
  Input: ComboboxInput,
  InputGroup: ComboboxInputGroup,
  Item: ComboboxItem,
  ItemIndicator: ComboboxItemIndicator,
  Label: ComboboxLabel,
  List: ComboboxList,
  Popup: ComboboxPopup,
  Portal: ComboboxPortal,
  Positioner: ComboboxPositioner,
  Root: ComboboxRoot,
  Row: ComboboxRow,
  Separator: ComboboxSeparator,
  Status: ComboboxStatus,
  Trigger: ComboboxTrigger,
  Value: ComboboxValue,
  useFilter: useFilter,
  useFilteredItems: useFilteredItems
});

export { ComboboxPrimitive as C };
