"use strict";
var __webpack_require__ = {};
(()=>{
    __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__, {
    ToolResourceIcon: ()=>ToolResourceIcon
});
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
const index_cjs_namespaceObject = require("../../../../icons/index.cjs");
const external_react_namespaceObject = require("react");
const external_types_cjs_namespaceObject = require("../../../../types.cjs");
const external_AddDataColumnIcon_cjs_namespaceObject = require("./AddDataColumnIcon.cjs");
const external_AnalyzeIcon_cjs_namespaceObject = require("./AnalyzeIcon.cjs");
const external_AttachmentIcon_cjs_namespaceObject = require("./AttachmentIcon.cjs");
const external_IXPIcon_cjs_namespaceObject = require("./IXPIcon.cjs");
const external_ProcessIcon_cjs_namespaceObject = require("./ProcessIcon.cjs");
const ToolResourceIcon = ({ size = 24, tool })=>{
    const [imgError, setImgError] = (0, external_react_namespaceObject.useState)(false);
    if (tool.iconUrl && !imgError) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("img", {
        src: tool.iconUrl,
        alt: tool.name,
        style: {
            width: size,
            height: size,
            objectFit: 'contain'
        },
        onError: ()=>setImgError(true)
    });
    switch(tool.projectType){
        case external_types_cjs_namespaceObject.ProjectType.Agent:
            return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_cjs_namespaceObject.AgentIcon, {
                w: size,
                h: size
            });
        case external_types_cjs_namespaceObject.ProjectType.Api:
            return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_cjs_namespaceObject.ApiProject, {
                w: size,
                h: size
            });
        case external_types_cjs_namespaceObject.ProjectType.IXP:
            return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_IXPIcon_cjs_namespaceObject.IxpIcon, {});
        case external_types_cjs_namespaceObject.ProjectType.Internal:
            switch(tool.toolType){
                case external_types_cjs_namespaceObject.BuiltInToolType.AnalyzeAttachments:
                    return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_AttachmentIcon_cjs_namespaceObject.AttachmentIcon, {});
                case external_types_cjs_namespaceObject.BuiltInToolType.BatchTransform:
                    return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_AddDataColumnIcon_cjs_namespaceObject.AddDataColumnIcon, {});
                case external_types_cjs_namespaceObject.BuiltInToolType.DeepRAG:
                    return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_AnalyzeIcon_cjs_namespaceObject.AnalyzeIcon, {});
                case external_types_cjs_namespaceObject.BuiltInToolType.LoadAttachments:
                    return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_AttachmentIcon_cjs_namespaceObject.AttachmentIcon, {});
                default:
                    return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_ProcessIcon_cjs_namespaceObject.ProcessIcon, {});
            }
        default:
            return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_ProcessIcon_cjs_namespaceObject.ProcessIcon, {});
    }
};
exports.ToolResourceIcon = __webpack_exports__.ToolResourceIcon;
for(var __rspack_i in __webpack_exports__)if (-1 === [
    "ToolResourceIcon"
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
Object.defineProperty(exports, '__esModule', {
    value: true
});
