"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__, {
    ModelTagChip: ()=>ModelTagChip
});
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
const CheckCircleOutline_namespaceObject = require("@mui/icons-material/CheckCircleOutline");
var CheckCircleOutline_default = /*#__PURE__*/ __webpack_require__.n(CheckCircleOutline_namespaceObject);
const PublicOff_namespaceObject = require("@mui/icons-material/PublicOff");
var PublicOff_default = /*#__PURE__*/ __webpack_require__.n(PublicOff_namespaceObject);
const Route_namespaceObject = require("@mui/icons-material/Route");
var Route_default = /*#__PURE__*/ __webpack_require__.n(Route_namespaceObject);
const ScienceOutlined_namespaceObject = require("@mui/icons-material/ScienceOutlined");
var ScienceOutlined_default = /*#__PURE__*/ __webpack_require__.n(ScienceOutlined_namespaceObject);
const WarningAmberOutlined_namespaceObject = require("@mui/icons-material/WarningAmberOutlined");
var WarningAmberOutlined_default = /*#__PURE__*/ __webpack_require__.n(WarningAmberOutlined_namespaceObject);
const Chip_namespaceObject = require("@mui/material/Chip");
var Chip_default = /*#__PURE__*/ __webpack_require__.n(Chip_namespaceObject);
const Tooltip_namespaceObject = require("@mui/material/Tooltip");
var Tooltip_default = /*#__PURE__*/ __webpack_require__.n(Tooltip_namespaceObject);
const VARIANT_MAP = {
    recommended: 'success-mini',
    preview: 'info-mini',
    deprecating: 'warning-mini',
    substituted: 'warning-mini',
    'out-of-region': 'error-mini',
    custom: 'mini',
    thinking: 'info-mini',
    'cost-basic': 'mini',
    'cost-standard': 'mini',
    'cost-premium': 'mini'
};
const MINI_COLORS = {
    mini: {
        color: 'var(--color-foreground, #273139)',
        backgroundColor: 'var(--color-background-secondary, #f4f5f7)'
    },
    'info-mini': {
        color: 'var(--color-info-foreground, #1665b3)',
        backgroundColor: 'var(--color-info-background, #e9f1fa)'
    },
    'success-mini': {
        color: 'var(--color-success-text, #038108)',
        backgroundColor: 'var(--color-success-background, #eeffe5)'
    },
    'warning-mini': {
        color: 'var(--color-warning-text, #9e6100)',
        backgroundColor: 'var(--color-warning-background, #fff3db)'
    },
    'error-mini': {
        color: 'var(--color-error-text, #a6040a)',
        backgroundColor: 'var(--color-error-background, #fff0f1)'
    }
};
const ICON_MAP = {
    recommended: CheckCircleOutline_default(),
    preview: ScienceOutlined_default(),
    deprecating: WarningAmberOutlined_default(),
    substituted: Route_default(),
    'out-of-region': PublicOff_default()
};
const ModelTagChip = ({ tag, variants, icons })=>{
    const variantClass = tag.variant ?? variants?.[tag.kind] ?? VARIANT_MAP[tag.kind] ?? 'mini';
    const Icon = icons && tag.kind in icons ? icons[tag.kind] : ICON_MAP[tag.kind];
    const colors = MINI_COLORS[variantClass] ?? MINI_COLORS['mini'];
    const chip = /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Chip_default(), {
        size: "small",
        label: tag.label,
        className: variantClass,
        icon: Icon ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Icon, {
            fontSize: "inherit"
        }) : void 0,
        sx: {
            height: '16px',
            paddingLeft: 0,
            paddingRight: 0,
            fontSize: '10px',
            lineHeight: '16px',
            fontWeight: 600,
            ...colors,
            '& .MuiChip-label': {
                px: 0.75
            },
            '& .MuiChip-icon': {
                fontSize: 13,
                marginLeft: 0.5,
                marginRight: -0.25,
                color: 'inherit'
            }
        }
    });
    if (tag.tooltip) return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Tooltip_default(), {
        title: tag.tooltip,
        arrow: true,
        placement: "top",
        children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
            children: chip
        })
    });
    return chip;
};
exports.ModelTagChip = __webpack_exports__.ModelTagChip;
for(var __rspack_i in __webpack_exports__)if (-1 === [
    "ModelTagChip"
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
Object.defineProperty(exports, '__esModule', {
    value: true
});
