'use strict';var a=n=>n>0&&n<1?n.toString().replace("0.","."):String(n),x=(n,i)=>{let t=n.split("");return i!==1?t[1]===t[2]&&t[3]===t[4]&&t[5]===t[6]&&t[7]===t[8]?`#${t[1]}${t[3]}${t[5]}${t[7]}`:null:t[1]===t[2]&&t[3]===t[4]&&t[5]===t[6]?`#${t[1]}${t[3]}${t[5]}`:null},y=n=>{let i=Math.round(n*255);return Math.round(i/255*100)===Math.round(n*100)},H=n=>{n.prototype.minify=function(i={}){let t={hex:true,rgb:true,hsl:true,...i},{r:h,g:u,b:c}=this.toRgb(),o=this.alpha(),l=this.toHex(),r=[];if(t.hex&&(o===1||t.alphaHex&&y(o))){let e=x(l,o);r.push(e??l);}if(t.rgb){let e=a(o);r.push(o===1?`rgb(${h},${u},${c})`:`rgba(${h},${u},${c},${e})`);}if(t.hsl){let e=a(o);for(let s=0;s<=2;s++){let{h:b,s:d,l:m}=this.toHsl(s),f=a(b),p=a(d),g=a(m),$=o===1?`hsl(${f},${p}%,${g}%)`:`hsla(${f},${p}%,${g}%,${e})`;if(new n($).toHex()===l){r.push($);break}}}if(t.transparent&&h===0&&u===0&&c===0&&o===0)r.push("transparent");else if(o===1&&t.name&&typeof this.toName=="function"){let e=this.toName();e&&r.push(e);}return r.length===0?l:r.reduce((e,s)=>s.length<e.length?s:e)};},M=H;module.exports=M;//# sourceMappingURL=minify.cjs.map
//# sourceMappingURL=minify.cjs.map