"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__, {
    HandleLabel: ()=>HandleLabel,
    LABEL_SHADOW_STYLE: ()=>LABEL_SHADOW_STYLE
});
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
const index_cjs_namespaceObject = require("../../layouts/index.cjs");
const react_cjs_namespaceObject = require("../../xyflow/react.cjs");
const CssUtil_cjs_namespaceObject = require("../../utils/CssUtil.cjs");
const LABEL_SHADOW_STYLE = {
    textShadow: '0 0 4px var(--canvas-background), 0 0 4px var(--canvas-background)'
};
const LABEL_POSITION = {
    [react_cjs_namespaceObject.Position.Top]: 'bottom-[calc(100%+4px)] left-1/2 -translate-x-1/2',
    [react_cjs_namespaceObject.Position.Bottom]: 'top-[calc(100%+4px)] left-1/2 -translate-x-1/2',
    [react_cjs_namespaceObject.Position.Left]: 'right-[calc(100%+4px)] top-1/2 -translate-y-1/2',
    [react_cjs_namespaceObject.Position.Right]: 'left-[calc(100%+4px)] top-1/2 -translate-y-1/2'
};
const HandleLabel = ({ position, backgroundColor, label, labelIcon, shouldTruncate })=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
        className: (0, CssUtil_cjs_namespaceObject.cx)('absolute px-1.5 py-0.5 rounded-sm z-1 whitespace-nowrap select-none', LABEL_POSITION[position], shouldTruncate && 'max-w-[50px] overflow-hidden'),
        style: backgroundColor ? {
            backgroundColor
        } : void 0,
        children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(index_cjs_namespaceObject.Row, {
            align: "center",
            gap: 4,
            children: [
                labelIcon,
                /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
                    className: (0, CssUtil_cjs_namespaceObject.cx)('text-xs font-bold text-foreground-muted', shouldTruncate && 'overflow-hidden text-ellipsis whitespace-nowrap'),
                    style: backgroundColor ? void 0 : LABEL_SHADOW_STYLE,
                    children: label
                })
            ]
        })
    });
exports.HandleLabel = __webpack_exports__.HandleLabel;
exports.LABEL_SHADOW_STYLE = __webpack_exports__.LABEL_SHADOW_STYLE;
for(var __rspack_i in __webpack_exports__)if (-1 === [
    "HandleLabel",
    "LABEL_SHADOW_STYLE"
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
Object.defineProperty(exports, '__esModule', {
    value: true
});
