/**
 * Bundled by jsDelivr using Rollup v2.79.1 and Terser v5.19.2.
 * Original file: /npm/@kurkle/color@0.3.4/dist/color.esm.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
/*!
 * @kurkle/color v0.3.4
 * https://github.com/kurkle/color#readme
 * (c) 2024 Jukka Kurkela
 * Released under the MIT License
 */
function e(e){return e+.5|0}const t=(e,t,f)=>Math.max(Math.min(e,f),t);function f(f){return t(e(2.55*f),0,255)}function r(f){return t(e(f/2.55),0,100)}function a(f){return t(e(255*f),0,255)}function n(f){return t(e(f/2.55)/100,0,1)}function i(f){return t(e(100*f),0,100)}const s={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},c=[..."0123456789ABCDEF"],b=e=>c[15&e],g=e=>c[(240&e)>>4]+c[15&e],d=e=>(240&e)>>4==(15&e);function o(e){var t,f=e.length;return"#"===e[0]&&(4===f||5===f?t={r:255&17*s[e[1]],g:255&17*s[e[2]],b:255&17*s[e[3]],a:5===f?17*s[e[4]]:255}:7!==f&&9!==f||(t={r:s[e[1]]<<4|s[e[2]],g:s[e[3]]<<4|s[e[4]],b:s[e[5]]<<4|s[e[6]],a:9===f?s[e[7]]<<4|s[e[8]]:255})),t}function u(e){var t=(e=>d(e.r)&&d(e.g)&&d(e.b)&&d(e.a))(e)?b:g;return e?"#"+t(e.r)+t(e.g)+t(e.b)+((e,t)=>e<255?t(e):"")(e.a,t):void 0}const h=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function l(e,t,f){const r=t*Math.min(f,1-f),a=(t,a=(t+e/30)%12)=>f-r*Math.max(Math.min(a-3,9-a,1),-1);return[a(0),a(8),a(4)]}function m(e,t,f){const r=(r,a=(r+e/60)%6)=>f-f*t*Math.max(Math.min(a,4-a,1),0);return[r(5),r(3),r(1)]}function y(e,t,f){const r=l(e,1,.5);let a;for(t+f>1&&(a=1/(t+f),t*=a,f*=a),a=0;a<3;a++)r[a]*=1-t-f,r[a]+=t;return r}function p(e){const t=e.r/255,f=e.g/255,r=e.b/255,a=Math.max(t,f,r),n=Math.min(t,f,r),i=(a+n)/2;let s,c,b;return a!==n&&(b=a-n,c=i>.5?b/(2-a-n):b/(a+n),s=function(e,t,f,r,a){return e===a?(t-f)/r+(t<f?6:0):t===a?(f-e)/r+2:(e-t)/r+4}(t,f,r,b,a),s=60*s+.5),[0|s,c||0,i]}function Y(e,t,f,r){return(Array.isArray(t)?e(t[0],t[1],t[2]):e(t,f,r)).map(a)}function v(e,t,f){return Y(l,e,t,f)}function w(e,t,f){return Y(y,e,t,f)}function x(e,t,f){return Y(m,e,t,f)}function F(e){return(e%360+360)%360}function _(e){const t=h.exec(e);let r,n=255;if(!t)return;t[5]!==r&&(n=t[6]?f(+t[5]):a(+t[5]));const i=F(+t[2]),s=+t[3]/100,c=+t[4]/100;return r="hwb"===t[1]?w(i,s,c):"hsv"===t[1]?x(i,s,c):v(i,s,c),{r:r[0],g:r[1],b:r[2],a:n}}function M(e,t){var f=p(e);f[0]=F(f[0]+t),f=v(f),e.r=f[0],e.g=f[1],e.b=f[2]}function X(e){if(!e)return;const t=p(e),f=t[0],r=i(t[1]),a=i(t[2]);return e.a<255?`hsla(${f}, ${r}%, ${a}%, ${n(e.a)})`:`hsl(${f}, ${r}%, ${a}%)`}const k={x:"dark",Z:"light",Y:"re",X:"blu",W:"gr",V:"medium",U:"slate",A:"ee",T:"ol",S:"or",B:"ra",C:"lateg",D:"ights",R:"in",Q:"turquois",E:"hi",P:"ro",O:"al",N:"le",M:"de",L:"yello",F:"en",K:"ch",G:"arks",H:"ea",I:"ightg",J:"wh"},O={OiceXe:"f0f8ff",antiquewEte:"faebd7",aqua:"ffff",aquamarRe:"7fffd4",azuY:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"0",blanKedOmond:"ffebcd",Xe:"ff",XeviTet:"8a2be2",bPwn:"a52a2a",burlywood:"deb887",caMtXe:"5f9ea0",KartYuse:"7fff00",KocTate:"d2691e",cSO:"ff7f50",cSnflowerXe:"6495ed",cSnsilk:"fff8dc",crimson:"dc143c",cyan:"ffff",xXe:"8b",xcyan:"8b8b",xgTMnPd:"b8860b",xWay:"a9a9a9",xgYF:"6400",xgYy:"a9a9a9",xkhaki:"bdb76b",xmagFta:"8b008b",xTivegYF:"556b2f",xSange:"ff8c00",xScEd:"9932cc",xYd:"8b0000",xsOmon:"e9967a",xsHgYF:"8fbc8f",xUXe:"483d8b",xUWay:"2f4f4f",xUgYy:"2f4f4f",xQe:"ced1",xviTet:"9400d3",dAppRk:"ff1493",dApskyXe:"bfff",dimWay:"696969",dimgYy:"696969",dodgerXe:"1e90ff",fiYbrick:"b22222",flSOwEte:"fffaf0",foYstWAn:"228b22",fuKsia:"ff00ff",gaRsbSo:"dcdcdc",ghostwEte:"f8f8ff",gTd:"ffd700",gTMnPd:"daa520",Way:"808080",gYF:"8000",gYFLw:"adff2f",gYy:"808080",honeyMw:"f0fff0",hotpRk:"ff69b4",RdianYd:"cd5c5c",Rdigo:"4b0082",ivSy:"fffff0",khaki:"f0e68c",lavFMr:"e6e6fa",lavFMrXsh:"fff0f5",lawngYF:"7cfc00",NmoncEffon:"fffacd",ZXe:"add8e6",ZcSO:"f08080",Zcyan:"e0ffff",ZgTMnPdLw:"fafad2",ZWay:"d3d3d3",ZgYF:"90ee90",ZgYy:"d3d3d3",ZpRk:"ffb6c1",ZsOmon:"ffa07a",ZsHgYF:"20b2aa",ZskyXe:"87cefa",ZUWay:"778899",ZUgYy:"778899",ZstAlXe:"b0c4de",ZLw:"ffffe0",lime:"ff00",limegYF:"32cd32",lRF:"faf0e6",magFta:"ff00ff",maPon:"800000",VaquamarRe:"66cdaa",VXe:"cd",VScEd:"ba55d3",VpurpN:"9370db",VsHgYF:"3cb371",VUXe:"7b68ee",VsprRggYF:"fa9a",VQe:"48d1cc",VviTetYd:"c71585",midnightXe:"191970",mRtcYam:"f5fffa",mistyPse:"ffe4e1",moccasR:"ffe4b5",navajowEte:"ffdead",navy:"80",Tdlace:"fdf5e6",Tive:"808000",TivedBb:"6b8e23",Sange:"ffa500",SangeYd:"ff4500",ScEd:"da70d6",pOegTMnPd:"eee8aa",pOegYF:"98fb98",pOeQe:"afeeee",pOeviTetYd:"db7093",papayawEp:"ffefd5",pHKpuff:"ffdab9",peru:"cd853f",pRk:"ffc0cb",plum:"dda0dd",powMrXe:"b0e0e6",purpN:"800080",YbeccapurpN:"663399",Yd:"ff0000",Psybrown:"bc8f8f",PyOXe:"4169e1",saddNbPwn:"8b4513",sOmon:"fa8072",sandybPwn:"f4a460",sHgYF:"2e8b57",sHshell:"fff5ee",siFna:"a0522d",silver:"c0c0c0",skyXe:"87ceeb",UXe:"6a5acd",UWay:"708090",UgYy:"708090",snow:"fffafa",sprRggYF:"ff7f",stAlXe:"4682b4",tan:"d2b48c",teO:"8080",tEstN:"d8bfd8",tomato:"ff6347",Qe:"40e0d0",viTet:"ee82ee",JHt:"f5deb3",wEte:"ffffff",wEtesmoke:"f5f5f5",Lw:"ffff00",LwgYF:"9acd32"};let S;function T(e){S||(S=function(){const e={},t=Object.keys(O),f=Object.keys(k);let r,a,n,i,s;for(r=0;r<t.length;r++){for(i=s=t[r],a=0;a<f.length;a++)n=f[a],s=s.replace(n,k[n]);n=parseInt(O[i],16),e[s]=[n>>16&255,n>>8&255,255&n]}return e}(),S.transparent=[0,0,0,0]);const t=S[e.toLowerCase()];return t&&{r:t[0],g:t[1],b:t[2],a:4===t.length?t[3]:255}}const Z=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function $(e){const r=Z.exec(e);let a,n,i,s=255;if(r){if(r[7]!==a){const e=+r[7];s=r[8]?f(e):t(255*e,0,255)}return a=+r[1],n=+r[3],i=+r[5],a=255&(r[2]?f(a):t(a,0,255)),n=255&(r[4]?f(n):t(n,0,255)),i=255&(r[6]?f(i):t(i,0,255)),{r:a,g:n,b:i,a:s}}}function E(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${n(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}const R=e=>e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055,A=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function P(e,t,f){if(e){let r=p(e);r[t]=Math.max(0,Math.min(r[t]+r[t]*f,0===t?360:1)),r=v(r),e.r=r[0],e.g=r[1],e.b=r[2]}}function U(e,t){return e?Object.assign(t||{},e):e}function V(e){var t={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(t={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(t.a=a(e[3]))):(t=U(e,{r:0,g:0,b:0,a:1})).a=a(t.a),t}class W{constructor(e){if(e instanceof W)return e;const t=typeof e;let f;var r;"object"===t?f=V(e):"string"===t&&(f=o(e)||T(e)||("r"===(r=e).charAt(0)?$(r):_(r))),this._rgb=f,this._valid=!!f}get valid(){return this._valid}get rgb(){var e=U(this._rgb);return e&&(e.a=n(e.a)),e}set rgb(e){this._rgb=V(e)}rgbString(){return this._valid?E(this._rgb):void 0}hexString(){return this._valid?u(this._rgb):void 0}hslString(){return this._valid?X(this._rgb):void 0}mix(e,t){if(e){const f=this.rgb,r=e.rgb;let a;const n=t===a?.5:t,i=2*n-1,s=f.a-r.a,c=((i*s==-1?i:(i+s)/(1+i*s))+1)/2;a=1-c,f.r=255&c*f.r+a*r.r+.5,f.g=255&c*f.g+a*r.g+.5,f.b=255&c*f.b+a*r.b+.5,f.a=n*f.a+(1-n)*r.a,this.rgb=f}return this}interpolate(e,t){return e&&(this._rgb=function(e,t,f){const r=A(n(e.r)),i=A(n(e.g)),s=A(n(e.b));return{r:a(R(r+f*(A(n(t.r))-r))),g:a(R(i+f*(A(n(t.g))-i))),b:a(R(s+f*(A(n(t.b))-s))),a:e.a+f*(t.a-e.a)}}(this._rgb,e._rgb,t)),this}clone(){return new W(this.rgb)}alpha(e){return this._rgb.a=a(e),this}clearer(e){return this._rgb.a*=1-e,this}greyscale(){const t=this._rgb,f=e(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=f,this}opaquer(e){return this._rgb.a*=1+e,this}negate(){const e=this._rgb;return e.r=255-e.r,e.g=255-e.g,e.b=255-e.b,this}lighten(e){return P(this._rgb,2,e),this}darken(e){return P(this._rgb,2,-e),this}saturate(e){return P(this._rgb,1,e),this}desaturate(e){return P(this._rgb,1,-e),this}rotate(e){return M(this._rgb,e),this}}function H(e){return new W(e)}export{W as Color,n as b2n,r as b2p,H as default,o as hexParse,u as hexString,v as hsl2rgb,X as hslString,x as hsv2rgb,_ as hueParse,w as hwb2rgb,t as lim,a as n2b,i as n2p,T as nameParse,f as p2b,p as rgb2hsl,$ as rgbParse,E as rgbString,M as rotate,e as round};
//# sourceMappingURL=/sm/8297956cd2e6973bbf161801ad93ec30162e56e9ae676cac2075aa32c3190ea0.map