"use strict";

exports.__esModule = true;
exports.ContainerRectDebug = void 0;
var _react = _interopRequireWildcard(require("react"));
var _providers = require("../../providers");
var _ToolbarCollectionContext = require("../ToolbarCollectionContext");
var _reactDom = require("react-dom");
var _mobxReactLite = require("mobx-react-lite");
var _RectState = require("../../state/RectState");
var _react2 = require("@wix/bex-core/react");
var _jsxFileName = "/home/builduser/work/843658b9f44192f0/packages/cairo/dist/cjs/components/ToolbarCollectionContentAutoSizer/ContainerRectDebug.tsx";
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
function _ContainerRectDebug() {
  const container = (0, _react2.useWixPatternsContainer)();
  const {
    stackingRootRef
  } = (0, _providers.usePageContext)();
  const {
    scrollableContentRef
  } = (0, _providers.useScrollableContentContext)();
  const toolbar = (0, _ToolbarCollectionContext.useToolbarCollectionContext)();
  const [scrollableContentRect] = (0, _react.useState)(() => new _RectState.RectState({
    container
  }));
  (0, _react.useEffect)(() => {
    scrollableContentRect.element = scrollableContentRef == null ? void 0 : scrollableContentRef.current;
    return scrollableContentRect.init();
  }, []);
  if ((stackingRootRef == null ? void 0 : stackingRootRef.current) == null) {
    return null;
  }
  return /*#__PURE__*/(0, _reactDom.createPortal)(/*#__PURE__*/_react.default.createElement("div", {
    style: {
      position: 'fixed',
      zIndex: 50,
      background: 'transparent',
      pointerEvents: 'none',
      border: '#15e9e9 1px solid',
      ...(toolbar.containerRect && {
        top: toolbar.containerRect.top,
        left: toolbar.containerRect.left,
        bottom: 0,
        width: toolbar.containerRect.width
      })
    },
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 32,
      columnNumber: 5
    }
  }), stackingRootRef.current);
}
const ContainerRectDebug = exports.ContainerRectDebug = (0, _mobxReactLite.observer)(_ContainerRectDebug);
//# sourceMappingURL=ContainerRectDebug.js.map