{"version":3,"sources":["../node_modules/react-with-styles-interface-css/index.js","../node_modules/react-with-styles-interface-css/dist/index.js","../node_modules/react-with-styles-interface-css/dist/utils/constants.js","../node_modules/react-with-styles-interface-css/dist/utils/getClassName.js","../node_modules/react-with-styles-interface-css/dist/utils/separateStyles.js"],"names":["module","exports","require","default","_interopRequireDefault","Object","defineProperty","value","_arrayPrototype","_globalCache","_constants","_getClassName","_separateStyles2","_default","create","stylesObject","stylesToClasses","styleNames","keys","_sharedState$namespac","get","GLOBAL_CACHE_KEY","namespace","forEach","styleName","className","resolve","stylesArray","flattenedStyles","Infinity","_separateStyles","classNames","hasInlineStyles","inlineStyles","result","map","name","index","concat","join","style","MAX_SPECIFICITY","namespaceSegment","length","i","push","assign"],"mappings":"2FACAA,EAAOC,QAAUC,EAAQ,KAAmBC,S,iCCC5C,IAAIC,EAAyBF,EAAQ,GAErCG,OAAOC,eAAeL,EAAS,aAAc,CAC3CM,OAAO,IAETN,EAAO,aAAc,EAErB,IAAIO,EAAkBJ,EAAuBF,EAAQ,MAEjDO,EAAeL,EAAuBF,EAAQ,MAE9CQ,EAAaR,EAAQ,KAErBS,EAAgBP,EAAuBF,EAAQ,MAE/CU,EAAmBR,EAAuBF,EAAQ,MAoDtD,IAAIW,EAAW,CACbC,OA1CF,SAAgBC,GACd,IAAIC,EAAkB,GAClBC,EAAaZ,OAAOa,KAAKH,GAEzBI,GADcV,EAAY,QAAYW,IAAIV,EAAWW,mBAAqB,IACtCC,UACpCA,OAAsC,IAA1BH,EAAmC,GAAKA,EAKxD,OAJAF,EAAWM,SAAQ,SAAUC,GAC3B,IAAIC,GAAY,EAAId,EAAa,SAAaW,EAAWE,GACzDR,EAAgBQ,GAAaC,KAExBT,GAiCPU,QArBF,SAAiBC,GACf,IAAIC,GAAkB,EAAIpB,EAAe,SAAamB,EAAaE,KAE/DC,GAAkB,EAAIlB,EAAgB,SAAagB,GACnDG,EAAaD,EAAgBC,WAC7BC,EAAkBF,EAAgBE,gBAClCC,EAAeH,EAAgBG,aAM/BC,EAAS,CACXT,UALuBM,EAAWI,KAAI,SAAUC,EAAMC,GACtD,MAAO,GAAGC,OAAOF,EAAM,KAAKE,OAAOF,EAAM,KAAKE,OAAOD,EAAQ,MAE5BE,KAAK,MAKxC,OADIP,IAAiBE,EAAOM,MAAQP,GAC7BC,IAOTjC,EAAO,QAAcY,G,iCCvErBR,OAAOC,eAAeL,EAAS,aAAc,CAC3CM,OAAO,IAETN,EAAQwC,gBAAkBxC,EAAQoB,sBAAmB,EAErDpB,EAAQoB,iBADe,8BAGvBpB,EAAQwC,gBADc,I,iCCNtBpC,OAAOC,eAAeL,EAAS,aAAc,CAC3CM,OAAO,IAETN,EAAO,QAUP,SAAsBqB,EAAWE,GAC/B,IAAIkB,EAAmBpB,EAAUqB,OAAS,EAAI,GAAGL,OAAOhB,EAAW,MAAQ,GAC3E,MAAO,GAAGgB,OAAOI,GAAkBJ,OAAOd,K,iCCf5CnB,OAAOC,eAAeL,EAAS,aAAc,CAC3CM,OAAO,IAETN,EAAO,aAAc,EAsCrB,IAAIY,EAlCJ,SAAwBc,GAUtB,IATA,IAAII,EAAa,GAIbC,GAAkB,EAClBC,EAAe,GAIVW,EAAI,EAAGA,EAAIjB,EAAYgB,OAAQC,IAAK,CAE3C,IAAIJ,EAAQb,EAAYiB,GAKpBJ,IACmB,kBAAVA,EACTT,EAAWc,KAAKL,IAEhBnC,OAAOyC,OAAOb,EAAcO,GAC5BR,GAAkB,IAKxB,MAAO,CACLD,WAAYA,EACZC,gBAAiBA,EACjBC,aAAcA,IAKlBhC,EAAO,QAAcY","file":"static/js/react-with-styles-interface-css.aa9742b3.chunk.js","sourcesContent":["// eslint-disable-next-line import/no-unresolved\nmodule.exports = require('./dist/index.js').default;\n","\"use strict\";\n\nvar _interopRequireDefault = require(\"@babel/runtime/helpers/interopRequireDefault\");\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = void 0;\n\nvar _arrayPrototype = _interopRequireDefault(require(\"array.prototype.flat\"));\n\nvar _globalCache = _interopRequireDefault(require(\"global-cache\"));\n\nvar _constants = require(\"./utils/constants\");\n\nvar _getClassName = _interopRequireDefault(require(\"./utils/getClassName\"));\n\nvar _separateStyles2 = _interopRequireDefault(require(\"./utils/separateStyles\"));\n\n/**\n * Function required as part of the react-with-styles interface. Parses the styles provided by\n * react-with-styles to produce class names based on the style name and optionally the namespace if\n * available.\n *\n * stylesObject {Object} The styles object passed to withStyles.\n *\n * Return an object mapping style names to class names.\n */\nfunction create(stylesObject) {\n var stylesToClasses = {};\n var styleNames = Object.keys(stylesObject);\n var sharedState = _globalCache[\"default\"].get(_constants.GLOBAL_CACHE_KEY) || {};\n var _sharedState$namespac = sharedState.namespace,\n namespace = _sharedState$namespac === void 0 ? '' : _sharedState$namespac;\n styleNames.forEach(function (styleName) {\n var className = (0, _getClassName[\"default\"])(namespace, styleName);\n stylesToClasses[styleName] = className;\n });\n return stylesToClasses;\n}\n/**\n * Process styles to be consumed by a component.\n *\n * stylesArray {Array} Array of the following: values returned by create, plain JavaScript objects\n * representing inline styles, or arrays thereof.\n *\n * Return an object with optional className and style properties to be spread on a component.\n */\n\n\nfunction resolve(stylesArray) {\n var flattenedStyles = (0, _arrayPrototype[\"default\"])(stylesArray, Infinity);\n\n var _separateStyles = (0, _separateStyles2[\"default\"])(flattenedStyles),\n classNames = _separateStyles.classNames,\n hasInlineStyles = _separateStyles.hasInlineStyles,\n inlineStyles = _separateStyles.inlineStyles;\n\n var specificClassNames = classNames.map(function (name, index) {\n return \"\".concat(name, \" \").concat(name, \"_\").concat(index + 1);\n });\n var className = specificClassNames.join(' ');\n var result = {\n className: className\n };\n if (hasInlineStyles) result.style = inlineStyles;\n return result;\n}\n\nvar _default = {\n create: create,\n resolve: resolve\n};\nexports[\"default\"] = _default;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.MAX_SPECIFICITY = exports.GLOBAL_CACHE_KEY = void 0;\nvar GLOBAL_CACHE_KEY = 'reactWithStylesInterfaceCSS';\nexports.GLOBAL_CACHE_KEY = GLOBAL_CACHE_KEY;\nvar MAX_SPECIFICITY = 20;\nexports.MAX_SPECIFICITY = MAX_SPECIFICITY;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = getClassName;\n\n/**\n * Construct a class name.\n *\n * namespace {String} Used to construct unique class names.\n * styleName {String} Name identifying the specific style.\n *\n * Return the class name.\n */\nfunction getClassName(namespace, styleName) {\n var namespaceSegment = namespace.length > 0 ? \"\".concat(namespace, \"__\") : '';\n return \"\".concat(namespaceSegment).concat(styleName);\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports[\"default\"] = void 0;\n\n// This function takes an array of styles and separates them into styles that\n// are handled by Aphrodite and inline styles.\nfunction separateStyles(stylesArray) {\n var classNames = []; // Since determining if an Object is empty requires collecting all of its\n // keys, and we want the best performance in this code because we are in the\n // render path, we are going to do a little bookkeeping ourselves.\n\n var hasInlineStyles = false;\n var inlineStyles = {}; // This is run on potentially every node in the tree when rendering, where\n // performance is critical. Normally we would prefer using `forEach`, but\n // old-fashioned for loops are faster so that's what we have chosen here.\n\n for (var i = 0; i < stylesArray.length; i++) {\n // eslint-disable-line no-plusplus\n var style = stylesArray[i]; // If this style is falsy, we just want to disregard it. This allows for\n // syntax like:\n //\n // css(isFoo && styles.foo)\n\n if (style) {\n if (typeof style === 'string') {\n classNames.push(style);\n } else {\n Object.assign(inlineStyles, style);\n hasInlineStyles = true;\n }\n }\n }\n\n return {\n classNames: classNames,\n hasInlineStyles: hasInlineStyles,\n inlineStyles: inlineStyles\n };\n}\n\nvar _default = separateStyles;\nexports[\"default\"] = _default;"],"sourceRoot":""}