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 _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;
}
import { ConfigProvider } from "antd";
import classNames from "clsx";
import { motion } from "framer-motion";
import React, { useContext, useEffect } from "react";
import { useStyle } from "./style";
export var ActionItemBox = function ActionItemBox(props) {
    var _props_hoverBg, _props_hoverBg1;
    var getPrefixCls = useContext(ConfigProvider.ConfigContext).getPrefixCls;
    var basePrefixCls = getPrefixCls('agentic-chat-action-item-box');
    var _useStyle = useStyle(basePrefixCls), wrapSSR = _useStyle.wrapSSR, hashId = _useStyle.hashId;
    useEffect(function() {
        var _props_onInit;
        props === null || props === void 0 ? void 0 : (_props_onInit = props.onInit) === null || _props_onInit === void 0 ? void 0 : _props_onInit.call(props);
    }, []);
    var _obj, _obj1;
    return wrapSSR(/*#__PURE__*/ React.createElement(motion.div, {
        initial: "hidden",
        animate: "visible",
        style: _object_spread({
            flex: props.size ? 'none' : 1,
            display: 'flex',
            height: 'min-content'
        }, props.style),
        variants: {
            hidden: {
                x: -10,
                opacity: 0
            },
            visible: {
                x: 0,
                opacity: 1
            }
        }
    }, /*#__PURE__*/ React.createElement("div", {
        className: classNames("".concat(basePrefixCls, "-container"), (_obj = {}, _define_property(_obj, "".concat(basePrefixCls, "-container-").concat(props.size), props.size), _define_property(_obj, "".concat(basePrefixCls, "-container-hover-bg"), (_props_hoverBg = props.hoverBg) !== null && _props_hoverBg !== void 0 ? _props_hoverBg : true), _obj), hashId)
    }, /*#__PURE__*/ React.createElement("div", {
        onClick: props.disabled ? undefined : props.onClick,
        className: classNames(basePrefixCls, hashId, (_obj1 = {}, _define_property(_obj1, "".concat(basePrefixCls, "-").concat(props.size), props.size), _define_property(_obj1, "".concat(basePrefixCls, "-has-icon"), !!props.icon && !props.compact), _define_property(_obj1, "".concat(basePrefixCls, "-standalone"), props.standalone), _define_property(_obj1, "".concat(basePrefixCls, "-compact"), props.compact), _define_property(_obj1, "".concat(basePrefixCls, "-hover-bg"), (_props_hoverBg1 = props.hoverBg) !== null && _props_hoverBg1 !== void 0 ? _props_hoverBg1 : true), _define_property(_obj1, "".concat(basePrefixCls, "-disabled"), props.disabled), _obj1))
    }, /*#__PURE__*/ React.createElement("div", {
        style: {
            display: 'flex',
            gap: props.size === 'small' ? 4 : 12,
            alignItems: 'center',
            maxWidth: '100%',
            flex: 1,
            minWidth: 0
        }
    }, props.icon && !props.compact ? /*#__PURE__*/ React.createElement("div", {
        style: {
            width: props.iconSize || 24,
            height: props.iconSize || 24,
            minWidth: props.iconSize || 24,
            minHeight: props.iconSize || 24
        },
        className: classNames("".concat(basePrefixCls, "-icon"), _define_property({}, "".concat(basePrefixCls, "-icon-").concat(props.size), props.size), hashId)
    }, props.icon.startsWith('http') ? /*#__PURE__*/ React.createElement("img", {
        src: props.icon,
        alt: "action-box-icon",
        style: {
            height: '100%',
            maxWidth: props.iconSize || 24,
            maxHeight: props.iconSize || 24
        }
    }) : /*#__PURE__*/ React.createElement("span", {
        style: {
            fontSize: 16,
            fontWeight: 500
        }
    }, props.icon)) : null, /*#__PURE__*/ React.createElement("div", {
        className: classNames("".concat(basePrefixCls, "-content"), hashId)
    }, /*#__PURE__*/ React.createElement("span", {
        className: classNames("".concat(basePrefixCls, "-content-title"), hashId, _define_property({}, "".concat(basePrefixCls, "-content-title-no-description"), !props.description))
    }, props.title), props.description && !props.compact ? /*#__PURE__*/ React.createElement("span", {
        className: classNames("".concat(basePrefixCls, "-content-description"), hashId),
        style: {
            maxWidth: "310px"
        }
    }, props.description) : null))))));
};
ActionItemBox.displayName = 'ActionItemBox';
