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;
}
function ownKeys(object, enumerableOnly) {
    var keys = Object.keys(object);
    if (Object.getOwnPropertySymbols) {
        var symbols = Object.getOwnPropertySymbols(object);
        if (enumerableOnly) {
            symbols = symbols.filter(function(sym) {
                return Object.getOwnPropertyDescriptor(object, sym).enumerable;
            });
        }
        keys.push.apply(keys, symbols);
    }
    return keys;
}
function _object_spread_props(target, source) {
    source = source != null ? source : {};
    if (Object.getOwnPropertyDescriptors) {
        Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
    } else {
        ownKeys(Object(source)).forEach(function(key) {
            Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
        });
    }
    return target;
}
import React from "react";
import { debugInfo } from "../../../../Utils/debugUtils";
import { useEditorStore } from "../../store";
/**
 * Blockquote 组件 - 引用块组件
 *
 * 该组件用于渲染 Markdown 编辑器中的引用块元素。
 * 支持拖拽功能和编辑器状态管理。
 *
 * @component
 * @description 引用块组件，渲染引用内容
 * @param {ElementProps<BlockQuoteNode>} props - 组件属性
 * @param {BlockQuoteNode} props.element - 引用块节点元素
 * @param {React.ReactNode} props.children - 子组件内容
 * @param {Object} props.attributes - 元素属性
 *
 * @example
 * ```tsx
 * <Blockquote
 *   element={blockquoteNode}
 *   attributes={attributes}
 * >
 *   引用内容
 * </Blockquote>
 * ```
 *
 * @returns {React.ReactElement} 渲染的引用块组件
 *
 * @remarks
 * - 使用 HTML blockquote 元素
 * - 支持拖拽功能
 * - 集成编辑器状态管理
 * - 使用 memo 优化性能
 * - 提供 data-be 属性用于标识
 */ export function Blockquote(props) {
    var _props_element_children;
    debugInfo('Blockquote - 渲染引用块', {
        childrenCount: (_props_element_children = props.element.children) === null || _props_element_children === void 0 ? void 0 : _props_element_children.length
    });
    var _useEditorStore = useEditorStore(), store = _useEditorStore.store, markdownContainerRef = _useEditorStore.markdownContainerRef;
    return React.useMemo(function() {
        var _props_element_children;
        debugInfo('Blockquote - useMemo 渲染', {
            childrenCount: (_props_element_children = props.element.children) === null || _props_element_children === void 0 ? void 0 : _props_element_children.length
        });
        return /*#__PURE__*/ React.createElement("blockquote", _object_spread_props(_object_spread({
            "data-be": 'blockquote'
        }, props.attributes), {
            onDragStart: function(e) {
                debugInfo('Blockquote - 拖拽开始');
                store.dragStart(e, markdownContainerRef.current);
            }
        }), props.children);
    }, [
        props.element.children
    ]);
}
