"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__, {
    ProbeResizeHandles: ()=>ProbeResizeHandles
});
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
const external_useDragSession_cjs_namespaceObject = require("./useDragSession.cjs");
const HANDLES = [
    {
        edges: {
            top: true,
            left: true
        },
        style: {
            top: -4,
            left: -4
        },
        cursor: 'nwse-resize'
    },
    {
        edges: {
            top: true,
            right: true
        },
        style: {
            top: -4,
            right: -4
        },
        cursor: 'nesw-resize'
    },
    {
        edges: {
            bottom: true,
            right: true
        },
        style: {
            bottom: -4,
            right: -4
        },
        cursor: 'nwse-resize'
    },
    {
        edges: {
            bottom: true,
            left: true
        },
        style: {
            bottom: -4,
            left: -4
        },
        cursor: 'nesw-resize'
    }
];
function ProbeResizeHandles({ active, onResizeStart, onResize, onResizeEnd }) {
    return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
        "aria-hidden": true,
        className: `pointer-events-none absolute inset-0 transition-opacity duration-100 ${active ? 'opacity-100' : 'opacity-0'}`,
        children: [
            /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
                className: "absolute inset-0 rounded-[20px] outline outline-2 outline-foreground-accent-muted"
            }),
            HANDLES.map((h, i)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(ResizeHandle, {
                    edges: h.edges,
                    style: h.style,
                    cursor: h.cursor,
                    onResizeStart: onResizeStart,
                    onResize: onResize,
                    onResizeEnd: onResizeEnd
                }, i))
        ]
    });
}
function ResizeHandle({ edges, style, cursor, onResizeStart, onResize, onResizeEnd }) {
    const handleMouseDown = (0, external_useDragSession_cjs_namespaceObject.useDragSession)({
        onStart: onResizeStart,
        onMove: (delta)=>onResize(delta, edges),
        onEnd: onResizeEnd
    });
    return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
        onMouseDown: handleMouseDown,
        style: {
            ...style,
            cursor,
            position: 'absolute'
        },
        className: "pointer-events-auto h-2 w-2 rounded-full bg-brand"
    });
}
exports.ProbeResizeHandles = __webpack_exports__.ProbeResizeHandles;
for(var __rspack_i in __webpack_exports__)if (-1 === [
    "ProbeResizeHandles"
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
Object.defineProperty(exports, '__esModule', {
    value: true
});
