{"dependencies":[{"name":"babel-runtime/core-js/object/keys","loc":{"line":7,"column":20}}],"generated":{"js":"'use strict';\n\nObject.defineProperty(exports, \"__esModule\", {\n  value: true\n});\n\nvar _keys = require('babel-runtime/core-js/object/keys');\n\nvar _keys2 = _interopRequireDefault(_keys);\n\nexports.default = rtl;\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar reTranslate = /((^|\\s)translate(3d|X)?\\()(\\-?[\\d]+)/;\nvar reSkew = /((^|\\s)skew(x|y)?\\()\\s*(\\-?[\\d]+)(deg|rad|grad)(,\\s*(\\-?[\\d]+)(deg|rad|grad))?/;\n\n/**\n * This function ensures that `style` supports both ltr and rtl directions by\n * checking `styleConstants` in `muiTheme` and replacing attribute keys if\n * necessary.\n */\nfunction rtl(muiTheme) {\n  if (muiTheme.isRtl) {\n    return function (style) {\n      if (style.directionInvariant === true) {\n        return style;\n      }\n\n      var flippedAttributes = {\n        // Keys and their replacements.\n        right: 'left',\n        left: 'right',\n        marginRight: 'marginLeft',\n        marginLeft: 'marginRight',\n        paddingRight: 'paddingLeft',\n        paddingLeft: 'paddingRight',\n        borderRight: 'borderLeft',\n        borderLeft: 'borderRight'\n      };\n\n      var newStyle = {};\n\n      (0, _keys2.default)(style).forEach(function (attribute) {\n        var value = style[attribute];\n        var key = attribute;\n\n        if (flippedAttributes.hasOwnProperty(attribute)) {\n          key = flippedAttributes[attribute];\n        }\n\n        switch (attribute) {\n          case 'float':\n          case 'textAlign':\n            if (value === 'right') {\n              value = 'left';\n            } else if (value === 'left') {\n              value = 'right';\n            }\n            break;\n\n          case 'direction':\n            if (value === 'ltr') {\n              value = 'rtl';\n            } else if (value === 'rtl') {\n              value = 'ltr';\n            }\n            break;\n\n          case 'transform':\n            if (!value) break;\n            var matches = void 0;\n            if (matches = value.match(reTranslate)) {\n              value = value.replace(matches[0], matches[1] + -parseFloat(matches[4]));\n            }\n            if (matches = value.match(reSkew)) {\n              value = value.replace(matches[0], matches[1] + -parseFloat(matches[4]) + matches[5] + matches[6] ? ', ' + (-parseFloat(matches[7]) + matches[8]) : '');\n            }\n            break;\n\n          case 'transformOrigin':\n            if (!value) break;\n            if (value.indexOf('right') > -1) {\n              value = value.replace('right', 'left');\n            } else if (value.indexOf('left') > -1) {\n              value = value.replace('left', 'right');\n            }\n            break;\n        }\n\n        newStyle[key] = value;\n      });\n\n      return newStyle;\n    };\n  }\n}"},"hash":"63a24df6295252d8a055b27be1c6eb1a"}