import { jsx as _jsx } from "react/jsx-runtime";
// (C) 2022-2026 GoodData Corporation
import cx from "classnames";
import { isInsightWidget, objRefToString } from "@gooddata/sdk-model";
import { OverlayController, OverlayControllerProvider, ScrollablePanel } from "@gooddata/sdk-ui-kit";
import { simplifyText } from "@gooddata/util";
import { DASHBOARD_HEADER_OVERLAYS_Z_INDEX } from "../../../constants/zIndex.js";
import { TargetDashboardFiltersProvider } from "./DrillFilters/TargetDashboardFiltersContext.js";
import { InsightDrillConfigPanel } from "./InsightDrillConfigPanel/InsightDrillConfigPanel.js";
const overlayController = OverlayController.getInstance(DASHBOARD_HEADER_OVERLAYS_Z_INDEX);
export function InsightInteractions({ widget }) {
    const widgetRefSuffix = isInsightWidget(widget) ? simplifyText(objRefToString(widget.ref)) : "";
    const classes = cx("configuration-scrollable-panel", "s-configuration-scrollable-panel", `s-visualization-${widgetRefSuffix}`);
    return (_jsx(ScrollablePanel, { className: classes, children: _jsx(OverlayControllerProvider, { overlayController: overlayController, children: _jsx(TargetDashboardFiltersProvider, { children: _jsx(InsightDrillConfigPanel, { widgetRef: widget.ref }) }) }) }));
}
export function createInsightInteractionsScreen(widget) {
    return _jsx(InsightInteractions, { widget: widget });
}
