"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var React = _interopRequireWildcard(require("react"));

var _styletronReact = require("styletron-react");

var _styletronStandard = require("styletron-standard");

var _themeProvider = require("./theme-provider.js");

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = Object.defineProperty && Object.getOwnPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : {}; if (desc.get || desc.set) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } } newObj.default = obj; return newObj; } }

function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }

var wrapper = function wrapper(StyledComponent) {
  return React.forwardRef(function (props, ref) {
    return React.createElement(_themeProvider.ThemeContext.Consumer, null, function (theme) {
      return React.createElement(StyledComponent, _extends({
        ref: ref
      }, props, {
        $theme: theme
      }));
    });
  });
};
/* eslint-disable flowtype/generic-spacing */

/* eslint-disable flowtype/no-weak-types */


/* eslint-enable flowtype/generic-spacing */

/* eslint-enable flowtype/no-weak-types */
var styled = (0, _styletronReact.createStyled)({
  wrapper: wrapper,
  getInitialStyle: _styletronStandard.getInitialStyle,
  driver: _styletronStandard.driver // eslint-disable-next-line flowtype/no-weak-types

});
var _default = styled;
exports.default = _default;