@esri/calcite-components 1.4.0-next.1 → 1.4.0-next.11

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.
Files changed (873) hide show
  1. package/dist/calcite/assets/icon/orientedImageryLayer16.json +1 -0
  2. package/dist/calcite/assets/icon/orientedImageryLayer24.json +1 -0
  3. package/dist/calcite/assets/icon/orientedImageryLayer32.json +1 -0
  4. package/dist/calcite/assets/icon/parcelLayer16.json +1 -0
  5. package/dist/calcite/assets/icon/parcelLayer24.json +1 -0
  6. package/dist/calcite/assets/icon/parcelLayer32.json +1 -0
  7. package/dist/calcite/assets/icon/viewAssociations16.json +1 -0
  8. package/dist/calcite/assets/icon/viewAssociations24.json +1 -0
  9. package/dist/calcite/assets/icon/viewAssociations32.json +1 -0
  10. package/dist/calcite/calcite.css +1 -1
  11. package/dist/calcite/calcite.esm.js +2 -2
  12. package/dist/calcite/index.esm.js +2 -2
  13. package/dist/calcite/p-02a5a46d.entry.js +6 -0
  14. package/dist/calcite/p-0472ee23.entry.js +6 -0
  15. package/dist/calcite/p-06a32d43.entry.js +6 -0
  16. package/dist/calcite/p-07ab96dc.entry.js +6 -0
  17. package/dist/calcite/p-0af8f02b.entry.js +6 -0
  18. package/dist/calcite/{p-fdc776d9.js → p-0d985cc2.js} +3 -3
  19. package/dist/calcite/{p-3f20b4ea.js → p-0e6174e1.js} +1 -1
  20. package/dist/calcite/p-0f380c43.entry.js +6 -0
  21. package/dist/calcite/p-15cb4cb0.entry.js +6 -0
  22. package/dist/calcite/{p-7b470dfe.js → p-165ec40b.js} +1 -1
  23. package/dist/calcite/p-18520138.entry.js +6 -0
  24. package/dist/calcite/p-1b20682f.entry.js +6 -0
  25. package/dist/calcite/p-1c831629.js +6 -0
  26. package/dist/calcite/{p-40e9ea4d.js → p-1f66d449.js} +1 -1
  27. package/dist/calcite/p-2338b106.entry.js +6 -0
  28. package/dist/calcite/p-2409fb7f.entry.js +6 -0
  29. package/dist/calcite/{p-baca04ad.entry.js → p-2a3cf375.entry.js} +2 -2
  30. package/dist/calcite/p-2c4bc19b.entry.js +6 -0
  31. package/dist/calcite/{p-3fd6d05a.js → p-2da7b70b.js} +1 -1
  32. package/dist/calcite/{p-931355e8.js → p-2dc2a820.js} +1 -1
  33. package/dist/calcite/{p-dab4ee30.js → p-2dcf0c10.js} +1 -1
  34. package/dist/calcite/p-2eb00e69.js +6 -0
  35. package/dist/calcite/p-30a6bd5e.js +6 -0
  36. package/dist/calcite/{p-b74b3edc.js → p-31ec389a.js} +1 -1
  37. package/dist/calcite/p-365f3e91.entry.js +6 -0
  38. package/dist/calcite/p-38714981.entry.js +6 -0
  39. package/dist/calcite/p-38aa122c.entry.js +6 -0
  40. package/dist/calcite/p-38cd1b20.entry.js +6 -0
  41. package/dist/calcite/p-3b392b46.entry.js +6 -0
  42. package/dist/calcite/{p-160e376e.js → p-42552845.js} +1 -1
  43. package/dist/calcite/p-43699b83.entry.js +6 -0
  44. package/dist/calcite/p-4726e3f1.entry.js +6 -0
  45. package/dist/calcite/p-4d1058f4.entry.js +6 -0
  46. package/dist/calcite/p-4d496ce6.entry.js +6 -0
  47. package/dist/calcite/p-4e86e62c.entry.js +6 -0
  48. package/dist/calcite/p-4ea387a3.entry.js +6 -0
  49. package/dist/calcite/{p-00b8a8e9.js → p-529f0e4a.js} +2 -2
  50. package/dist/calcite/p-5441476c.entry.js +6 -0
  51. package/dist/calcite/p-5e275908.entry.js +6 -0
  52. package/dist/calcite/p-61b39222.entry.js +6 -0
  53. package/dist/calcite/{p-c75b8170.js → p-6315c73f.js} +2 -2
  54. package/dist/calcite/p-6736c3c0.entry.js +6 -0
  55. package/dist/calcite/{p-3048b02a.js → p-6911bf06.js} +1 -1
  56. package/dist/calcite/p-6d9c082a.entry.js +6 -0
  57. package/dist/calcite/{p-8e588bd5.js → p-6dc8f26e.js} +2 -2
  58. package/dist/calcite/p-7543c7af.entry.js +6 -0
  59. package/dist/calcite/{p-202ec7cb.js → p-75a62ff3.js} +1 -1
  60. package/dist/calcite/p-785a071f.entry.js +6 -0
  61. package/dist/calcite/{p-192c9303.js → p-7b4366b3.js} +2 -2
  62. package/dist/calcite/p-7d35466a.entry.js +6 -0
  63. package/dist/calcite/p-80701cd1.entry.js +6 -0
  64. package/dist/calcite/{p-dbfc5b2e.js → p-8420a6cf.js} +2 -2
  65. package/dist/calcite/{p-9f492399.js → p-84c1e54b.js} +2 -2
  66. package/dist/calcite/p-85cca4f2.js +6 -0
  67. package/dist/calcite/p-88dc218e.entry.js +6 -0
  68. package/dist/calcite/p-8ac3da4a.entry.js +6 -0
  69. package/dist/calcite/{p-9f47f20c.js → p-8ae8e08d.js} +1 -1
  70. package/dist/calcite/{p-929f251f.js → p-8d6e3780.js} +1 -1
  71. package/dist/calcite/p-8faa3bdc.entry.js +6 -0
  72. package/dist/calcite/{p-cb0f1e83.js → p-95093c16.js} +1 -1
  73. package/dist/calcite/p-99d4749d.entry.js +6 -0
  74. package/dist/calcite/p-9ad25ab1.entry.js +6 -0
  75. package/dist/calcite/p-a49b3c20.entry.js +6 -0
  76. package/dist/calcite/{p-cbbc6c3c.js → p-a8f92d33.js} +1 -1
  77. package/dist/calcite/p-aa2f5346.entry.js +6 -0
  78. package/dist/calcite/p-ac4a7ccf.entry.js +6 -0
  79. package/dist/calcite/{p-0d8ab202.js → p-afe946bd.js} +2 -2
  80. package/dist/calcite/p-b1058ef9.entry.js +6 -0
  81. package/dist/calcite/{p-cccdae42.js → p-b15456d2.js} +2 -2
  82. package/dist/calcite/p-b6b1831c.entry.js +6 -0
  83. package/dist/calcite/p-bb026473.entry.js +6 -0
  84. package/dist/calcite/p-c0538fc7.entry.js +6 -0
  85. package/dist/calcite/p-c448c7bd.entry.js +6 -0
  86. package/dist/calcite/p-c98aeafa.entry.js +6 -0
  87. package/dist/calcite/p-cafdc943.entry.js +6 -0
  88. package/dist/calcite/p-cfb7ba9f.js +6 -0
  89. package/dist/calcite/p-d0a4d643.entry.js +6 -0
  90. package/dist/calcite/p-d55fc7c1.entry.js +6 -0
  91. package/dist/calcite/p-d5a8044b.entry.js +6 -0
  92. package/dist/calcite/p-d7b38007.entry.js +6 -0
  93. package/dist/calcite/p-da7bb2c5.entry.js +6 -0
  94. package/dist/calcite/p-dc69e13c.entry.js +6 -0
  95. package/dist/calcite/p-df4228a1.entry.js +6 -0
  96. package/dist/calcite/p-df73eefa.entry.js +6 -0
  97. package/dist/calcite/p-e0fa4d49.entry.js +6 -0
  98. package/dist/calcite/p-e2206b46.js +6 -0
  99. package/dist/calcite/p-e22f0d26.entry.js +6 -0
  100. package/dist/calcite/p-e718d92b.entry.js +6 -0
  101. package/dist/calcite/{p-80f5c7dc.entry.js → p-e7ace0b9.entry.js} +2 -2
  102. package/dist/calcite/{p-90170ec7.js → p-ea084a60.js} +2 -2
  103. package/dist/calcite/p-ebb31c6d.entry.js +6 -0
  104. package/dist/calcite/{p-a8216142.js → p-f3a960c7.js} +1 -1
  105. package/dist/calcite/{p-52234353.js → p-f747567a.js} +2 -2
  106. package/dist/calcite/{p-a7a5335e.js → p-f9a351e1.js} +2 -2
  107. package/dist/calcite/{p-4dfe3be2.js → p-fcbd924b.js} +1 -1
  108. package/dist/calcite/p-ffb1f95e.entry.js +6 -0
  109. package/dist/cjs/{ExpandToggle-46462b73.js → ExpandToggle-47593692.js} +5 -5
  110. package/dist/cjs/{FloatingArrow-386bcf99.js → FloatingArrow-f41bbf5a.js} +2 -2
  111. package/dist/cjs/{Heading-cdc35796.js → Heading-2bd3592d.js} +2 -2
  112. package/dist/cjs/{app-globals-d6130b8b.js → app-globals-0b2c6450.js} +2 -2
  113. package/dist/cjs/{array-79e60de8.js → array-09964494.js} +1 -1
  114. package/dist/cjs/calcite-accordion_2.cjs.entry.js +9 -9
  115. package/dist/cjs/calcite-action-bar.cjs.entry.js +16 -16
  116. package/dist/cjs/calcite-action-group.cjs.entry.js +14 -14
  117. package/dist/cjs/calcite-action-menu.cjs.entry.js +10 -10
  118. package/dist/cjs/calcite-action-pad.cjs.entry.js +15 -15
  119. package/dist/cjs/calcite-action.cjs.entry.js +12 -12
  120. package/dist/cjs/calcite-alert.cjs.entry.js +13 -13
  121. package/dist/cjs/calcite-avatar.cjs.entry.js +10 -9
  122. package/dist/cjs/calcite-block_2.cjs.entry.js +14 -14
  123. package/dist/cjs/calcite-button.cjs.entry.js +14 -14
  124. package/dist/cjs/calcite-card.cjs.entry.js +11 -11
  125. package/dist/cjs/calcite-checkbox.cjs.entry.js +11 -11
  126. package/dist/cjs/calcite-chip-group.cjs.entry.js +9 -9
  127. package/dist/cjs/calcite-chip.cjs.entry.js +13 -13
  128. package/dist/cjs/calcite-color-picker_3.cjs.entry.js +585 -339
  129. package/dist/cjs/calcite-combobox_3.cjs.entry.js +21 -21
  130. package/dist/cjs/calcite-date-picker_4.cjs.entry.js +17 -17
  131. package/dist/cjs/calcite-dropdown_3.cjs.entry.js +15 -15
  132. package/dist/cjs/calcite-fab.cjs.entry.js +8 -8
  133. package/dist/cjs/calcite-filter.cjs.entry.js +14 -14
  134. package/dist/cjs/calcite-flow-item.cjs.entry.js +13 -13
  135. package/dist/cjs/calcite-flow.cjs.entry.js +4 -4
  136. package/dist/cjs/calcite-graph_2.cjs.entry.js +15 -15
  137. package/dist/cjs/calcite-handle.cjs.entry.js +11 -11
  138. package/dist/cjs/calcite-icon.cjs.entry.js +7 -7
  139. package/dist/cjs/calcite-inline-editable.cjs.entry.js +13 -13
  140. package/dist/cjs/calcite-input-date-picker.cjs.entry.js +19 -19
  141. package/dist/cjs/calcite-input-message.cjs.entry.js +6 -6
  142. package/dist/cjs/calcite-input-number.cjs.entry.js +14 -14
  143. package/dist/cjs/calcite-input-text.cjs.entry.js +14 -14
  144. package/dist/cjs/calcite-input-time-picker_2.cjs.entry.js +16 -16
  145. package/dist/cjs/calcite-input.cjs.entry.js +14 -14
  146. package/dist/cjs/calcite-label.cjs.entry.js +7 -7
  147. package/dist/cjs/calcite-link.cjs.entry.js +8 -8
  148. package/dist/cjs/calcite-list_3.cjs.entry.js +53 -43
  149. package/dist/cjs/calcite-loader.cjs.entry.js +4 -4
  150. package/dist/cjs/calcite-modal.cjs.entry.js +14 -14
  151. package/dist/cjs/calcite-notice.cjs.entry.js +13 -13
  152. package/dist/cjs/calcite-option_3.cjs.entry.js +13 -13
  153. package/dist/cjs/calcite-pagination.cjs.entry.js +11 -11
  154. package/dist/cjs/calcite-panel.cjs.entry.js +15 -15
  155. package/dist/cjs/calcite-pick-list_3.cjs.entry.js +19 -19
  156. package/dist/cjs/calcite-popover.cjs.entry.js +17 -17
  157. package/dist/cjs/calcite-progress.cjs.entry.js +3 -3
  158. package/dist/cjs/calcite-radio-button-group.cjs.entry.js +4 -4
  159. package/dist/cjs/calcite-radio-button.cjs.entry.js +11 -11
  160. package/dist/cjs/calcite-rating.cjs.entry.js +14 -14
  161. package/dist/cjs/calcite-scrim.cjs.entry.js +10 -10
  162. package/dist/cjs/calcite-segmented-control_2.cjs.entry.js +11 -11
  163. package/dist/cjs/calcite-shell_3.cjs.entry.js +14 -17
  164. package/dist/cjs/calcite-sortable-list.cjs.entry.js +6 -6
  165. package/dist/cjs/calcite-split-button.cjs.entry.js +5 -5
  166. package/dist/cjs/calcite-stepper_2.cjs.entry.js +12 -12
  167. package/dist/cjs/calcite-switch.cjs.entry.js +11 -11
  168. package/dist/cjs/calcite-tab_4.cjs.entry.js +11 -11
  169. package/dist/cjs/calcite-text-area.cjs.entry.js +16 -16
  170. package/dist/cjs/calcite-tile-select_2.cjs.entry.js +7 -7
  171. package/dist/cjs/calcite-tile.cjs.entry.js +9 -9
  172. package/dist/cjs/calcite-tip_3.cjs.entry.js +14 -14
  173. package/dist/cjs/calcite-tooltip.cjs.entry.js +47 -33
  174. package/dist/cjs/calcite-tree_2.cjs.entry.js +49 -29
  175. package/dist/cjs/calcite-value-list_2.cjs.entry.js +18 -18
  176. package/dist/cjs/calcite.cjs.js +5 -5
  177. package/dist/cjs/{composed-offset-position.esm-34843aea.js → composed-offset-position.esm-da5b3cd1.js} +1 -1
  178. package/dist/cjs/{conditionalSlot-a61d43fc.js → conditionalSlot-00a45a49.js} +3 -3
  179. package/dist/cjs/{debounce-bf9bd36d.js → debounce-8b93ddf9.js} +1 -1
  180. package/dist/cjs/{dom-dd7e7078.js → dom-f9be6b76.js} +116 -17
  181. package/dist/cjs/{filter-95f477d2.js → filter-78a4abdc.js} +2 -2
  182. package/dist/cjs/{floating-ui-fab04fea.js → floating-ui-767d9fec.js} +71 -65
  183. package/dist/cjs/{focusTrapComponent-6e1488e8.js → focusTrapComponent-11458ff7.js} +2 -2
  184. package/dist/cjs/{form-a683c373.js → form-da98f535.js} +3 -3
  185. package/dist/cjs/{guid-6841fe52.js → guid-d38d5390.js} +1 -1
  186. package/dist/cjs/{index-2a60e5ec.js → index-878e6a10.js} +1 -1
  187. package/dist/cjs/index.cjs.js +2 -2
  188. package/dist/cjs/{interactive-6cff8d4e.js → interactive-5c9db1e0.js} +1 -1
  189. package/dist/cjs/{key-629ff080.js → key-19d72847.js} +1 -1
  190. package/dist/cjs/{label-7712e5a1.js → label-41cb371b.js} +2 -2
  191. package/dist/cjs/{loadable-85e1f45b.js → loadable-30ec84d4.js} +1 -1
  192. package/dist/cjs/loader.cjs.js +5 -5
  193. package/dist/cjs/{locale-44e61096.js → locale-2feae2e1.js} +4 -4
  194. package/dist/cjs/{math-faf5a949.js → math-06431d34.js} +1 -1
  195. package/dist/cjs/{observers-d3bfb778.js → observers-1f039e59.js} +1 -1
  196. package/dist/cjs/{openCloseComponent-65c2ca00.js → openCloseComponent-97cba1d8.js} +2 -2
  197. package/dist/cjs/{resources-ad5570c2.js → resources-1e20f92b.js} +1 -1
  198. package/dist/cjs/{resources-6ae8b620.js → resources-37d537a4.js} +1 -1
  199. package/dist/cjs/{resources-2e9fab44.js → resources-71924711.js} +1 -1
  200. package/dist/cjs/{resources-54920aaa.js → resources-d828a7a2.js} +5 -5
  201. package/dist/cjs/{resources-4861da6e.js → resources-dcd3ec6f.js} +1 -1
  202. package/dist/cjs/{resources-34d3d589.js → resources-e81bfcee.js} +1 -1
  203. package/dist/cjs/{sortable.esm-7c113379.js → sortable.esm-bdf4502c.js} +1 -1
  204. package/dist/cjs/{t9n-6d0f2ca7.js → t9n-e4b5d7bc.js} +3 -3
  205. package/dist/cjs/{throttle-9dfcf548.js → throttle-c959a70a.js} +2 -2
  206. package/dist/cjs/utils-3cbb4489.js +213 -0
  207. package/dist/cjs/{utils-7e605f34.js → utils-d7655679.js} +3 -3
  208. package/dist/collection/components/accordion/accordion.css +28 -0
  209. package/dist/collection/components/accordion/accordion.js +1 -1
  210. package/dist/collection/components/accordion-item/accordion-item.css +28 -0
  211. package/dist/collection/components/accordion-item/accordion-item.js +1 -1
  212. package/dist/collection/components/accordion-item/resources.js +1 -1
  213. package/dist/collection/components/action/action.css +28 -0
  214. package/dist/collection/components/action/action.js +1 -1
  215. package/dist/collection/components/action/resources.js +1 -1
  216. package/dist/collection/components/action-bar/action-bar.css +37 -12
  217. package/dist/collection/components/action-bar/action-bar.js +1 -1
  218. package/dist/collection/components/action-bar/resources.js +1 -1
  219. package/dist/collection/components/action-bar/utils.js +1 -1
  220. package/dist/collection/components/action-group/action-group.css +28 -0
  221. package/dist/collection/components/action-group/action-group.js +1 -1
  222. package/dist/collection/components/action-group/resources.js +1 -1
  223. package/dist/collection/components/action-menu/action-menu.css +28 -0
  224. package/dist/collection/components/action-menu/action-menu.js +1 -1
  225. package/dist/collection/components/action-menu/resources.js +1 -1
  226. package/dist/collection/components/action-pad/action-pad.css +28 -0
  227. package/dist/collection/components/action-pad/action-pad.js +1 -1
  228. package/dist/collection/components/action-pad/resources.js +1 -1
  229. package/dist/collection/components/alert/alert.css +28 -0
  230. package/dist/collection/components/alert/alert.js +1 -1
  231. package/dist/collection/components/alert/resources.js +1 -1
  232. package/dist/collection/components/avatar/avatar.css +28 -0
  233. package/dist/collection/components/avatar/avatar.js +22 -4
  234. package/dist/collection/components/avatar/utils.js +1 -1
  235. package/dist/collection/components/block/block.css +56 -0
  236. package/dist/collection/components/block/block.js +1 -1
  237. package/dist/collection/components/block/resources.js +1 -1
  238. package/dist/collection/components/block-section/block-section.css +28 -0
  239. package/dist/collection/components/block-section/block-section.js +1 -1
  240. package/dist/collection/components/block-section/resources.js +1 -1
  241. package/dist/collection/components/button/button.css +28 -0
  242. package/dist/collection/components/button/button.js +1 -1
  243. package/dist/collection/components/button/resources.js +1 -1
  244. package/dist/collection/components/card/card.css +28 -0
  245. package/dist/collection/components/card/card.js +1 -1
  246. package/dist/collection/components/card/resources.js +1 -1
  247. package/dist/collection/components/checkbox/checkbox.css +28 -0
  248. package/dist/collection/components/checkbox/checkbox.js +1 -1
  249. package/dist/collection/components/chip/chip.css +28 -0
  250. package/dist/collection/components/chip/chip.js +1 -1
  251. package/dist/collection/components/chip/resources.js +1 -1
  252. package/dist/collection/components/chip-group/chip-group.css +28 -0
  253. package/dist/collection/components/chip-group/chip-group.js +1 -1
  254. package/dist/collection/components/color-picker/color-picker.css +87 -52
  255. package/dist/collection/components/color-picker/color-picker.js +449 -234
  256. package/dist/collection/components/color-picker/resources.js +37 -27
  257. package/dist/collection/components/color-picker/utils.js +116 -30
  258. package/dist/collection/components/color-picker-hex-input/color-picker-hex-input.css +47 -16
  259. package/dist/collection/components/color-picker-hex-input/color-picker-hex-input.js +225 -118
  260. package/dist/collection/components/color-picker-hex-input/resources.js +3 -3
  261. package/dist/collection/components/color-picker-swatch/color-picker-swatch.css +38 -6
  262. package/dist/collection/components/color-picker-swatch/color-picker-swatch.js +34 -7
  263. package/dist/collection/components/color-picker-swatch/resources.js +8 -2
  264. package/dist/collection/components/combobox/combobox.css +28 -0
  265. package/dist/collection/components/combobox/combobox.js +1 -1
  266. package/dist/collection/components/combobox/resources.js +1 -1
  267. package/dist/collection/components/combobox/utils.js +1 -1
  268. package/dist/collection/components/combobox-item/combobox-item.css +28 -0
  269. package/dist/collection/components/combobox-item/combobox-item.js +1 -1
  270. package/dist/collection/components/combobox-item/resources.js +1 -1
  271. package/dist/collection/components/combobox-item-group/combobox-item-group.css +28 -0
  272. package/dist/collection/components/combobox-item-group/combobox-item-group.js +1 -1
  273. package/dist/collection/components/combobox-item-group/resources.js +1 -1
  274. package/dist/collection/components/date-picker/date-picker.css +28 -0
  275. package/dist/collection/components/date-picker/date-picker.js +1 -1
  276. package/dist/collection/components/date-picker/resources.js +1 -1
  277. package/dist/collection/components/date-picker/utils.js +1 -1
  278. package/dist/collection/components/date-picker-day/date-picker-day.css +28 -0
  279. package/dist/collection/components/date-picker-day/date-picker-day.js +1 -1
  280. package/dist/collection/components/date-picker-month/date-picker-month.css +28 -0
  281. package/dist/collection/components/date-picker-month/date-picker-month.js +1 -1
  282. package/dist/collection/components/date-picker-month-header/date-picker-month-header.css +28 -0
  283. package/dist/collection/components/date-picker-month-header/date-picker-month-header.js +1 -1
  284. package/dist/collection/components/date-picker-month-header/resources.js +1 -1
  285. package/dist/collection/components/dropdown/dropdown.css +28 -0
  286. package/dist/collection/components/dropdown/dropdown.js +1 -1
  287. package/dist/collection/components/dropdown/resources.js +1 -1
  288. package/dist/collection/components/dropdown-group/dropdown-group.css +28 -0
  289. package/dist/collection/components/dropdown-group/dropdown-group.js +1 -1
  290. package/dist/collection/components/dropdown-group/resources.js +1 -1
  291. package/dist/collection/components/dropdown-item/dropdown-item.css +28 -0
  292. package/dist/collection/components/dropdown-item/dropdown-item.js +1 -1
  293. package/dist/collection/components/dropdown-item/resources.js +1 -1
  294. package/dist/collection/components/fab/fab.css +28 -0
  295. package/dist/collection/components/fab/fab.js +1 -1
  296. package/dist/collection/components/fab/resources.js +1 -1
  297. package/dist/collection/components/filter/filter.css +28 -0
  298. package/dist/collection/components/filter/filter.js +1 -1
  299. package/dist/collection/components/filter/resources.js +1 -1
  300. package/dist/collection/components/flow/flow.css +28 -0
  301. package/dist/collection/components/flow/flow.js +1 -1
  302. package/dist/collection/components/flow/resources.js +1 -1
  303. package/dist/collection/components/flow-item/flow-item.css +40 -0
  304. package/dist/collection/components/flow-item/flow-item.js +2 -2
  305. package/dist/collection/components/flow-item/resources.js +1 -1
  306. package/dist/collection/components/functional/ExpandToggle.js +1 -1
  307. package/dist/collection/components/functional/FloatingArrow.js +1 -1
  308. package/dist/collection/components/functional/Heading.js +1 -1
  309. package/dist/collection/components/graph/graph.css +28 -0
  310. package/dist/collection/components/graph/graph.js +1 -1
  311. package/dist/collection/components/graph/util.js +1 -1
  312. package/dist/collection/components/handle/handle.css +28 -0
  313. package/dist/collection/components/handle/handle.js +1 -1
  314. package/dist/collection/components/handle/resources.js +1 -1
  315. package/dist/collection/components/icon/assets/icon/orientedImageryLayer16.json +1 -0
  316. package/dist/collection/components/icon/assets/icon/orientedImageryLayer24.json +1 -0
  317. package/dist/collection/components/icon/assets/icon/orientedImageryLayer32.json +1 -0
  318. package/dist/collection/components/icon/assets/icon/parcelLayer16.json +1 -0
  319. package/dist/collection/components/icon/assets/icon/parcelLayer24.json +1 -0
  320. package/dist/collection/components/icon/assets/icon/parcelLayer32.json +1 -0
  321. package/dist/collection/components/icon/assets/icon/viewAssociations16.json +1 -0
  322. package/dist/collection/components/icon/assets/icon/viewAssociations24.json +1 -0
  323. package/dist/collection/components/icon/assets/icon/viewAssociations32.json +1 -0
  324. package/dist/collection/components/icon/icon.css +28 -0
  325. package/dist/collection/components/icon/icon.js +1 -1
  326. package/dist/collection/components/icon/resources.js +1 -1
  327. package/dist/collection/components/icon/utils.js +1 -1
  328. package/dist/collection/components/inline-editable/inline-editable.css +28 -0
  329. package/dist/collection/components/inline-editable/inline-editable.js +1 -1
  330. package/dist/collection/components/inline-editable/resources.js +1 -1
  331. package/dist/collection/components/input/input.css +28 -0
  332. package/dist/collection/components/input/input.js +1 -1
  333. package/dist/collection/components/input/resources.js +1 -1
  334. package/dist/collection/components/input-date-picker/input-date-picker.css +28 -0
  335. package/dist/collection/components/input-date-picker/input-date-picker.js +1 -1
  336. package/dist/collection/components/input-date-picker/resources.js +1 -1
  337. package/dist/collection/components/input-message/input-message.css +28 -0
  338. package/dist/collection/components/input-message/input-message.js +1 -1
  339. package/dist/collection/components/input-message/interfaces.js +1 -1
  340. package/dist/collection/components/input-number/input-number.css +28 -0
  341. package/dist/collection/components/input-number/input-number.js +1 -1
  342. package/dist/collection/components/input-number/resources.js +1 -1
  343. package/dist/collection/components/input-text/input-text.css +28 -0
  344. package/dist/collection/components/input-text/input-text.js +1 -1
  345. package/dist/collection/components/input-text/resources.js +1 -1
  346. package/dist/collection/components/input-time-picker/input-time-picker.css +28 -0
  347. package/dist/collection/components/input-time-picker/input-time-picker.js +1 -1
  348. package/dist/collection/components/input-time-picker/resources.js +1 -1
  349. package/dist/collection/components/label/label.css +28 -0
  350. package/dist/collection/components/label/label.js +1 -1
  351. package/dist/collection/components/label/resources.js +1 -1
  352. package/dist/collection/components/link/link.css +28 -0
  353. package/dist/collection/components/link/link.js +1 -1
  354. package/dist/collection/components/list/list.css +28 -0
  355. package/dist/collection/components/list/list.js +60 -30
  356. package/dist/collection/components/list/resources.js +2 -2
  357. package/dist/collection/components/list-item/list-item.css +28 -0
  358. package/dist/collection/components/list-item/list-item.js +1 -1
  359. package/dist/collection/components/list-item/resources.js +1 -1
  360. package/dist/collection/components/list-item/utils.js +1 -1
  361. package/dist/collection/components/list-item-group/list-item-group.css +28 -0
  362. package/dist/collection/components/list-item-group/list-item-group.js +1 -1
  363. package/dist/collection/components/list-item-group/resources.js +1 -1
  364. package/dist/collection/components/loader/loader.css +56 -0
  365. package/dist/collection/components/loader/loader.js +1 -1
  366. package/dist/collection/components/modal/modal.css +28 -0
  367. package/dist/collection/components/modal/modal.js +1 -1
  368. package/dist/collection/components/modal/resources.js +1 -1
  369. package/dist/collection/components/notice/notice.css +28 -0
  370. package/dist/collection/components/notice/notice.js +1 -1
  371. package/dist/collection/components/notice/resources.js +1 -1
  372. package/dist/collection/components/option/option.css +28 -0
  373. package/dist/collection/components/option/option.js +1 -1
  374. package/dist/collection/components/option-group/option-group.css +28 -0
  375. package/dist/collection/components/option-group/option-group.js +1 -1
  376. package/dist/collection/components/pagination/pagination.css +28 -0
  377. package/dist/collection/components/pagination/pagination.js +1 -1
  378. package/dist/collection/components/pagination/resources.js +1 -1
  379. package/dist/collection/components/panel/panel.css +37 -2
  380. package/dist/collection/components/panel/panel.js +2 -2
  381. package/dist/collection/components/panel/resources.js +1 -1
  382. package/dist/collection/components/pick-list/pick-list.css +28 -0
  383. package/dist/collection/components/pick-list/pick-list.js +1 -1
  384. package/dist/collection/components/pick-list/resources.js +1 -1
  385. package/dist/collection/components/pick-list/shared-list-logic.js +1 -1
  386. package/dist/collection/components/pick-list/shared-list-render.js +1 -1
  387. package/dist/collection/components/pick-list-group/pick-list-group.css +28 -0
  388. package/dist/collection/components/pick-list-group/pick-list-group.js +1 -1
  389. package/dist/collection/components/pick-list-group/resources.js +1 -1
  390. package/dist/collection/components/pick-list-item/pick-list-item.css +28 -0
  391. package/dist/collection/components/pick-list-item/pick-list-item.js +1 -1
  392. package/dist/collection/components/pick-list-item/resources.js +1 -1
  393. package/dist/collection/components/popover/PopoverManager.js +1 -1
  394. package/dist/collection/components/popover/popover.css +28 -0
  395. package/dist/collection/components/popover/popover.js +1 -1
  396. package/dist/collection/components/popover/resources.js +1 -1
  397. package/dist/collection/components/progress/progress.css +56 -0
  398. package/dist/collection/components/progress/progress.js +1 -1
  399. package/dist/collection/components/radio-button/radio-button.css +28 -0
  400. package/dist/collection/components/radio-button/radio-button.js +1 -1
  401. package/dist/collection/components/radio-button/resources.js +1 -1
  402. package/dist/collection/components/radio-button-group/radio-button-group.css +28 -0
  403. package/dist/collection/components/radio-button-group/radio-button-group.js +1 -1
  404. package/dist/collection/components/rating/function/star.js +1 -1
  405. package/dist/collection/components/rating/rating.css +28 -0
  406. package/dist/collection/components/rating/rating.js +1 -1
  407. package/dist/collection/components/resources.js +1 -1
  408. package/dist/collection/components/scrim/resources.js +1 -1
  409. package/dist/collection/components/scrim/scrim.css +28 -0
  410. package/dist/collection/components/scrim/scrim.js +1 -1
  411. package/dist/collection/components/segmented-control/segmented-control.css +28 -0
  412. package/dist/collection/components/segmented-control/segmented-control.js +1 -1
  413. package/dist/collection/components/segmented-control-item/resources.js +1 -1
  414. package/dist/collection/components/segmented-control-item/segmented-control-item.css +28 -0
  415. package/dist/collection/components/segmented-control-item/segmented-control-item.js +1 -1
  416. package/dist/collection/components/select/resources.js +1 -1
  417. package/dist/collection/components/select/select.css +28 -0
  418. package/dist/collection/components/select/select.js +1 -1
  419. package/dist/collection/components/shell/resources.js +1 -1
  420. package/dist/collection/components/shell/shell.css +28 -0
  421. package/dist/collection/components/shell/shell.js +1 -1
  422. package/dist/collection/components/shell-center-row/resources.js +1 -1
  423. package/dist/collection/components/shell-center-row/shell-center-row.css +28 -0
  424. package/dist/collection/components/shell-center-row/shell-center-row.js +1 -4
  425. package/dist/collection/components/shell-panel/resources.js +1 -1
  426. package/dist/collection/components/shell-panel/shell-panel.css +28 -0
  427. package/dist/collection/components/shell-panel/shell-panel.js +1 -1
  428. package/dist/collection/components/slider/resources.js +1 -1
  429. package/dist/collection/components/slider/slider.css +28 -0
  430. package/dist/collection/components/slider/slider.js +1 -1
  431. package/dist/collection/components/sortable-list/resources.js +1 -1
  432. package/dist/collection/components/sortable-list/sortable-list.css +28 -0
  433. package/dist/collection/components/sortable-list/sortable-list.js +1 -1
  434. package/dist/collection/components/split-button/resources.js +1 -1
  435. package/dist/collection/components/split-button/split-button.css +28 -0
  436. package/dist/collection/components/split-button/split-button.js +1 -1
  437. package/dist/collection/components/stepper/stepper.css +28 -0
  438. package/dist/collection/components/stepper/stepper.js +1 -1
  439. package/dist/collection/components/stepper-item/stepper-item.css +28 -0
  440. package/dist/collection/components/stepper-item/stepper-item.js +1 -1
  441. package/dist/collection/components/switch/switch.css +28 -0
  442. package/dist/collection/components/switch/switch.js +1 -1
  443. package/dist/collection/components/tab/tab.css +28 -0
  444. package/dist/collection/components/tab/tab.js +1 -1
  445. package/dist/collection/components/tab-nav/tab-nav.css +28 -0
  446. package/dist/collection/components/tab-nav/tab-nav.js +1 -1
  447. package/dist/collection/components/tab-title/resources.js +1 -1
  448. package/dist/collection/components/tab-title/tab-title.css +28 -0
  449. package/dist/collection/components/tab-title/tab-title.js +1 -1
  450. package/dist/collection/components/tabs/resources.js +1 -1
  451. package/dist/collection/components/tabs/tabs.css +28 -0
  452. package/dist/collection/components/tabs/tabs.js +1 -1
  453. package/dist/collection/components/text-area/resources.js +1 -1
  454. package/dist/collection/components/text-area/text-area.css +28 -0
  455. package/dist/collection/components/text-area/text-area.js +1 -1
  456. package/dist/collection/components/tile/resources.js +1 -1
  457. package/dist/collection/components/tile/tile.css +28 -0
  458. package/dist/collection/components/tile/tile.js +1 -1
  459. package/dist/collection/components/tile-select/resources.js +1 -1
  460. package/dist/collection/components/tile-select/tile-select.css +28 -0
  461. package/dist/collection/components/tile-select/tile-select.js +1 -1
  462. package/dist/collection/components/tile-select-group/tile-select-group.css +28 -0
  463. package/dist/collection/components/tile-select-group/tile-select-group.js +1 -1
  464. package/dist/collection/components/time-picker/resources.js +1 -1
  465. package/dist/collection/components/time-picker/time-picker.css +28 -0
  466. package/dist/collection/components/time-picker/time-picker.js +1 -1
  467. package/dist/collection/components/tip/resources.js +1 -1
  468. package/dist/collection/components/tip/tip.css +28 -0
  469. package/dist/collection/components/tip/tip.js +1 -1
  470. package/dist/collection/components/tip-group/tip-group.css +28 -0
  471. package/dist/collection/components/tip-group/tip-group.js +1 -1
  472. package/dist/collection/components/tip-manager/resources.js +1 -1
  473. package/dist/collection/components/tip-manager/tip-manager.css +28 -0
  474. package/dist/collection/components/tip-manager/tip-manager.js +1 -1
  475. package/dist/collection/components/tooltip/TooltipManager.js +38 -24
  476. package/dist/collection/components/tooltip/resources.js +1 -1
  477. package/dist/collection/components/tooltip/tooltip.css +28 -0
  478. package/dist/collection/components/tooltip/tooltip.js +1 -1
  479. package/dist/collection/components/tooltip/utils.js +1 -1
  480. package/dist/collection/components/tree/tree.css +28 -0
  481. package/dist/collection/components/tree/tree.js +25 -12
  482. package/dist/collection/components/tree/utils.js +1 -1
  483. package/dist/collection/components/tree-item/resources.js +1 -1
  484. package/dist/collection/components/tree-item/tree-item.css +28 -0
  485. package/dist/collection/components/tree-item/tree-item.js +15 -8
  486. package/dist/collection/components/value-list/resources.js +1 -1
  487. package/dist/collection/components/value-list/utils.js +1 -1
  488. package/dist/collection/components/value-list/value-list.css +28 -0
  489. package/dist/collection/components/value-list/value-list.js +1 -1
  490. package/dist/collection/components/value-list-item/resources.js +1 -1
  491. package/dist/collection/components/value-list-item/value-list-item.css +28 -0
  492. package/dist/collection/components/value-list-item/value-list-item.js +1 -1
  493. package/dist/collection/index.js +1 -1
  494. package/dist/collection/utils/array.js +1 -1
  495. package/dist/collection/utils/conditionalSlot.js +1 -1
  496. package/dist/collection/utils/config.js +1 -1
  497. package/dist/collection/utils/date.js +1 -1
  498. package/dist/collection/utils/dom.js +114 -15
  499. package/dist/collection/utils/filter.js +1 -1
  500. package/dist/collection/utils/floating-ui.js +1 -1
  501. package/dist/collection/utils/focusTrapComponent.js +1 -1
  502. package/dist/collection/utils/form.js +1 -1
  503. package/dist/collection/utils/globalAttributes.js +1 -1
  504. package/dist/collection/utils/globalScript.js +1 -1
  505. package/dist/collection/utils/guid.js +1 -1
  506. package/dist/collection/utils/interactive.js +1 -1
  507. package/dist/collection/utils/key.js +1 -1
  508. package/dist/collection/utils/label.js +1 -1
  509. package/dist/collection/utils/loadable.js +1 -1
  510. package/dist/collection/utils/locale.js +1 -1
  511. package/dist/collection/utils/math.js +1 -1
  512. package/dist/collection/utils/mode.js +1 -1
  513. package/dist/collection/utils/number.js +1 -1
  514. package/dist/collection/utils/observers.js +1 -1
  515. package/dist/collection/utils/openCloseComponent.js +1 -1
  516. package/dist/collection/utils/resources.js +1 -1
  517. package/dist/collection/utils/t9n.js +1 -1
  518. package/dist/collection/utils/time.js +1 -1
  519. package/dist/components/ExpandToggle.js +1 -1
  520. package/dist/components/FloatingArrow.js +1 -1
  521. package/dist/components/Heading.js +1 -1
  522. package/dist/components/action-group.js +2 -2
  523. package/dist/components/action-menu.js +2 -2
  524. package/dist/components/action.js +2 -2
  525. package/dist/components/array.js +1 -1
  526. package/dist/components/button.js +2 -2
  527. package/dist/components/calcite-accordion-item.js +2 -2
  528. package/dist/components/calcite-accordion.js +2 -2
  529. package/dist/components/calcite-action-bar.js +2 -2
  530. package/dist/components/calcite-action-group.js +1 -1
  531. package/dist/components/calcite-action-menu.js +1 -1
  532. package/dist/components/calcite-action-pad.js +2 -2
  533. package/dist/components/calcite-action.js +1 -1
  534. package/dist/components/calcite-alert.js +2 -2
  535. package/dist/components/calcite-avatar.js +6 -4
  536. package/dist/components/calcite-block-section.js +2 -2
  537. package/dist/components/calcite-block.js +2 -2
  538. package/dist/components/calcite-button.js +1 -1
  539. package/dist/components/calcite-card.js +2 -2
  540. package/dist/components/calcite-checkbox.js +1 -1
  541. package/dist/components/calcite-chip-group.js +2 -2
  542. package/dist/components/calcite-chip.js +1 -1
  543. package/dist/components/calcite-color-picker-hex-input.js +2 -2
  544. package/dist/components/calcite-color-picker-swatch.js +1 -1
  545. package/dist/components/calcite-color-picker.js +377 -314
  546. package/dist/components/calcite-combobox-item-group.js +2 -2
  547. package/dist/components/calcite-combobox-item.js +2 -2
  548. package/dist/components/calcite-combobox.js +2 -2
  549. package/dist/components/calcite-date-picker-day.js +1 -1
  550. package/dist/components/calcite-date-picker-month-header.js +1 -1
  551. package/dist/components/calcite-date-picker-month.js +1 -1
  552. package/dist/components/calcite-date-picker.js +1 -1
  553. package/dist/components/calcite-dropdown-group.js +2 -2
  554. package/dist/components/calcite-dropdown-item.js +2 -2
  555. package/dist/components/calcite-dropdown.js +1 -1
  556. package/dist/components/calcite-fab.js +2 -2
  557. package/dist/components/calcite-filter.js +1 -1
  558. package/dist/components/calcite-flow-item.js +2 -2
  559. package/dist/components/calcite-flow.js +2 -2
  560. package/dist/components/calcite-graph.js +1 -1
  561. package/dist/components/calcite-handle.js +1 -1
  562. package/dist/components/calcite-icon.js +1 -1
  563. package/dist/components/calcite-inline-editable.js +2 -2
  564. package/dist/components/calcite-input-date-picker.js +2 -2
  565. package/dist/components/calcite-input-message.js +2 -2
  566. package/dist/components/calcite-input-number.js +2 -617
  567. package/dist/components/calcite-input-text.js +2 -2
  568. package/dist/components/calcite-input-time-picker.js +2 -2
  569. package/dist/components/calcite-input.js +1 -1
  570. package/dist/components/calcite-label.js +1 -1
  571. package/dist/components/calcite-link.js +1 -1
  572. package/dist/components/calcite-list-item-group.js +2 -2
  573. package/dist/components/calcite-list-item.js +2 -2
  574. package/dist/components/calcite-list.js +41 -31
  575. package/dist/components/calcite-loader.js +1 -1
  576. package/dist/components/calcite-modal.js +2 -2
  577. package/dist/components/calcite-notice.js +2 -2
  578. package/dist/components/calcite-option-group.js +2 -2
  579. package/dist/components/calcite-option.js +2 -2
  580. package/dist/components/calcite-pagination.js +2 -2
  581. package/dist/components/calcite-panel.js +1 -1
  582. package/dist/components/calcite-pick-list-group.js +2 -2
  583. package/dist/components/calcite-pick-list-item.js +1 -1
  584. package/dist/components/calcite-pick-list.js +2 -2
  585. package/dist/components/calcite-popover.js +1 -1
  586. package/dist/components/calcite-progress.js +1 -1
  587. package/dist/components/calcite-radio-button-group.js +2 -2
  588. package/dist/components/calcite-radio-button.js +2 -2
  589. package/dist/components/calcite-rating.js +2 -2
  590. package/dist/components/calcite-scrim.js +1 -1
  591. package/dist/components/calcite-segmented-control-item.js +2 -2
  592. package/dist/components/calcite-segmented-control.js +2 -2
  593. package/dist/components/calcite-select.js +2 -2
  594. package/dist/components/calcite-shell-center-row.js +2 -5
  595. package/dist/components/calcite-shell-panel.js +2 -2
  596. package/dist/components/calcite-shell.js +2 -2
  597. package/dist/components/calcite-slider.js +2 -2
  598. package/dist/components/calcite-sortable-list.js +2 -2
  599. package/dist/components/calcite-split-button.js +2 -2
  600. package/dist/components/calcite-stepper-item.js +2 -2
  601. package/dist/components/calcite-stepper.js +2 -2
  602. package/dist/components/calcite-switch.js +1 -1
  603. package/dist/components/calcite-tab-nav.js +1 -1
  604. package/dist/components/calcite-tab-title.js +1 -1
  605. package/dist/components/calcite-tab.js +1 -1
  606. package/dist/components/calcite-tabs.js +1 -1
  607. package/dist/components/calcite-text-area.js +2 -2
  608. package/dist/components/calcite-tile-select-group.js +2 -2
  609. package/dist/components/calcite-tile-select.js +2 -2
  610. package/dist/components/calcite-tile.js +1 -1
  611. package/dist/components/calcite-time-picker.js +1 -1
  612. package/dist/components/calcite-tip-group.js +2 -2
  613. package/dist/components/calcite-tip-manager.js +2 -2
  614. package/dist/components/calcite-tip.js +2 -2
  615. package/dist/components/calcite-tooltip.js +1 -1
  616. package/dist/components/calcite-tree-item.js +16 -9
  617. package/dist/components/calcite-tree.js +26 -13
  618. package/dist/components/calcite-value-list-item.js +2 -2
  619. package/dist/components/calcite-value-list.js +2 -2
  620. package/dist/components/checkbox.js +2 -2
  621. package/dist/components/chip.js +2 -2
  622. package/dist/components/color-picker-hex-input.js +252 -88
  623. package/dist/components/color-picker-swatch.js +42 -2118
  624. package/dist/components/composed-offset-position.esm.js +1 -1
  625. package/dist/components/conditionalSlot.js +1 -1
  626. package/dist/components/date-picker-day.js +2 -2
  627. package/dist/components/date-picker-month-header.js +2 -2
  628. package/dist/components/date-picker-month.js +2 -2
  629. package/dist/components/date-picker.js +3 -3
  630. package/dist/components/date.js +1 -1
  631. package/dist/components/debounce.js +1 -1
  632. package/dist/components/dom.js +114 -15
  633. package/dist/components/dropdown.js +2 -2
  634. package/dist/components/filter.js +2 -2
  635. package/dist/components/filter2.js +1 -1
  636. package/dist/components/floating-ui.js +68 -62
  637. package/dist/components/focusTrapComponent.js +1 -1
  638. package/dist/components/form.js +1 -1
  639. package/dist/components/graph.js +2 -2
  640. package/dist/components/guid.js +1 -1
  641. package/dist/components/handle.js +2 -2
  642. package/dist/components/icon.js +2 -2
  643. package/dist/components/index.js +1 -1
  644. package/dist/components/index2.js +2116 -0
  645. package/dist/components/input-number.js +623 -0
  646. package/dist/components/input.js +3 -3
  647. package/dist/components/interactive.js +1 -1
  648. package/dist/components/key.js +1 -1
  649. package/dist/components/label.js +2 -2
  650. package/dist/components/label2.js +1 -1
  651. package/dist/components/link.js +2 -2
  652. package/dist/components/loadable.js +1 -1
  653. package/dist/components/loader.js +2 -2
  654. package/dist/components/locale.js +2 -2
  655. package/dist/components/math.js +1 -1
  656. package/dist/components/observers.js +1 -1
  657. package/dist/components/openCloseComponent.js +1 -1
  658. package/dist/components/panel.js +2 -2
  659. package/dist/components/pick-list-item.js +2 -2
  660. package/dist/components/popover.js +2 -2
  661. package/dist/components/progress.js +2 -2
  662. package/dist/components/resources.js +1 -1
  663. package/dist/components/resources2.js +1 -1
  664. package/dist/components/resources3.js +1 -1
  665. package/dist/components/scrim.js +2 -2
  666. package/dist/components/shared-list-render.js +1 -1
  667. package/dist/components/sortable.esm.js +1 -1
  668. package/dist/components/switch.js +2 -2
  669. package/dist/components/t9n.js +1 -1
  670. package/dist/components/tab-nav.js +2 -2
  671. package/dist/components/tab-title.js +2 -2
  672. package/dist/components/tab.js +2 -2
  673. package/dist/components/tabs.js +2 -2
  674. package/dist/components/throttle.js +1 -1
  675. package/dist/components/tile.js +2 -2
  676. package/dist/components/time-picker.js +3 -3
  677. package/dist/components/tooltip.js +39 -25
  678. package/dist/components/utils.js +112 -31
  679. package/dist/components/utils2.js +1 -1
  680. package/dist/components/utils3.js +1 -1
  681. package/dist/esm/{ExpandToggle-b9435cd9.js → ExpandToggle-08d3fc16.js} +5 -5
  682. package/dist/esm/{FloatingArrow-c11f7328.js → FloatingArrow-2c212b17.js} +2 -2
  683. package/dist/esm/{Heading-cf0b7487.js → Heading-74a23d79.js} +2 -2
  684. package/dist/esm/{app-globals-4fed5e1d.js → app-globals-8c9ecd4d.js} +2 -2
  685. package/dist/esm/{array-358c609b.js → array-738e1ac6.js} +1 -1
  686. package/dist/esm/calcite-accordion_2.entry.js +9 -9
  687. package/dist/esm/calcite-action-bar.entry.js +16 -16
  688. package/dist/esm/calcite-action-group.entry.js +14 -14
  689. package/dist/esm/calcite-action-menu.entry.js +10 -10
  690. package/dist/esm/calcite-action-pad.entry.js +15 -15
  691. package/dist/esm/calcite-action.entry.js +12 -12
  692. package/dist/esm/calcite-alert.entry.js +13 -13
  693. package/dist/esm/calcite-avatar.entry.js +10 -9
  694. package/dist/esm/calcite-block_2.entry.js +14 -14
  695. package/dist/esm/calcite-button.entry.js +14 -14
  696. package/dist/esm/calcite-card.entry.js +11 -11
  697. package/dist/esm/calcite-checkbox.entry.js +11 -11
  698. package/dist/esm/calcite-chip-group.entry.js +9 -9
  699. package/dist/esm/calcite-chip.entry.js +13 -13
  700. package/dist/esm/calcite-color-picker_3.entry.js +585 -339
  701. package/dist/esm/calcite-combobox_3.entry.js +21 -21
  702. package/dist/esm/calcite-date-picker_4.entry.js +17 -17
  703. package/dist/esm/calcite-dropdown_3.entry.js +15 -15
  704. package/dist/esm/calcite-fab.entry.js +8 -8
  705. package/dist/esm/calcite-filter.entry.js +14 -14
  706. package/dist/esm/calcite-flow-item.entry.js +13 -13
  707. package/dist/esm/calcite-flow.entry.js +4 -4
  708. package/dist/esm/calcite-graph_2.entry.js +15 -15
  709. package/dist/esm/calcite-handle.entry.js +11 -11
  710. package/dist/esm/calcite-icon.entry.js +7 -7
  711. package/dist/esm/calcite-inline-editable.entry.js +13 -13
  712. package/dist/esm/calcite-input-date-picker.entry.js +19 -19
  713. package/dist/esm/calcite-input-message.entry.js +6 -6
  714. package/dist/esm/calcite-input-number.entry.js +14 -14
  715. package/dist/esm/calcite-input-text.entry.js +14 -14
  716. package/dist/esm/calcite-input-time-picker_2.entry.js +16 -16
  717. package/dist/esm/calcite-input.entry.js +14 -14
  718. package/dist/esm/calcite-label.entry.js +7 -7
  719. package/dist/esm/calcite-link.entry.js +8 -8
  720. package/dist/esm/calcite-list_3.entry.js +53 -43
  721. package/dist/esm/calcite-loader.entry.js +4 -4
  722. package/dist/esm/calcite-modal.entry.js +14 -14
  723. package/dist/esm/calcite-notice.entry.js +13 -13
  724. package/dist/esm/calcite-option_3.entry.js +13 -13
  725. package/dist/esm/calcite-pagination.entry.js +11 -11
  726. package/dist/esm/calcite-panel.entry.js +15 -15
  727. package/dist/esm/calcite-pick-list_3.entry.js +19 -19
  728. package/dist/esm/calcite-popover.entry.js +17 -17
  729. package/dist/esm/calcite-progress.entry.js +3 -3
  730. package/dist/esm/calcite-radio-button-group.entry.js +4 -4
  731. package/dist/esm/calcite-radio-button.entry.js +11 -11
  732. package/dist/esm/calcite-rating.entry.js +14 -14
  733. package/dist/esm/calcite-scrim.entry.js +10 -10
  734. package/dist/esm/calcite-segmented-control_2.entry.js +11 -11
  735. package/dist/esm/calcite-shell_3.entry.js +14 -17
  736. package/dist/esm/calcite-sortable-list.entry.js +6 -6
  737. package/dist/esm/calcite-split-button.entry.js +5 -5
  738. package/dist/esm/calcite-stepper_2.entry.js +12 -12
  739. package/dist/esm/calcite-switch.entry.js +11 -11
  740. package/dist/esm/calcite-tab_4.entry.js +11 -11
  741. package/dist/esm/calcite-text-area.entry.js +16 -16
  742. package/dist/esm/calcite-tile-select_2.entry.js +7 -7
  743. package/dist/esm/calcite-tile.entry.js +9 -9
  744. package/dist/esm/calcite-tip_3.entry.js +14 -14
  745. package/dist/esm/calcite-tooltip.entry.js +47 -33
  746. package/dist/esm/calcite-tree_2.entry.js +49 -29
  747. package/dist/esm/calcite-value-list_2.entry.js +18 -18
  748. package/dist/esm/calcite.js +6 -6
  749. package/dist/esm/{composed-offset-position.esm-7dad5f51.js → composed-offset-position.esm-7183f535.js} +1 -1
  750. package/dist/esm/{conditionalSlot-5cabd141.js → conditionalSlot-8dcf294e.js} +3 -3
  751. package/dist/esm/{debounce-3236c2d6.js → debounce-202fcbcd.js} +1 -1
  752. package/dist/esm/{dom-28b5e538.js → dom-bef76399.js} +116 -17
  753. package/dist/esm/{filter-698b6eb0.js → filter-99a00b00.js} +2 -2
  754. package/dist/esm/{floating-ui-b5749485.js → floating-ui-3b144250.js} +71 -65
  755. package/dist/esm/{focusTrapComponent-889051a9.js → focusTrapComponent-11da47cd.js} +2 -2
  756. package/dist/esm/{form-09082c06.js → form-9ec1fffc.js} +3 -3
  757. package/dist/esm/{guid-544471e1.js → guid-9fe3e534.js} +1 -1
  758. package/dist/esm/{index-5d088200.js → index-2db8a7e2.js} +1 -1
  759. package/dist/esm/index.js +2 -2
  760. package/dist/esm/{interactive-854fd770.js → interactive-bb1f57d0.js} +1 -1
  761. package/dist/esm/{key-fe7f0c5b.js → key-c032c64e.js} +1 -1
  762. package/dist/esm/{label-78d3672e.js → label-491a2111.js} +2 -2
  763. package/dist/esm/{loadable-1fd5df25.js → loadable-8dd0a87b.js} +1 -1
  764. package/dist/esm/loader.js +6 -6
  765. package/dist/esm/{locale-ca2b383e.js → locale-a0557607.js} +4 -4
  766. package/dist/esm/{math-144739fc.js → math-c3672f0c.js} +1 -1
  767. package/dist/esm/{observers-072ef19c.js → observers-600e50b2.js} +1 -1
  768. package/dist/esm/{openCloseComponent-6e2df95d.js → openCloseComponent-415e6baf.js} +2 -2
  769. package/dist/esm/{resources-bc08b0a8.js → resources-004115b1.js} +5 -5
  770. package/dist/esm/{resources-7c3efd5b.js → resources-07152e83.js} +1 -1
  771. package/dist/esm/{resources-81fb0e53.js → resources-30536763.js} +1 -1
  772. package/dist/esm/{resources-ae5aaa2f.js → resources-405d5533.js} +1 -1
  773. package/dist/esm/{resources-417fcb2c.js → resources-84de5e61.js} +1 -1
  774. package/dist/esm/{resources-0fd2a367.js → resources-8b8ca592.js} +1 -1
  775. package/dist/esm/{sortable.esm-2496d718.js → sortable.esm-b48569dd.js} +1 -1
  776. package/dist/esm/{t9n-a16b2bfd.js → t9n-5f6010b1.js} +3 -3
  777. package/dist/esm/{throttle-f248810f.js → throttle-c1467685.js} +2 -2
  778. package/dist/esm/{utils-dbad4ec5.js → utils-182a6956.js} +3 -3
  779. package/dist/esm/utils-c0bef67d.js +195 -0
  780. package/dist/extras/docs-json.json +193 -39
  781. package/dist/extras/vscode-data.json +28 -4
  782. package/dist/loader/cdn.js +1 -1
  783. package/dist/loader/index.cjs.js +1 -1
  784. package/dist/loader/index.es2017.js +1 -1
  785. package/dist/loader/index.js +1 -1
  786. package/dist/types/components/avatar/avatar.d.ts +3 -1
  787. package/dist/types/components/color-picker/color-picker.d.ts +55 -26
  788. package/dist/types/components/color-picker/interfaces.d.ts +1 -0
  789. package/dist/types/components/color-picker/resources.d.ts +28 -18
  790. package/dist/types/components/color-picker/utils.d.ts +16 -7
  791. package/dist/types/components/color-picker-hex-input/color-picker-hex-input.d.ts +33 -16
  792. package/dist/types/components/color-picker-hex-input/resources.d.ts +2 -2
  793. package/dist/types/components/color-picker-swatch/color-picker-swatch.d.ts +3 -2
  794. package/dist/types/components/color-picker-swatch/resources.d.ts +6 -1
  795. package/dist/types/components/flow-item/flow-item.d.ts +1 -1
  796. package/dist/types/components/list/list.d.ts +7 -2
  797. package/dist/types/components/list/resources.d.ts +1 -1
  798. package/dist/types/components/panel/panel.d.ts +1 -1
  799. package/dist/types/components/tooltip/TooltipManager.d.ts +3 -2
  800. package/dist/types/components/tree-item/tree-item.d.ts +2 -0
  801. package/dist/types/components.d.ts +74 -10
  802. package/dist/types/preact.d.ts +2 -1
  803. package/dist/types/utils/dom.d.ts +115 -19
  804. package/hydrate/index.js +1070 -597
  805. package/package.json +5 -6
  806. package/dist/calcite/p-0e62bf57.entry.js +0 -6
  807. package/dist/calcite/p-130cb272.entry.js +0 -6
  808. package/dist/calcite/p-137e2bb9.entry.js +0 -6
  809. package/dist/calcite/p-16186076.entry.js +0 -6
  810. package/dist/calcite/p-16eb38b3.entry.js +0 -6
  811. package/dist/calcite/p-16fa02e0.entry.js +0 -6
  812. package/dist/calcite/p-19558484.entry.js +0 -6
  813. package/dist/calcite/p-19eec879.entry.js +0 -6
  814. package/dist/calcite/p-1a2f0b78.entry.js +0 -6
  815. package/dist/calcite/p-1c134cca.entry.js +0 -6
  816. package/dist/calcite/p-1ea5ac9d.entry.js +0 -6
  817. package/dist/calcite/p-1ee8a27c.entry.js +0 -6
  818. package/dist/calcite/p-26900c87.entry.js +0 -6
  819. package/dist/calcite/p-2e37d908.entry.js +0 -6
  820. package/dist/calcite/p-331764e7.entry.js +0 -6
  821. package/dist/calcite/p-3480e564.js +0 -6
  822. package/dist/calcite/p-355c6b51.js +0 -6
  823. package/dist/calcite/p-3c07d6d9.entry.js +0 -6
  824. package/dist/calcite/p-43c67bb9.entry.js +0 -6
  825. package/dist/calcite/p-4fd321ce.entry.js +0 -6
  826. package/dist/calcite/p-5b450927.entry.js +0 -6
  827. package/dist/calcite/p-5f1f5c38.entry.js +0 -6
  828. package/dist/calcite/p-601ddd73.js +0 -6
  829. package/dist/calcite/p-6050736c.entry.js +0 -6
  830. package/dist/calcite/p-636d0418.entry.js +0 -6
  831. package/dist/calcite/p-647ebb8d.entry.js +0 -6
  832. package/dist/calcite/p-648773ca.entry.js +0 -6
  833. package/dist/calcite/p-69984379.entry.js +0 -6
  834. package/dist/calcite/p-6b999e6a.entry.js +0 -6
  835. package/dist/calcite/p-6f9a5b38.entry.js +0 -6
  836. package/dist/calcite/p-70dba721.entry.js +0 -6
  837. package/dist/calcite/p-77a01239.entry.js +0 -6
  838. package/dist/calcite/p-77e28424.entry.js +0 -6
  839. package/dist/calcite/p-77ffa8c0.entry.js +0 -6
  840. package/dist/calcite/p-78f1640b.entry.js +0 -6
  841. package/dist/calcite/p-8a791b50.entry.js +0 -6
  842. package/dist/calcite/p-8bfca736.entry.js +0 -6
  843. package/dist/calcite/p-8c36542e.entry.js +0 -6
  844. package/dist/calcite/p-8e7597b8.entry.js +0 -6
  845. package/dist/calcite/p-8eb242c3.entry.js +0 -6
  846. package/dist/calcite/p-8f36135a.entry.js +0 -6
  847. package/dist/calcite/p-91a65b3d.entry.js +0 -6
  848. package/dist/calcite/p-9419d79f.entry.js +0 -6
  849. package/dist/calcite/p-9a4aea5c.entry.js +0 -6
  850. package/dist/calcite/p-9e966c8c.entry.js +0 -6
  851. package/dist/calcite/p-9f70d531.entry.js +0 -6
  852. package/dist/calcite/p-a6964ccc.entry.js +0 -6
  853. package/dist/calcite/p-a7b6b725.entry.js +0 -6
  854. package/dist/calcite/p-b1128d62.entry.js +0 -6
  855. package/dist/calcite/p-b96e03be.entry.js +0 -6
  856. package/dist/calcite/p-bfd4b549.entry.js +0 -6
  857. package/dist/calcite/p-c0877b02.js +0 -6
  858. package/dist/calcite/p-ca503db0.entry.js +0 -6
  859. package/dist/calcite/p-ccdbdd3e.entry.js +0 -6
  860. package/dist/calcite/p-d025ac9c.entry.js +0 -6
  861. package/dist/calcite/p-d66139be.entry.js +0 -6
  862. package/dist/calcite/p-db810dad.js +0 -6
  863. package/dist/calcite/p-dc80a779.entry.js +0 -6
  864. package/dist/calcite/p-de9cb821.js +0 -6
  865. package/dist/calcite/p-ec46baf1.entry.js +0 -6
  866. package/dist/calcite/p-ede3f0a2.entry.js +0 -6
  867. package/dist/calcite/p-eebb35d7.entry.js +0 -6
  868. package/dist/calcite/p-f02dfea6.entry.js +0 -6
  869. package/dist/calcite/p-f3481dad.entry.js +0 -6
  870. package/dist/calcite/p-f3fd38f8.entry.js +0 -6
  871. package/dist/calcite/p-f54ae1ab.entry.js +0 -6
  872. package/dist/cjs/utils-a90ed219.js +0 -124
  873. package/dist/esm/utils-5f9ac4a7.js +0 -114
@@ -0,0 +1,2116 @@
1
+ /*!
2
+ * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
4
+ * v1.4.0-next.11
5
+ */
6
+ function createCommonjsModule(fn, basedir, module) {
7
+ return module = {
8
+ path: basedir,
9
+ exports: {},
10
+ require: function (path, base) {
11
+ return commonjsRequire();
12
+ }
13
+ }, fn(module, module.exports), module.exports;
14
+ }
15
+
16
+ function commonjsRequire () {
17
+ throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
18
+ }
19
+
20
+ var colorName$1 = {
21
+ "aliceblue": [240, 248, 255],
22
+ "antiquewhite": [250, 235, 215],
23
+ "aqua": [0, 255, 255],
24
+ "aquamarine": [127, 255, 212],
25
+ "azure": [240, 255, 255],
26
+ "beige": [245, 245, 220],
27
+ "bisque": [255, 228, 196],
28
+ "black": [0, 0, 0],
29
+ "blanchedalmond": [255, 235, 205],
30
+ "blue": [0, 0, 255],
31
+ "blueviolet": [138, 43, 226],
32
+ "brown": [165, 42, 42],
33
+ "burlywood": [222, 184, 135],
34
+ "cadetblue": [95, 158, 160],
35
+ "chartreuse": [127, 255, 0],
36
+ "chocolate": [210, 105, 30],
37
+ "coral": [255, 127, 80],
38
+ "cornflowerblue": [100, 149, 237],
39
+ "cornsilk": [255, 248, 220],
40
+ "crimson": [220, 20, 60],
41
+ "cyan": [0, 255, 255],
42
+ "darkblue": [0, 0, 139],
43
+ "darkcyan": [0, 139, 139],
44
+ "darkgoldenrod": [184, 134, 11],
45
+ "darkgray": [169, 169, 169],
46
+ "darkgreen": [0, 100, 0],
47
+ "darkgrey": [169, 169, 169],
48
+ "darkkhaki": [189, 183, 107],
49
+ "darkmagenta": [139, 0, 139],
50
+ "darkolivegreen": [85, 107, 47],
51
+ "darkorange": [255, 140, 0],
52
+ "darkorchid": [153, 50, 204],
53
+ "darkred": [139, 0, 0],
54
+ "darksalmon": [233, 150, 122],
55
+ "darkseagreen": [143, 188, 143],
56
+ "darkslateblue": [72, 61, 139],
57
+ "darkslategray": [47, 79, 79],
58
+ "darkslategrey": [47, 79, 79],
59
+ "darkturquoise": [0, 206, 209],
60
+ "darkviolet": [148, 0, 211],
61
+ "deeppink": [255, 20, 147],
62
+ "deepskyblue": [0, 191, 255],
63
+ "dimgray": [105, 105, 105],
64
+ "dimgrey": [105, 105, 105],
65
+ "dodgerblue": [30, 144, 255],
66
+ "firebrick": [178, 34, 34],
67
+ "floralwhite": [255, 250, 240],
68
+ "forestgreen": [34, 139, 34],
69
+ "fuchsia": [255, 0, 255],
70
+ "gainsboro": [220, 220, 220],
71
+ "ghostwhite": [248, 248, 255],
72
+ "gold": [255, 215, 0],
73
+ "goldenrod": [218, 165, 32],
74
+ "gray": [128, 128, 128],
75
+ "green": [0, 128, 0],
76
+ "greenyellow": [173, 255, 47],
77
+ "grey": [128, 128, 128],
78
+ "honeydew": [240, 255, 240],
79
+ "hotpink": [255, 105, 180],
80
+ "indianred": [205, 92, 92],
81
+ "indigo": [75, 0, 130],
82
+ "ivory": [255, 255, 240],
83
+ "khaki": [240, 230, 140],
84
+ "lavender": [230, 230, 250],
85
+ "lavenderblush": [255, 240, 245],
86
+ "lawngreen": [124, 252, 0],
87
+ "lemonchiffon": [255, 250, 205],
88
+ "lightblue": [173, 216, 230],
89
+ "lightcoral": [240, 128, 128],
90
+ "lightcyan": [224, 255, 255],
91
+ "lightgoldenrodyellow": [250, 250, 210],
92
+ "lightgray": [211, 211, 211],
93
+ "lightgreen": [144, 238, 144],
94
+ "lightgrey": [211, 211, 211],
95
+ "lightpink": [255, 182, 193],
96
+ "lightsalmon": [255, 160, 122],
97
+ "lightseagreen": [32, 178, 170],
98
+ "lightskyblue": [135, 206, 250],
99
+ "lightslategray": [119, 136, 153],
100
+ "lightslategrey": [119, 136, 153],
101
+ "lightsteelblue": [176, 196, 222],
102
+ "lightyellow": [255, 255, 224],
103
+ "lime": [0, 255, 0],
104
+ "limegreen": [50, 205, 50],
105
+ "linen": [250, 240, 230],
106
+ "magenta": [255, 0, 255],
107
+ "maroon": [128, 0, 0],
108
+ "mediumaquamarine": [102, 205, 170],
109
+ "mediumblue": [0, 0, 205],
110
+ "mediumorchid": [186, 85, 211],
111
+ "mediumpurple": [147, 112, 219],
112
+ "mediumseagreen": [60, 179, 113],
113
+ "mediumslateblue": [123, 104, 238],
114
+ "mediumspringgreen": [0, 250, 154],
115
+ "mediumturquoise": [72, 209, 204],
116
+ "mediumvioletred": [199, 21, 133],
117
+ "midnightblue": [25, 25, 112],
118
+ "mintcream": [245, 255, 250],
119
+ "mistyrose": [255, 228, 225],
120
+ "moccasin": [255, 228, 181],
121
+ "navajowhite": [255, 222, 173],
122
+ "navy": [0, 0, 128],
123
+ "oldlace": [253, 245, 230],
124
+ "olive": [128, 128, 0],
125
+ "olivedrab": [107, 142, 35],
126
+ "orange": [255, 165, 0],
127
+ "orangered": [255, 69, 0],
128
+ "orchid": [218, 112, 214],
129
+ "palegoldenrod": [238, 232, 170],
130
+ "palegreen": [152, 251, 152],
131
+ "paleturquoise": [175, 238, 238],
132
+ "palevioletred": [219, 112, 147],
133
+ "papayawhip": [255, 239, 213],
134
+ "peachpuff": [255, 218, 185],
135
+ "peru": [205, 133, 63],
136
+ "pink": [255, 192, 203],
137
+ "plum": [221, 160, 221],
138
+ "powderblue": [176, 224, 230],
139
+ "purple": [128, 0, 128],
140
+ "rebeccapurple": [102, 51, 153],
141
+ "red": [255, 0, 0],
142
+ "rosybrown": [188, 143, 143],
143
+ "royalblue": [65, 105, 225],
144
+ "saddlebrown": [139, 69, 19],
145
+ "salmon": [250, 128, 114],
146
+ "sandybrown": [244, 164, 96],
147
+ "seagreen": [46, 139, 87],
148
+ "seashell": [255, 245, 238],
149
+ "sienna": [160, 82, 45],
150
+ "silver": [192, 192, 192],
151
+ "skyblue": [135, 206, 235],
152
+ "slateblue": [106, 90, 205],
153
+ "slategray": [112, 128, 144],
154
+ "slategrey": [112, 128, 144],
155
+ "snow": [255, 250, 250],
156
+ "springgreen": [0, 255, 127],
157
+ "steelblue": [70, 130, 180],
158
+ "tan": [210, 180, 140],
159
+ "teal": [0, 128, 128],
160
+ "thistle": [216, 191, 216],
161
+ "tomato": [255, 99, 71],
162
+ "turquoise": [64, 224, 208],
163
+ "violet": [238, 130, 238],
164
+ "wheat": [245, 222, 179],
165
+ "white": [255, 255, 255],
166
+ "whitesmoke": [245, 245, 245],
167
+ "yellow": [255, 255, 0],
168
+ "yellowgreen": [154, 205, 50]
169
+ };
170
+
171
+ var isArrayish = function isArrayish(obj) {
172
+ if (!obj || typeof obj === 'string') {
173
+ return false;
174
+ }
175
+
176
+ return obj instanceof Array || Array.isArray(obj) ||
177
+ (obj.length >= 0 && (obj.splice instanceof Function ||
178
+ (Object.getOwnPropertyDescriptor(obj, (obj.length - 1)) && obj.constructor.name !== 'String')));
179
+ };
180
+
181
+ var simpleSwizzle = createCommonjsModule(function (module) {
182
+
183
+
184
+
185
+ var concat = Array.prototype.concat;
186
+ var slice = Array.prototype.slice;
187
+
188
+ var swizzle = module.exports = function swizzle(args) {
189
+ var results = [];
190
+
191
+ for (var i = 0, len = args.length; i < len; i++) {
192
+ var arg = args[i];
193
+
194
+ if (isArrayish(arg)) {
195
+ // http://jsperf.com/javascript-array-concat-vs-push/98
196
+ results = concat.call(results, slice.call(arg));
197
+ } else {
198
+ results.push(arg);
199
+ }
200
+ }
201
+
202
+ return results;
203
+ };
204
+
205
+ swizzle.wrap = function (fn) {
206
+ return function () {
207
+ return fn(swizzle(arguments));
208
+ };
209
+ };
210
+ });
211
+
212
+ var colorString = createCommonjsModule(function (module) {
213
+ /* MIT license */
214
+
215
+
216
+ var hasOwnProperty = Object.hasOwnProperty;
217
+
218
+ var reverseNames = {};
219
+
220
+ // create a list of reverse color names
221
+ for (var name in colorName$1) {
222
+ if (hasOwnProperty.call(colorName$1, name)) {
223
+ reverseNames[colorName$1[name]] = name;
224
+ }
225
+ }
226
+
227
+ var cs = module.exports = {
228
+ to: {},
229
+ get: {}
230
+ };
231
+
232
+ cs.get = function (string) {
233
+ var prefix = string.substring(0, 3).toLowerCase();
234
+ var val;
235
+ var model;
236
+ switch (prefix) {
237
+ case 'hsl':
238
+ val = cs.get.hsl(string);
239
+ model = 'hsl';
240
+ break;
241
+ case 'hwb':
242
+ val = cs.get.hwb(string);
243
+ model = 'hwb';
244
+ break;
245
+ default:
246
+ val = cs.get.rgb(string);
247
+ model = 'rgb';
248
+ break;
249
+ }
250
+
251
+ if (!val) {
252
+ return null;
253
+ }
254
+
255
+ return {model: model, value: val};
256
+ };
257
+
258
+ cs.get.rgb = function (string) {
259
+ if (!string) {
260
+ return null;
261
+ }
262
+
263
+ var abbr = /^#([a-f0-9]{3,4})$/i;
264
+ var hex = /^#([a-f0-9]{6})([a-f0-9]{2})?$/i;
265
+ var rgba = /^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/;
266
+ var per = /^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/;
267
+ var keyword = /^(\w+)$/;
268
+
269
+ var rgb = [0, 0, 0, 1];
270
+ var match;
271
+ var i;
272
+ var hexAlpha;
273
+
274
+ if (match = string.match(hex)) {
275
+ hexAlpha = match[2];
276
+ match = match[1];
277
+
278
+ for (i = 0; i < 3; i++) {
279
+ // https://jsperf.com/slice-vs-substr-vs-substring-methods-long-string/19
280
+ var i2 = i * 2;
281
+ rgb[i] = parseInt(match.slice(i2, i2 + 2), 16);
282
+ }
283
+
284
+ if (hexAlpha) {
285
+ rgb[3] = parseInt(hexAlpha, 16) / 255;
286
+ }
287
+ } else if (match = string.match(abbr)) {
288
+ match = match[1];
289
+ hexAlpha = match[3];
290
+
291
+ for (i = 0; i < 3; i++) {
292
+ rgb[i] = parseInt(match[i] + match[i], 16);
293
+ }
294
+
295
+ if (hexAlpha) {
296
+ rgb[3] = parseInt(hexAlpha + hexAlpha, 16) / 255;
297
+ }
298
+ } else if (match = string.match(rgba)) {
299
+ for (i = 0; i < 3; i++) {
300
+ rgb[i] = parseInt(match[i + 1], 0);
301
+ }
302
+
303
+ if (match[4]) {
304
+ if (match[5]) {
305
+ rgb[3] = parseFloat(match[4]) * 0.01;
306
+ } else {
307
+ rgb[3] = parseFloat(match[4]);
308
+ }
309
+ }
310
+ } else if (match = string.match(per)) {
311
+ for (i = 0; i < 3; i++) {
312
+ rgb[i] = Math.round(parseFloat(match[i + 1]) * 2.55);
313
+ }
314
+
315
+ if (match[4]) {
316
+ if (match[5]) {
317
+ rgb[3] = parseFloat(match[4]) * 0.01;
318
+ } else {
319
+ rgb[3] = parseFloat(match[4]);
320
+ }
321
+ }
322
+ } else if (match = string.match(keyword)) {
323
+ if (match[1] === 'transparent') {
324
+ return [0, 0, 0, 0];
325
+ }
326
+
327
+ if (!hasOwnProperty.call(colorName$1, match[1])) {
328
+ return null;
329
+ }
330
+
331
+ rgb = colorName$1[match[1]];
332
+ rgb[3] = 1;
333
+
334
+ return rgb;
335
+ } else {
336
+ return null;
337
+ }
338
+
339
+ for (i = 0; i < 3; i++) {
340
+ rgb[i] = clamp(rgb[i], 0, 255);
341
+ }
342
+ rgb[3] = clamp(rgb[3], 0, 1);
343
+
344
+ return rgb;
345
+ };
346
+
347
+ cs.get.hsl = function (string) {
348
+ if (!string) {
349
+ return null;
350
+ }
351
+
352
+ var 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*)?\)$/;
353
+ var match = string.match(hsl);
354
+
355
+ if (match) {
356
+ var alpha = parseFloat(match[4]);
357
+ var h = ((parseFloat(match[1]) % 360) + 360) % 360;
358
+ var s = clamp(parseFloat(match[2]), 0, 100);
359
+ var l = clamp(parseFloat(match[3]), 0, 100);
360
+ var a = clamp(isNaN(alpha) ? 1 : alpha, 0, 1);
361
+
362
+ return [h, s, l, a];
363
+ }
364
+
365
+ return null;
366
+ };
367
+
368
+ cs.get.hwb = function (string) {
369
+ if (!string) {
370
+ return null;
371
+ }
372
+
373
+ var 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*)?\)$/;
374
+ var match = string.match(hwb);
375
+
376
+ if (match) {
377
+ var alpha = parseFloat(match[4]);
378
+ var h = ((parseFloat(match[1]) % 360) + 360) % 360;
379
+ var w = clamp(parseFloat(match[2]), 0, 100);
380
+ var b = clamp(parseFloat(match[3]), 0, 100);
381
+ var a = clamp(isNaN(alpha) ? 1 : alpha, 0, 1);
382
+ return [h, w, b, a];
383
+ }
384
+
385
+ return null;
386
+ };
387
+
388
+ cs.to.hex = function () {
389
+ var rgba = simpleSwizzle(arguments);
390
+
391
+ return (
392
+ '#' +
393
+ hexDouble(rgba[0]) +
394
+ hexDouble(rgba[1]) +
395
+ hexDouble(rgba[2]) +
396
+ (rgba[3] < 1
397
+ ? (hexDouble(Math.round(rgba[3] * 255)))
398
+ : '')
399
+ );
400
+ };
401
+
402
+ cs.to.rgb = function () {
403
+ var rgba = simpleSwizzle(arguments);
404
+
405
+ return rgba.length < 4 || rgba[3] === 1
406
+ ? 'rgb(' + Math.round(rgba[0]) + ', ' + Math.round(rgba[1]) + ', ' + Math.round(rgba[2]) + ')'
407
+ : 'rgba(' + Math.round(rgba[0]) + ', ' + Math.round(rgba[1]) + ', ' + Math.round(rgba[2]) + ', ' + rgba[3] + ')';
408
+ };
409
+
410
+ cs.to.rgb.percent = function () {
411
+ var rgba = simpleSwizzle(arguments);
412
+
413
+ var r = Math.round(rgba[0] / 255 * 100);
414
+ var g = Math.round(rgba[1] / 255 * 100);
415
+ var b = Math.round(rgba[2] / 255 * 100);
416
+
417
+ return rgba.length < 4 || rgba[3] === 1
418
+ ? 'rgb(' + r + '%, ' + g + '%, ' + b + '%)'
419
+ : 'rgba(' + r + '%, ' + g + '%, ' + b + '%, ' + rgba[3] + ')';
420
+ };
421
+
422
+ cs.to.hsl = function () {
423
+ var hsla = simpleSwizzle(arguments);
424
+ return hsla.length < 4 || hsla[3] === 1
425
+ ? 'hsl(' + hsla[0] + ', ' + hsla[1] + '%, ' + hsla[2] + '%)'
426
+ : 'hsla(' + hsla[0] + ', ' + hsla[1] + '%, ' + hsla[2] + '%, ' + hsla[3] + ')';
427
+ };
428
+
429
+ // hwb is a bit different than rgb(a) & hsl(a) since there is no alpha specific syntax
430
+ // (hwb have alpha optional & 1 is default value)
431
+ cs.to.hwb = function () {
432
+ var hwba = simpleSwizzle(arguments);
433
+
434
+ var a = '';
435
+ if (hwba.length >= 4 && hwba[3] !== 1) {
436
+ a = ', ' + hwba[3];
437
+ }
438
+
439
+ return 'hwb(' + hwba[0] + ', ' + hwba[1] + '%, ' + hwba[2] + '%' + a + ')';
440
+ };
441
+
442
+ cs.to.keyword = function (rgb) {
443
+ return reverseNames[rgb.slice(0, 3)];
444
+ };
445
+
446
+ // helpers
447
+ function clamp(num, min, max) {
448
+ return Math.min(Math.max(min, num), max);
449
+ }
450
+
451
+ function hexDouble(num) {
452
+ var str = Math.round(num).toString(16).toUpperCase();
453
+ return (str.length < 2) ? '0' + str : str;
454
+ }
455
+ });
456
+
457
+ var colorName = {
458
+ "aliceblue": [240, 248, 255],
459
+ "antiquewhite": [250, 235, 215],
460
+ "aqua": [0, 255, 255],
461
+ "aquamarine": [127, 255, 212],
462
+ "azure": [240, 255, 255],
463
+ "beige": [245, 245, 220],
464
+ "bisque": [255, 228, 196],
465
+ "black": [0, 0, 0],
466
+ "blanchedalmond": [255, 235, 205],
467
+ "blue": [0, 0, 255],
468
+ "blueviolet": [138, 43, 226],
469
+ "brown": [165, 42, 42],
470
+ "burlywood": [222, 184, 135],
471
+ "cadetblue": [95, 158, 160],
472
+ "chartreuse": [127, 255, 0],
473
+ "chocolate": [210, 105, 30],
474
+ "coral": [255, 127, 80],
475
+ "cornflowerblue": [100, 149, 237],
476
+ "cornsilk": [255, 248, 220],
477
+ "crimson": [220, 20, 60],
478
+ "cyan": [0, 255, 255],
479
+ "darkblue": [0, 0, 139],
480
+ "darkcyan": [0, 139, 139],
481
+ "darkgoldenrod": [184, 134, 11],
482
+ "darkgray": [169, 169, 169],
483
+ "darkgreen": [0, 100, 0],
484
+ "darkgrey": [169, 169, 169],
485
+ "darkkhaki": [189, 183, 107],
486
+ "darkmagenta": [139, 0, 139],
487
+ "darkolivegreen": [85, 107, 47],
488
+ "darkorange": [255, 140, 0],
489
+ "darkorchid": [153, 50, 204],
490
+ "darkred": [139, 0, 0],
491
+ "darksalmon": [233, 150, 122],
492
+ "darkseagreen": [143, 188, 143],
493
+ "darkslateblue": [72, 61, 139],
494
+ "darkslategray": [47, 79, 79],
495
+ "darkslategrey": [47, 79, 79],
496
+ "darkturquoise": [0, 206, 209],
497
+ "darkviolet": [148, 0, 211],
498
+ "deeppink": [255, 20, 147],
499
+ "deepskyblue": [0, 191, 255],
500
+ "dimgray": [105, 105, 105],
501
+ "dimgrey": [105, 105, 105],
502
+ "dodgerblue": [30, 144, 255],
503
+ "firebrick": [178, 34, 34],
504
+ "floralwhite": [255, 250, 240],
505
+ "forestgreen": [34, 139, 34],
506
+ "fuchsia": [255, 0, 255],
507
+ "gainsboro": [220, 220, 220],
508
+ "ghostwhite": [248, 248, 255],
509
+ "gold": [255, 215, 0],
510
+ "goldenrod": [218, 165, 32],
511
+ "gray": [128, 128, 128],
512
+ "green": [0, 128, 0],
513
+ "greenyellow": [173, 255, 47],
514
+ "grey": [128, 128, 128],
515
+ "honeydew": [240, 255, 240],
516
+ "hotpink": [255, 105, 180],
517
+ "indianred": [205, 92, 92],
518
+ "indigo": [75, 0, 130],
519
+ "ivory": [255, 255, 240],
520
+ "khaki": [240, 230, 140],
521
+ "lavender": [230, 230, 250],
522
+ "lavenderblush": [255, 240, 245],
523
+ "lawngreen": [124, 252, 0],
524
+ "lemonchiffon": [255, 250, 205],
525
+ "lightblue": [173, 216, 230],
526
+ "lightcoral": [240, 128, 128],
527
+ "lightcyan": [224, 255, 255],
528
+ "lightgoldenrodyellow": [250, 250, 210],
529
+ "lightgray": [211, 211, 211],
530
+ "lightgreen": [144, 238, 144],
531
+ "lightgrey": [211, 211, 211],
532
+ "lightpink": [255, 182, 193],
533
+ "lightsalmon": [255, 160, 122],
534
+ "lightseagreen": [32, 178, 170],
535
+ "lightskyblue": [135, 206, 250],
536
+ "lightslategray": [119, 136, 153],
537
+ "lightslategrey": [119, 136, 153],
538
+ "lightsteelblue": [176, 196, 222],
539
+ "lightyellow": [255, 255, 224],
540
+ "lime": [0, 255, 0],
541
+ "limegreen": [50, 205, 50],
542
+ "linen": [250, 240, 230],
543
+ "magenta": [255, 0, 255],
544
+ "maroon": [128, 0, 0],
545
+ "mediumaquamarine": [102, 205, 170],
546
+ "mediumblue": [0, 0, 205],
547
+ "mediumorchid": [186, 85, 211],
548
+ "mediumpurple": [147, 112, 219],
549
+ "mediumseagreen": [60, 179, 113],
550
+ "mediumslateblue": [123, 104, 238],
551
+ "mediumspringgreen": [0, 250, 154],
552
+ "mediumturquoise": [72, 209, 204],
553
+ "mediumvioletred": [199, 21, 133],
554
+ "midnightblue": [25, 25, 112],
555
+ "mintcream": [245, 255, 250],
556
+ "mistyrose": [255, 228, 225],
557
+ "moccasin": [255, 228, 181],
558
+ "navajowhite": [255, 222, 173],
559
+ "navy": [0, 0, 128],
560
+ "oldlace": [253, 245, 230],
561
+ "olive": [128, 128, 0],
562
+ "olivedrab": [107, 142, 35],
563
+ "orange": [255, 165, 0],
564
+ "orangered": [255, 69, 0],
565
+ "orchid": [218, 112, 214],
566
+ "palegoldenrod": [238, 232, 170],
567
+ "palegreen": [152, 251, 152],
568
+ "paleturquoise": [175, 238, 238],
569
+ "palevioletred": [219, 112, 147],
570
+ "papayawhip": [255, 239, 213],
571
+ "peachpuff": [255, 218, 185],
572
+ "peru": [205, 133, 63],
573
+ "pink": [255, 192, 203],
574
+ "plum": [221, 160, 221],
575
+ "powderblue": [176, 224, 230],
576
+ "purple": [128, 0, 128],
577
+ "rebeccapurple": [102, 51, 153],
578
+ "red": [255, 0, 0],
579
+ "rosybrown": [188, 143, 143],
580
+ "royalblue": [65, 105, 225],
581
+ "saddlebrown": [139, 69, 19],
582
+ "salmon": [250, 128, 114],
583
+ "sandybrown": [244, 164, 96],
584
+ "seagreen": [46, 139, 87],
585
+ "seashell": [255, 245, 238],
586
+ "sienna": [160, 82, 45],
587
+ "silver": [192, 192, 192],
588
+ "skyblue": [135, 206, 235],
589
+ "slateblue": [106, 90, 205],
590
+ "slategray": [112, 128, 144],
591
+ "slategrey": [112, 128, 144],
592
+ "snow": [255, 250, 250],
593
+ "springgreen": [0, 255, 127],
594
+ "steelblue": [70, 130, 180],
595
+ "tan": [210, 180, 140],
596
+ "teal": [0, 128, 128],
597
+ "thistle": [216, 191, 216],
598
+ "tomato": [255, 99, 71],
599
+ "turquoise": [64, 224, 208],
600
+ "violet": [238, 130, 238],
601
+ "wheat": [245, 222, 179],
602
+ "white": [255, 255, 255],
603
+ "whitesmoke": [245, 245, 245],
604
+ "yellow": [255, 255, 0],
605
+ "yellowgreen": [154, 205, 50]
606
+ };
607
+
608
+ /* MIT license */
609
+ /* eslint-disable no-mixed-operators */
610
+
611
+
612
+ // NOTE: conversions should only return primitive values (i.e. arrays, or
613
+ // values that give correct `typeof` results).
614
+ // do not use box values types (i.e. Number(), String(), etc.)
615
+
616
+ const reverseKeywords = {};
617
+ for (const key of Object.keys(colorName)) {
618
+ reverseKeywords[colorName[key]] = key;
619
+ }
620
+
621
+ const convert$1 = {
622
+ rgb: {channels: 3, labels: 'rgb'},
623
+ hsl: {channels: 3, labels: 'hsl'},
624
+ hsv: {channels: 3, labels: 'hsv'},
625
+ hwb: {channels: 3, labels: 'hwb'},
626
+ cmyk: {channels: 4, labels: 'cmyk'},
627
+ xyz: {channels: 3, labels: 'xyz'},
628
+ lab: {channels: 3, labels: 'lab'},
629
+ lch: {channels: 3, labels: 'lch'},
630
+ hex: {channels: 1, labels: ['hex']},
631
+ keyword: {channels: 1, labels: ['keyword']},
632
+ ansi16: {channels: 1, labels: ['ansi16']},
633
+ ansi256: {channels: 1, labels: ['ansi256']},
634
+ hcg: {channels: 3, labels: ['h', 'c', 'g']},
635
+ apple: {channels: 3, labels: ['r16', 'g16', 'b16']},
636
+ gray: {channels: 1, labels: ['gray']}
637
+ };
638
+
639
+ var conversions = convert$1;
640
+
641
+ // Hide .channels and .labels properties
642
+ for (const model of Object.keys(convert$1)) {
643
+ if (!('channels' in convert$1[model])) {
644
+ throw new Error('missing channels property: ' + model);
645
+ }
646
+
647
+ if (!('labels' in convert$1[model])) {
648
+ throw new Error('missing channel labels property: ' + model);
649
+ }
650
+
651
+ if (convert$1[model].labels.length !== convert$1[model].channels) {
652
+ throw new Error('channel and label counts mismatch: ' + model);
653
+ }
654
+
655
+ const {channels, labels} = convert$1[model];
656
+ delete convert$1[model].channels;
657
+ delete convert$1[model].labels;
658
+ Object.defineProperty(convert$1[model], 'channels', {value: channels});
659
+ Object.defineProperty(convert$1[model], 'labels', {value: labels});
660
+ }
661
+
662
+ convert$1.rgb.hsl = function (rgb) {
663
+ const r = rgb[0] / 255;
664
+ const g = rgb[1] / 255;
665
+ const b = rgb[2] / 255;
666
+ const min = Math.min(r, g, b);
667
+ const max = Math.max(r, g, b);
668
+ const delta = max - min;
669
+ let h;
670
+ let s;
671
+
672
+ if (max === min) {
673
+ h = 0;
674
+ } else if (r === max) {
675
+ h = (g - b) / delta;
676
+ } else if (g === max) {
677
+ h = 2 + (b - r) / delta;
678
+ } else if (b === max) {
679
+ h = 4 + (r - g) / delta;
680
+ }
681
+
682
+ h = Math.min(h * 60, 360);
683
+
684
+ if (h < 0) {
685
+ h += 360;
686
+ }
687
+
688
+ const l = (min + max) / 2;
689
+
690
+ if (max === min) {
691
+ s = 0;
692
+ } else if (l <= 0.5) {
693
+ s = delta / (max + min);
694
+ } else {
695
+ s = delta / (2 - max - min);
696
+ }
697
+
698
+ return [h, s * 100, l * 100];
699
+ };
700
+
701
+ convert$1.rgb.hsv = function (rgb) {
702
+ let rdif;
703
+ let gdif;
704
+ let bdif;
705
+ let h;
706
+ let s;
707
+
708
+ const r = rgb[0] / 255;
709
+ const g = rgb[1] / 255;
710
+ const b = rgb[2] / 255;
711
+ const v = Math.max(r, g, b);
712
+ const diff = v - Math.min(r, g, b);
713
+ const diffc = function (c) {
714
+ return (v - c) / 6 / diff + 1 / 2;
715
+ };
716
+
717
+ if (diff === 0) {
718
+ h = 0;
719
+ s = 0;
720
+ } else {
721
+ s = diff / v;
722
+ rdif = diffc(r);
723
+ gdif = diffc(g);
724
+ bdif = diffc(b);
725
+
726
+ if (r === v) {
727
+ h = bdif - gdif;
728
+ } else if (g === v) {
729
+ h = (1 / 3) + rdif - bdif;
730
+ } else if (b === v) {
731
+ h = (2 / 3) + gdif - rdif;
732
+ }
733
+
734
+ if (h < 0) {
735
+ h += 1;
736
+ } else if (h > 1) {
737
+ h -= 1;
738
+ }
739
+ }
740
+
741
+ return [
742
+ h * 360,
743
+ s * 100,
744
+ v * 100
745
+ ];
746
+ };
747
+
748
+ convert$1.rgb.hwb = function (rgb) {
749
+ const r = rgb[0];
750
+ const g = rgb[1];
751
+ let b = rgb[2];
752
+ const h = convert$1.rgb.hsl(rgb)[0];
753
+ const w = 1 / 255 * Math.min(r, Math.min(g, b));
754
+
755
+ b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
756
+
757
+ return [h, w * 100, b * 100];
758
+ };
759
+
760
+ convert$1.rgb.cmyk = function (rgb) {
761
+ const r = rgb[0] / 255;
762
+ const g = rgb[1] / 255;
763
+ const b = rgb[2] / 255;
764
+
765
+ const k = Math.min(1 - r, 1 - g, 1 - b);
766
+ const c = (1 - r - k) / (1 - k) || 0;
767
+ const m = (1 - g - k) / (1 - k) || 0;
768
+ const y = (1 - b - k) / (1 - k) || 0;
769
+
770
+ return [c * 100, m * 100, y * 100, k * 100];
771
+ };
772
+
773
+ function comparativeDistance(x, y) {
774
+ /*
775
+ See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance
776
+ */
777
+ return (
778
+ ((x[0] - y[0]) ** 2) +
779
+ ((x[1] - y[1]) ** 2) +
780
+ ((x[2] - y[2]) ** 2)
781
+ );
782
+ }
783
+
784
+ convert$1.rgb.keyword = function (rgb) {
785
+ const reversed = reverseKeywords[rgb];
786
+ if (reversed) {
787
+ return reversed;
788
+ }
789
+
790
+ let currentClosestDistance = Infinity;
791
+ let currentClosestKeyword;
792
+
793
+ for (const keyword of Object.keys(colorName)) {
794
+ const value = colorName[keyword];
795
+
796
+ // Compute comparative distance
797
+ const distance = comparativeDistance(rgb, value);
798
+
799
+ // Check if its less, if so set as closest
800
+ if (distance < currentClosestDistance) {
801
+ currentClosestDistance = distance;
802
+ currentClosestKeyword = keyword;
803
+ }
804
+ }
805
+
806
+ return currentClosestKeyword;
807
+ };
808
+
809
+ convert$1.keyword.rgb = function (keyword) {
810
+ return colorName[keyword];
811
+ };
812
+
813
+ convert$1.rgb.xyz = function (rgb) {
814
+ let r = rgb[0] / 255;
815
+ let g = rgb[1] / 255;
816
+ let b = rgb[2] / 255;
817
+
818
+ // Assume sRGB
819
+ r = r > 0.04045 ? (((r + 0.055) / 1.055) ** 2.4) : (r / 12.92);
820
+ g = g > 0.04045 ? (((g + 0.055) / 1.055) ** 2.4) : (g / 12.92);
821
+ b = b > 0.04045 ? (((b + 0.055) / 1.055) ** 2.4) : (b / 12.92);
822
+
823
+ const x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805);
824
+ const y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722);
825
+ const z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505);
826
+
827
+ return [x * 100, y * 100, z * 100];
828
+ };
829
+
830
+ convert$1.rgb.lab = function (rgb) {
831
+ const xyz = convert$1.rgb.xyz(rgb);
832
+ let x = xyz[0];
833
+ let y = xyz[1];
834
+ let z = xyz[2];
835
+
836
+ x /= 95.047;
837
+ y /= 100;
838
+ z /= 108.883;
839
+
840
+ x = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116);
841
+ y = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116);
842
+ z = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116);
843
+
844
+ const l = (116 * y) - 16;
845
+ const a = 500 * (x - y);
846
+ const b = 200 * (y - z);
847
+
848
+ return [l, a, b];
849
+ };
850
+
851
+ convert$1.hsl.rgb = function (hsl) {
852
+ const h = hsl[0] / 360;
853
+ const s = hsl[1] / 100;
854
+ const l = hsl[2] / 100;
855
+ let t2;
856
+ let t3;
857
+ let val;
858
+
859
+ if (s === 0) {
860
+ val = l * 255;
861
+ return [val, val, val];
862
+ }
863
+
864
+ if (l < 0.5) {
865
+ t2 = l * (1 + s);
866
+ } else {
867
+ t2 = l + s - l * s;
868
+ }
869
+
870
+ const t1 = 2 * l - t2;
871
+
872
+ const rgb = [0, 0, 0];
873
+ for (let i = 0; i < 3; i++) {
874
+ t3 = h + 1 / 3 * -(i - 1);
875
+ if (t3 < 0) {
876
+ t3++;
877
+ }
878
+
879
+ if (t3 > 1) {
880
+ t3--;
881
+ }
882
+
883
+ if (6 * t3 < 1) {
884
+ val = t1 + (t2 - t1) * 6 * t3;
885
+ } else if (2 * t3 < 1) {
886
+ val = t2;
887
+ } else if (3 * t3 < 2) {
888
+ val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
889
+ } else {
890
+ val = t1;
891
+ }
892
+
893
+ rgb[i] = val * 255;
894
+ }
895
+
896
+ return rgb;
897
+ };
898
+
899
+ convert$1.hsl.hsv = function (hsl) {
900
+ const h = hsl[0];
901
+ let s = hsl[1] / 100;
902
+ let l = hsl[2] / 100;
903
+ let smin = s;
904
+ const lmin = Math.max(l, 0.01);
905
+
906
+ l *= 2;
907
+ s *= (l <= 1) ? l : 2 - l;
908
+ smin *= lmin <= 1 ? lmin : 2 - lmin;
909
+ const v = (l + s) / 2;
910
+ const sv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s);
911
+
912
+ return [h, sv * 100, v * 100];
913
+ };
914
+
915
+ convert$1.hsv.rgb = function (hsv) {
916
+ const h = hsv[0] / 60;
917
+ const s = hsv[1] / 100;
918
+ let v = hsv[2] / 100;
919
+ const hi = Math.floor(h) % 6;
920
+
921
+ const f = h - Math.floor(h);
922
+ const p = 255 * v * (1 - s);
923
+ const q = 255 * v * (1 - (s * f));
924
+ const t = 255 * v * (1 - (s * (1 - f)));
925
+ v *= 255;
926
+
927
+ switch (hi) {
928
+ case 0:
929
+ return [v, t, p];
930
+ case 1:
931
+ return [q, v, p];
932
+ case 2:
933
+ return [p, v, t];
934
+ case 3:
935
+ return [p, q, v];
936
+ case 4:
937
+ return [t, p, v];
938
+ case 5:
939
+ return [v, p, q];
940
+ }
941
+ };
942
+
943
+ convert$1.hsv.hsl = function (hsv) {
944
+ const h = hsv[0];
945
+ const s = hsv[1] / 100;
946
+ const v = hsv[2] / 100;
947
+ const vmin = Math.max(v, 0.01);
948
+ let sl;
949
+ let l;
950
+
951
+ l = (2 - s) * v;
952
+ const lmin = (2 - s) * vmin;
953
+ sl = s * vmin;
954
+ sl /= (lmin <= 1) ? lmin : 2 - lmin;
955
+ sl = sl || 0;
956
+ l /= 2;
957
+
958
+ return [h, sl * 100, l * 100];
959
+ };
960
+
961
+ // http://dev.w3.org/csswg/css-color/#hwb-to-rgb
962
+ convert$1.hwb.rgb = function (hwb) {
963
+ const h = hwb[0] / 360;
964
+ let wh = hwb[1] / 100;
965
+ let bl = hwb[2] / 100;
966
+ const ratio = wh + bl;
967
+ let f;
968
+
969
+ // Wh + bl cant be > 1
970
+ if (ratio > 1) {
971
+ wh /= ratio;
972
+ bl /= ratio;
973
+ }
974
+
975
+ const i = Math.floor(6 * h);
976
+ const v = 1 - bl;
977
+ f = 6 * h - i;
978
+
979
+ if ((i & 0x01) !== 0) {
980
+ f = 1 - f;
981
+ }
982
+
983
+ const n = wh + f * (v - wh); // Linear interpolation
984
+
985
+ let r;
986
+ let g;
987
+ let b;
988
+ /* eslint-disable max-statements-per-line,no-multi-spaces */
989
+ switch (i) {
990
+ default:
991
+ case 6:
992
+ case 0: r = v; g = n; b = wh; break;
993
+ case 1: r = n; g = v; b = wh; break;
994
+ case 2: r = wh; g = v; b = n; break;
995
+ case 3: r = wh; g = n; b = v; break;
996
+ case 4: r = n; g = wh; b = v; break;
997
+ case 5: r = v; g = wh; b = n; break;
998
+ }
999
+ /* eslint-enable max-statements-per-line,no-multi-spaces */
1000
+
1001
+ return [r * 255, g * 255, b * 255];
1002
+ };
1003
+
1004
+ convert$1.cmyk.rgb = function (cmyk) {
1005
+ const c = cmyk[0] / 100;
1006
+ const m = cmyk[1] / 100;
1007
+ const y = cmyk[2] / 100;
1008
+ const k = cmyk[3] / 100;
1009
+
1010
+ const r = 1 - Math.min(1, c * (1 - k) + k);
1011
+ const g = 1 - Math.min(1, m * (1 - k) + k);
1012
+ const b = 1 - Math.min(1, y * (1 - k) + k);
1013
+
1014
+ return [r * 255, g * 255, b * 255];
1015
+ };
1016
+
1017
+ convert$1.xyz.rgb = function (xyz) {
1018
+ const x = xyz[0] / 100;
1019
+ const y = xyz[1] / 100;
1020
+ const z = xyz[2] / 100;
1021
+ let r;
1022
+ let g;
1023
+ let b;
1024
+
1025
+ r = (x * 3.2406) + (y * -1.5372) + (z * -0.4986);
1026
+ g = (x * -0.9689) + (y * 1.8758) + (z * 0.0415);
1027
+ b = (x * 0.0557) + (y * -0.2040) + (z * 1.0570);
1028
+
1029
+ // Assume sRGB
1030
+ r = r > 0.0031308
1031
+ ? ((1.055 * (r ** (1.0 / 2.4))) - 0.055)
1032
+ : r * 12.92;
1033
+
1034
+ g = g > 0.0031308
1035
+ ? ((1.055 * (g ** (1.0 / 2.4))) - 0.055)
1036
+ : g * 12.92;
1037
+
1038
+ b = b > 0.0031308
1039
+ ? ((1.055 * (b ** (1.0 / 2.4))) - 0.055)
1040
+ : b * 12.92;
1041
+
1042
+ r = Math.min(Math.max(0, r), 1);
1043
+ g = Math.min(Math.max(0, g), 1);
1044
+ b = Math.min(Math.max(0, b), 1);
1045
+
1046
+ return [r * 255, g * 255, b * 255];
1047
+ };
1048
+
1049
+ convert$1.xyz.lab = function (xyz) {
1050
+ let x = xyz[0];
1051
+ let y = xyz[1];
1052
+ let z = xyz[2];
1053
+
1054
+ x /= 95.047;
1055
+ y /= 100;
1056
+ z /= 108.883;
1057
+
1058
+ x = x > 0.008856 ? (x ** (1 / 3)) : (7.787 * x) + (16 / 116);
1059
+ y = y > 0.008856 ? (y ** (1 / 3)) : (7.787 * y) + (16 / 116);
1060
+ z = z > 0.008856 ? (z ** (1 / 3)) : (7.787 * z) + (16 / 116);
1061
+
1062
+ const l = (116 * y) - 16;
1063
+ const a = 500 * (x - y);
1064
+ const b = 200 * (y - z);
1065
+
1066
+ return [l, a, b];
1067
+ };
1068
+
1069
+ convert$1.lab.xyz = function (lab) {
1070
+ const l = lab[0];
1071
+ const a = lab[1];
1072
+ const b = lab[2];
1073
+ let x;
1074
+ let y;
1075
+ let z;
1076
+
1077
+ y = (l + 16) / 116;
1078
+ x = a / 500 + y;
1079
+ z = y - b / 200;
1080
+
1081
+ const y2 = y ** 3;
1082
+ const x2 = x ** 3;
1083
+ const z2 = z ** 3;
1084
+ y = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787;
1085
+ x = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787;
1086
+ z = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787;
1087
+
1088
+ x *= 95.047;
1089
+ y *= 100;
1090
+ z *= 108.883;
1091
+
1092
+ return [x, y, z];
1093
+ };
1094
+
1095
+ convert$1.lab.lch = function (lab) {
1096
+ const l = lab[0];
1097
+ const a = lab[1];
1098
+ const b = lab[2];
1099
+ let h;
1100
+
1101
+ const hr = Math.atan2(b, a);
1102
+ h = hr * 360 / 2 / Math.PI;
1103
+
1104
+ if (h < 0) {
1105
+ h += 360;
1106
+ }
1107
+
1108
+ const c = Math.sqrt(a * a + b * b);
1109
+
1110
+ return [l, c, h];
1111
+ };
1112
+
1113
+ convert$1.lch.lab = function (lch) {
1114
+ const l = lch[0];
1115
+ const c = lch[1];
1116
+ const h = lch[2];
1117
+
1118
+ const hr = h / 360 * 2 * Math.PI;
1119
+ const a = c * Math.cos(hr);
1120
+ const b = c * Math.sin(hr);
1121
+
1122
+ return [l, a, b];
1123
+ };
1124
+
1125
+ convert$1.rgb.ansi16 = function (args, saturation = null) {
1126
+ const [r, g, b] = args;
1127
+ let value = saturation === null ? convert$1.rgb.hsv(args)[2] : saturation; // Hsv -> ansi16 optimization
1128
+
1129
+ value = Math.round(value / 50);
1130
+
1131
+ if (value === 0) {
1132
+ return 30;
1133
+ }
1134
+
1135
+ let ansi = 30
1136
+ + ((Math.round(b / 255) << 2)
1137
+ | (Math.round(g / 255) << 1)
1138
+ | Math.round(r / 255));
1139
+
1140
+ if (value === 2) {
1141
+ ansi += 60;
1142
+ }
1143
+
1144
+ return ansi;
1145
+ };
1146
+
1147
+ convert$1.hsv.ansi16 = function (args) {
1148
+ // Optimization here; we already know the value and don't need to get
1149
+ // it converted for us.
1150
+ return convert$1.rgb.ansi16(convert$1.hsv.rgb(args), args[2]);
1151
+ };
1152
+
1153
+ convert$1.rgb.ansi256 = function (args) {
1154
+ const r = args[0];
1155
+ const g = args[1];
1156
+ const b = args[2];
1157
+
1158
+ // We use the extended greyscale palette here, with the exception of
1159
+ // black and white. normal palette only has 4 greyscale shades.
1160
+ if (r === g && g === b) {
1161
+ if (r < 8) {
1162
+ return 16;
1163
+ }
1164
+
1165
+ if (r > 248) {
1166
+ return 231;
1167
+ }
1168
+
1169
+ return Math.round(((r - 8) / 247) * 24) + 232;
1170
+ }
1171
+
1172
+ const ansi = 16
1173
+ + (36 * Math.round(r / 255 * 5))
1174
+ + (6 * Math.round(g / 255 * 5))
1175
+ + Math.round(b / 255 * 5);
1176
+
1177
+ return ansi;
1178
+ };
1179
+
1180
+ convert$1.ansi16.rgb = function (args) {
1181
+ let color = args % 10;
1182
+
1183
+ // Handle greyscale
1184
+ if (color === 0 || color === 7) {
1185
+ if (args > 50) {
1186
+ color += 3.5;
1187
+ }
1188
+
1189
+ color = color / 10.5 * 255;
1190
+
1191
+ return [color, color, color];
1192
+ }
1193
+
1194
+ const mult = (~~(args > 50) + 1) * 0.5;
1195
+ const r = ((color & 1) * mult) * 255;
1196
+ const g = (((color >> 1) & 1) * mult) * 255;
1197
+ const b = (((color >> 2) & 1) * mult) * 255;
1198
+
1199
+ return [r, g, b];
1200
+ };
1201
+
1202
+ convert$1.ansi256.rgb = function (args) {
1203
+ // Handle greyscale
1204
+ if (args >= 232) {
1205
+ const c = (args - 232) * 10 + 8;
1206
+ return [c, c, c];
1207
+ }
1208
+
1209
+ args -= 16;
1210
+
1211
+ let rem;
1212
+ const r = Math.floor(args / 36) / 5 * 255;
1213
+ const g = Math.floor((rem = args % 36) / 6) / 5 * 255;
1214
+ const b = (rem % 6) / 5 * 255;
1215
+
1216
+ return [r, g, b];
1217
+ };
1218
+
1219
+ convert$1.rgb.hex = function (args) {
1220
+ const integer = ((Math.round(args[0]) & 0xFF) << 16)
1221
+ + ((Math.round(args[1]) & 0xFF) << 8)
1222
+ + (Math.round(args[2]) & 0xFF);
1223
+
1224
+ const string = integer.toString(16).toUpperCase();
1225
+ return '000000'.substring(string.length) + string;
1226
+ };
1227
+
1228
+ convert$1.hex.rgb = function (args) {
1229
+ const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
1230
+ if (!match) {
1231
+ return [0, 0, 0];
1232
+ }
1233
+
1234
+ let colorString = match[0];
1235
+
1236
+ if (match[0].length === 3) {
1237
+ colorString = colorString.split('').map(char => {
1238
+ return char + char;
1239
+ }).join('');
1240
+ }
1241
+
1242
+ const integer = parseInt(colorString, 16);
1243
+ const r = (integer >> 16) & 0xFF;
1244
+ const g = (integer >> 8) & 0xFF;
1245
+ const b = integer & 0xFF;
1246
+
1247
+ return [r, g, b];
1248
+ };
1249
+
1250
+ convert$1.rgb.hcg = function (rgb) {
1251
+ const r = rgb[0] / 255;
1252
+ const g = rgb[1] / 255;
1253
+ const b = rgb[2] / 255;
1254
+ const max = Math.max(Math.max(r, g), b);
1255
+ const min = Math.min(Math.min(r, g), b);
1256
+ const chroma = (max - min);
1257
+ let grayscale;
1258
+ let hue;
1259
+
1260
+ if (chroma < 1) {
1261
+ grayscale = min / (1 - chroma);
1262
+ } else {
1263
+ grayscale = 0;
1264
+ }
1265
+
1266
+ if (chroma <= 0) {
1267
+ hue = 0;
1268
+ } else
1269
+ if (max === r) {
1270
+ hue = ((g - b) / chroma) % 6;
1271
+ } else
1272
+ if (max === g) {
1273
+ hue = 2 + (b - r) / chroma;
1274
+ } else {
1275
+ hue = 4 + (r - g) / chroma;
1276
+ }
1277
+
1278
+ hue /= 6;
1279
+ hue %= 1;
1280
+
1281
+ return [hue * 360, chroma * 100, grayscale * 100];
1282
+ };
1283
+
1284
+ convert$1.hsl.hcg = function (hsl) {
1285
+ const s = hsl[1] / 100;
1286
+ const l = hsl[2] / 100;
1287
+
1288
+ const c = l < 0.5 ? (2.0 * s * l) : (2.0 * s * (1.0 - l));
1289
+
1290
+ let f = 0;
1291
+ if (c < 1.0) {
1292
+ f = (l - 0.5 * c) / (1.0 - c);
1293
+ }
1294
+
1295
+ return [hsl[0], c * 100, f * 100];
1296
+ };
1297
+
1298
+ convert$1.hsv.hcg = function (hsv) {
1299
+ const s = hsv[1] / 100;
1300
+ const v = hsv[2] / 100;
1301
+
1302
+ const c = s * v;
1303
+ let f = 0;
1304
+
1305
+ if (c < 1.0) {
1306
+ f = (v - c) / (1 - c);
1307
+ }
1308
+
1309
+ return [hsv[0], c * 100, f * 100];
1310
+ };
1311
+
1312
+ convert$1.hcg.rgb = function (hcg) {
1313
+ const h = hcg[0] / 360;
1314
+ const c = hcg[1] / 100;
1315
+ const g = hcg[2] / 100;
1316
+
1317
+ if (c === 0.0) {
1318
+ return [g * 255, g * 255, g * 255];
1319
+ }
1320
+
1321
+ const pure = [0, 0, 0];
1322
+ const hi = (h % 1) * 6;
1323
+ const v = hi % 1;
1324
+ const w = 1 - v;
1325
+ let mg = 0;
1326
+
1327
+ /* eslint-disable max-statements-per-line */
1328
+ switch (Math.floor(hi)) {
1329
+ case 0:
1330
+ pure[0] = 1; pure[1] = v; pure[2] = 0; break;
1331
+ case 1:
1332
+ pure[0] = w; pure[1] = 1; pure[2] = 0; break;
1333
+ case 2:
1334
+ pure[0] = 0; pure[1] = 1; pure[2] = v; break;
1335
+ case 3:
1336
+ pure[0] = 0; pure[1] = w; pure[2] = 1; break;
1337
+ case 4:
1338
+ pure[0] = v; pure[1] = 0; pure[2] = 1; break;
1339
+ default:
1340
+ pure[0] = 1; pure[1] = 0; pure[2] = w;
1341
+ }
1342
+ /* eslint-enable max-statements-per-line */
1343
+
1344
+ mg = (1.0 - c) * g;
1345
+
1346
+ return [
1347
+ (c * pure[0] + mg) * 255,
1348
+ (c * pure[1] + mg) * 255,
1349
+ (c * pure[2] + mg) * 255
1350
+ ];
1351
+ };
1352
+
1353
+ convert$1.hcg.hsv = function (hcg) {
1354
+ const c = hcg[1] / 100;
1355
+ const g = hcg[2] / 100;
1356
+
1357
+ const v = c + g * (1.0 - c);
1358
+ let f = 0;
1359
+
1360
+ if (v > 0.0) {
1361
+ f = c / v;
1362
+ }
1363
+
1364
+ return [hcg[0], f * 100, v * 100];
1365
+ };
1366
+
1367
+ convert$1.hcg.hsl = function (hcg) {
1368
+ const c = hcg[1] / 100;
1369
+ const g = hcg[2] / 100;
1370
+
1371
+ const l = g * (1.0 - c) + 0.5 * c;
1372
+ let s = 0;
1373
+
1374
+ if (l > 0.0 && l < 0.5) {
1375
+ s = c / (2 * l);
1376
+ } else
1377
+ if (l >= 0.5 && l < 1.0) {
1378
+ s = c / (2 * (1 - l));
1379
+ }
1380
+
1381
+ return [hcg[0], s * 100, l * 100];
1382
+ };
1383
+
1384
+ convert$1.hcg.hwb = function (hcg) {
1385
+ const c = hcg[1] / 100;
1386
+ const g = hcg[2] / 100;
1387
+ const v = c + g * (1.0 - c);
1388
+ return [hcg[0], (v - c) * 100, (1 - v) * 100];
1389
+ };
1390
+
1391
+ convert$1.hwb.hcg = function (hwb) {
1392
+ const w = hwb[1] / 100;
1393
+ const b = hwb[2] / 100;
1394
+ const v = 1 - b;
1395
+ const c = v - w;
1396
+ let g = 0;
1397
+
1398
+ if (c < 1) {
1399
+ g = (v - c) / (1 - c);
1400
+ }
1401
+
1402
+ return [hwb[0], c * 100, g * 100];
1403
+ };
1404
+
1405
+ convert$1.apple.rgb = function (apple) {
1406
+ return [(apple[0] / 65535) * 255, (apple[1] / 65535) * 255, (apple[2] / 65535) * 255];
1407
+ };
1408
+
1409
+ convert$1.rgb.apple = function (rgb) {
1410
+ return [(rgb[0] / 255) * 65535, (rgb[1] / 255) * 65535, (rgb[2] / 255) * 65535];
1411
+ };
1412
+
1413
+ convert$1.gray.rgb = function (args) {
1414
+ return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
1415
+ };
1416
+
1417
+ convert$1.gray.hsl = function (args) {
1418
+ return [0, 0, args[0]];
1419
+ };
1420
+
1421
+ convert$1.gray.hsv = convert$1.gray.hsl;
1422
+
1423
+ convert$1.gray.hwb = function (gray) {
1424
+ return [0, 100, gray[0]];
1425
+ };
1426
+
1427
+ convert$1.gray.cmyk = function (gray) {
1428
+ return [0, 0, 0, gray[0]];
1429
+ };
1430
+
1431
+ convert$1.gray.lab = function (gray) {
1432
+ return [gray[0], 0, 0];
1433
+ };
1434
+
1435
+ convert$1.gray.hex = function (gray) {
1436
+ const val = Math.round(gray[0] / 100 * 255) & 0xFF;
1437
+ const integer = (val << 16) + (val << 8) + val;
1438
+
1439
+ const string = integer.toString(16).toUpperCase();
1440
+ return '000000'.substring(string.length) + string;
1441
+ };
1442
+
1443
+ convert$1.rgb.gray = function (rgb) {
1444
+ const val = (rgb[0] + rgb[1] + rgb[2]) / 3;
1445
+ return [val / 255 * 100];
1446
+ };
1447
+
1448
+ /*
1449
+ This function routes a model to all other models.
1450
+
1451
+ all functions that are routed have a property `.conversion` attached
1452
+ to the returned synthetic function. This property is an array
1453
+ of strings, each with the steps in between the 'from' and 'to'
1454
+ color models (inclusive).
1455
+
1456
+ conversions that are not possible simply are not included.
1457
+ */
1458
+
1459
+ function buildGraph() {
1460
+ const graph = {};
1461
+ // https://jsperf.com/object-keys-vs-for-in-with-closure/3
1462
+ const models = Object.keys(conversions);
1463
+
1464
+ for (let len = models.length, i = 0; i < len; i++) {
1465
+ graph[models[i]] = {
1466
+ // http://jsperf.com/1-vs-infinity
1467
+ // micro-opt, but this is simple.
1468
+ distance: -1,
1469
+ parent: null
1470
+ };
1471
+ }
1472
+
1473
+ return graph;
1474
+ }
1475
+
1476
+ // https://en.wikipedia.org/wiki/Breadth-first_search
1477
+ function deriveBFS(fromModel) {
1478
+ const graph = buildGraph();
1479
+ const queue = [fromModel]; // Unshift -> queue -> pop
1480
+
1481
+ graph[fromModel].distance = 0;
1482
+
1483
+ while (queue.length) {
1484
+ const current = queue.pop();
1485
+ const adjacents = Object.keys(conversions[current]);
1486
+
1487
+ for (let len = adjacents.length, i = 0; i < len; i++) {
1488
+ const adjacent = adjacents[i];
1489
+ const node = graph[adjacent];
1490
+
1491
+ if (node.distance === -1) {
1492
+ node.distance = graph[current].distance + 1;
1493
+ node.parent = current;
1494
+ queue.unshift(adjacent);
1495
+ }
1496
+ }
1497
+ }
1498
+
1499
+ return graph;
1500
+ }
1501
+
1502
+ function link(from, to) {
1503
+ return function (args) {
1504
+ return to(from(args));
1505
+ };
1506
+ }
1507
+
1508
+ function wrapConversion(toModel, graph) {
1509
+ const path = [graph[toModel].parent, toModel];
1510
+ let fn = conversions[graph[toModel].parent][toModel];
1511
+
1512
+ let cur = graph[toModel].parent;
1513
+ while (graph[cur].parent) {
1514
+ path.unshift(graph[cur].parent);
1515
+ fn = link(conversions[graph[cur].parent][cur], fn);
1516
+ cur = graph[cur].parent;
1517
+ }
1518
+
1519
+ fn.conversion = path;
1520
+ return fn;
1521
+ }
1522
+
1523
+ var route = function (fromModel) {
1524
+ const graph = deriveBFS(fromModel);
1525
+ const conversion = {};
1526
+
1527
+ const models = Object.keys(graph);
1528
+ for (let len = models.length, i = 0; i < len; i++) {
1529
+ const toModel = models[i];
1530
+ const node = graph[toModel];
1531
+
1532
+ if (node.parent === null) {
1533
+ // No possible conversion, or this node is the source model.
1534
+ continue;
1535
+ }
1536
+
1537
+ conversion[toModel] = wrapConversion(toModel, graph);
1538
+ }
1539
+
1540
+ return conversion;
1541
+ };
1542
+
1543
+ const convert = {};
1544
+
1545
+ const models = Object.keys(conversions);
1546
+
1547
+ function wrapRaw(fn) {
1548
+ const wrappedFn = function (...args) {
1549
+ const arg0 = args[0];
1550
+ if (arg0 === undefined || arg0 === null) {
1551
+ return arg0;
1552
+ }
1553
+
1554
+ if (arg0.length > 1) {
1555
+ args = arg0;
1556
+ }
1557
+
1558
+ return fn(args);
1559
+ };
1560
+
1561
+ // Preserve .conversion property if there is one
1562
+ if ('conversion' in fn) {
1563
+ wrappedFn.conversion = fn.conversion;
1564
+ }
1565
+
1566
+ return wrappedFn;
1567
+ }
1568
+
1569
+ function wrapRounded(fn) {
1570
+ const wrappedFn = function (...args) {
1571
+ const arg0 = args[0];
1572
+
1573
+ if (arg0 === undefined || arg0 === null) {
1574
+ return arg0;
1575
+ }
1576
+
1577
+ if (arg0.length > 1) {
1578
+ args = arg0;
1579
+ }
1580
+
1581
+ const result = fn(args);
1582
+
1583
+ // We're assuming the result is an array here.
1584
+ // see notice in conversions.js; don't use box types
1585
+ // in conversion functions.
1586
+ if (typeof result === 'object') {
1587
+ for (let len = result.length, i = 0; i < len; i++) {
1588
+ result[i] = Math.round(result[i]);
1589
+ }
1590
+ }
1591
+
1592
+ return result;
1593
+ };
1594
+
1595
+ // Preserve .conversion property if there is one
1596
+ if ('conversion' in fn) {
1597
+ wrappedFn.conversion = fn.conversion;
1598
+ }
1599
+
1600
+ return wrappedFn;
1601
+ }
1602
+
1603
+ models.forEach(fromModel => {
1604
+ convert[fromModel] = {};
1605
+
1606
+ Object.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels});
1607
+ Object.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels});
1608
+
1609
+ const routes = route(fromModel);
1610
+ const routeModels = Object.keys(routes);
1611
+
1612
+ routeModels.forEach(toModel => {
1613
+ const fn = routes[toModel];
1614
+
1615
+ convert[fromModel][toModel] = wrapRounded(fn);
1616
+ convert[fromModel][toModel].raw = wrapRaw(fn);
1617
+ });
1618
+ });
1619
+
1620
+ var colorConvert = convert;
1621
+
1622
+ const skippedModels = [
1623
+ // To be honest, I don't really feel like keyword belongs in color convert, but eh.
1624
+ 'keyword',
1625
+
1626
+ // Gray conflicts with some method names, and has its own method defined.
1627
+ 'gray',
1628
+
1629
+ // Shouldn't really be in color-convert either...
1630
+ 'hex',
1631
+ ];
1632
+
1633
+ const hashedModelKeys = {};
1634
+ for (const model of Object.keys(colorConvert)) {
1635
+ hashedModelKeys[[...colorConvert[model].labels].sort().join('')] = model;
1636
+ }
1637
+
1638
+ const limiters = {};
1639
+
1640
+ function Color(object, model) {
1641
+ if (!(this instanceof Color)) {
1642
+ return new Color(object, model);
1643
+ }
1644
+
1645
+ if (model && model in skippedModels) {
1646
+ model = null;
1647
+ }
1648
+
1649
+ if (model && !(model in colorConvert)) {
1650
+ throw new Error('Unknown model: ' + model);
1651
+ }
1652
+
1653
+ let i;
1654
+ let channels;
1655
+
1656
+ if (object == null) { // eslint-disable-line no-eq-null,eqeqeq
1657
+ this.model = 'rgb';
1658
+ this.color = [0, 0, 0];
1659
+ this.valpha = 1;
1660
+ } else if (object instanceof Color) {
1661
+ this.model = object.model;
1662
+ this.color = [...object.color];
1663
+ this.valpha = object.valpha;
1664
+ } else if (typeof object === 'string') {
1665
+ const result = colorString.get(object);
1666
+ if (result === null) {
1667
+ throw new Error('Unable to parse color from string: ' + object);
1668
+ }
1669
+
1670
+ this.model = result.model;
1671
+ channels = colorConvert[this.model].channels;
1672
+ this.color = result.value.slice(0, channels);
1673
+ this.valpha = typeof result.value[channels] === 'number' ? result.value[channels] : 1;
1674
+ } else if (object.length > 0) {
1675
+ this.model = model || 'rgb';
1676
+ channels = colorConvert[this.model].channels;
1677
+ const newArray = Array.prototype.slice.call(object, 0, channels);
1678
+ this.color = zeroArray(newArray, channels);
1679
+ this.valpha = typeof object[channels] === 'number' ? object[channels] : 1;
1680
+ } else if (typeof object === 'number') {
1681
+ // This is always RGB - can be converted later on.
1682
+ this.model = 'rgb';
1683
+ this.color = [
1684
+ (object >> 16) & 0xFF,
1685
+ (object >> 8) & 0xFF,
1686
+ object & 0xFF,
1687
+ ];
1688
+ this.valpha = 1;
1689
+ } else {
1690
+ this.valpha = 1;
1691
+
1692
+ const keys = Object.keys(object);
1693
+ if ('alpha' in object) {
1694
+ keys.splice(keys.indexOf('alpha'), 1);
1695
+ this.valpha = typeof object.alpha === 'number' ? object.alpha : 0;
1696
+ }
1697
+
1698
+ const hashedKeys = keys.sort().join('');
1699
+ if (!(hashedKeys in hashedModelKeys)) {
1700
+ throw new Error('Unable to parse color from object: ' + JSON.stringify(object));
1701
+ }
1702
+
1703
+ this.model = hashedModelKeys[hashedKeys];
1704
+
1705
+ const {labels} = colorConvert[this.model];
1706
+ const color = [];
1707
+ for (i = 0; i < labels.length; i++) {
1708
+ color.push(object[labels[i]]);
1709
+ }
1710
+
1711
+ this.color = zeroArray(color);
1712
+ }
1713
+
1714
+ // Perform limitations (clamping, etc.)
1715
+ if (limiters[this.model]) {
1716
+ channels = colorConvert[this.model].channels;
1717
+ for (i = 0; i < channels; i++) {
1718
+ const limit = limiters[this.model][i];
1719
+ if (limit) {
1720
+ this.color[i] = limit(this.color[i]);
1721
+ }
1722
+ }
1723
+ }
1724
+
1725
+ this.valpha = Math.max(0, Math.min(1, this.valpha));
1726
+
1727
+ if (Object.freeze) {
1728
+ Object.freeze(this);
1729
+ }
1730
+ }
1731
+
1732
+ Color.prototype = {
1733
+ toString() {
1734
+ return this.string();
1735
+ },
1736
+
1737
+ toJSON() {
1738
+ return this[this.model]();
1739
+ },
1740
+
1741
+ string(places) {
1742
+ let self = this.model in colorString.to ? this : this.rgb();
1743
+ self = self.round(typeof places === 'number' ? places : 1);
1744
+ const args = self.valpha === 1 ? self.color : [...self.color, this.valpha];
1745
+ return colorString.to[self.model](args);
1746
+ },
1747
+
1748
+ percentString(places) {
1749
+ const self = this.rgb().round(typeof places === 'number' ? places : 1);
1750
+ const args = self.valpha === 1 ? self.color : [...self.color, this.valpha];
1751
+ return colorString.to.rgb.percent(args);
1752
+ },
1753
+
1754
+ array() {
1755
+ return this.valpha === 1 ? [...this.color] : [...this.color, this.valpha];
1756
+ },
1757
+
1758
+ object() {
1759
+ const result = {};
1760
+ const {channels} = colorConvert[this.model];
1761
+ const {labels} = colorConvert[this.model];
1762
+
1763
+ for (let i = 0; i < channels; i++) {
1764
+ result[labels[i]] = this.color[i];
1765
+ }
1766
+
1767
+ if (this.valpha !== 1) {
1768
+ result.alpha = this.valpha;
1769
+ }
1770
+
1771
+ return result;
1772
+ },
1773
+
1774
+ unitArray() {
1775
+ const rgb = this.rgb().color;
1776
+ rgb[0] /= 255;
1777
+ rgb[1] /= 255;
1778
+ rgb[2] /= 255;
1779
+
1780
+ if (this.valpha !== 1) {
1781
+ rgb.push(this.valpha);
1782
+ }
1783
+
1784
+ return rgb;
1785
+ },
1786
+
1787
+ unitObject() {
1788
+ const rgb = this.rgb().object();
1789
+ rgb.r /= 255;
1790
+ rgb.g /= 255;
1791
+ rgb.b /= 255;
1792
+
1793
+ if (this.valpha !== 1) {
1794
+ rgb.alpha = this.valpha;
1795
+ }
1796
+
1797
+ return rgb;
1798
+ },
1799
+
1800
+ round(places) {
1801
+ places = Math.max(places || 0, 0);
1802
+ return new Color([...this.color.map(roundToPlace(places)), this.valpha], this.model);
1803
+ },
1804
+
1805
+ alpha(value) {
1806
+ if (value !== undefined) {
1807
+ return new Color([...this.color, Math.max(0, Math.min(1, value))], this.model);
1808
+ }
1809
+
1810
+ return this.valpha;
1811
+ },
1812
+
1813
+ // Rgb
1814
+ red: getset('rgb', 0, maxfn(255)),
1815
+ green: getset('rgb', 1, maxfn(255)),
1816
+ blue: getset('rgb', 2, maxfn(255)),
1817
+
1818
+ hue: getset(['hsl', 'hsv', 'hsl', 'hwb', 'hcg'], 0, value => ((value % 360) + 360) % 360),
1819
+
1820
+ saturationl: getset('hsl', 1, maxfn(100)),
1821
+ lightness: getset('hsl', 2, maxfn(100)),
1822
+
1823
+ saturationv: getset('hsv', 1, maxfn(100)),
1824
+ value: getset('hsv', 2, maxfn(100)),
1825
+
1826
+ chroma: getset('hcg', 1, maxfn(100)),
1827
+ gray: getset('hcg', 2, maxfn(100)),
1828
+
1829
+ white: getset('hwb', 1, maxfn(100)),
1830
+ wblack: getset('hwb', 2, maxfn(100)),
1831
+
1832
+ cyan: getset('cmyk', 0, maxfn(100)),
1833
+ magenta: getset('cmyk', 1, maxfn(100)),
1834
+ yellow: getset('cmyk', 2, maxfn(100)),
1835
+ black: getset('cmyk', 3, maxfn(100)),
1836
+
1837
+ x: getset('xyz', 0, maxfn(95.047)),
1838
+ y: getset('xyz', 1, maxfn(100)),
1839
+ z: getset('xyz', 2, maxfn(108.833)),
1840
+
1841
+ l: getset('lab', 0, maxfn(100)),
1842
+ a: getset('lab', 1),
1843
+ b: getset('lab', 2),
1844
+
1845
+ keyword(value) {
1846
+ if (value !== undefined) {
1847
+ return new Color(value);
1848
+ }
1849
+
1850
+ return colorConvert[this.model].keyword(this.color);
1851
+ },
1852
+
1853
+ hex(value) {
1854
+ if (value !== undefined) {
1855
+ return new Color(value);
1856
+ }
1857
+
1858
+ return colorString.to.hex(this.rgb().round().color);
1859
+ },
1860
+
1861
+ hexa(value) {
1862
+ if (value !== undefined) {
1863
+ return new Color(value);
1864
+ }
1865
+
1866
+ const rgbArray = this.rgb().round().color;
1867
+
1868
+ let alphaHex = Math.round(this.valpha * 255).toString(16).toUpperCase();
1869
+ if (alphaHex.length === 1) {
1870
+ alphaHex = '0' + alphaHex;
1871
+ }
1872
+
1873
+ return colorString.to.hex(rgbArray) + alphaHex;
1874
+ },
1875
+
1876
+ rgbNumber() {
1877
+ const rgb = this.rgb().color;
1878
+ return ((rgb[0] & 0xFF) << 16) | ((rgb[1] & 0xFF) << 8) | (rgb[2] & 0xFF);
1879
+ },
1880
+
1881
+ luminosity() {
1882
+ // http://www.w3.org/TR/WCAG20/#relativeluminancedef
1883
+ const rgb = this.rgb().color;
1884
+
1885
+ const lum = [];
1886
+ for (const [i, element] of rgb.entries()) {
1887
+ const chan = element / 255;
1888
+ lum[i] = (chan <= 0.04045) ? chan / 12.92 : ((chan + 0.055) / 1.055) ** 2.4;
1889
+ }
1890
+
1891
+ return 0.2126 * lum[0] + 0.7152 * lum[1] + 0.0722 * lum[2];
1892
+ },
1893
+
1894
+ contrast(color2) {
1895
+ // http://www.w3.org/TR/WCAG20/#contrast-ratiodef
1896
+ const lum1 = this.luminosity();
1897
+ const lum2 = color2.luminosity();
1898
+
1899
+ if (lum1 > lum2) {
1900
+ return (lum1 + 0.05) / (lum2 + 0.05);
1901
+ }
1902
+
1903
+ return (lum2 + 0.05) / (lum1 + 0.05);
1904
+ },
1905
+
1906
+ level(color2) {
1907
+ // https://www.w3.org/TR/WCAG/#contrast-enhanced
1908
+ const contrastRatio = this.contrast(color2);
1909
+ if (contrastRatio >= 7) {
1910
+ return 'AAA';
1911
+ }
1912
+
1913
+ return (contrastRatio >= 4.5) ? 'AA' : '';
1914
+ },
1915
+
1916
+ isDark() {
1917
+ // YIQ equation from http://24ways.org/2010/calculating-color-contrast
1918
+ const rgb = this.rgb().color;
1919
+ const yiq = (rgb[0] * 2126 + rgb[1] * 7152 + rgb[2] * 722) / 10000;
1920
+ return yiq < 128;
1921
+ },
1922
+
1923
+ isLight() {
1924
+ return !this.isDark();
1925
+ },
1926
+
1927
+ negate() {
1928
+ const rgb = this.rgb();
1929
+ for (let i = 0; i < 3; i++) {
1930
+ rgb.color[i] = 255 - rgb.color[i];
1931
+ }
1932
+
1933
+ return rgb;
1934
+ },
1935
+
1936
+ lighten(ratio) {
1937
+ const hsl = this.hsl();
1938
+ hsl.color[2] += hsl.color[2] * ratio;
1939
+ return hsl;
1940
+ },
1941
+
1942
+ darken(ratio) {
1943
+ const hsl = this.hsl();
1944
+ hsl.color[2] -= hsl.color[2] * ratio;
1945
+ return hsl;
1946
+ },
1947
+
1948
+ saturate(ratio) {
1949
+ const hsl = this.hsl();
1950
+ hsl.color[1] += hsl.color[1] * ratio;
1951
+ return hsl;
1952
+ },
1953
+
1954
+ desaturate(ratio) {
1955
+ const hsl = this.hsl();
1956
+ hsl.color[1] -= hsl.color[1] * ratio;
1957
+ return hsl;
1958
+ },
1959
+
1960
+ whiten(ratio) {
1961
+ const hwb = this.hwb();
1962
+ hwb.color[1] += hwb.color[1] * ratio;
1963
+ return hwb;
1964
+ },
1965
+
1966
+ blacken(ratio) {
1967
+ const hwb = this.hwb();
1968
+ hwb.color[2] += hwb.color[2] * ratio;
1969
+ return hwb;
1970
+ },
1971
+
1972
+ grayscale() {
1973
+ // http://en.wikipedia.org/wiki/Grayscale#Converting_color_to_grayscale
1974
+ const rgb = this.rgb().color;
1975
+ const value = rgb[0] * 0.3 + rgb[1] * 0.59 + rgb[2] * 0.11;
1976
+ return Color.rgb(value, value, value);
1977
+ },
1978
+
1979
+ fade(ratio) {
1980
+ return this.alpha(this.valpha - (this.valpha * ratio));
1981
+ },
1982
+
1983
+ opaquer(ratio) {
1984
+ return this.alpha(this.valpha + (this.valpha * ratio));
1985
+ },
1986
+
1987
+ rotate(degrees) {
1988
+ const hsl = this.hsl();
1989
+ let hue = hsl.color[0];
1990
+ hue = (hue + degrees) % 360;
1991
+ hue = hue < 0 ? 360 + hue : hue;
1992
+ hsl.color[0] = hue;
1993
+ return hsl;
1994
+ },
1995
+
1996
+ mix(mixinColor, weight) {
1997
+ // Ported from sass implementation in C
1998
+ // https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209
1999
+ if (!mixinColor || !mixinColor.rgb) {
2000
+ throw new Error('Argument to "mix" was not a Color instance, but rather an instance of ' + typeof mixinColor);
2001
+ }
2002
+
2003
+ const color1 = mixinColor.rgb();
2004
+ const color2 = this.rgb();
2005
+ const p = weight === undefined ? 0.5 : weight;
2006
+
2007
+ const w = 2 * p - 1;
2008
+ const a = color1.alpha() - color2.alpha();
2009
+
2010
+ const w1 = (((w * a === -1) ? w : (w + a) / (1 + w * a)) + 1) / 2;
2011
+ const w2 = 1 - w1;
2012
+
2013
+ return Color.rgb(
2014
+ w1 * color1.red() + w2 * color2.red(),
2015
+ w1 * color1.green() + w2 * color2.green(),
2016
+ w1 * color1.blue() + w2 * color2.blue(),
2017
+ color1.alpha() * p + color2.alpha() * (1 - p));
2018
+ },
2019
+ };
2020
+
2021
+ // Model conversion methods and static constructors
2022
+ for (const model of Object.keys(colorConvert)) {
2023
+ if (skippedModels.includes(model)) {
2024
+ continue;
2025
+ }
2026
+
2027
+ const {channels} = colorConvert[model];
2028
+
2029
+ // Conversion methods
2030
+ Color.prototype[model] = function (...args) {
2031
+ if (this.model === model) {
2032
+ return new Color(this);
2033
+ }
2034
+
2035
+ if (args.length > 0) {
2036
+ return new Color(args, model);
2037
+ }
2038
+
2039
+ return new Color([...assertArray(colorConvert[this.model][model].raw(this.color)), this.valpha], model);
2040
+ };
2041
+
2042
+ // 'static' construction methods
2043
+ Color[model] = function (...args) {
2044
+ let color = args[0];
2045
+ if (typeof color === 'number') {
2046
+ color = zeroArray(args, channels);
2047
+ }
2048
+
2049
+ return new Color(color, model);
2050
+ };
2051
+ }
2052
+
2053
+ function roundTo(number, places) {
2054
+ return Number(number.toFixed(places));
2055
+ }
2056
+
2057
+ function roundToPlace(places) {
2058
+ return function (number) {
2059
+ return roundTo(number, places);
2060
+ };
2061
+ }
2062
+
2063
+ function getset(model, channel, modifier) {
2064
+ model = Array.isArray(model) ? model : [model];
2065
+
2066
+ for (const m of model) {
2067
+ (limiters[m] || (limiters[m] = []))[channel] = modifier;
2068
+ }
2069
+
2070
+ model = model[0];
2071
+
2072
+ return function (value) {
2073
+ let result;
2074
+
2075
+ if (value !== undefined) {
2076
+ if (modifier) {
2077
+ value = modifier(value);
2078
+ }
2079
+
2080
+ result = this[model]();
2081
+ result.color[channel] = value;
2082
+ return result;
2083
+ }
2084
+
2085
+ result = this[model]().color[channel];
2086
+ if (modifier) {
2087
+ result = modifier(result);
2088
+ }
2089
+
2090
+ return result;
2091
+ };
2092
+ }
2093
+
2094
+ function maxfn(max) {
2095
+ return function (v) {
2096
+ return Math.max(0, Math.min(max, v));
2097
+ };
2098
+ }
2099
+
2100
+ function assertArray(value) {
2101
+ return Array.isArray(value) ? value : [value];
2102
+ }
2103
+
2104
+ function zeroArray(array, length) {
2105
+ for (let i = 0; i < length; i++) {
2106
+ if (typeof array[i] !== 'number') {
2107
+ array[i] = 0;
2108
+ }
2109
+ }
2110
+
2111
+ return array;
2112
+ }
2113
+
2114
+ var color = Color;
2115
+
2116
+ export { color as c };