mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-22 16:35:14 +00:00
1 line
5.8 KiB
JSON
1 line
5.8 KiB
JSON
{"ast":null,"code":"import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport responsivePropType from './responsivePropType';\nimport { handleBreakpoints } from './breakpoints';\n\nfunction getPath(obj, path) {\n if (!path || typeof path !== 'string') {\n return null;\n }\n\n return path.split('.').reduce(function (acc, item) {\n return acc && acc[item] ? acc[item] : null;\n }, obj);\n}\n\nfunction style(options) {\n var prop = options.prop,\n _options$cssProperty = options.cssProperty,\n cssProperty = _options$cssProperty === void 0 ? options.prop : _options$cssProperty,\n themeKey = options.themeKey,\n transform = options.transform;\n\n var fn = function fn(props) {\n if (props[prop] == null) {\n return null;\n }\n\n var propValue = props[prop];\n var theme = props.theme;\n var themeMapping = getPath(theme, themeKey) || {};\n\n var styleFromPropValue = function styleFromPropValue(propValueFinal) {\n var value;\n\n if (typeof themeMapping === 'function') {\n value = themeMapping(propValueFinal);\n } else if (Array.isArray(themeMapping)) {\n value = themeMapping[propValueFinal] || propValueFinal;\n } else {\n value = getPath(themeMapping, propValueFinal) || propValueFinal;\n\n if (transform) {\n value = transform(value);\n }\n }\n\n if (cssProperty === false) {\n return value;\n }\n\n return _defineProperty({}, cssProperty, value);\n };\n\n return handleBreakpoints(props, propValue, styleFromPropValue);\n };\n\n fn.propTypes = process.env.NODE_ENV !== 'production' ? _defineProperty({}, prop, responsivePropType) : {};\n fn.filterProps = [prop];\n return fn;\n}\n\nexport default style;","map":{"version":3,"sources":["/app/node_modules/@material-ui/system/esm/style.js"],"names":["_defineProperty","responsivePropType","handleBreakpoints","getPath","obj","path","split","reduce","acc","item","style","options","prop","_options$cssProperty","cssProperty","themeKey","transform","fn","props","propValue","theme","themeMapping","styleFromPropValue","propValueFinal","value","Array","isArray","propTypes","process","env","NODE_ENV","filterProps"],"mappings":"AAAA,OAAOA,eAAP,MAA4B,2CAA5B;AACA,OAAOC,kBAAP,M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AY,CAACE,cAAD,CAApB;AACD,OAFD,MAEO,IAAIE,KAAK,CAACC,OAAN,CAAcL,YAAd,CAAJ,EAAiC;AACtCG,QAAAA,KAAK,GAAGH,YAAY,CAACE,cAAD,CAAZ,IAAgCA,cAAxC;AACD,OAFM,MAEA;AACLC,QAAAA,KAAK,GAAGrB,OAAO,CAACkB,YAAD,EAAeE,cAAf,CAAP,IAAyCA,cAAjD;;AAEA,YAAIP,SAAJ,EAAe;AACbQ,UAAAA,KAAK,GAAGR,SAAS,CAACQ,KAAD,CAAjB;AACD;AACF;;AAED,UAAIV,WAAW,KAAK,KAApB,EAA2B;AACzB,eAAOU,KAAP;AACD;;AAED,aAAOxB,eAAe,CAAC,EAAD,EAAKc,WAAL,EAAkBU,KAAlB,CAAtB;AACD,KApBD;;AAsBA,WAAOtB,iBAAiB,CAACgB,KAAD,EAAQC,SAAR,EAAmBG,kBAAnB,CAAxB;AACD,GAhCD;;AAkCAL,EAAAA,EAAE,CAACU,SAAH,GAAeC,OAAO,CAACC,GAAR,CAAYC,QAAZ,KAAyB,YAAzB,GAAwC9B,eAAe,CAAC,EAAD,EAAKY,IAAL,EAAWX,kBAAX,CAAvD,GAAwF,EAAvG;AACAgB,EAAAA,EAAE,CAACc,WAAH,GAAiB,CAACnB,IAAD,CAAjB;AACA,SAAOK,EAAP;AACD;;AAED,eAAeP,KAAf","sourcesContent":["import _defineProperty from \"@babel/runtime/helpers/esm/defineProperty\";\nimport responsivePropType from './responsivePropType';\nimport { handleBreakpoints } from './breakpoints';\n\nfunction getPath(obj, path) {\n if (!path || typeof path !== 'string') {\n return null;\n }\n\n return path.split('.').reduce(function (acc, item) {\n return acc && acc[item] ? acc[item] : null;\n }, obj);\n}\n\nfunction style(options) {\n var prop = options.prop,\n _options$cssProperty = options.cssProperty,\n cssProperty = _options$cssProperty === void 0 ? options.prop : _options$cssProperty,\n themeKey = options.themeKey,\n transform = options.transform;\n\n var fn = function fn(props) {\n if (props[prop] == null) {\n return null;\n }\n\n var propValue = props[prop];\n var theme = props.theme;\n var themeMapping = getPath(theme, themeKey) || {};\n\n var styleFromPropValue = function styleFromPropValue(propValueFinal) {\n var value;\n\n if (typeof themeMapping === 'function') {\n value = themeMapping(propValueFinal);\n } else if (Array.isArray(themeMapping)) {\n value = themeMapping[propValueFinal] || propValueFinal;\n } else {\n value = getPath(themeMapping, propValueFinal) || propValueFinal;\n\n if (transform) {\n value = transform(value);\n }\n }\n\n if (cssProperty === false) {\n return value;\n }\n\n return _defineProperty({}, cssProperty, value);\n };\n\n return handleBreakpoints(props, propValue, styleFromPropValue);\n };\n\n fn.propTypes = process.env.NODE_ENV !== 'production' ? _defineProperty({}, prop, responsivePropType) : {};\n fn.filterProps = [prop];\n return fn;\n}\n\nexport default style;"]},"metadata":{},"sourceType":"module"} |