@salty-css/react 0.0.1-alpha.256 → 0.0.1-alpha.258

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/class-name.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./styles-generator-CihJA9Kx.cjs");class u extends i.StylesGenerator{constructor(s){super(s),this._params=s}}const m=t=>{const s=new u(t),r=a=>{const e=new String(a);return Object.assign(e,{get isClassName(){return!0},variant:(n,c)=>{const o=`${n}-${c}`,l=`${e} ${o}`;return r(l)},generator:s}),e};return r(s.cssClassName)};exports.className=m;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./styles-generator-E48FU2R-.cjs");class u extends i.StylesGenerator{constructor(s){super(s),this._params=s}}const m=t=>{const s=new u(t),r=a=>{const e=new String(a);return Object.assign(e,{get isClassName(){return!0},variant:(n,c)=>{const o=`${n}-${c}`,l=`${e} ${o}`;return r(l)},generator:s}),e};return r(s.cssClassName)};exports.className=m;
package/class-name.js CHANGED
@@ -1,4 +1,4 @@
1
- import { S as i } from "./styles-generator-BQCMgM_V.js";
1
+ import { S as i } from "./styles-generator-Cz2vkKB0.js";
2
2
  class m extends i {
3
3
  constructor(s) {
4
4
  super(s), this._params = s;
package/helpers.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var A=Object.defineProperty;var S=(e,t,n)=>t in e?A(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var _=(e,t,n)=>S(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},O=Object.create(null);for(const e in k)Object.hasOwn(k,e)&&(O[k[e]]=e);const d={to:{},get:{}};d.get=function(e){const t=e.slice(0,3).toLowerCase();let n,r;switch(t){case"hsl":{n=d.get.hsl(e),r="hsl";break}case"hwb":{n=d.get.hwb(e),r="hwb";break}default:{n=d.get.rgb(e),r="rgb";break}}return n?{model:r,value:n}:null};d.get.rgb=function(e){if(!e)return null;const t=/^#([a-f\d]{3,4})$/i,n=/^#([a-f\d]{6})([a-f\d]{2})?$/i,r=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/,o=/^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/,l=/^(\w+)$/;let s=[0,0,0,1],a,i,u;if(a=e.match(n)){for(u=a[2],a=a[1],i=0;i<3;i++){const m=i*2;s[i]=Number.parseInt(a.slice(m,m+2),16)}u&&(s[3]=Number.parseInt(u,16)/255)}else if(a=e.match(t)){for(a=a[1],u=a[3],i=0;i<3;i++)s[i]=Number.parseInt(a[i]+a[i],16);u&&(s[3]=Number.parseInt(u+u,16)/255)}else if(a=e.match(r)){for(i=0;i<3;i++)s[i]=Number.parseInt(a[i+1],10);a[4]&&(s[3]=a[5]?Number.parseFloat(a[4])*.01:Number.parseFloat(a[4]))}else if(a=e.match(o)){for(i=0;i<3;i++)s[i]=Math.round(Number.parseFloat(a[i+1])*2.55);a[4]&&(s[3]=a[5]?Number.parseFloat(a[4])*.01:Number.parseFloat(a[4]))}else return(a=e.match(l))?a[1]==="transparent"?[0,0,0,0]:Object.hasOwn(k,a[1])?(s=k[a[1]],s[3]=1,s):null:null;for(i=0;i<3;i++)s[i]=w(s[i],0,255);return s[3]=w(s[3],0,1),s};d.get.hsl=function(e){if(!e)return null;const t=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,n=e.match(t);if(n){const r=Number.parseFloat(n[4]),o=(Number.parseFloat(n[1])%360+360)%360,l=w(Number.parseFloat(n[2]),0,100),s=w(Number.parseFloat(n[3]),0,100),a=w(Number.isNaN(r)?1:r,0,1);return[o,l,s,a]}return null};d.get.hwb=function(e){if(!e)return null;const t=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d.]+)%\s*,\s*([+-]?[\d.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,n=e.match(t);if(n){const r=Number.parseFloat(n[4]),o=(Number.parseFloat(n[1])%360+360)%360,l=w(Number.parseFloat(n[2]),0,100),s=w(Number.parseFloat(n[3]),0,100),a=w(Number.isNaN(r)?1:r,0,1);return[o,l,s,a]}return null};d.to.hex=function(...e){return"#"+x(e[0])+x(e[1])+x(e[2])+(e[3]<1?x(Math.round(e[3]*255)):"")};d.to.rgb=function(...e){return e.length<4||e[3]===1?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"};d.to.rgb.percent=function(...e){const t=Math.round(e[0]/255*100),n=Math.round(e[1]/255*100),r=Math.round(e[2]/255*100);return e.length<4||e[3]===1?"rgb("+t+"%, "+n+"%, "+r+"%)":"rgba("+t+"%, "+n+"%, "+r+"%, "+e[3]+")"};d.to.hsl=function(...e){return e.length<4||e[3]===1?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"};d.to.hwb=function(...e){let t="";return e.length>=4&&e[3]!==1&&(t=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"};d.to.keyword=function(...e){return O[e.slice(0,3)]};function w(e,t,n){return Math.min(Math.max(t,e),n)}function x(e){const t=Math.round(e).toString(16).toUpperCase();return t.length<2?"0"+t:t}const M={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},q={};for(const e of Object.keys(M))q[M[e]]=e;const c={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}},y=(6/29)**3;for(const e of Object.keys(c)){if(!("channels"in c[e]))throw new Error("missing channels property: "+e);if(!("labels"in c[e]))throw new Error("missing channel labels property: "+e);if(c[e].labels.length!==c[e].channels)throw new Error("channel and label counts mismatch: "+e);const{channels:t,labels:n}=c[e];delete c[e].channels,delete c[e].labels,Object.defineProperty(c[e],"channels",{value:t}),Object.defineProperty(c[e],"labels",{value:n})}c.rgb.hsl=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,o=Math.min(t,n,r),l=Math.max(t,n,r),s=l-o;let a,i;switch(l){case o:{a=0;break}case t:{a=(n-r)/s;break}case n:{a=2+(r-t)/s;break}case r:{a=4+(t-n)/s;break}}a=Math.min(a*60,360),a<0&&(a+=360);const u=(o+l)/2;return l===o?i=0:u<=.5?i=s/(l+o):i=s/(2-l-o),[a,i*100,u*100]};c.rgb.hsv=function(e){let t,n,r,o,l;const s=e[0]/255,a=e[1]/255,i=e[2]/255,u=Math.max(s,a,i),m=u-Math.min(s,a,i),p=function(z){return(u-z)/6/m+1/2};if(m===0)o=0,l=0;else{switch(l=m/u,t=p(s),n=p(a),r=p(i),u){case s:{o=r-n;break}case a:{o=1/3+t-r;break}case i:{o=2/3+n-t;break}}o<0?o+=1:o>1&&(o-=1)}return[o*360,l*100,u*100]};c.rgb.hwb=function(e){const t=e[0],n=e[1];let r=e[2];const o=c.rgb.hsl(e)[0],l=1/255*Math.min(t,Math.min(n,r));return r=1-1/255*Math.max(t,Math.max(n,r)),[o,l*100,r*100]};c.rgb.cmyk=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,o=Math.min(1-t,1-n,1-r),l=(1-t-o)/(1-o)||0,s=(1-n-o)/(1-o)||0,a=(1-r-o)/(1-o)||0;return[l*100,s*100,a*100,o*100]};function P(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}c.rgb.keyword=function(e){const t=q[e];if(t)return t;let n=Number.POSITIVE_INFINITY,r;for(const o of Object.keys(M)){const l=M[o],s=P(e,l);s<n&&(n=s,r=o)}return r};c.keyword.rgb=function(e){return M[e]};c.rgb.xyz=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255;t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92;const o=t*.4124564+n*.3575761+r*.1804375,l=t*.2126729+n*.7151522+r*.072175,s=t*.0193339+n*.119192+r*.9503041;return[o*100,l*100,s*100]};c.rgb.lab=function(e){const t=c.rgb.xyz(e);let n=t[0],r=t[1],o=t[2];n/=95.047,r/=100,o/=108.883,n=n>y?n**(1/3):7.787*n+16/116,r=r>y?r**(1/3):7.787*r+16/116,o=o>y?o**(1/3):7.787*o+16/116;const l=116*r-16,s=500*(n-r),a=200*(r-o);return[l,s,a]};c.hsl.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;let o,l;if(n===0)return l=r*255,[l,l,l];const s=r<.5?r*(1+n):r+n-r*n,a=2*r-s,i=[0,0,0];for(let u=0;u<3;u++)o=t+1/3*-(u-1),o<0&&o++,o>1&&o--,6*o<1?l=a+(s-a)*6*o:2*o<1?l=s:3*o<2?l=a+(s-a)*(2/3-o)*6:l=a,i[u]=l*255;return i};c.hsl.hsv=function(e){const t=e[0];let n=e[1]/100,r=e[2]/100,o=n;const l=Math.max(r,.01);r*=2,n*=r<=1?r:2-r,o*=l<=1?l:2-l;const s=(r+n)/2,a=r===0?2*o/(l+o):2*n/(r+n);return[t,a*100,s*100]};c.hsv.rgb=function(e){const t=e[0]/60,n=e[1]/100;let r=e[2]/100;const o=Math.floor(t)%6,l=t-Math.floor(t),s=255*r*(1-n),a=255*r*(1-n*l),i=255*r*(1-n*(1-l));switch(r*=255,o){case 0:return[r,i,s];case 1:return[a,r,s];case 2:return[s,r,i];case 3:return[s,a,r];case 4:return[i,s,r];case 5:return[r,s,a]}};c.hsv.hsl=function(e){const t=e[0],n=e[1]/100,r=e[2]/100,o=Math.max(r,.01);let l,s;s=(2-n)*r;const a=(2-n)*o;return l=n*o,l/=a<=1?a:2-a,l=l||0,s/=2,[t,l*100,s*100]};c.hwb.rgb=function(e){const t=e[0]/360;let n=e[1]/100,r=e[2]/100;const o=n+r;let l;o>1&&(n/=o,r/=o);const s=Math.floor(6*t),a=1-r;l=6*t-s,(s&1)!==0&&(l=1-l);const i=n+l*(a-n);let u,m,p;switch(s){default:case 6:case 0:{u=a,m=i,p=n;break}case 1:{u=i,m=a,p=n;break}case 2:{u=n,m=a,p=i;break}case 3:{u=n,m=i,p=a;break}case 4:{u=i,m=n,p=a;break}case 5:{u=a,m=n,p=i;break}}return[u*255,m*255,p*255]};c.cmyk.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100,o=e[3]/100,l=1-Math.min(1,t*(1-o)+o),s=1-Math.min(1,n*(1-o)+o),a=1-Math.min(1,r*(1-o)+o);return[l*255,s*255,a*255]};c.xyz.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100;let o,l,s;return o=t*3.2404542+n*-1.5371385+r*-.4985314,l=t*-.969266+n*1.8760108+r*.041556,s=t*.0556434+n*-.2040259+r*1.0572252,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,l=l>.0031308?1.055*l**(1/2.4)-.055:l*12.92,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,o=Math.min(Math.max(0,o),1),l=Math.min(Math.max(0,l),1),s=Math.min(Math.max(0,s),1),[o*255,l*255,s*255]};c.xyz.lab=function(e){let t=e[0],n=e[1],r=e[2];t/=95.047,n/=100,r/=108.883,t=t>y?t**(1/3):7.787*t+16/116,n=n>y?n**(1/3):7.787*n+16/116,r=r>y?r**(1/3):7.787*r+16/116;const o=116*n-16,l=500*(t-n),s=200*(n-r);return[o,l,s]};c.lab.xyz=function(e){const t=e[0],n=e[1],r=e[2];let o,l,s;l=(t+16)/116,o=n/500+l,s=l-r/200;const a=l**3,i=o**3,u=s**3;return l=a>y?a:(l-16/116)/7.787,o=i>y?i:(o-16/116)/7.787,s=u>y?u:(s-16/116)/7.787,o*=95.047,l*=100,s*=108.883,[o,l,s]};c.lab.lch=function(e){const t=e[0],n=e[1],r=e[2];let o;o=Math.atan2(r,n)*360/2/Math.PI,o<0&&(o+=360);const s=Math.sqrt(n*n+r*r);return[t,s,o]};c.lch.lab=function(e){const t=e[0],n=e[1],o=e[2]/360*2*Math.PI,l=n*Math.cos(o),s=n*Math.sin(o);return[t,l,s]};c.rgb.ansi16=function(e,t=null){const[n,r,o]=e;let l=t===null?c.rgb.hsv(e)[2]:t;if(l=Math.round(l/50),l===0)return 30;let s=30+(Math.round(o/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return l===2&&(s+=60),s};c.hsv.ansi16=function(e){return c.rgb.ansi16(c.hsv.rgb(e),e[2])};c.rgb.ansi256=function(e){const t=e[0],n=e[1],r=e[2];return t>>4===n>>4&&n>>4===r>>4?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)};c.ansi16.rgb=function(e){e=e[0];let t=e%10;if(t===0||t===7)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];const n=(Math.trunc(e>50)+1)*.5,r=(t&1)*n*255,o=(t>>1&1)*n*255,l=(t>>2&1)*n*255;return[r,o,l]};c.ansi256.rgb=function(e){if(e=e[0],e>=232){const l=(e-232)*10+8;return[l,l,l]}e-=16;let t;const n=Math.floor(e/36)/5*255,r=Math.floor((t=e%36)/6)/5*255,o=t%6/5*255;return[n,r,o]};c.rgb.hex=function(e){const n=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return"000000".slice(n.length)+n};c.hex.rgb=function(e){const t=e.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!t)return[0,0,0];let n=t[0];t[0].length===3&&(n=[...n].map(a=>a+a).join(""));const r=Number.parseInt(n,16),o=r>>16&255,l=r>>8&255,s=r&255;return[o,l,s]};c.rgb.hcg=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,o=Math.max(Math.max(t,n),r),l=Math.min(Math.min(t,n),r),s=o-l;let a;const i=s<1?l/(1-s):0;return s<=0?a=0:o===t?a=(n-r)/s%6:o===n?a=2+(r-t)/s:a=4+(t-n)/s,a/=6,a%=1,[a*360,s*100,i*100]};c.hsl.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=n<.5?2*t*n:2*t*(1-n);let o=0;return r<1&&(o=(n-.5*r)/(1-r)),[e[0],r*100,o*100]};c.hsv.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=t*n;let o=0;return r<1&&(o=(n-r)/(1-r)),[e[0],r*100,o*100]};c.hcg.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;if(n===0)return[r*255,r*255,r*255];const o=[0,0,0],l=t%1*6,s=l%1,a=1-s;let i=0;switch(Math.floor(l)){case 0:{o[0]=1,o[1]=s,o[2]=0;break}case 1:{o[0]=a,o[1]=1,o[2]=0;break}case 2:{o[0]=0,o[1]=1,o[2]=s;break}case 3:{o[0]=0,o[1]=a,o[2]=1;break}case 4:{o[0]=s,o[1]=0,o[2]=1;break}default:o[0]=1,o[1]=0,o[2]=a}return i=(1-n)*r,[(n*o[0]+i)*255,(n*o[1]+i)*255,(n*o[2]+i)*255]};c.hcg.hsv=function(e){const t=e[1]/100,n=e[2]/100,r=t+n*(1-t);let o=0;return r>0&&(o=t/r),[e[0],o*100,r*100]};c.hcg.hsl=function(e){const t=e[1]/100,r=e[2]/100*(1-t)+.5*t;let o=0;return r>0&&r<.5?o=t/(2*r):r>=.5&&r<1&&(o=t/(2*(1-r))),[e[0],o*100,r*100]};c.hcg.hwb=function(e){const t=e[1]/100,n=e[2]/100,r=t+n*(1-t);return[e[0],(r-t)*100,(1-r)*100]};c.hwb.hcg=function(e){const t=e[1]/100,r=1-e[2]/100,o=r-t;let l=0;return o<1&&(l=(r-o)/(1-o)),[e[0],o*100,l*100]};c.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};c.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};c.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};c.gray.hsl=function(e){return[0,0,e[0]]};c.gray.hsv=c.gray.hsl;c.gray.hwb=function(e){return[0,100,e[0]]};c.gray.cmyk=function(e){return[0,0,0,e[0]]};c.gray.lab=function(e){return[e[0],0,0]};c.gray.hex=function(e){const t=Math.round(e[0]/100*255)&255,r=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".slice(r.length)+r};c.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};function $(){const e={},t=Object.keys(c);for(let{length:n}=t,r=0;r<n;r++)e[t[r]]={distance:-1,parent:null};return e}function I(e){const t=$(),n=[e];for(t[e].distance=0;n.length>0;){const r=n.pop(),o=Object.keys(c[r]);for(let{length:l}=o,s=0;s<l;s++){const a=o[s],i=t[a];i.distance===-1&&(i.distance=t[r].distance+1,i.parent=r,n.unshift(a))}}return t}function j(e,t){return function(n){return t(e(n))}}function E(e,t){const n=[t[e].parent,e];let r=c[t[e].parent][e],o=t[e].parent;for(;t[o].parent;)n.unshift(t[o].parent),r=j(c[t[o].parent][o],r),o=t[o].parent;return r.conversion=n,r}function T(e){const t=I(e),n={},r=Object.keys(t);for(let{length:o}=r,l=0;l<o;l++){const s=r[l];t[s].parent!==null&&(n[s]=E(s,t))}return n}const g={},U=Object.keys(c);function V(e){const t=function(...n){const r=n[0];return r==null?r:(r.length>1&&(n=r),e(n))};return"conversion"in e&&(t.conversion=e.conversion),t}function D(e){const t=function(...n){const r=n[0];if(r==null)return r;r.length>1&&(n=r);const o=e(n);if(typeof o=="object")for(let{length:l}=o,s=0;s<l;s++)o[s]=Math.round(o[s]);return o};return"conversion"in e&&(t.conversion=e.conversion),t}for(const e of U){g[e]={},Object.defineProperty(g[e],"channels",{value:c[e].channels}),Object.defineProperty(g[e],"labels",{value:c[e].labels});const t=T(e),n=Object.keys(t);for(const r of n){const o=t[r];g[e][r]=D(o),g[e][r].raw=V(o)}}const C=["keyword","gray","hex"],F={};for(const e of Object.keys(g))F[[...g[e].labels].sort().join("")]=e;const v={};function b(e,t){if(!(this instanceof b))return new b(e,t);if(t&&t in C&&(t=null),t&&!(t in g))throw new Error("Unknown model: "+t);let n,r;if(e==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(e instanceof b)this.model=e.model,this.color=[...e.color],this.valpha=e.valpha;else if(typeof e=="string"){const o=d.get(e);if(o===null)throw new Error("Unable to parse color from string: "+e);this.model=o.model,r=g[this.model].channels,this.color=o.value.slice(0,r),this.valpha=typeof o.value[r]=="number"?o.value[r]:1}else if(e.length>0){this.model=t||"rgb",r=g[this.model].channels;const o=Array.prototype.slice.call(e,0,r);this.color=N(o,r),this.valpha=typeof e[r]=="number"?e[r]:1}else if(typeof e=="number")this.model="rgb",this.color=[e>>16&255,e>>8&255,e&255],this.valpha=1;else{this.valpha=1;const o=Object.keys(e);"alpha"in e&&(o.splice(o.indexOf("alpha"),1),this.valpha=typeof e.alpha=="number"?e.alpha:0);const l=o.sort().join("");if(!(l in F))throw new Error("Unable to parse color from object: "+JSON.stringify(e));this.model=F[l];const{labels:s}=g[this.model],a=[];for(n=0;n<s.length;n++)a.push(e[s[n]]);this.color=N(a)}if(v[this.model])for(r=g[this.model].channels,n=0;n<r;n++){const o=v[this.model][n];o&&(this.color[n]=o(this.color[n]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}b.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(e){let t=this.model in d.to?this:this.rgb();t=t.round(typeof e=="number"?e:1);const n=t.valpha===1?t.color:[...t.color,this.valpha];return d.to[t.model](...n)},percentString(e){const t=this.rgb().round(typeof e=="number"?e:1),n=t.valpha===1?t.color:[...t.color,this.valpha];return d.to.rgb.percent(...n)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){const e={},{channels:t}=g[this.model],{labels:n}=g[this.model];for(let r=0;r<t;r++)e[n[r]]=this.color[r];return this.valpha!==1&&(e.alpha=this.valpha),e},unitArray(){const e=this.rgb().color;return e[0]/=255,e[1]/=255,e[2]/=255,this.valpha!==1&&e.push(this.valpha),e},unitObject(){const e=this.rgb().object();return e.r/=255,e.g/=255,e.b/=255,this.valpha!==1&&(e.alpha=this.valpha),e},round(e){return e=Math.max(e||0,0),new b([...this.color.map(B(e)),this.valpha],this.model)},alpha(e){return e!==void 0?new b([...this.color,Math.max(0,Math.min(1,e))],this.model):this.valpha},red:h("rgb",0,f(255)),green:h("rgb",1,f(255)),blue:h("rgb",2,f(255)),hue:h(["hsl","hsv","hsl","hwb","hcg"],0,e=>(e%360+360)%360),saturationl:h("hsl",1,f(100)),lightness:h("hsl",2,f(100)),saturationv:h("hsv",1,f(100)),value:h("hsv",2,f(100)),chroma:h("hcg",1,f(100)),gray:h("hcg",2,f(100)),white:h("hwb",1,f(100)),wblack:h("hwb",2,f(100)),cyan:h("cmyk",0,f(100)),magenta:h("cmyk",1,f(100)),yellow:h("cmyk",2,f(100)),black:h("cmyk",3,f(100)),x:h("xyz",0,f(95.047)),y:h("xyz",1,f(100)),z:h("xyz",2,f(108.833)),l:h("lab",0,f(100)),a:h("lab",1),b:h("lab",2),keyword(e){return e!==void 0?new b(e):g[this.model].keyword(this.color)},hex(e){return e!==void 0?new b(e):d.to.hex(...this.rgb().round().color)},hexa(e){if(e!==void 0)return new b(e);const t=this.rgb().round().color;let n=Math.round(this.valpha*255).toString(16).toUpperCase();return n.length===1&&(n="0"+n),d.to.hex(...t)+n},rgbNumber(){const e=this.rgb().color;return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255},luminosity(){const e=this.rgb().color,t=[];for(const[n,r]of e.entries()){const o=r/255;t[n]=o<=.04045?o/12.92:((o+.055)/1.055)**2.4}return .2126*t[0]+.7152*t[1]+.0722*t[2]},contrast(e){const t=this.luminosity(),n=e.luminosity();return t>n?(t+.05)/(n+.05):(n+.05)/(t+.05)},level(e){const t=this.contrast(e);return t>=7?"AAA":t>=4.5?"AA":""},isDark(){const e=this.rgb().color;return(e[0]*2126+e[1]*7152+e[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){const e=this.rgb();for(let t=0;t<3;t++)e.color[t]=255-e.color[t];return e},lighten(e){const t=this.hsl();return t.color[2]+=t.color[2]*e,t},darken(e){const t=this.hsl();return t.color[2]-=t.color[2]*e,t},saturate(e){const t=this.hsl();return t.color[1]+=t.color[1]*e,t},desaturate(e){const t=this.hsl();return t.color[1]-=t.color[1]*e,t},whiten(e){const t=this.hwb();return t.color[1]+=t.color[1]*e,t},blacken(e){const t=this.hwb();return t.color[2]+=t.color[2]*e,t},grayscale(){const e=this.rgb().color,t=e[0]*.3+e[1]*.59+e[2]*.11;return b.rgb(t,t,t)},fade(e){return this.alpha(this.valpha-this.valpha*e)},opaquer(e){return this.alpha(this.valpha+this.valpha*e)},rotate(e){const t=this.hsl();let n=t.color[0];return n=(n+e)%360,n=n<0?360+n:n,t.color[0]=n,t},mix(e,t){if(!e||!e.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof e);const n=e.rgb(),r=this.rgb(),o=t===void 0?.5:t,l=2*o-1,s=n.alpha()-r.alpha(),a=((l*s===-1?l:(l+s)/(1+l*s))+1)/2,i=1-a;return b.rgb(a*n.red()+i*r.red(),a*n.green()+i*r.green(),a*n.blue()+i*r.blue(),n.alpha()*o+r.alpha()*(1-o))}};for(const e of Object.keys(g)){if(C.includes(e))continue;const{channels:t}=g[e];b.prototype[e]=function(...n){return this.model===e?new b(this):n.length>0?new b(n,e):new b([...L(g[this.model][e].raw(this.color)),this.valpha],e)},b[e]=function(...n){let r=n[0];return typeof r=="number"&&(r=N(n,t)),new b(r,e)}}function K(e,t){return Number(e.toFixed(t))}function B(e){return function(t){return K(t,e)}}function h(e,t,n){e=Array.isArray(e)?e:[e];for(const r of e)(v[r]||(v[r]=[]))[t]=n;return e=e[0],function(r){let o;return r!==void 0?(n&&(r=n(r)),o=this[e](),o.color[t]=r,o):(o=this[e]().color[t],n&&(o=n(o)),o)}}function f(e){return function(t){return Math.max(0,Math.min(e,t))}}function L(e){return Array.isArray(e)?e:[e]}function N(e,t){for(let n=0;n<t;n++)typeof e[n]!="number"&&(e[n]=0);return e}class R{constructor(t){_(this,"isColor",!0);_(this,"currentColor");this.base=t;const n=this._resolveBaseColor(t);return this.currentColor=b(n),this._createProxy()}_createProxy(){return new Proxy(this,{get(t,n){return n in t?t[n]:n in t.currentColor?t._handleColorMethod(n):t[n]}})}_resolveBaseColor(t){if(typeof t!="string"||!/\{[^{}]+\}/g.test(t))return t;if(typeof saltyConfig>"u")return"transparent";const{staticVariables:r}=saltyConfig;return r?t.replace(/^\{|\}$/g,"").split(".").reduce((s,a)=>s[a],r):"transparent"}_handleColorMethod(t){const n=this.currentColor;return typeof n[t]!="function"?n[t]:(...r)=>(this.currentColor=n[t](...r),this._createProxy())}toString(){return this.currentColor.toString()}}const J=e=>new R(e),G=e=>t=>{const{screenSize:n,axis:r="horizontal",minMultiplier:o=.5,maxMultiplier:l=1.5}=e,s=Math.round(t/n*1e4)/100,a=r==="vertical"?"vh":"vw",i=Math.round(o*t),u=Math.round(l*t);return`clamp(${i}px, ${s}${a}, ${u}px)`};exports.color=J;exports.defineViewportClamp=G;
1
+ "use strict";var A=Object.defineProperty;var S=(e,t,n)=>t in e?A(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var _=(e,t,n)=>S(e,typeof t!="symbol"?t+"":t,n);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("./viewport-clamp-kY8JqYzm.cjs"),k={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},O=Object.create(null);for(const e in k)Object.hasOwn(k,e)&&(O[k[e]]=e);const d={to:{},get:{}};d.get=function(e){const t=e.slice(0,3).toLowerCase();let n,r;switch(t){case"hsl":{n=d.get.hsl(e),r="hsl";break}case"hwb":{n=d.get.hwb(e),r="hwb";break}default:{n=d.get.rgb(e),r="rgb";break}}return n?{model:r,value:n}:null};d.get.rgb=function(e){if(!e)return null;const t=/^#([a-f\d]{3,4})$/i,n=/^#([a-f\d]{6})([a-f\d]{2})?$/i,r=/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/,o=/^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/,l=/^(\w+)$/;let s=[0,0,0,1],a,i,u;if(a=e.match(n)){for(u=a[2],a=a[1],i=0;i<3;i++){const m=i*2;s[i]=Number.parseInt(a.slice(m,m+2),16)}u&&(s[3]=Number.parseInt(u,16)/255)}else if(a=e.match(t)){for(a=a[1],u=a[3],i=0;i<3;i++)s[i]=Number.parseInt(a[i]+a[i],16);u&&(s[3]=Number.parseInt(u+u,16)/255)}else if(a=e.match(r)){for(i=0;i<3;i++)s[i]=Number.parseInt(a[i+1],10);a[4]&&(s[3]=a[5]?Number.parseFloat(a[4])*.01:Number.parseFloat(a[4]))}else if(a=e.match(o)){for(i=0;i<3;i++)s[i]=Math.round(Number.parseFloat(a[i+1])*2.55);a[4]&&(s[3]=a[5]?Number.parseFloat(a[4])*.01:Number.parseFloat(a[4]))}else return(a=e.match(l))?a[1]==="transparent"?[0,0,0,0]:Object.hasOwn(k,a[1])?(s=k[a[1]],s[3]=1,s):null:null;for(i=0;i<3;i++)s[i]=w(s[i],0,255);return s[3]=w(s[3],0,1),s};d.get.hsl=function(e){if(!e)return null;const t=/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,n=e.match(t);if(n){const r=Number.parseFloat(n[4]),o=(Number.parseFloat(n[1])%360+360)%360,l=w(Number.parseFloat(n[2]),0,100),s=w(Number.parseFloat(n[3]),0,100),a=w(Number.isNaN(r)?1:r,0,1);return[o,l,s,a]}return null};d.get.hwb=function(e){if(!e)return null;const t=/^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d.]+)%\s*,\s*([+-]?[\d.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/,n=e.match(t);if(n){const r=Number.parseFloat(n[4]),o=(Number.parseFloat(n[1])%360+360)%360,l=w(Number.parseFloat(n[2]),0,100),s=w(Number.parseFloat(n[3]),0,100),a=w(Number.isNaN(r)?1:r,0,1);return[o,l,s,a]}return null};d.to.hex=function(...e){return"#"+x(e[0])+x(e[1])+x(e[2])+(e[3]<1?x(Math.round(e[3]*255)):"")};d.to.rgb=function(...e){return e.length<4||e[3]===1?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"};d.to.rgb.percent=function(...e){const t=Math.round(e[0]/255*100),n=Math.round(e[1]/255*100),r=Math.round(e[2]/255*100);return e.length<4||e[3]===1?"rgb("+t+"%, "+n+"%, "+r+"%)":"rgba("+t+"%, "+n+"%, "+r+"%, "+e[3]+")"};d.to.hsl=function(...e){return e.length<4||e[3]===1?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"};d.to.hwb=function(...e){let t="";return e.length>=4&&e[3]!==1&&(t=", "+e[3]),"hwb("+e[0]+", "+e[1]+"%, "+e[2]+"%"+t+")"};d.to.keyword=function(...e){return O[e.slice(0,3)]};function w(e,t,n){return Math.min(Math.max(t,e),n)}function x(e){const t=Math.round(e).toString(16).toUpperCase();return t.length<2?"0"+t:t}const M={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},q={};for(const e of Object.keys(M))q[M[e]]=e;const c={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}},y=(6/29)**3;for(const e of Object.keys(c)){if(!("channels"in c[e]))throw new Error("missing channels property: "+e);if(!("labels"in c[e]))throw new Error("missing channel labels property: "+e);if(c[e].labels.length!==c[e].channels)throw new Error("channel and label counts mismatch: "+e);const{channels:t,labels:n}=c[e];delete c[e].channels,delete c[e].labels,Object.defineProperty(c[e],"channels",{value:t}),Object.defineProperty(c[e],"labels",{value:n})}c.rgb.hsl=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,o=Math.min(t,n,r),l=Math.max(t,n,r),s=l-o;let a,i;switch(l){case o:{a=0;break}case t:{a=(n-r)/s;break}case n:{a=2+(r-t)/s;break}case r:{a=4+(t-n)/s;break}}a=Math.min(a*60,360),a<0&&(a+=360);const u=(o+l)/2;return l===o?i=0:u<=.5?i=s/(l+o):i=s/(2-l-o),[a,i*100,u*100]};c.rgb.hsv=function(e){let t,n,r,o,l;const s=e[0]/255,a=e[1]/255,i=e[2]/255,u=Math.max(s,a,i),m=u-Math.min(s,a,i),p=function(z){return(u-z)/6/m+1/2};if(m===0)o=0,l=0;else{switch(l=m/u,t=p(s),n=p(a),r=p(i),u){case s:{o=r-n;break}case a:{o=1/3+t-r;break}case i:{o=2/3+n-t;break}}o<0?o+=1:o>1&&(o-=1)}return[o*360,l*100,u*100]};c.rgb.hwb=function(e){const t=e[0],n=e[1];let r=e[2];const o=c.rgb.hsl(e)[0],l=1/255*Math.min(t,Math.min(n,r));return r=1-1/255*Math.max(t,Math.max(n,r)),[o,l*100,r*100]};c.rgb.cmyk=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,o=Math.min(1-t,1-n,1-r),l=(1-t-o)/(1-o)||0,s=(1-n-o)/(1-o)||0,a=(1-r-o)/(1-o)||0;return[l*100,s*100,a*100,o*100]};function I(e,t){return(e[0]-t[0])**2+(e[1]-t[1])**2+(e[2]-t[2])**2}c.rgb.keyword=function(e){const t=q[e];if(t)return t;let n=Number.POSITIVE_INFINITY,r;for(const o of Object.keys(M)){const l=M[o],s=I(e,l);s<n&&(n=s,r=o)}return r};c.keyword.rgb=function(e){return M[e]};c.rgb.xyz=function(e){let t=e[0]/255,n=e[1]/255,r=e[2]/255;t=t>.04045?((t+.055)/1.055)**2.4:t/12.92,n=n>.04045?((n+.055)/1.055)**2.4:n/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92;const o=t*.4124564+n*.3575761+r*.1804375,l=t*.2126729+n*.7151522+r*.072175,s=t*.0193339+n*.119192+r*.9503041;return[o*100,l*100,s*100]};c.rgb.lab=function(e){const t=c.rgb.xyz(e);let n=t[0],r=t[1],o=t[2];n/=95.047,r/=100,o/=108.883,n=n>y?n**(1/3):7.787*n+16/116,r=r>y?r**(1/3):7.787*r+16/116,o=o>y?o**(1/3):7.787*o+16/116;const l=116*r-16,s=500*(n-r),a=200*(r-o);return[l,s,a]};c.hsl.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;let o,l;if(n===0)return l=r*255,[l,l,l];const s=r<.5?r*(1+n):r+n-r*n,a=2*r-s,i=[0,0,0];for(let u=0;u<3;u++)o=t+1/3*-(u-1),o<0&&o++,o>1&&o--,6*o<1?l=a+(s-a)*6*o:2*o<1?l=s:3*o<2?l=a+(s-a)*(2/3-o)*6:l=a,i[u]=l*255;return i};c.hsl.hsv=function(e){const t=e[0];let n=e[1]/100,r=e[2]/100,o=n;const l=Math.max(r,.01);r*=2,n*=r<=1?r:2-r,o*=l<=1?l:2-l;const s=(r+n)/2,a=r===0?2*o/(l+o):2*n/(r+n);return[t,a*100,s*100]};c.hsv.rgb=function(e){const t=e[0]/60,n=e[1]/100;let r=e[2]/100;const o=Math.floor(t)%6,l=t-Math.floor(t),s=255*r*(1-n),a=255*r*(1-n*l),i=255*r*(1-n*(1-l));switch(r*=255,o){case 0:return[r,i,s];case 1:return[a,r,s];case 2:return[s,r,i];case 3:return[s,a,r];case 4:return[i,s,r];case 5:return[r,s,a]}};c.hsv.hsl=function(e){const t=e[0],n=e[1]/100,r=e[2]/100,o=Math.max(r,.01);let l,s;s=(2-n)*r;const a=(2-n)*o;return l=n*o,l/=a<=1?a:2-a,l=l||0,s/=2,[t,l*100,s*100]};c.hwb.rgb=function(e){const t=e[0]/360;let n=e[1]/100,r=e[2]/100;const o=n+r;let l;o>1&&(n/=o,r/=o);const s=Math.floor(6*t),a=1-r;l=6*t-s,(s&1)!==0&&(l=1-l);const i=n+l*(a-n);let u,m,p;switch(s){default:case 6:case 0:{u=a,m=i,p=n;break}case 1:{u=i,m=a,p=n;break}case 2:{u=n,m=a,p=i;break}case 3:{u=n,m=i,p=a;break}case 4:{u=i,m=n,p=a;break}case 5:{u=a,m=n,p=i;break}}return[u*255,m*255,p*255]};c.cmyk.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100,o=e[3]/100,l=1-Math.min(1,t*(1-o)+o),s=1-Math.min(1,n*(1-o)+o),a=1-Math.min(1,r*(1-o)+o);return[l*255,s*255,a*255]};c.xyz.rgb=function(e){const t=e[0]/100,n=e[1]/100,r=e[2]/100;let o,l,s;return o=t*3.2404542+n*-1.5371385+r*-.4985314,l=t*-.969266+n*1.8760108+r*.041556,s=t*.0556434+n*-.2040259+r*1.0572252,o=o>.0031308?1.055*o**(1/2.4)-.055:o*12.92,l=l>.0031308?1.055*l**(1/2.4)-.055:l*12.92,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,o=Math.min(Math.max(0,o),1),l=Math.min(Math.max(0,l),1),s=Math.min(Math.max(0,s),1),[o*255,l*255,s*255]};c.xyz.lab=function(e){let t=e[0],n=e[1],r=e[2];t/=95.047,n/=100,r/=108.883,t=t>y?t**(1/3):7.787*t+16/116,n=n>y?n**(1/3):7.787*n+16/116,r=r>y?r**(1/3):7.787*r+16/116;const o=116*n-16,l=500*(t-n),s=200*(n-r);return[o,l,s]};c.lab.xyz=function(e){const t=e[0],n=e[1],r=e[2];let o,l,s;l=(t+16)/116,o=n/500+l,s=l-r/200;const a=l**3,i=o**3,u=s**3;return l=a>y?a:(l-16/116)/7.787,o=i>y?i:(o-16/116)/7.787,s=u>y?u:(s-16/116)/7.787,o*=95.047,l*=100,s*=108.883,[o,l,s]};c.lab.lch=function(e){const t=e[0],n=e[1],r=e[2];let o;o=Math.atan2(r,n)*360/2/Math.PI,o<0&&(o+=360);const s=Math.sqrt(n*n+r*r);return[t,s,o]};c.lch.lab=function(e){const t=e[0],n=e[1],o=e[2]/360*2*Math.PI,l=n*Math.cos(o),s=n*Math.sin(o);return[t,l,s]};c.rgb.ansi16=function(e,t=null){const[n,r,o]=e;let l=t===null?c.rgb.hsv(e)[2]:t;if(l=Math.round(l/50),l===0)return 30;let s=30+(Math.round(o/255)<<2|Math.round(r/255)<<1|Math.round(n/255));return l===2&&(s+=60),s};c.hsv.ansi16=function(e){return c.rgb.ansi16(c.hsv.rgb(e),e[2])};c.rgb.ansi256=function(e){const t=e[0],n=e[1],r=e[2];return t>>4===n>>4&&n>>4===r>>4?t<8?16:t>248?231:Math.round((t-8)/247*24)+232:16+36*Math.round(t/255*5)+6*Math.round(n/255*5)+Math.round(r/255*5)};c.ansi16.rgb=function(e){e=e[0];let t=e%10;if(t===0||t===7)return e>50&&(t+=3.5),t=t/10.5*255,[t,t,t];const n=(Math.trunc(e>50)+1)*.5,r=(t&1)*n*255,o=(t>>1&1)*n*255,l=(t>>2&1)*n*255;return[r,o,l]};c.ansi256.rgb=function(e){if(e=e[0],e>=232){const l=(e-232)*10+8;return[l,l,l]}e-=16;let t;const n=Math.floor(e/36)/5*255,r=Math.floor((t=e%36)/6)/5*255,o=t%6/5*255;return[n,r,o]};c.rgb.hex=function(e){const n=(((Math.round(e[0])&255)<<16)+((Math.round(e[1])&255)<<8)+(Math.round(e[2])&255)).toString(16).toUpperCase();return"000000".slice(n.length)+n};c.hex.rgb=function(e){const t=e.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);if(!t)return[0,0,0];let n=t[0];t[0].length===3&&(n=[...n].map(a=>a+a).join(""));const r=Number.parseInt(n,16),o=r>>16&255,l=r>>8&255,s=r&255;return[o,l,s]};c.rgb.hcg=function(e){const t=e[0]/255,n=e[1]/255,r=e[2]/255,o=Math.max(Math.max(t,n),r),l=Math.min(Math.min(t,n),r),s=o-l;let a;const i=s<1?l/(1-s):0;return s<=0?a=0:o===t?a=(n-r)/s%6:o===n?a=2+(r-t)/s:a=4+(t-n)/s,a/=6,a%=1,[a*360,s*100,i*100]};c.hsl.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=n<.5?2*t*n:2*t*(1-n);let o=0;return r<1&&(o=(n-.5*r)/(1-r)),[e[0],r*100,o*100]};c.hsv.hcg=function(e){const t=e[1]/100,n=e[2]/100,r=t*n;let o=0;return r<1&&(o=(n-r)/(1-r)),[e[0],r*100,o*100]};c.hcg.rgb=function(e){const t=e[0]/360,n=e[1]/100,r=e[2]/100;if(n===0)return[r*255,r*255,r*255];const o=[0,0,0],l=t%1*6,s=l%1,a=1-s;let i=0;switch(Math.floor(l)){case 0:{o[0]=1,o[1]=s,o[2]=0;break}case 1:{o[0]=a,o[1]=1,o[2]=0;break}case 2:{o[0]=0,o[1]=1,o[2]=s;break}case 3:{o[0]=0,o[1]=a,o[2]=1;break}case 4:{o[0]=s,o[1]=0,o[2]=1;break}default:o[0]=1,o[1]=0,o[2]=a}return i=(1-n)*r,[(n*o[0]+i)*255,(n*o[1]+i)*255,(n*o[2]+i)*255]};c.hcg.hsv=function(e){const t=e[1]/100,n=e[2]/100,r=t+n*(1-t);let o=0;return r>0&&(o=t/r),[e[0],o*100,r*100]};c.hcg.hsl=function(e){const t=e[1]/100,r=e[2]/100*(1-t)+.5*t;let o=0;return r>0&&r<.5?o=t/(2*r):r>=.5&&r<1&&(o=t/(2*(1-r))),[e[0],o*100,r*100]};c.hcg.hwb=function(e){const t=e[1]/100,n=e[2]/100,r=t+n*(1-t);return[e[0],(r-t)*100,(1-r)*100]};c.hwb.hcg=function(e){const t=e[1]/100,r=1-e[2]/100,o=r-t;let l=0;return o<1&&(l=(r-o)/(1-o)),[e[0],o*100,l*100]};c.apple.rgb=function(e){return[e[0]/65535*255,e[1]/65535*255,e[2]/65535*255]};c.rgb.apple=function(e){return[e[0]/255*65535,e[1]/255*65535,e[2]/255*65535]};c.gray.rgb=function(e){return[e[0]/100*255,e[0]/100*255,e[0]/100*255]};c.gray.hsl=function(e){return[0,0,e[0]]};c.gray.hsv=c.gray.hsl;c.gray.hwb=function(e){return[0,100,e[0]]};c.gray.cmyk=function(e){return[0,0,0,e[0]]};c.gray.lab=function(e){return[e[0],0,0]};c.gray.hex=function(e){const t=Math.round(e[0]/100*255)&255,r=((t<<16)+(t<<8)+t).toString(16).toUpperCase();return"000000".slice(r.length)+r};c.rgb.gray=function(e){return[(e[0]+e[1]+e[2])/3/255*100]};function j(){const e={},t=Object.keys(c);for(let{length:n}=t,r=0;r<n;r++)e[t[r]]={distance:-1,parent:null};return e}function E(e){const t=j(),n=[e];for(t[e].distance=0;n.length>0;){const r=n.pop(),o=Object.keys(c[r]);for(let{length:l}=o,s=0;s<l;s++){const a=o[s],i=t[a];i.distance===-1&&(i.distance=t[r].distance+1,i.parent=r,n.unshift(a))}}return t}function $(e,t){return function(n){return t(e(n))}}function T(e,t){const n=[t[e].parent,e];let r=c[t[e].parent][e],o=t[e].parent;for(;t[o].parent;)n.unshift(t[o].parent),r=$(c[t[o].parent][o],r),o=t[o].parent;return r.conversion=n,r}function U(e){const t=E(e),n={},r=Object.keys(t);for(let{length:o}=r,l=0;l<o;l++){const s=r[l];t[s].parent!==null&&(n[s]=T(s,t))}return n}const g={},D=Object.keys(c);function K(e){const t=function(...n){const r=n[0];return r==null?r:(r.length>1&&(n=r),e(n))};return"conversion"in e&&(t.conversion=e.conversion),t}function V(e){const t=function(...n){const r=n[0];if(r==null)return r;r.length>1&&(n=r);const o=e(n);if(typeof o=="object")for(let{length:l}=o,s=0;s<l;s++)o[s]=Math.round(o[s]);return o};return"conversion"in e&&(t.conversion=e.conversion),t}for(const e of D){g[e]={},Object.defineProperty(g[e],"channels",{value:c[e].channels}),Object.defineProperty(g[e],"labels",{value:c[e].labels});const t=U(e),n=Object.keys(t);for(const r of n){const o=t[r];g[e][r]=V(o),g[e][r].raw=K(o)}}const C=["keyword","gray","hex"],F={};for(const e of Object.keys(g))F[[...g[e].labels].sort().join("")]=e;const v={};function b(e,t){if(!(this instanceof b))return new b(e,t);if(t&&t in C&&(t=null),t&&!(t in g))throw new Error("Unknown model: "+t);let n,r;if(e==null)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(e instanceof b)this.model=e.model,this.color=[...e.color],this.valpha=e.valpha;else if(typeof e=="string"){const o=d.get(e);if(o===null)throw new Error("Unable to parse color from string: "+e);this.model=o.model,r=g[this.model].channels,this.color=o.value.slice(0,r),this.valpha=typeof o.value[r]=="number"?o.value[r]:1}else if(e.length>0){this.model=t||"rgb",r=g[this.model].channels;const o=Array.prototype.slice.call(e,0,r);this.color=N(o,r),this.valpha=typeof e[r]=="number"?e[r]:1}else if(typeof e=="number")this.model="rgb",this.color=[e>>16&255,e>>8&255,e&255],this.valpha=1;else{this.valpha=1;const o=Object.keys(e);"alpha"in e&&(o.splice(o.indexOf("alpha"),1),this.valpha=typeof e.alpha=="number"?e.alpha:0);const l=o.sort().join("");if(!(l in F))throw new Error("Unable to parse color from object: "+JSON.stringify(e));this.model=F[l];const{labels:s}=g[this.model],a=[];for(n=0;n<s.length;n++)a.push(e[s[n]]);this.color=N(a)}if(v[this.model])for(r=g[this.model].channels,n=0;n<r;n++){const o=v[this.model][n];o&&(this.color[n]=o(this.color[n]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}b.prototype={toString(){return this.string()},toJSON(){return this[this.model]()},string(e){let t=this.model in d.to?this:this.rgb();t=t.round(typeof e=="number"?e:1);const n=t.valpha===1?t.color:[...t.color,this.valpha];return d.to[t.model](...n)},percentString(e){const t=this.rgb().round(typeof e=="number"?e:1),n=t.valpha===1?t.color:[...t.color,this.valpha];return d.to.rgb.percent(...n)},array(){return this.valpha===1?[...this.color]:[...this.color,this.valpha]},object(){const e={},{channels:t}=g[this.model],{labels:n}=g[this.model];for(let r=0;r<t;r++)e[n[r]]=this.color[r];return this.valpha!==1&&(e.alpha=this.valpha),e},unitArray(){const e=this.rgb().color;return e[0]/=255,e[1]/=255,e[2]/=255,this.valpha!==1&&e.push(this.valpha),e},unitObject(){const e=this.rgb().object();return e.r/=255,e.g/=255,e.b/=255,this.valpha!==1&&(e.alpha=this.valpha),e},round(e){return e=Math.max(e||0,0),new b([...this.color.map(L(e)),this.valpha],this.model)},alpha(e){return e!==void 0?new b([...this.color,Math.max(0,Math.min(1,e))],this.model):this.valpha},red:h("rgb",0,f(255)),green:h("rgb",1,f(255)),blue:h("rgb",2,f(255)),hue:h(["hsl","hsv","hsl","hwb","hcg"],0,e=>(e%360+360)%360),saturationl:h("hsl",1,f(100)),lightness:h("hsl",2,f(100)),saturationv:h("hsv",1,f(100)),value:h("hsv",2,f(100)),chroma:h("hcg",1,f(100)),gray:h("hcg",2,f(100)),white:h("hwb",1,f(100)),wblack:h("hwb",2,f(100)),cyan:h("cmyk",0,f(100)),magenta:h("cmyk",1,f(100)),yellow:h("cmyk",2,f(100)),black:h("cmyk",3,f(100)),x:h("xyz",0,f(95.047)),y:h("xyz",1,f(100)),z:h("xyz",2,f(108.833)),l:h("lab",0,f(100)),a:h("lab",1),b:h("lab",2),keyword(e){return e!==void 0?new b(e):g[this.model].keyword(this.color)},hex(e){return e!==void 0?new b(e):d.to.hex(...this.rgb().round().color)},hexa(e){if(e!==void 0)return new b(e);const t=this.rgb().round().color;let n=Math.round(this.valpha*255).toString(16).toUpperCase();return n.length===1&&(n="0"+n),d.to.hex(...t)+n},rgbNumber(){const e=this.rgb().color;return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255},luminosity(){const e=this.rgb().color,t=[];for(const[n,r]of e.entries()){const o=r/255;t[n]=o<=.04045?o/12.92:((o+.055)/1.055)**2.4}return .2126*t[0]+.7152*t[1]+.0722*t[2]},contrast(e){const t=this.luminosity(),n=e.luminosity();return t>n?(t+.05)/(n+.05):(n+.05)/(t+.05)},level(e){const t=this.contrast(e);return t>=7?"AAA":t>=4.5?"AA":""},isDark(){const e=this.rgb().color;return(e[0]*2126+e[1]*7152+e[2]*722)/1e4<128},isLight(){return!this.isDark()},negate(){const e=this.rgb();for(let t=0;t<3;t++)e.color[t]=255-e.color[t];return e},lighten(e){const t=this.hsl();return t.color[2]+=t.color[2]*e,t},darken(e){const t=this.hsl();return t.color[2]-=t.color[2]*e,t},saturate(e){const t=this.hsl();return t.color[1]+=t.color[1]*e,t},desaturate(e){const t=this.hsl();return t.color[1]-=t.color[1]*e,t},whiten(e){const t=this.hwb();return t.color[1]+=t.color[1]*e,t},blacken(e){const t=this.hwb();return t.color[2]+=t.color[2]*e,t},grayscale(){const e=this.rgb().color,t=e[0]*.3+e[1]*.59+e[2]*.11;return b.rgb(t,t,t)},fade(e){return this.alpha(this.valpha-this.valpha*e)},opaquer(e){return this.alpha(this.valpha+this.valpha*e)},rotate(e){const t=this.hsl();let n=t.color[0];return n=(n+e)%360,n=n<0?360+n:n,t.color[0]=n,t},mix(e,t){if(!e||!e.rgb)throw new Error('Argument to "mix" was not a Color instance, but rather an instance of '+typeof e);const n=e.rgb(),r=this.rgb(),o=t===void 0?.5:t,l=2*o-1,s=n.alpha()-r.alpha(),a=((l*s===-1?l:(l+s)/(1+l*s))+1)/2,i=1-a;return b.rgb(a*n.red()+i*r.red(),a*n.green()+i*r.green(),a*n.blue()+i*r.blue(),n.alpha()*o+r.alpha()*(1-o))}};for(const e of Object.keys(g)){if(C.includes(e))continue;const{channels:t}=g[e];b.prototype[e]=function(...n){return this.model===e?new b(this):n.length>0?new b(n,e):new b([...R(g[this.model][e].raw(this.color)),this.valpha],e)},b[e]=function(...n){let r=n[0];return typeof r=="number"&&(r=N(n,t)),new b(r,e)}}function B(e,t){return Number(e.toFixed(t))}function L(e){return function(t){return B(t,e)}}function h(e,t,n){e=Array.isArray(e)?e:[e];for(const r of e)(v[r]||(v[r]=[]))[t]=n;return e=e[0],function(r){let o;return r!==void 0?(n&&(r=n(r)),o=this[e](),o.color[t]=r,o):(o=this[e]().color[t],n&&(o=n(o)),o)}}function f(e){return function(t){return Math.max(0,Math.min(e,t))}}function R(e){return Array.isArray(e)?e:[e]}function N(e,t){for(let n=0;n<t;n++)typeof e[n]!="number"&&(e[n]=0);return e}class J{constructor(t){_(this,"isColor",!0);_(this,"currentColor");this.base=t;const n=this._resolveBaseColor(t);return this.currentColor=b(n),this._createProxy()}_createProxy(){return new Proxy(this,{get(t,n){return n in t?t[n]:n in t.currentColor?t._handleColorMethod(n):t[n]}})}_resolveBaseColor(t){if(typeof t!="string"||!/\{[^{}]+\}/g.test(t))return t;if(typeof saltyConfig>"u")return"transparent";const{staticVariables:r}=saltyConfig;return r?t.replace(/^\{|\}$/g,"").split(".").reduce((s,a)=>s[a],r):"transparent"}_handleColorMethod(t){const n=this.currentColor;return typeof n[t]!="function"?n[t]:(...r)=>(this.currentColor=n[t](...r),this._createProxy())}toString(){return this.currentColor.toString()}}const G=e=>new J(e);exports.defineViewportClamp=P.defineViewportClamp;exports.color=G;
package/helpers.js CHANGED
@@ -1,7 +1,8 @@
1
1
  var A = Object.defineProperty;
2
- var S = (e, t, n) => t in e ? A(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var _ = (e, t, n) => S(e, typeof t != "symbol" ? t + "" : t, n);
4
- const k = {
2
+ var P = (e, t, n) => t in e ? A(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
+ var _ = (e, t, n) => P(e, typeof t != "symbol" ? t + "" : t, n);
4
+ import { d as Q } from "./viewport-clamp-BOc-8Oph.js";
5
+ const w = {
5
6
  aliceblue: [240, 248, 255],
6
7
  antiquewhite: [250, 235, 215],
7
8
  aqua: [0, 255, 255],
@@ -151,8 +152,8 @@ const k = {
151
152
  yellow: [255, 255, 0],
152
153
  yellowgreen: [154, 205, 50]
153
154
  }, O = /* @__PURE__ */ Object.create(null);
154
- for (const e in k)
155
- Object.hasOwn(k, e) && (O[k[e]] = e);
155
+ for (const e in w)
156
+ Object.hasOwn(w, e) && (O[w[e]] = e);
156
157
  const d = {
157
158
  to: {},
158
159
  get: {}
@@ -199,17 +200,17 @@ d.get.rgb = function(e) {
199
200
  for (i = 0; i < 3; i++)
200
201
  s[i] = Math.round(Number.parseFloat(a[i + 1]) * 2.55);
201
202
  a[4] && (s[3] = a[5] ? Number.parseFloat(a[4]) * 0.01 : Number.parseFloat(a[4]));
202
- } else return (a = e.match(l)) ? a[1] === "transparent" ? [0, 0, 0, 0] : Object.hasOwn(k, a[1]) ? (s = k[a[1]], s[3] = 1, s) : null : null;
203
+ } else return (a = e.match(l)) ? a[1] === "transparent" ? [0, 0, 0, 0] : Object.hasOwn(w, a[1]) ? (s = w[a[1]], s[3] = 1, s) : null : null;
203
204
  for (i = 0; i < 3; i++)
204
- s[i] = w(s[i], 0, 255);
205
- return s[3] = w(s[3], 0, 1), s;
205
+ s[i] = k(s[i], 0, 255);
206
+ return s[3] = k(s[3], 0, 1), s;
206
207
  };
207
208
  d.get.hsl = function(e) {
208
209
  if (!e)
209
210
  return null;
210
211
  const t = /^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/, n = e.match(t);
211
212
  if (n) {
212
- const r = Number.parseFloat(n[4]), o = (Number.parseFloat(n[1]) % 360 + 360) % 360, l = w(Number.parseFloat(n[2]), 0, 100), s = w(Number.parseFloat(n[3]), 0, 100), a = w(Number.isNaN(r) ? 1 : r, 0, 1);
213
+ const r = Number.parseFloat(n[4]), o = (Number.parseFloat(n[1]) % 360 + 360) % 360, l = k(Number.parseFloat(n[2]), 0, 100), s = k(Number.parseFloat(n[3]), 0, 100), a = k(Number.isNaN(r) ? 1 : r, 0, 1);
213
214
  return [o, l, s, a];
214
215
  }
215
216
  return null;
@@ -219,7 +220,7 @@ d.get.hwb = function(e) {
219
220
  return null;
220
221
  const t = /^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d.]+)%\s*,\s*([+-]?[\d.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/, n = e.match(t);
221
222
  if (n) {
222
- const r = Number.parseFloat(n[4]), o = (Number.parseFloat(n[1]) % 360 + 360) % 360, l = w(Number.parseFloat(n[2]), 0, 100), s = w(Number.parseFloat(n[3]), 0, 100), a = w(Number.isNaN(r) ? 1 : r, 0, 1);
223
+ const r = Number.parseFloat(n[4]), o = (Number.parseFloat(n[1]) % 360 + 360) % 360, l = k(Number.parseFloat(n[2]), 0, 100), s = k(Number.parseFloat(n[3]), 0, 100), a = k(Number.isNaN(r) ? 1 : r, 0, 1);
223
224
  return [o, l, s, a];
224
225
  }
225
226
  return null;
@@ -244,7 +245,7 @@ d.to.hwb = function(...e) {
244
245
  d.to.keyword = function(...e) {
245
246
  return O[e.slice(0, 3)];
246
247
  };
247
- function w(e, t, n) {
248
+ function k(e, t, n) {
248
249
  return Math.min(Math.max(t, e), n);
249
250
  }
250
251
  function x(e) {
@@ -495,7 +496,7 @@ c.rgb.cmyk = function(e) {
495
496
  const t = e[0] / 255, n = e[1] / 255, r = e[2] / 255, o = Math.min(1 - t, 1 - n, 1 - r), l = (1 - t - o) / (1 - o) || 0, s = (1 - n - o) / (1 - o) || 0, a = (1 - r - o) / (1 - o) || 0;
496
497
  return [l * 100, s * 100, a * 100, o * 100];
497
498
  };
498
- function P(e, t) {
499
+ function S(e, t) {
499
500
  return (e[0] - t[0]) ** 2 + (e[1] - t[1]) ** 2 + (e[2] - t[2]) ** 2;
500
501
  }
501
502
  c.rgb.keyword = function(e) {
@@ -504,7 +505,7 @@ c.rgb.keyword = function(e) {
504
505
  return t;
505
506
  let n = Number.POSITIVE_INFINITY, r;
506
507
  for (const o of Object.keys(M)) {
507
- const l = M[o], s = P(e, l);
508
+ const l = M[o], s = S(e, l);
508
509
  s < n && (n = s, r = o);
509
510
  }
510
511
  return r;
@@ -788,7 +789,7 @@ c.gray.hex = function(e) {
788
789
  c.rgb.gray = function(e) {
789
790
  return [(e[0] + e[1] + e[2]) / 3 / 255 * 100];
790
791
  };
791
- function $() {
792
+ function I() {
792
793
  const e = {}, t = Object.keys(c);
793
794
  for (let { length: n } = t, r = 0; r < n; r++)
794
795
  e[t[r]] = {
@@ -799,8 +800,8 @@ function $() {
799
800
  };
800
801
  return e;
801
802
  }
802
- function I(e) {
803
- const t = $(), n = [e];
803
+ function j(e) {
804
+ const t = I(), n = [e];
804
805
  for (t[e].distance = 0; n.length > 0; ) {
805
806
  const r = n.pop(), o = Object.keys(c[r]);
806
807
  for (let { length: l } = o, s = 0; s < l; s++) {
@@ -810,35 +811,35 @@ function I(e) {
810
811
  }
811
812
  return t;
812
813
  }
813
- function j(e, t) {
814
+ function E(e, t) {
814
815
  return function(n) {
815
816
  return t(e(n));
816
817
  };
817
818
  }
818
- function E(e, t) {
819
+ function $(e, t) {
819
820
  const n = [t[e].parent, e];
820
821
  let r = c[t[e].parent][e], o = t[e].parent;
821
822
  for (; t[o].parent; )
822
- n.unshift(t[o].parent), r = j(c[t[o].parent][o], r), o = t[o].parent;
823
+ n.unshift(t[o].parent), r = E(c[t[o].parent][o], r), o = t[o].parent;
823
824
  return r.conversion = n, r;
824
825
  }
825
- function U(e) {
826
- const t = I(e), n = {}, r = Object.keys(t);
826
+ function T(e) {
827
+ const t = j(e), n = {}, r = Object.keys(t);
827
828
  for (let { length: o } = r, l = 0; l < o; l++) {
828
829
  const s = r[l];
829
- t[s].parent !== null && (n[s] = E(s, t));
830
+ t[s].parent !== null && (n[s] = $(s, t));
830
831
  }
831
832
  return n;
832
833
  }
833
- const g = {}, T = Object.keys(c);
834
- function V(e) {
834
+ const g = {}, U = Object.keys(c);
835
+ function D(e) {
835
836
  const t = function(...n) {
836
837
  const r = n[0];
837
838
  return r == null ? r : (r.length > 1 && (n = r), e(n));
838
839
  };
839
840
  return "conversion" in e && (t.conversion = e.conversion), t;
840
841
  }
841
- function D(e) {
842
+ function K(e) {
842
843
  const t = function(...n) {
843
844
  const r = n[0];
844
845
  if (r == null)
@@ -852,12 +853,12 @@ function D(e) {
852
853
  };
853
854
  return "conversion" in e && (t.conversion = e.conversion), t;
854
855
  }
855
- for (const e of T) {
856
+ for (const e of U) {
856
857
  g[e] = {}, Object.defineProperty(g[e], "channels", { value: c[e].channels }), Object.defineProperty(g[e], "labels", { value: c[e].labels });
857
- const t = U(e), n = Object.keys(t);
858
+ const t = T(e), n = Object.keys(t);
858
859
  for (const r of n) {
859
860
  const o = t[r];
860
- g[e][r] = D(o), g[e][r].raw = V(o);
861
+ g[e][r] = K(o), g[e][r].raw = D(o);
861
862
  }
862
863
  }
863
864
  const C = [
@@ -951,7 +952,7 @@ b.prototype = {
951
952
  return e.r /= 255, e.g /= 255, e.b /= 255, this.valpha !== 1 && (e.alpha = this.valpha), e;
952
953
  },
953
954
  round(e) {
954
- return e = Math.max(e || 0, 0), new b([...this.color.map(B(e)), this.valpha], this.model);
955
+ return e = Math.max(e || 0, 0), new b([...this.color.map(V(e)), this.valpha], this.model);
955
956
  },
956
957
  alpha(e) {
957
958
  return e !== void 0 ? new b([...this.color, Math.max(0, Math.min(1, e))], this.model) : this.valpha;
@@ -1087,12 +1088,12 @@ for (const e of Object.keys(g)) {
1087
1088
  return typeof r == "number" && (r = N(n, t)), new b(r, e);
1088
1089
  };
1089
1090
  }
1090
- function K(e, t) {
1091
+ function B(e, t) {
1091
1092
  return Number(e.toFixed(t));
1092
1093
  }
1093
- function B(e) {
1094
+ function V(e) {
1094
1095
  return function(t) {
1095
- return K(t, e);
1096
+ return B(t, e);
1096
1097
  };
1097
1098
  }
1098
1099
  function h(e, t, n) {
@@ -1146,11 +1147,8 @@ class R {
1146
1147
  return this.currentColor.toString();
1147
1148
  }
1148
1149
  }
1149
- const G = (e) => new R(e), H = (e) => (t) => {
1150
- const { screenSize: n, axis: r = "horizontal", minMultiplier: o = 0.5, maxMultiplier: l = 1.5 } = e, s = Math.round(t / n * 1e4) / 100, a = r === "vertical" ? "vh" : "vw", i = Math.round(o * t), u = Math.round(l * t);
1151
- return `clamp(${i}px, ${s}${a}, ${u}px)`;
1152
- };
1150
+ const G = (e) => new R(e);
1153
1151
  export {
1154
1152
  G as color,
1155
- H as defineViewportClamp
1153
+ Q as defineViewportClamp
1156
1154
  };
package/keyframes.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./parse-styles-CfxJtQu_.cjs"),w=async({animationName:l,params:u,appendInitialStyles:y,...t})=>{const e=l||i.toHash(t),r=async(n={})=>{const{duration:s="500ms",easing:o="ease-in-out",delay:c="0s",iterationCount:S="1",direction:p="normal",fillMode:g="forwards",playState:b="running"}={...u,...n},a=`${e} ${s} ${o} ${c} ${S} ${p} ${g} ${b}`;if(!y)return a;const m=t.from||t["0%"];if(!m)return a;const j=await i.parseAndJoinStyles(m,"");return`${a};${j}`},$=Object.entries(t).map(async([n,s])=>{if(!s)return"";const o=await i.parseAndJoinStyles(s,"");return`${typeof n=="number"?`${n}%`:n}{${o}}`}),d=(await Promise.all($)).join(""),f=`@keyframes ${e} {${d}}`;return Object.assign(r,{toString:r,isKeyframes:!0,animationName:e,css:f,keyframes:t}),r};exports.keyframes=w;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./parse-styles-BU5fcwDA.cjs"),w=async({animationName:l,params:u,appendInitialStyles:y,...t})=>{const e=l||i.toHash(t),r=async(n={})=>{const{duration:s="500ms",easing:o="ease-in-out",delay:c="0s",iterationCount:S="1",direction:p="normal",fillMode:g="forwards",playState:b="running"}={...u,...n},a=`${e} ${s} ${o} ${c} ${S} ${p} ${g} ${b}`;if(!y)return a;const m=t.from||t["0%"];if(!m)return a;const j=await i.parseAndJoinStyles(m,"");return`${a};${j}`},$=Object.entries(t).map(async([n,s])=>{if(!s)return"";const o=await i.parseAndJoinStyles(s,"");return`${typeof n=="number"?`${n}%`:n}{${o}}`}),d=(await Promise.all($)).join(""),f=`@keyframes ${e} {${d}}`;return Object.assign(r,{toString:r,isKeyframes:!0,animationName:e,css:f,keyframes:t}),r};exports.keyframes=w;
package/keyframes.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as j, p as m } from "./parse-styles-anFzH8TT.js";
1
+ import { t as j, p as m } from "./parse-styles-BRbiYmZ_.js";
2
2
  const h = async ({ animationName: $, params: l, appendInitialStyles: u, ...t }) => {
3
3
  const r = $ || j(t), e = async (n = {}) => {
4
4
  const {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salty-css/react",
3
- "version": "0.0.1-alpha.256",
3
+ "version": "0.0.1-alpha.258",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "typings": "./dist/index.d.ts",
@@ -66,7 +66,7 @@
66
66
  }
67
67
  },
68
68
  "dependencies": {
69
- "@salty-css/core": "^0.0.1-alpha.256",
69
+ "@salty-css/core": "^0.0.1-alpha.258",
70
70
  "clsx": ">=2.x",
71
71
  "react": ">=19.x || >=18.3.x"
72
72
  }
@@ -0,0 +1,155 @@
1
+ import { d as W, a as M } from "./parse-tokens-Cbbbt7eO.js";
2
+ import { d as U } from "./viewport-clamp-BOc-8Oph.js";
3
+ const H = (r) => (s) => {
4
+ if (typeof s != "string" || !r) return;
5
+ let t = s;
6
+ const a = [];
7
+ return Object.values(r).forEach((o) => {
8
+ const { pattern: b, transform: m } = o;
9
+ t = t.replace(b, (C) => {
10
+ const { value: j, css: E } = m(C);
11
+ return E && a.push(E), j;
12
+ });
13
+ }), { transformed: t, additionalCss: a };
14
+ }, z = (r) => String.fromCharCode(r + (r > 25 ? 39 : 97)), J = (r, s) => {
15
+ let t = "", a;
16
+ for (a = Math.abs(r); a > 52; a = a / 52 | 0) t = z(a % 52) + t;
17
+ return t = z(a % 52) + t, t.length < s ? t = t.padStart(s, "a") : t.length > s && (t = t.slice(-s)), t;
18
+ }, Q = (r, s) => {
19
+ let t = s.length;
20
+ for (; t; ) r = r * 33 ^ s.charCodeAt(--t);
21
+ return r;
22
+ }, L = (r, s = 5) => {
23
+ const t = Q(5381, JSON.stringify(r)) >>> 0;
24
+ return J(t, s);
25
+ }, T = [
26
+ "top",
27
+ "right",
28
+ "bottom",
29
+ "left",
30
+ "min-width",
31
+ /.*width.*/,
32
+ /^[^line]*height.*/,
33
+ // Exclude line-height
34
+ /padding.*/,
35
+ /margin.*/,
36
+ /border.*/,
37
+ /inset.*/,
38
+ /.*radius.*/,
39
+ /.*spacing.*/,
40
+ /.*gap.*/,
41
+ /.*indent.*/,
42
+ /.*offset.*/,
43
+ /.*size.*/,
44
+ /.*thickness.*/,
45
+ /.*font-size.*/
46
+ ], _ = (r, s, t) => {
47
+ if (T.some((o) => typeof o == "string" ? o === r : o.test(r))) {
48
+ const o = (t == null ? void 0 : t.defaultUnit) || "px";
49
+ if (o.startsWith("viewport-clamp:"))
50
+ try {
51
+ const m = o.split(":")[1];
52
+ return U({
53
+ screenSize: parseInt(m)
54
+ })(Number(s));
55
+ } catch (m) {
56
+ throw console.error(m), new Error(`Invalid viewport-clamp value: ${o}`);
57
+ }
58
+ return `${s}${o}`;
59
+ }
60
+ return `${s}`;
61
+ }, q = ["Webkit", "Moz", "ms", "O"], F = (r) => r.startsWith("-") ? r : q.some((s) => r.startsWith(s)) ? `-${W(r)}` : W(r), $ = async (r, s = "", t, a = !1) => {
62
+ if (!r) throw new Error("No styles provided to parseStyles function!");
63
+ const o = /* @__PURE__ */ new Set(), b = Object.entries(r), m = async ([f, e]) => {
64
+ var S;
65
+ const n = f.trim().replace(/^\?+/g, ""), y = F(n), u = (c, p = ";") => `${y}:${c}${p}`, P = { scope: s, config: t };
66
+ if (typeof e == "function") return m([f, e(P)]);
67
+ if (e instanceof Promise) return m([f, await e]);
68
+ if (t != null && t.templates && t.templatePaths[n])
69
+ try {
70
+ const [c, p] = t.templatePaths[n].split(";;"), i = await import(p), l = p.includes("salty.config"), d = l ? i[c].templates : i[c], w = l ? d[n] : d.params[n];
71
+ if (d && typeof w == "function") {
72
+ const v = await w(e), [h] = await $(v, "");
73
+ return h;
74
+ }
75
+ } catch (c) {
76
+ console.error(`Error loading template "${n}" from path "${t.templatePaths[n]}"`, c);
77
+ return;
78
+ }
79
+ if (t != null && t.templates && t.templates[n]) {
80
+ if (a) return;
81
+ const p = e.split(".").reduce((i, l) => i[l], t.templates[n]);
82
+ if (p) {
83
+ const [i] = await $(p, "");
84
+ return i;
85
+ }
86
+ console.warn(`Template "${n}" with path of "${e}" was not found in config!`);
87
+ return;
88
+ }
89
+ if (typeof e == "object") {
90
+ if (!e) return;
91
+ if (e.isColor) return u(e.toString());
92
+ if (n === "defaultVariants") return;
93
+ if (n === "variants") {
94
+ const i = Object.entries(e);
95
+ for (const [l, d] of i) {
96
+ if (!d) continue;
97
+ const w = Object.entries(d);
98
+ for (const [v, h] of w) {
99
+ if (!h) continue;
100
+ const A = `${s}.${l}-${v}`;
101
+ (await $(h, A, t)).forEach((I) => o.add(I));
102
+ }
103
+ }
104
+ return;
105
+ }
106
+ if (n === "compoundVariants") {
107
+ for (const i of e) {
108
+ const { css: l, ...d } = i, w = Object.entries(d).reduce((h, [A, N]) => `${h}.${A}-${N}`, s);
109
+ (await $(l, w, t)).forEach((h) => o.add(h));
110
+ }
111
+ return;
112
+ }
113
+ if (n.startsWith("@")) {
114
+ const i = ((S = t == null ? void 0 : t.mediaQueries) == null ? void 0 : S[n]) || n, l = await V(e, s, t), d = `${i} { ${l} }`;
115
+ o.add(d);
116
+ return;
117
+ }
118
+ const c = f.includes("&") ? n.replaceAll("&", s) : n.startsWith(":") ? `${s}${n}` : `${s} ${n}`;
119
+ (await $(e, c, t)).forEach((i) => o.add(i));
120
+ return;
121
+ }
122
+ if (typeof e == "number") {
123
+ const c = _(y, e, t);
124
+ return u(c);
125
+ }
126
+ if (typeof e != "string")
127
+ if ("toString" in e) e = e.toString();
128
+ else throw new Error(`Invalid value type for property ${y}`);
129
+ return u(e);
130
+ }, C = b.map(m), { modifiers: j } = t || {}, E = [M(), H(j)], x = (await Promise.all(C).then((f) => Promise.all(
131
+ f.map((e) => E.reduce(async (n, y) => {
132
+ const u = await n;
133
+ if (!u) return u;
134
+ const P = await y(u);
135
+ if (!P) return u;
136
+ const { transformed: S, additionalCss: c } = P;
137
+ let p = "";
138
+ if (c)
139
+ for (const i of c)
140
+ p += await V(i, "");
141
+ return `${p}${S}`;
142
+ }, Promise.resolve(e)))
143
+ ))).filter((f) => f !== void 0).join(`
144
+ `);
145
+ if (!x.trim()) return Array.from(o);
146
+ const O = s ? `${s} {
147
+ ${x}
148
+ }` : x;
149
+ return o.has(O) ? Array.from(o) : [O, ...o];
150
+ }, V = async (r, s, t, a = !1) => (await $(r, s, t, a)).join(`
151
+ `);
152
+ export {
153
+ V as p,
154
+ L as t
155
+ };
@@ -0,0 +1,5 @@
1
+ "use strict";const x=require("./parse-tokens-BnDwbP7V.cjs"),H=require("./viewport-clamp-kY8JqYzm.cjs"),I=r=>s=>{if(typeof s!="string"||!r)return;let t=s;const a=[];return Object.values(r).forEach(o=>{const{pattern:C,transform:f}=o;t=t.replace(C,b=>{const{value:j,css:E}=f(b);return E&&a.push(E),j})}),{transformed:t,additionalCss:a}},V=r=>String.fromCharCode(r+(r>25?39:97)),J=(r,s)=>{let t="",a;for(a=Math.abs(r);a>52;a=a/52|0)t=V(a%52)+t;return t=V(a%52)+t,t.length<s?t=t.padStart(s,"a"):t.length>s&&(t=t.slice(-s)),t},M=(r,s)=>{let t=s.length;for(;t;)r=r*33^s.charCodeAt(--t);return r},T=(r,s=5)=>{const t=M(5381,JSON.stringify(r))>>>0;return J(t,s)},U=["top","right","bottom","left","min-width",/.*width.*/,/^[^line]*height.*/,/padding.*/,/margin.*/,/border.*/,/inset.*/,/.*radius.*/,/.*spacing.*/,/.*gap.*/,/.*indent.*/,/.*offset.*/,/.*size.*/,/.*thickness.*/,/.*font-size.*/],Q=(r,s,t)=>{if(U.some(o=>typeof o=="string"?o===r:o.test(r))){const o=(t==null?void 0:t.defaultUnit)||"px";if(o.startsWith("viewport-clamp:"))try{const f=o.split(":")[1];return H.defineViewportClamp({screenSize:parseInt(f)})(Number(s))}catch(f){throw console.error(f),new Error(`Invalid viewport-clamp value: ${o}`)}return`${s}${o}`}return`${s}`},_=["Webkit","Moz","ms","O"],F=r=>r.startsWith("-")?r:_.some(s=>r.startsWith(s))?`-${x.dashCase(r)}`:x.dashCase(r),$=async(r,s="",t,a=!1)=>{if(!r)throw new Error("No styles provided to parseStyles function!");const o=new Set,C=Object.entries(r),f=async([m,e])=>{var S;const n=m.trim().replace(/^\?+/g,""),y=F(n),u=(c,p=";")=>`${y}:${c}${p}`,P={scope:s,config:t};if(typeof e=="function")return f([m,e(P)]);if(e instanceof Promise)return f([m,await e]);if(t!=null&&t.templates&&t.templatePaths[n])try{const[c,p]=t.templatePaths[n].split(";;"),i=await import(p),l=p.includes("salty.config"),d=l?i[c].templates:i[c],w=l?d[n]:d.params[n];if(d&&typeof w=="function"){const v=await w(e),[h]=await $(v,"");return h}}catch(c){console.error(`Error loading template "${n}" from path "${t.templatePaths[n]}"`,c);return}if(t!=null&&t.templates&&t.templates[n]){if(a)return;const p=e.split(".").reduce((i,l)=>i[l],t.templates[n]);if(p){const[i]=await $(p,"");return i}console.warn(`Template "${n}" with path of "${e}" was not found in config!`);return}if(typeof e=="object"){if(!e)return;if(e.isColor)return u(e.toString());if(n==="defaultVariants")return;if(n==="variants"){const i=Object.entries(e);for(const[l,d]of i){if(!d)continue;const w=Object.entries(d);for(const[v,h]of w){if(!h)continue;const O=`${s}.${l}-${v}`;(await $(h,O,t)).forEach(q=>o.add(q))}}return}if(n==="compoundVariants"){for(const i of e){const{css:l,...d}=i,w=Object.entries(d).reduce((h,[O,z])=>`${h}.${O}-${z}`,s);(await $(l,w,t)).forEach(h=>o.add(h))}return}if(n.startsWith("@")){const i=((S=t==null?void 0:t.mediaQueries)==null?void 0:S[n])||n,l=await N(e,s,t),d=`${i} { ${l} }`;o.add(d);return}const c=m.includes("&")?n.replaceAll("&",s):n.startsWith(":")?`${s}${n}`:`${s} ${n}`;(await $(e,c,t)).forEach(i=>o.add(i));return}if(typeof e=="number"){const c=Q(y,e,t);return u(c)}if(typeof e!="string")if("toString"in e)e=e.toString();else throw new Error(`Invalid value type for property ${y}`);return u(e)},b=C.map(f),{modifiers:j}=t||{},E=[x.parseValueTokens(),I(j)],A=(await Promise.all(b).then(m=>Promise.all(m.map(e=>E.reduce(async(n,y)=>{const u=await n;if(!u)return u;const P=await y(u);if(!P)return u;const{transformed:S,additionalCss:c}=P;let p="";if(c)for(const i of c)p+=await N(i,"");return`${p}${S}`},Promise.resolve(e)))))).filter(m=>m!==void 0).join(`
2
+ `);if(!A.trim())return Array.from(o);const W=s?`${s} {
3
+ ${A}
4
+ }`:A;return o.has(W)?Array.from(o):[W,...o]},N=async(r,s,t,a=!1)=>(await $(r,s,t,a)).join(`
5
+ `);exports.parseAndJoinStyles=N;exports.toHash=T;
package/styled.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("./styles-generator-CihJA9Kx.cjs"),g=require("./parse-tokens-BnDwbP7V.cjs"),b=require("./element-factory-Dt_Z9aHy.cjs");class v extends h.StylesGenerator{constructor(e,t){super(t),this.tagName=e,this._params=t}get priority(){var e;return this.params.priority?this.params.priority:typeof this.tagName=="function"||typeof this.tagName=="object"?(((e=this.tagName.generator)==null?void 0:e.priority)||0)+1:0}get clientProps(){const{element:e,variants:t={},compoundVariants:r=[],defaultVariants:d={},defaultProps:l={},passProps:u}=this.params,{callerName:y,isProduction:m}=this.buildContext,n=new Set([]),i=s=>{const a=d[s];a!==void 0?n.add(`${s}=${String(a)}`):n.add(s)};Object.keys(t).forEach(i),r.map(s=>Object.keys(s).forEach(i));const c=new Set([]);if(this.params.base){const s=JSON.stringify(this.params.base).match(/\{-?props\.([^}]+)\}/gi);s&&s.forEach(a=>{const p=a.replace(/\{(?:-)?props\.([^}]+)\}/gi,"$1"),f=g.dashCase(p);p&&c.add(f)})}return{element:e,variantKeys:[...n],propValueKeys:[...c],passProps:u,defaultProps:l,attr:{"data-component-name":m?void 0:y}}}}const S=(o,e)=>{const t=new v(o,e),r=b.elementFactory(o,t.cssClassName,t.clientProps,{"data-unoptimized-client-component":!0});return Object.assign(r,{generator:t}),r};exports.styled=S;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("./styles-generator-E48FU2R-.cjs"),g=require("./parse-tokens-BnDwbP7V.cjs"),b=require("./element-factory-Dt_Z9aHy.cjs");class v extends h.StylesGenerator{constructor(e,t){super(t),this.tagName=e,this._params=t}get priority(){var e;return this.params.priority?this.params.priority:typeof this.tagName=="function"||typeof this.tagName=="object"?(((e=this.tagName.generator)==null?void 0:e.priority)||0)+1:0}get clientProps(){const{element:e,variants:t={},compoundVariants:r=[],defaultVariants:d={},defaultProps:l={},passProps:u}=this.params,{callerName:y,isProduction:m}=this.buildContext,n=new Set([]),i=s=>{const a=d[s];a!==void 0?n.add(`${s}=${String(a)}`):n.add(s)};Object.keys(t).forEach(i),r.map(s=>Object.keys(s).forEach(i));const c=new Set([]);if(this.params.base){const s=JSON.stringify(this.params.base).match(/\{-?props\.([^}]+)\}/gi);s&&s.forEach(a=>{const p=a.replace(/\{(?:-)?props\.([^}]+)\}/gi,"$1"),f=g.dashCase(p);p&&c.add(f)})}return{element:e,variantKeys:[...n],propValueKeys:[...c],passProps:u,defaultProps:l,attr:{"data-component-name":m?void 0:y}}}}const S=(o,e)=>{const t=new v(o,e),r=b.elementFactory(o,t.cssClassName,t.clientProps,{"data-unoptimized-client-component":!0});return Object.assign(r,{generator:t}),r};exports.styled=S;
package/styled.js CHANGED
@@ -1,4 +1,4 @@
1
- import { S as y } from "./styles-generator-BQCMgM_V.js";
1
+ import { S as y } from "./styles-generator-Cz2vkKB0.js";
2
2
  import { d as g } from "./parse-tokens-Cbbbt7eO.js";
3
3
  import { e as v } from "./element-factory-DrGBPkh2.js";
4
4
  class b extends y {
@@ -1,7 +1,7 @@
1
1
  var c = Object.defineProperty;
2
2
  var l = (a, s, t) => s in a ? c(a, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[s] = t;
3
3
  var o = (a, s, t) => l(a, typeof s != "symbol" ? s + "" : s, t);
4
- import { t as n, p as d } from "./parse-styles-anFzH8TT.js";
4
+ import { t as n, p as d } from "./parse-styles-BRbiYmZ_.js";
5
5
  import { d as h } from "./parse-tokens-Cbbbt7eO.js";
6
6
  class C {
7
7
  constructor(s) {
@@ -1 +1 @@
1
- "use strict";var c=Object.defineProperty;var l=(a,s,t)=>s in a?c(a,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[s]=t;var o=(a,s,t)=>l(a,typeof s!="symbol"?s+"":s,t);const n=require("./parse-styles-CfxJtQu_.cjs"),h=require("./parse-tokens-BnDwbP7V.cjs");class u{constructor(s){o(this,"buildContext",{});this.params=s}get priority(){return 0}get isRoot(){return this.priority===0}get hash(){const{base:s,variants:t,compoundVariants:e}=this.params;return n.toHash({base:s,variants:t,compoundVariants:e})}get cssClassName(){return this.hash}get classNames(){const s=new Set([this.cssClassName]),{className:t}=this.params;return typeof t=="string"&&s.add(t),typeof t=="object"&&t.forEach(e=>s.add(e)),this.getTemplateClasses().forEach(e=>s.add(e)),this.buildContext.classNames&&this.buildContext.classNames.forEach(e=>s.add(e)),[...s].join(" ")}get cssFileName(){const{callerName:s}=this.buildContext;return s?`cl_${h.dashCase(s)}-${this.hash}.css`:`${this.hash}.css`}get css(){const{base:s={},variants:t={},compoundVariants:e=[]}=this.params,{config:r}=this.buildContext,i={...s,variants:t,compoundVariants:e};return n.parseAndJoinStyles(i,`.${this.cssClassName}`,r,this.isRoot)}getTemplateClasses(s=this.buildContext.config){if(!(s!=null&&s.templates)||!this.params.base||this.priority>0)return[];const t=Object.keys(s.templates);return Object.entries(this.params.base).reduce((e,[r,i])=>(t.includes(r)&&e.push("t_"+n.toHash(h.dashCase(`${r}-${i}`),4)),e),[])}_withBuildContext(s){return this.buildContext=s,this}}exports.StylesGenerator=u;
1
+ "use strict";var c=Object.defineProperty;var l=(a,s,t)=>s in a?c(a,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[s]=t;var o=(a,s,t)=>l(a,typeof s!="symbol"?s+"":s,t);const n=require("./parse-styles-BU5fcwDA.cjs"),h=require("./parse-tokens-BnDwbP7V.cjs");class u{constructor(s){o(this,"buildContext",{});this.params=s}get priority(){return 0}get isRoot(){return this.priority===0}get hash(){const{base:s,variants:t,compoundVariants:e}=this.params;return n.toHash({base:s,variants:t,compoundVariants:e})}get cssClassName(){return this.hash}get classNames(){const s=new Set([this.cssClassName]),{className:t}=this.params;return typeof t=="string"&&s.add(t),typeof t=="object"&&t.forEach(e=>s.add(e)),this.getTemplateClasses().forEach(e=>s.add(e)),this.buildContext.classNames&&this.buildContext.classNames.forEach(e=>s.add(e)),[...s].join(" ")}get cssFileName(){const{callerName:s}=this.buildContext;return s?`cl_${h.dashCase(s)}-${this.hash}.css`:`${this.hash}.css`}get css(){const{base:s={},variants:t={},compoundVariants:e=[]}=this.params,{config:r}=this.buildContext,i={...s,variants:t,compoundVariants:e};return n.parseAndJoinStyles(i,`.${this.cssClassName}`,r,this.isRoot)}getTemplateClasses(s=this.buildContext.config){if(!(s!=null&&s.templates)||!this.params.base||this.priority>0)return[];const t=Object.keys(s.templates);return Object.entries(this.params.base).reduce((e,[r,i])=>(t.includes(r)&&e.push("t_"+n.toHash(h.dashCase(`${r}-${i}`),4)),e),[])}_withBuildContext(s){return this.buildContext=s,this}}exports.StylesGenerator=u;
@@ -0,0 +1,7 @@
1
+ const p = (e) => (t) => {
2
+ const { screenSize: n, axis: i = "horizontal", minMultiplier: a = 0.5, maxMultiplier: r = 1.5 } = e, o = Math.round(t / n * 1e4) / 100, l = i === "vertical" ? "vh" : "vw", c = Math.round(a * t), s = Math.round(r * t);
3
+ return `clamp(${c}px, ${o}${l}, ${s}px)`;
4
+ };
5
+ export {
6
+ p as d
7
+ };
@@ -0,0 +1 @@
1
+ "use strict";const p=e=>t=>{const{screenSize:i,axis:n="horizontal",minMultiplier:r=.5,maxMultiplier:a=1.5}=e,o=Math.round(t/i*1e4)/100,l=n==="vertical"?"vh":"vw",c=Math.round(r*t),s=Math.round(a*t);return`clamp(${c}px, ${o}${l}, ${s}px)`};exports.defineViewportClamp=p;
@@ -1,5 +0,0 @@
1
- "use strict";const N=require("./parse-tokens-BnDwbP7V.cjs"),J=r=>s=>{if(typeof s!="string"||!r)return;let t=s;const a=[];return Object.values(r).forEach(o=>{const{pattern:S,transform:$}=o;t=t.replace(S,j=>{const{value:A,css:b}=$(j);return b&&a.push(b),A})}),{transformed:t,additionalCss:a}},z=r=>String.fromCharCode(r+(r>25?39:97)),M=(r,s)=>{let t="",a;for(a=Math.abs(r);a>52;a=a/52|0)t=z(a%52)+t;return t=z(a%52)+t,t.length<s?t=t.padStart(s,"a"):t.length>s&&(t=t.slice(-s)),t},T=(r,s)=>{let t=s.length;for(;t;)r=r*33^s.charCodeAt(--t);return r},U=(r,s=5)=>{const t=T(5381,JSON.stringify(r))>>>0;return M(t,s)},q=["top","right","bottom","left","min-width",/.*width.*/,/^[^line]*height.*/,/padding.*/,/margin.*/,/border.*/,/inset.*/,/.*radius.*/,/.*spacing.*/,/.*gap.*/,/.*indent.*/,/.*offset.*/,/.*size.*/,/.*thickness.*/,/.*font-size.*/],Q=(r,s,t)=>{if(q.some(o=>typeof o=="string"?o===r:o.test(r))){const o=(t==null?void 0:t.defaultUnit)||"px";return`${s}${o}`}return`${s}`},_=["Webkit","Moz","ms","O"],F=r=>r.startsWith("-")?r:_.some(s=>r.startsWith(s))?`-${N.dashCase(r)}`:N.dashCase(r),y=async(r,s="",t,a=!1)=>{if(!r)throw new Error("No styles provided to parseStyles function!");const o=new Set,S=Object.entries(r),$=async([f,e])=>{var C;const n=f.trim().replace(/^\?+/g,""),w=F(n),u=(c,d=";")=>`${w}:${c}${d}`,P={scope:s,config:t};if(typeof e=="function")return $([f,e(P)]);if(e instanceof Promise)return $([f,await e]);if(t!=null&&t.templates&&t.templatePaths[n])try{const[c,d]=t.templatePaths[n].split(";;"),i=await import(d),l=d.includes("salty.config"),p=l?i[c].templates:i[c],h=l?p[n]:p.params[n];if(p&&typeof h=="function"){const E=await h(e),[m]=await y(E,"");return m}}catch(c){console.error(`Error loading template "${n}" from path "${t.templatePaths[n]}"`,c);return}if(t!=null&&t.templates&&t.templates[n]){if(a)return;const d=e.split(".").reduce((i,l)=>i[l],t.templates[n]);if(d){const[i]=await y(d,"");return i}console.warn(`Template "${n}" with path of "${e}" was not found in config!`);return}if(typeof e=="object"){if(!e)return;if(e.isColor)return u(e.toString());if(n==="defaultVariants")return;if(n==="variants"){const i=Object.entries(e);for(const[l,p]of i){if(!p)continue;const h=Object.entries(p);for(const[E,m]of h){if(!m)continue;const x=`${s}.${l}-${E}`;(await y(m,x,t)).forEach(H=>o.add(H))}}return}if(n==="compoundVariants"){for(const i of e){const{css:l,...p}=i,h=Object.entries(p).reduce((m,[x,V])=>`${m}.${x}-${V}`,s);(await y(l,h,t)).forEach(m=>o.add(m))}return}if(n.startsWith("@")){const i=((C=t==null?void 0:t.mediaQueries)==null?void 0:C[n])||n,l=await W(e,s,t),p=`${i} { ${l} }`;o.add(p);return}const c=f.includes("&")?n.replaceAll("&",s):n.startsWith(":")?`${s}${n}`:`${s} ${n}`;(await y(e,c,t)).forEach(i=>o.add(i));return}if(typeof e=="number"){const c=Q(w,e,t);return u(c)}if(typeof e!="string")if("toString"in e)e=e.toString();else throw new Error(`Invalid value type for property ${w}`);return u(e)},j=S.map($),{modifiers:A}=t||{},b=[N.parseValueTokens(),J(A)],O=(await Promise.all(j).then(f=>Promise.all(f.map(e=>b.reduce(async(n,w)=>{const u=await n;if(!u)return u;const P=await w(u);if(!P)return u;const{transformed:C,additionalCss:c}=P;let d="";if(c)for(const i of c)d+=await W(i,"");return`${d}${C}`},Promise.resolve(e)))))).filter(f=>f!==void 0).join(`
2
- `);if(!O.trim())return Array.from(o);const v=s?`${s} {
3
- ${O}
4
- }`:O;return o.has(v)?Array.from(o):[v,...o]},W=async(r,s,t,a=!1)=>(await y(r,s,t,a)).join(`
5
- `);exports.parseAndJoinStyles=W;exports.toHash=U;
@@ -1,145 +0,0 @@
1
- import { d as v, a as U } from "./parse-tokens-Cbbbt7eO.js";
2
- const H = (r) => (s) => {
3
- if (typeof s != "string" || !r) return;
4
- let t = s;
5
- const i = [];
6
- return Object.values(r).forEach((o) => {
7
- const { pattern: j, transform: y } = o;
8
- t = t.replace(j, (S) => {
9
- const { value: x, css: b } = y(S);
10
- return b && i.push(b), x;
11
- });
12
- }), { transformed: t, additionalCss: i };
13
- }, V = (r) => String.fromCharCode(r + (r > 25 ? 39 : 97)), J = (r, s) => {
14
- let t = "", i;
15
- for (i = Math.abs(r); i > 52; i = i / 52 | 0) t = V(i % 52) + t;
16
- return t = V(i % 52) + t, t.length < s ? t = t.padStart(s, "a") : t.length > s && (t = t.slice(-s)), t;
17
- }, Q = (r, s) => {
18
- let t = s.length;
19
- for (; t; ) r = r * 33 ^ s.charCodeAt(--t);
20
- return r;
21
- }, G = (r, s = 5) => {
22
- const t = Q(5381, JSON.stringify(r)) >>> 0;
23
- return J(t, s);
24
- }, T = [
25
- "top",
26
- "right",
27
- "bottom",
28
- "left",
29
- "min-width",
30
- /.*width.*/,
31
- /^[^line]*height.*/,
32
- // Exclude line-height
33
- /padding.*/,
34
- /margin.*/,
35
- /border.*/,
36
- /inset.*/,
37
- /.*radius.*/,
38
- /.*spacing.*/,
39
- /.*gap.*/,
40
- /.*indent.*/,
41
- /.*offset.*/,
42
- /.*size.*/,
43
- /.*thickness.*/,
44
- /.*font-size.*/
45
- ], _ = (r, s, t) => {
46
- if (T.some((o) => typeof o == "string" ? o === r : o.test(r))) {
47
- const o = (t == null ? void 0 : t.defaultUnit) || "px";
48
- return `${s}${o}`;
49
- }
50
- return `${s}`;
51
- }, q = ["Webkit", "Moz", "ms", "O"], F = (r) => r.startsWith("-") ? r : q.some((s) => r.startsWith(s)) ? `-${v(r)}` : v(r), $ = async (r, s = "", t, i = !1) => {
52
- if (!r) throw new Error("No styles provided to parseStyles function!");
53
- const o = /* @__PURE__ */ new Set(), j = Object.entries(r), y = async ([f, e]) => {
54
- var E;
55
- const n = f.trim().replace(/^\?+/g, ""), w = F(n), m = (c, d = ";") => `${w}:${c}${d}`, P = { scope: s, config: t };
56
- if (typeof e == "function") return y([f, e(P)]);
57
- if (e instanceof Promise) return y([f, await e]);
58
- if (t != null && t.templates && t.templatePaths[n])
59
- try {
60
- const [c, d] = t.templatePaths[n].split(";;"), a = await import(d), p = d.includes("salty.config"), l = p ? a[c].templates : a[c], h = p ? l[n] : l.params[n];
61
- if (l && typeof h == "function") {
62
- const C = await h(e), [u] = await $(C, "");
63
- return u;
64
- }
65
- } catch (c) {
66
- console.error(`Error loading template "${n}" from path "${t.templatePaths[n]}"`, c);
67
- return;
68
- }
69
- if (t != null && t.templates && t.templates[n]) {
70
- if (i) return;
71
- const d = e.split(".").reduce((a, p) => a[p], t.templates[n]);
72
- if (d) {
73
- const [a] = await $(d, "");
74
- return a;
75
- }
76
- console.warn(`Template "${n}" with path of "${e}" was not found in config!`);
77
- return;
78
- }
79
- if (typeof e == "object") {
80
- if (!e) return;
81
- if (e.isColor) return m(e.toString());
82
- if (n === "defaultVariants") return;
83
- if (n === "variants") {
84
- const a = Object.entries(e);
85
- for (const [p, l] of a) {
86
- if (!l) continue;
87
- const h = Object.entries(l);
88
- for (const [C, u] of h) {
89
- if (!u) continue;
90
- const O = `${s}.${p}-${C}`;
91
- (await $(u, O, t)).forEach((M) => o.add(M));
92
- }
93
- }
94
- return;
95
- }
96
- if (n === "compoundVariants") {
97
- for (const a of e) {
98
- const { css: p, ...l } = a, h = Object.entries(l).reduce((u, [O, W]) => `${u}.${O}-${W}`, s);
99
- (await $(p, h, t)).forEach((u) => o.add(u));
100
- }
101
- return;
102
- }
103
- if (n.startsWith("@")) {
104
- const a = ((E = t == null ? void 0 : t.mediaQueries) == null ? void 0 : E[n]) || n, p = await z(e, s, t), l = `${a} { ${p} }`;
105
- o.add(l);
106
- return;
107
- }
108
- const c = f.includes("&") ? n.replaceAll("&", s) : n.startsWith(":") ? `${s}${n}` : `${s} ${n}`;
109
- (await $(e, c, t)).forEach((a) => o.add(a));
110
- return;
111
- }
112
- if (typeof e == "number") {
113
- const c = _(w, e, t);
114
- return m(c);
115
- }
116
- if (typeof e != "string")
117
- if ("toString" in e) e = e.toString();
118
- else throw new Error(`Invalid value type for property ${w}`);
119
- return m(e);
120
- }, S = j.map(y), { modifiers: x } = t || {}, b = [U(), H(x)], A = (await Promise.all(S).then((f) => Promise.all(
121
- f.map((e) => b.reduce(async (n, w) => {
122
- const m = await n;
123
- if (!m) return m;
124
- const P = await w(m);
125
- if (!P) return m;
126
- const { transformed: E, additionalCss: c } = P;
127
- let d = "";
128
- if (c)
129
- for (const a of c)
130
- d += await z(a, "");
131
- return `${d}${E}`;
132
- }, Promise.resolve(e)))
133
- ))).filter((f) => f !== void 0).join(`
134
- `);
135
- if (!A.trim()) return Array.from(o);
136
- const N = s ? `${s} {
137
- ${A}
138
- }` : A;
139
- return o.has(N) ? Array.from(o) : [N, ...o];
140
- }, z = async (r, s, t, i = !1) => (await $(r, s, t, i)).join(`
141
- `);
142
- export {
143
- z as p,
144
- G as t
145
- };