"use strict";var e=require("postcss"),t=require("purgecss");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var s=o(e),r=o(t);async function n(e,o,{result:s}){const n=new r.default,c={...t.defaultOptions,...e,safelist:t.standardizeSafelist(null==e?void 0:e.safelist)};e&&"function"==typeof e.contentFunction&&(c.content=e.contentFunction(o.source&&o.source.input.file||"")),n.options=c;const{content:i,extractors:u}=c,a=i.filter((e=>"string"==typeof e)),l=i.filter((e=>"object"==typeof e)),p=await n.extractSelectorsFromFiles(a,u),f=await n.extractSelectorsFromString(l,u),d=t.mergeExtractorSelectors(p,f);n.walkThroughCSS(o,d),n.options.fontFace&&n.removeUnusedFontFaces(),n.options.keyframes&&n.removeUnusedKeyframes(),n.options.variables&&n.removeUnusedCSSVariables(),n.options.rejected&&n.selectorsRemoved.size>0&&(s.messages.push({type:"purgecss",plugin:"postcss-purgecss",text:`purging ${n.selectorsRemoved.size} selectors:\n          ${Array.from(n.selectorsRemoved).map((e=>e.trim())).join("\n  ")}`}),n.selectorsRemoved.clear())}const c=function(e){if(void 0===e)throw new Error("PurgeCSS plugin does not have the correct options");return{postcssPlugin:"postcss-purgecss",Once:(t,o)=>n(e,t,o)}};c.postcss=!0;var i,u=function(e){return void 0!==e.Root}(i=s.default)?c:i.plugin("postcss-purgecss",(e=>{if(void 0===e)throw new Error("PurgeCSS plugin does not have the correct options");return async function(t,o){return n(e,t,o)}}));module.exports=u;
