"use strict";

exports.__esModule = true;
exports.default = exports.Wrapper = exports.Cover = exports.ContainedInput = exports.Checkbox = void 0;
var _react = _interopRequireDefault(require("react"));
var _styledComponents = _interopRequireWildcard(require("styled-components"));
var _utils = require("../utils");
var _polished = require("polished");
var _withId = _interopRequireDefault(require("../hocs/withId"));
var _excluded = ["value", "className", "id"];
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
(function () {
  var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
  enterModule && enterModule(module);
})();
(function () {
  var enterModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.enterModule : undefined;
  enterModule && enterModule(module);
})();
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
  return a;
};
var __signature__ = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default.signature : function (a) {
  return a;
};
var Wrapper = exports.Wrapper = _styledComponents.default.label.withConfig({
  displayName: "Checkbox__Wrapper",
  componentId: "sc-l110sd-0"
})(["padding:10px 15px;margin:-10px -15px;"]);
var ContainedInput = exports.ContainedInput = _styledComponents.default.input.attrs(function () {
  return {
    type: "checkbox"
  };
}).withConfig({
  displayName: "Checkbox__ContainedInput",
  componentId: "sc-l110sd-1"
})(["position:absolute;opacity:0;z-index:10;margin:0;"]);
var Cover = exports.Cover = _styledComponents.default.label.withConfig({
  displayName: "Checkbox__Cover",
  componentId: "sc-l110sd-2"
})(["display:inline-block;position:relative;height:14px;width:14px;border:1px solid ", ";border-radius:3px;", ":active + &,", ":focus + &{box-shadow:0px 0px 1px 0px ", ";border-color:", ";}", ";"], (0, _utils.getThemeProp)(["colors", "borderLight"], "#cccccc"), ContainedInput, ContainedInput, (0, _utils.getThemeProp)(["colors", "application", "base"], "#777", function (color) {
  return (0, _polished.tint)(0.05, color);
}), (0, _utils.getThemeProp)(["colors", "application", "base"], "#777"), (0, _utils.ifFlag)("value", (0, _styledComponents.css)(["background-color:", ";&::after{content:\"\u2714\";font-size:12px;line-height:1;position:absolute;top:1px;left:0;right:0;bottom:0;color:white;text-align:center;}"], (0, _utils.getThemeProp)(["colors", "application", "base"], "#777", function (color) {
  return (0, _polished.tint)(0.05, color);
})), (0, _styledComponents.css)(["background-color:white;"])));
var Checkbox = exports.Checkbox = function Checkbox(_ref) {
  var value = _ref.value,
    className = _ref.className,
    id = _ref.id,
    otherProps = _objectWithoutProperties(_ref, _excluded);
  return /*#__PURE__*/_react.default.createElement(Wrapper, {
    className: className,
    htmlFor: id
  }, /*#__PURE__*/_react.default.createElement(ContainedInput, _extends({
    value: value,
    id: id
  }, otherProps)), /*#__PURE__*/_react.default.createElement(Cover, {
    value: value,
    htmlFor: id
  }));
};
var _default = (0, _withId.default)("checkbox")(Checkbox);
var _default2 = _default;
var _default3 = exports.default = _default2;
;
(function () {
  var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
  if (!reactHotLoader) {
    return;
  }
  reactHotLoader.register(Wrapper, "Wrapper", "/home/vsts/work/1/s/src/components/Checkbox.js");
  reactHotLoader.register(ContainedInput, "ContainedInput", "/home/vsts/work/1/s/src/components/Checkbox.js");
  reactHotLoader.register(Cover, "Cover", "/home/vsts/work/1/s/src/components/Checkbox.js");
  reactHotLoader.register(Checkbox, "Checkbox", "/home/vsts/work/1/s/src/components/Checkbox.js");
  reactHotLoader.register(_default, "default", "/home/vsts/work/1/s/src/components/Checkbox.js");
})();
;
(function () {
  var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
  leaveModule && leaveModule(module);
})();
;
(function () {
  var reactHotLoader = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.default : undefined;
  if (!reactHotLoader) {
    return;
  }
  reactHotLoader.register(Wrapper, "Wrapper", "/home/vsts/work/1/s/src/components/Checkbox.js");
  reactHotLoader.register(ContainedInput, "ContainedInput", "/home/vsts/work/1/s/src/components/Checkbox.js");
  reactHotLoader.register(Cover, "Cover", "/home/vsts/work/1/s/src/components/Checkbox.js");
  reactHotLoader.register(Checkbox, "Checkbox", "/home/vsts/work/1/s/src/components/Checkbox.js");
  reactHotLoader.register(_default2, "default", "/home/vsts/work/1/s/src/components/Checkbox.js");
})();
;
(function () {
  var leaveModule = typeof reactHotLoaderGlobal !== 'undefined' ? reactHotLoaderGlobal.leaveModule : undefined;
  leaveModule && leaveModule(module);
})();