"use strict";

exports.__esModule = true;
exports.FloatingScrollBarContext = void 0;
exports.FloatingScrollBarContextProvider = FloatingScrollBarContextProvider;
exports.useFloatingScrollBarContext = void 0;
var _react = _interopRequireWildcard(require("react"));
var _jsxFileName = "/home/builduser/work/57e038ea7326c1ec/packages/wix-design-system/dist/cjs/Table/FloatingScrollBar/FloatingScrollBarContext.tsx";
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(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 (var _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); }
class FloatingScrollBarContextValue {
  constructor() {
    this.viewportRef = undefined;
    this.scrollableContentRef = {
      current: null
    };
    this.scrollElementRef = {
      current: null
    };
    this.floatingScrollBarStateRef = {
      current: null
    };
  }
}
var FloatingScrollBarContext = exports.FloatingScrollBarContext = /*#__PURE__*/(0, _react.createContext)(new FloatingScrollBarContextValue());
var useFloatingScrollBarContext = () => (0, _react.useContext)(FloatingScrollBarContext);
exports.useFloatingScrollBarContext = useFloatingScrollBarContext;
function FloatingScrollBarContextProvider(_ref) {
  var {
    children,
    scrollableContentRef,
    viewportRef,
    scrollElementRef
  } = _ref;
  var [value] = (0, _react.useState)(() => new FloatingScrollBarContextValue());
  value.viewportRef = viewportRef;
  value.scrollableContentRef = scrollableContentRef;
  value.scrollElementRef = scrollElementRef;
  return /*#__PURE__*/_react.default.createElement(FloatingScrollBarContext.Provider, {
    value: value,
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 52,
      columnNumber: 5
    }
  }, children);
}
//# sourceMappingURL=FloatingScrollBarContext.js.map