"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.default = void 0;
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
var _react = _interopRequireDefault(require("react"));
var _newColorsBrandingSt = require("./newColorsBranding.st.css.js");
var _madeforSt = require("./madefor.st.css.js");
var _madefordisplaySt = require("./madefordisplay.st.css.js");
var _WixDesignSystemProviderSt = require("./WixDesignSystemProvider.st.css.js");
var _context = require("./context");
var _context2 = require("../WixStyleReactEnvironmentProvider/context");
var _WixStyleReactEnvironmentProvider = _interopRequireDefault(require("../WixStyleReactEnvironmentProvider"));
var _excluded = ["dataHook", "className", "as", "mobile", "children", "theme", "features", "locale", "pageHeaderId", "contextClassName"];
var _jsxFileName = "/home/builduser/work/57e038ea7326c1ec/packages/wix-design-system/dist/cjs/WixDesignSystemProvider/WixDesignSystemProvider.tsx";
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
var WixDesignSystemProvider = _ref => {
  var {
      dataHook,
      className,
      // FIXME: MAJOR RELEASE: make this a block element (div), not an inline element (span) because of safari specific issue with focus.
      as = 'span',
      mobile = false,
      children,
      theme,
      features = {},
      locale,
      pageHeaderId,
      contextClassName = ''
    } = _ref,
    rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
  var compactMode = (features == null ? void 0 : features.compactMode) || false;
  var newBrandingClass = _newColorsBrandingSt.classes.root;
  var environmentContext = _react.default.useContext(_context2.WixStyleReactEnvironmentContext);
  return /*#__PURE__*/_react.default.createElement(_context.WixDesignSystemContext.Provider, {
    value: {
      newBrandingClass,
      mobile,
      contextClassName
    },
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 33,
      columnNumber: 5
    }
  }, /*#__PURE__*/_react.default.createElement(_WixStyleReactEnvironmentProvider.default, {
    locale: locale !== null && locale !== void 0 ? locale : environmentContext == null ? void 0 : environmentContext.locale,
    pageHeaderId: pageHeaderId !== null && pageHeaderId !== void 0 ? pageHeaderId : environmentContext == null ? void 0 : environmentContext.pageHeaderId,
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 36,
      columnNumber: 7
    }
  }, /*#__PURE__*/_react.default.createElement(as, _objectSpread(_objectSpread({}, rest), {}, {
    'data-hook': dataHook,
    className: (0, _newColorsBrandingSt.st)(className, newBrandingClass, _madefordisplaySt.classes.madefordisplay, _madeforSt.classes.madefor, theme == null ? void 0 : theme.className, mobile && _WixDesignSystemProviderSt.classes.mobile, compactMode && 'compactMode')
  }), children)));
};
var _default = exports.default = WixDesignSystemProvider;
//# sourceMappingURL=WixDesignSystemProvider.js.map