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pB,IAAI,IAAI,KAAK,EACZ,GAAI,EAAI,KAAO,EACd,OAAO,EAIV,OAAO,CACR,CASK,CAAa,EAAU,EAAK,QAAQ,IAChC,EAGD,EAtCT,SAAuB,GACtB,OAAO,EAAS,MAAM,KAAK,KAAK,KAAK,EAAK,OAAS,IACpD,CAoCwB,CAAc,GACrC,GAED,GAED,CAED","file":"/npm/rework-namespace-css-multiple@0.2.0/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/rework-namespace-css-multiple@0.2.0/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","// WF Prefixer\r\n// -------------------------\r\n\r\n// Forked by @pvoznyuk\r\n// Added ability to add multiple selectors & roots\r\n\r\n// Built on Rework. Can prefix selectors and classes.\r\n// Options:\r\n// \r\n// \t\tclass: all classes will have this string prepended to them\r\n// \t\tselector: all selectors will have this string prepended to them (except html) \r\n// \t\tnamespaceHtml: should html have prefix appended to it directly? or with a space (eg. descendant)?\r\n// \t\tnamespaceBody: should body selectors also have a non-body prefixed version \r\n// \t\troot: the element to treat as the highest level. Defaults to html\r\n\r\n// TODO @geordiemhall: Implement keyframes option \r\n\r\n\r\nvar walk = require('rework-walk');\r\n\r\n\r\nmodule.exports = function prefix(options) {\r\n\r\n\tvar opts = options || {}\r\n\tvar regBody = /(?:\\s+|^)body(?:\\s+|$|\\.|\\:){1}/\r\n\tvar regHtml = /(?:\\s+|^)html(?:\\s+|$|\\.|\\:){1}/\r\n\r\n\tif(opts.ignore && typeof opts.ignore != 'object'){\r\n\t\topts.ignore = [opts.ignore]\r\n\t}\r\n\r\n\treturn function prefix(style) {\r\n\r\n\t\tfunction prefixSelector(selector){\r\n\r\n\t\t\tvar sel = selector\r\n\r\n\r\n\r\n\t\t\tif (opts.namespaceBody !== false){\r\n\t\t\t\t// Replace body with .body\r\n\t\t\t\tsel = sel.replace(regBody, function(s){\r\n\t\t\t\t\treturn s.replace('body', '.body')\r\n\t\t\t\t})\r\n\t\t\t}\r\n\r\n\t\t\tif (opts.namespaceHtml !== false){\r\n\t\t\t\t// Replace html with .html\r\n\t\t\t\tsel = sel.replace(regHtml, function(s){\r\n\t\t\t\t\treturn s.replace('html', '.html')\r\n\t\t\t\t})\r\n\t\t\t}\r\n\r\n\t\t\tif (opts.selector){\r\n\r\n\t\t\t\tvar root = opts.root || 'html'\r\n\t\t\t\tvar selStack = [];\r\n\r\n\t\t\t\t// TODO: This method would only replace the first instance of root,\r\n\t\t\t\t// so there is a rare bug when there are two classes that both contain root.\r\n\t\t\t\t// eg. if root is 'html' and an element has the class .html5.html\r\n\r\n\t\t\t\tif(typeof opts.selector != 'object'){\r\n\t\t\t\t\topts.selector = [opts.selector]\r\n\t\t\t\t}\r\n\t\t\t\tif(typeof opts.root != 'object'){\r\n\t\t\t\t\topts.root = [opts.root]\r\n\t\t\t\t}\r\n\r\n\t\t\t\tvar selRoot = getRootFromSelector(sel,root);\r\n\r\n\t\t\t\tfor( i in opts.selector){\r\n\t\t\t\t\t// Add prefix to selector, adding it to the .html part instead of prepending if needed\r\n\t\t\t\t\tif (selRoot){\r\n\t\t\t\t\t\tselStack.push(sel.replace(selRoot, selRoot + opts.selector[i]));\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tselStack.push(opts.selector[i] + ' ' + sel);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tif(selStack.length){\r\n\t\t\t\treturn selStack.join(',');\r\n\t\t\t} else {\r\n\t\t\t\treturn sel;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tfunction prefixClasses(selector){\r\n\t\t\treturn selector.split('.').join('.'+(opts.class || ''))\r\n\t\t}\r\n\r\n\t\tfunction getRootFromSelector(_sel,_roots){\r\n\t\t\tfor(i in _roots){\r\n\t\t\t\tif (_sel.indexOf(_roots[i]) >= 0){\r\n\t\t\t\t\treturn _roots[i];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t// Walk all styles\r\n\t\twalk(style, function(rule, node) {\r\n\r\n\t\t\tfunction ifSelInArray(sel,arr){\r\n\t\t\t\tif(sel && arr && arr.length){\r\n\t\t\t\t\tfor(var j in arr){\r\n\t\t\t\t\t\tif( arr[j] === sel ){\r\n\t\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn false\r\n\t\t\t}\r\n\r\n\t\t\t// Don't touch keyframes or font-face\r\n\t\t\tif (!rule.selectors || rule.selectors.toString().indexOf('@') >= 0 )\r\n\t\t\t\treturn rule;\r\n\r\n\t\t\trule.selectors = rule.selectors.map(function(selector) {\r\n\r\n\t\t\t\t// skip ignored selectors\r\n\t\t\t\tif( ifSelInArray(selector, opts.ignore||[] ) ){\r\n\t\t\t\t\treturn selector;\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn prefixSelector(prefixClasses(selector))\r\n\t\t\t});\r\n\r\n\t\t});\r\n\r\n\t}\r\n\r\n};"]}