"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = BlockSupportSlotContainer;
var _components = require("@wordpress/components");
var _element = require("@wordpress/element");
var _jsxRuntime = require("react/jsx-runtime");
/**
 * WordPress dependencies
 */

function BlockSupportSlotContainer({
  Slot,
  fillProps,
  ...props
}) {
  // Add the toolspanel context provider and value to existing fill props
  const toolsPanelContext = (0, _element.useContext)(_components.__experimentalToolsPanelContext);
  const computedFillProps = (0, _element.useMemo)(() => {
    var _fillProps$forwardedC;
    return {
      ...(fillProps !== null && fillProps !== void 0 ? fillProps : {}),
      forwardedContext: [...((_fillProps$forwardedC = fillProps?.forwardedContext) !== null && _fillProps$forwardedC !== void 0 ? _fillProps$forwardedC : []), [_components.__experimentalToolsPanelContext.Provider, {
        value: toolsPanelContext
      }]]
    };
  }, [toolsPanelContext, fillProps]);
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(Slot, {
    ...props,
    fillProps: computedFillProps,
    bubblesVirtually: true
  });
}
//# sourceMappingURL=block-support-slot-container.js.map