"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__, {
    ApChip: ()=>ApChip
});
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
const Close_namespaceObject = require("@mui/icons-material/Close");
var Close_default = /*#__PURE__*/ __webpack_require__.n(Close_namespaceObject);
const material_namespaceObject = require("@mui/material");
const styles_namespaceObject = require("@mui/material/styles");
const apollo_core_namespaceObject = require("@uipath/apollo-core");
var apollo_core_default = /*#__PURE__*/ __webpack_require__.n(apollo_core_namespaceObject);
const external_react_namespaceObject = require("react");
var external_react_default = /*#__PURE__*/ __webpack_require__.n(external_react_namespaceObject);
const StyledChip = (0, styles_namespaceObject.styled)(material_namespaceObject.Chip, {
    shouldForwardProp: (prop)=>'error' !== prop && 'loading' !== prop
})(({ error })=>({
        backgroundColor: 'var(--color-background-gray)',
        borderRadius: '1000px',
        boxSizing: 'border-box',
        color: 'var(--color-foreground)',
        fontWeight: apollo_core_default().FontFamily.FontWeightDefault,
        gap: apollo_core_default().Spacing.SpacingXs,
        height: apollo_core_default().Spacing.SpacingXl,
        outline: 'none',
        paddingLeft: apollo_core_default().Spacing.SpacingS,
        paddingRight: apollo_core_default().Spacing.SpacingS,
        cursor: 'default',
        '.MuiChip-label': {
            padding: 0
        },
        '.MuiChip-deleteIcon': {
            margin: 0,
            color: 'inherit',
            '&:hover': {
                color: 'inherit'
            }
        },
        ':hover': {
            backgroundColor: 'var(--color-background-hover)'
        },
        ':focus-visible:not(.Mui-disabled)': {
            backgroundColor: 'var(--color-background-gray)',
            outline: `${apollo_core_default().Border.BorderThickS} solid var(--color-focus-indicator)`,
            outlineOffset: apollo_core_default().Spacing.SpacingMicro
        },
        '&.Mui-disabled': {
            outline: 'none !important',
            backgroundColor: 'var(--color-background-disabled)',
            color: 'var(--color-foreground-light)',
            opacity: 1
        },
        ...error && {
            backgroundColor: 'var(--color-error-background) !important',
            color: 'var(--color-foreground) !important',
            fontWeight: apollo_core_default().FontFamily.FontWeightDefault,
            ':after': {
                content: '""',
                borderRadius: 'inherit',
                position: 'absolute',
                inset: '0px',
                boxSizing: 'border-box',
                border: `${apollo_core_default().Border.BorderThickS} solid var(--color-error-text)`,
                pointerEvents: 'none'
            }
        }
    }));
const LoadingSpinner = (0, styles_namespaceObject.styled)(material_namespaceObject.CircularProgress)({
    width: `${apollo_core_default().Spacing.SpacingM} !important`,
    height: `${apollo_core_default().Spacing.SpacingM} !important`,
    color: 'inherit'
});
const ApChip = /*#__PURE__*/ external_react_default().forwardRef(({ loading, disabled, tooltip, debugForceOpen = false, error, label, onDelete, ...restProps }, ref)=>{
    const shouldDisable = disabled || loading;
    const deleteIcon = loading ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(LoadingSpinner, {}) : onDelete ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Close_default(), {
        fontSize: "small"
    }) : void 0;
    const chip = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(StyledChip, {
        ref: ref,
        label: label,
        deleteIcon: deleteIcon,
        onDelete: onDelete,
        disabled: shouldDisable,
        error: error,
        loading: loading,
        ...shouldDisable && {
            tabIndex: -1
        },
        ...restProps
    });
    if (tooltip && tooltip.length > 0) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(material_namespaceObject.Tooltip, {
        title: tooltip,
        placement: "top",
        open: debugForceOpen ? true : void 0,
        arrow: true,
        children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
            children: chip
        })
    });
    return chip;
});
ApChip.displayName = 'ApChip';
exports.ApChip = __webpack_exports__.ApChip;
for(var __rspack_i in __webpack_exports__)if (-1 === [
    "ApChip"
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
Object.defineProperty(exports, '__esModule', {
    value: true
});
