"use strict";var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;exports.__esModule = true;exports.toggleSizeMixin = exports.inputSizeMixin = exports.handleMixin = exports.containerSizeMixin = exports.captionSizeMixin = exports.buttonSizeMixin = void 0;var _taggedTemplateLiteralLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteralLoose"));var _Emotion = require("../../lib/theming/Emotion");
var _client = require("../../lib/client");

var _Toggle = require("./Toggle.styles");var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;

var toggleSizeMixin = exports.toggleSizeMixin = function toggleSizeMixin(fontSize, toggleHeight, toggleWidth) {
  return (0, _Emotion.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteralLoose2.default)(["\n    line-height: ", ";\n    font-size: ", ";\n\n    &::before {\n      width: ", ";\n    }\n  "])),
  toggleHeight,
  fontSize,


  toggleWidth);


};

var buttonSizeMixin = exports.buttonSizeMixin = function buttonSizeMixin(
labGrotesqueBaselineCompensation,
fontSize,
toggleHeight,
toggleWidth,
toggleBorderRadius,
toggleButtonOffsetY)
{
  var labGrotesqueCompenstation = parseInt(labGrotesqueBaselineCompensation);
  var buttonFontSize = parseInt(fontSize);
  var baselineCompensation = buttonFontSize <= 16 && _client.isChrome ? -labGrotesqueCompenstation : 0;
  return (0, _Emotion.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteralLoose2.default)(["\n    height: ", ";\n    width: ", ";\n    flex: 1 0 ", ";\n\n    border-radius: ", ";\n    line-height: ", ";\n\n    margin-top: calc(", " + ", "px);\n  "])),
  toggleHeight,
  toggleWidth,
  toggleWidth,

  toggleBorderRadius,
  toggleHeight,

  toggleButtonOffsetY, baselineCompensation);

};

var captionSizeMixin = exports.captionSizeMixin = function captionSizeMixin(fontSize, toggleHeight) {
  return (0, _Emotion.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteralLoose2.default)(["\n    line-height: ", ";\n    font-size: ", ";\n  "])),
  toggleHeight,
  fontSize);

};

var handleMixin = exports.handleMixin = function handleMixin(toggleHandleSize, toggleHandleBorderRadius) {
  return (0, _Emotion.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteralLoose2.default)(["\n    border-radius: ", ";\n    height: ", ";\n    width: ", ";\n  "])),
  toggleHandleBorderRadius,
  toggleHandleSize,
  toggleHandleSize);

};

var containerSizeMixin = exports.containerSizeMixin = function containerSizeMixin(toggleBorderRadius) {
  return (0, _Emotion.css)(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteralLoose2.default)(["\n    border-radius: ", ";\n  "])),
  toggleBorderRadius);

};

var inputSizeMixin = exports.inputSizeMixin = function inputSizeMixin(toggleHeight, toggleWidth) {
  var handleWidthWithBorders = toggleHeight;
  var height = parseInt(toggleHeight);
  return (0, _Emotion.css)(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteralLoose2.default)(["\n    &:checked ~ .", " .", " {\n      border-radius: ", "px 0 0 ", "px;\n    }\n    &:checked ~ .", " {\n      transform: translateX(", ") translateX(-", ");\n    }\n  "])),
  _Toggle.globalClasses.containerDisabled, _Toggle.globalClasses.background,
  height * 0.5, height * 0.5,

  _Toggle.globalClasses.handle,
  toggleWidth, handleWidthWithBorders);


};