GoScrobble/web/node_modules/jss-plugin-nested/dist/jss-plugin-nested.min.js

2 lines
1.4 KiB
JavaScript

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).jssPluginNested={})}(this,(function(e){"use strict";function t(){return(t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var n=/\s*,\s*/g,r=/&/g,o=/\$([\w-]+)/g;e.default=function(){function e(e,t){return function(n,r){var o=e.getRule(r)||t&&t.getRule(r);return o?(o=o).selector:r}}function i(e,t){for(var o=t.split(n),i=e.split(n),l="",f=0;f<o.length;f++)for(var s=o[f],u=0;u<i.length;u++){var a=i[u];l&&(l+=", "),l+=-1!==a.indexOf("&")?a.replace(r,s):s+" "+a}return l}function l(e,n,r){if(r)return t({},r,{index:r.index+1});var o=e.options.nestingLevel;o=void 0===o?1:o+1;var i=t({},e.options,{nestingLevel:o,index:n.indexOf(e)+1});return delete i.name,i}return{onProcessStyle:function(n,r,f){if("style"!==r.type)return n;var s,u,a=r,d=a.options.parent;for(var c in n){var p=-1!==c.indexOf("&"),v="@"===c[0];if(p||v){if(s=l(a,d,s),p){var g=i(c,a.selector);u||(u=e(d,f)),g=g.replace(o,u),d.addRule(g,n[c],t({},s,{selector:g}))}else v&&d.addRule(c,{},s).addRule(a.key,n[c],{selector:a.selector});delete n[c]}}return n}}},Object.defineProperty(e,"__esModule",{value:!0})}));