"use strict";
var __webpack_require__ = {};
(()=>{
    __webpack_require__.n = (module)=>{
        var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
        __webpack_require__.d(getter, {
            a: getter
        });
        return getter;
    };
})();
(()=>{
    __webpack_require__.d = (exports1, definition)=>{
        for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
            enumerable: true,
            get: definition[key]
        });
    };
})();
(()=>{
    __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
})();
(()=>{
    __webpack_require__.r = (exports1)=>{
        if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
            value: 'Module'
        });
        Object.defineProperty(exports1, '__esModule', {
            value: true
        });
    };
})();
var __webpack_exports__ = {};
__webpack_require__.r(__webpack_exports__);
__webpack_require__.d(__webpack_exports__, {
    GroupHeader: ()=>GroupHeader
});
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
const KeyboardArrowRight_namespaceObject = require("@mui/icons-material/KeyboardArrowRight");
var KeyboardArrowRight_default = /*#__PURE__*/ __webpack_require__.n(KeyboardArrowRight_namespaceObject);
const Box_namespaceObject = require("@mui/material/Box");
var Box_default = /*#__PURE__*/ __webpack_require__.n(Box_namespaceObject);
const ButtonBase_namespaceObject = require("@mui/material/ButtonBase");
var ButtonBase_default = /*#__PURE__*/ __webpack_require__.n(ButtonBase_namespaceObject);
const Typography_namespaceObject = require("@mui/material/Typography");
var Typography_default = /*#__PURE__*/ __webpack_require__.n(Typography_namespaceObject);
const apollo_core_namespaceObject = require("@uipath/apollo-core");
const GroupHeader = ({ label, hint, count, countLabel, dense, isFirst, leadingIcon, collapsible, collapsed, onToggle, 'data-testid': dataTestId })=>{
    const resolvedCountLabel = countLabel ?? (null != count ? `${count} ${1 === count ? 'model' : 'models'}` : null);
    const content = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(jsx_runtime_namespaceObject.Fragment, {
        children: [
            leadingIcon && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Box_default(), {
                "aria-hidden": true,
                sx: {
                    display: 'flex',
                    alignItems: 'center',
                    color: `var(--color-foreground-de-emp, ${apollo_core_namespaceObject.Colors.ColorGray550})`,
                    mr: 0.25
                },
                children: leadingIcon
            }),
            /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Typography_default(), {
                variant: "overline",
                sx: {
                    fontSize: dense ? 9 : 11,
                    fontWeight: 700,
                    color: `var(--color-foreground-de-emp, ${apollo_core_namespaceObject.Colors.ColorGray550})`,
                    letterSpacing: 0.7,
                    lineHeight: 1.2,
                    display: 'block',
                    flex: '1 1 auto'
                },
                children: label
            }),
            null != resolvedCountLabel && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Typography_default(), {
                variant: "caption",
                sx: {
                    color: `var(--color-foreground-disable, ${apollo_core_namespaceObject.Colors.ColorGray500})`,
                    fontSize: dense ? 10 : 11,
                    fontWeight: 400,
                    flexShrink: 0
                },
                children: resolvedCountLabel
            }),
            collapsible && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(KeyboardArrowRight_default(), {
                "aria-hidden": true,
                sx: {
                    fontSize: 18,
                    color: `var(--color-foreground-de-emp, ${apollo_core_namespaceObject.Colors.ColorGray550})`,
                    transition: 'transform 150ms',
                    transform: collapsed ? 'rotate(0deg)' : 'rotate(90deg)',
                    flexShrink: 0
                }
            })
        ]
    });
    const baseSx = {
        width: '100%',
        px: dense ? 1.5 : 1.75,
        pt: isFirst ? dense ? 0.75 : 1.5 : dense ? 1.25 : 1.75,
        pb: dense ? 0.5 : 0.875,
        backgroundColor: `var(--color-background-secondary, ${apollo_core_namespaceObject.Colors.ColorGray150})`,
        borderTop: isFirst ? 'none' : `1px solid var(--color-border-grid, ${apollo_core_namespaceObject.Colors.ColorGray150})`,
        display: 'flex',
        alignItems: 'center',
        gap: 1,
        textAlign: 'left'
    };
    if (collapsible) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(ButtonBase_default(), {
        component: "div",
        role: "button",
        title: hint,
        "data-testid": dataTestId,
        onClick: onToggle,
        "aria-expanded": !collapsed,
        sx: {
            ...baseSx,
            cursor: 'pointer',
            '&:hover': {
                backgroundColor: "var(--color-background-hover, rgba(82, 96, 105, 0.078))"
            }
        },
        children: content
    });
    return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Box_default(), {
        title: hint,
        role: "presentation",
        "data-testid": dataTestId,
        sx: baseSx,
        children: content
    });
};
exports.GroupHeader = __webpack_exports__.GroupHeader;
for(var __rspack_i in __webpack_exports__)if (-1 === [
    "GroupHeader"
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
Object.defineProperty(exports, '__esModule', {
    value: true
});
