notebook 7.5.0a1__py3-none-any.whl → 7.5.0a2__py3-none-any.whl

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.

Potentially problematic release.


This version of notebook might be problematic. Click here for more details.

Files changed (112) hide show
  1. notebook/_version.py +1 -1
  2. notebook/static/1468.38f64176ff236023d384.js +2180 -0
  3. notebook/static/1468.38f64176ff236023d384.js.map +1 -0
  4. notebook/static/1602.1f9163a55b87ec440fc5.js +2066 -0
  5. notebook/static/1602.1f9163a55b87ec440fc5.js.map +1 -0
  6. notebook/static/{1650.b00394ad3dc35053e693.js → 1650.b6a511d5a1f6220e2fa3.js} +4 -4
  7. notebook/static/{1650.b00394ad3dc35053e693.js.map → 1650.b6a511d5a1f6220e2fa3.js.map} +1 -1
  8. notebook/static/{1684.f349edb803bac0f91f0c.js → 1684.95aa82062c4eca59fdd8.js} +5 -5
  9. notebook/static/{1684.f349edb803bac0f91f0c.js.map → 1684.95aa82062c4eca59fdd8.js.map} +1 -1
  10. notebook/static/{4686.033cd721d82d6a834932.js → 1869.48ca2e23bddad3adfc1a.js} +2 -2
  11. notebook/static/{4686.033cd721d82d6a834932.js.map → 1869.48ca2e23bddad3adfc1a.js.map} +1 -1
  12. notebook/static/{2228.4d7324cc3d83ef51f620.js → 2228.e21c6943709bcbca9f11.js} +5 -5
  13. notebook/static/{2228.4d7324cc3d83ef51f620.js.map → 2228.e21c6943709bcbca9f11.js.map} +1 -1
  14. notebook/static/{3146.85e8d7d6490bc7809d61.js → 3146.f44bb02dabad5764acb1.js} +3 -3
  15. notebook/static/{3146.85e8d7d6490bc7809d61.js.map → 3146.f44bb02dabad5764acb1.js.map} +1 -1
  16. notebook/static/{3197.973b1a00d1862cd93aa3.js → 3197.faee11ea04d6005f556a.js} +5 -5
  17. notebook/static/{3197.973b1a00d1862cd93aa3.js.map → 3197.faee11ea04d6005f556a.js.map} +1 -1
  18. notebook/static/{3768.06d59da7841a953a73f9.js → 3768.a792a9cd73c0063eb1e6.js} +19 -19
  19. notebook/static/{7302.d917bedc72c836127fd8.js.map → 3768.a792a9cd73c0063eb1e6.js.map} +1 -1
  20. notebook/static/{4382.a6be960a392df98ece0a.js → 4382.b1c5a0c7667d0650c44b.js} +3 -3
  21. notebook/static/{4382.a6be960a392df98ece0a.js.map → 4382.b1c5a0c7667d0650c44b.js.map} +1 -1
  22. notebook/static/{4645.ea6bc9fd7e87785a9da6.js → 4645.7ddcfae735a32dab2a63.js} +5 -5
  23. notebook/static/{4645.ea6bc9fd7e87785a9da6.js.map → 4645.7ddcfae735a32dab2a63.js.map} +1 -1
  24. notebook/static/{4837.482580d2b358e43e70a5.js → 4837.3c7eba49f940fff29a91.js} +3 -3
  25. notebook/static/{4837.482580d2b358e43e70a5.js.map → 4837.3c7eba49f940fff29a91.js.map} +1 -1
  26. notebook/static/{5135.41f01f7766328bc84cf4.js → 5135.b48ecd90bfe174ac46cf.js} +12 -12
  27. notebook/static/5135.b48ecd90bfe174ac46cf.js.map +1 -0
  28. notebook/static/{5573.1ca7216a042fa1e46686.js → 5573.18819704a267d2675e93.js} +17 -17
  29. notebook/static/{5573.1ca7216a042fa1e46686.js.map → 5573.18819704a267d2675e93.js.map} +1 -1
  30. notebook/static/{5601.6d56403e3367766b9833.js → 5601.451696703c791262d61c.js} +5 -5
  31. notebook/static/{5601.6d56403e3367766b9833.js.map → 5601.451696703c791262d61c.js.map} +1 -1
  32. notebook/static/{6345.a3b34eb6fbdb77795446.js → 6345.418adfd3df1526bef29d.js} +5 -5
  33. notebook/static/{6345.a3b34eb6fbdb77795446.js.map → 6345.418adfd3df1526bef29d.js.map} +1 -1
  34. notebook/static/{8018.9d668662c823eb96a340.js → 6514.29684612c517058fce54.js} +2 -2
  35. notebook/static/{8018.9d668662c823eb96a340.js.map → 6514.29684612c517058fce54.js.map} +1 -1
  36. notebook/static/{7302.d917bedc72c836127fd8.js → 7302.49c1041fbaca659a1f06.js} +19 -19
  37. notebook/static/{3768.06d59da7841a953a73f9.js.map → 7302.49c1041fbaca659a1f06.js.map} +1 -1
  38. notebook/static/{7906.9861494266a56d27108d.js → 7906.548a8342ea988f1683a5.js} +3 -3
  39. notebook/static/{7906.9861494266a56d27108d.js.map → 7906.548a8342ea988f1683a5.js.map} +1 -1
  40. notebook/static/{8579.5f0f1dff5c472f6e109f.js → 8579.6d68bc32866d4eb0ba22.js} +13 -13
  41. notebook/static/{8579.5f0f1dff5c472f6e109f.js.map → 8579.6d68bc32866d4eb0ba22.js.map} +1 -1
  42. notebook/static/877.6e7f963fba9e130a70de.js +12 -0
  43. notebook/static/877.6e7f963fba9e130a70de.js.map +1 -0
  44. notebook/static/{8781.ef452884c28a92cd461a.js → 8781.06fab3c1d2b18cf2534a.js} +62 -62
  45. notebook/static/{8781.ef452884c28a92cd461a.js.map → 8781.06fab3c1d2b18cf2534a.js.map} +1 -1
  46. notebook/static/{8875.d5ac718df2dd327ea01c.js → 8875.daf6addb5886c25ad887.js} +4 -4
  47. notebook/static/{8875.d5ac718df2dd327ea01c.js.map → 8875.daf6addb5886c25ad887.js.map} +1 -1
  48. notebook/static/{9068.ffdecd947641745f1d04.js → 9068.558f62905a47813d65f6.js} +3 -3
  49. notebook/static/{9068.ffdecd947641745f1d04.js.map → 9068.558f62905a47813d65f6.js.map} +1 -1
  50. notebook/static/{9250.bdc1f9dad1231a7f6f62.js → 9250.a4dfe77db702bf7a316c.js} +2 -2
  51. notebook/static/{9250.bdc1f9dad1231a7f6f62.js.map → 9250.a4dfe77db702bf7a316c.js.map} +1 -1
  52. notebook/static/{9380.cc37e64444d30c28c8b7.js → 9380.4e3e3cfcb65c0bc07b6f.js} +5 -5
  53. notebook/static/{9380.cc37e64444d30c28c8b7.js.map → 9380.4e3e3cfcb65c0bc07b6f.js.map} +1 -1
  54. notebook/static/{9619.72d0af35a1e6e3c624d7.js → 9619.8568577b14d9b7dafc06.js} +6 -2182
  55. notebook/static/9619.8568577b14d9b7dafc06.js.map +1 -0
  56. notebook/static/main.162cdf5c87887fbae342.js +1206 -0
  57. notebook/static/main.162cdf5c87887fbae342.js.map +1 -0
  58. notebook/static/{notebook_core.37893bb05a49faa489fa.js → notebook_core.db352d5a5e6e5427718e.js} +1326 -965
  59. notebook/static/{notebook_core.37893bb05a49faa489fa.js.map → notebook_core.db352d5a5e6e5427718e.js.map} +1 -1
  60. notebook/static/third-party-licenses.json +111 -105
  61. notebook/templates/consoles.html +1 -1
  62. notebook/templates/edit.html +1 -1
  63. notebook/templates/error.html +1 -1
  64. notebook/templates/notebooks.html +1 -1
  65. notebook/templates/terminals.html +1 -1
  66. notebook/templates/tree.html +1 -1
  67. {notebook-7.5.0a1.data → notebook-7.5.0a2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/package.json.orig +14 -14
  68. {notebook-7.5.0a1.data → notebook-7.5.0a2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/documentsearch-extension/package.json.orig +4 -4
  69. {notebook-7.5.0a1.data → notebook-7.5.0a2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/help-extension/package.json.orig +6 -6
  70. {notebook-7.5.0a1.data → notebook-7.5.0a2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/package.json.orig +9 -9
  71. {notebook-7.5.0a1.data → notebook-7.5.0a2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/package.json.orig +15 -15
  72. {notebook-7.5.0a1.data → notebook-7.5.0a2.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/package.json +11 -11
  73. {notebook-7.5.0a1.data → notebook-7.5.0a2.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/package.json.orig +10 -10
  74. notebook-7.5.0a2.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/568.8c581a64e1c3fa57e146.js +1 -0
  75. notebook-7.5.0a2.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/72.de849eb23a96c949827b.js +1 -0
  76. notebook-7.5.0a2.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/928.d9792bb41a11ffa9f14c.js +1 -0
  77. notebook-7.5.0a2.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/remoteEntry.4720490c302033257d7d.js +1 -0
  78. {notebook-7.5.0a1.data → notebook-7.5.0a2.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/third-party-licenses.json +2 -2
  79. {notebook-7.5.0a1.dist-info → notebook-7.5.0a2.dist-info}/METADATA +2 -2
  80. {notebook-7.5.0a1.dist-info → notebook-7.5.0a2.dist-info}/RECORD +104 -98
  81. notebook/static/5135.41f01f7766328bc84cf4.js.map +0 -1
  82. notebook/static/9619.72d0af35a1e6e3c624d7.js.map +0 -1
  83. notebook/static/main.3d8274c6ccdd05c0f5b1.js +0 -1191
  84. notebook/static/main.3d8274c6ccdd05c0f5b1.js.map +0 -1
  85. notebook-7.5.0a1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/568.86e4dcf4a87445c5d0c3.js +0 -1
  86. notebook-7.5.0a1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/743.252a0fdc772394b5030e.js +0 -1
  87. notebook-7.5.0a1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/928.92ec0e44385a6f5a58da.js +0 -1
  88. notebook-7.5.0a1.data/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/remoteEntry.47eb4f1e4922cfb9a214.js +0 -1
  89. {notebook-7.5.0a1.data → notebook-7.5.0a2.data}/data/etc/jupyter/jupyter_server_config.d/notebook.json +0 -0
  90. {notebook-7.5.0a1.data → notebook-7.5.0a2.data}/data/share/applications/jupyter-notebook.desktop +0 -0
  91. {notebook-7.5.0a1.data → notebook-7.5.0a2.data}/data/share/icons/hicolor/scalable/apps/notebook.svg +0 -0
  92. {notebook-7.5.0a1.data → notebook-7.5.0a2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/menus.json +0 -0
  93. {notebook-7.5.0a1.data → notebook-7.5.0a2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/pages.json +0 -0
  94. {notebook-7.5.0a1.data → notebook-7.5.0a2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/shell.json +0 -0
  95. {notebook-7.5.0a1.data → notebook-7.5.0a2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/title.json +0 -0
  96. {notebook-7.5.0a1.data → notebook-7.5.0a2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/top.json +0 -0
  97. {notebook-7.5.0a1.data → notebook-7.5.0a2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/application-extension/zen.json +0 -0
  98. {notebook-7.5.0a1.data → notebook-7.5.0a2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/help-extension/open.json +0 -0
  99. {notebook-7.5.0a1.data → notebook-7.5.0a2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/checkpoints.json +0 -0
  100. {notebook-7.5.0a1.data → notebook-7.5.0a2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/edit-notebook-metadata.json +0 -0
  101. {notebook-7.5.0a1.data → notebook-7.5.0a2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/full-width-notebook.json +0 -0
  102. {notebook-7.5.0a1.data → notebook-7.5.0a2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/kernel-logo.json +0 -0
  103. {notebook-7.5.0a1.data → notebook-7.5.0a2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/notebook-extension/scroll-output.json +0 -0
  104. {notebook-7.5.0a1.data → notebook-7.5.0a2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/file-actions.json +0 -0
  105. {notebook-7.5.0a1.data → notebook-7.5.0a2.data}/data/share/jupyter/lab/schemas/@jupyter-notebook/tree-extension/widget.json +0 -0
  106. {notebook-7.5.0a1.data → notebook-7.5.0a2.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/interface-switcher.json +0 -0
  107. {notebook-7.5.0a1.data → notebook-7.5.0a2.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/schemas/@jupyter-notebook/lab-extension/launch-tree.json +0 -0
  108. {notebook-7.5.0a1.data → notebook-7.5.0a2.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/93.eae3497dd223d842d198.js +0 -0
  109. {notebook-7.5.0a1.data → notebook-7.5.0a2.data}/data/share/jupyter/labextensions/@jupyter-notebook/lab-extension/static/style.js +0 -0
  110. {notebook-7.5.0a1.dist-info → notebook-7.5.0a2.dist-info}/WHEEL +0 -0
  111. {notebook-7.5.0a1.dist-info → notebook-7.5.0a2.dist-info}/entry_points.txt +0 -0
  112. {notebook-7.5.0a1.dist-info → notebook-7.5.0a2.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,2066 @@
1
+ "use strict";
2
+ (self["webpackChunk_JUPYTERLAB_CORE_OUTPUT"] = self["webpackChunk_JUPYTERLAB_CORE_OUTPUT"] || []).push([[1602],{
3
+
4
+ /***/ 59116:
5
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
6
+
7
+ // ESM COMPAT FLAG
8
+ __webpack_require__.r(__webpack_exports__);
9
+
10
+ // EXPORTS
11
+ __webpack_require__.d(__webpack_exports__, {
12
+ "default": () => (/* binding */ color)
13
+ });
14
+
15
+ ;// CONCATENATED MODULE: ../node_modules/color/node_modules/color-name/index.js
16
+ /* harmony default export */ const color_name = ({
17
+ aliceblue: [240, 248, 255],
18
+ antiquewhite: [250, 235, 215],
19
+ aqua: [0, 255, 255],
20
+ aquamarine: [127, 255, 212],
21
+ azure: [240, 255, 255],
22
+ beige: [245, 245, 220],
23
+ bisque: [255, 228, 196],
24
+ black: [0, 0, 0],
25
+ blanchedalmond: [255, 235, 205],
26
+ blue: [0, 0, 255],
27
+ blueviolet: [138, 43, 226],
28
+ brown: [165, 42, 42],
29
+ burlywood: [222, 184, 135],
30
+ cadetblue: [95, 158, 160],
31
+ chartreuse: [127, 255, 0],
32
+ chocolate: [210, 105, 30],
33
+ coral: [255, 127, 80],
34
+ cornflowerblue: [100, 149, 237],
35
+ cornsilk: [255, 248, 220],
36
+ crimson: [220, 20, 60],
37
+ cyan: [0, 255, 255],
38
+ darkblue: [0, 0, 139],
39
+ darkcyan: [0, 139, 139],
40
+ darkgoldenrod: [184, 134, 11],
41
+ darkgray: [169, 169, 169],
42
+ darkgreen: [0, 100, 0],
43
+ darkgrey: [169, 169, 169],
44
+ darkkhaki: [189, 183, 107],
45
+ darkmagenta: [139, 0, 139],
46
+ darkolivegreen: [85, 107, 47],
47
+ darkorange: [255, 140, 0],
48
+ darkorchid: [153, 50, 204],
49
+ darkred: [139, 0, 0],
50
+ darksalmon: [233, 150, 122],
51
+ darkseagreen: [143, 188, 143],
52
+ darkslateblue: [72, 61, 139],
53
+ darkslategray: [47, 79, 79],
54
+ darkslategrey: [47, 79, 79],
55
+ darkturquoise: [0, 206, 209],
56
+ darkviolet: [148, 0, 211],
57
+ deeppink: [255, 20, 147],
58
+ deepskyblue: [0, 191, 255],
59
+ dimgray: [105, 105, 105],
60
+ dimgrey: [105, 105, 105],
61
+ dodgerblue: [30, 144, 255],
62
+ firebrick: [178, 34, 34],
63
+ floralwhite: [255, 250, 240],
64
+ forestgreen: [34, 139, 34],
65
+ fuchsia: [255, 0, 255],
66
+ gainsboro: [220, 220, 220],
67
+ ghostwhite: [248, 248, 255],
68
+ gold: [255, 215, 0],
69
+ goldenrod: [218, 165, 32],
70
+ gray: [128, 128, 128],
71
+ green: [0, 128, 0],
72
+ greenyellow: [173, 255, 47],
73
+ grey: [128, 128, 128],
74
+ honeydew: [240, 255, 240],
75
+ hotpink: [255, 105, 180],
76
+ indianred: [205, 92, 92],
77
+ indigo: [75, 0, 130],
78
+ ivory: [255, 255, 240],
79
+ khaki: [240, 230, 140],
80
+ lavender: [230, 230, 250],
81
+ lavenderblush: [255, 240, 245],
82
+ lawngreen: [124, 252, 0],
83
+ lemonchiffon: [255, 250, 205],
84
+ lightblue: [173, 216, 230],
85
+ lightcoral: [240, 128, 128],
86
+ lightcyan: [224, 255, 255],
87
+ lightgoldenrodyellow: [250, 250, 210],
88
+ lightgray: [211, 211, 211],
89
+ lightgreen: [144, 238, 144],
90
+ lightgrey: [211, 211, 211],
91
+ lightpink: [255, 182, 193],
92
+ lightsalmon: [255, 160, 122],
93
+ lightseagreen: [32, 178, 170],
94
+ lightskyblue: [135, 206, 250],
95
+ lightslategray: [119, 136, 153],
96
+ lightslategrey: [119, 136, 153],
97
+ lightsteelblue: [176, 196, 222],
98
+ lightyellow: [255, 255, 224],
99
+ lime: [0, 255, 0],
100
+ limegreen: [50, 205, 50],
101
+ linen: [250, 240, 230],
102
+ magenta: [255, 0, 255],
103
+ maroon: [128, 0, 0],
104
+ mediumaquamarine: [102, 205, 170],
105
+ mediumblue: [0, 0, 205],
106
+ mediumorchid: [186, 85, 211],
107
+ mediumpurple: [147, 112, 219],
108
+ mediumseagreen: [60, 179, 113],
109
+ mediumslateblue: [123, 104, 238],
110
+ mediumspringgreen: [0, 250, 154],
111
+ mediumturquoise: [72, 209, 204],
112
+ mediumvioletred: [199, 21, 133],
113
+ midnightblue: [25, 25, 112],
114
+ mintcream: [245, 255, 250],
115
+ mistyrose: [255, 228, 225],
116
+ moccasin: [255, 228, 181],
117
+ navajowhite: [255, 222, 173],
118
+ navy: [0, 0, 128],
119
+ oldlace: [253, 245, 230],
120
+ olive: [128, 128, 0],
121
+ olivedrab: [107, 142, 35],
122
+ orange: [255, 165, 0],
123
+ orangered: [255, 69, 0],
124
+ orchid: [218, 112, 214],
125
+ palegoldenrod: [238, 232, 170],
126
+ palegreen: [152, 251, 152],
127
+ paleturquoise: [175, 238, 238],
128
+ palevioletred: [219, 112, 147],
129
+ papayawhip: [255, 239, 213],
130
+ peachpuff: [255, 218, 185],
131
+ peru: [205, 133, 63],
132
+ pink: [255, 192, 203],
133
+ plum: [221, 160, 221],
134
+ powderblue: [176, 224, 230],
135
+ purple: [128, 0, 128],
136
+ rebeccapurple: [102, 51, 153],
137
+ red: [255, 0, 0],
138
+ rosybrown: [188, 143, 143],
139
+ royalblue: [65, 105, 225],
140
+ saddlebrown: [139, 69, 19],
141
+ salmon: [250, 128, 114],
142
+ sandybrown: [244, 164, 96],
143
+ seagreen: [46, 139, 87],
144
+ seashell: [255, 245, 238],
145
+ sienna: [160, 82, 45],
146
+ silver: [192, 192, 192],
147
+ skyblue: [135, 206, 235],
148
+ slateblue: [106, 90, 205],
149
+ slategray: [112, 128, 144],
150
+ slategrey: [112, 128, 144],
151
+ snow: [255, 250, 250],
152
+ springgreen: [0, 255, 127],
153
+ steelblue: [70, 130, 180],
154
+ tan: [210, 180, 140],
155
+ teal: [0, 128, 128],
156
+ thistle: [216, 191, 216],
157
+ tomato: [255, 99, 71],
158
+ turquoise: [64, 224, 208],
159
+ violet: [238, 130, 238],
160
+ wheat: [245, 222, 179],
161
+ white: [255, 255, 255],
162
+ whitesmoke: [245, 245, 245],
163
+ yellow: [255, 255, 0],
164
+ yellowgreen: [154, 205, 50]
165
+ });
166
+
167
+ ;// CONCATENATED MODULE: ../node_modules/color/node_modules/color-string/index.js
168
+
169
+
170
+ const reverseNames = Object.create(null);
171
+
172
+ // Create a list of reverse color names
173
+ for (const name in color_name) {
174
+ if (Object.hasOwn(color_name, name)) {
175
+ reverseNames[color_name[name]] = name;
176
+ }
177
+ }
178
+
179
+ const cs = {
180
+ to: {},
181
+ get: {},
182
+ };
183
+
184
+ cs.get = function (string) {
185
+ const prefix = string.slice(0, 3).toLowerCase();
186
+ let value;
187
+ let model;
188
+ switch (prefix) {
189
+ case 'hsl': {
190
+ value = cs.get.hsl(string);
191
+ model = 'hsl';
192
+ break;
193
+ }
194
+
195
+ case 'hwb': {
196
+ value = cs.get.hwb(string);
197
+ model = 'hwb';
198
+ break;
199
+ }
200
+
201
+ default: {
202
+ value = cs.get.rgb(string);
203
+ model = 'rgb';
204
+ break;
205
+ }
206
+ }
207
+
208
+ if (!value) {
209
+ return null;
210
+ }
211
+
212
+ return {model, value};
213
+ };
214
+
215
+ cs.get.rgb = function (string) {
216
+ if (!string) {
217
+ return null;
218
+ }
219
+
220
+ const abbr = /^#([a-f\d]{3,4})$/i;
221
+ const hex = /^#([a-f\d]{6})([a-f\d]{2})?$/i;
222
+ const rgba = /^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/;
223
+ const per = /^rgba?\(\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?[\d.]+)(%?)\s*)?\)$/;
224
+ const keyword = /^(\w+)$/;
225
+
226
+ let rgb = [0, 0, 0, 1];
227
+ let match;
228
+ let i;
229
+ let hexAlpha;
230
+
231
+ if (match = string.match(hex)) {
232
+ hexAlpha = match[2];
233
+ match = match[1];
234
+
235
+ for (i = 0; i < 3; i++) {
236
+ // https://jsperf.com/slice-vs-substr-vs-substring-methods-long-string/19
237
+ const i2 = i * 2;
238
+ rgb[i] = Number.parseInt(match.slice(i2, i2 + 2), 16);
239
+ }
240
+
241
+ if (hexAlpha) {
242
+ rgb[3] = Number.parseInt(hexAlpha, 16) / 255;
243
+ }
244
+ } else if (match = string.match(abbr)) {
245
+ match = match[1];
246
+ hexAlpha = match[3];
247
+
248
+ for (i = 0; i < 3; i++) {
249
+ rgb[i] = Number.parseInt(match[i] + match[i], 16);
250
+ }
251
+
252
+ if (hexAlpha) {
253
+ rgb[3] = Number.parseInt(hexAlpha + hexAlpha, 16) / 255;
254
+ }
255
+ } else if (match = string.match(rgba)) {
256
+ for (i = 0; i < 3; i++) {
257
+ rgb[i] = Number.parseInt(match[i + 1], 10);
258
+ }
259
+
260
+ if (match[4]) {
261
+ rgb[3] = match[5] ? Number.parseFloat(match[4]) * 0.01 : Number.parseFloat(match[4]);
262
+ }
263
+ } else if (match = string.match(per)) {
264
+ for (i = 0; i < 3; i++) {
265
+ rgb[i] = Math.round(Number.parseFloat(match[i + 1]) * 2.55);
266
+ }
267
+
268
+ if (match[4]) {
269
+ rgb[3] = match[5] ? Number.parseFloat(match[4]) * 0.01 : Number.parseFloat(match[4]);
270
+ }
271
+ } else if (match = string.match(keyword)) {
272
+ if (match[1] === 'transparent') {
273
+ return [0, 0, 0, 0];
274
+ }
275
+
276
+ if (!Object.hasOwn(color_name, match[1])) {
277
+ return null;
278
+ }
279
+
280
+ rgb = color_name[match[1]];
281
+ rgb[3] = 1;
282
+
283
+ return rgb;
284
+ } else {
285
+ return null;
286
+ }
287
+
288
+ for (i = 0; i < 3; i++) {
289
+ rgb[i] = clamp(rgb[i], 0, 255);
290
+ }
291
+
292
+ rgb[3] = clamp(rgb[3], 0, 1);
293
+
294
+ return rgb;
295
+ };
296
+
297
+ cs.get.hsl = function (string) {
298
+ if (!string) {
299
+ return null;
300
+ }
301
+
302
+ const hsl = /^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d.]+)%\s*,?\s*([+-]?[\d.]+)%\s*(?:[,|/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/;
303
+ const match = string.match(hsl);
304
+
305
+ if (match) {
306
+ const alpha = Number.parseFloat(match[4]);
307
+ const h = ((Number.parseFloat(match[1]) % 360) + 360) % 360;
308
+ const s = clamp(Number.parseFloat(match[2]), 0, 100);
309
+ const l = clamp(Number.parseFloat(match[3]), 0, 100);
310
+ const a = clamp(Number.isNaN(alpha) ? 1 : alpha, 0, 1);
311
+
312
+ return [h, s, l, a];
313
+ }
314
+
315
+ return null;
316
+ };
317
+
318
+ cs.get.hwb = function (string) {
319
+ if (!string) {
320
+ return null;
321
+ }
322
+
323
+ const hwb = /^hwb\(\s*([+-]?\d{0,3}(?:\.\d+)?)(?:deg)?\s*,\s*([+-]?[\d.]+)%\s*,\s*([+-]?[\d.]+)%\s*(?:,\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/;
324
+ const match = string.match(hwb);
325
+
326
+ if (match) {
327
+ const alpha = Number.parseFloat(match[4]);
328
+ const h = ((Number.parseFloat(match[1]) % 360) + 360) % 360;
329
+ const w = clamp(Number.parseFloat(match[2]), 0, 100);
330
+ const b = clamp(Number.parseFloat(match[3]), 0, 100);
331
+ const a = clamp(Number.isNaN(alpha) ? 1 : alpha, 0, 1);
332
+ return [h, w, b, a];
333
+ }
334
+
335
+ return null;
336
+ };
337
+
338
+ cs.to.hex = function (...rgba) {
339
+ return (
340
+ '#' +
341
+ hexDouble(rgba[0]) +
342
+ hexDouble(rgba[1]) +
343
+ hexDouble(rgba[2]) +
344
+ (rgba[3] < 1
345
+ ? (hexDouble(Math.round(rgba[3] * 255)))
346
+ : '')
347
+ );
348
+ };
349
+
350
+ cs.to.rgb = function (...rgba) {
351
+ return rgba.length < 4 || rgba[3] === 1
352
+ ? 'rgb(' + Math.round(rgba[0]) + ', ' + Math.round(rgba[1]) + ', ' + Math.round(rgba[2]) + ')'
353
+ : 'rgba(' + Math.round(rgba[0]) + ', ' + Math.round(rgba[1]) + ', ' + Math.round(rgba[2]) + ', ' + rgba[3] + ')';
354
+ };
355
+
356
+ cs.to.rgb.percent = function (...rgba) {
357
+ const r = Math.round(rgba[0] / 255 * 100);
358
+ const g = Math.round(rgba[1] / 255 * 100);
359
+ const b = Math.round(rgba[2] / 255 * 100);
360
+
361
+ return rgba.length < 4 || rgba[3] === 1
362
+ ? 'rgb(' + r + '%, ' + g + '%, ' + b + '%)'
363
+ : 'rgba(' + r + '%, ' + g + '%, ' + b + '%, ' + rgba[3] + ')';
364
+ };
365
+
366
+ cs.to.hsl = function (...hsla) {
367
+ return hsla.length < 4 || hsla[3] === 1
368
+ ? 'hsl(' + hsla[0] + ', ' + hsla[1] + '%, ' + hsla[2] + '%)'
369
+ : 'hsla(' + hsla[0] + ', ' + hsla[1] + '%, ' + hsla[2] + '%, ' + hsla[3] + ')';
370
+ };
371
+
372
+ // Hwb is a bit different than rgb(a) & hsl(a) since there is no alpha specific syntax
373
+ // (hwb have alpha optional & 1 is default value)
374
+ cs.to.hwb = function (...hwba) {
375
+ let a = '';
376
+ if (hwba.length >= 4 && hwba[3] !== 1) {
377
+ a = ', ' + hwba[3];
378
+ }
379
+
380
+ return 'hwb(' + hwba[0] + ', ' + hwba[1] + '%, ' + hwba[2] + '%' + a + ')';
381
+ };
382
+
383
+ cs.to.keyword = function (...rgb) {
384
+ return reverseNames[rgb.slice(0, 3)];
385
+ };
386
+
387
+ // Helpers
388
+ function clamp(number_, min, max) {
389
+ return Math.min(Math.max(min, number_), max);
390
+ }
391
+
392
+ function hexDouble(number_) {
393
+ const string_ = Math.round(number_).toString(16).toUpperCase();
394
+ return (string_.length < 2) ? '0' + string_ : string_;
395
+ }
396
+
397
+ /* harmony default export */ const color_string = (cs);
398
+
399
+ ;// CONCATENATED MODULE: ../node_modules/color/node_modules/color-convert/conversions.js
400
+ /* MIT license */
401
+ /* eslint-disable no-mixed-operators */
402
+
403
+
404
+ // NOTE: conversions should only return primitive values (i.e. arrays, or
405
+ // values that give correct `typeof` results).
406
+ // do not use box values types (i.e. Number(), String(), etc.)
407
+
408
+ const reverseKeywords = {};
409
+ for (const key of Object.keys(color_name)) {
410
+ reverseKeywords[color_name[key]] = key;
411
+ }
412
+
413
+ const convert = {
414
+ rgb: {channels: 3, labels: 'rgb'},
415
+ hsl: {channels: 3, labels: 'hsl'},
416
+ hsv: {channels: 3, labels: 'hsv'},
417
+ hwb: {channels: 3, labels: 'hwb'},
418
+ cmyk: {channels: 4, labels: 'cmyk'},
419
+ xyz: {channels: 3, labels: 'xyz'},
420
+ lab: {channels: 3, labels: 'lab'},
421
+ oklab: {channels: 3, labels: ['okl', 'oka', 'okb']},
422
+ lch: {channels: 3, labels: 'lch'},
423
+ oklch: {channels: 3, labels: ['okl', 'okc', 'okh']},
424
+ hex: {channels: 1, labels: ['hex']},
425
+ keyword: {channels: 1, labels: ['keyword']},
426
+ ansi16: {channels: 1, labels: ['ansi16']},
427
+ ansi256: {channels: 1, labels: ['ansi256']},
428
+ hcg: {channels: 3, labels: ['h', 'c', 'g']},
429
+ apple: {channels: 3, labels: ['r16', 'g16', 'b16']},
430
+ gray: {channels: 1, labels: ['gray']},
431
+ };
432
+
433
+ /* harmony default export */ const conversions = (convert);
434
+
435
+ // LAB f(t) constant
436
+ const LAB_FT = (6 / 29) ** 3;
437
+
438
+ // SRGB non-linear transform functions
439
+ function srgbNonlinearTransform(c) {
440
+ const cc = c > 0.003_130_8
441
+ ? ((1.055 * (c ** (1 / 2.4))) - 0.055)
442
+ : c * 12.92;
443
+ return Math.min(Math.max(0, cc), 1);
444
+ }
445
+
446
+ function srgbNonlinearTransformInv(c) {
447
+ return c > 0.040_45 ? (((c + 0.055) / 1.055) ** 2.4) : (c / 12.92);
448
+ }
449
+
450
+ // Hide .channels and .labels properties
451
+ for (const model of Object.keys(convert)) {
452
+ if (!('channels' in convert[model])) {
453
+ throw new Error('missing channels property: ' + model);
454
+ }
455
+
456
+ if (!('labels' in convert[model])) {
457
+ throw new Error('missing channel labels property: ' + model);
458
+ }
459
+
460
+ if (convert[model].labels.length !== convert[model].channels) {
461
+ throw new Error('channel and label counts mismatch: ' + model);
462
+ }
463
+
464
+ const {channels, labels} = convert[model];
465
+ delete convert[model].channels;
466
+ delete convert[model].labels;
467
+ Object.defineProperty(convert[model], 'channels', {value: channels});
468
+ Object.defineProperty(convert[model], 'labels', {value: labels});
469
+ }
470
+
471
+ convert.rgb.hsl = function (rgb) {
472
+ const r = rgb[0] / 255;
473
+ const g = rgb[1] / 255;
474
+ const b = rgb[2] / 255;
475
+ const min = Math.min(r, g, b);
476
+ const max = Math.max(r, g, b);
477
+ const delta = max - min;
478
+ let h;
479
+ let s;
480
+
481
+ switch (max) {
482
+ case min: {
483
+ h = 0;
484
+
485
+ break;
486
+ }
487
+
488
+ case r: {
489
+ h = (g - b) / delta;
490
+
491
+ break;
492
+ }
493
+
494
+ case g: {
495
+ h = 2 + (b - r) / delta;
496
+
497
+ break;
498
+ }
499
+
500
+ case b: {
501
+ h = 4 + (r - g) / delta;
502
+
503
+ break;
504
+ }
505
+ // No default
506
+ }
507
+
508
+ h = Math.min(h * 60, 360);
509
+
510
+ if (h < 0) {
511
+ h += 360;
512
+ }
513
+
514
+ const l = (min + max) / 2;
515
+
516
+ if (max === min) {
517
+ s = 0;
518
+ } else if (l <= 0.5) {
519
+ s = delta / (max + min);
520
+ } else {
521
+ s = delta / (2 - max - min);
522
+ }
523
+
524
+ return [h, s * 100, l * 100];
525
+ };
526
+
527
+ convert.rgb.hsv = function (rgb) {
528
+ let rdif;
529
+ let gdif;
530
+ let bdif;
531
+ let h;
532
+ let s;
533
+
534
+ const r = rgb[0] / 255;
535
+ const g = rgb[1] / 255;
536
+ const b = rgb[2] / 255;
537
+ const v = Math.max(r, g, b);
538
+ const diff = v - Math.min(r, g, b);
539
+ const diffc = function (c) {
540
+ return (v - c) / 6 / diff + 1 / 2;
541
+ };
542
+
543
+ if (diff === 0) {
544
+ h = 0;
545
+ s = 0;
546
+ } else {
547
+ s = diff / v;
548
+ rdif = diffc(r);
549
+ gdif = diffc(g);
550
+ bdif = diffc(b);
551
+
552
+ switch (v) {
553
+ case r: {
554
+ h = bdif - gdif;
555
+
556
+ break;
557
+ }
558
+
559
+ case g: {
560
+ h = (1 / 3) + rdif - bdif;
561
+
562
+ break;
563
+ }
564
+
565
+ case b: {
566
+ h = (2 / 3) + gdif - rdif;
567
+
568
+ break;
569
+ }
570
+ // No default
571
+ }
572
+
573
+ if (h < 0) {
574
+ h += 1;
575
+ } else if (h > 1) {
576
+ h -= 1;
577
+ }
578
+ }
579
+
580
+ return [
581
+ h * 360,
582
+ s * 100,
583
+ v * 100,
584
+ ];
585
+ };
586
+
587
+ convert.rgb.hwb = function (rgb) {
588
+ const r = rgb[0];
589
+ const g = rgb[1];
590
+ let b = rgb[2];
591
+ const h = convert.rgb.hsl(rgb)[0];
592
+ const w = 1 / 255 * Math.min(r, Math.min(g, b));
593
+
594
+ b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
595
+
596
+ return [h, w * 100, b * 100];
597
+ };
598
+
599
+ convert.rgb.oklab = function (rgb) {
600
+ // Assume sRGB
601
+ const r = srgbNonlinearTransformInv(rgb[0] / 255);
602
+ const g = srgbNonlinearTransformInv(rgb[1] / 255);
603
+ const b = srgbNonlinearTransformInv(rgb[2] / 255);
604
+
605
+ const lp = Math.cbrt(0.412_221_470_8 * r + 0.536_332_536_3 * g + 0.051_445_992_9 * b);
606
+ const mp = Math.cbrt(0.211_903_498_2 * r + 0.680_699_545_1 * g + 0.107_396_956_6 * b);
607
+ const sp = Math.cbrt(0.088_302_461_9 * r + 0.281_718_837_6 * g + 0.629_978_700_5 * b);
608
+
609
+ const l = 0.210_454_255_3 * lp + 0.793_617_785 * mp - 0.004_072_046_8 * sp;
610
+ const aa = 1.977_998_495_1 * lp - 2.428_592_205 * mp + 0.450_593_709_9 * sp;
611
+ const bb = 0.025_904_037_1 * lp + 0.782_771_766_2 * mp - 0.808_675_766 * sp;
612
+
613
+ return [l * 100, aa * 100, bb * 100];
614
+ };
615
+
616
+ convert.rgb.cmyk = function (rgb) {
617
+ const r = rgb[0] / 255;
618
+ const g = rgb[1] / 255;
619
+ const b = rgb[2] / 255;
620
+
621
+ const k = Math.min(1 - r, 1 - g, 1 - b);
622
+ const c = (1 - r - k) / (1 - k) || 0;
623
+ const m = (1 - g - k) / (1 - k) || 0;
624
+ const y = (1 - b - k) / (1 - k) || 0;
625
+
626
+ return [c * 100, m * 100, y * 100, k * 100];
627
+ };
628
+
629
+ function comparativeDistance(x, y) {
630
+ /*
631
+ See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance
632
+ */
633
+ return (
634
+ ((x[0] - y[0]) ** 2) +
635
+ ((x[1] - y[1]) ** 2) +
636
+ ((x[2] - y[2]) ** 2)
637
+ );
638
+ }
639
+
640
+ convert.rgb.keyword = function (rgb) {
641
+ const reversed = reverseKeywords[rgb];
642
+ if (reversed) {
643
+ return reversed;
644
+ }
645
+
646
+ let currentClosestDistance = Number.POSITIVE_INFINITY;
647
+ let currentClosestKeyword;
648
+
649
+ for (const keyword of Object.keys(color_name)) {
650
+ const value = color_name[keyword];
651
+
652
+ // Compute comparative distance
653
+ const distance = comparativeDistance(rgb, value);
654
+
655
+ // Check if its less, if so set as closest
656
+ if (distance < currentClosestDistance) {
657
+ currentClosestDistance = distance;
658
+ currentClosestKeyword = keyword;
659
+ }
660
+ }
661
+
662
+ return currentClosestKeyword;
663
+ };
664
+
665
+ convert.keyword.rgb = function (keyword) {
666
+ return color_name[keyword];
667
+ };
668
+
669
+ convert.rgb.xyz = function (rgb) {
670
+ // Assume sRGB
671
+ const r = srgbNonlinearTransformInv(rgb[0] / 255);
672
+ const g = srgbNonlinearTransformInv(rgb[1] / 255);
673
+ const b = srgbNonlinearTransformInv(rgb[2] / 255);
674
+
675
+ const x = (r * 0.412_456_4) + (g * 0.357_576_1) + (b * 0.180_437_5);
676
+ const y = (r * 0.212_672_9) + (g * 0.715_152_2) + (b * 0.072_175);
677
+ const z = (r * 0.019_333_9) + (g * 0.119_192) + (b * 0.950_304_1);
678
+
679
+ return [x * 100, y * 100, z * 100];
680
+ };
681
+
682
+ convert.rgb.lab = function (rgb) {
683
+ const xyz = convert.rgb.xyz(rgb);
684
+ let x = xyz[0];
685
+ let y = xyz[1];
686
+ let z = xyz[2];
687
+
688
+ x /= 95.047;
689
+ y /= 100;
690
+ z /= 108.883;
691
+
692
+ x = x > LAB_FT ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116);
693
+ y = y > LAB_FT ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116);
694
+ z = z > LAB_FT ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116);
695
+
696
+ const l = (116 * y) - 16;
697
+ const a = 500 * (x - y);
698
+ const b = 200 * (y - z);
699
+
700
+ return [l, a, b];
701
+ };
702
+
703
+ convert.hsl.rgb = function (hsl) {
704
+ const h = hsl[0] / 360;
705
+ const s = hsl[1] / 100;
706
+ const l = hsl[2] / 100;
707
+ let t3;
708
+ let value;
709
+
710
+ if (s === 0) {
711
+ value = l * 255;
712
+ return [value, value, value];
713
+ }
714
+
715
+ const t2 = l < 0.5 ? l * (1 + s) : l + s - l * s;
716
+
717
+ const t1 = 2 * l - t2;
718
+
719
+ const rgb = [0, 0, 0];
720
+ for (let i = 0; i < 3; i++) {
721
+ t3 = h + 1 / 3 * -(i - 1);
722
+ if (t3 < 0) {
723
+ t3++;
724
+ }
725
+
726
+ if (t3 > 1) {
727
+ t3--;
728
+ }
729
+
730
+ if (6 * t3 < 1) {
731
+ value = t1 + (t2 - t1) * 6 * t3;
732
+ } else if (2 * t3 < 1) {
733
+ value = t2;
734
+ } else if (3 * t3 < 2) {
735
+ value = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
736
+ } else {
737
+ value = t1;
738
+ }
739
+
740
+ rgb[i] = value * 255;
741
+ }
742
+
743
+ return rgb;
744
+ };
745
+
746
+ convert.hsl.hsv = function (hsl) {
747
+ const h = hsl[0];
748
+ let s = hsl[1] / 100;
749
+ let l = hsl[2] / 100;
750
+ let smin = s;
751
+ const lmin = Math.max(l, 0.01);
752
+
753
+ l *= 2;
754
+ s *= (l <= 1) ? l : 2 - l;
755
+ smin *= lmin <= 1 ? lmin : 2 - lmin;
756
+ const v = (l + s) / 2;
757
+ const sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s);
758
+
759
+ return [h, sv * 100, v * 100];
760
+ };
761
+
762
+ convert.hsv.rgb = function (hsv) {
763
+ const h = hsv[0] / 60;
764
+ const s = hsv[1] / 100;
765
+ let v = hsv[2] / 100;
766
+ const hi = Math.floor(h) % 6;
767
+
768
+ const f = h - Math.floor(h);
769
+ const p = 255 * v * (1 - s);
770
+ const q = 255 * v * (1 - (s * f));
771
+ const t = 255 * v * (1 - (s * (1 - f)));
772
+ v *= 255;
773
+
774
+ switch (hi) {
775
+ case 0: {
776
+ return [v, t, p];
777
+ }
778
+
779
+ case 1: {
780
+ return [q, v, p];
781
+ }
782
+
783
+ case 2: {
784
+ return [p, v, t];
785
+ }
786
+
787
+ case 3: {
788
+ return [p, q, v];
789
+ }
790
+
791
+ case 4: {
792
+ return [t, p, v];
793
+ }
794
+
795
+ case 5: {
796
+ return [v, p, q];
797
+ }
798
+ }
799
+ };
800
+
801
+ convert.hsv.hsl = function (hsv) {
802
+ const h = hsv[0];
803
+ const s = hsv[1] / 100;
804
+ const v = hsv[2] / 100;
805
+ const vmin = Math.max(v, 0.01);
806
+ let sl;
807
+ let l;
808
+
809
+ l = (2 - s) * v;
810
+ const lmin = (2 - s) * vmin;
811
+ sl = s * vmin;
812
+ sl /= (lmin <= 1) ? lmin : 2 - lmin;
813
+ sl = sl || 0;
814
+ l /= 2;
815
+
816
+ return [h, sl * 100, l * 100];
817
+ };
818
+
819
+ // http://dev.w3.org/csswg/css-color/#hwb-to-rgb
820
+ convert.hwb.rgb = function (hwb) {
821
+ const h = hwb[0] / 360;
822
+ let wh = hwb[1] / 100;
823
+ let bl = hwb[2] / 100;
824
+ const ratio = wh + bl;
825
+ let f;
826
+
827
+ // Wh + bl cant be > 1
828
+ if (ratio > 1) {
829
+ wh /= ratio;
830
+ bl /= ratio;
831
+ }
832
+
833
+ const i = Math.floor(6 * h);
834
+ const v = 1 - bl;
835
+ f = 6 * h - i;
836
+
837
+ // eslint-disable-next-line no-bitwise
838
+ if ((i & 0x01) !== 0) {
839
+ f = 1 - f;
840
+ }
841
+
842
+ const n = wh + f * (v - wh); // Linear interpolation
843
+
844
+ let r;
845
+ let g;
846
+ let b;
847
+ /* eslint-disable max-statements-per-line,no-multi-spaces, default-case-last */
848
+ switch (i) {
849
+ default:
850
+ case 6:
851
+ case 0: { r = v; g = n; b = wh; break;
852
+ }
853
+
854
+ case 1: { r = n; g = v; b = wh; break;
855
+ }
856
+
857
+ case 2: { r = wh; g = v; b = n; break;
858
+ }
859
+
860
+ case 3: { r = wh; g = n; b = v; break;
861
+ }
862
+
863
+ case 4: { r = n; g = wh; b = v; break;
864
+ }
865
+
866
+ case 5: { r = v; g = wh; b = n; break;
867
+ }
868
+ }
869
+ /* eslint-enable max-statements-per-line,no-multi-spaces, default-case-last */
870
+
871
+ return [r * 255, g * 255, b * 255];
872
+ };
873
+
874
+ convert.cmyk.rgb = function (cmyk) {
875
+ const c = cmyk[0] / 100;
876
+ const m = cmyk[1] / 100;
877
+ const y = cmyk[2] / 100;
878
+ const k = cmyk[3] / 100;
879
+
880
+ const r = 1 - Math.min(1, c * (1 - k) + k);
881
+ const g = 1 - Math.min(1, m * (1 - k) + k);
882
+ const b = 1 - Math.min(1, y * (1 - k) + k);
883
+
884
+ return [r * 255, g * 255, b * 255];
885
+ };
886
+
887
+ convert.xyz.rgb = function (xyz) {
888
+ const x = xyz[0] / 100;
889
+ const y = xyz[1] / 100;
890
+ const z = xyz[2] / 100;
891
+ let r;
892
+ let g;
893
+ let b;
894
+
895
+ r = (x * 3.240_454_2) + (y * -1.537_138_5) + (z * -0.498_531_4);
896
+ g = (x * -0.969_266) + (y * 1.876_010_8) + (z * 0.041_556);
897
+ b = (x * 0.055_643_4) + (y * -0.204_025_9) + (z * 1.057_225_2);
898
+
899
+ // Assume sRGB
900
+ r = srgbNonlinearTransform(r);
901
+ g = srgbNonlinearTransform(g);
902
+ b = srgbNonlinearTransform(b);
903
+
904
+ return [r * 255, g * 255, b * 255];
905
+ };
906
+
907
+ convert.xyz.lab = function (xyz) {
908
+ let x = xyz[0];
909
+ let y = xyz[1];
910
+ let z = xyz[2];
911
+
912
+ x /= 95.047;
913
+ y /= 100;
914
+ z /= 108.883;
915
+
916
+ x = x > LAB_FT ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116);
917
+ y = y > LAB_FT ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116);
918
+ z = z > LAB_FT ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116);
919
+
920
+ const l = (116 * y) - 16;
921
+ const a = 500 * (x - y);
922
+ const b = 200 * (y - z);
923
+
924
+ return [l, a, b];
925
+ };
926
+
927
+ convert.xyz.oklab = function (xyz) {
928
+ const x = xyz[0] / 100;
929
+ const y = xyz[1] / 100;
930
+ const z = xyz[2] / 100;
931
+
932
+ const lp = Math.cbrt(0.818_933_010_1 * x + 0.361_866_742_4 * y - 0.128_859_713_7 * z);
933
+ const mp = Math.cbrt(0.032_984_543_6 * x + 0.929_311_871_5 * y + 0.036_145_638_7 * z);
934
+ const sp = Math.cbrt(0.048_200_301_8 * x + 0.264_366_269_1 * y + 0.633_851_707 * z);
935
+
936
+ const l = 0.210_454_255_3 * lp + 0.793_617_785 * mp - 0.004_072_046_8 * sp;
937
+ const a = 1.977_998_495_1 * lp - 2.428_592_205 * mp + 0.450_593_709_9 * sp;
938
+ const b = 0.025_904_037_1 * lp + 0.782_771_766_2 * mp - 0.808_675_766 * sp;
939
+
940
+ return [l * 100, a * 100, b * 100];
941
+ };
942
+
943
+ convert.oklab.oklch = function (oklab) {
944
+ return convert.lab.lch(oklab);
945
+ };
946
+
947
+ convert.oklab.xyz = function (oklab) {
948
+ const ll = oklab[0] / 100;
949
+ const a = oklab[1] / 100;
950
+ const b = oklab[2] / 100;
951
+
952
+ const l = (0.999_999_998 * ll + 0.396_337_792 * a + 0.215_803_758 * b) ** 3;
953
+ const m = (1.000_000_008 * ll - 0.105_561_342 * a - 0.063_854_175 * b) ** 3;
954
+ const s = (1.000_000_055 * ll - 0.089_484_182 * a - 1.291_485_538 * b) ** 3;
955
+
956
+ const x = 1.227_013_851 * l - 0.557_799_98 * m + 0.281_256_149 * s;
957
+ const y = -0.040_580_178 * l + 1.112_256_87 * m - 0.071_676_679 * s;
958
+ const z = -0.076_381_285 * l - 0.421_481_978 * m + 1.586_163_22 * s;
959
+
960
+ return [x * 100, y * 100, z * 100];
961
+ };
962
+
963
+ convert.oklab.rgb = function (oklab) {
964
+ const ll = oklab[0] / 100;
965
+ const aa = oklab[1] / 100;
966
+ const bb = oklab[2] / 100;
967
+
968
+ const l = (ll + 0.396_337_777_4 * aa + 0.215_803_757_3 * bb) ** 3;
969
+ const m = (ll - 0.105_561_345_8 * aa - 0.063_854_172_8 * bb) ** 3;
970
+ const s = (ll - 0.089_484_177_5 * aa - 1.291_485_548 * bb) ** 3;
971
+
972
+ // Assume sRGB
973
+ const r = srgbNonlinearTransform(4.076_741_662_1 * l - 3.307_711_591_3 * m + 0.230_969_929_2 * s);
974
+ const g = srgbNonlinearTransform(-1.268_438_004_6 * l + 2.609_757_401_1 * m - 0.341_319_396_5 * s);
975
+ const b = srgbNonlinearTransform(-0.004_196_086_3 * l - 0.703_418_614_7 * m + 1.707_614_701 * s);
976
+
977
+ return [r * 255, g * 255, b * 255];
978
+ };
979
+
980
+ convert.oklch.oklab = function (oklch) {
981
+ return convert.lch.lab(oklch);
982
+ };
983
+
984
+ convert.lab.xyz = function (lab) {
985
+ const l = lab[0];
986
+ const a = lab[1];
987
+ const b = lab[2];
988
+ let x;
989
+ let y;
990
+ let z;
991
+
992
+ y = (l + 16) / 116;
993
+ x = a / 500 + y;
994
+ z = y - b / 200;
995
+
996
+ const y2 = y ** 3;
997
+ const x2 = x ** 3;
998
+ const z2 = z ** 3;
999
+ y = y2 > LAB_FT ? y2 : (y - 16 / 116) / 7.787;
1000
+ x = x2 > LAB_FT ? x2 : (x - 16 / 116) / 7.787;
1001
+ z = z2 > LAB_FT ? z2 : (z - 16 / 116) / 7.787;
1002
+
1003
+ // Illuminant D65 XYZ Tristrimulus Values
1004
+ // https://en.wikipedia.org/wiki/CIE_1931_color_space
1005
+ x *= 95.047;
1006
+ y *= 100;
1007
+ z *= 108.883;
1008
+
1009
+ return [x, y, z];
1010
+ };
1011
+
1012
+ convert.lab.lch = function (lab) {
1013
+ const l = lab[0];
1014
+ const a = lab[1];
1015
+ const b = lab[2];
1016
+ let h;
1017
+
1018
+ const hr = Math.atan2(b, a);
1019
+ h = hr * 360 / 2 / Math.PI;
1020
+
1021
+ if (h < 0) {
1022
+ h += 360;
1023
+ }
1024
+
1025
+ const c = Math.sqrt(a * a + b * b);
1026
+
1027
+ return [l, c, h];
1028
+ };
1029
+
1030
+ convert.lch.lab = function (lch) {
1031
+ const l = lch[0];
1032
+ const c = lch[1];
1033
+ const h = lch[2];
1034
+
1035
+ const hr = h / 360 * 2 * Math.PI;
1036
+ const a = c * Math.cos(hr);
1037
+ const b = c * Math.sin(hr);
1038
+
1039
+ return [l, a, b];
1040
+ };
1041
+
1042
+ convert.rgb.ansi16 = function (args, saturation = null) {
1043
+ const [r, g, b] = args;
1044
+ let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation; // Hsv -> ansi16 optimization
1045
+
1046
+ value = Math.round(value / 50);
1047
+
1048
+ if (value === 0) {
1049
+ return 30;
1050
+ }
1051
+
1052
+ let ansi = 30
1053
+ /* eslint-disable no-bitwise */
1054
+ + ((Math.round(b / 255) << 2)
1055
+ | (Math.round(g / 255) << 1)
1056
+ | Math.round(r / 255));
1057
+ /* eslint-enable no-bitwise */
1058
+
1059
+ if (value === 2) {
1060
+ ansi += 60;
1061
+ }
1062
+
1063
+ return ansi;
1064
+ };
1065
+
1066
+ convert.hsv.ansi16 = function (args) {
1067
+ // Optimization here; we already know the value and don't need to get
1068
+ // it converted for us.
1069
+ return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
1070
+ };
1071
+
1072
+ convert.rgb.ansi256 = function (args) {
1073
+ const r = args[0];
1074
+ const g = args[1];
1075
+ const b = args[2];
1076
+
1077
+ // We use the extended greyscale palette here, with the exception of
1078
+ // black and white. normal palette only has 4 greyscale shades.
1079
+ // eslint-disable-next-line no-bitwise
1080
+ if (r >> 4 === g >> 4 && g >> 4 === b >> 4) {
1081
+ if (r < 8) {
1082
+ return 16;
1083
+ }
1084
+
1085
+ if (r > 248) {
1086
+ return 231;
1087
+ }
1088
+
1089
+ return Math.round(((r - 8) / 247) * 24) + 232;
1090
+ }
1091
+
1092
+ const ansi = 16
1093
+ + (36 * Math.round(r / 255 * 5))
1094
+ + (6 * Math.round(g / 255 * 5))
1095
+ + Math.round(b / 255 * 5);
1096
+
1097
+ return ansi;
1098
+ };
1099
+
1100
+ convert.ansi16.rgb = function (args) {
1101
+ args = args[0];
1102
+
1103
+ let color = args % 10;
1104
+
1105
+ // Handle greyscale
1106
+ if (color === 0 || color === 7) {
1107
+ if (args > 50) {
1108
+ color += 3.5;
1109
+ }
1110
+
1111
+ color = color / 10.5 * 255;
1112
+
1113
+ return [color, color, color];
1114
+ }
1115
+
1116
+ const mult = (Math.trunc(args > 50) + 1) * 0.5;
1117
+ /* eslint-disable no-bitwise */
1118
+ const r = ((color & 1) * mult) * 255;
1119
+ const g = (((color >> 1) & 1) * mult) * 255;
1120
+ const b = (((color >> 2) & 1) * mult) * 255;
1121
+ /* eslint-enable no-bitwise */
1122
+
1123
+ return [r, g, b];
1124
+ };
1125
+
1126
+ convert.ansi256.rgb = function (args) {
1127
+ args = args[0];
1128
+
1129
+ // Handle greyscale
1130
+ if (args >= 232) {
1131
+ const c = (args - 232) * 10 + 8;
1132
+ return [c, c, c];
1133
+ }
1134
+
1135
+ args -= 16;
1136
+
1137
+ let rem;
1138
+ const r = Math.floor(args / 36) / 5 * 255;
1139
+ const g = Math.floor((rem = args % 36) / 6) / 5 * 255;
1140
+ const b = (rem % 6) / 5 * 255;
1141
+
1142
+ return [r, g, b];
1143
+ };
1144
+
1145
+ convert.rgb.hex = function (args) {
1146
+ /* eslint-disable no-bitwise */
1147
+ const integer = ((Math.round(args[0]) & 0xFF) << 16)
1148
+ + ((Math.round(args[1]) & 0xFF) << 8)
1149
+ + (Math.round(args[2]) & 0xFF);
1150
+ /* eslint-enable no-bitwise */
1151
+
1152
+ const string = integer.toString(16).toUpperCase();
1153
+ return '000000'.slice(string.length) + string;
1154
+ };
1155
+
1156
+ convert.hex.rgb = function (args) {
1157
+ const match = args.toString(16).match(/[a-f\d]{6}|[a-f\d]{3}/i);
1158
+ if (!match) {
1159
+ return [0, 0, 0];
1160
+ }
1161
+
1162
+ let colorString = match[0];
1163
+
1164
+ if (match[0].length === 3) {
1165
+ colorString = [...colorString].map(char => char + char).join('');
1166
+ }
1167
+
1168
+ const integer = Number.parseInt(colorString, 16);
1169
+ /* eslint-disable no-bitwise */
1170
+ const r = (integer >> 16) & 0xFF;
1171
+ const g = (integer >> 8) & 0xFF;
1172
+ const b = integer & 0xFF;
1173
+ /* eslint-enable no-bitwise */
1174
+
1175
+ return [r, g, b];
1176
+ };
1177
+
1178
+ convert.rgb.hcg = function (rgb) {
1179
+ const r = rgb[0] / 255;
1180
+ const g = rgb[1] / 255;
1181
+ const b = rgb[2] / 255;
1182
+ const max = Math.max(Math.max(r, g), b);
1183
+ const min = Math.min(Math.min(r, g), b);
1184
+ const chroma = (max - min);
1185
+ let hue;
1186
+
1187
+ const grayscale = chroma < 1 ? min / (1 - chroma) : 0;
1188
+
1189
+ if (chroma <= 0) {
1190
+ hue = 0;
1191
+ } else if (max === r) {
1192
+ hue = ((g - b) / chroma) % 6;
1193
+ } else if (max === g) {
1194
+ hue = 2 + (b - r) / chroma;
1195
+ } else {
1196
+ hue = 4 + (r - g) / chroma;
1197
+ }
1198
+
1199
+ hue /= 6;
1200
+ hue %= 1;
1201
+
1202
+ return [hue * 360, chroma * 100, grayscale * 100];
1203
+ };
1204
+
1205
+ convert.hsl.hcg = function (hsl) {
1206
+ const s = hsl[1] / 100;
1207
+ const l = hsl[2] / 100;
1208
+
1209
+ const c = l < 0.5 ? (2 * s * l) : (2 * s * (1 - l));
1210
+
1211
+ let f = 0;
1212
+ if (c < 1) {
1213
+ f = (l - 0.5 * c) / (1 - c);
1214
+ }
1215
+
1216
+ return [hsl[0], c * 100, f * 100];
1217
+ };
1218
+
1219
+ convert.hsv.hcg = function (hsv) {
1220
+ const s = hsv[1] / 100;
1221
+ const v = hsv[2] / 100;
1222
+
1223
+ const c = s * v;
1224
+ let f = 0;
1225
+
1226
+ if (c < 1) {
1227
+ f = (v - c) / (1 - c);
1228
+ }
1229
+
1230
+ return [hsv[0], c * 100, f * 100];
1231
+ };
1232
+
1233
+ convert.hcg.rgb = function (hcg) {
1234
+ const h = hcg[0] / 360;
1235
+ const c = hcg[1] / 100;
1236
+ const g = hcg[2] / 100;
1237
+
1238
+ if (c === 0) {
1239
+ return [g * 255, g * 255, g * 255];
1240
+ }
1241
+
1242
+ const pure = [0, 0, 0];
1243
+ const hi = (h % 1) * 6;
1244
+ const v = hi % 1;
1245
+ const w = 1 - v;
1246
+ let mg = 0;
1247
+
1248
+ /* eslint-disable max-statements-per-line */
1249
+ switch (Math.floor(hi)) {
1250
+ case 0: {
1251
+ pure[0] = 1; pure[1] = v; pure[2] = 0; break;
1252
+ }
1253
+
1254
+ case 1: {
1255
+ pure[0] = w; pure[1] = 1; pure[2] = 0; break;
1256
+ }
1257
+
1258
+ case 2: {
1259
+ pure[0] = 0; pure[1] = 1; pure[2] = v; break;
1260
+ }
1261
+
1262
+ case 3: {
1263
+ pure[0] = 0; pure[1] = w; pure[2] = 1; break;
1264
+ }
1265
+
1266
+ case 4: {
1267
+ pure[0] = v; pure[1] = 0; pure[2] = 1; break;
1268
+ }
1269
+
1270
+ default: {
1271
+ pure[0] = 1; pure[1] = 0; pure[2] = w;
1272
+ }
1273
+ }
1274
+ /* eslint-enable max-statements-per-line */
1275
+
1276
+ mg = (1 - c) * g;
1277
+
1278
+ return [
1279
+ (c * pure[0] + mg) * 255,
1280
+ (c * pure[1] + mg) * 255,
1281
+ (c * pure[2] + mg) * 255,
1282
+ ];
1283
+ };
1284
+
1285
+ convert.hcg.hsv = function (hcg) {
1286
+ const c = hcg[1] / 100;
1287
+ const g = hcg[2] / 100;
1288
+
1289
+ const v = c + g * (1 - c);
1290
+ let f = 0;
1291
+
1292
+ if (v > 0) {
1293
+ f = c / v;
1294
+ }
1295
+
1296
+ return [hcg[0], f * 100, v * 100];
1297
+ };
1298
+
1299
+ convert.hcg.hsl = function (hcg) {
1300
+ const c = hcg[1] / 100;
1301
+ const g = hcg[2] / 100;
1302
+
1303
+ const l = g * (1 - c) + 0.5 * c;
1304
+ let s = 0;
1305
+
1306
+ if (l > 0 && l < 0.5) {
1307
+ s = c / (2 * l);
1308
+ } else if (l >= 0.5 && l < 1) {
1309
+ s = c / (2 * (1 - l));
1310
+ }
1311
+
1312
+ return [hcg[0], s * 100, l * 100];
1313
+ };
1314
+
1315
+ convert.hcg.hwb = function (hcg) {
1316
+ const c = hcg[1] / 100;
1317
+ const g = hcg[2] / 100;
1318
+ const v = c + g * (1 - c);
1319
+ return [hcg[0], (v - c) * 100, (1 - v) * 100];
1320
+ };
1321
+
1322
+ convert.hwb.hcg = function (hwb) {
1323
+ const w = hwb[1] / 100;
1324
+ const b = hwb[2] / 100;
1325
+ const v = 1 - b;
1326
+ const c = v - w;
1327
+ let g = 0;
1328
+
1329
+ if (c < 1) {
1330
+ g = (v - c) / (1 - c);
1331
+ }
1332
+
1333
+ return [hwb[0], c * 100, g * 100];
1334
+ };
1335
+
1336
+ convert.apple.rgb = function (apple) {
1337
+ return [(apple[0] / 65_535) * 255, (apple[1] / 65_535) * 255, (apple[2] / 65_535) * 255];
1338
+ };
1339
+
1340
+ convert.rgb.apple = function (rgb) {
1341
+ return [(rgb[0] / 255) * 65_535, (rgb[1] / 255) * 65_535, (rgb[2] / 255) * 65_535];
1342
+ };
1343
+
1344
+ convert.gray.rgb = function (args) {
1345
+ return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
1346
+ };
1347
+
1348
+ convert.gray.hsl = function (args) {
1349
+ return [0, 0, args[0]];
1350
+ };
1351
+
1352
+ convert.gray.hsv = convert.gray.hsl;
1353
+
1354
+ convert.gray.hwb = function (gray) {
1355
+ return [0, 100, gray[0]];
1356
+ };
1357
+
1358
+ convert.gray.cmyk = function (gray) {
1359
+ return [0, 0, 0, gray[0]];
1360
+ };
1361
+
1362
+ convert.gray.lab = function (gray) {
1363
+ return [gray[0], 0, 0];
1364
+ };
1365
+
1366
+ convert.gray.hex = function (gray) {
1367
+ /* eslint-disable no-bitwise */
1368
+ const value = Math.round(gray[0] / 100 * 255) & 0xFF;
1369
+ const integer = (value << 16) + (value << 8) + value;
1370
+ /* eslint-enable no-bitwise */
1371
+
1372
+ const string = integer.toString(16).toUpperCase();
1373
+ return '000000'.slice(string.length) + string;
1374
+ };
1375
+
1376
+ convert.rgb.gray = function (rgb) {
1377
+ const value = (rgb[0] + rgb[1] + rgb[2]) / 3;
1378
+ return [value / 255 * 100];
1379
+ };
1380
+
1381
+ ;// CONCATENATED MODULE: ../node_modules/color/node_modules/color-convert/route.js
1382
+
1383
+
1384
+ /*
1385
+ This function routes a model to all other models.
1386
+
1387
+ all functions that are routed have a property `.conversion` attached
1388
+ to the returned synthetic function. This property is an array
1389
+ of strings, each with the steps in between the 'from' and 'to'
1390
+ color models (inclusive).
1391
+
1392
+ conversions that are not possible simply are not included.
1393
+ */
1394
+
1395
+ function buildGraph() {
1396
+ const graph = {};
1397
+ // https://jsperf.com/object-keys-vs-for-in-with-closure/3
1398
+ const models = Object.keys(conversions);
1399
+
1400
+ for (let {length} = models, i = 0; i < length; i++) {
1401
+ graph[models[i]] = {
1402
+ // http://jsperf.com/1-vs-infinity
1403
+ // micro-opt, but this is simple.
1404
+ distance: -1,
1405
+ parent: null,
1406
+ };
1407
+ }
1408
+
1409
+ return graph;
1410
+ }
1411
+
1412
+ // https://en.wikipedia.org/wiki/Breadth-first_search
1413
+ function deriveBFS(fromModel) {
1414
+ const graph = buildGraph();
1415
+ const queue = [fromModel]; // Unshift -> queue -> pop
1416
+
1417
+ graph[fromModel].distance = 0;
1418
+
1419
+ while (queue.length > 0) {
1420
+ const current = queue.pop();
1421
+ const adjacents = Object.keys(conversions[current]);
1422
+
1423
+ for (let {length} = adjacents, i = 0; i < length; i++) {
1424
+ const adjacent = adjacents[i];
1425
+ const node = graph[adjacent];
1426
+
1427
+ if (node.distance === -1) {
1428
+ node.distance = graph[current].distance + 1;
1429
+ node.parent = current;
1430
+ queue.unshift(adjacent);
1431
+ }
1432
+ }
1433
+ }
1434
+
1435
+ return graph;
1436
+ }
1437
+
1438
+ function route_link(from, to) {
1439
+ return function (args) {
1440
+ return to(from(args));
1441
+ };
1442
+ }
1443
+
1444
+ function wrapConversion(toModel, graph) {
1445
+ const path = [graph[toModel].parent, toModel];
1446
+ let fn = conversions[graph[toModel].parent][toModel];
1447
+
1448
+ let cur = graph[toModel].parent;
1449
+ while (graph[cur].parent) {
1450
+ path.unshift(graph[cur].parent);
1451
+ fn = route_link(conversions[graph[cur].parent][cur], fn);
1452
+ cur = graph[cur].parent;
1453
+ }
1454
+
1455
+ fn.conversion = path;
1456
+ return fn;
1457
+ }
1458
+
1459
+ function route(fromModel) {
1460
+ const graph = deriveBFS(fromModel);
1461
+ const conversion = {};
1462
+
1463
+ const models = Object.keys(graph);
1464
+ for (let {length} = models, i = 0; i < length; i++) {
1465
+ const toModel = models[i];
1466
+ const node = graph[toModel];
1467
+
1468
+ if (node.parent === null) {
1469
+ // No possible conversion, or this node is the source model.
1470
+ continue;
1471
+ }
1472
+
1473
+ conversion[toModel] = wrapConversion(toModel, graph);
1474
+ }
1475
+
1476
+ return conversion;
1477
+ }
1478
+
1479
+ /* harmony default export */ const color_convert_route = (route);
1480
+
1481
+ ;// CONCATENATED MODULE: ../node_modules/color/node_modules/color-convert/index.js
1482
+
1483
+
1484
+
1485
+ const color_convert_convert = {};
1486
+
1487
+ const models = Object.keys(conversions);
1488
+
1489
+ function wrapRaw(fn) {
1490
+ const wrappedFn = function (...args) {
1491
+ const arg0 = args[0];
1492
+ if (arg0 === undefined || arg0 === null) {
1493
+ return arg0;
1494
+ }
1495
+
1496
+ if (arg0.length > 1) {
1497
+ args = arg0;
1498
+ }
1499
+
1500
+ return fn(args);
1501
+ };
1502
+
1503
+ // Preserve .conversion property if there is one
1504
+ if ('conversion' in fn) {
1505
+ wrappedFn.conversion = fn.conversion;
1506
+ }
1507
+
1508
+ return wrappedFn;
1509
+ }
1510
+
1511
+ function wrapRounded(fn) {
1512
+ const wrappedFn = function (...args) {
1513
+ const arg0 = args[0];
1514
+
1515
+ if (arg0 === undefined || arg0 === null) {
1516
+ return arg0;
1517
+ }
1518
+
1519
+ if (arg0.length > 1) {
1520
+ args = arg0;
1521
+ }
1522
+
1523
+ const result = fn(args);
1524
+
1525
+ // We're assuming the result is an array here.
1526
+ // see notice in conversions.js; don't use box types
1527
+ // in conversion functions.
1528
+ if (typeof result === 'object') {
1529
+ for (let {length} = result, i = 0; i < length; i++) {
1530
+ result[i] = Math.round(result[i]);
1531
+ }
1532
+ }
1533
+
1534
+ return result;
1535
+ };
1536
+
1537
+ // Preserve .conversion property if there is one
1538
+ if ('conversion' in fn) {
1539
+ wrappedFn.conversion = fn.conversion;
1540
+ }
1541
+
1542
+ return wrappedFn;
1543
+ }
1544
+
1545
+ for (const fromModel of models) {
1546
+ color_convert_convert[fromModel] = {};
1547
+
1548
+ Object.defineProperty(color_convert_convert[fromModel], 'channels', {value: conversions[fromModel].channels});
1549
+ Object.defineProperty(color_convert_convert[fromModel], 'labels', {value: conversions[fromModel].labels});
1550
+
1551
+ const routes = color_convert_route(fromModel);
1552
+ const routeModels = Object.keys(routes);
1553
+
1554
+ for (const toModel of routeModels) {
1555
+ const fn = routes[toModel];
1556
+
1557
+ color_convert_convert[fromModel][toModel] = wrapRounded(fn);
1558
+ color_convert_convert[fromModel][toModel].raw = wrapRaw(fn);
1559
+ }
1560
+ }
1561
+
1562
+ /* harmony default export */ const color_convert = (color_convert_convert);
1563
+
1564
+ ;// CONCATENATED MODULE: ../node_modules/color/index.js
1565
+
1566
+
1567
+
1568
+ const skippedModels = [
1569
+ // To be honest, I don't really feel like keyword belongs in color convert, but eh.
1570
+ 'keyword',
1571
+
1572
+ // Gray conflicts with some method names, and has its own method defined.
1573
+ 'gray',
1574
+
1575
+ // Shouldn't really be in color-convert either...
1576
+ 'hex',
1577
+ ];
1578
+
1579
+ const hashedModelKeys = {};
1580
+ for (const model of Object.keys(color_convert)) {
1581
+ hashedModelKeys[[...color_convert[model].labels].sort().join('')] = model;
1582
+ }
1583
+
1584
+ const limiters = {};
1585
+
1586
+ function Color(object, model) {
1587
+ if (!(this instanceof Color)) {
1588
+ return new Color(object, model);
1589
+ }
1590
+
1591
+ if (model && model in skippedModels) {
1592
+ model = null;
1593
+ }
1594
+
1595
+ if (model && !(model in color_convert)) {
1596
+ throw new Error('Unknown model: ' + model);
1597
+ }
1598
+
1599
+ let i;
1600
+ let channels;
1601
+
1602
+ if (object == null) { // eslint-disable-line no-eq-null,eqeqeq
1603
+ this.model = 'rgb';
1604
+ this.color = [0, 0, 0];
1605
+ this.valpha = 1;
1606
+ } else if (object instanceof Color) {
1607
+ this.model = object.model;
1608
+ this.color = [...object.color];
1609
+ this.valpha = object.valpha;
1610
+ } else if (typeof object === 'string') {
1611
+ const result = color_string.get(object);
1612
+ if (result === null) {
1613
+ throw new Error('Unable to parse color from string: ' + object);
1614
+ }
1615
+
1616
+ this.model = result.model;
1617
+ channels = color_convert[this.model].channels;
1618
+ this.color = result.value.slice(0, channels);
1619
+ this.valpha = typeof result.value[channels] === 'number' ? result.value[channels] : 1;
1620
+ } else if (object.length > 0) {
1621
+ this.model = model || 'rgb';
1622
+ channels = color_convert[this.model].channels;
1623
+ const newArray = Array.prototype.slice.call(object, 0, channels);
1624
+ this.color = zeroArray(newArray, channels);
1625
+ this.valpha = typeof object[channels] === 'number' ? object[channels] : 1;
1626
+ } else if (typeof object === 'number') {
1627
+ // This is always RGB - can be converted later on.
1628
+ this.model = 'rgb';
1629
+ this.color = [
1630
+ (object >> 16) & 0xFF,
1631
+ (object >> 8) & 0xFF,
1632
+ object & 0xFF,
1633
+ ];
1634
+ this.valpha = 1;
1635
+ } else {
1636
+ this.valpha = 1;
1637
+
1638
+ const keys = Object.keys(object);
1639
+ if ('alpha' in object) {
1640
+ keys.splice(keys.indexOf('alpha'), 1);
1641
+ this.valpha = typeof object.alpha === 'number' ? object.alpha : 0;
1642
+ }
1643
+
1644
+ const hashedKeys = keys.sort().join('');
1645
+ if (!(hashedKeys in hashedModelKeys)) {
1646
+ throw new Error('Unable to parse color from object: ' + JSON.stringify(object));
1647
+ }
1648
+
1649
+ this.model = hashedModelKeys[hashedKeys];
1650
+
1651
+ const {labels} = color_convert[this.model];
1652
+ const color = [];
1653
+ for (i = 0; i < labels.length; i++) {
1654
+ color.push(object[labels[i]]);
1655
+ }
1656
+
1657
+ this.color = zeroArray(color);
1658
+ }
1659
+
1660
+ // Perform limitations (clamping, etc.)
1661
+ if (limiters[this.model]) {
1662
+ channels = color_convert[this.model].channels;
1663
+ for (i = 0; i < channels; i++) {
1664
+ const limit = limiters[this.model][i];
1665
+ if (limit) {
1666
+ this.color[i] = limit(this.color[i]);
1667
+ }
1668
+ }
1669
+ }
1670
+
1671
+ this.valpha = Math.max(0, Math.min(1, this.valpha));
1672
+
1673
+ if (Object.freeze) {
1674
+ Object.freeze(this);
1675
+ }
1676
+ }
1677
+
1678
+ Color.prototype = {
1679
+ toString() {
1680
+ return this.string();
1681
+ },
1682
+
1683
+ toJSON() {
1684
+ return this[this.model]();
1685
+ },
1686
+
1687
+ string(places) {
1688
+ let self = this.model in color_string.to ? this : this.rgb();
1689
+ self = self.round(typeof places === 'number' ? places : 1);
1690
+ const arguments_ = self.valpha === 1 ? self.color : [...self.color, this.valpha];
1691
+ return color_string.to[self.model](...arguments_);
1692
+ },
1693
+
1694
+ percentString(places) {
1695
+ const self = this.rgb().round(typeof places === 'number' ? places : 1);
1696
+ const arguments_ = self.valpha === 1 ? self.color : [...self.color, this.valpha];
1697
+ return color_string.to.rgb.percent(...arguments_);
1698
+ },
1699
+
1700
+ array() {
1701
+ return this.valpha === 1 ? [...this.color] : [...this.color, this.valpha];
1702
+ },
1703
+
1704
+ object() {
1705
+ const result = {};
1706
+ const {channels} = color_convert[this.model];
1707
+ const {labels} = color_convert[this.model];
1708
+
1709
+ for (let i = 0; i < channels; i++) {
1710
+ result[labels[i]] = this.color[i];
1711
+ }
1712
+
1713
+ if (this.valpha !== 1) {
1714
+ result.alpha = this.valpha;
1715
+ }
1716
+
1717
+ return result;
1718
+ },
1719
+
1720
+ unitArray() {
1721
+ const rgb = this.rgb().color;
1722
+ rgb[0] /= 255;
1723
+ rgb[1] /= 255;
1724
+ rgb[2] /= 255;
1725
+
1726
+ if (this.valpha !== 1) {
1727
+ rgb.push(this.valpha);
1728
+ }
1729
+
1730
+ return rgb;
1731
+ },
1732
+
1733
+ unitObject() {
1734
+ const rgb = this.rgb().object();
1735
+ rgb.r /= 255;
1736
+ rgb.g /= 255;
1737
+ rgb.b /= 255;
1738
+
1739
+ if (this.valpha !== 1) {
1740
+ rgb.alpha = this.valpha;
1741
+ }
1742
+
1743
+ return rgb;
1744
+ },
1745
+
1746
+ round(places) {
1747
+ places = Math.max(places || 0, 0);
1748
+ return new Color([...this.color.map(roundToPlace(places)), this.valpha], this.model);
1749
+ },
1750
+
1751
+ alpha(value) {
1752
+ if (value !== undefined) {
1753
+ return new Color([...this.color, Math.max(0, Math.min(1, value))], this.model);
1754
+ }
1755
+
1756
+ return this.valpha;
1757
+ },
1758
+
1759
+ // Rgb
1760
+ red: getset('rgb', 0, maxfn(255)),
1761
+ green: getset('rgb', 1, maxfn(255)),
1762
+ blue: getset('rgb', 2, maxfn(255)),
1763
+
1764
+ hue: getset(['hsl', 'hsv', 'hsl', 'hwb', 'hcg'], 0, value => ((value % 360) + 360) % 360),
1765
+
1766
+ saturationl: getset('hsl', 1, maxfn(100)),
1767
+ lightness: getset('hsl', 2, maxfn(100)),
1768
+
1769
+ saturationv: getset('hsv', 1, maxfn(100)),
1770
+ value: getset('hsv', 2, maxfn(100)),
1771
+
1772
+ chroma: getset('hcg', 1, maxfn(100)),
1773
+ gray: getset('hcg', 2, maxfn(100)),
1774
+
1775
+ white: getset('hwb', 1, maxfn(100)),
1776
+ wblack: getset('hwb', 2, maxfn(100)),
1777
+
1778
+ cyan: getset('cmyk', 0, maxfn(100)),
1779
+ magenta: getset('cmyk', 1, maxfn(100)),
1780
+ yellow: getset('cmyk', 2, maxfn(100)),
1781
+ black: getset('cmyk', 3, maxfn(100)),
1782
+
1783
+ x: getset('xyz', 0, maxfn(95.047)),
1784
+ y: getset('xyz', 1, maxfn(100)),
1785
+ z: getset('xyz', 2, maxfn(108.833)),
1786
+
1787
+ l: getset('lab', 0, maxfn(100)),
1788
+ a: getset('lab', 1),
1789
+ b: getset('lab', 2),
1790
+
1791
+ keyword(value) {
1792
+ if (value !== undefined) {
1793
+ return new Color(value);
1794
+ }
1795
+
1796
+ return color_convert[this.model].keyword(this.color);
1797
+ },
1798
+
1799
+ hex(value) {
1800
+ if (value !== undefined) {
1801
+ return new Color(value);
1802
+ }
1803
+
1804
+ return color_string.to.hex(...this.rgb().round().color);
1805
+ },
1806
+
1807
+ hexa(value) {
1808
+ if (value !== undefined) {
1809
+ return new Color(value);
1810
+ }
1811
+
1812
+ const rgbArray = this.rgb().round().color;
1813
+
1814
+ let alphaHex = Math.round(this.valpha * 255).toString(16).toUpperCase();
1815
+ if (alphaHex.length === 1) {
1816
+ alphaHex = '0' + alphaHex;
1817
+ }
1818
+
1819
+ return color_string.to.hex(...rgbArray) + alphaHex;
1820
+ },
1821
+
1822
+ rgbNumber() {
1823
+ const rgb = this.rgb().color;
1824
+ return ((rgb[0] & 0xFF) << 16) | ((rgb[1] & 0xFF) << 8) | (rgb[2] & 0xFF);
1825
+ },
1826
+
1827
+ luminosity() {
1828
+ // http://www.w3.org/TR/WCAG20/#relativeluminancedef
1829
+ const rgb = this.rgb().color;
1830
+
1831
+ const lum = [];
1832
+ for (const [i, element] of rgb.entries()) {
1833
+ const chan = element / 255;
1834
+ lum[i] = (chan <= 0.04045) ? chan / 12.92 : ((chan + 0.055) / 1.055) ** 2.4;
1835
+ }
1836
+
1837
+ return 0.2126 * lum[0] + 0.7152 * lum[1] + 0.0722 * lum[2];
1838
+ },
1839
+
1840
+ contrast(color2) {
1841
+ // http://www.w3.org/TR/WCAG20/#contrast-ratiodef
1842
+ const lum1 = this.luminosity();
1843
+ const lum2 = color2.luminosity();
1844
+
1845
+ if (lum1 > lum2) {
1846
+ return (lum1 + 0.05) / (lum2 + 0.05);
1847
+ }
1848
+
1849
+ return (lum2 + 0.05) / (lum1 + 0.05);
1850
+ },
1851
+
1852
+ level(color2) {
1853
+ // https://www.w3.org/TR/WCAG/#contrast-enhanced
1854
+ const contrastRatio = this.contrast(color2);
1855
+ if (contrastRatio >= 7) {
1856
+ return 'AAA';
1857
+ }
1858
+
1859
+ return (contrastRatio >= 4.5) ? 'AA' : '';
1860
+ },
1861
+
1862
+ isDark() {
1863
+ // YIQ equation from http://24ways.org/2010/calculating-color-contrast
1864
+ const rgb = this.rgb().color;
1865
+ const yiq = (rgb[0] * 2126 + rgb[1] * 7152 + rgb[2] * 722) / 10000;
1866
+ return yiq < 128;
1867
+ },
1868
+
1869
+ isLight() {
1870
+ return !this.isDark();
1871
+ },
1872
+
1873
+ negate() {
1874
+ const rgb = this.rgb();
1875
+ for (let i = 0; i < 3; i++) {
1876
+ rgb.color[i] = 255 - rgb.color[i];
1877
+ }
1878
+
1879
+ return rgb;
1880
+ },
1881
+
1882
+ lighten(ratio) {
1883
+ const hsl = this.hsl();
1884
+ hsl.color[2] += hsl.color[2] * ratio;
1885
+ return hsl;
1886
+ },
1887
+
1888
+ darken(ratio) {
1889
+ const hsl = this.hsl();
1890
+ hsl.color[2] -= hsl.color[2] * ratio;
1891
+ return hsl;
1892
+ },
1893
+
1894
+ saturate(ratio) {
1895
+ const hsl = this.hsl();
1896
+ hsl.color[1] += hsl.color[1] * ratio;
1897
+ return hsl;
1898
+ },
1899
+
1900
+ desaturate(ratio) {
1901
+ const hsl = this.hsl();
1902
+ hsl.color[1] -= hsl.color[1] * ratio;
1903
+ return hsl;
1904
+ },
1905
+
1906
+ whiten(ratio) {
1907
+ const hwb = this.hwb();
1908
+ hwb.color[1] += hwb.color[1] * ratio;
1909
+ return hwb;
1910
+ },
1911
+
1912
+ blacken(ratio) {
1913
+ const hwb = this.hwb();
1914
+ hwb.color[2] += hwb.color[2] * ratio;
1915
+ return hwb;
1916
+ },
1917
+
1918
+ grayscale() {
1919
+ // http://en.wikipedia.org/wiki/Grayscale#Converting_colour_to_grayscale
1920
+ const rgb = this.rgb().color;
1921
+ const value = rgb[0] * 0.3 + rgb[1] * 0.59 + rgb[2] * 0.11;
1922
+ return Color.rgb(value, value, value);
1923
+ },
1924
+
1925
+ fade(ratio) {
1926
+ return this.alpha(this.valpha - (this.valpha * ratio));
1927
+ },
1928
+
1929
+ opaquer(ratio) {
1930
+ return this.alpha(this.valpha + (this.valpha * ratio));
1931
+ },
1932
+
1933
+ rotate(degrees) {
1934
+ const hsl = this.hsl();
1935
+ let hue = hsl.color[0];
1936
+ hue = (hue + degrees) % 360;
1937
+ hue = hue < 0 ? 360 + hue : hue;
1938
+ hsl.color[0] = hue;
1939
+ return hsl;
1940
+ },
1941
+
1942
+ mix(mixinColor, weight) {
1943
+ // Ported from sass implementation in C
1944
+ // https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209
1945
+ if (!mixinColor || !mixinColor.rgb) {
1946
+ throw new Error('Argument to "mix" was not a Color instance, but rather an instance of ' + typeof mixinColor);
1947
+ }
1948
+
1949
+ const color1 = mixinColor.rgb();
1950
+ const color2 = this.rgb();
1951
+ const p = weight === undefined ? 0.5 : weight;
1952
+
1953
+ const w = 2 * p - 1;
1954
+ const a = color1.alpha() - color2.alpha();
1955
+
1956
+ const w1 = (((w * a === -1) ? w : (w + a) / (1 + w * a)) + 1) / 2;
1957
+ const w2 = 1 - w1;
1958
+
1959
+ return Color.rgb(
1960
+ w1 * color1.red() + w2 * color2.red(),
1961
+ w1 * color1.green() + w2 * color2.green(),
1962
+ w1 * color1.blue() + w2 * color2.blue(),
1963
+ color1.alpha() * p + color2.alpha() * (1 - p));
1964
+ },
1965
+ };
1966
+
1967
+ // Model conversion methods and static constructors
1968
+ for (const model of Object.keys(color_convert)) {
1969
+ if (skippedModels.includes(model)) {
1970
+ continue;
1971
+ }
1972
+
1973
+ const {channels} = color_convert[model];
1974
+
1975
+ // Conversion methods
1976
+ Color.prototype[model] = function (...arguments_) {
1977
+ if (this.model === model) {
1978
+ return new Color(this);
1979
+ }
1980
+
1981
+ if (arguments_.length > 0) {
1982
+ return new Color(arguments_, model);
1983
+ }
1984
+
1985
+ return new Color([...assertArray(color_convert[this.model][model].raw(this.color)), this.valpha], model);
1986
+ };
1987
+
1988
+ // 'static' construction methods
1989
+ Color[model] = function (...arguments_) {
1990
+ let color = arguments_[0];
1991
+ if (typeof color === 'number') {
1992
+ color = zeroArray(arguments_, channels);
1993
+ }
1994
+
1995
+ return new Color(color, model);
1996
+ };
1997
+ }
1998
+
1999
+ function roundTo(number, places) {
2000
+ return Number(number.toFixed(places));
2001
+ }
2002
+
2003
+ function roundToPlace(places) {
2004
+ return function (number) {
2005
+ return roundTo(number, places);
2006
+ };
2007
+ }
2008
+
2009
+ function getset(model, channel, modifier) {
2010
+ model = Array.isArray(model) ? model : [model];
2011
+
2012
+ for (const m of model) {
2013
+ (limiters[m] ||= [])[channel] = modifier;
2014
+ }
2015
+
2016
+ model = model[0];
2017
+
2018
+ return function (value) {
2019
+ let result;
2020
+
2021
+ if (value !== undefined) {
2022
+ if (modifier) {
2023
+ value = modifier(value);
2024
+ }
2025
+
2026
+ result = this[model]();
2027
+ result.color[channel] = value;
2028
+ return result;
2029
+ }
2030
+
2031
+ result = this[model]().color[channel];
2032
+ if (modifier) {
2033
+ result = modifier(result);
2034
+ }
2035
+
2036
+ return result;
2037
+ };
2038
+ }
2039
+
2040
+ function maxfn(max) {
2041
+ return function (v) {
2042
+ return Math.max(0, Math.min(max, v));
2043
+ };
2044
+ }
2045
+
2046
+ function assertArray(value) {
2047
+ return Array.isArray(value) ? value : [value];
2048
+ }
2049
+
2050
+ function zeroArray(array, length) {
2051
+ for (let i = 0; i < length; i++) {
2052
+ if (typeof array[i] !== 'number') {
2053
+ array[i] = 0;
2054
+ }
2055
+ }
2056
+
2057
+ return array;
2058
+ }
2059
+
2060
+ /* harmony default export */ const color = (Color);
2061
+
2062
+
2063
+ /***/ })
2064
+
2065
+ }]);
2066
+ //# sourceMappingURL=1602.1f9163a55b87ec440fc5.js.map?v=1f9163a55b87ec440fc5