// muse-ui v4.0.0-alpha.1
// © 2024 kjxbyz. All Rights Reserved.
"use client";
"use strict";
function _array_like_to_array(arr, len) {
    if (len == null || len > arr.length) len = arr.length;
    for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
    return arr2;
}
function _array_with_holes(arr) {
    if (Array.isArray(arr)) return arr;
}
function _array_without_holes(arr) {
    if (Array.isArray(arr)) return _array_like_to_array(arr);
}
function _define_property(obj, key, value) {
    if (key in obj) {
        Object.defineProperty(obj, key, {
            value: value,
            enumerable: true,
            configurable: true,
            writable: true
        });
    } else {
        obj[key] = value;
    }
    return obj;
}
function _iterable_to_array(iter) {
    if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
}
function _iterable_to_array_limit(arr, i) {
    var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
    if (_i == null) return;
    var _arr = [];
    var _n = true;
    var _d = false;
    var _s, _e;
    try {
        for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
            _arr.push(_s.value);
            if (i && _arr.length === i) break;
        }
    } catch (err) {
        _d = true;
        _e = err;
    } finally{
        try {
            if (!_n && _i["return"] != null) _i["return"]();
        } finally{
            if (_d) throw _e;
        }
    }
    return _arr;
}
function _non_iterable_rest() {
    throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _non_iterable_spread() {
    throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _object_spread(target) {
    for(var i = 1; i < arguments.length; i++){
        var source = arguments[i] != null ? arguments[i] : {};
        var ownKeys = Object.keys(source);
        if (typeof Object.getOwnPropertySymbols === "function") {
            ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
                return Object.getOwnPropertyDescriptor(source, sym).enumerable;
            }));
        }
        ownKeys.forEach(function(key) {
            _define_property(target, key, source[key]);
        });
    }
    return target;
}
function ownKeys(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
        var symbols = Object.getOwnPropertySymbols(object);
        if (enumerableOnly) {
            symbols = symbols.filter(function(sym) {
                return Object.getOwnPropertyDescriptor(object, sym).enumerable;
            });
        }
        keys.push.apply(keys, symbols);
    }
    return keys;
}
function _object_spread_props(target, source) {
    source = source != null ? source : {};
    if (Object.getOwnPropertyDescriptors) {
        Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
    } else {
        ownKeys(Object(source)).forEach(function(key) {
            Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
        });
    }
    return target;
}
function _object_without_properties(source, excluded) {
    if (source == null) return {};
    var target = _object_without_properties_loose(source, excluded);
    var key, i;
    if (Object.getOwnPropertySymbols) {
        var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
        for(i = 0; i < sourceSymbolKeys.length; i++){
            key = sourceSymbolKeys[i];
            if (excluded.indexOf(key) >= 0) continue;
            if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
            target[key] = source[key];
        }
    }
    return target;
}
function _object_without_properties_loose(source, excluded) {
    if (source == null) return {};
    var target = {};
    var sourceKeys = Object.keys(source);
    var key, i;
    for(i = 0; i < sourceKeys.length; i++){
        key = sourceKeys[i];
        if (excluded.indexOf(key) >= 0) continue;
        target[key] = source[key];
    }
    return target;
}
function _sliced_to_array(arr, i) {
    return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
}
function _to_consumable_array(arr) {
    return _array_without_holes(arr) || _iterable_to_array(arr) || _unsupported_iterable_to_array(arr) || _non_iterable_spread();
}
function _unsupported_iterable_to_array(o, minLen) {
    if (!o) return;
    if (typeof o === "string") return _array_like_to_array(o, minLen);
    var n = Object.prototype.toString.call(o).slice(8, -1);
    if (n === "Object" && o.constructor) n = o.constructor.name;
    if (n === "Map" || n === "Set") return Array.from(n);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
}
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = function(target, all) {
    for(var name in all)__defProp(target, name, {
        get: all[name],
        enumerable: true
    });
};
var __copyProps = function(to, from, except, desc) {
    if (from && typeof from === "object" || typeof from === "function") {
        var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
        try {
            var _loop = function() {
                var key = _step.value;
                if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
                    get: function() {
                        return from[key];
                    },
                    enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
                });
            };
            for(var _iterator = __getOwnPropNames(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true)_loop();
        } catch (err) {
            _didIteratorError = true;
            _iteratorError = err;
        } finally{
            try {
                if (!_iteratorNormalCompletion && _iterator.return != null) {
                    _iterator.return();
                }
            } finally{
                if (_didIteratorError) {
                    throw _iteratorError;
                }
            }
        }
    }
    return to;
};
var __toESM = function(mod, isNodeMode, target) {
    return target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(// If the importer is in node compatibility mode or this is not an ESM
    // file that has been converted to a CommonJS file using a Babel-
    // compatible transform (i.e. "__esModule" has not been set), then set
    // "default" to the CommonJS "module.exports" for node compatibility.
    isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
        value: mod,
        enumerable: true
    }) : target, mod);
};
var __toCommonJS = function(mod) {
    return __copyProps(__defProp({}, "__esModule", {
        value: true
    }), mod);
};
// registry/new-york/ui/toggle-group.tsx
var toggle_group_exports = {};
__export(toggle_group_exports, {
    ToggleGroup: function() {
        return ToggleGroup;
    },
    ToggleGroupItem: function() {
        return ToggleGroupItem;
    }
});
module.exports = __toCommonJS(toggle_group_exports);
var React2 = __toESM(require("react"));
// ../../node_modules/.pnpm/@babel+runtime@7.22.3/node_modules/@babel/runtime/helpers/esm/extends.js
function _extends() {
    _extends = Object.assign ? Object.assign.bind() : function _extends(target) {
        for(var i = 1; i < arguments.length; i++){
            var source = arguments[i];
            for(var key in source){
                if (Object.prototype.hasOwnProperty.call(source, key)) {
                    target[key] = source[key];
                }
            }
        }
        return target;
    };
    return _extends.apply(this, arguments);
}
// ../../node_modules/.pnpm/@radix-ui+react-toggle-group@1.0.4_@types+react-dom@18.2.22_@types+react@18.2.65_react-dom@18.2.0_react@18.2.0/node_modules/@radix-ui/react-toggle-group/dist/index.mjs
var import_react12 = __toESM(require("react"), 1);
// ../../node_modules/.pnpm/@radix-ui+react-context@1.0.1_@types+react@18.2.65_react@18.2.0/node_modules/@radix-ui/react-context/dist/index.mjs
var import_react = require("react");
function $c512c27ab02ef895$export$50c7b4e9d9f19c1(scopeName) {
    var createContextScopeDeps = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
    var defaultContexts = [];
    function $c512c27ab02ef895$export$fd42f52fd3ae1109(rootComponentName, defaultContext) {
        var BaseContext = /* @__PURE__ */ (0, import_react.createContext)(defaultContext);
        var index = defaultContexts.length;
        defaultContexts = _to_consumable_array(defaultContexts).concat([
            defaultContext
        ]);
        function Provider(props) {
            var scope = props.scope, children = props.children, context = _object_without_properties(props, [
                "scope",
                "children"
            ]);
            var Context = (scope === null || scope === void 0 ? void 0 : scope[scopeName][index]) || BaseContext;
            var value = (0, import_react.useMemo)(function() {
                return context;
            }, Object.values(context));
            return /* @__PURE__ */ (0, import_react.createElement)(Context.Provider, {
                value: value
            }, children);
        }
        function useContext2(consumerName, scope) {
            var Context = (scope === null || scope === void 0 ? void 0 : scope[scopeName][index]) || BaseContext;
            var context = (0, import_react.useContext)(Context);
            if (context) return context;
            if (defaultContext !== void 0) return defaultContext;
            throw new Error("`".concat(consumerName, "` must be used within `").concat(rootComponentName, "`"));
        }
        Provider.displayName = rootComponentName + "Provider";
        return [
            Provider,
            useContext2
        ];
    }
    var createScope = function() {
        var scopeContexts = defaultContexts.map(function(defaultContext) {
            return /* @__PURE__ */ (0, import_react.createContext)(defaultContext);
        });
        return function useScope(scope) {
            var contexts = (scope === null || scope === void 0 ? void 0 : scope[scopeName]) || scopeContexts;
            return (0, import_react.useMemo)(function() {
                return _define_property({}, "__scope".concat(scopeName), _object_spread_props(_object_spread({}, scope), _define_property({}, scopeName, contexts)));
            }, [
                scope,
                contexts
            ]);
        };
    };
    createScope.scopeName = scopeName;
    return [
        $c512c27ab02ef895$export$fd42f52fd3ae1109,
        $c512c27ab02ef895$var$composeContextScopes.apply(void 0, [
            createScope
        ].concat(_to_consumable_array(createContextScopeDeps)))
    ];
}
function $c512c27ab02ef895$var$composeContextScopes() {
    for(var _len = arguments.length, scopes = new Array(_len), _key = 0; _key < _len; _key++){
        scopes[_key] = arguments[_key];
    }
    var baseScope = scopes[0];
    if (scopes.length === 1) return baseScope;
    var createScope1 = function() {
        var scopeHooks = scopes.map(function(createScope) {
            return {
                useScope: createScope(),
                scopeName: createScope.scopeName
            };
        });
        return function useComposedScopes(overrideScopes) {
            var nextScopes1 = scopeHooks.reduce(function(nextScopes, param) {
                var useScope = param.useScope, scopeName = param.scopeName;
                var scopeProps = useScope(overrideScopes);
                var currentScope = scopeProps["__scope".concat(scopeName)];
                return _object_spread({}, nextScopes, currentScope);
            }, {});
            return (0, import_react.useMemo)(function() {
                return _define_property({}, "__scope".concat(baseScope.scopeName), nextScopes1);
            }, [
                nextScopes1
            ]);
        };
    };
    createScope1.scopeName = baseScope.scopeName;
    return createScope1;
}
// ../../node_modules/.pnpm/@babel+runtime@7.22.6/node_modules/@babel/runtime/helpers/esm/extends.js
function _extends2() {
    _extends2 = Object.assign ? Object.assign.bind() : function _extends2(target) {
        for(var i = 1; i < arguments.length; i++){
            var source = arguments[i];
            for(var key in source){
                if (Object.prototype.hasOwnProperty.call(source, key)) {
                    target[key] = source[key];
                }
            }
        }
        return target;
    };
    return _extends2.apply(this, arguments);
}
// ../../node_modules/.pnpm/@radix-ui+react-primitive@1.0.3_@types+react-dom@18.2.22_@types+react@18.2.65_react-dom@18.2.0_react@18.2.0/node_modules/@radix-ui/react-primitive/dist/index.mjs
var import_react4 = require("react");
var import_react_dom = require("react-dom");
// ../../node_modules/.pnpm/@radix-ui+react-slot@1.0.2_@types+react@18.2.65_react@18.2.0/node_modules/@radix-ui/react-slot/dist/index.mjs
var import_react3 = require("react");
// ../../node_modules/.pnpm/@radix-ui+react-compose-refs@1.0.1_@types+react@18.2.65_react@18.2.0/node_modules/@radix-ui/react-compose-refs/dist/index.mjs
var import_react2 = require("react");
function $6ed0406888f73fc4$var$setRef(ref, value) {
    if (typeof ref === "function") ref(value);
    else if (ref !== null && ref !== void 0) ref.current = value;
}
function $6ed0406888f73fc4$export$43e446d32b3d21af() {
    for(var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++){
        refs[_key] = arguments[_key];
    }
    return function(node) {
        return refs.forEach(function(ref) {
            return $6ed0406888f73fc4$var$setRef(ref, node);
        });
    };
}
function $6ed0406888f73fc4$export$c7b2cbe3552a0d05() {
    for(var _len = arguments.length, refs = new Array(_len), _key = 0; _key < _len; _key++){
        refs[_key] = arguments[_key];
    }
    return (0, import_react2.useCallback)($6ed0406888f73fc4$export$43e446d32b3d21af.apply(void 0, _to_consumable_array(refs)), refs);
}
// ../../node_modules/.pnpm/@radix-ui+react-slot@1.0.2_@types+react@18.2.65_react@18.2.0/node_modules/@radix-ui/react-slot/dist/index.mjs
var $5e63c961fc1ce211$export$8c6ed5c666ac1360 = /* @__PURE__ */ (0, import_react3.forwardRef)(function(props, forwardedRef) {
    var children = props.children, slotProps = _object_without_properties(props, [
        "children"
    ]);
    var childrenArray = import_react3.Children.toArray(children);
    var slottable = childrenArray.find($5e63c961fc1ce211$var$isSlottable);
    if (slottable) {
        var newElement = slottable.props.children;
        var newChildren = childrenArray.map(function(child) {
            if (child === slottable) {
                if (import_react3.Children.count(newElement) > 1) return import_react3.Children.only(null);
                return /* @__PURE__ */ (0, import_react3.isValidElement)(newElement) ? newElement.props.children : null;
            } else return child;
        });
        return /* @__PURE__ */ (0, import_react3.createElement)($5e63c961fc1ce211$var$SlotClone, _extends2({}, slotProps, {
            ref: forwardedRef
        }), /* @__PURE__ */ (0, import_react3.isValidElement)(newElement) ? /* @__PURE__ */ (0, import_react3.cloneElement)(newElement, void 0, newChildren) : null);
    }
    return /* @__PURE__ */ (0, import_react3.createElement)($5e63c961fc1ce211$var$SlotClone, _extends2({}, slotProps, {
        ref: forwardedRef
    }), children);
});
$5e63c961fc1ce211$export$8c6ed5c666ac1360.displayName = "Slot";
var $5e63c961fc1ce211$var$SlotClone = /* @__PURE__ */ (0, import_react3.forwardRef)(function(props, forwardedRef) {
    var children = props.children, slotProps = _object_without_properties(props, [
        "children"
    ]);
    if (/* @__PURE__ */ (0, import_react3.isValidElement)(children)) return /* @__PURE__ */ (0, import_react3.cloneElement)(children, _object_spread_props(_object_spread({}, $5e63c961fc1ce211$var$mergeProps(slotProps, children.props)), {
        ref: forwardedRef ? $6ed0406888f73fc4$export$43e446d32b3d21af(forwardedRef, children.ref) : children.ref
    }));
    return import_react3.Children.count(children) > 1 ? import_react3.Children.only(null) : null;
});
$5e63c961fc1ce211$var$SlotClone.displayName = "SlotClone";
var $5e63c961fc1ce211$export$d9f1ccf0bdb05d45 = function(param) {
    var children = param.children;
    return /* @__PURE__ */ (0, import_react3.createElement)(import_react3.Fragment, null, children);
};
function $5e63c961fc1ce211$var$isSlottable(child) {
    return /* @__PURE__ */ (0, import_react3.isValidElement)(child) && child.type === $5e63c961fc1ce211$export$d9f1ccf0bdb05d45;
}
function $5e63c961fc1ce211$var$mergeProps(slotProps, childProps) {
    var _loop = function(propName) {
        var slotPropValue = slotProps[propName];
        var childPropValue = childProps[propName];
        var isHandler = /^on[A-Z]/.test(propName);
        if (isHandler) {
            if (slotPropValue && childPropValue) overrideProps[propName] = function() {
                for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
                    args[_key] = arguments[_key];
                }
                childPropValue.apply(void 0, _to_consumable_array(args));
                slotPropValue.apply(void 0, _to_consumable_array(args));
            };
            else if (slotPropValue) overrideProps[propName] = slotPropValue;
        } else if (propName === "style") overrideProps[propName] = _object_spread({}, slotPropValue, childPropValue);
        else if (propName === "className") overrideProps[propName] = [
            slotPropValue,
            childPropValue
        ].filter(Boolean).join(" ");
    };
    var overrideProps = _object_spread({}, childProps);
    for(var propName in childProps)_loop(propName);
    return _object_spread({}, slotProps, overrideProps);
}
// ../../node_modules/.pnpm/@radix-ui+react-primitive@1.0.3_@types+react-dom@18.2.22_@types+react@18.2.65_react-dom@18.2.0_react@18.2.0/node_modules/@radix-ui/react-primitive/dist/index.mjs
var $8927f6f2acc4f386$var$NODES = [
    "a",
    "button",
    "div",
    "form",
    "h2",
    "h3",
    "img",
    "input",
    "label",
    "li",
    "nav",
    "ol",
    "p",
    "span",
    "svg",
    "ul"
];
var $8927f6f2acc4f386$export$250ffa63cdc0d034 = $8927f6f2acc4f386$var$NODES.reduce(function(primitive, node) {
    var Node = /* @__PURE__ */ (0, import_react4.forwardRef)(function(props, forwardedRef) {
        var asChild = props.asChild, primitiveProps = _object_without_properties(props, [
            "asChild"
        ]);
        var Comp = asChild ? $5e63c961fc1ce211$export$8c6ed5c666ac1360 : node;
        (0, import_react4.useEffect)(function() {
            window[Symbol.for("radix-ui")] = true;
        }, []);
        return /* @__PURE__ */ (0, import_react4.createElement)(Comp, _extends2({}, primitiveProps, {
            ref: forwardedRef
        }));
    });
    Node.displayName = "Primitive.".concat(node);
    return _object_spread_props(_object_spread({}, primitive), _define_property({}, node, Node));
}, {});
// ../../node_modules/.pnpm/@radix-ui+react-roving-focus@1.0.4_@types+react-dom@18.2.22_@types+react@18.2.65_react-dom@18.2.0_react@18.2.0/node_modules/@radix-ui/react-roving-focus/dist/index.mjs
var import_react10 = require("react");
// ../../node_modules/.pnpm/@radix-ui+primitive@1.0.1/node_modules/@radix-ui/primitive/dist/index.mjs
function $e42e1063c40fb3ef$export$b9ecd428b558ff10(originalEventHandler, ourEventHandler) {
    var _ref = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, _ref_checkForDefaultPrevented = _ref.checkForDefaultPrevented, checkForDefaultPrevented = _ref_checkForDefaultPrevented === void 0 ? true : _ref_checkForDefaultPrevented;
    return function handleEvent(event) {
        originalEventHandler === null || originalEventHandler === void 0 || originalEventHandler(event);
        if (checkForDefaultPrevented === false || !event.defaultPrevented) return ourEventHandler === null || ourEventHandler === void 0 ? void 0 : ourEventHandler(event);
    };
}
// ../../node_modules/.pnpm/@radix-ui+react-collection@1.0.3_@types+react-dom@18.2.22_@types+react@18.2.65_react-dom@18.2.0_react@18.2.0/node_modules/@radix-ui/react-collection/dist/index.mjs
var import_react5 = __toESM(require("react"), 1);
function $e02a7d9cb1dc128c$export$c74125a8e3af6bb2(name) {
    var PROVIDER_NAME = name + "CollectionProvider";
    var _$c512c27ab02ef895$export$50c7b4e9d9f19c1 = _sliced_to_array($c512c27ab02ef895$export$50c7b4e9d9f19c1(PROVIDER_NAME), 2), createCollectionContext = _$c512c27ab02ef895$export$50c7b4e9d9f19c1[0], createCollectionScope = _$c512c27ab02ef895$export$50c7b4e9d9f19c1[1];
    var _createCollectionContext = _sliced_to_array(createCollectionContext(PROVIDER_NAME, {
        collectionRef: {
            current: null
        },
        itemMap: /* @__PURE__ */ new Map()
    }), 2), CollectionProviderImpl = _createCollectionContext[0], useCollectionContext = _createCollectionContext[1];
    var CollectionProvider = function(props) {
        var scope = props.scope, children = props.children;
        var ref = import_react5.default.useRef(null);
        var itemMap = import_react5.default.useRef(/* @__PURE__ */ new Map()).current;
        return /* @__PURE__ */ import_react5.default.createElement(CollectionProviderImpl, {
            scope: scope,
            itemMap: itemMap,
            collectionRef: ref
        }, children);
    };
    /* @__PURE__ */ Object.assign(CollectionProvider, {
        displayName: PROVIDER_NAME
    });
    var COLLECTION_SLOT_NAME = name + "CollectionSlot";
    var CollectionSlot = /* @__PURE__ */ import_react5.default.forwardRef(function(props, forwardedRef) {
        var scope = props.scope, children = props.children;
        var context = useCollectionContext(COLLECTION_SLOT_NAME, scope);
        var composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, context.collectionRef);
        return /* @__PURE__ */ import_react5.default.createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360, {
            ref: composedRefs
        }, children);
    });
    /* @__PURE__ */ Object.assign(CollectionSlot, {
        displayName: COLLECTION_SLOT_NAME
    });
    var ITEM_SLOT_NAME = name + "CollectionItemSlot";
    var ITEM_DATA_ATTR = "data-radix-collection-item";
    var CollectionItemSlot = /* @__PURE__ */ import_react5.default.forwardRef(function(props, forwardedRef) {
        var scope = props.scope, children = props.children, itemData = _object_without_properties(props, [
            "scope",
            "children"
        ]);
        var ref = import_react5.default.useRef(null);
        var composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
        var context = useCollectionContext(ITEM_SLOT_NAME, scope);
        import_react5.default.useEffect(function() {
            context.itemMap.set(ref, _object_spread({
                ref: ref
            }, itemData));
            return function() {
                return void context.itemMap.delete(ref);
            };
        });
        var _obj;
        return /* @__PURE__ */ import_react5.default.createElement($5e63c961fc1ce211$export$8c6ed5c666ac1360, (_obj = {}, _define_property(_obj, ITEM_DATA_ATTR, ""), _define_property(_obj, "ref", composedRefs), _obj), children);
    });
    /* @__PURE__ */ Object.assign(CollectionItemSlot, {
        displayName: ITEM_SLOT_NAME
    });
    function useCollection(scope) {
        var context = useCollectionContext(name + "CollectionConsumer", scope);
        var getItems = import_react5.default.useCallback(function() {
            var collectionNode = context.collectionRef.current;
            if (!collectionNode) return [];
            var orderedNodes = Array.from(collectionNode.querySelectorAll("[".concat(ITEM_DATA_ATTR, "]")));
            var items = Array.from(context.itemMap.values());
            var orderedItems = items.sort(function(a, b) {
                return orderedNodes.indexOf(a.ref.current) - orderedNodes.indexOf(b.ref.current);
            });
            return orderedItems;
        }, [
            context.collectionRef,
            context.itemMap
        ]);
        return getItems;
    }
    return [
        {
            Provider: CollectionProvider,
            Slot: CollectionSlot,
            ItemSlot: CollectionItemSlot
        },
        useCollection,
        createCollectionScope
    ];
}
// ../../node_modules/.pnpm/@radix-ui+react-id@1.0.1_@types+react@18.2.65_react@18.2.0/node_modules/@radix-ui/react-id/dist/index.mjs
var $2AODx$react = __toESM(require("react"), 1);
// ../../node_modules/.pnpm/@radix-ui+react-use-layout-effect@1.0.1_@types+react@18.2.65_react@18.2.0/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs
var import_react6 = require("react");
var $9f79659886946c16$export$e5c5a5f917a5871c = Boolean(globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) ? import_react6.useLayoutEffect : function() {};
// ../../node_modules/.pnpm/@radix-ui+react-id@1.0.1_@types+react@18.2.65_react@18.2.0/node_modules/@radix-ui/react-id/dist/index.mjs
var $1746a345f3d73bb7$var$useReactId = $2AODx$react["useId".toString()] || function() {
    return void 0;
};
var $1746a345f3d73bb7$var$count = 0;
function $1746a345f3d73bb7$export$f680877a34711e37(deterministicId) {
    var _$2AODx$react_useState = _sliced_to_array($2AODx$react.useState($1746a345f3d73bb7$var$useReactId()), 2), id = _$2AODx$react_useState[0], setId = _$2AODx$react_useState[1];
    $9f79659886946c16$export$e5c5a5f917a5871c(function() {
        if (!deterministicId) setId(function(reactId) {
            return reactId !== null && reactId !== void 0 ? reactId : String($1746a345f3d73bb7$var$count++);
        });
    }, [
        deterministicId
    ]);
    return deterministicId || (id ? "radix-".concat(id) : "");
}
// ../../node_modules/.pnpm/@radix-ui+react-use-callback-ref@1.0.1_@types+react@18.2.65_react@18.2.0/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs
var import_react7 = require("react");
function $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(callback) {
    var callbackRef = (0, import_react7.useRef)(callback);
    (0, import_react7.useEffect)(function() {
        callbackRef.current = callback;
    });
    return (0, import_react7.useMemo)(function() {
        return function() {
            for(var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++){
                args[_key] = arguments[_key];
            }
            var _callbackRef$current;
            var _callbackRef$current1;
            return (_callbackRef$current1 = callbackRef.current) === null || _callbackRef$current1 === void 0 ? void 0 : (_callbackRef$current = _callbackRef$current1).call.apply(_callbackRef$current, [
                callbackRef
            ].concat(_to_consumable_array(args)));
        };
    }, []);
}
// ../../node_modules/.pnpm/@radix-ui+react-use-controllable-state@1.0.1_@types+react@18.2.65_react@18.2.0/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs
var import_react8 = require("react");
function $71cd76cc60e0454e$export$6f32135080cb4c3(param) {
    var prop = param.prop, defaultProp = param.defaultProp, _param_onChange = param.onChange, onChange = _param_onChange === void 0 ? function() {} : _param_onChange;
    var _$71cd76cc60e0454e$var$useUncontrolledState = _sliced_to_array($71cd76cc60e0454e$var$useUncontrolledState({
        defaultProp: defaultProp,
        onChange: onChange
    }), 2), uncontrolledProp = _$71cd76cc60e0454e$var$useUncontrolledState[0], setUncontrolledProp = _$71cd76cc60e0454e$var$useUncontrolledState[1];
    var isControlled = prop !== void 0;
    var value1 = isControlled ? prop : uncontrolledProp;
    var handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
    var setValue = (0, import_react8.useCallback)(function(nextValue) {
        if (isControlled) {
            var setter = nextValue;
            var value = typeof nextValue === "function" ? setter(prop) : nextValue;
            if (value !== prop) handleChange(value);
        } else setUncontrolledProp(nextValue);
    }, [
        isControlled,
        prop,
        setUncontrolledProp,
        handleChange
    ]);
    return [
        value1,
        setValue
    ];
}
function $71cd76cc60e0454e$var$useUncontrolledState(param) {
    var defaultProp = param.defaultProp, onChange = param.onChange;
    var uncontrolledState = (0, import_react8.useState)(defaultProp);
    var _uncontrolledState = _sliced_to_array(uncontrolledState, 1), value = _uncontrolledState[0];
    var prevValueRef = (0, import_react8.useRef)(value);
    var handleChange = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onChange);
    (0, import_react8.useEffect)(function() {
        if (prevValueRef.current !== value) {
            handleChange(value);
            prevValueRef.current = value;
        }
    }, [
        value,
        prevValueRef,
        handleChange
    ]);
    return uncontrolledState;
}
// ../../node_modules/.pnpm/@radix-ui+react-direction@1.0.1_@types+react@18.2.65_react@18.2.0/node_modules/@radix-ui/react-direction/dist/index.mjs
var import_react9 = require("react");
var $f631663db3294ace$var$DirectionContext = /* @__PURE__ */ (0, import_react9.createContext)(void 0);
function $f631663db3294ace$export$b39126d51d94e6f3(localDir) {
    var globalDir = (0, import_react9.useContext)($f631663db3294ace$var$DirectionContext);
    return localDir || globalDir || "ltr";
}
// ../../node_modules/.pnpm/@radix-ui+react-roving-focus@1.0.4_@types+react-dom@18.2.22_@types+react@18.2.65_react-dom@18.2.0_react@18.2.0/node_modules/@radix-ui/react-roving-focus/dist/index.mjs
var $d7bdfb9eb0fdf311$var$ENTRY_FOCUS = "rovingFocusGroup.onEntryFocus";
var $d7bdfb9eb0fdf311$var$EVENT_OPTIONS = {
    bubbles: false,
    cancelable: true
};
var $d7bdfb9eb0fdf311$var$GROUP_NAME = "RovingFocusGroup";
var _$e02a7d9cb1dc128c$export$c74125a8e3af6bb2 = _sliced_to_array($e02a7d9cb1dc128c$export$c74125a8e3af6bb2($d7bdfb9eb0fdf311$var$GROUP_NAME), 3), $d7bdfb9eb0fdf311$var$Collection = _$e02a7d9cb1dc128c$export$c74125a8e3af6bb2[0], $d7bdfb9eb0fdf311$var$useCollection = _$e02a7d9cb1dc128c$export$c74125a8e3af6bb2[1], $d7bdfb9eb0fdf311$var$createCollectionScope = _$e02a7d9cb1dc128c$export$c74125a8e3af6bb2[2];
var _$c512c27ab02ef895$export$50c7b4e9d9f19c1 = _sliced_to_array($c512c27ab02ef895$export$50c7b4e9d9f19c1($d7bdfb9eb0fdf311$var$GROUP_NAME, [
    $d7bdfb9eb0fdf311$var$createCollectionScope
]), 2), $d7bdfb9eb0fdf311$var$createRovingFocusGroupContext = _$c512c27ab02ef895$export$50c7b4e9d9f19c1[0], $d7bdfb9eb0fdf311$export$c7109489551a4f4 = _$c512c27ab02ef895$export$50c7b4e9d9f19c1[1];
var _$d7bdfb9eb0fdf311$var$createRovingFocusGroupContext = _sliced_to_array($d7bdfb9eb0fdf311$var$createRovingFocusGroupContext($d7bdfb9eb0fdf311$var$GROUP_NAME), 2), $d7bdfb9eb0fdf311$var$RovingFocusProvider = _$d7bdfb9eb0fdf311$var$createRovingFocusGroupContext[0], $d7bdfb9eb0fdf311$var$useRovingFocusContext = _$d7bdfb9eb0fdf311$var$createRovingFocusGroupContext[1];
var $d7bdfb9eb0fdf311$export$8699f7c8af148338 = /* @__PURE__ */ (0, import_react10.forwardRef)(function(props, forwardedRef) {
    return /* @__PURE__ */ (0, import_react10.createElement)($d7bdfb9eb0fdf311$var$Collection.Provider, {
        scope: props.__scopeRovingFocusGroup
    }, /* @__PURE__ */ (0, import_react10.createElement)($d7bdfb9eb0fdf311$var$Collection.Slot, {
        scope: props.__scopeRovingFocusGroup
    }, /* @__PURE__ */ (0, import_react10.createElement)($d7bdfb9eb0fdf311$var$RovingFocusGroupImpl, _extends({}, props, {
        ref: forwardedRef
    }))));
});
var $d7bdfb9eb0fdf311$var$RovingFocusGroupImpl = /* @__PURE__ */ (0, import_react10.forwardRef)(function(props, forwardedRef) {
    var __scopeRovingFocusGroup = props.__scopeRovingFocusGroup, orientation = props.orientation, _props_loop = props.loop, loop = _props_loop === void 0 ? false : _props_loop, dir = props.dir, currentTabStopIdProp = props.currentTabStopId, defaultCurrentTabStopId = props.defaultCurrentTabStopId, onCurrentTabStopIdChange = props.onCurrentTabStopIdChange, onEntryFocus = props.onEntryFocus, groupProps = _object_without_properties(props, [
        "__scopeRovingFocusGroup",
        "orientation",
        "loop",
        "dir",
        "currentTabStopId",
        "defaultCurrentTabStopId",
        "onCurrentTabStopIdChange",
        "onEntryFocus"
    ]);
    var ref = (0, import_react10.useRef)(null);
    var composedRefs = $6ed0406888f73fc4$export$c7b2cbe3552a0d05(forwardedRef, ref);
    var direction = $f631663db3294ace$export$b39126d51d94e6f3(dir);
    var _$71cd76cc60e0454e$export$6f32135080cb4c3 = _sliced_to_array($71cd76cc60e0454e$export$6f32135080cb4c3({
        prop: currentTabStopIdProp,
        defaultProp: defaultCurrentTabStopId,
        onChange: onCurrentTabStopIdChange
    }), 2), tmp = _$71cd76cc60e0454e$export$6f32135080cb4c3[0], currentTabStopId = tmp === void 0 ? null : tmp, setCurrentTabStopId = _$71cd76cc60e0454e$export$6f32135080cb4c3[1];
    var _ref = _sliced_to_array((0, import_react10.useState)(false), 2), isTabbingBackOut = _ref[0], setIsTabbingBackOut = _ref[1];
    var handleEntryFocus = $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(onEntryFocus);
    var getItems = $d7bdfb9eb0fdf311$var$useCollection(__scopeRovingFocusGroup);
    var isClickFocusRef = (0, import_react10.useRef)(false);
    var _ref1 = _sliced_to_array((0, import_react10.useState)(0), 2), focusableItemsCount = _ref1[0], setFocusableItemsCount = _ref1[1];
    (0, import_react10.useEffect)(function() {
        var node = ref.current;
        if (node) {
            node.addEventListener($d7bdfb9eb0fdf311$var$ENTRY_FOCUS, handleEntryFocus);
            return function() {
                return node.removeEventListener($d7bdfb9eb0fdf311$var$ENTRY_FOCUS, handleEntryFocus);
            };
        }
    }, [
        handleEntryFocus
    ]);
    return /* @__PURE__ */ (0, import_react10.createElement)($d7bdfb9eb0fdf311$var$RovingFocusProvider, {
        scope: __scopeRovingFocusGroup,
        orientation: orientation,
        dir: direction,
        loop: loop,
        currentTabStopId: currentTabStopId,
        onItemFocus: (0, import_react10.useCallback)(function(tabStopId) {
            return setCurrentTabStopId(tabStopId);
        }, [
            setCurrentTabStopId
        ]),
        onItemShiftTab: (0, import_react10.useCallback)(function() {
            return setIsTabbingBackOut(true);
        }, []),
        onFocusableItemAdd: (0, import_react10.useCallback)(function() {
            return setFocusableItemsCount(function(prevCount) {
                return prevCount + 1;
            });
        }, []),
        onFocusableItemRemove: (0, import_react10.useCallback)(function() {
            return setFocusableItemsCount(function(prevCount) {
                return prevCount - 1;
            });
        }, [])
    }, /* @__PURE__ */ (0, import_react10.createElement)($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({
        tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0,
        "data-orientation": orientation
    }, groupProps, {
        ref: composedRefs,
        style: _object_spread({
            outline: "none"
        }, props.style),
        onMouseDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onMouseDown, function() {
            isClickFocusRef.current = true;
        }),
        onFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocus, function(event) {
            var isKeyboardFocus = !isClickFocusRef.current;
            if (event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut) {
                var entryFocusEvent = new CustomEvent($d7bdfb9eb0fdf311$var$ENTRY_FOCUS, $d7bdfb9eb0fdf311$var$EVENT_OPTIONS);
                event.currentTarget.dispatchEvent(entryFocusEvent);
                if (!entryFocusEvent.defaultPrevented) {
                    var items = getItems().filter(function(item) {
                        return item.focusable;
                    });
                    var activeItem = items.find(function(item) {
                        return item.active;
                    });
                    var currentItem = items.find(function(item) {
                        return item.id === currentTabStopId;
                    });
                    var candidateItems = [
                        activeItem,
                        currentItem
                    ].concat(_to_consumable_array(items)).filter(Boolean);
                    var candidateNodes = candidateItems.map(function(item) {
                        return item.ref.current;
                    });
                    $d7bdfb9eb0fdf311$var$focusFirst(candidateNodes);
                }
            }
            isClickFocusRef.current = false;
        }),
        onBlur: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onBlur, function() {
            return setIsTabbingBackOut(false);
        })
    })));
});
var $d7bdfb9eb0fdf311$var$ITEM_NAME = "RovingFocusGroupItem";
var $d7bdfb9eb0fdf311$export$ab9df7c53fe8454 = /* @__PURE__ */ (0, import_react10.forwardRef)(function(props, forwardedRef) {
    var __scopeRovingFocusGroup = props.__scopeRovingFocusGroup, _props_focusable = props.focusable, focusable = _props_focusable === void 0 ? true : _props_focusable, _props_active = props.active, active = _props_active === void 0 ? false : _props_active, tabStopId = props.tabStopId, itemProps = _object_without_properties(props, [
        "__scopeRovingFocusGroup",
        "focusable",
        "active",
        "tabStopId"
    ]);
    var autoId = $1746a345f3d73bb7$export$f680877a34711e37();
    var id = tabStopId || autoId;
    var context = $d7bdfb9eb0fdf311$var$useRovingFocusContext($d7bdfb9eb0fdf311$var$ITEM_NAME, __scopeRovingFocusGroup);
    var isCurrentTabStop = context.currentTabStopId === id;
    var getItems = $d7bdfb9eb0fdf311$var$useCollection(__scopeRovingFocusGroup);
    var onFocusableItemAdd = context.onFocusableItemAdd, onFocusableItemRemove = context.onFocusableItemRemove;
    (0, import_react10.useEffect)(function() {
        if (focusable) {
            onFocusableItemAdd();
            return function() {
                return onFocusableItemRemove();
            };
        }
    }, [
        focusable,
        onFocusableItemAdd,
        onFocusableItemRemove
    ]);
    return /* @__PURE__ */ (0, import_react10.createElement)($d7bdfb9eb0fdf311$var$Collection.ItemSlot, {
        scope: __scopeRovingFocusGroup,
        id: id,
        focusable: focusable,
        active: active
    }, /* @__PURE__ */ (0, import_react10.createElement)($8927f6f2acc4f386$export$250ffa63cdc0d034.span, _extends({
        tabIndex: isCurrentTabStop ? 0 : -1,
        "data-orientation": context.orientation
    }, itemProps, {
        ref: forwardedRef,
        onMouseDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onMouseDown, function(event) {
            if (!focusable) event.preventDefault();
            else context.onItemFocus(id);
        }),
        onFocus: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onFocus, function() {
            return context.onItemFocus(id);
        }),
        onKeyDown: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onKeyDown, function(event) {
            if (event.key === "Tab" && event.shiftKey) {
                context.onItemShiftTab();
                return;
            }
            if (event.target !== event.currentTarget) return;
            var focusIntent = $d7bdfb9eb0fdf311$var$getFocusIntent(event, context.orientation, context.dir);
            if (focusIntent !== void 0) {
                event.preventDefault();
                var items = getItems().filter(function(item) {
                    return item.focusable;
                });
                var candidateNodes = items.map(function(item) {
                    return item.ref.current;
                });
                if (focusIntent === "last") candidateNodes.reverse();
                else if (focusIntent === "prev" || focusIntent === "next") {
                    if (focusIntent === "prev") candidateNodes.reverse();
                    var currentIndex = candidateNodes.indexOf(event.currentTarget);
                    candidateNodes = context.loop ? $d7bdfb9eb0fdf311$var$wrapArray(candidateNodes, currentIndex + 1) : candidateNodes.slice(currentIndex + 1);
                }
                setTimeout(function() {
                    return $d7bdfb9eb0fdf311$var$focusFirst(candidateNodes);
                });
            }
        })
    })));
});
var $d7bdfb9eb0fdf311$var$MAP_KEY_TO_FOCUS_INTENT = {
    ArrowLeft: "prev",
    ArrowUp: "prev",
    ArrowRight: "next",
    ArrowDown: "next",
    PageUp: "first",
    Home: "first",
    PageDown: "last",
    End: "last"
};
function $d7bdfb9eb0fdf311$var$getDirectionAwareKey(key, dir) {
    if (dir !== "rtl") return key;
    return key === "ArrowLeft" ? "ArrowRight" : key === "ArrowRight" ? "ArrowLeft" : key;
}
function $d7bdfb9eb0fdf311$var$getFocusIntent(event, orientation, dir) {
    var key = $d7bdfb9eb0fdf311$var$getDirectionAwareKey(event.key, dir);
    if (orientation === "vertical" && [
        "ArrowLeft",
        "ArrowRight"
    ].includes(key)) return void 0;
    if (orientation === "horizontal" && [
        "ArrowUp",
        "ArrowDown"
    ].includes(key)) return void 0;
    return $d7bdfb9eb0fdf311$var$MAP_KEY_TO_FOCUS_INTENT[key];
}
function $d7bdfb9eb0fdf311$var$focusFirst(candidates) {
    var PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;
    var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
    try {
        for(var _iterator = candidates[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
            var candidate = _step.value;
            if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;
            candidate.focus();
            if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;
        }
    } catch (err) {
        _didIteratorError = true;
        _iteratorError = err;
    } finally{
        try {
            if (!_iteratorNormalCompletion && _iterator.return != null) {
                _iterator.return();
            }
        } finally{
            if (_didIteratorError) {
                throw _iteratorError;
            }
        }
    }
}
function $d7bdfb9eb0fdf311$var$wrapArray(array, startIndex) {
    return array.map(function(_, index) {
        return array[(startIndex + index) % array.length];
    });
}
var $d7bdfb9eb0fdf311$export$be92b6f5f03c0fe9 = $d7bdfb9eb0fdf311$export$8699f7c8af148338;
var $d7bdfb9eb0fdf311$export$6d08773d2e66f8f2 = $d7bdfb9eb0fdf311$export$ab9df7c53fe8454;
// ../../node_modules/.pnpm/@radix-ui+react-toggle@1.0.3_@types+react-dom@18.2.22_@types+react@18.2.65_react-dom@18.2.0_react@18.2.0/node_modules/@radix-ui/react-toggle/dist/index.mjs
var import_react11 = require("react");
var $b3bbe2732c13b576$export$bea8ebba691c5813 = /* @__PURE__ */ (0, import_react11.forwardRef)(function(props, forwardedRef) {
    var pressedProp = props.pressed, _props_defaultPressed = props.defaultPressed, defaultPressed = _props_defaultPressed === void 0 ? false : _props_defaultPressed, onPressedChange = props.onPressedChange, buttonProps = _object_without_properties(props, [
        "pressed",
        "defaultPressed",
        "onPressedChange"
    ]);
    var _$71cd76cc60e0454e$export$6f32135080cb4c3 = _sliced_to_array($71cd76cc60e0454e$export$6f32135080cb4c3({
        prop: pressedProp,
        onChange: onPressedChange,
        defaultProp: defaultPressed
    }), 2), tmp = _$71cd76cc60e0454e$export$6f32135080cb4c3[0], pressed = tmp === void 0 ? false : tmp, setPressed = _$71cd76cc60e0454e$export$6f32135080cb4c3[1];
    return /* @__PURE__ */ (0, import_react11.createElement)($8927f6f2acc4f386$export$250ffa63cdc0d034.button, _extends({
        type: "button",
        "aria-pressed": pressed,
        "data-state": pressed ? "on" : "off",
        "data-disabled": props.disabled ? "" : void 0
    }, buttonProps, {
        ref: forwardedRef,
        onClick: $e42e1063c40fb3ef$export$b9ecd428b558ff10(props.onClick, function() {
            if (!props.disabled) setPressed(!pressed);
        })
    }));
});
var $b3bbe2732c13b576$export$be92b6f5f03c0fe9 = $b3bbe2732c13b576$export$bea8ebba691c5813;
// ../../node_modules/.pnpm/@radix-ui+react-toggle-group@1.0.4_@types+react-dom@18.2.22_@types+react@18.2.65_react-dom@18.2.0_react@18.2.0/node_modules/@radix-ui/react-toggle-group/dist/index.mjs
var $6c1fd9e6a8969628$var$TOGGLE_GROUP_NAME = "ToggleGroup";
var _$c512c27ab02ef895$export$50c7b4e9d9f19c11 = _sliced_to_array($c512c27ab02ef895$export$50c7b4e9d9f19c1($6c1fd9e6a8969628$var$TOGGLE_GROUP_NAME, [
    $d7bdfb9eb0fdf311$export$c7109489551a4f4
]), 2), $6c1fd9e6a8969628$var$createToggleGroupContext = _$c512c27ab02ef895$export$50c7b4e9d9f19c11[0], $6c1fd9e6a8969628$export$d1c7c4bcd9f26dd4 = _$c512c27ab02ef895$export$50c7b4e9d9f19c11[1];
var $6c1fd9e6a8969628$var$useRovingFocusGroupScope = $d7bdfb9eb0fdf311$export$c7109489551a4f4();
var $6c1fd9e6a8969628$export$af3ec21f6cfb5e30 = /* @__PURE__ */ import_react12.default.forwardRef(function(props, forwardedRef) {
    var type = props.type, toggleGroupProps = _object_without_properties(props, [
        "type"
    ]);
    if (type === "single") {
        var singleProps = toggleGroupProps;
        return /* @__PURE__ */ import_react12.default.createElement($6c1fd9e6a8969628$var$ToggleGroupImplSingle, _extends({}, singleProps, {
            ref: forwardedRef
        }));
    }
    if (type === "multiple") {
        var multipleProps = toggleGroupProps;
        return /* @__PURE__ */ import_react12.default.createElement($6c1fd9e6a8969628$var$ToggleGroupImplMultiple, _extends({}, multipleProps, {
            ref: forwardedRef
        }));
    }
    throw new Error("Missing prop `type` expected on `".concat($6c1fd9e6a8969628$var$TOGGLE_GROUP_NAME, "`"));
});
var _$6c1fd9e6a8969628$var$createToggleGroupContext = _sliced_to_array($6c1fd9e6a8969628$var$createToggleGroupContext($6c1fd9e6a8969628$var$TOGGLE_GROUP_NAME), 2), $6c1fd9e6a8969628$var$ToggleGroupValueProvider = _$6c1fd9e6a8969628$var$createToggleGroupContext[0], $6c1fd9e6a8969628$var$useToggleGroupValueContext = _$6c1fd9e6a8969628$var$createToggleGroupContext[1];
var $6c1fd9e6a8969628$var$ToggleGroupImplSingle = /* @__PURE__ */ import_react12.default.forwardRef(function(props, forwardedRef) {
    var valueProp = props.value, defaultValue = props.defaultValue, _props_onValueChange = props.onValueChange, onValueChange = _props_onValueChange === void 0 ? function() {} : _props_onValueChange, toggleGroupSingleProps = _object_without_properties(props, [
        "value",
        "defaultValue",
        "onValueChange"
    ]);
    var _$71cd76cc60e0454e$export$6f32135080cb4c3 = _sliced_to_array($71cd76cc60e0454e$export$6f32135080cb4c3({
        prop: valueProp,
        defaultProp: defaultValue,
        onChange: onValueChange
    }), 2), value = _$71cd76cc60e0454e$export$6f32135080cb4c3[0], setValue = _$71cd76cc60e0454e$export$6f32135080cb4c3[1];
    return /* @__PURE__ */ import_react12.default.createElement($6c1fd9e6a8969628$var$ToggleGroupValueProvider, {
        scope: props.__scopeToggleGroup,
        type: "single",
        value: value ? [
            value
        ] : [],
        onItemActivate: setValue,
        onItemDeactivate: import_react12.default.useCallback(function() {
            return setValue("");
        }, [
            setValue
        ])
    }, /* @__PURE__ */ import_react12.default.createElement($6c1fd9e6a8969628$var$ToggleGroupImpl, _extends({}, toggleGroupSingleProps, {
        ref: forwardedRef
    })));
});
var $6c1fd9e6a8969628$var$ToggleGroupImplMultiple = /* @__PURE__ */ import_react12.default.forwardRef(function(props, forwardedRef) {
    var valueProp = props.value, defaultValue = props.defaultValue, _props_onValueChange = props.onValueChange, onValueChange = _props_onValueChange === void 0 ? function() {} : _props_onValueChange, toggleGroupMultipleProps = _object_without_properties(props, [
        "value",
        "defaultValue",
        "onValueChange"
    ]);
    var _$71cd76cc60e0454e$export$6f32135080cb4c3 = _sliced_to_array($71cd76cc60e0454e$export$6f32135080cb4c3({
        prop: valueProp,
        defaultProp: defaultValue,
        onChange: onValueChange
    }), 2), tmp = _$71cd76cc60e0454e$export$6f32135080cb4c3[0], value1 = tmp === void 0 ? [] : tmp, setValue = _$71cd76cc60e0454e$export$6f32135080cb4c3[1];
    var handleButtonActivate = import_react12.default.useCallback(function(itemValue) {
        return setValue(function() {
            var prevValue = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
            return _to_consumable_array(prevValue).concat([
                itemValue
            ]);
        });
    }, [
        setValue
    ]);
    var handleButtonDeactivate = import_react12.default.useCallback(function(itemValue) {
        return setValue(function() {
            var prevValue = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : [];
            return prevValue.filter(function(value) {
                return value !== itemValue;
            });
        });
    }, [
        setValue
    ]);
    return /* @__PURE__ */ import_react12.default.createElement($6c1fd9e6a8969628$var$ToggleGroupValueProvider, {
        scope: props.__scopeToggleGroup,
        type: "multiple",
        value: value1,
        onItemActivate: handleButtonActivate,
        onItemDeactivate: handleButtonDeactivate
    }, /* @__PURE__ */ import_react12.default.createElement($6c1fd9e6a8969628$var$ToggleGroupImpl, _extends({}, toggleGroupMultipleProps, {
        ref: forwardedRef
    })));
});
var _$6c1fd9e6a8969628$var$createToggleGroupContext1 = _sliced_to_array($6c1fd9e6a8969628$var$createToggleGroupContext($6c1fd9e6a8969628$var$TOGGLE_GROUP_NAME), 2), $6c1fd9e6a8969628$var$ToggleGroupContext = _$6c1fd9e6a8969628$var$createToggleGroupContext1[0], $6c1fd9e6a8969628$var$useToggleGroupContext = _$6c1fd9e6a8969628$var$createToggleGroupContext1[1];
var $6c1fd9e6a8969628$var$ToggleGroupImpl = /* @__PURE__ */ import_react12.default.forwardRef(function(props, forwardedRef) {
    var __scopeToggleGroup = props.__scopeToggleGroup, _props_disabled = props.disabled, disabled = _props_disabled === void 0 ? false : _props_disabled, _props_rovingFocus = props.rovingFocus, rovingFocus = _props_rovingFocus === void 0 ? true : _props_rovingFocus, orientation = props.orientation, dir = props.dir, _props_loop = props.loop, loop = _props_loop === void 0 ? true : _props_loop, toggleGroupProps = _object_without_properties(props, [
        "__scopeToggleGroup",
        "disabled",
        "rovingFocus",
        "orientation",
        "dir",
        "loop"
    ]);
    var rovingFocusGroupScope = $6c1fd9e6a8969628$var$useRovingFocusGroupScope(__scopeToggleGroup);
    var direction = $f631663db3294ace$export$b39126d51d94e6f3(dir);
    var commonProps = _object_spread({
        role: "group",
        dir: direction
    }, toggleGroupProps);
    return /* @__PURE__ */ import_react12.default.createElement($6c1fd9e6a8969628$var$ToggleGroupContext, {
        scope: __scopeToggleGroup,
        rovingFocus: rovingFocus,
        disabled: disabled
    }, rovingFocus ? /* @__PURE__ */ import_react12.default.createElement($d7bdfb9eb0fdf311$export$be92b6f5f03c0fe9, _extends({
        asChild: true
    }, rovingFocusGroupScope, {
        orientation: orientation,
        dir: direction,
        loop: loop
    }), /* @__PURE__ */ import_react12.default.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, commonProps, {
        ref: forwardedRef
    }))) : /* @__PURE__ */ import_react12.default.createElement($8927f6f2acc4f386$export$250ffa63cdc0d034.div, _extends({}, commonProps, {
        ref: forwardedRef
    })));
});
var $6c1fd9e6a8969628$var$ITEM_NAME = "ToggleGroupItem";
var $6c1fd9e6a8969628$export$b453109e13abe10b = /* @__PURE__ */ import_react12.default.forwardRef(function(props, forwardedRef) {
    var valueContext = $6c1fd9e6a8969628$var$useToggleGroupValueContext($6c1fd9e6a8969628$var$ITEM_NAME, props.__scopeToggleGroup);
    var context = $6c1fd9e6a8969628$var$useToggleGroupContext($6c1fd9e6a8969628$var$ITEM_NAME, props.__scopeToggleGroup);
    var rovingFocusGroupScope = $6c1fd9e6a8969628$var$useRovingFocusGroupScope(props.__scopeToggleGroup);
    var pressed = valueContext.value.includes(props.value);
    var disabled = context.disabled || props.disabled;
    var commonProps = _object_spread_props(_object_spread({}, props), {
        pressed: pressed,
        disabled: disabled
    });
    var ref = import_react12.default.useRef(null);
    return context.rovingFocus ? /* @__PURE__ */ import_react12.default.createElement($d7bdfb9eb0fdf311$export$6d08773d2e66f8f2, _extends({
        asChild: true
    }, rovingFocusGroupScope, {
        focusable: !disabled,
        active: pressed,
        ref: ref
    }), /* @__PURE__ */ import_react12.default.createElement($6c1fd9e6a8969628$var$ToggleGroupItemImpl, _extends({}, commonProps, {
        ref: forwardedRef
    }))) : /* @__PURE__ */ import_react12.default.createElement($6c1fd9e6a8969628$var$ToggleGroupItemImpl, _extends({}, commonProps, {
        ref: forwardedRef
    }));
});
var $6c1fd9e6a8969628$var$ToggleGroupItemImpl = /* @__PURE__ */ import_react12.default.forwardRef(function(props, forwardedRef) {
    var __scopeToggleGroup = props.__scopeToggleGroup, value = props.value, itemProps = _object_without_properties(props, [
        "__scopeToggleGroup",
        "value"
    ]);
    var valueContext = $6c1fd9e6a8969628$var$useToggleGroupValueContext($6c1fd9e6a8969628$var$ITEM_NAME, __scopeToggleGroup);
    var singleProps = {
        role: "radio",
        "aria-checked": props.pressed,
        "aria-pressed": void 0
    };
    var typeProps = valueContext.type === "single" ? singleProps : void 0;
    return /* @__PURE__ */ import_react12.default.createElement($b3bbe2732c13b576$export$bea8ebba691c5813, _extends({}, typeProps, itemProps, {
        ref: forwardedRef,
        onPressedChange: function(pressed) {
            if (pressed) valueContext.onItemActivate(value);
            else valueContext.onItemDeactivate(value);
        }
    }));
});
var $6c1fd9e6a8969628$export$be92b6f5f03c0fe9 = $6c1fd9e6a8969628$export$af3ec21f6cfb5e30;
var $6c1fd9e6a8969628$export$6d08773d2e66f8f2 = $6c1fd9e6a8969628$export$b453109e13abe10b;
// lib/utils.ts
var import_clsx = require("clsx");
var import_tailwind_merge = require("tailwind-merge");
function cn() {
    for(var _len = arguments.length, inputs = new Array(_len), _key = 0; _key < _len; _key++){
        inputs[_key] = arguments[_key];
    }
    return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
}
// registry/new-york/ui/toggle.tsx
var React = __toESM(require("react"));
var import_class_variance_authority = require("class-variance-authority");
var import_jsx_runtime = require("react/jsx-runtime");
var toggleVariants = (0, import_class_variance_authority.cva)("inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground", {
    variants: {
        variant: {
            default: "bg-transparent",
            outline: "border border-input bg-transparent shadow-sm hover:bg-accent hover:text-accent-foreground"
        },
        size: {
            default: "h-9 px-3",
            sm: "h-8 px-2",
            lg: "h-10 px-3"
        }
    },
    defaultVariants: {
        variant: "default",
        size: "default"
    }
});
var Toggle = React.forwardRef(function(_param, ref) {
    var className = _param.className, variant = _param.variant, size = _param.size, props = _object_without_properties(_param, [
        "className",
        "variant",
        "size"
    ]);
    return /* @__PURE__ */ (0, import_jsx_runtime.jsx)($b3bbe2732c13b576$export$be92b6f5f03c0fe9, _object_spread({
        ref: ref,
        className: cn(toggleVariants({
            variant: variant,
            size: size,
            className: className
        }))
    }, props));
});
Toggle.displayName = $b3bbe2732c13b576$export$be92b6f5f03c0fe9.displayName;
// registry/new-york/ui/toggle-group.tsx
var import_jsx_runtime2 = require("react/jsx-runtime");
var ToggleGroupContext = React2.createContext({
    size: "default",
    variant: "default"
});
var ToggleGroup = React2.forwardRef(function(_param, ref) {
    var className = _param.className, variant = _param.variant, size = _param.size, children = _param.children, props = _object_without_properties(_param, [
        "className",
        "variant",
        "size",
        "children"
    ]);
    return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)($6c1fd9e6a8969628$export$be92b6f5f03c0fe9, _object_spread_props(_object_spread({
        ref: ref,
        className: cn("flex items-center justify-center gap-1", className)
    }, props), {
        children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ToggleGroupContext.Provider, {
            value: {
                variant: variant,
                size: size
            },
            children: children
        })
    }));
});
ToggleGroup.displayName = $6c1fd9e6a8969628$export$be92b6f5f03c0fe9.displayName;
var ToggleGroupItem = React2.forwardRef(function(_param, ref) {
    var className = _param.className, children = _param.children, variant = _param.variant, size = _param.size, props = _object_without_properties(_param, [
        "className",
        "children",
        "variant",
        "size"
    ]);
    var context = React2.useContext(ToggleGroupContext);
    return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)($6c1fd9e6a8969628$export$6d08773d2e66f8f2, _object_spread_props(_object_spread({
        ref: ref,
        className: cn(toggleVariants({
            variant: context.variant || variant,
            size: context.size || size
        }), className)
    }, props), {
        children: children
    }));
});
ToggleGroupItem.displayName = $6c1fd9e6a8969628$export$6d08773d2e66f8f2.displayName;
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
    ToggleGroup: ToggleGroup,
    ToggleGroupItem: ToggleGroupItem
});
//# sourceMappingURL=toggle-group.js.map