"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__, {
    AgentFlow: ()=>AgentFlow
});
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
const styled_namespaceObject = require("@emotion/styled");
var styled_default = /*#__PURE__*/ __webpack_require__.n(styled_namespaceObject);
const index_cjs_namespaceObject = require("../../layouts/index.cjs");
const react_cjs_namespaceObject = require("../../xyflow/react.cjs");
const external_lucide_react_namespaceObject = require("lucide-react");
const external_react_namespaceObject = require("react");
const external_BaseCanvas_index_cjs_namespaceObject = require("../BaseCanvas/index.cjs");
const external_types_cjs_namespaceObject = require("../../types.cjs");
const props_helpers_cjs_namespaceObject = require("../../utils/props-helpers.cjs");
const external_CanvasPositionControls_cjs_namespaceObject = require("../CanvasPositionControls.cjs");
const external_StickyNoteNode_index_cjs_namespaceObject = require("../StickyNoteNode/index.cjs");
const PaneContextMenu_cjs_namespaceObject = require("./components/PaneContextMenu.cjs");
const SuggestionGroupPanel_cjs_namespaceObject = require("./components/SuggestionGroupPanel.cjs");
const TimelinePlayer_cjs_namespaceObject = require("./components/TimelinePlayer.cjs");
const TimelinePlayer_utils_cjs_namespaceObject = require("./components/TimelinePlayer.utils.cjs");
const Edge_cjs_namespaceObject = require("./edges/Edge.cjs");
const AgentNode_cjs_namespaceObject = require("./nodes/AgentNode.cjs");
const ResourceNode_cjs_namespaceObject = require("./nodes/ResourceNode.cjs");
const agent_flow_store_cjs_namespaceObject = require("./store/agent-flow-store.cjs");
const NodeRegistryProvider_cjs_namespaceObject = require("../../core/NodeRegistryProvider.cjs");
const external_agent_flow_manifest_cjs_namespaceObject = require("./agent-flow.manifest.cjs");
const ToolbarContainer = styled_default().div`
  display: flex;
  align-items: center;
  background: var(--canvas-background);
  border: 1px solid var(--canvas-border-de-emp);
  border-radius: 16px;
  padding: 4px;
  gap: 4px;
  height: 50px;
`;
const ToolbarButton = styled_default().button`
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 16px;
  transition: background-color 0.15s ease;
  color: var(--canvas-foreground);

  &:hover {
    background: var(--canvas-background-hover);
  }
`;
const edgeTypes = {
    default: Edge_cjs_namespaceObject.Edge
};
const AGENT_FLOW_FIT_VIEW_OPTIONS = {
    padding: {
        top: 0.3,
        right: 0.3,
        bottom: 0.3,
        left: 0.3
    },
    duration: 300
};
const createAgentNodeWrapper = (handlers)=>(props)=>{
        const { props: storeProps, nodes, setSelectedNodeId } = (0, agent_flow_store_cjs_namespaceObject.useAgentFlowStore)();
        const hasContext = nodes.some((node)=>(0, external_types_cjs_namespaceObject.isAgentFlowResourceNode)(node) && 'context' === node.data.type && node.data.parentNodeId === props.id);
        const hasEscalation = nodes.some((node)=>(0, external_types_cjs_namespaceObject.isAgentFlowResourceNode)(node) && 'escalation' === node.data.type && node.data.parentNodeId === props.id);
        const hasTool = nodes.some((node)=>(0, external_types_cjs_namespaceObject.isAgentFlowResourceNode)(node) && 'tool' === node.data.type && node.data.parentNodeId === props.id);
        const hasMcp = false !== handlers.enableMcpTools && nodes.some((node)=>(0, external_types_cjs_namespaceObject.isAgentFlowResourceNode)(node) && 'mcp' === node.data.type && node.data.parentNodeId === props.id);
        const hasMemory = nodes.some((node)=>(0, external_types_cjs_namespaceObject.isAgentFlowResourceNode)(node) && 'memorySpace' === node.data.type && node.data.parentNodeId === props.id);
        const hasA2a = true === handlers.enableA2a && nodes.some((node)=>(0, external_types_cjs_namespaceObject.isAgentFlowResourceNode)(node) && 'a2a' === node.data.type && node.data.parentNodeId === props.id);
        const agentRunning = (0, props_helpers_cjs_namespaceObject.hasAgentRunning)(storeProps.spans);
        const resourceRunning = nodes.some((node)=>(0, external_types_cjs_namespaceObject.isAgentFlowResourceNode)(node) && 'view' === storeProps.mode && node.data.parentNodeId === props.id && node.data.hasRunning);
        const agentProcessing = props.data.isProcessing;
        const hasRunning = agentRunning || resourceRunning || agentProcessing;
        const hasError = !hasRunning && nodes.some((node)=>(0, external_types_cjs_namespaceObject.isAgentFlowResourceNode)(node) && node.data.parentNodeId === props.id && node.data.hasError);
        const hasSuccess = !hasRunning && nodes.some((node)=>(0, external_types_cjs_namespaceObject.isAgentFlowResourceNode)(node) && node.data.parentNodeId === props.id && node.data.hasSuccess);
        const handleAddInstructions = (0, external_react_namespaceObject.useCallback)(()=>{
            setSelectedNodeId(props.id);
            storeProps.onSelectResource?.(props.id);
        }, [
            setSelectedNodeId,
            storeProps.onSelectResource,
            props.id
        ]);
        return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(AgentNode_cjs_namespaceObject.AgentNodeElement, {
            ...props,
            hasContext: hasContext,
            hasEscalation: hasEscalation,
            hasTool: hasTool,
            hasMcp: hasMcp,
            hasMemory: hasMemory,
            hasA2a: hasA2a,
            a2aEnabled: true === handlers.enableA2a,
            mcpEnabled: false !== handlers.enableMcpTools,
            mode: storeProps.mode,
            hasError: hasError,
            hasSuccess: hasSuccess,
            hasRunning: hasRunning,
            onAddResource: handlers.onAddResource,
            onAddInstructions: handleAddInstructions,
            translations: handlers.translations ?? external_types_cjs_namespaceObject.DefaultAgentNodeTranslations,
            suggestionTranslations: handlers.suggestionTranslations ?? external_types_cjs_namespaceObject.DefaultSuggestionTranslations,
            enableMemory: true === handlers.enableMemory,
            enableInstructions: true === handlers.enableInstructions,
            healthScore: handlers.healthScore,
            onHealthScoreClick: handlers.onHealthScoreClick,
            suggestionGroupVersion: handlers.suggestionGroupVersion
        });
    };
const createResourceNodeWrapper = (opts)=>(props)=>{
        const { props: storeProps, deleteNode } = (0, agent_flow_store_cjs_namespaceObject.useAgentFlowStore)();
        return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(ResourceNode_cjs_namespaceObject.ResourceNode, {
            ...props,
            mode: storeProps.mode,
            hasError: props.data.hasError,
            hasSuccess: props.data.hasSuccess,
            hasRunning: props.data.hasRunning,
            onEnable: opts.onEnable,
            onDisable: opts.onDisable,
            onAddBreakpoint: opts.onAddBreakpoint,
            onRemoveBreakpoint: opts.onRemoveBreakpoint,
            onAddGuardrail: opts.onAddGuardrail,
            onGoToSource: opts.onGoToSource,
            onErrorAction: opts.onErrorAction,
            onRemoveResource: deleteNode,
            onExpandResource: opts.onExpandResource,
            onCollapseResource: opts.onCollapseResource,
            translations: opts.translations ?? external_types_cjs_namespaceObject.DefaultResourceNodeTranslations,
            suggestionTranslations: opts.suggestionTranslations ?? external_types_cjs_namespaceObject.DefaultSuggestionTranslations,
            suggestionGroupVersion: opts.suggestionGroupVersion
        });
    };
const AgentFlowInner = /*#__PURE__*/ (0, external_react_namespaceObject.memo)(({ children, mode, spans, onEnable, onDisable, onAddBreakpoint, onRemoveBreakpoint, onAddGuardrail, onGoToSource, onErrorAction, onAddResource: _onAddResource, onSelectResource, setSpanForSelectedNode, getNodeFromSelectedSpan, onExpandResource, onCollapseResource, agentNodeTranslations, resourceNodeTranslations, stickyNoteNodeTranslations, canvasTranslations, enableTimelinePlayer, canvasRef, enableMcpTools, enableMemory, enableA2a, enableStickyNotes, enableInstructions, healthScore, onHealthScoreClick, suggestionTranslations, suggestionGroup, onAgentNodePositionChange, onResourceNodePositionChange, onOrganize, onUpdateStickyNote, zoomLevel, onZoomLevelChange })=>{
    const { nodes, edges, onNodesChange, onEdgesChange, onConnect, autoArrange, setSelectedNodeId, selectedNodeId, setDragging, expandAgent, collapseAgent, createResourcePlaceholder, actOnSuggestionGroup, currentSuggestionIndex, navigateToNextSuggestion, navigateToPreviousSuggestion, addStickyNote, paneContextMenu, openPaneContextMenu, closePaneContextMenu } = (0, agent_flow_store_cjs_namespaceObject.useAgentFlowStore)();
    const nodeTypesBase = (0, external_react_namespaceObject.useMemo)(()=>({
            stickyNote: (props)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_StickyNoteNode_index_cjs_namespaceObject.StickyNoteNode, {
                    ...props,
                    placeholder: (stickyNoteNodeTranslations ?? external_types_cjs_namespaceObject.DefaultStickyNoteNodeTranslations).placeholder,
                    renderPlaceholderOnSelect: true
                })
        }), [
        stickyNoteNodeTranslations
    ]);
    const { fitView: reactFlowFitView, screenToFlowPosition: reactFlowScreenToFlowPosition } = (0, react_cjs_namespaceObject.useReactFlow)();
    const timelinePlayerRef = (0, external_react_namespaceObject.useRef)(null);
    const suggestionGroupPanelRef = (0, external_react_namespaceObject.useRef)(null);
    const toolbarContainerRef = (0, external_react_namespaceObject.useRef)(null);
    const timelineHeight = (0, external_react_namespaceObject.useMemo)(()=>(0, TimelinePlayer_utils_cjs_namespaceObject.calculateTimelineHeight)(enableTimelinePlayer, spans), [
        enableTimelinePlayer,
        spans
    ]);
    const suggestionGroupPanelHeight = suggestionGroupPanelRef.current?.offsetHeight || 0;
    const toolbarContainerHeight = toolbarContainerRef.current?.offsetHeight || 0;
    const adjustedFitViewOptions = (0, external_react_namespaceObject.useMemo)(()=>{
        if ([
            timelineHeight,
            suggestionGroupPanelHeight,
            toolbarContainerHeight
        ].some((height)=>height > 0)) {
            const viewportHeight = window.innerHeight;
            const timelineRatio = timelineHeight / viewportHeight;
            const suggestionGroupPanelRatio = suggestionGroupPanelHeight / viewportHeight;
            const toolbarContainerRatio = toolbarContainerHeight / viewportHeight;
            const bottomPadding = AGENT_FLOW_FIT_VIEW_OPTIONS.padding.bottom + 3 * (timelineRatio + suggestionGroupPanelRatio + toolbarContainerRatio);
            return {
                ...AGENT_FLOW_FIT_VIEW_OPTIONS,
                padding: {
                    ...AGENT_FLOW_FIT_VIEW_OPTIONS.padding,
                    bottom: bottomPadding
                }
            };
        }
        return AGENT_FLOW_FIT_VIEW_OPTIONS;
    }, [
        timelineHeight,
        suggestionGroupPanelHeight,
        toolbarContainerHeight
    ]);
    const nodeTypes = (0, external_react_namespaceObject.useMemo)(()=>{
        const handleAddResource = (type)=>{
            createResourcePlaceholder(type);
        };
        const suggestionGroupVersion = suggestionGroup?.metadata?.version;
        return {
            ...nodeTypesBase,
            agent: createAgentNodeWrapper({
                onAddResource: handleAddResource,
                translations: agentNodeTranslations,
                suggestionTranslations,
                enableMcpTools,
                enableMemory,
                enableA2a,
                enableInstructions,
                healthScore,
                onHealthScoreClick,
                suggestionGroupVersion
            }),
            resource: createResourceNodeWrapper({
                onEnable,
                onDisable,
                onAddBreakpoint,
                onRemoveBreakpoint,
                onAddGuardrail,
                onGoToSource,
                onErrorAction,
                onExpandResource,
                onCollapseResource,
                translations: resourceNodeTranslations,
                suggestionTranslations,
                suggestionGroupVersion
            })
        };
    }, [
        onEnable,
        onDisable,
        onAddBreakpoint,
        onRemoveBreakpoint,
        onAddGuardrail,
        onGoToSource,
        onErrorAction,
        healthScore,
        onHealthScoreClick,
        createResourcePlaceholder,
        agentNodeTranslations,
        resourceNodeTranslations,
        suggestionTranslations,
        onExpandResource,
        onCollapseResource,
        enableMcpTools,
        enableMemory,
        suggestionGroup?.metadata?.version
    ]);
    const handlePaneClick = (0, external_react_namespaceObject.useCallback)(()=>{
        setSelectedNodeId(null);
        onSelectResource?.('pane');
        closePaneContextMenu();
    }, [
        onSelectResource,
        setSelectedNodeId,
        closePaneContextMenu
    ]);
    const handleNodeClick = (0, external_react_namespaceObject.useCallback)((_event, node)=>{
        _event.stopPropagation();
        _event.preventDefault();
        setSelectedNodeId(node.id);
        setSpanForSelectedNode?.(node, nodes);
        onSelectResource?.(node.id);
    }, [
        onSelectResource,
        setSelectedNodeId,
        setSpanForSelectedNode,
        nodes
    ]);
    const handleNodeContextMenu = (0, external_react_namespaceObject.useCallback)((event, node)=>{
        event.stopPropagation();
        event.preventDefault();
        setSelectedNodeId(node.id);
        setSpanForSelectedNode?.(node, nodes);
        onSelectResource?.(node.id);
    }, [
        onSelectResource,
        setSelectedNodeId,
        setSpanForSelectedNode,
        nodes
    ]);
    const handlePaneContextMenu = (0, external_react_namespaceObject.useCallback)((event)=>{
        event.stopPropagation();
        event.preventDefault();
        const screenPosition = {
            x: event.clientX,
            y: event.clientY
        };
        const flowPosition = reactFlowScreenToFlowPosition(screenPosition);
        openPaneContextMenu(screenPosition, flowPosition);
    }, [
        openPaneContextMenu,
        reactFlowScreenToFlowPosition
    ]);
    const handleNodeDragStart = (0, external_react_namespaceObject.useCallback)((_event, node)=>{
        setSelectedNodeId(node.id);
        onSelectResource?.(node.id);
        if (!(0, external_types_cjs_namespaceObject.isAgentFlowResourceNode)(node)) return;
        setDragging(true, node.id);
    }, [
        setSelectedNodeId,
        onSelectResource,
        setDragging
    ]);
    const handleNodeDragStop = (0, external_react_namespaceObject.useCallback)((_event, node)=>{
        if ((0, external_types_cjs_namespaceObject.isStickyNoteNode)(node)) return void onUpdateStickyNote?.(node.id, {
            position: {
                x: node.position.x,
                y: node.position.y
            }
        });
        if (!(0, external_types_cjs_namespaceObject.isAgentFlowResourceNode)(node)) return void onAgentNodePositionChange?.({
            x: node.position.x,
            y: node.position.y
        });
        const agentNode = nodes.find(external_types_cjs_namespaceObject.isAgentFlowAgentNode);
        if (agentNode) onAgentNodePositionChange?.({
            x: agentNode.position.x,
            y: agentNode.position.y
        });
        onResourceNodePositionChange?.(node.id, {
            x: node.position.x,
            y: node.position.y
        });
    }, [
        onAgentNodePositionChange,
        onResourceNodePositionChange,
        onUpdateStickyNote,
        nodes
    ]);
    (0, external_react_namespaceObject.useEffect)(()=>{
        const handleExpandAgent = (event)=>{
            const customEvent = event;
            const { resourceId, agentDetails } = customEvent.detail;
            expandAgent(resourceId, agentDetails);
        };
        window.addEventListener('expandAgent', handleExpandAgent);
        return ()=>{
            window.removeEventListener('expandAgent', handleExpandAgent);
        };
    }, [
        expandAgent
    ]);
    (0, external_react_namespaceObject.useEffect)(()=>{
        const handleCollapseAgent = (event)=>{
            const customEvent = event;
            const { resourceId } = customEvent.detail;
            collapseAgent(resourceId);
        };
        window.addEventListener('collapseAgent', handleCollapseAgent);
        return ()=>{
            window.removeEventListener('collapseAgent', handleCollapseAgent);
        };
    }, [
        collapseAgent
    ]);
    (0, external_react_namespaceObject.useEffect)(()=>{
        const handleResetSelectedNode = ()=>{
            setSelectedNodeId(null);
            onSelectResource?.(null);
            reactFlowFitView(adjustedFitViewOptions);
        };
        window.addEventListener('resetSelectedNode', handleResetSelectedNode);
        return ()=>{
            window.removeEventListener('resetSelectedNode', handleResetSelectedNode);
        };
    }, [
        setSelectedNodeId,
        onSelectResource,
        reactFlowFitView,
        adjustedFitViewOptions
    ]);
    (0, external_react_namespaceObject.useEffect)(()=>{
        if (0 === nodes.length || 0 === spans.length) return;
        const targetNode = getNodeFromSelectedSpan?.(nodes);
        if (targetNode && targetNode?.id !== selectedNodeId) {
            setSelectedNodeId(targetNode.id);
            onSelectResource?.(targetNode.id);
        }
    }, [
        nodes,
        setSelectedNodeId,
        onSelectResource,
        getNodeFromSelectedSpan,
        selectedNodeId,
        spans
    ]);
    const filteredNodes = nodes.filter((node)=>{
        if (!(0, external_types_cjs_namespaceObject.isAgentFlowResourceNode)(node)) return true;
        if (node.data.isVirtual) return true;
        if ('memorySpace' === node.data.type) return !!enableMemory;
        if ('a2a' === node.data.type) return !!enableA2a;
        return true;
    });
    const defaultViewport = (0, external_react_namespaceObject.useMemo)(()=>{
        if (void 0 !== zoomLevel) return {
            x: 0,
            y: 0,
            zoom: zoomLevel
        };
    }, [
        zoomLevel
    ]);
    const handleViewportChange = (0, external_react_namespaceObject.useCallback)((_event, viewport)=>{
        const newZoomLevel = Math.round(100 * viewport.zoom) / 100;
        const currentZoomLevel = zoomLevel ? Math.round(100 * zoomLevel) / 100 : void 0;
        if (onZoomLevelChange && newZoomLevel !== currentZoomLevel) onZoomLevelChange(newZoomLevel);
    }, [
        onZoomLevelChange,
        zoomLevel
    ]);
    return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(index_cjs_namespaceObject.Column, {
        w: "100%",
        h: "100%",
        style: {
            touchAction: 'none'
        },
        children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(index_cjs_namespaceObject.Column, {
            flex: 1,
            position: "relative",
            style: {
                touchAction: 'none'
            },
            children: [
                /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_BaseCanvas_index_cjs_namespaceObject.BaseCanvas, {
                    ref: canvasRef,
                    nodes: filteredNodes,
                    edges: edges,
                    nodeTypes: nodeTypes,
                    edgeTypes: edgeTypes,
                    mode: mode,
                    initialAutoLayout: autoArrange,
                    fitViewOptions: adjustedFitViewOptions,
                    defaultViewport: defaultViewport,
                    onMove: handleViewportChange,
                    onNodesChange: onNodesChange,
                    onEdgesChange: onEdgesChange,
                    onConnect: onConnect,
                    onNodeClick: handleNodeClick,
                    onNodeContextMenu: handleNodeContextMenu,
                    onPaneContextMenu: handlePaneContextMenu,
                    onPaneClick: handlePaneClick,
                    onNodeDragStart: handleNodeDragStart,
                    onNodeDragStop: handleNodeDragStop,
                    deleteKeyCode: 'design' === mode ? [
                        'Backspace',
                        'Delete'
                    ] : null,
                    maintainNodesInView: [],
                    panShortcutTeachingUIMessage: (canvasTranslations ?? external_types_cjs_namespaceObject.DefaultCanvasTranslations).panShortcutTeaching,
                    children: [
                        /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(react_cjs_namespaceObject.Panel, {
                            position: "bottom-right",
                            children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_CanvasPositionControls_cjs_namespaceObject.CanvasPositionControls, {
                                fitViewOptions: adjustedFitViewOptions,
                                translations: canvasTranslations ?? external_types_cjs_namespaceObject.DefaultCanvasTranslations,
                                onOrganize: 'design' === mode ? onOrganize : void 0
                            })
                        }),
                        /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(react_cjs_namespaceObject.Panel, {
                            position: "bottom-center",
                            children: [
                                /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
                                    ref: timelinePlayerRef,
                                    children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(TimelinePlayer_cjs_namespaceObject.TimelinePlayer, {
                                        spans: spans ?? [],
                                        enableTimelinePlayer: enableTimelinePlayer ?? true
                                    })
                                }),
                                /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
                                    ref: toolbarContainerRef,
                                    children: enableStickyNotes && 'design' === mode && !suggestionGroup?.suggestions.length && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(ToolbarContainer, {
                                        className: "nodrag nopan nowheel",
                                        children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(ToolbarButton, {
                                            type: "button",
                                            onClick: ()=>addStickyNote(),
                                            title: (canvasTranslations ?? external_types_cjs_namespaceObject.DefaultCanvasTranslations).addNote,
                                            children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.StickyNote, {
                                                size: 16
                                            })
                                        })
                                    })
                                }),
                                /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
                                    ref: suggestionGroupPanelRef,
                                    children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(SuggestionGroupPanel_cjs_namespaceObject.SuggestionGroupPanel, {
                                        suggestionGroup: suggestionGroup,
                                        onRejectAll: (suggestionGroupId)=>actOnSuggestionGroup?.(suggestionGroupId, 'reject'),
                                        onAcceptAll: (suggestionGroupId)=>actOnSuggestionGroup?.(suggestionGroupId, 'accept'),
                                        currentIndex: currentSuggestionIndex,
                                        onNavigateNext: navigateToNextSuggestion,
                                        onNavigatePrevious: navigateToPreviousSuggestion
                                    })
                                })
                            ]
                        }),
                        children
                    ]
                }),
                'design' === mode && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(PaneContextMenu_cjs_namespaceObject.PaneContextMenu, {
                    isOpen: null !== paneContextMenu,
                    position: paneContextMenu?.position ?? {
                        x: 0,
                        y: 0
                    },
                    items: [
                        ...enableStickyNotes ? [
                            {
                                label: (canvasTranslations ?? external_types_cjs_namespaceObject.DefaultCanvasTranslations).addNote,
                                onClick: ()=>addStickyNote({
                                        position: paneContextMenu?.flowPosition ?? {
                                            x: 0,
                                            y: 0
                                        }
                                    })
                            }
                        ] : [],
                        ...onOrganize ? [
                            {
                                label: (canvasTranslations ?? external_types_cjs_namespaceObject.DefaultCanvasTranslations).organize,
                                onClick: onOrganize
                            }
                        ] : []
                    ],
                    onClose: closePaneContextMenu
                })
            ]
        })
    });
});
AgentFlowInner.displayName = 'AgentFlowInner';
const AgentFlow = (props)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(NodeRegistryProvider_cjs_namespaceObject.NodeRegistryProvider, {
        manifest: external_agent_flow_manifest_cjs_namespaceObject.agentFlowManifest,
        children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(agent_flow_store_cjs_namespaceObject.AgentFlowProvider, {
            ...props,
            children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(AgentFlowInner, {
                ...props
            })
        })
    });
exports.AgentFlow = __webpack_exports__.AgentFlow;
for(var __rspack_i in __webpack_exports__)if (-1 === [
    "AgentFlow"
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
Object.defineProperty(exports, '__esModule', {
    value: true
});
