@ui5/webcomponents-base 2.7.0-rc.0 → 2.7.0-rc.1

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.
@@ -1,2 +1,2 @@
1
- "use strict";const u=new Map([["aliceblue","f0f8ff"],["antiquewhite","faebd7"],["aqua","00ffff"],["aquamarine","7fffd4"],["azure","f0ffff"],["beige","f5f5dc"],["bisque","ffe4c4"],["black","000000"],["blanchedalmond","ffebcd"],["blue","0000ff"],["blueviolet","8a2be2"],["brown","a52a2a"],["burlywood","deb887"],["cadetblue","5f9ea0"],["chartreuse","7fff00"],["chocolate","d2691e"],["coral","ff7f50"],["cornflowerblue","6495ed"],["cornsilk","fff8dc"],["crimson","dc143c"],["cyan","00ffff"],["darkblue","00008b"],["darkcyan","008b8b"],["darkgoldenrod","b8860b"],["darkgray","a9a9a9"],["darkgrey","a9a9a9"],["darkgreen","006400"],["darkkhaki","bdb76b"],["darkmagenta","8b008b"],["darkolivegreen","556b2f"],["darkorange","ff8c00"],["darkorchid","9932cc"],["darkred","8b0000"],["darksalmon","e9967a"],["darkseagreen","8fbc8f"],["darkslateblue","483d8b"],["darkslategray","2f4f4f"],["darkslategrey","2f4f4f"],["darkturquoise","00ced1"],["darkviolet","9400d3"],["deeppink","ff1493"],["deepskyblue","00bfff"],["dimgray","696969"],["dimgrey","696969"],["dodgerblue","1e90ff"],["firebrick","b22222"],["floralwhite","fffaf0"],["forestgreen","228b22"],["fuchsia","ff00ff"],["gainsboro","dcdcdc"],["ghostwhite","f8f8ff"],["gold","ffd700"],["goldenrod","daa520"],["gray","808080"],["grey","808080"],["green","008000"],["greenyellow","adff2f"],["honeydew","f0fff0"],["hotpink","ff69b4"],["indianred","cd5c5c"],["indigo","4b0082"],["ivory","fffff0"],["khaki","f0e68c"],["lavender","e6e6fa"],["lavenderblush","fff0f5"],["lawngreen","7cfc00"],["lemonchiffon","fffacd"],["lightblue","add8e6"],["lightcoral","f08080"],["lightcyan","e0ffff"],["lightgoldenrodyellow","fafad2"],["lightgray","d3d3d3"],["lightgrey","d3d3d3"],["lightgreen","90ee90"],["lightpink","ffb6c1"],["lightsalmon","ffa07a"],["lightseagreen","20b2aa"],["lightskyblue","87cefa"],["lightslategray","778899"],["lightslategrey","778899"],["lightsteelblue","b0c4de"],["lightyellow","ffffe0"],["lime","00ff00"],["limegreen","32cd32"],["linen","faf0e6"],["magenta","ff00ff"],["maroon","800000"],["mediumaquamarine","66cdaa"],["mediumblue","0000cd"],["mediumorchid","ba55d3"],["mediumpurple","9370db"],["mediumseagreen","3cb371"],["mediumslateblue","7b68ee"],["mediumspringgreen","00fa9a"],["mediumturquoise","48d1cc"],["mediumvioletred","c71585"],["midnightblue","191970"],["mintcream","f5fffa"],["mistyrose","ffe4e1"],["moccasin","ffe4b5"],["navajowhite","ffdead"],["navy","000080"],["oldlace","fdf5e6"],["olive","808000"],["olivedrab","6b8e23"],["orange","ffa500"],["orangered","ff4500"],["orchid","da70d6"],["palegoldenrod","eee8aa"],["palegreen","98fb98"],["paleturquoise","afeeee"],["palevioletred","db7093"],["papayawhip","ffefd5"],["peachpuff","ffdab9"],["peru","cd853f"],["pink","ffc0cb"],["plum","dda0dd"],["powderblue","b0e0e6"],["purple","800080"],["red","ff0000"],["rosybrown","bc8f8f"],["royalblue","4169e1"],["saddlebrown","8b4513"],["salmon","fa8072"],["sandybrown","f4a460"],["seagreen","2e8b57"],["seashell","fff5ee"],["sienna","a0522d"],["silver","c0c0c0"],["skyblue","87ceeb"],["slateblue","6a5acd"],["slategray","708090"],["slategrey","708090"],["snow","fffafa"],["springgreen","00ff7f"],["steelblue","4682b4"],["tan","d2b48c"],["teal","008080"],["thistle","d8bfd8"],["tomato","ff6347"],["turquoise","40e0d0"],["violet","ee82ee"],["wheat","f5deb3"],["white","ffffff"],["whitesmoke","f5f5f5"],["yellow","ffff00"],["yellowgreen","9acd32"],["transparent","00000000"]]),c=e=>e.startsWith("rgba")?k(e):e.startsWith("rgb")?h(e):(e.indexOf("#")===0&&(e.length===4?e=`${e[1]}${e[1]}${e[2]}${e[2]}${e[3]}${e[3]}`:e=e.slice(1,e.length)),u.has(e)&&(e=u.get(e)),m(e)),p=e=>{let r=1;if(e.startsWith("rgba")||e.startsWith("hsla")){const a=e.split(",");a.length===4&&(r=parseFloat(a[3].replace(")","").trim()))}return r},k=e=>{const r=e.indexOf("("),a=[];for(let f=0;f<e.length;f++)e[f]===","&&a.push(f);return{r:parseInt(e.slice(r+1,a[0]).trim()),g:parseInt(e.slice(a[0]+1,a[1]).trim()),b:parseInt(e.slice(a[1]+1,a[2]).trim())}},h=e=>{const r=e.indexOf("("),a=e.indexOf(")"),f=[];for(let t=0;t<e.length;t++)e[t]===","&&f.push(t);return{r:parseInt(e.slice(r+1,f[0]).trim()),g:parseInt(e.slice(f[0]+1,f[1]).trim()),b:parseInt(e.slice(f[1]+1,a).trim())}},y=e=>{let r=e.s*100,a=e.l*100,f,t,i;r>100?r=1:r<0?r=0:r/=100,a>100?a=1:a<0?a=0:a/=100;const d=e.h,s=r*(1-Math.abs(2*a-1)),n=255*(a-.5*s),g=s*(1-Math.abs(d/60%2-1)),o=Math.floor(d/60),l=n+255*g,b=n+255*s;switch(o){case 0:f=b,t=l,i=n;break;case 1:f=l,t=b,i=n;break;case 2:f=n,t=b,i=l;break;case 3:f=n,t=l,i=b;break;case 4:f=l,t=n,i=b;break;case 5:f=b,t=n,i=l;break;default:f=0,t=0,i=0;break}return{r:Math.round(f),g:Math.round(t),b:Math.round(i)}},m=e=>({r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16)}),w=e=>{const r=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F"];let a="#",f=e.r/16,t=e.r%16;return a+=String(r[Math.floor(f)]),a+=String(r[t]),f=e.g/16,t=e.g%16,a+=String(r[Math.floor(f)]),a+=String(r[t]),f=e.b/16,t=e.b%16,a+=String(r[Math.floor(f)]),a+=String(r[t]),a},B=e=>{const r=e.r/255,a=e.g/255,f=e.b/255,t=Math.max(r,a,f),i=Math.min(r,a,f),d=t-i;let s=0,n;d===0?s=0:t===r?s=60*((a-f)/d%6):t===a?s=60*((f-r)/d+2):t===f&&(s=60*((r-a)/d+4));const g=(t+i)/2;return d===0?n=0:n=d/(1-Math.abs(2*g-1)),{h:s,s:n,l:g}};export{c as getRGBColor,p as getAlpha,y as HSLToRGB,m as HEXToRGB,B as RGBToHSL,h as RGBStringToRGBObject,w as RGBtoHEX};
1
+ "use strict";const u=new Map([["aliceblue","f0f8ff"],["antiquewhite","faebd7"],["aqua","00ffff"],["aquamarine","7fffd4"],["azure","f0ffff"],["beige","f5f5dc"],["bisque","ffe4c4"],["black","000000"],["blanchedalmond","ffebcd"],["blue","0000ff"],["blueviolet","8a2be2"],["brown","a52a2a"],["burlywood","deb887"],["cadetblue","5f9ea0"],["chartreuse","7fff00"],["chocolate","d2691e"],["coral","ff7f50"],["cornflowerblue","6495ed"],["cornsilk","fff8dc"],["crimson","dc143c"],["cyan","00ffff"],["darkblue","00008b"],["darkcyan","008b8b"],["darkgoldenrod","b8860b"],["darkgray","a9a9a9"],["darkgrey","a9a9a9"],["darkgreen","006400"],["darkkhaki","bdb76b"],["darkmagenta","8b008b"],["darkolivegreen","556b2f"],["darkorange","ff8c00"],["darkorchid","9932cc"],["darkred","8b0000"],["darksalmon","e9967a"],["darkseagreen","8fbc8f"],["darkslateblue","483d8b"],["darkslategray","2f4f4f"],["darkslategrey","2f4f4f"],["darkturquoise","00ced1"],["darkviolet","9400d3"],["deeppink","ff1493"],["deepskyblue","00bfff"],["dimgray","696969"],["dimgrey","696969"],["dodgerblue","1e90ff"],["firebrick","b22222"],["floralwhite","fffaf0"],["forestgreen","228b22"],["fuchsia","ff00ff"],["gainsboro","dcdcdc"],["ghostwhite","f8f8ff"],["gold","ffd700"],["goldenrod","daa520"],["gray","808080"],["grey","808080"],["green","008000"],["greenyellow","adff2f"],["honeydew","f0fff0"],["hotpink","ff69b4"],["indianred","cd5c5c"],["indigo","4b0082"],["ivory","fffff0"],["khaki","f0e68c"],["lavender","e6e6fa"],["lavenderblush","fff0f5"],["lawngreen","7cfc00"],["lemonchiffon","fffacd"],["lightblue","add8e6"],["lightcoral","f08080"],["lightcyan","e0ffff"],["lightgoldenrodyellow","fafad2"],["lightgray","d3d3d3"],["lightgrey","d3d3d3"],["lightgreen","90ee90"],["lightpink","ffb6c1"],["lightsalmon","ffa07a"],["lightseagreen","20b2aa"],["lightskyblue","87cefa"],["lightslategray","778899"],["lightslategrey","778899"],["lightsteelblue","b0c4de"],["lightyellow","ffffe0"],["lime","00ff00"],["limegreen","32cd32"],["linen","faf0e6"],["magenta","ff00ff"],["maroon","800000"],["mediumaquamarine","66cdaa"],["mediumblue","0000cd"],["mediumorchid","ba55d3"],["mediumpurple","9370db"],["mediumseagreen","3cb371"],["mediumslateblue","7b68ee"],["mediumspringgreen","00fa9a"],["mediumturquoise","48d1cc"],["mediumvioletred","c71585"],["midnightblue","191970"],["mintcream","f5fffa"],["mistyrose","ffe4e1"],["moccasin","ffe4b5"],["navajowhite","ffdead"],["navy","000080"],["oldlace","fdf5e6"],["olive","808000"],["olivedrab","6b8e23"],["orange","ffa500"],["orangered","ff4500"],["orchid","da70d6"],["palegoldenrod","eee8aa"],["palegreen","98fb98"],["paleturquoise","afeeee"],["palevioletred","db7093"],["papayawhip","ffefd5"],["peachpuff","ffdab9"],["peru","cd853f"],["pink","ffc0cb"],["plum","dda0dd"],["powderblue","b0e0e6"],["purple","800080"],["red","ff0000"],["rosybrown","bc8f8f"],["royalblue","4169e1"],["saddlebrown","8b4513"],["salmon","fa8072"],["sandybrown","f4a460"],["seagreen","2e8b57"],["seashell","fff5ee"],["sienna","a0522d"],["silver","c0c0c0"],["skyblue","87ceeb"],["slateblue","6a5acd"],["slategray","708090"],["slategrey","708090"],["snow","fffafa"],["springgreen","00ff7f"],["steelblue","4682b4"],["tan","d2b48c"],["teal","008080"],["thistle","d8bfd8"],["tomato","ff6347"],["turquoise","40e0d0"],["violet","ee82ee"],["wheat","f5deb3"],["white","ffffff"],["whitesmoke","f5f5f5"],["yellow","ffff00"],["yellowgreen","9acd32"],["transparent","00000000"]]),m=e=>e.startsWith("rgba")?k(e):e.startsWith("rgb")?h(e):(e.indexOf("#")===0&&(e.length===4?e=`${e[1]}${e[1]}${e[2]}${e[2]}${e[3]}${e[3]}`:e=e.slice(1,e.length)),u.has(e)&&(e=u.get(e)),o(e)),p=e=>{let t=1;if(e.startsWith("rgba")||e.startsWith("hsla")){const a=e.split(",");a.length===4&&(t=parseFloat(a[3].replace(")","").trim()))}return t},k=e=>{const t=e.indexOf("("),a=[];for(let f=0;f<e.length;f++)e[f]===","&&a.push(f);return{r:parseInt(e.slice(t+1,a[0]).trim()),g:parseInt(e.slice(a[0]+1,a[1]).trim()),b:parseInt(e.slice(a[1]+1,a[2]).trim())}},h=e=>{const t=e.indexOf("("),a=e.indexOf(")"),f=[];for(let r=0;r<e.length;r++)e[r]===","&&f.push(r);return{r:parseInt(e.slice(t+1,f[0]).trim()),g:parseInt(e.slice(f[0]+1,f[1]).trim()),b:parseInt(e.slice(f[1]+1,a).trim())}},y=e=>{let t=e.s,a=e.l,f,r,n;t>100?t=1:t<0?t=0:t/=100,a>100?a=1:a<0?a=0:a/=100;const s=(e.h%360+360)%360,d=t*(1-Math.abs(2*a-1)),i=255*(a-.5*d),l=d*(1-Math.abs(s/60%2-1)),c=Math.floor(s/60),b=i+255*l,g=i+255*d;switch(c){case 0:f=g,r=b,n=i;break;case 1:f=b,r=g,n=i;break;case 2:f=i,r=g,n=b;break;case 3:f=i,r=b,n=g;break;case 4:f=b,r=i,n=g;break;case 5:f=g,r=i,n=b;break;default:f=0,r=0,n=0;break}return{r:Math.round(f),g:Math.round(r),b:Math.round(n)}},o=e=>({r:parseInt(e.substr(0,2),16),g:parseInt(e.substr(2,2),16),b:parseInt(e.substr(4,2),16)}),w=e=>{const t=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];let a="",f=e.r/16,r=e.r%16;return a+=String(t[Math.floor(f)]),a+=String(t[r]),f=e.g/16,r=e.g%16,a+=String(t[Math.floor(f)]),a+=String(t[r]),f=e.b/16,r=e.b%16,a+=String(t[Math.floor(f)]),a+=String(t[r]),a},B=e=>{const t=e.r/255,a=e.g/255,f=e.b/255,r=Math.max(t,a,f),n=Math.min(t,a,f),s=r-n;let d=(r+n)/2,i=(r+n)/2,l=(r+n)/2;if(r===n)d=0,i=0;else{switch(i=l>.5?s/(2-r-n):s/(r+n),r){case t:d=(a-f)/s+(a<f?6:0);break;case a:d=(f-t)/s+2;break;case f:d=(t-a)/s+4;break}d/=6}return d=Math.round(d*360),i=Math.round(i*100),l=Math.round(l*100),{h:d,s:i,l}};export{m as getRGBColor,p as getAlpha,y as HSLToRGB,o as HEXToRGB,B as RGBToHSL,h as RGBStringToRGBObject,w as RGBtoHEX};
2
2
  //# sourceMappingURL=ColorConversion.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/util/ColorConversion.ts"],
4
- "sourcesContent": ["/**\n *\n * @param {String} color Color in one of the following formats: RGBA or HEX\n */\n\ntype ColorHSL = {\n\th: number,\n\ts: number,\n\tl: number,\n};\n\ntype ColorRGB = {\n\tr: number,\n\tb: number,\n\tg: number,\n};\n\n/**\n * Map of CSS colors to hex representation\n */\nconst CSSColors = new Map([\n\t[\"aliceblue\", \"f0f8ff\"],\n\t[\"antiquewhite\", \"faebd7\"],\n\t[\"aqua\", \"00ffff\"],\n\t[\"aquamarine\", \"7fffd4\"],\n\t[\"azure\", \"f0ffff\"],\n\t[\"beige\", \"f5f5dc\"],\n\t[\"bisque\", \"ffe4c4\"],\n\t[\"black\", \"000000\"],\n\t[\"blanchedalmond\", \"ffebcd\"],\n\t[\"blue\", \"0000ff\"],\n\t[\"blueviolet\", \"8a2be2\"],\n\t[\"brown\", \"a52a2a\"],\n\t[\"burlywood\", \"deb887\"],\n\t[\"cadetblue\", \"5f9ea0\"],\n\t[\"chartreuse\", \"7fff00\"],\n\t[\"chocolate\", \"d2691e\"],\n\t[\"coral\", \"ff7f50\"],\n\t[\"cornflowerblue\", \"6495ed\"],\n\t[\"cornsilk\", \"fff8dc\"],\n\t[\"crimson\", \"dc143c\"],\n\t[\"cyan\", \"00ffff\"],\n\t[\"darkblue\", \"00008b\"],\n\t[\"darkcyan\", \"008b8b\"],\n\t[\"darkgoldenrod\", \"b8860b\"],\n\t[\"darkgray\", \"a9a9a9\"],\n\t[\"darkgrey\", \"a9a9a9\"],\n\t[\"darkgreen\", \"006400\"],\n\t[\"darkkhaki\", \"bdb76b\"],\n\t[\"darkmagenta\", \"8b008b\"],\n\t[\"darkolivegreen\", \"556b2f\"],\n\t[\"darkorange\", \"ff8c00\"],\n\t[\"darkorchid\", \"9932cc\"],\n\t[\"darkred\", \"8b0000\"],\n\t[\"darksalmon\", \"e9967a\"],\n\t[\"darkseagreen\", \"8fbc8f\"],\n\t[\"darkslateblue\", \"483d8b\"],\n\t[\"darkslategray\", \"2f4f4f\"],\n\t[\"darkslategrey\", \"2f4f4f\"],\n\t[\"darkturquoise\", \"00ced1\"],\n\t[\"darkviolet\", \"9400d3\"],\n\t[\"deeppink\", \"ff1493\"],\n\t[\"deepskyblue\", \"00bfff\"],\n\t[\"dimgray\", \"696969\"],\n\t[\"dimgrey\", \"696969\"],\n\t[\"dodgerblue\", \"1e90ff\"],\n\t[\"firebrick\", \"b22222\"],\n\t[\"floralwhite\", \"fffaf0\"],\n\t[\"forestgreen\", \"228b22\"],\n\t[\"fuchsia\", \"ff00ff\"],\n\t[\"gainsboro\", \"dcdcdc\"],\n\t[\"ghostwhite\", \"f8f8ff\"],\n\t[\"gold\", \"ffd700\"],\n\t[\"goldenrod\", \"daa520\"],\n\t[\"gray\", \"808080\"],\n\t[\"grey\", \"808080\"],\n\t[\"green\", \"008000\"],\n\t[\"greenyellow\", \"adff2f\"],\n\t[\"honeydew\", \"f0fff0\"],\n\t[\"hotpink\", \"ff69b4\"],\n\t[\"indianred\", \"cd5c5c\"],\n\t[\"indigo\", \"4b0082\"],\n\t[\"ivory\", \"fffff0\"],\n\t[\"khaki\", \"f0e68c\"],\n\t[\"lavender\", \"e6e6fa\"],\n\t[\"lavenderblush\", \"fff0f5\"],\n\t[\"lawngreen\", \"7cfc00\"],\n\t[\"lemonchiffon\", \"fffacd\"],\n\t[\"lightblue\", \"add8e6\"],\n\t[\"lightcoral\", \"f08080\"],\n\t[\"lightcyan\", \"e0ffff\"],\n\t[\"lightgoldenrodyellow\", \"fafad2\"],\n\t[\"lightgray\", \"d3d3d3\"],\n\t[\"lightgrey\", \"d3d3d3\"],\n\t[\"lightgreen\", \"90ee90\"],\n\t[\"lightpink\", \"ffb6c1\"],\n\t[\"lightsalmon\", \"ffa07a\"],\n\t[\"lightseagreen\", \"20b2aa\"],\n\t[\"lightskyblue\", \"87cefa\"],\n\t[\"lightslategray\", \"778899\"],\n\t[\"lightslategrey\", \"778899\"],\n\t[\"lightsteelblue\", \"b0c4de\"],\n\t[\"lightyellow\", \"ffffe0\"],\n\t[\"lime\", \"00ff00\"],\n\t[\"limegreen\", \"32cd32\"],\n\t[\"linen\", \"faf0e6\"],\n\t[\"magenta\", \"ff00ff\"],\n\t[\"maroon\", \"800000\"],\n\t[\"mediumaquamarine\", \"66cdaa\"],\n\t[\"mediumblue\", \"0000cd\"],\n\t[\"mediumorchid\", \"ba55d3\"],\n\t[\"mediumpurple\", \"9370db\"],\n\t[\"mediumseagreen\", \"3cb371\"],\n\t[\"mediumslateblue\", \"7b68ee\"],\n\t[\"mediumspringgreen\", \"00fa9a\"],\n\t[\"mediumturquoise\", \"48d1cc\"],\n\t[\"mediumvioletred\", \"c71585\"],\n\t[\"midnightblue\", \"191970\"],\n\t[\"mintcream\", \"f5fffa\"],\n\t[\"mistyrose\", \"ffe4e1\"],\n\t[\"moccasin\", \"ffe4b5\"],\n\t[\"navajowhite\", \"ffdead\"],\n\t[\"navy\", \"000080\"],\n\t[\"oldlace\", \"fdf5e6\"],\n\t[\"olive\", \"808000\"],\n\t[\"olivedrab\", \"6b8e23\"],\n\t[\"orange\", \"ffa500\"],\n\t[\"orangered\", \"ff4500\"],\n\t[\"orchid\", \"da70d6\"],\n\t[\"palegoldenrod\", \"eee8aa\"],\n\t[\"palegreen\", \"98fb98\"],\n\t[\"paleturquoise\", \"afeeee\"],\n\t[\"palevioletred\", \"db7093\"],\n\t[\"papayawhip\", \"ffefd5\"],\n\t[\"peachpuff\", \"ffdab9\"],\n\t[\"peru\", \"cd853f\"],\n\t[\"pink\", \"ffc0cb\"],\n\t[\"plum\", \"dda0dd\"],\n\t[\"powderblue\", \"b0e0e6\"],\n\t[\"purple\", \"800080\"],\n\t[\"red\", \"ff0000\"],\n\t[\"rosybrown\", \"bc8f8f\"],\n\t[\"royalblue\", \"4169e1\"],\n\t[\"saddlebrown\", \"8b4513\"],\n\t[\"salmon\", \"fa8072\"],\n\t[\"sandybrown\", \"f4a460\"],\n\t[\"seagreen\", \"2e8b57\"],\n\t[\"seashell\", \"fff5ee\"],\n\t[\"sienna\", \"a0522d\"],\n\t[\"silver\", \"c0c0c0\"],\n\t[\"skyblue\", \"87ceeb\"],\n\t[\"slateblue\", \"6a5acd\"],\n\t[\"slategray\", \"708090\"],\n\t[\"slategrey\", \"708090\"],\n\t[\"snow\", \"fffafa\"],\n\t[\"springgreen\", \"00ff7f\"],\n\t[\"steelblue\", \"4682b4\"],\n\t[\"tan\", \"d2b48c\"],\n\t[\"teal\", \"008080\"],\n\t[\"thistle\", \"d8bfd8\"],\n\t[\"tomato\", \"ff6347\"],\n\t[\"turquoise\", \"40e0d0\"],\n\t[\"violet\", \"ee82ee\"],\n\t[\"wheat\", \"f5deb3\"],\n\t[\"white\", \"ffffff\"],\n\t[\"whitesmoke\", \"f5f5f5\"],\n\t[\"yellow\", \"ffff00\"],\n\t[\"yellowgreen\", \"9acd32\"],\n\t[\"transparent\", \"00000000\"],\n]);\n\nconst getRGBColor = (color: string): ColorRGB => {\n\tif (color.startsWith(\"rgba\")) {\n\t\treturn RGBAToRGB(color);\n\t}\n\n\tif (color.startsWith(\"rgb\")) {\n\t\treturn RGBStringToRGBObject(color);\n\t}\n\n\t// HEX\n\tif (color.indexOf(\"#\") === 0) {\n\t\t// Shorthand Syntax\n\t\tif (color.length === 4) {\n\t\t\tcolor = `${color[1]}${color[1]}${color[2]}${color[2]}${color[3]}${color[3]}`;\n\t\t} else {\n\t\t\tcolor = color.slice(1, color.length);\n\t\t}\n\t}\n\n\t// Css Color\n\tif (CSSColors.has(color)) {\n\t\tcolor = CSSColors.get(color)!;\n\t}\n\n\treturn HEXToRGB(color);\n};\n\nconst getAlpha = (color: string): number => {\n\tlet alpha = 1;\n\n\tif (color.startsWith(\"rgba\") || color.startsWith(\"hsla\")) {\n\t\tconst parts = color.split(\",\");\n\t\tif (parts.length === 4) {\n\t\t\talpha = parseFloat(parts[3].replace(\")\", \"\").trim());\n\t\t}\n\t}\n\n\treturn alpha;\n};\n\n/**\n * Return an object with the properties for each of the main colors(red, green, blue)\n * @param {String} color Receives a color in the following format: \"rgba(0, 0, 0, 1)\n */\nconst RGBAToRGB = (color: string): ColorRGB => {\n\tconst openingBracketIndex = color.indexOf(\"(\"),\n\t\tcommasIndexes = [];\n\n\tfor (let i = 0; i < color.length; i++) {\n\t\tif (color[i] === \",\") {\n\t\t\tcommasIndexes.push(i);\n\t\t}\n\t}\n\n\treturn {\n\t\tr: parseInt(color.slice(openingBracketIndex + 1, commasIndexes[0]).trim()),\n\t\tg: parseInt(color.slice(commasIndexes[0] + 1, commasIndexes[1]).trim()),\n\t\tb: parseInt(color.slice(commasIndexes[1] + 1, commasIndexes[2]).trim()),\n\t};\n};\n\n/**\n * Return an object with the properties for each of the main colors(red, green, blue)\n * @param {String} color Receives a color in the following format: \"rgb(0, 0, 0)\n */\nconst RGBStringToRGBObject = (color: string): ColorRGB => {\n\tconst openingBracketIndex = color.indexOf(\"(\"),\n\t\tclosingBraketIndex = color.indexOf(\")\"),\n\t\tcommasIndexes = [];\n\n\tfor (let i = 0; i < color.length; i++) {\n\t\tif (color[i] === \",\") {\n\t\t\tcommasIndexes.push(i);\n\t\t}\n\t}\n\n\treturn {\n\t\tr: parseInt(color.slice(openingBracketIndex + 1, commasIndexes[0]).trim()),\n\t\tg: parseInt(color.slice(commasIndexes[0] + 1, commasIndexes[1]).trim()),\n\t\tb: parseInt(color.slice(commasIndexes[1] + 1, closingBraketIndex).trim()),\n\t};\n};\n\nconst HSLToRGB = (color: ColorHSL): ColorRGB => {\n\t// Formula taken from https://www.rapidtables.com/convert/color/hsl-to-rgb.html\n\tlet saturation = color.s * 100,\n\t\tlightness = color.l * 100,\n\t\tred,\n\t\tgreen,\n\t\tblue;\n\n\tif (saturation > 100) {\n\t\tsaturation = 1;\n\t} else if (saturation < 0) {\n\t\tsaturation = 0;\n\t} else {\n\t\tsaturation /= 100;\n\t}\n\n\tif (lightness > 100) {\n\t\tlightness = 1;\n\t} else if (lightness < 0) {\n\t\tlightness = 0;\n\t} else {\n\t\tlightness /= 100;\n\t}\n\n\tconst hue = color.h,\n\t\td = saturation * (1 - Math.abs(2 * lightness - 1)),\n\t\tm = 255 * (lightness - 0.5 * d),\n\t\tx = d * (1 - Math.abs(((hue / 60) % 2) - 1)),\n\t\ti = Math.floor(hue / 60),\n\t\tm255x = m + 255 * x,\n\t\tm255d = m + 255 * d;\n\n\tswitch (i) {\n\tcase 0:\n\t\tred = m255d;\n\t\tgreen = m255x;\n\t\tblue = m;\n\t\tbreak;\n\tcase 1:\n\t\tred = m255x;\n\t\tgreen = m255d;\n\t\tblue = m;\n\t\tbreak;\n\tcase 2:\n\t\tred = m;\n\t\tgreen = m255d;\n\t\tblue = m255x;\n\t\tbreak;\n\tcase 3:\n\t\tred = m;\n\t\tgreen = m255x;\n\t\tblue = m255d;\n\t\tbreak;\n\tcase 4:\n\t\tred = m255x;\n\t\tgreen = m;\n\t\tblue = m255d;\n\t\tbreak;\n\tcase 5:\n\t\tred = m255d;\n\t\tgreen = m;\n\t\tblue = m255x;\n\t\tbreak;\n\tdefault:\n\t\tred = 0;\n\t\tgreen = 0;\n\t\tblue = 0;\n\t\tbreak;\n\t}\n\n\treturn {\n\t\tr: Math.round(red),\n\t\tg: Math.round(green),\n\t\tb: Math.round(blue),\n\t};\n};\n\nconst HEXToRGB = (hex: string): ColorRGB => {\n\t// Please make sure you pass a valid 6 digit hex color\n\t// In the implementation of this method we assume that the hex argument is a 6 digit valid hex color\n\n\treturn {\n\t\tr: parseInt(hex.substr(0, 2), 16),\n\t\tg: parseInt(hex.substr(2, 2), 16),\n\t\tb: parseInt(hex.substr(4, 2), 16),\n\t};\n};\n\n/**\n * Returns the hex value of the color as string\n * @param {Object} color Receives an object with the properties for each of the main colors(r, g, b)\n */\nconst RGBtoHEX = (color: ColorRGB): string => {\n\tconst hexMap = [\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"A\", \"B\", \"C\", \"D\", \"E\", \"F\"];\n\tlet hexValue = \"#\";\n\n\tlet divisionNumber = color.r / 16;\n\tlet remainder = color.r % 16;\n\thexValue += String(hexMap[Math.floor(divisionNumber)]);\n\thexValue += String(hexMap[remainder]);\n\n\tdivisionNumber = color.g / 16;\n\tremainder = color.g % 16;\n\thexValue += String(hexMap[Math.floor(divisionNumber)]);\n\thexValue += String(hexMap[remainder]);\n\n\tdivisionNumber = color.b / 16;\n\tremainder = color.b % 16;\n\thexValue += String(hexMap[Math.floor(divisionNumber)]);\n\thexValue += String(hexMap[remainder]);\n\n\treturn hexValue;\n};\n\nconst RGBToHSL = (color: ColorRGB): ColorHSL => {\n\tconst R = color.r / 255,\n\t\tG = color.g / 255,\n\t\tB = color.b / 255,\n\t\tmax = Math.max(R, G, B),\n\t\tmin = Math.min(R, G, B),\n\t\tdelta = max - min;\n\n\tlet h = 0,\n\t\ts;\n\n\t// Hue calculation\n\tif (delta === 0) {\n\t\th = 0;\n\t} else if (max === R) {\n\t\th = 60 * (((G - B) / delta) % 6);\n\t} else if (max === G) {\n\t\th = 60 * (((B - R) / delta) + 2);\n\t} else if (max === B) {\n\t\th = 60 * (((R - G) / delta) + 4);\n\t}\n\n\t// Lightness calculation\n\tconst l = (max + min) / 2;\n\n\t// Saturation calculation\n\tif (delta === 0) {\n\t\ts = 0;\n\t} else {\n\t\ts = delta / (1 - Math.abs(2 * l - 1));\n\t}\n\n\treturn {\n\t\th,\n\t\ts,\n\t\tl,\n\t};\n};\n\nexport {\n\tgetRGBColor,\n\tgetAlpha,\n\tHSLToRGB,\n\tHEXToRGB,\n\tRGBToHSL,\n\tRGBStringToRGBObject,\n\tRGBtoHEX,\n};\n\nexport type {\n\tColorHSL,\n\tColorRGB,\n};\n"],
5
- "mappings": "aAoBA,MAAMA,EAAY,IAAI,IAAI,CACzB,CAAC,YAAa,QAAQ,EACtB,CAAC,eAAgB,QAAQ,EACzB,CAAC,OAAQ,QAAQ,EACjB,CAAC,aAAc,QAAQ,EACvB,CAAC,QAAS,QAAQ,EAClB,CAAC,QAAS,QAAQ,EAClB,CAAC,SAAU,QAAQ,EACnB,CAAC,QAAS,QAAQ,EAClB,CAAC,iBAAkB,QAAQ,EAC3B,CAAC,OAAQ,QAAQ,EACjB,CAAC,aAAc,QAAQ,EACvB,CAAC,QAAS,QAAQ,EAClB,CAAC,YAAa,QAAQ,EACtB,CAAC,YAAa,QAAQ,EACtB,CAAC,aAAc,QAAQ,EACvB,CAAC,YAAa,QAAQ,EACtB,CAAC,QAAS,QAAQ,EAClB,CAAC,iBAAkB,QAAQ,EAC3B,CAAC,WAAY,QAAQ,EACrB,CAAC,UAAW,QAAQ,EACpB,CAAC,OAAQ,QAAQ,EACjB,CAAC,WAAY,QAAQ,EACrB,CAAC,WAAY,QAAQ,EACrB,CAAC,gBAAiB,QAAQ,EAC1B,CAAC,WAAY,QAAQ,EACrB,CAAC,WAAY,QAAQ,EACrB,CAAC,YAAa,QAAQ,EACtB,CAAC,YAAa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A,SACAO,KAAA,SACAR,KAAA,SACA0B,KAAA,SACA3B,KAAA,qBACAsB,KAAA",
6
- "names": ["CSSColors", "getRGBColor", "color", "RGBAToRGB", "RGBStringToRGBObject", "HEXToRGB", "getAlpha", "alpha", "parts", "openingBracketIndex", "commasIndexes", "i", "closingBraketIndex", "HSLToRGB", "saturation", "lightness", "red", "green", "blue", "hue", "d", "m", "x", "m255x", "m255d", "hex", "RGBtoHEX", "hexMap", "hexValue", "divisionNumber", "remainder", "RGBToHSL", "R", "G", "B", "max", "min", "delta", "h", "s", "l"]
4
+ "sourcesContent": ["/**\n *\n * @param {String} color Color in one of the following formats: RGBA or HEX\n */\n\ntype ColorHSL = {\n\th: number,\n\ts: number,\n\tl: number,\n};\n\ntype ColorRGB = {\n\tr: number,\n\tb: number,\n\tg: number,\n};\n\n/**\n * Map of CSS colors to hex representation\n */\nconst CSSColors = new Map([\n\t[\"aliceblue\", \"f0f8ff\"],\n\t[\"antiquewhite\", \"faebd7\"],\n\t[\"aqua\", \"00ffff\"],\n\t[\"aquamarine\", \"7fffd4\"],\n\t[\"azure\", \"f0ffff\"],\n\t[\"beige\", \"f5f5dc\"],\n\t[\"bisque\", \"ffe4c4\"],\n\t[\"black\", \"000000\"],\n\t[\"blanchedalmond\", \"ffebcd\"],\n\t[\"blue\", \"0000ff\"],\n\t[\"blueviolet\", \"8a2be2\"],\n\t[\"brown\", \"a52a2a\"],\n\t[\"burlywood\", \"deb887\"],\n\t[\"cadetblue\", \"5f9ea0\"],\n\t[\"chartreuse\", \"7fff00\"],\n\t[\"chocolate\", \"d2691e\"],\n\t[\"coral\", \"ff7f50\"],\n\t[\"cornflowerblue\", \"6495ed\"],\n\t[\"cornsilk\", \"fff8dc\"],\n\t[\"crimson\", \"dc143c\"],\n\t[\"cyan\", \"00ffff\"],\n\t[\"darkblue\", \"00008b\"],\n\t[\"darkcyan\", \"008b8b\"],\n\t[\"darkgoldenrod\", \"b8860b\"],\n\t[\"darkgray\", \"a9a9a9\"],\n\t[\"darkgrey\", \"a9a9a9\"],\n\t[\"darkgreen\", \"006400\"],\n\t[\"darkkhaki\", \"bdb76b\"],\n\t[\"darkmagenta\", \"8b008b\"],\n\t[\"darkolivegreen\", \"556b2f\"],\n\t[\"darkorange\", \"ff8c00\"],\n\t[\"darkorchid\", \"9932cc\"],\n\t[\"darkred\", \"8b0000\"],\n\t[\"darksalmon\", \"e9967a\"],\n\t[\"darkseagreen\", \"8fbc8f\"],\n\t[\"darkslateblue\", \"483d8b\"],\n\t[\"darkslategray\", \"2f4f4f\"],\n\t[\"darkslategrey\", \"2f4f4f\"],\n\t[\"darkturquoise\", \"00ced1\"],\n\t[\"darkviolet\", \"9400d3\"],\n\t[\"deeppink\", \"ff1493\"],\n\t[\"deepskyblue\", \"00bfff\"],\n\t[\"dimgray\", \"696969\"],\n\t[\"dimgrey\", \"696969\"],\n\t[\"dodgerblue\", \"1e90ff\"],\n\t[\"firebrick\", \"b22222\"],\n\t[\"floralwhite\", \"fffaf0\"],\n\t[\"forestgreen\", \"228b22\"],\n\t[\"fuchsia\", \"ff00ff\"],\n\t[\"gainsboro\", \"dcdcdc\"],\n\t[\"ghostwhite\", \"f8f8ff\"],\n\t[\"gold\", \"ffd700\"],\n\t[\"goldenrod\", \"daa520\"],\n\t[\"gray\", \"808080\"],\n\t[\"grey\", \"808080\"],\n\t[\"green\", \"008000\"],\n\t[\"greenyellow\", \"adff2f\"],\n\t[\"honeydew\", \"f0fff0\"],\n\t[\"hotpink\", \"ff69b4\"],\n\t[\"indianred\", \"cd5c5c\"],\n\t[\"indigo\", \"4b0082\"],\n\t[\"ivory\", \"fffff0\"],\n\t[\"khaki\", \"f0e68c\"],\n\t[\"lavender\", \"e6e6fa\"],\n\t[\"lavenderblush\", \"fff0f5\"],\n\t[\"lawngreen\", \"7cfc00\"],\n\t[\"lemonchiffon\", \"fffacd\"],\n\t[\"lightblue\", \"add8e6\"],\n\t[\"lightcoral\", \"f08080\"],\n\t[\"lightcyan\", \"e0ffff\"],\n\t[\"lightgoldenrodyellow\", \"fafad2\"],\n\t[\"lightgray\", \"d3d3d3\"],\n\t[\"lightgrey\", \"d3d3d3\"],\n\t[\"lightgreen\", \"90ee90\"],\n\t[\"lightpink\", \"ffb6c1\"],\n\t[\"lightsalmon\", \"ffa07a\"],\n\t[\"lightseagreen\", \"20b2aa\"],\n\t[\"lightskyblue\", \"87cefa\"],\n\t[\"lightslategray\", \"778899\"],\n\t[\"lightslategrey\", \"778899\"],\n\t[\"lightsteelblue\", \"b0c4de\"],\n\t[\"lightyellow\", \"ffffe0\"],\n\t[\"lime\", \"00ff00\"],\n\t[\"limegreen\", \"32cd32\"],\n\t[\"linen\", \"faf0e6\"],\n\t[\"magenta\", \"ff00ff\"],\n\t[\"maroon\", \"800000\"],\n\t[\"mediumaquamarine\", \"66cdaa\"],\n\t[\"mediumblue\", \"0000cd\"],\n\t[\"mediumorchid\", \"ba55d3\"],\n\t[\"mediumpurple\", \"9370db\"],\n\t[\"mediumseagreen\", \"3cb371\"],\n\t[\"mediumslateblue\", \"7b68ee\"],\n\t[\"mediumspringgreen\", \"00fa9a\"],\n\t[\"mediumturquoise\", \"48d1cc\"],\n\t[\"mediumvioletred\", \"c71585\"],\n\t[\"midnightblue\", \"191970\"],\n\t[\"mintcream\", \"f5fffa\"],\n\t[\"mistyrose\", \"ffe4e1\"],\n\t[\"moccasin\", \"ffe4b5\"],\n\t[\"navajowhite\", \"ffdead\"],\n\t[\"navy\", \"000080\"],\n\t[\"oldlace\", \"fdf5e6\"],\n\t[\"olive\", \"808000\"],\n\t[\"olivedrab\", \"6b8e23\"],\n\t[\"orange\", \"ffa500\"],\n\t[\"orangered\", \"ff4500\"],\n\t[\"orchid\", \"da70d6\"],\n\t[\"palegoldenrod\", \"eee8aa\"],\n\t[\"palegreen\", \"98fb98\"],\n\t[\"paleturquoise\", \"afeeee\"],\n\t[\"palevioletred\", \"db7093\"],\n\t[\"papayawhip\", \"ffefd5\"],\n\t[\"peachpuff\", \"ffdab9\"],\n\t[\"peru\", \"cd853f\"],\n\t[\"pink\", \"ffc0cb\"],\n\t[\"plum\", \"dda0dd\"],\n\t[\"powderblue\", \"b0e0e6\"],\n\t[\"purple\", \"800080\"],\n\t[\"red\", \"ff0000\"],\n\t[\"rosybrown\", \"bc8f8f\"],\n\t[\"royalblue\", \"4169e1\"],\n\t[\"saddlebrown\", \"8b4513\"],\n\t[\"salmon\", \"fa8072\"],\n\t[\"sandybrown\", \"f4a460\"],\n\t[\"seagreen\", \"2e8b57\"],\n\t[\"seashell\", \"fff5ee\"],\n\t[\"sienna\", \"a0522d\"],\n\t[\"silver\", \"c0c0c0\"],\n\t[\"skyblue\", \"87ceeb\"],\n\t[\"slateblue\", \"6a5acd\"],\n\t[\"slategray\", \"708090\"],\n\t[\"slategrey\", \"708090\"],\n\t[\"snow\", \"fffafa\"],\n\t[\"springgreen\", \"00ff7f\"],\n\t[\"steelblue\", \"4682b4\"],\n\t[\"tan\", \"d2b48c\"],\n\t[\"teal\", \"008080\"],\n\t[\"thistle\", \"d8bfd8\"],\n\t[\"tomato\", \"ff6347\"],\n\t[\"turquoise\", \"40e0d0\"],\n\t[\"violet\", \"ee82ee\"],\n\t[\"wheat\", \"f5deb3\"],\n\t[\"white\", \"ffffff\"],\n\t[\"whitesmoke\", \"f5f5f5\"],\n\t[\"yellow\", \"ffff00\"],\n\t[\"yellowgreen\", \"9acd32\"],\n\t[\"transparent\", \"00000000\"],\n]);\n\nconst getRGBColor = (color: string): ColorRGB => {\n\tif (color.startsWith(\"rgba\")) {\n\t\treturn RGBAToRGB(color);\n\t}\n\n\tif (color.startsWith(\"rgb\")) {\n\t\treturn RGBStringToRGBObject(color);\n\t}\n\n\t// HEX\n\tif (color.indexOf(\"#\") === 0) {\n\t\t// Shorthand Syntax\n\t\tif (color.length === 4) {\n\t\t\tcolor = `${color[1]}${color[1]}${color[2]}${color[2]}${color[3]}${color[3]}`;\n\t\t} else {\n\t\t\tcolor = color.slice(1, color.length);\n\t\t}\n\t}\n\n\t// Css Color\n\tif (CSSColors.has(color)) {\n\t\tcolor = CSSColors.get(color)!;\n\t}\n\n\treturn HEXToRGB(color);\n};\n\nconst getAlpha = (color: string): number => {\n\tlet alpha = 1;\n\n\tif (color.startsWith(\"rgba\") || color.startsWith(\"hsla\")) {\n\t\tconst parts = color.split(\",\");\n\t\tif (parts.length === 4) {\n\t\t\talpha = parseFloat(parts[3].replace(\")\", \"\").trim());\n\t\t}\n\t}\n\n\treturn alpha;\n};\n\n/**\n * Return an object with the properties for each of the main colors(red, green, blue)\n * @param {String} color Receives a color in the following format: \"rgba(0, 0, 0, 1)\n */\nconst RGBAToRGB = (color: string): ColorRGB => {\n\tconst openingBracketIndex = color.indexOf(\"(\"),\n\t\tcommasIndexes = [];\n\n\tfor (let i = 0; i < color.length; i++) {\n\t\tif (color[i] === \",\") {\n\t\t\tcommasIndexes.push(i);\n\t\t}\n\t}\n\n\treturn {\n\t\tr: parseInt(color.slice(openingBracketIndex + 1, commasIndexes[0]).trim()),\n\t\tg: parseInt(color.slice(commasIndexes[0] + 1, commasIndexes[1]).trim()),\n\t\tb: parseInt(color.slice(commasIndexes[1] + 1, commasIndexes[2]).trim()),\n\t};\n};\n\n/**\n * Return an object with the properties for each of the main colors(red, green, blue)\n * @param {String} color Receives a color in the following format: \"rgb(0, 0, 0)\n */\nconst RGBStringToRGBObject = (color: string): ColorRGB => {\n\tconst openingBracketIndex = color.indexOf(\"(\"),\n\t\tclosingBraketIndex = color.indexOf(\")\"),\n\t\tcommasIndexes = [];\n\n\tfor (let i = 0; i < color.length; i++) {\n\t\tif (color[i] === \",\") {\n\t\t\tcommasIndexes.push(i);\n\t\t}\n\t}\n\n\treturn {\n\t\tr: parseInt(color.slice(openingBracketIndex + 1, commasIndexes[0]).trim()),\n\t\tg: parseInt(color.slice(commasIndexes[0] + 1, commasIndexes[1]).trim()),\n\t\tb: parseInt(color.slice(commasIndexes[1] + 1, closingBraketIndex).trim()),\n\t};\n};\n\nconst HSLToRGB = (color: ColorHSL): ColorRGB => {\n\t// Formula taken from https://www.rapidtables.com/convert/color/hsl-to-rgb.html\n\tlet saturation = color.s,\n\t\tlightness = color.l,\n\t\tred,\n\t\tgreen,\n\t\tblue;\n\n\tif (saturation > 100) {\n\t\tsaturation = 1;\n\t} else if (saturation < 0) {\n\t\tsaturation = 0;\n\t} else {\n\t\tsaturation /= 100;\n\t}\n\n\tif (lightness > 100) {\n\t\tlightness = 1;\n\t} else if (lightness < 0) {\n\t\tlightness = 0;\n\t} else {\n\t\tlightness /= 100;\n\t}\n\n\tconst hue = ((color.h % 360) + 360) % 360,\n\t\td = saturation * (1 - Math.abs(2 * lightness - 1)),\n\t\tm = 255 * (lightness - 0.5 * d),\n\t\tx = d * (1 - Math.abs(((hue / 60) % 2) - 1)),\n\t\ti = Math.floor(hue / 60),\n\t\tm255x = m + 255 * x,\n\t\tm255d = m + 255 * d;\n\n\tswitch (i) {\n\tcase 0:\n\t\tred = m255d;\n\t\tgreen = m255x;\n\t\tblue = m;\n\t\tbreak;\n\tcase 1:\n\t\tred = m255x;\n\t\tgreen = m255d;\n\t\tblue = m;\n\t\tbreak;\n\tcase 2:\n\t\tred = m;\n\t\tgreen = m255d;\n\t\tblue = m255x;\n\t\tbreak;\n\tcase 3:\n\t\tred = m;\n\t\tgreen = m255x;\n\t\tblue = m255d;\n\t\tbreak;\n\tcase 4:\n\t\tred = m255x;\n\t\tgreen = m;\n\t\tblue = m255d;\n\t\tbreak;\n\tcase 5:\n\t\tred = m255d;\n\t\tgreen = m;\n\t\tblue = m255x;\n\t\tbreak;\n\tdefault:\n\t\tred = 0;\n\t\tgreen = 0;\n\t\tblue = 0;\n\t\tbreak;\n\t}\n\n\treturn {\n\t\tr: Math.round(red),\n\t\tg: Math.round(green),\n\t\tb: Math.round(blue),\n\t};\n};\n\nconst HEXToRGB = (hex: string): ColorRGB => {\n\t// Please make sure you pass a valid 6 digit hex color\n\t// In the implementation of this method we assume that the hex argument is a 6 digit valid hex color\n\n\treturn {\n\t\tr: parseInt(hex.substr(0, 2), 16),\n\t\tg: parseInt(hex.substr(2, 2), 16),\n\t\tb: parseInt(hex.substr(4, 2), 16),\n\t};\n};\n\n/**\n * Returns the hex value of the color as string\n * @param {Object} color Receives an object with the properties for each of the main colors(r, g, b)\n */\nconst RGBtoHEX = (color: ColorRGB): string => {\n\tconst hexMap = [\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"a\", \"b\", \"c\", \"d\", \"e\", \"f\"];\n\tlet hexValue = \"\";\n\n\tlet divisionNumber = color.r / 16;\n\tlet remainder = color.r % 16;\n\thexValue += String(hexMap[Math.floor(divisionNumber)]);\n\thexValue += String(hexMap[remainder]);\n\n\tdivisionNumber = color.g / 16;\n\tremainder = color.g % 16;\n\thexValue += String(hexMap[Math.floor(divisionNumber)]);\n\thexValue += String(hexMap[remainder]);\n\n\tdivisionNumber = color.b / 16;\n\tremainder = color.b % 16;\n\thexValue += String(hexMap[Math.floor(divisionNumber)]);\n\thexValue += String(hexMap[remainder]);\n\n\treturn hexValue;\n};\n\nconst RGBToHSL = (color: ColorRGB): ColorHSL => {\n\tconst R = color.r / 255,\n\t\tG = color.g / 255,\n\t\tB = color.b / 255,\n\t\tmax = Math.max(R, G, B),\n\t\tmin = Math.min(R, G, B),\n\t\tdelta = max - min;\n\n\tlet h = (max + min) / 2;\n\tlet s = (max + min) / 2;\n\tlet l = (max + min) / 2;\n\n\tif (max === min) {\n\t\th = 0;\n\t\ts = 0;\n\t} else {\n\t\ts = l > 0.5 ? delta / (2 - max - min) : delta / (max + min);\n\n\t\tswitch (max) {\n\t\tcase R:\n\t\t\th = (G - B) / delta + (G < B ? 6 : 0);\n\t\t\tbreak;\n\t\tcase G:\n\t\t\th = (B - R) / delta + 2;\n\t\t\tbreak;\n\t\tcase B:\n\t\t\th = (R - G) / delta + 4;\n\t\t\tbreak;\n\t\t}\n\n\t\th /= 6;\n\t}\n\n\th = Math.round(h * 360);\n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KAAA,SACA1B,KAAA,qBACAqB,KAAA",
6
+ "names": ["CSSColors", "getRGBColor", "color", "RGBAToRGB", "RGBStringToRGBObject", "HEXToRGB", "getAlpha", "alpha", "parts", "openingBracketIndex", "commasIndexes", "i", "closingBraketIndex", "HSLToRGB", "saturation", "lightness", "red", "green", "blue", "hue", "m", "x", "m255x", "m255d", "hex", "RGBtoHEX", "hexMap", "hexValue", "divisionNumber", "remainder", "RGBToHSL", "R", "G", "B", "max", "min", "delta", "h", "s"]
7
7
  }
@@ -0,0 +1,2 @@
1
+ "use strict";function i(e,r){let t=!1;return(...u)=>{t||(e(...u),t=!0,setTimeout(()=>{t=!1},r))}}export default i;
2
+ //# sourceMappingURL=throttle.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/util/throttle.ts"],
4
+ "sourcesContent": ["function throttle(func: () => void, delay: number): () => void {\n\tlet wait = false;\n\n\treturn (...args) => {\n\t\tif (wait) {\n\t\t\treturn;\n\t\t}\n\n\t\tfunc(...args);\n\t\twait = true;\n\t\tsetTimeout(() => {\n\t\t\twait = false;\n\t\t}, delay);\n\t};\n}\nexport default throttle;\n"],
5
+ "mappings": "aAAA,SAASA,EAASC,EAAkBC,EAA2B,CAC9D,IAAIC,EAAO,GAEX,MAAO,IAAIC,IAAS,CACfD,IAIJF,EAAK,GAAGG,CAAI,EACZD,EAAO,GACP,WAAW,IAAM,CAChBA,EAAO,EACR,EAAGD,CAAK,EACT,CACD,CACA,eAAeF",
6
+ "names": ["throttle", "func", "delay", "wait", "args"]
7
+ }
@@ -9,4 +9,50 @@ globalThis.Node ??= NodeShim;
9
9
  class FileListShim {
10
10
  }
11
11
  globalThis.FileList ??= FileListShim;
12
+ // ------- JS DOM shims -------
13
+ // Polyfill `adoptedStyleSheets` globally for both `Document` and `ShadowRoot`
14
+ const adoptedSheetsStore = new WeakMap();
15
+ if (globalThis.Document && !("adoptedStyleSheets" in Document.prototype)) {
16
+ Object.defineProperty(Document.prototype, "adoptedStyleSheets", {
17
+ get() {
18
+ return adoptedSheetsStore.get(this) || [];
19
+ },
20
+ set(sheets) {
21
+ adoptedSheetsStore.set(this, sheets);
22
+ },
23
+ });
24
+ }
25
+ if (globalThis.ShadowRoot && !("adoptedStyleSheets" in ShadowRoot.prototype)) {
26
+ Object.defineProperty(ShadowRoot.prototype, "adoptedStyleSheets", {
27
+ get() {
28
+ return adoptedSheetsStore.get(this) || [];
29
+ },
30
+ set(sheets) {
31
+ adoptedSheetsStore.set(this, sheets);
32
+ },
33
+ });
34
+ }
35
+ // Polyfill CSSStyleSheet to provide `replaceSync`
36
+ if (globalThis.CSSStyleSheet && !("replaceSync" in CSSStyleSheet.prototype)) {
37
+ Object.defineProperty(CSSStyleSheet.prototype, "replaceSync", {
38
+ value(cssText) {
39
+ this.cssText = cssText;
40
+ return cssText;
41
+ },
42
+ });
43
+ }
44
+ // Empty resize observer
45
+ globalThis.ResizeObserver = class ResizeObserver {
46
+ observe() {
47
+ // do nothing
48
+ }
49
+ unobserve() {
50
+ // do nothing
51
+ }
52
+ disconnect() {
53
+ // do nothing
54
+ }
55
+ };
56
+ // empty showPopover method
57
+ globalThis.HTMLElement.prototype.showPopover = function () { };
12
58
  //# sourceMappingURL=ssr-dom-shim.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ssr-dom-shim.js","sourceRoot":"","sources":["../src/ssr-dom-shim.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE9E,UAAU,CAAC,WAAW,KAAK,WAAW,CAAC;AACvC,UAAU,CAAC,OAAO,KAAK,OAAO,CAAC;AAC/B,UAAU,CAAC,cAAc,KAAK,cAAc,CAAC;AAE7C,MAAM,QAAQ;CAAG;AACjB,UAAU,CAAC,IAAI,KAAK,QAAiC,CAAC;AAEtD,MAAM,YAAY;CAAG;AACrB,UAAU,CAAC,QAAQ,KAAK,YAAyC,CAAC","sourcesContent":["/* eslint-disable max-classes-per-file */\nimport { HTMLElement, Element, customElements } from \"@lit-labs/ssr-dom-shim\";\n\nglobalThis.HTMLElement ??= HTMLElement;\nglobalThis.Element ??= Element;\nglobalThis.customElements ??= customElements;\n\nclass NodeShim {}\nglobalThis.Node ??= NodeShim as object as typeof Node;\n\nclass FileListShim {}\nglobalThis.FileList ??= FileListShim as object as typeof FileList;\n"]}
1
+ {"version":3,"file":"ssr-dom-shim.js","sourceRoot":"","sources":["../src/ssr-dom-shim.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAE9E,UAAU,CAAC,WAAW,KAAK,WAAW,CAAC;AACvC,UAAU,CAAC,OAAO,KAAK,OAAO,CAAC;AAC/B,UAAU,CAAC,cAAc,KAAK,cAAc,CAAC;AAE7C,MAAM,QAAQ;CAAG;AACjB,UAAU,CAAC,IAAI,KAAK,QAAiC,CAAC;AAEtD,MAAM,YAAY;CAAG;AACrB,UAAU,CAAC,QAAQ,KAAK,YAAyC,CAAC;AAElE,+BAA+B;AAE/B,8EAA8E;AAC9E,MAAM,kBAAkB,GAAG,IAAI,OAAO,EAAE,CAAC;AAEzC,IAAI,UAAU,CAAC,QAAQ,IAAI,CAAC,CAAC,oBAAoB,IAAI,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;IACzE,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC,SAAS,EAAE,oBAAoB,EAAE;QAC9D,GAAG;YACD,OAAO,kBAAkB,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;QAC5C,CAAC;QACD,GAAG,CAAC,MAAuB;YACzB,kBAAkB,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACvC,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAED,IAAI,UAAU,CAAC,UAAU,IAAI,CAAC,CAAC,oBAAoB,IAAI,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;IAC7E,MAAM,CAAC,cAAc,CAAC,UAAU,CAAC,SAAS,EAAE,oBAAoB,EAAE;QAChE,GAAG;YACD,OAAO,kBAAkB,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;QAC5C,CAAC;QACD,GAAG,CAAC,MAAuB;YACzB,kBAAkB,CAAC,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QACvC,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAED,kDAAkD;AAClD,IAAI,UAAU,CAAC,aAAa,IAAI,CAAC,CAAC,aAAa,IAAI,aAAa,CAAC,SAAS,CAAC,EAAE,CAAC;IAC1E,MAAM,CAAC,cAAc,CAAC,aAAa,CAAC,SAAS,EAAE,aAAa,EAAE;QAC5D,KAAK,CAAC,OAAe;YACnB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;YACvB,OAAO,OAAO,CAAC;QACjB,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAEH,wBAAwB;AACxB,UAAU,CAAC,cAAc,GAAG,MAAM,cAAc;IAC5C,OAAO;QACL,aAAa;IACf,CAAC;IACD,SAAS;QACP,aAAa;IACf,CAAC;IACD,UAAU;QACR,aAAa;IACf,CAAC;CACJ,CAAC;AAEF,2BAA2B;AAC3B,UAAU,CAAC,WAAW,CAAC,SAAS,CAAC,WAAW,GAAG,cAAa,CAAC,CAAC","sourcesContent":["/* eslint-disable max-classes-per-file */\nimport { HTMLElement, Element, customElements } from \"@lit-labs/ssr-dom-shim\";\n\nglobalThis.HTMLElement ??= HTMLElement;\nglobalThis.Element ??= Element;\nglobalThis.customElements ??= customElements;\n\nclass NodeShim {}\nglobalThis.Node ??= NodeShim as object as typeof Node;\n\nclass FileListShim {}\nglobalThis.FileList ??= FileListShim as object as typeof FileList;\n\n// ------- JS DOM shims -------\n\n// Polyfill `adoptedStyleSheets` globally for both `Document` and `ShadowRoot`\nconst adoptedSheetsStore = new WeakMap();\n\nif (globalThis.Document && !(\"adoptedStyleSheets\" in Document.prototype)) {\n Object.defineProperty(Document.prototype, \"adoptedStyleSheets\", {\n get() {\n return adoptedSheetsStore.get(this) || [];\n },\n set(sheets: CSSStyleSheet[]) {\n adoptedSheetsStore.set(this, sheets);\n },\n });\n}\n\nif (globalThis.ShadowRoot && !(\"adoptedStyleSheets\" in ShadowRoot.prototype)) {\n Object.defineProperty(ShadowRoot.prototype, \"adoptedStyleSheets\", {\n get() {\n return adoptedSheetsStore.get(this) || [];\n },\n set(sheets: CSSStyleSheet[]) {\n adoptedSheetsStore.set(this, sheets);\n },\n });\n}\n\n// Polyfill CSSStyleSheet to provide `replaceSync`\nif (globalThis.CSSStyleSheet && !(\"replaceSync\" in CSSStyleSheet.prototype)) {\n Object.defineProperty(CSSStyleSheet.prototype, \"replaceSync\", {\n value(cssText: string) {\n this.cssText = cssText;\n return cssText;\n },\n });\n }\n\n// Empty resize observer\nglobalThis.ResizeObserver = class ResizeObserver {\n observe() {\n // do nothing\n }\n unobserve() {\n // do nothing\n }\n disconnect() {\n // do nothing\n }\n};\n\n// empty showPopover method\nglobalThis.HTMLElement.prototype.showPopover = function () {};\n"]}
@@ -1,2 +1 @@
1
1
  import{options as r,Fragment as e}from"./preact.module.js";export{Fragment}from"./preact.module.js";var t=/["&<]/;function n(r){if(0===r.length||!1===t.test(r))return r;for(var e=0,n=0,o="",f="";n<r.length;n++){switch(r.charCodeAt(n)){case 34:f="&quot;";break;case 38:f="&amp;";break;case 60:f="&lt;";break;default:continue}n!==e&&(o+=r.slice(e,n)),o+=f,e=n+1}return n!==e&&(o+=r.slice(e,n)),o}var o=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,f=0,i=Array.isArray;function u(e,t,n,o,i,u){t||(t={});var a,c,l=t;"ref"in t&&(a=t.ref,delete t.ref);var p={type:e,props:l,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--f,__i:-1,__u:0,__source:i,__self:u};if("function"==typeof e&&(a=e.defaultProps))for(c in a)void 0===l[c]&&(l[c]=a[c]);return r.vnode&&r.vnode(p),p}function a(r){var t=u(e,{tpl:r,exprs:[].slice.call(arguments,1)});return t.key=t.__v,t}var c={},l=/[A-Z]/g;function p(e,t){if(r.attr){var f=r.attr(e,t);if("string"==typeof f)return f}if("ref"===e||"key"===e)return"";if("style"===e&&"object"==typeof t){var i="";for(var u in t){var a=t[u];if(null!=a&&""!==a){var p="-"==u[0]?u:c[u]||(c[u]=u.replace(l,"-$&").toLowerCase()),s=";";"number"!=typeof a||p.startsWith("--")||o.test(p)||(s="px;"),i=i+p+":"+a+s}}return e+'="'+i+'"'}return null==t||!1===t||"function"==typeof t||"object"==typeof t?"":!0===t?e:e+'="'+n(t)+'"'}function s(r){if(null==r||"boolean"==typeof r||"function"==typeof r)return null;if("object"==typeof r){if(void 0===r.constructor)return r;if(i(r)){for(var e=0;e<r.length;e++)r[e]=s(r[e]);return r}}return n(""+r)}export{u as jsx,p as jsxAttr,u as jsxDEV,s as jsxEscape,a as jsxTemplate,u as jsxs};
2
- //# sourceMappingURL=jsxRuntime.module.js.map
@@ -1,2 +1 @@
1
1
  var n,l,u,t,i,o,r,e,f,c,s,a,h,p={},v=[],y=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,d=Array.isArray;function w(n,l){for(var u in l)n[u]=l[u];return n}function _(n){n&&n.parentNode&&n.parentNode.removeChild(n)}function g(l,u,t){var i,o,r,e={};for(r in u)"key"==r?i=u[r]:"ref"==r?o=u[r]:e[r]=u[r];if(arguments.length>2&&(e.children=arguments.length>3?n.call(arguments,2):t),"function"==typeof l&&null!=l.defaultProps)for(r in l.defaultProps)void 0===e[r]&&(e[r]=l.defaultProps[r]);return m(l,e,i,o,null)}function m(n,t,i,o,r){var e={type:n,props:t,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==r?++u:r,__i:-1,__u:0};return null==r&&null!=l.vnode&&l.vnode(e),e}function b(){return{current:null}}function k(n){return n.children}function x(n,l){this.props=n,this.context=l}function C(n,l){if(null==l)return n.__?C(n.__,n.__i+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__e;return"function"==typeof n.type?C(n):null}function S(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break}return S(n)}}function M(n){(!n.__d&&(n.__d=!0)&&i.push(n)&&!P.__r++||o!==l.debounceRendering)&&((o=l.debounceRendering)||r)(P)}function P(){var n,u,t,o,r,f,c,s;for(i.sort(e);n=i.shift();)n.__d&&(u=i.length,o=void 0,f=(r=(t=n).__v).__e,c=[],s=[],t.__P&&((o=w({},r)).__v=r.__v+1,l.vnode&&l.vnode(o),F(t.__P,o,r,t.__n,t.__P.namespaceURI,32&r.__u?[f]:null,c,null==f?C(r):f,!!(32&r.__u),s),o.__v=r.__v,o.__.__k[o.__i]=o,z(c,o,s),o.__e!=f&&S(o)),i.length>u&&i.sort(e));P.__r=0}function $(n,l,u,t,i,o,r,e,f,c,s){var a,h,y,d,w,_,g=t&&t.__k||v,m=l.length;for(f=I(u,l,g,f),a=0;a<m;a++)null!=(y=u.__k[a])&&(h=-1===y.__i?p:g[y.__i]||p,y.__i=a,_=F(n,y,h,i,o,r,e,f,c,s),d=y.__e,y.ref&&h.ref!=y.ref&&(h.ref&&V(h.ref,null,y),s.push(y.ref,y.__c||d,y)),null==w&&null!=d&&(w=d),4&y.__u||h.__k===y.__k?f=H(y,f,n):"function"==typeof y.type&&void 0!==_?f=_:d&&(f=d.nextSibling),y.__u&=-7);return u.__e=w,f}function I(n,l,u,t){var i,o,r,e,f,c=l.length,s=u.length,a=s,h=0;for(n.__k=[],i=0;i<c;i++)null!=(o=l[i])&&"boolean"!=typeof o&&"function"!=typeof o?(e=i+h,(o=n.__k[i]="string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?m(null,o,null,null,null):d(o)?m(k,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?m(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=n,o.__b=n.__b+1,r=null,-1!==(f=o.__i=O(o,u,e,a))&&(a--,(r=u[f])&&(r.__u|=2)),null==r||null===r.__v?(-1==f&&h--,"function"!=typeof o.type&&(o.__u|=4)):f!==e&&(f==e-1?h--:f==e+1?h++:(f>e?h--:h++,o.__u|=4))):o=n.__k[i]=null;if(a)for(i=0;i<s;i++)null!=(r=u[i])&&0==(2&r.__u)&&(r.__e==t&&(t=C(r)),q(r,r));return t}function H(n,l,u){var t,i;if("function"==typeof n.type){for(t=n.__k,i=0;t&&i<t.length;i++)t[i]&&(t[i].__=n,l=H(t[i],l,u));return l}n.__e!=l&&(l&&n.type&&!u.contains(l)&&(l=C(n)),u.insertBefore(n.__e,l||null),l=n.__e);do{l=l&&l.nextSibling}while(null!=l&&8===l.nodeType);return l}function L(n,l){return l=l||[],null==n||"boolean"==typeof n||(d(n)?n.some(function(n){L(n,l)}):l.push(n)),l}function O(n,l,u,t){var i=n.key,o=n.type,r=u-1,e=u+1,f=l[u];if(null===f||f&&i==f.key&&o===f.type&&0==(2&f.__u))return u;if(("function"!=typeof o||o===k||i)&&t>(null!=f&&0==(2&f.__u)?1:0))for(;r>=0||e<l.length;){if(r>=0){if((f=l[r])&&0==(2&f.__u)&&i==f.key&&o===f.type)return r;r--}if(e<l.length){if((f=l[e])&&0==(2&f.__u)&&i==f.key&&o===f.type)return e;e++}}return-1}function T(n,l,u){"-"===l[0]?n.setProperty(l,null==u?"":u):n[l]=null==u?"":"number"!=typeof u||y.test(l)?u:u+"px"}function j(n,l,u,t,i){var o,r;n:if("style"===l)if("string"==typeof u)n.style.cssText=u;else{if("string"==typeof t&&(n.style.cssText=t=""),t)for(l in t)u&&l in u||T(n.style,l,"");if(u)for(l in u)t&&u[l]===t[l]||T(n.style,l,u[l])}else if("o"===l[0]&&"n"===l[1])o=l!==(l=l.replace(f,"$1")),l=l.toLowerCase()in n||"onFocusOut"===l||"onFocusIn"===l?l.toLowerCase().slice(2):l.slice(2),n.l||(n.l={}),n.l[l+o]=u,u?t?u.u=t.u:(u.u=c,n.addEventListener(l,o?a:s,o)):n.removeEventListener(l,o?a:s,o);else{if("http://www.w3.org/2000/svg"==i)l=l.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=l&&"height"!=l&&"href"!=l&&"list"!=l&&"form"!=l&&"tabIndex"!=l&&"download"!=l&&"rowSpan"!=l&&"colSpan"!=l&&"role"!=l&&"popover"!=l&&l in n)try{r=n.tagName&&n.tagName.includes("-"),u!==t&&(n[l]=null!=u||r?u:"");break n}catch(n){}"function"==typeof u||(null==u||!1===u&&"-"!==l[4]?n.removeAttribute(l):n.setAttribute(l,"popover"==l&&1==u?"":u))}}function A(n){return function(u){if(this.l){var t=this.l[u.type+n];if(null==u.t)u.t=c++;else if(u.t<t.u)return;return t(l.event?l.event(u):u)}}}function F(n,u,t,i,o,r,e,f,c,s){var a,h,p,v,y,g,m,b,C,S,M,P,I,H,L,O,T,j=u.type;if(void 0!==u.constructor)return null;128&t.__u&&(c=!!(32&t.__u),r=[f=u.__e=t.__e]),(a=l.__b)&&a(u);n:if("function"==typeof j)try{if(b=u.props,C="prototype"in j&&j.prototype.render,S=(a=j.contextType)&&i[a.__c],M=a?S?S.props.value:a.__:i,t.__c?m=(h=u.__c=t.__c).__=h.__E:(C?u.__c=h=new j(b,M):(u.__c=h=new x(b,M),h.constructor=j,h.render=B),S&&S.sub(h),h.props=b,h.state||(h.state={}),h.context=M,h.__n=i,p=h.__d=!0,h.__h=[],h._sb=[]),C&&null==h.__s&&(h.__s=h.state),C&&null!=j.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=w({},h.__s)),w(h.__s,j.getDerivedStateFromProps(b,h.__s))),v=h.props,y=h.state,h.__v=u,p)C&&null==j.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),C&&null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(C&&null==j.getDerivedStateFromProps&&b!==v&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(b,M),!h.__e&&(null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(b,h.__s,M)||u.__v===t.__v)){for(u.__v!==t.__v&&(h.props=b,h.state=h.__s,h.__d=!1),u.__e=t.__e,u.__k=t.__k,u.__k.some(function(n){n&&(n.__=u)}),P=0;P<h._sb.length;P++)h.__h.push(h._sb[P]);h._sb=[],h.__h.length&&e.push(h);break n}null!=h.componentWillUpdate&&h.componentWillUpdate(b,h.__s,M),C&&null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(v,y,g)})}if(h.context=M,h.props=b,h.__P=n,h.__e=!1,I=l.__r,H=0,C){for(h.state=h.__s,h.__d=!1,I&&I(u),a=h.render(h.props,h.state,h.context),L=0;L<h._sb.length;L++)h.__h.push(h._sb[L]);h._sb=[]}else do{h.__d=!1,I&&I(u),a=h.render(h.props,h.state,h.context),h.state=h.__s}while(h.__d&&++H<25);h.state=h.__s,null!=h.getChildContext&&(i=w(w({},i),h.getChildContext())),C&&!p&&null!=h.getSnapshotBeforeUpdate&&(g=h.getSnapshotBeforeUpdate(v,y)),f=$(n,d(O=null!=a&&a.type===k&&null==a.key?a.props.children:a)?O:[O],u,t,i,o,r,e,f,c,s),h.base=u.__e,u.__u&=-161,h.__h.length&&e.push(h),m&&(h.__E=h.__=null)}catch(n){if(u.__v=null,c||null!=r)if(n.then){for(u.__u|=c?160:128;f&&8===f.nodeType&&f.nextSibling;)f=f.nextSibling;r[r.indexOf(f)]=null,u.__e=f}else for(T=r.length;T--;)_(r[T]);else u.__e=t.__e,u.__k=t.__k;l.__e(n,u,t)}else null==r&&u.__v===t.__v?(u.__k=t.__k,u.__e=t.__e):f=u.__e=N(t.__e,u,t,i,o,r,e,c,s);return(a=l.diffed)&&a(u),128&u.__u?void 0:f}function z(n,u,t){for(var i=0;i<t.length;i++)V(t[i],t[++i],t[++i]);l.__c&&l.__c(u,n),n.some(function(u){try{n=u.__h,u.__h=[],n.some(function(n){n.call(u)})}catch(n){l.__e(n,u.__v)}})}function N(u,t,i,o,r,e,f,c,s){var a,h,v,y,w,g,m,b,k=i.props,x=t.props,S=t.type;if("svg"===S?r="http://www.w3.org/2000/svg":"math"===S?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),null!=e)for(a=0;a<e.length;a++)if((w=e[a])&&"setAttribute"in w==!!S&&(S?w.localName===S:3===w.nodeType)){u=w,e[a]=null;break}if(null==u){if(null===S)return document.createTextNode(x);u=document.createElementNS(r,S,x.is&&x),c&&(l.__m&&l.__m(t,e),c=!1),e=null}if(null===S)k===x||c&&u.data===x||(u.data=x);else{if(e=e&&n.call(u.childNodes),k=i.props||p,!c&&null!=e)for(k={},a=0;a<u.attributes.length;a++)k[(w=u.attributes[a]).name]=w.value;for(a in k)if(w=k[a],"children"==a);else if("dangerouslySetInnerHTML"==a)v=w;else if(!(a in x)){if("value"==a&&"defaultValue"in x||"checked"==a&&"defaultChecked"in x)continue;j(u,a,null,w,r)}for(a in x)w=x[a],"children"==a?y=w:"dangerouslySetInnerHTML"==a?h=w:"value"==a?g=w:"checked"==a?m=w:c&&"function"!=typeof w||k[a]===w||(a.startsWith("on")&&(b=o[Object.keys(o)[0]].props.value,w=w.bind(b)),j(u,a,w,k[a],r));if(h)c||v&&(h.__html===v.__html||h.__html===u.innerHTML)||(u.innerHTML=h.__html),t.__k=[];else if(v&&(u.innerHTML=""),$(u,d(y)?y:[y],t,i,o,"foreignObject"===S?"http://www.w3.org/1999/xhtml":r,e,f,e?e[0]:i.__k&&C(i,0),c,s),null!=e)for(a=e.length;a--;)_(e[a]);c||(a="value","progress"===S&&null==g?u.removeAttribute("value"):void 0!==g&&(g!==u[a]||"progress"===S&&!g||"option"===S&&g!==k[a])&&j(u,a,g,k[a],r),a="checked",void 0!==m&&m!==u[a]&&j(u,a,m,k[a],r))}return u}function V(n,u,t){try{if("function"==typeof n){var i="function"==typeof n.__u;i&&n.__u(),i&&null==u||(n.__u=n(u))}else n.current=u}catch(n){l.__e(n,t)}}function q(n,u,t){var i,o;if(l.unmount&&l.unmount(n),(i=n.ref)&&(i.current&&i.current!==n.__e||V(i,null,u)),null!=(i=n.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(n){l.__e(n,u)}i.base=i.__P=null}if(i=n.__k)for(o=0;o<i.length;o++)i[o]&&q(i[o],u,t||"function"!=typeof n.type);t||_(n.__e),n.__c=n.__=n.__e=void 0}function B(n,l,u){return this.constructor(n,u)}function D(u,t,i){var o,r,e,f;t===document&&(t=document.documentElement),l.__&&l.__(u,t),r=(o="function"==typeof i)?null:i&&i.__k||t.__k,e=[],f=[],F(t,u=(!o&&i||t).__k=g(k,null,[u]),r||p,p,t.namespaceURI,!o&&i?[i]:r?null:t.firstChild?n.call(t.childNodes):null,e,!o&&i?i:r?r.__e:t.firstChild,o,f),z(e,u,f)}function E(n,l){D(n,l,E)}function G(l,u,t){var i,o,r,e,f=w({},l.props);for(r in l.type&&l.type.defaultProps&&(e=l.type.defaultProps),u)"key"==r?i=u[r]:"ref"==r?o=u[r]:f[r]=void 0===u[r]&&void 0!==e?e[r]:u[r];return arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):t),m(l.type,f,i||l.key,o||l.ref,null)}function J(n,l){var u={__c:l="__cC"+h++,__:n,Consumer:function(n,l){return n.children(l)},Provider:function(n){var u,t;return this.getChildContext||(u=new Set,(t={})[l]=this,this.getChildContext=function(){return t},this.componentWillUnmount=function(){u=null},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&u.forEach(function(n){n.__e=!0,M(n)})},this.sub=function(n){u.add(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){u&&u.delete(n),l&&l.call(n)}}),n.children}};return u.Provider.__=u.Consumer.contextType=u}n=v.slice,l={__e:function(n,l,u,t){for(var i,o,r;l=l.__;)if((i=l.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(n)),r=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(n,t||{}),r=i.__d),r)return i.__E=i}catch(l){n=l}throw n}},u=0,t=function(n){return null!=n&&null==n.constructor},x.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=w({},this.state),"function"==typeof n&&(n=n(w({},u),this.props)),n&&w(u,n),null!=n&&this.__v&&(l&&this._sb.push(l),M(this))},x.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),M(this))},x.prototype.render=k,i=[],r="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,e=function(n,l){return n.__v.__b-l.__v.__b},P.__r=0,f=/(PointerCapture)$|Capture$/i,c=0,s=A(!1),a=A(!0),h=0;export{x as Component,k as Fragment,G as cloneElement,J as createContext,g as createElement,b as createRef,g as h,E as hydrate,t as isValidElement,l as options,D as render,L as toChildArray};
2
- //# sourceMappingURL=preact.module.js.map
@@ -224,7 +224,7 @@ const RGBStringToRGBObject = (color) => {
224
224
  };
225
225
  const HSLToRGB = (color) => {
226
226
  // Formula taken from https://www.rapidtables.com/convert/color/hsl-to-rgb.html
227
- let saturation = color.s * 100, lightness = color.l * 100, red, green, blue;
227
+ let saturation = color.s, lightness = color.l, red, green, blue;
228
228
  if (saturation > 100) {
229
229
  saturation = 1;
230
230
  }
@@ -243,7 +243,7 @@ const HSLToRGB = (color) => {
243
243
  else {
244
244
  lightness /= 100;
245
245
  }
246
- const hue = color.h, d = saturation * (1 - Math.abs(2 * lightness - 1)), m = 255 * (lightness - 0.5 * d), x = d * (1 - Math.abs(((hue / 60) % 2) - 1)), i = Math.floor(hue / 60), m255x = m + 255 * x, m255d = m + 255 * d;
246
+ const hue = ((color.h % 360) + 360) % 360, d = saturation * (1 - Math.abs(2 * lightness - 1)), m = 255 * (lightness - 0.5 * d), x = d * (1 - Math.abs(((hue / 60) % 2) - 1)), i = Math.floor(hue / 60), m255x = m + 255 * x, m255d = m + 255 * d;
247
247
  switch (i) {
248
248
  case 0:
249
249
  red = m255d;
@@ -301,8 +301,8 @@ const HEXToRGB = (hex) => {
301
301
  * @param {Object} color Receives an object with the properties for each of the main colors(r, g, b)
302
302
  */
303
303
  const RGBtoHEX = (color) => {
304
- const hexMap = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F"];
305
- let hexValue = "#";
304
+ const hexMap = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"];
305
+ let hexValue = "";
306
306
  let divisionNumber = color.r / 16;
307
307
  let remainder = color.r % 16;
308
308
  hexValue += String(hexMap[Math.floor(divisionNumber)]);
@@ -319,29 +319,31 @@ const RGBtoHEX = (color) => {
319
319
  };
320
320
  const RGBToHSL = (color) => {
321
321
  const R = color.r / 255, G = color.g / 255, B = color.b / 255, max = Math.max(R, G, B), min = Math.min(R, G, B), delta = max - min;
322
- let h = 0, s;
323
- // Hue calculation
324
- if (delta === 0) {
322
+ let h = (max + min) / 2;
323
+ let s = (max + min) / 2;
324
+ let l = (max + min) / 2;
325
+ if (max === min) {
325
326
  h = 0;
326
- }
327
- else if (max === R) {
328
- h = 60 * (((G - B) / delta) % 6);
329
- }
330
- else if (max === G) {
331
- h = 60 * (((B - R) / delta) + 2);
332
- }
333
- else if (max === B) {
334
- h = 60 * (((R - G) / delta) + 4);
335
- }
336
- // Lightness calculation
337
- const l = (max + min) / 2;
338
- // Saturation calculation
339
- if (delta === 0) {
340
327
  s = 0;
341
328
  }
342
329
  else {
343
- s = delta / (1 - Math.abs(2 * l - 1));
330
+ s = l > 0.5 ? delta / (2 - max - min) : delta / (max + min);
331
+ switch (max) {
332
+ case R:
333
+ h = (G - B) / delta + (G < B ? 6 : 0);
334
+ break;
335
+ case G:
336
+ h = (B - R) / delta + 2;
337
+ break;
338
+ case B:
339
+ h = (R - G) / delta + 4;
340
+ break;
341
+ }
342
+ h /= 6;
344
343
  }
344
+ h = Math.round(h * 360);
345
+ s = Math.round(s * 100);
346
+ l = Math.round(l * 100);
345
347
  return {
346
348
  h,
347
349
  s,
@@ -1 +1 @@
1
- {"version":3,"file":"ColorConversion.js","sourceRoot":"","sources":["../../src/util/ColorConversion.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAcH;;GAEG;AACH,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC;IACzB,CAAC,WAAW,EAAE,QAAQ,CAAC;IACvB,CAAC,cAAc,EAAE,QAAQ,CAAC;IAC1B,CAAC,MAAM,EAAE,QAAQ,CAAC;IAClB,CAAC,YAAY,EAAE,QAAQ,CAAC;IACxB,CAAC,OAAO,EAAE,QAAQ,CAAC;IACnB,CAAC,OAAO,EAAE,QAAQ,CAAC;IACnB,CAAC,QAAQ,EAAE,QAAQ,CAAC;IACpB,CAAC,OAAO,EAAE,QAAQ,CAAC;IACnB,CAAC,gBAAgB,EAAE,QAAQ,CAAC;IAC5B,CAAC,MAAM,EAAE,QAAQ,CAAC;IAClB,CAAC,YAAY,EAAE,QAAQ,CAAC;IACxB,CAAC,OAAO,EAAE,QAAQ,CAAC;IACnB,CAAC,WAAW,EAAE,QAAQ,CAAC;IACvB,CAAC,WAAW,EAAE,QAAQ,CAAC;IACvB,CAAC,YAAY,EAAE,QAAQ,CAAC;IACxB,CAAC,WAAW,EAAE,QAAQ,CAAC;IACvB,CAAC,OAAO,EAAE,QAAQ,CAAC;IACnB,CAAC,gBAAgB,EAAE,QAAQ,CAAC;IAC5B,CAAC,UAAU,EAAE,QAAQ,CAAC;IACtB,CAAC,SAAS,EAAE,QAAQ,CAAC;IACrB,CAAC,MAAM,EAAE,QAAQ,CAAC;IAClB,CAAC,UAAU,EAAE,QAAQ,CAAC;IACtB,CAAC,UAAU,EAAE,QAAQ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CAAC,CAAC;IAEH,kBAAkB;IAClB,IAAI,KAAK,KAAK,CAAC,EAAE,CAAC;QACjB,CAAC,GAAG,CAAC,CAAC;IACP,CAAC;SAAM,IAAI,GAAG,KAAK,CAAC,EAAE,CAAC;QACtB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;IAClC,CAAC;SAAM,IAAI,GAAG,KAAK,CAAC,EAAE,CAAC;QACtB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;IAClC,CAAC;SAAM,IAAI,GAAG,KAAK,CAAC,EAAE,CAAC;QACtB,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;IAClC,CAAC;IAED,wBAAwB;IACxB,MAAM,CAAC,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;IAE1B,yBAAyB;IACzB,IAAI,KAAK,KAAK,CAAC,EAAE,CAAC;QACjB,CAAC,GAAG,CAAC,CAAC;IACP,CAAC;SAAM,CAAC;QACP,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACvC,CAAC;IAED,OAAO;QACN,CAAC;QACD,CAAC;QACD,CAAC;KACD,CAAC;AACH,CAAC,CAAC;AAEF,OAAO,EACN,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,oBAAoB,EACpB,QAAQ,GACR,CAAC","sourcesContent":["/**\n *\n * @param {String} color Color in one of the following formats: RGBA or HEX\n */\n\ntype ColorHSL = {\n\th: number,\n\ts: number,\n\tl: number,\n};\n\ntype ColorRGB = {\n\tr: number,\n\tb: number,\n\tg: number,\n};\n\n/**\n * Map of CSS colors to hex representation\n */\nconst CSSColors = new Map([\n\t[\"aliceblue\", \"f0f8ff\"],\n\t[\"antiquewhite\", \"faebd7\"],\n\t[\"aqua\", \"00ffff\"],\n\t[\"aquamarine\", \"7fffd4\"],\n\t[\"azure\", \"f0ffff\"],\n\t[\"beige\", \"f5f5dc\"],\n\t[\"bisque\", \"ffe4c4\"],\n\t[\"black\", \"000000\"],\n\t[\"blanchedalmond\", \"ffebcd\"],\n\t[\"blue\", \"0000ff\"],\n\t[\"blueviolet\", \"8a2be2\"],\n\t[\"brown\", \"a52a2a\"],\n\t[\"burlywood\", \"deb887\"],\n\t[\"cadetblue\", \"5f9ea0\"],\n\t[\"chartreuse\", \"7fff00\"],\n\t[\"chocolate\", \"d2691e\"],\n\t[\"coral\", \"ff7f50\"],\n\t[\"cornflowerblue\", \"6495ed\"],\n\t[\"cornsilk\", \"fff8dc\"],\n\t[\"crimson\", \"dc143c\"],\n\t[\"cyan\", \"00ffff\"],\n\t[\"darkblue\", \"00008b\"],\n\t[\"darkcyan\", \"008b8b\"],\n\t[\"darkgoldenrod\", \"b8860b\"],\n\t[\"darkgray\", \"a9a9a9\"],\n\t[\"darkgrey\", \"a9a9a9\"],\n\t[\"darkgreen\", \"006400\"],\n\t[\"darkkhaki\", \"bdb76b\"],\n\t[\"darkmagenta\", \"8b008b\"],\n\t[\"darkolivegreen\", \"556b2f\"],\n\t[\"darkorange\", \"ff8c00\"],\n\t[\"darkorchid\", \"9932cc\"],\n\t[\"darkred\", \"8b0000\"],\n\t[\"darksalmon\", \"e9967a\"],\n\t[\"darkseagreen\", \"8fbc8f\"],\n\t[\"darkslateblue\", \"483d8b\"],\n\t[\"darkslategray\", \"2f4f4f\"],\n\t[\"darkslategrey\", \"2f4f4f\"],\n\t[\"darkturquoise\", \"00ced1\"],\n\t[\"darkviolet\", \"9400d3\"],\n\t[\"deeppink\", \"ff1493\"],\n\t[\"deepskyblue\", \"00bfff\"],\n\t[\"dimgray\", \"696969\"],\n\t[\"dimgrey\", \"696969\"],\n\t[\"dodgerblue\", \"1e90ff\"],\n\t[\"firebrick\", \"b22222\"],\n\t[\"floralwhite\", \"fffaf0\"],\n\t[\"forestgreen\", \"228b22\"],\n\t[\"fuchsia\", \"ff00ff\"],\n\t[\"gainsboro\", \"dcdcdc\"],\n\t[\"ghostwhite\", \"f8f8ff\"],\n\t[\"gold\", \"ffd700\"],\n\t[\"goldenrod\", \"daa520\"],\n\t[\"gray\", \"808080\"],\n\t[\"grey\", \"808080\"],\n\t[\"green\", \"008000\"],\n\t[\"greenyellow\", \"adff2f\"],\n\t[\"honeydew\", \"f0fff0\"],\n\t[\"hotpink\", \"ff69b4\"],\n\t[\"indianred\", \"cd5c5c\"],\n\t[\"indigo\", \"4b0082\"],\n\t[\"ivory\", \"fffff0\"],\n\t[\"khaki\", \"f0e68c\"],\n\t[\"lavender\", \"e6e6fa\"],\n\t[\"lavenderblush\", \"fff0f5\"],\n\t[\"lawngreen\", \"7cfc00\"],\n\t[\"lemonchiffon\", \"fffacd\"],\n\t[\"lightblue\", \"add8e6\"],\n\t[\"lightcoral\", \"f08080\"],\n\t[\"lightcyan\", \"e0ffff\"],\n\t[\"lightgoldenrodyellow\", \"fafad2\"],\n\t[\"lightgray\", \"d3d3d3\"],\n\t[\"lightgrey\", \"d3d3d3\"],\n\t[\"lightgreen\", \"90ee90\"],\n\t[\"lightpink\", \"ffb6c1\"],\n\t[\"lightsalmon\", \"ffa07a\"],\n\t[\"lightseagreen\", \"20b2aa\"],\n\t[\"lightskyblue\", \"87cefa\"],\n\t[\"lightslategray\", \"778899\"],\n\t[\"lightslategrey\", \"778899\"],\n\t[\"lightsteelblue\", \"b0c4de\"],\n\t[\"lightyellow\", \"ffffe0\"],\n\t[\"lime\", \"00ff00\"],\n\t[\"limegreen\", \"32cd32\"],\n\t[\"linen\", \"faf0e6\"],\n\t[\"magenta\", \"ff00ff\"],\n\t[\"maroon\", \"800000\"],\n\t[\"mediumaquamarine\", \"66cdaa\"],\n\t[\"mediumblue\", \"0000cd\"],\n\t[\"mediumorchid\", \"ba55d3\"],\n\t[\"mediumpurple\", \"9370db\"],\n\t[\"mediumseagreen\", \"3cb371\"],\n\t[\"mediumslateblue\", \"7b68ee\"],\n\t[\"mediumspringgreen\", \"00fa9a\"],\n\t[\"mediumturquoise\", \"48d1cc\"],\n\t[\"mediumvioletred\", \"c71585\"],\n\t[\"midnightblue\", \"191970\"],\n\t[\"mintcream\", \"f5fffa\"],\n\t[\"mistyrose\", \"ffe4e1\"],\n\t[\"moccasin\", \"ffe4b5\"],\n\t[\"navajowhite\", \"ffdead\"],\n\t[\"navy\", \"000080\"],\n\t[\"oldlace\", \"fdf5e6\"],\n\t[\"olive\", \"808000\"],\n\t[\"olivedrab\", \"6b8e23\"],\n\t[\"orange\", \"ffa500\"],\n\t[\"orangered\", \"ff4500\"],\n\t[\"orchid\", \"da70d6\"],\n\t[\"palegoldenrod\", \"eee8aa\"],\n\t[\"palegreen\", \"98fb98\"],\n\t[\"paleturquoise\", \"afeeee\"],\n\t[\"palevioletred\", \"db7093\"],\n\t[\"papayawhip\", \"ffefd5\"],\n\t[\"peachpuff\", \"ffdab9\"],\n\t[\"peru\", \"cd853f\"],\n\t[\"pink\", \"ffc0cb\"],\n\t[\"plum\", \"dda0dd\"],\n\t[\"powderblue\", \"b0e0e6\"],\n\t[\"purple\", \"800080\"],\n\t[\"red\", \"ff0000\"],\n\t[\"rosybrown\", \"bc8f8f\"],\n\t[\"royalblue\", \"4169e1\"],\n\t[\"saddlebrown\", \"8b4513\"],\n\t[\"salmon\", \"fa8072\"],\n\t[\"sandybrown\", \"f4a460\"],\n\t[\"seagreen\", \"2e8b57\"],\n\t[\"seashell\", \"fff5ee\"],\n\t[\"sienna\", \"a0522d\"],\n\t[\"silver\", \"c0c0c0\"],\n\t[\"skyblue\", \"87ceeb\"],\n\t[\"slateblue\", \"6a5acd\"],\n\t[\"slategray\", \"708090\"],\n\t[\"slategrey\", \"708090\"],\n\t[\"snow\", \"fffafa\"],\n\t[\"springgreen\", \"00ff7f\"],\n\t[\"steelblue\", \"4682b4\"],\n\t[\"tan\", \"d2b48c\"],\n\t[\"teal\", \"008080\"],\n\t[\"thistle\", \"d8bfd8\"],\n\t[\"tomato\", \"ff6347\"],\n\t[\"turquoise\", \"40e0d0\"],\n\t[\"violet\", \"ee82ee\"],\n\t[\"wheat\", \"f5deb3\"],\n\t[\"white\", \"ffffff\"],\n\t[\"whitesmoke\", \"f5f5f5\"],\n\t[\"yellow\", \"ffff00\"],\n\t[\"yellowgreen\", \"9acd32\"],\n\t[\"transparent\", \"00000000\"],\n]);\n\nconst getRGBColor = (color: string): ColorRGB => {\n\tif (color.startsWith(\"rgba\")) {\n\t\treturn RGBAToRGB(color);\n\t}\n\n\tif (color.startsWith(\"rgb\")) {\n\t\treturn RGBStringToRGBObject(color);\n\t}\n\n\t// HEX\n\tif (color.indexOf(\"#\") === 0) {\n\t\t// Shorthand Syntax\n\t\tif (color.length === 4) {\n\t\t\tcolor = `${color[1]}${color[1]}${color[2]}${color[2]}${color[3]}${color[3]}`;\n\t\t} else {\n\t\t\tcolor = color.slice(1, color.length);\n\t\t}\n\t}\n\n\t// Css Color\n\tif (CSSColors.has(color)) {\n\t\tcolor = CSSColors.get(color)!;\n\t}\n\n\treturn HEXToRGB(color);\n};\n\nconst getAlpha = (color: string): number => {\n\tlet alpha = 1;\n\n\tif (color.startsWith(\"rgba\") || color.startsWith(\"hsla\")) {\n\t\tconst parts = color.split(\",\");\n\t\tif (parts.length === 4) {\n\t\t\talpha = parseFloat(parts[3].replace(\")\", \"\").trim());\n\t\t}\n\t}\n\n\treturn alpha;\n};\n\n/**\n * Return an object with the properties for each of the main colors(red, green, blue)\n * @param {String} color Receives a color in the following format: \"rgba(0, 0, 0, 1)\n */\nconst RGBAToRGB = (color: string): ColorRGB => {\n\tconst openingBracketIndex = color.indexOf(\"(\"),\n\t\tcommasIndexes = [];\n\n\tfor (let i = 0; i < color.length; i++) {\n\t\tif (color[i] === \",\") {\n\t\t\tcommasIndexes.push(i);\n\t\t}\n\t}\n\n\treturn {\n\t\tr: parseInt(color.slice(openingBracketIndex + 1, commasIndexes[0]).trim()),\n\t\tg: parseInt(color.slice(commasIndexes[0] + 1, commasIndexes[1]).trim()),\n\t\tb: parseInt(color.slice(commasIndexes[1] + 1, commasIndexes[2]).trim()),\n\t};\n};\n\n/**\n * Return an object with the properties for each of the main colors(red, green, blue)\n * @param {String} color Receives a color in the following format: \"rgb(0, 0, 0)\n */\nconst RGBStringToRGBObject = (color: string): ColorRGB => {\n\tconst openingBracketIndex = color.indexOf(\"(\"),\n\t\tclosingBraketIndex = color.indexOf(\")\"),\n\t\tcommasIndexes = [];\n\n\tfor (let i = 0; i < color.length; i++) {\n\t\tif (color[i] === \",\") {\n\t\t\tcommasIndexes.push(i);\n\t\t}\n\t}\n\n\treturn {\n\t\tr: parseInt(color.slice(openingBracketIndex + 1, commasIndexes[0]).trim()),\n\t\tg: parseInt(color.slice(commasIndexes[0] + 1, commasIndexes[1]).trim()),\n\t\tb: parseInt(color.slice(commasIndexes[1] + 1, closingBraketIndex).trim()),\n\t};\n};\n\nconst HSLToRGB = (color: ColorHSL): ColorRGB => {\n\t// Formula taken from https://www.rapidtables.com/convert/color/hsl-to-rgb.html\n\tlet saturation = color.s * 100,\n\t\tlightness = color.l * 100,\n\t\tred,\n\t\tgreen,\n\t\tblue;\n\n\tif (saturation > 100) {\n\t\tsaturation = 1;\n\t} else if (saturation < 0) {\n\t\tsaturation = 0;\n\t} else {\n\t\tsaturation /= 100;\n\t}\n\n\tif (lightness > 100) {\n\t\tlightness = 1;\n\t} else if (lightness < 0) {\n\t\tlightness = 0;\n\t} else {\n\t\tlightness /= 100;\n\t}\n\n\tconst hue = color.h,\n\t\td = saturation * (1 - Math.abs(2 * lightness - 1)),\n\t\tm = 255 * (lightness - 0.5 * d),\n\t\tx = d * (1 - Math.abs(((hue / 60) % 2) - 1)),\n\t\ti = Math.floor(hue / 60),\n\t\tm255x = m + 255 * x,\n\t\tm255d = m + 255 * d;\n\n\tswitch (i) {\n\tcase 0:\n\t\tred = m255d;\n\t\tgreen = m255x;\n\t\tblue = m;\n\t\tbreak;\n\tcase 1:\n\t\tred = m255x;\n\t\tgreen = m255d;\n\t\tblue = m;\n\t\tbreak;\n\tcase 2:\n\t\tred = m;\n\t\tgreen = m255d;\n\t\tblue = m255x;\n\t\tbreak;\n\tcase 3:\n\t\tred = m;\n\t\tgreen = m255x;\n\t\tblue = m255d;\n\t\tbreak;\n\tcase 4:\n\t\tred = m255x;\n\t\tgreen = m;\n\t\tblue = m255d;\n\t\tbreak;\n\tcase 5:\n\t\tred = m255d;\n\t\tgreen = m;\n\t\tblue = m255x;\n\t\tbreak;\n\tdefault:\n\t\tred = 0;\n\t\tgreen = 0;\n\t\tblue = 0;\n\t\tbreak;\n\t}\n\n\treturn {\n\t\tr: Math.round(red),\n\t\tg: Math.round(green),\n\t\tb: Math.round(blue),\n\t};\n};\n\nconst HEXToRGB = (hex: string): ColorRGB => {\n\t// Please make sure you pass a valid 6 digit hex color\n\t// In the implementation of this method we assume that the hex argument is a 6 digit valid hex color\n\n\treturn {\n\t\tr: parseInt(hex.substr(0, 2), 16),\n\t\tg: parseInt(hex.substr(2, 2), 16),\n\t\tb: parseInt(hex.substr(4, 2), 16),\n\t};\n};\n\n/**\n * Returns the hex value of the color as string\n * @param {Object} color Receives an object with the properties for each of the main colors(r, g, b)\n */\nconst RGBtoHEX = (color: ColorRGB): string => {\n\tconst hexMap = [\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"A\", \"B\", \"C\", \"D\", \"E\", \"F\"];\n\tlet hexValue = \"#\";\n\n\tlet divisionNumber = color.r / 16;\n\tlet remainder = color.r % 16;\n\thexValue += String(hexMap[Math.floor(divisionNumber)]);\n\thexValue += String(hexMap[remainder]);\n\n\tdivisionNumber = color.g / 16;\n\tremainder = color.g % 16;\n\thexValue += String(hexMap[Math.floor(divisionNumber)]);\n\thexValue += String(hexMap[remainder]);\n\n\tdivisionNumber = color.b / 16;\n\tremainder = color.b % 16;\n\thexValue += String(hexMap[Math.floor(divisionNumber)]);\n\thexValue += String(hexMap[remainder]);\n\n\treturn hexValue;\n};\n\nconst RGBToHSL = (color: ColorRGB): ColorHSL => {\n\tconst R = color.r / 255,\n\t\tG = color.g / 255,\n\t\tB = color.b / 255,\n\t\tmax = Math.max(R, G, B),\n\t\tmin = Math.min(R, G, B),\n\t\tdelta = max - min;\n\n\tlet h = 0,\n\t\ts;\n\n\t// Hue calculation\n\tif (delta === 0) {\n\t\th = 0;\n\t} else if (max === R) {\n\t\th = 60 * (((G - B) / delta) % 6);\n\t} else if (max === G) {\n\t\th = 60 * (((B - R) / delta) + 2);\n\t} else if (max === B) {\n\t\th = 60 * (((R - G) / delta) + 4);\n\t}\n\n\t// Lightness calculation\n\tconst l = (max + min) / 2;\n\n\t// Saturation calculation\n\tif (delta === 0) {\n\t\ts = 0;\n\t} else {\n\t\ts = delta / (1 - Math.abs(2 * l - 1));\n\t}\n\n\treturn {\n\t\th,\n\t\ts,\n\t\tl,\n\t};\n};\n\nexport {\n\tgetRGBColor,\n\tgetAlpha,\n\tHSLToRGB,\n\tHEXToRGB,\n\tRGBToHSL,\n\tRGBStringToRGBObject,\n\tRGBtoHEX,\n};\n\nexport type {\n\tColorHSL,\n\tColorRGB,\n};\n"]}
1
+ {"version":3,"file":"ColorConversion.js","sourceRoot":"","sources":["../../src/util/ColorConversion.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAcH;;GAEG;AACH,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC;IACzB,CAAC,WAAW,EAAE,QAAQ,CAAC;IACvB,CAAC,cAAc,EAAE,QAAQ,CAAC;IAC1B,CAAC,MAAM,EAAE,QAAQ,CAAC;IAClB,CAAC,YAAY,EAAE,QAAQ,CAAC;IACxB,CAAC,OAAO,EA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;YACd,KAAK,CAAC;gBACL,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;gBACtC,MAAM;YACP,KAAK,CAAC;gBACL,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC;gBACxB,MAAM;YACP,KAAK,CAAC;gBACL,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,GAAG,CAAC,CAAC;gBACxB,MAAM;QACP,CAAC;QAED,CAAC,IAAI,CAAC,CAAC;IACR,CAAC;IAED,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC;IACxB,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC;IACxB,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC;IAExB,OAAO;QACN,CAAC;QACD,CAAC;QACD,CAAC;KACD,CAAC;AACH,CAAC,CAAC;AAEF,OAAO,EACN,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,oBAAoB,EACpB,QAAQ,GACR,CAAC","sourcesContent":["/**\n *\n * @param {String} color Color in one of the following formats: RGBA or HEX\n */\n\ntype ColorHSL = {\n\th: number,\n\ts: number,\n\tl: number,\n};\n\ntype ColorRGB = {\n\tr: number,\n\tb: number,\n\tg: number,\n};\n\n/**\n * Map of CSS colors to hex representation\n */\nconst CSSColors = new Map([\n\t[\"aliceblue\", \"f0f8ff\"],\n\t[\"antiquewhite\", \"faebd7\"],\n\t[\"aqua\", \"00ffff\"],\n\t[\"aquamarine\", \"7fffd4\"],\n\t[\"azure\", \"f0ffff\"],\n\t[\"beige\", \"f5f5dc\"],\n\t[\"bisque\", \"ffe4c4\"],\n\t[\"black\", \"000000\"],\n\t[\"blanchedalmond\", \"ffebcd\"],\n\t[\"blue\", \"0000ff\"],\n\t[\"blueviolet\", \"8a2be2\"],\n\t[\"brown\", \"a52a2a\"],\n\t[\"burlywood\", \"deb887\"],\n\t[\"cadetblue\", \"5f9ea0\"],\n\t[\"chartreuse\", \"7fff00\"],\n\t[\"chocolate\", \"d2691e\"],\n\t[\"coral\", \"ff7f50\"],\n\t[\"cornflowerblue\", \"6495ed\"],\n\t[\"cornsilk\", \"fff8dc\"],\n\t[\"crimson\", \"dc143c\"],\n\t[\"cyan\", \"00ffff\"],\n\t[\"darkblue\", \"00008b\"],\n\t[\"darkcyan\", \"008b8b\"],\n\t[\"darkgoldenrod\", \"b8860b\"],\n\t[\"darkgray\", \"a9a9a9\"],\n\t[\"darkgrey\", \"a9a9a9\"],\n\t[\"darkgreen\", \"006400\"],\n\t[\"darkkhaki\", \"bdb76b\"],\n\t[\"darkmagenta\", \"8b008b\"],\n\t[\"darkolivegreen\", \"556b2f\"],\n\t[\"darkorange\", \"ff8c00\"],\n\t[\"darkorchid\", \"9932cc\"],\n\t[\"darkred\", \"8b0000\"],\n\t[\"darksalmon\", \"e9967a\"],\n\t[\"darkseagreen\", \"8fbc8f\"],\n\t[\"darkslateblue\", \"483d8b\"],\n\t[\"darkslategray\", \"2f4f4f\"],\n\t[\"darkslategrey\", \"2f4f4f\"],\n\t[\"darkturquoise\", \"00ced1\"],\n\t[\"darkviolet\", \"9400d3\"],\n\t[\"deeppink\", \"ff1493\"],\n\t[\"deepskyblue\", \"00bfff\"],\n\t[\"dimgray\", \"696969\"],\n\t[\"dimgrey\", \"696969\"],\n\t[\"dodgerblue\", \"1e90ff\"],\n\t[\"firebrick\", \"b22222\"],\n\t[\"floralwhite\", \"fffaf0\"],\n\t[\"forestgreen\", \"228b22\"],\n\t[\"fuchsia\", \"ff00ff\"],\n\t[\"gainsboro\", \"dcdcdc\"],\n\t[\"ghostwhite\", \"f8f8ff\"],\n\t[\"gold\", \"ffd700\"],\n\t[\"goldenrod\", \"daa520\"],\n\t[\"gray\", \"808080\"],\n\t[\"grey\", \"808080\"],\n\t[\"green\", \"008000\"],\n\t[\"greenyellow\", \"adff2f\"],\n\t[\"honeydew\", \"f0fff0\"],\n\t[\"hotpink\", \"ff69b4\"],\n\t[\"indianred\", \"cd5c5c\"],\n\t[\"indigo\", \"4b0082\"],\n\t[\"ivory\", \"fffff0\"],\n\t[\"khaki\", \"f0e68c\"],\n\t[\"lavender\", \"e6e6fa\"],\n\t[\"lavenderblush\", \"fff0f5\"],\n\t[\"lawngreen\", \"7cfc00\"],\n\t[\"lemonchiffon\", \"fffacd\"],\n\t[\"lightblue\", \"add8e6\"],\n\t[\"lightcoral\", \"f08080\"],\n\t[\"lightcyan\", \"e0ffff\"],\n\t[\"lightgoldenrodyellow\", \"fafad2\"],\n\t[\"lightgray\", \"d3d3d3\"],\n\t[\"lightgrey\", \"d3d3d3\"],\n\t[\"lightgreen\", \"90ee90\"],\n\t[\"lightpink\", \"ffb6c1\"],\n\t[\"lightsalmon\", \"ffa07a\"],\n\t[\"lightseagreen\", \"20b2aa\"],\n\t[\"lightskyblue\", \"87cefa\"],\n\t[\"lightslategray\", \"778899\"],\n\t[\"lightslategrey\", \"778899\"],\n\t[\"lightsteelblue\", \"b0c4de\"],\n\t[\"lightyellow\", \"ffffe0\"],\n\t[\"lime\", \"00ff00\"],\n\t[\"limegreen\", \"32cd32\"],\n\t[\"linen\", \"faf0e6\"],\n\t[\"magenta\", \"ff00ff\"],\n\t[\"maroon\", \"800000\"],\n\t[\"mediumaquamarine\", \"66cdaa\"],\n\t[\"mediumblue\", \"0000cd\"],\n\t[\"mediumorchid\", \"ba55d3\"],\n\t[\"mediumpurple\", \"9370db\"],\n\t[\"mediumseagreen\", \"3cb371\"],\n\t[\"mediumslateblue\", \"7b68ee\"],\n\t[\"mediumspringgreen\", \"00fa9a\"],\n\t[\"mediumturquoise\", \"48d1cc\"],\n\t[\"mediumvioletred\", \"c71585\"],\n\t[\"midnightblue\", \"191970\"],\n\t[\"mintcream\", \"f5fffa\"],\n\t[\"mistyrose\", \"ffe4e1\"],\n\t[\"moccasin\", \"ffe4b5\"],\n\t[\"navajowhite\", \"ffdead\"],\n\t[\"navy\", \"000080\"],\n\t[\"oldlace\", \"fdf5e6\"],\n\t[\"olive\", \"808000\"],\n\t[\"olivedrab\", \"6b8e23\"],\n\t[\"orange\", \"ffa500\"],\n\t[\"orangered\", \"ff4500\"],\n\t[\"orchid\", \"da70d6\"],\n\t[\"palegoldenrod\", \"eee8aa\"],\n\t[\"palegreen\", \"98fb98\"],\n\t[\"paleturquoise\", \"afeeee\"],\n\t[\"palevioletred\", \"db7093\"],\n\t[\"papayawhip\", \"ffefd5\"],\n\t[\"peachpuff\", \"ffdab9\"],\n\t[\"peru\", \"cd853f\"],\n\t[\"pink\", \"ffc0cb\"],\n\t[\"plum\", \"dda0dd\"],\n\t[\"powderblue\", \"b0e0e6\"],\n\t[\"purple\", \"800080\"],\n\t[\"red\", \"ff0000\"],\n\t[\"rosybrown\", \"bc8f8f\"],\n\t[\"royalblue\", \"4169e1\"],\n\t[\"saddlebrown\", \"8b4513\"],\n\t[\"salmon\", \"fa8072\"],\n\t[\"sandybrown\", \"f4a460\"],\n\t[\"seagreen\", \"2e8b57\"],\n\t[\"seashell\", \"fff5ee\"],\n\t[\"sienna\", \"a0522d\"],\n\t[\"silver\", \"c0c0c0\"],\n\t[\"skyblue\", \"87ceeb\"],\n\t[\"slateblue\", \"6a5acd\"],\n\t[\"slategray\", \"708090\"],\n\t[\"slategrey\", \"708090\"],\n\t[\"snow\", \"fffafa\"],\n\t[\"springgreen\", \"00ff7f\"],\n\t[\"steelblue\", \"4682b4\"],\n\t[\"tan\", \"d2b48c\"],\n\t[\"teal\", \"008080\"],\n\t[\"thistle\", \"d8bfd8\"],\n\t[\"tomato\", \"ff6347\"],\n\t[\"turquoise\", \"40e0d0\"],\n\t[\"violet\", \"ee82ee\"],\n\t[\"wheat\", \"f5deb3\"],\n\t[\"white\", \"ffffff\"],\n\t[\"whitesmoke\", \"f5f5f5\"],\n\t[\"yellow\", \"ffff00\"],\n\t[\"yellowgreen\", \"9acd32\"],\n\t[\"transparent\", \"00000000\"],\n]);\n\nconst getRGBColor = (color: string): ColorRGB => {\n\tif (color.startsWith(\"rgba\")) {\n\t\treturn RGBAToRGB(color);\n\t}\n\n\tif (color.startsWith(\"rgb\")) {\n\t\treturn RGBStringToRGBObject(color);\n\t}\n\n\t// HEX\n\tif (color.indexOf(\"#\") === 0) {\n\t\t// Shorthand Syntax\n\t\tif (color.length === 4) {\n\t\t\tcolor = `${color[1]}${color[1]}${color[2]}${color[2]}${color[3]}${color[3]}`;\n\t\t} else {\n\t\t\tcolor = color.slice(1, color.length);\n\t\t}\n\t}\n\n\t// Css Color\n\tif (CSSColors.has(color)) {\n\t\tcolor = CSSColors.get(color)!;\n\t}\n\n\treturn HEXToRGB(color);\n};\n\nconst getAlpha = (color: string): number => {\n\tlet alpha = 1;\n\n\tif (color.startsWith(\"rgba\") || color.startsWith(\"hsla\")) {\n\t\tconst parts = color.split(\",\");\n\t\tif (parts.length === 4) {\n\t\t\talpha = parseFloat(parts[3].replace(\")\", \"\").trim());\n\t\t}\n\t}\n\n\treturn alpha;\n};\n\n/**\n * Return an object with the properties for each of the main colors(red, green, blue)\n * @param {String} color Receives a color in the following format: \"rgba(0, 0, 0, 1)\n */\nconst RGBAToRGB = (color: string): ColorRGB => {\n\tconst openingBracketIndex = color.indexOf(\"(\"),\n\t\tcommasIndexes = [];\n\n\tfor (let i = 0; i < color.length; i++) {\n\t\tif (color[i] === \",\") {\n\t\t\tcommasIndexes.push(i);\n\t\t}\n\t}\n\n\treturn {\n\t\tr: parseInt(color.slice(openingBracketIndex + 1, commasIndexes[0]).trim()),\n\t\tg: parseInt(color.slice(commasIndexes[0] + 1, commasIndexes[1]).trim()),\n\t\tb: parseInt(color.slice(commasIndexes[1] + 1, commasIndexes[2]).trim()),\n\t};\n};\n\n/**\n * Return an object with the properties for each of the main colors(red, green, blue)\n * @param {String} color Receives a color in the following format: \"rgb(0, 0, 0)\n */\nconst RGBStringToRGBObject = (color: string): ColorRGB => {\n\tconst openingBracketIndex = color.indexOf(\"(\"),\n\t\tclosingBraketIndex = color.indexOf(\")\"),\n\t\tcommasIndexes = [];\n\n\tfor (let i = 0; i < color.length; i++) {\n\t\tif (color[i] === \",\") {\n\t\t\tcommasIndexes.push(i);\n\t\t}\n\t}\n\n\treturn {\n\t\tr: parseInt(color.slice(openingBracketIndex + 1, commasIndexes[0]).trim()),\n\t\tg: parseInt(color.slice(commasIndexes[0] + 1, commasIndexes[1]).trim()),\n\t\tb: parseInt(color.slice(commasIndexes[1] + 1, closingBraketIndex).trim()),\n\t};\n};\n\nconst HSLToRGB = (color: ColorHSL): ColorRGB => {\n\t// Formula taken from https://www.rapidtables.com/convert/color/hsl-to-rgb.html\n\tlet saturation = color.s,\n\t\tlightness = color.l,\n\t\tred,\n\t\tgreen,\n\t\tblue;\n\n\tif (saturation > 100) {\n\t\tsaturation = 1;\n\t} else if (saturation < 0) {\n\t\tsaturation = 0;\n\t} else {\n\t\tsaturation /= 100;\n\t}\n\n\tif (lightness > 100) {\n\t\tlightness = 1;\n\t} else if (lightness < 0) {\n\t\tlightness = 0;\n\t} else {\n\t\tlightness /= 100;\n\t}\n\n\tconst hue = ((color.h % 360) + 360) % 360,\n\t\td = saturation * (1 - Math.abs(2 * lightness - 1)),\n\t\tm = 255 * (lightness - 0.5 * d),\n\t\tx = d * (1 - Math.abs(((hue / 60) % 2) - 1)),\n\t\ti = Math.floor(hue / 60),\n\t\tm255x = m + 255 * x,\n\t\tm255d = m + 255 * d;\n\n\tswitch (i) {\n\tcase 0:\n\t\tred = m255d;\n\t\tgreen = m255x;\n\t\tblue = m;\n\t\tbreak;\n\tcase 1:\n\t\tred = m255x;\n\t\tgreen = m255d;\n\t\tblue = m;\n\t\tbreak;\n\tcase 2:\n\t\tred = m;\n\t\tgreen = m255d;\n\t\tblue = m255x;\n\t\tbreak;\n\tcase 3:\n\t\tred = m;\n\t\tgreen = m255x;\n\t\tblue = m255d;\n\t\tbreak;\n\tcase 4:\n\t\tred = m255x;\n\t\tgreen = m;\n\t\tblue = m255d;\n\t\tbreak;\n\tcase 5:\n\t\tred = m255d;\n\t\tgreen = m;\n\t\tblue = m255x;\n\t\tbreak;\n\tdefault:\n\t\tred = 0;\n\t\tgreen = 0;\n\t\tblue = 0;\n\t\tbreak;\n\t}\n\n\treturn {\n\t\tr: Math.round(red),\n\t\tg: Math.round(green),\n\t\tb: Math.round(blue),\n\t};\n};\n\nconst HEXToRGB = (hex: string): ColorRGB => {\n\t// Please make sure you pass a valid 6 digit hex color\n\t// In the implementation of this method we assume that the hex argument is a 6 digit valid hex color\n\n\treturn {\n\t\tr: parseInt(hex.substr(0, 2), 16),\n\t\tg: parseInt(hex.substr(2, 2), 16),\n\t\tb: parseInt(hex.substr(4, 2), 16),\n\t};\n};\n\n/**\n * Returns the hex value of the color as string\n * @param {Object} color Receives an object with the properties for each of the main colors(r, g, b)\n */\nconst RGBtoHEX = (color: ColorRGB): string => {\n\tconst hexMap = [\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"a\", \"b\", \"c\", \"d\", \"e\", \"f\"];\n\tlet hexValue = \"\";\n\n\tlet divisionNumber = color.r / 16;\n\tlet remainder = color.r % 16;\n\thexValue += String(hexMap[Math.floor(divisionNumber)]);\n\thexValue += String(hexMap[remainder]);\n\n\tdivisionNumber = color.g / 16;\n\tremainder = color.g % 16;\n\thexValue += String(hexMap[Math.floor(divisionNumber)]);\n\thexValue += String(hexMap[remainder]);\n\n\tdivisionNumber = color.b / 16;\n\tremainder = color.b % 16;\n\thexValue += String(hexMap[Math.floor(divisionNumber)]);\n\thexValue += String(hexMap[remainder]);\n\n\treturn hexValue;\n};\n\nconst RGBToHSL = (color: ColorRGB): ColorHSL => {\n\tconst R = color.r / 255,\n\t\tG = color.g / 255,\n\t\tB = color.b / 255,\n\t\tmax = Math.max(R, G, B),\n\t\tmin = Math.min(R, G, B),\n\t\tdelta = max - min;\n\n\tlet h = (max + min) / 2;\n\tlet s = (max + min) / 2;\n\tlet l = (max + min) / 2;\n\n\tif (max === min) {\n\t\th = 0;\n\t\ts = 0;\n\t} else {\n\t\ts = l > 0.5 ? delta / (2 - max - min) : delta / (max + min);\n\n\t\tswitch (max) {\n\t\tcase R:\n\t\t\th = (G - B) / delta + (G < B ? 6 : 0);\n\t\t\tbreak;\n\t\tcase G:\n\t\t\th = (B - R) / delta + 2;\n\t\t\tbreak;\n\t\tcase B:\n\t\t\th = (R - G) / delta + 4;\n\t\t\tbreak;\n\t\t}\n\n\t\th /= 6;\n\t}\n\n\th = Math.round(h * 360);\n\ts = Math.round(s * 100);\n\tl = Math.round(l * 100);\n\n\treturn {\n\t\th,\n\t\ts,\n\t\tl,\n\t};\n};\n\nexport {\n\tgetRGBColor,\n\tgetAlpha,\n\tHSLToRGB,\n\tHEXToRGB,\n\tRGBToHSL,\n\tRGBStringToRGBObject,\n\tRGBtoHEX,\n};\n\nexport type {\n\tColorHSL,\n\tColorRGB,\n};\n"]}
@@ -0,0 +1,2 @@
1
+ declare function throttle(func: () => void, delay: number): () => void;
2
+ export default throttle;
@@ -0,0 +1,15 @@
1
+ function throttle(func, delay) {
2
+ let wait = false;
3
+ return (...args) => {
4
+ if (wait) {
5
+ return;
6
+ }
7
+ func(...args);
8
+ wait = true;
9
+ setTimeout(() => {
10
+ wait = false;
11
+ }, delay);
12
+ };
13
+ }
14
+ export default throttle;
15
+ //# sourceMappingURL=throttle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"throttle.js","sourceRoot":"","sources":["../../src/util/throttle.ts"],"names":[],"mappings":"AAAA,SAAS,QAAQ,CAAC,IAAgB,EAAE,KAAa;IAChD,IAAI,IAAI,GAAG,KAAK,CAAC;IAEjB,OAAO,CAAC,GAAG,IAAI,EAAE,EAAE;QAClB,IAAI,IAAI,EAAE,CAAC;YACV,OAAO;QACR,CAAC;QAED,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC;QACd,IAAI,GAAG,IAAI,CAAC;QACZ,UAAU,CAAC,GAAG,EAAE;YACf,IAAI,GAAG,KAAK,CAAC;QACd,CAAC,EAAE,KAAK,CAAC,CAAC;IACX,CAAC,CAAC;AACH,CAAC;AACD,eAAe,QAAQ,CAAC","sourcesContent":["function throttle(func: () => void, delay: number): () => void {\n\tlet wait = false;\n\n\treturn (...args) => {\n\t\tif (wait) {\n\t\t\treturn;\n\t\t}\n\n\t\tfunc(...args);\n\t\twait = true;\n\t\tsetTimeout(() => {\n\t\t\twait = false;\n\t\t}, delay);\n\t};\n}\nexport default throttle;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ui5/webcomponents-base",
3
- "version": "2.7.0-rc.0",
3
+ "version": "2.7.0-rc.1",
4
4
  "description": "UI5 Web Components: webcomponents.base",
5
5
  "author": "SAP SE (https://www.sap.com)",
6
6
  "license": "Apache-2.0",
@@ -57,7 +57,7 @@
57
57
  },
58
58
  "devDependencies": {
59
59
  "@openui5/sap.ui.core": "1.120.17",
60
- "@ui5/webcomponents-tools": "2.7.0-rc.0",
60
+ "@ui5/webcomponents-tools": "2.7.0-rc.1",
61
61
  "chromedriver": "^131.0.0",
62
62
  "clean-css": "^5.2.2",
63
63
  "copy-and-watch": "^0.1.5",
@@ -68,5 +68,5 @@
68
68
  "resolve": "^1.20.0",
69
69
  "touch": "^3.1.0"
70
70
  },
71
- "gitHead": "bae15996685c58d21d6bf20ce7fa8ed10e4728c7"
71
+ "gitHead": "2f90ed3982de20cc411a1cda852ee98709b15e33"
72
72
  }
@@ -1,2 +1 @@
1
1
  import{options as r,Fragment as e}from"./preact.module.js";export{Fragment}from"./preact.module.js";var t=/["&<]/;function n(r){if(0===r.length||!1===t.test(r))return r;for(var e=0,n=0,o="",f="";n<r.length;n++){switch(r.charCodeAt(n)){case 34:f="&quot;";break;case 38:f="&amp;";break;case 60:f="&lt;";break;default:continue}n!==e&&(o+=r.slice(e,n)),o+=f,e=n+1}return n!==e&&(o+=r.slice(e,n)),o}var o=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,f=0,i=Array.isArray;function u(e,t,n,o,i,u){t||(t={});var a,c,l=t;"ref"in t&&(a=t.ref,delete t.ref);var p={type:e,props:l,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--f,__i:-1,__u:0,__source:i,__self:u};if("function"==typeof e&&(a=e.defaultProps))for(c in a)void 0===l[c]&&(l[c]=a[c]);return r.vnode&&r.vnode(p),p}function a(r){var t=u(e,{tpl:r,exprs:[].slice.call(arguments,1)});return t.key=t.__v,t}var c={},l=/[A-Z]/g;function p(e,t){if(r.attr){var f=r.attr(e,t);if("string"==typeof f)return f}if("ref"===e||"key"===e)return"";if("style"===e&&"object"==typeof t){var i="";for(var u in t){var a=t[u];if(null!=a&&""!==a){var p="-"==u[0]?u:c[u]||(c[u]=u.replace(l,"-$&").toLowerCase()),s=";";"number"!=typeof a||p.startsWith("--")||o.test(p)||(s="px;"),i=i+p+":"+a+s}}return e+'="'+i+'"'}return null==t||!1===t||"function"==typeof t||"object"==typeof t?"":!0===t?e:e+'="'+n(t)+'"'}function s(r){if(null==r||"boolean"==typeof r||"function"==typeof r)return null;if("object"==typeof r){if(void 0===r.constructor)return r;if(i(r)){for(var e=0;e<r.length;e++)r[e]=s(r[e]);return r}}return n(""+r)}export{u as jsx,p as jsxAttr,u as jsxDEV,s as jsxEscape,a as jsxTemplate,u as jsxs};
2
- //# sourceMappingURL=jsxRuntime.module.js.map
@@ -1,2 +1 @@
1
1
  var n,l,u,t,i,o,r,e,f,c,s,a,h,p={},v=[],y=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,d=Array.isArray;function w(n,l){for(var u in l)n[u]=l[u];return n}function _(n){n&&n.parentNode&&n.parentNode.removeChild(n)}function g(l,u,t){var i,o,r,e={};for(r in u)"key"==r?i=u[r]:"ref"==r?o=u[r]:e[r]=u[r];if(arguments.length>2&&(e.children=arguments.length>3?n.call(arguments,2):t),"function"==typeof l&&null!=l.defaultProps)for(r in l.defaultProps)void 0===e[r]&&(e[r]=l.defaultProps[r]);return m(l,e,i,o,null)}function m(n,t,i,o,r){var e={type:n,props:t,key:i,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==r?++u:r,__i:-1,__u:0};return null==r&&null!=l.vnode&&l.vnode(e),e}function b(){return{current:null}}function k(n){return n.children}function x(n,l){this.props=n,this.context=l}function C(n,l){if(null==l)return n.__?C(n.__,n.__i+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__e;return"function"==typeof n.type?C(n):null}function S(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break}return S(n)}}function M(n){(!n.__d&&(n.__d=!0)&&i.push(n)&&!P.__r++||o!==l.debounceRendering)&&((o=l.debounceRendering)||r)(P)}function P(){var n,u,t,o,r,f,c,s;for(i.sort(e);n=i.shift();)n.__d&&(u=i.length,o=void 0,f=(r=(t=n).__v).__e,c=[],s=[],t.__P&&((o=w({},r)).__v=r.__v+1,l.vnode&&l.vnode(o),F(t.__P,o,r,t.__n,t.__P.namespaceURI,32&r.__u?[f]:null,c,null==f?C(r):f,!!(32&r.__u),s),o.__v=r.__v,o.__.__k[o.__i]=o,z(c,o,s),o.__e!=f&&S(o)),i.length>u&&i.sort(e));P.__r=0}function $(n,l,u,t,i,o,r,e,f,c,s){var a,h,y,d,w,_,g=t&&t.__k||v,m=l.length;for(f=I(u,l,g,f),a=0;a<m;a++)null!=(y=u.__k[a])&&(h=-1===y.__i?p:g[y.__i]||p,y.__i=a,_=F(n,y,h,i,o,r,e,f,c,s),d=y.__e,y.ref&&h.ref!=y.ref&&(h.ref&&V(h.ref,null,y),s.push(y.ref,y.__c||d,y)),null==w&&null!=d&&(w=d),4&y.__u||h.__k===y.__k?f=H(y,f,n):"function"==typeof y.type&&void 0!==_?f=_:d&&(f=d.nextSibling),y.__u&=-7);return u.__e=w,f}function I(n,l,u,t){var i,o,r,e,f,c=l.length,s=u.length,a=s,h=0;for(n.__k=[],i=0;i<c;i++)null!=(o=l[i])&&"boolean"!=typeof o&&"function"!=typeof o?(e=i+h,(o=n.__k[i]="string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?m(null,o,null,null,null):d(o)?m(k,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?m(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=n,o.__b=n.__b+1,r=null,-1!==(f=o.__i=O(o,u,e,a))&&(a--,(r=u[f])&&(r.__u|=2)),null==r||null===r.__v?(-1==f&&h--,"function"!=typeof o.type&&(o.__u|=4)):f!==e&&(f==e-1?h--:f==e+1?h++:(f>e?h--:h++,o.__u|=4))):o=n.__k[i]=null;if(a)for(i=0;i<s;i++)null!=(r=u[i])&&0==(2&r.__u)&&(r.__e==t&&(t=C(r)),q(r,r));return t}function H(n,l,u){var t,i;if("function"==typeof n.type){for(t=n.__k,i=0;t&&i<t.length;i++)t[i]&&(t[i].__=n,l=H(t[i],l,u));return l}n.__e!=l&&(l&&n.type&&!u.contains(l)&&(l=C(n)),u.insertBefore(n.__e,l||null),l=n.__e);do{l=l&&l.nextSibling}while(null!=l&&8===l.nodeType);return l}function L(n,l){return l=l||[],null==n||"boolean"==typeof n||(d(n)?n.some(function(n){L(n,l)}):l.push(n)),l}function O(n,l,u,t){var i=n.key,o=n.type,r=u-1,e=u+1,f=l[u];if(null===f||f&&i==f.key&&o===f.type&&0==(2&f.__u))return u;if(("function"!=typeof o||o===k||i)&&t>(null!=f&&0==(2&f.__u)?1:0))for(;r>=0||e<l.length;){if(r>=0){if((f=l[r])&&0==(2&f.__u)&&i==f.key&&o===f.type)return r;r--}if(e<l.length){if((f=l[e])&&0==(2&f.__u)&&i==f.key&&o===f.type)return e;e++}}return-1}function T(n,l,u){"-"===l[0]?n.setProperty(l,null==u?"":u):n[l]=null==u?"":"number"!=typeof u||y.test(l)?u:u+"px"}function j(n,l,u,t,i){var o,r;n:if("style"===l)if("string"==typeof u)n.style.cssText=u;else{if("string"==typeof t&&(n.style.cssText=t=""),t)for(l in t)u&&l in u||T(n.style,l,"");if(u)for(l in u)t&&u[l]===t[l]||T(n.style,l,u[l])}else if("o"===l[0]&&"n"===l[1])o=l!==(l=l.replace(f,"$1")),l=l.toLowerCase()in n||"onFocusOut"===l||"onFocusIn"===l?l.toLowerCase().slice(2):l.slice(2),n.l||(n.l={}),n.l[l+o]=u,u?t?u.u=t.u:(u.u=c,n.addEventListener(l,o?a:s,o)):n.removeEventListener(l,o?a:s,o);else{if("http://www.w3.org/2000/svg"==i)l=l.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=l&&"height"!=l&&"href"!=l&&"list"!=l&&"form"!=l&&"tabIndex"!=l&&"download"!=l&&"rowSpan"!=l&&"colSpan"!=l&&"role"!=l&&"popover"!=l&&l in n)try{r=n.tagName&&n.tagName.includes("-"),u!==t&&(n[l]=null!=u||r?u:"");break n}catch(n){}"function"==typeof u||(null==u||!1===u&&"-"!==l[4]?n.removeAttribute(l):n.setAttribute(l,"popover"==l&&1==u?"":u))}}function A(n){return function(u){if(this.l){var t=this.l[u.type+n];if(null==u.t)u.t=c++;else if(u.t<t.u)return;return t(l.event?l.event(u):u)}}}function F(n,u,t,i,o,r,e,f,c,s){var a,h,p,v,y,g,m,b,C,S,M,P,I,H,L,O,T,j=u.type;if(void 0!==u.constructor)return null;128&t.__u&&(c=!!(32&t.__u),r=[f=u.__e=t.__e]),(a=l.__b)&&a(u);n:if("function"==typeof j)try{if(b=u.props,C="prototype"in j&&j.prototype.render,S=(a=j.contextType)&&i[a.__c],M=a?S?S.props.value:a.__:i,t.__c?m=(h=u.__c=t.__c).__=h.__E:(C?u.__c=h=new j(b,M):(u.__c=h=new x(b,M),h.constructor=j,h.render=B),S&&S.sub(h),h.props=b,h.state||(h.state={}),h.context=M,h.__n=i,p=h.__d=!0,h.__h=[],h._sb=[]),C&&null==h.__s&&(h.__s=h.state),C&&null!=j.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=w({},h.__s)),w(h.__s,j.getDerivedStateFromProps(b,h.__s))),v=h.props,y=h.state,h.__v=u,p)C&&null==j.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),C&&null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else{if(C&&null==j.getDerivedStateFromProps&&b!==v&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(b,M),!h.__e&&(null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(b,h.__s,M)||u.__v===t.__v)){for(u.__v!==t.__v&&(h.props=b,h.state=h.__s,h.__d=!1),u.__e=t.__e,u.__k=t.__k,u.__k.some(function(n){n&&(n.__=u)}),P=0;P<h._sb.length;P++)h.__h.push(h._sb[P]);h._sb=[],h.__h.length&&e.push(h);break n}null!=h.componentWillUpdate&&h.componentWillUpdate(b,h.__s,M),C&&null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(v,y,g)})}if(h.context=M,h.props=b,h.__P=n,h.__e=!1,I=l.__r,H=0,C){for(h.state=h.__s,h.__d=!1,I&&I(u),a=h.render(h.props,h.state,h.context),L=0;L<h._sb.length;L++)h.__h.push(h._sb[L]);h._sb=[]}else do{h.__d=!1,I&&I(u),a=h.render(h.props,h.state,h.context),h.state=h.__s}while(h.__d&&++H<25);h.state=h.__s,null!=h.getChildContext&&(i=w(w({},i),h.getChildContext())),C&&!p&&null!=h.getSnapshotBeforeUpdate&&(g=h.getSnapshotBeforeUpdate(v,y)),f=$(n,d(O=null!=a&&a.type===k&&null==a.key?a.props.children:a)?O:[O],u,t,i,o,r,e,f,c,s),h.base=u.__e,u.__u&=-161,h.__h.length&&e.push(h),m&&(h.__E=h.__=null)}catch(n){if(u.__v=null,c||null!=r)if(n.then){for(u.__u|=c?160:128;f&&8===f.nodeType&&f.nextSibling;)f=f.nextSibling;r[r.indexOf(f)]=null,u.__e=f}else for(T=r.length;T--;)_(r[T]);else u.__e=t.__e,u.__k=t.__k;l.__e(n,u,t)}else null==r&&u.__v===t.__v?(u.__k=t.__k,u.__e=t.__e):f=u.__e=N(t.__e,u,t,i,o,r,e,c,s);return(a=l.diffed)&&a(u),128&u.__u?void 0:f}function z(n,u,t){for(var i=0;i<t.length;i++)V(t[i],t[++i],t[++i]);l.__c&&l.__c(u,n),n.some(function(u){try{n=u.__h,u.__h=[],n.some(function(n){n.call(u)})}catch(n){l.__e(n,u.__v)}})}function N(u,t,i,o,r,e,f,c,s){var a,h,v,y,w,g,m,b,k=i.props,x=t.props,S=t.type;if("svg"===S?r="http://www.w3.org/2000/svg":"math"===S?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),null!=e)for(a=0;a<e.length;a++)if((w=e[a])&&"setAttribute"in w==!!S&&(S?w.localName===S:3===w.nodeType)){u=w,e[a]=null;break}if(null==u){if(null===S)return document.createTextNode(x);u=document.createElementNS(r,S,x.is&&x),c&&(l.__m&&l.__m(t,e),c=!1),e=null}if(null===S)k===x||c&&u.data===x||(u.data=x);else{if(e=e&&n.call(u.childNodes),k=i.props||p,!c&&null!=e)for(k={},a=0;a<u.attributes.length;a++)k[(w=u.attributes[a]).name]=w.value;for(a in k)if(w=k[a],"children"==a);else if("dangerouslySetInnerHTML"==a)v=w;else if(!(a in x)){if("value"==a&&"defaultValue"in x||"checked"==a&&"defaultChecked"in x)continue;j(u,a,null,w,r)}for(a in x)w=x[a],"children"==a?y=w:"dangerouslySetInnerHTML"==a?h=w:"value"==a?g=w:"checked"==a?m=w:c&&"function"!=typeof w||k[a]===w||(a.startsWith("on")&&(b=o[Object.keys(o)[0]].props.value,w=w.bind(b)),j(u,a,w,k[a],r));if(h)c||v&&(h.__html===v.__html||h.__html===u.innerHTML)||(u.innerHTML=h.__html),t.__k=[];else if(v&&(u.innerHTML=""),$(u,d(y)?y:[y],t,i,o,"foreignObject"===S?"http://www.w3.org/1999/xhtml":r,e,f,e?e[0]:i.__k&&C(i,0),c,s),null!=e)for(a=e.length;a--;)_(e[a]);c||(a="value","progress"===S&&null==g?u.removeAttribute("value"):void 0!==g&&(g!==u[a]||"progress"===S&&!g||"option"===S&&g!==k[a])&&j(u,a,g,k[a],r),a="checked",void 0!==m&&m!==u[a]&&j(u,a,m,k[a],r))}return u}function V(n,u,t){try{if("function"==typeof n){var i="function"==typeof n.__u;i&&n.__u(),i&&null==u||(n.__u=n(u))}else n.current=u}catch(n){l.__e(n,t)}}function q(n,u,t){var i,o;if(l.unmount&&l.unmount(n),(i=n.ref)&&(i.current&&i.current!==n.__e||V(i,null,u)),null!=(i=n.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(n){l.__e(n,u)}i.base=i.__P=null}if(i=n.__k)for(o=0;o<i.length;o++)i[o]&&q(i[o],u,t||"function"!=typeof n.type);t||_(n.__e),n.__c=n.__=n.__e=void 0}function B(n,l,u){return this.constructor(n,u)}function D(u,t,i){var o,r,e,f;t===document&&(t=document.documentElement),l.__&&l.__(u,t),r=(o="function"==typeof i)?null:i&&i.__k||t.__k,e=[],f=[],F(t,u=(!o&&i||t).__k=g(k,null,[u]),r||p,p,t.namespaceURI,!o&&i?[i]:r?null:t.firstChild?n.call(t.childNodes):null,e,!o&&i?i:r?r.__e:t.firstChild,o,f),z(e,u,f)}function E(n,l){D(n,l,E)}function G(l,u,t){var i,o,r,e,f=w({},l.props);for(r in l.type&&l.type.defaultProps&&(e=l.type.defaultProps),u)"key"==r?i=u[r]:"ref"==r?o=u[r]:f[r]=void 0===u[r]&&void 0!==e?e[r]:u[r];return arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):t),m(l.type,f,i||l.key,o||l.ref,null)}function J(n,l){var u={__c:l="__cC"+h++,__:n,Consumer:function(n,l){return n.children(l)},Provider:function(n){var u,t;return this.getChildContext||(u=new Set,(t={})[l]=this,this.getChildContext=function(){return t},this.componentWillUnmount=function(){u=null},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&u.forEach(function(n){n.__e=!0,M(n)})},this.sub=function(n){u.add(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){u&&u.delete(n),l&&l.call(n)}}),n.children}};return u.Provider.__=u.Consumer.contextType=u}n=v.slice,l={__e:function(n,l,u,t){for(var i,o,r;l=l.__;)if((i=l.__c)&&!i.__)try{if((o=i.constructor)&&null!=o.getDerivedStateFromError&&(i.setState(o.getDerivedStateFromError(n)),r=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(n,t||{}),r=i.__d),r)return i.__E=i}catch(l){n=l}throw n}},u=0,t=function(n){return null!=n&&null==n.constructor},x.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=w({},this.state),"function"==typeof n&&(n=n(w({},u),this.props)),n&&w(u,n),null!=n&&this.__v&&(l&&this._sb.push(l),M(this))},x.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),M(this))},x.prototype.render=k,i=[],r="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,e=function(n,l){return n.__v.__b-l.__v.__b},P.__r=0,f=/(PointerCapture)$|Capture$/i,c=0,s=A(!1),a=A(!0),h=0;export{x as Component,k as Fragment,G as cloneElement,J as createContext,g as createElement,b as createRef,g as h,E as hydrate,t as isValidElement,l as options,D as render,L as toChildArray};
2
- //# sourceMappingURL=preact.module.js.map