yuyeon 0.3.1-rc.6 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (949) hide show
  1. package/dist/yuyeon.js +1 -1
  2. package/dist/yuyeon.umd.cjs +1 -1
  3. package/lib/abstract/items.js +20 -0
  4. package/lib/abstract/items.js.map +1 -0
  5. package/lib/components/alert/YAlert.js +83 -0
  6. package/lib/components/alert/YAlert.js.map +1 -0
  7. package/lib/components/alert/index.js +2 -0
  8. package/lib/components/alert/index.js.map +1 -0
  9. package/lib/components/app/YApp.js +21 -0
  10. package/lib/components/app/YApp.js.map +1 -0
  11. package/lib/components/app/index.js +2 -0
  12. package/lib/components/app/index.js.map +1 -0
  13. package/lib/components/badge/YBadge.js +83 -0
  14. package/lib/components/badge/YBadge.js.map +1 -0
  15. package/lib/components/badge/index.js +2 -0
  16. package/lib/components/badge/index.js.map +1 -0
  17. package/lib/components/bench/YBench.js +43 -0
  18. package/lib/components/bench/YBench.js.map +1 -0
  19. package/lib/components/bench/index.js +2 -0
  20. package/lib/components/bench/index.js.map +1 -0
  21. package/lib/components/button/YButton.js +169 -0
  22. package/lib/components/button/YButton.js.map +1 -0
  23. package/lib/components/button/index.js +2 -0
  24. package/lib/components/button/index.js.map +1 -0
  25. package/lib/components/card/YCard.js +28 -0
  26. package/lib/components/card/YCard.js.map +1 -0
  27. package/lib/components/card/YCardBody.js +11 -0
  28. package/lib/components/card/YCardBody.js.map +1 -0
  29. package/lib/components/card/YCardFooter.js +11 -0
  30. package/lib/components/card/YCardFooter.js.map +1 -0
  31. package/lib/components/card/YCardHeader.js +11 -0
  32. package/lib/components/card/YCardHeader.js.map +1 -0
  33. package/lib/components/card/index.js +5 -0
  34. package/lib/components/card/index.js.map +1 -0
  35. package/lib/components/checkbox/YCheckbox.js +160 -0
  36. package/lib/components/checkbox/YCheckbox.js.map +1 -0
  37. package/lib/components/checkbox/YInputCheckbox.js +114 -0
  38. package/lib/components/checkbox/YInputCheckbox.js.map +1 -0
  39. package/lib/components/checkbox/index.js +4 -0
  40. package/lib/components/checkbox/index.js.map +1 -0
  41. package/lib/components/chip/YChip.js +39 -0
  42. package/lib/components/chip/YChip.js.map +1 -0
  43. package/lib/components/chip/index.js +2 -0
  44. package/lib/components/chip/index.js.map +1 -0
  45. package/lib/components/date-picker/YDateCalendar.js +243 -0
  46. package/lib/components/date-picker/YDateCalendar.js.map +1 -0
  47. package/lib/components/date-picker/YDatePicker.js +132 -0
  48. package/lib/components/date-picker/YDatePicker.js.map +1 -0
  49. package/lib/components/date-picker/YDatePickerControl.js +107 -0
  50. package/lib/components/date-picker/YDatePickerControl.js.map +1 -0
  51. package/lib/components/date-picker/YMonthPicker.js +64 -0
  52. package/lib/components/date-picker/YMonthPicker.js.map +1 -0
  53. package/lib/components/date-picker/YYearPicker.js +87 -0
  54. package/lib/components/date-picker/YYearPicker.js.map +1 -0
  55. package/lib/components/date-picker/index.js +4 -0
  56. package/lib/components/date-picker/index.js.map +1 -0
  57. package/lib/components/default-provider/YDefaultProvider.js +2 -0
  58. package/lib/components/default-provider/YDefaultProvider.js.map +1 -0
  59. package/lib/components/default-provider/index.js +2 -0
  60. package/lib/components/default-provider/index.js.map +1 -0
  61. package/lib/components/dialog/YDialog.js +213 -0
  62. package/lib/components/dialog/YDialog.js.map +1 -0
  63. package/lib/components/dialog/index.js +2 -0
  64. package/lib/components/dialog/index.js.map +1 -0
  65. package/lib/components/divider/YDivider.js +20 -0
  66. package/lib/components/divider/YDivider.js.map +1 -0
  67. package/lib/components/divider/index.js +2 -0
  68. package/lib/components/divider/index.js.map +1 -0
  69. package/lib/components/draggable/YDraggable.js +95 -0
  70. package/lib/components/draggable/YDraggable.js.map +1 -0
  71. package/lib/components/dropdown/YDropdown.js +109 -0
  72. package/lib/components/dropdown/YDropdown.js.map +1 -0
  73. package/lib/components/dropdown/index.js +2 -0
  74. package/lib/components/dropdown/index.js.map +1 -0
  75. package/lib/components/field-input/YFieldInput.js +229 -0
  76. package/lib/components/field-input/YFieldInput.js.map +1 -0
  77. package/lib/components/field-input/index.js +2 -0
  78. package/lib/components/field-input/index.js.map +1 -0
  79. package/lib/components/form/YForm.js +65 -0
  80. package/lib/components/form/YForm.js.map +1 -0
  81. package/lib/components/form/index.js +2 -0
  82. package/lib/components/form/index.js.map +1 -0
  83. package/lib/components/hover/YHover.js +54 -0
  84. package/lib/components/hover/YHover.js.map +1 -0
  85. package/lib/components/hover/index.js +2 -0
  86. package/lib/components/hover/index.js.map +1 -0
  87. package/lib/components/icon/YIcon.js +63 -0
  88. package/lib/components/icon/YIcon.js.map +1 -0
  89. package/lib/components/icon/index.js +2 -0
  90. package/lib/components/icon/index.js.map +1 -0
  91. package/lib/components/icons/YIconCheckbox.js +32 -0
  92. package/lib/components/icons/YIconCheckbox.js.map +1 -0
  93. package/lib/components/icons/YIconClear.js +16 -0
  94. package/lib/components/icons/YIconClear.js.map +1 -0
  95. package/lib/components/icons/YIconDropdown.js +16 -0
  96. package/lib/components/icons/YIconDropdown.js.map +1 -0
  97. package/lib/components/icons/YIconExpand.js +20 -0
  98. package/lib/components/icons/YIconExpand.js.map +1 -0
  99. package/lib/components/icons/YIconPageControl.js +32 -0
  100. package/lib/components/icons/YIconPageControl.js.map +1 -0
  101. package/lib/components/icons/YIconSort.js +45 -0
  102. package/lib/components/icons/YIconSort.js.map +1 -0
  103. package/lib/components/icons/index.js +32 -0
  104. package/lib/components/icons/index.js.map +1 -0
  105. package/lib/components/img/YImg.js +173 -0
  106. package/lib/components/img/YImg.js.map +1 -0
  107. package/lib/components/img/index.js +2 -0
  108. package/lib/components/img/index.js.map +1 -0
  109. package/lib/components/index.js +39 -0
  110. package/lib/components/index.js.map +1 -0
  111. package/lib/components/input/YInput.js +258 -0
  112. package/lib/components/input/YInput.js.map +1 -0
  113. package/lib/components/input/index.js +2 -0
  114. package/lib/components/input/index.js.map +1 -0
  115. package/lib/components/ip-field/YIpv4Field.js +297 -0
  116. package/lib/components/ip-field/YIpv4Field.js.map +1 -0
  117. package/lib/components/ip-field/index.js +2 -0
  118. package/lib/components/ip-field/index.js.map +1 -0
  119. package/lib/components/layer/YLayer.js +326 -0
  120. package/lib/components/layer/YLayer.js.map +1 -0
  121. package/lib/components/layer/active-delay.js +28 -0
  122. package/lib/components/layer/active-delay.js.map +1 -0
  123. package/lib/components/layer/active-stack.js +52 -0
  124. package/lib/components/layer/active-stack.js.map +1 -0
  125. package/lib/components/layer/base.js +87 -0
  126. package/lib/components/layer/base.js.map +1 -0
  127. package/lib/components/layer/content.js +22 -0
  128. package/lib/components/layer/content.js.map +1 -0
  129. package/lib/components/layer/index.js +2 -0
  130. package/lib/components/layer/index.js.map +1 -0
  131. package/lib/components/layer/scroll-strategies.js +132 -0
  132. package/lib/components/layer/scroll-strategies.js.map +1 -0
  133. package/lib/components/list/YList.js +55 -0
  134. package/lib/components/list/YList.js.map +1 -0
  135. package/lib/components/list/YListItem.js +59 -0
  136. package/lib/components/list/YListItem.js.map +1 -0
  137. package/lib/components/list/index.js +3 -0
  138. package/lib/components/list/index.js.map +1 -0
  139. package/lib/components/loading/YSpinnerRing.js +25 -0
  140. package/lib/components/loading/YSpinnerRing.js.map +1 -0
  141. package/lib/components/loading/index.js +2 -0
  142. package/lib/components/loading/index.js.map +1 -0
  143. package/lib/components/menu/YMenu.js +211 -0
  144. package/lib/components/menu/YMenu.js.map +1 -0
  145. package/lib/components/menu/index.js +2 -0
  146. package/lib/components/menu/index.js.map +1 -0
  147. package/lib/components/navigation/YNavigation.js +18 -0
  148. package/lib/components/navigation/YNavigation.js.map +1 -0
  149. package/lib/components/navigation/index.js +2 -0
  150. package/lib/components/navigation/index.js.map +1 -0
  151. package/lib/components/pagination/YPagination.js +288 -0
  152. package/lib/components/pagination/YPagination.js.map +1 -0
  153. package/lib/components/pagination/index.js +2 -0
  154. package/lib/components/pagination/index.js.map +1 -0
  155. package/lib/components/panel/YDividePanel.js +90 -0
  156. package/lib/components/panel/YDividePanel.js.map +1 -0
  157. package/lib/components/panel/index.js +2 -0
  158. package/lib/components/panel/index.js.map +1 -0
  159. package/lib/components/plate/YPlate.js +28 -0
  160. package/lib/components/plate/YPlate.js.map +1 -0
  161. package/lib/components/plate/index.js +2 -0
  162. package/lib/components/plate/index.js.map +1 -0
  163. package/lib/components/progress-bar/YProgressBar.js +117 -0
  164. package/lib/components/progress-bar/YProgressBar.js.map +1 -0
  165. package/lib/components/progress-bar/index.js +2 -0
  166. package/lib/components/progress-bar/index.js.map +1 -0
  167. package/lib/components/progress-ring/YProgressRing.js +128 -0
  168. package/lib/components/progress-ring/YProgressRing.js.map +1 -0
  169. package/lib/components/progress-ring/index.js +2 -0
  170. package/lib/components/progress-ring/index.js.map +1 -0
  171. package/lib/components/select/YSelect.js +344 -0
  172. package/lib/components/select/YSelect.js.map +1 -0
  173. package/lib/components/select/index.js +2 -0
  174. package/lib/components/select/index.js.map +1 -0
  175. package/lib/components/slider/YSlider.js +26 -0
  176. package/lib/components/slider/YSlider.js.map +1 -0
  177. package/lib/components/slider/index.js +2 -0
  178. package/lib/components/slider/index.js.map +1 -0
  179. package/lib/components/snackbar/YSnackbar.js +209 -0
  180. package/lib/components/snackbar/YSnackbar.js.map +1 -0
  181. package/lib/components/snackbar/index.js +2 -0
  182. package/lib/components/snackbar/index.js.map +1 -0
  183. package/lib/components/switch/YSwitch.js +184 -0
  184. package/lib/components/switch/YSwitch.js.map +1 -0
  185. package/lib/components/switch/index.js +2 -0
  186. package/lib/components/switch/index.js.map +1 -0
  187. package/lib/components/tab/YTab.js +64 -0
  188. package/lib/components/tab/YTab.js.map +1 -0
  189. package/lib/components/tab/YTabs.js +86 -0
  190. package/lib/components/tab/YTabs.js.map +1 -0
  191. package/lib/components/tab/index.js +4 -0
  192. package/lib/components/tab/index.js.map +1 -0
  193. package/lib/components/tab/shared.js +2 -0
  194. package/lib/components/tab/shared.js.map +1 -0
  195. package/lib/components/tab/types.js +2 -0
  196. package/lib/components/tab/types.js.map +1 -0
  197. package/lib/components/table/YDataTable.js +182 -0
  198. package/lib/components/table/YDataTable.js.map +1 -0
  199. package/lib/components/table/YDataTableBody.js +131 -0
  200. package/lib/components/table/YDataTableBody.js.map +1 -0
  201. package/lib/components/table/YDataTableCell.js +78 -0
  202. package/lib/components/table/YDataTableCell.js.map +1 -0
  203. package/lib/components/table/YDataTableControl.js +46 -0
  204. package/lib/components/table/YDataTableControl.js.map +1 -0
  205. package/lib/components/table/YDataTableHead.js +172 -0
  206. package/lib/components/table/YDataTableHead.js.map +1 -0
  207. package/lib/components/table/YDataTableLayer.js +29 -0
  208. package/lib/components/table/YDataTableLayer.js.map +1 -0
  209. package/lib/components/table/YDataTableRow.js +150 -0
  210. package/lib/components/table/YDataTableRow.js.map +1 -0
  211. package/lib/components/table/YDataTableServer.js +173 -0
  212. package/lib/components/table/YDataTableServer.js.map +1 -0
  213. package/lib/components/table/YTable.js +77 -0
  214. package/lib/components/table/YTable.js.map +1 -0
  215. package/lib/components/table/composibles/header.js +127 -0
  216. package/lib/components/table/composibles/header.js.map +1 -0
  217. package/lib/components/table/composibles/items.js +52 -0
  218. package/lib/components/table/composibles/items.js.map +1 -0
  219. package/lib/components/table/composibles/measure.js +39 -0
  220. package/lib/components/table/composibles/measure.js.map +1 -0
  221. package/lib/components/table/composibles/options.js +33 -0
  222. package/lib/components/table/composibles/options.js.map +1 -0
  223. package/lib/components/table/composibles/pagination.js +99 -0
  224. package/lib/components/table/composibles/pagination.js.map +1 -0
  225. package/lib/components/table/composibles/selection.js +196 -0
  226. package/lib/components/table/composibles/selection.js.map +1 -0
  227. package/lib/components/table/composibles/sorted-items.js +50 -0
  228. package/lib/components/table/composibles/sorted-items.js.map +1 -0
  229. package/lib/components/table/composibles/sorting.js +73 -0
  230. package/lib/components/table/composibles/sorting.js.map +1 -0
  231. package/lib/components/table/index.js +9 -0
  232. package/lib/components/table/index.js.map +1 -0
  233. package/lib/components/table/types/common.js +2 -0
  234. package/lib/components/table/types/common.js.map +1 -0
  235. package/lib/components/table/types/header.js +2 -0
  236. package/lib/components/table/types/header.js.map +1 -0
  237. package/lib/components/table/types/index.js +2 -0
  238. package/lib/components/table/types/index.js.map +1 -0
  239. package/lib/components/table/types/item.js +2 -0
  240. package/lib/components/table/types/item.js.map +1 -0
  241. package/lib/components/table/types/row.js +2 -0
  242. package/lib/components/table/types/row.js.map +1 -0
  243. package/lib/components/text-ellipsis/YTextEllipsis.js +66 -0
  244. package/lib/components/text-ellipsis/YTextEllipsis.js.map +1 -0
  245. package/lib/components/text-ellipsis/index.js +2 -0
  246. package/lib/components/text-ellipsis/index.js.map +1 -0
  247. package/lib/components/text-highlighter/YTextHighlighter.js +95 -0
  248. package/lib/components/text-highlighter/YTextHighlighter.js.map +1 -0
  249. package/lib/components/text-highlighter/index.js +2 -0
  250. package/lib/components/text-highlighter/index.js.map +1 -0
  251. package/lib/components/text-interpolation/YTi.js +47 -0
  252. package/lib/components/text-interpolation/YTi.js.map +1 -0
  253. package/lib/components/text-interpolation/index.js +2 -0
  254. package/lib/components/text-interpolation/index.js.map +1 -0
  255. package/lib/components/textarea/YTextarea.js +157 -0
  256. package/lib/components/textarea/YTextarea.js.map +1 -0
  257. package/lib/components/textarea/index.js +2 -0
  258. package/lib/components/textarea/index.js.map +1 -0
  259. package/lib/components/toggle-button/YToggleButton.js +2 -0
  260. package/lib/components/toggle-button/YToggleButton.js.map +1 -0
  261. package/lib/components/toggle-button/index.js +2 -0
  262. package/lib/components/toggle-button/index.js.map +1 -0
  263. package/lib/components/tooltip/YTooltip.js +157 -0
  264. package/lib/components/tooltip/YTooltip.js.map +1 -0
  265. package/lib/components/tooltip/index.js +2 -0
  266. package/lib/components/tooltip/index.js.map +1 -0
  267. package/lib/components/transitions/expand-transition.js +109 -0
  268. package/lib/components/transitions/expand-transition.js.map +1 -0
  269. package/lib/components/transitions/index.js +4 -0
  270. package/lib/components/transitions/index.js.map +1 -0
  271. package/lib/components/tree-view/YTreeView.js +289 -0
  272. package/lib/components/tree-view/YTreeView.js.map +1 -0
  273. package/lib/components/tree-view/YTreeViewNode.js +250 -0
  274. package/lib/components/tree-view/YTreeViewNode.js.map +1 -0
  275. package/lib/components/tree-view/index.js +3 -0
  276. package/lib/components/tree-view/index.js.map +1 -0
  277. package/lib/components/tree-view/tree-view.js +179 -0
  278. package/lib/components/tree-view/tree-view.js.map +1 -0
  279. package/lib/components/tree-view/types.js +2 -0
  280. package/lib/components/tree-view/types.js.map +1 -0
  281. package/lib/components/tree-view/util.js +40 -0
  282. package/lib/components/tree-view/util.js.map +1 -0
  283. package/lib/composables/choice-link.js +13 -0
  284. package/lib/composables/choice-link.js.map +1 -0
  285. package/lib/composables/choice.js +187 -0
  286. package/lib/composables/choice.js.map +1 -0
  287. package/lib/composables/communication.js +55 -0
  288. package/lib/composables/communication.js.map +1 -0
  289. package/lib/composables/component.js +8 -0
  290. package/lib/composables/component.js.map +1 -0
  291. package/lib/composables/coordinate/arrangement.js +14 -0
  292. package/lib/composables/coordinate/arrangement.js.map +1 -0
  293. package/lib/composables/coordinate/index.js +67 -0
  294. package/lib/composables/coordinate/index.js.map +1 -0
  295. package/lib/composables/coordinate/levitation.js +315 -0
  296. package/lib/composables/coordinate/levitation.js.map +1 -0
  297. package/lib/composables/coordinate/types.js +2 -0
  298. package/lib/composables/coordinate/types.js.map +1 -0
  299. package/lib/composables/coordinate/utils/point.js +55 -0
  300. package/lib/composables/coordinate/utils/point.js.map +1 -0
  301. package/lib/composables/date/factory.js +12 -0
  302. package/lib/composables/date/factory.js.map +1 -0
  303. package/lib/composables/date/index.js +20 -0
  304. package/lib/composables/date/index.js.map +1 -0
  305. package/lib/composables/date/setting.js +11 -0
  306. package/lib/composables/date/setting.js.map +1 -0
  307. package/lib/composables/date/types.js +2 -0
  308. package/lib/composables/date/types.js.map +1 -0
  309. package/lib/composables/defaults/index.js +99 -0
  310. package/lib/composables/defaults/index.js.map +1 -0
  311. package/lib/composables/defaults/share.js +2 -0
  312. package/lib/composables/defaults/share.js.map +1 -0
  313. package/lib/composables/defaults/types.js +2 -0
  314. package/lib/composables/defaults/types.js.map +1 -0
  315. package/lib/composables/dimension.js +26 -0
  316. package/lib/composables/dimension.js.map +1 -0
  317. package/lib/composables/focus.js +29 -0
  318. package/lib/composables/focus.js.map +1 -0
  319. package/lib/composables/form.js +100 -0
  320. package/lib/composables/form.js.map +1 -0
  321. package/lib/composables/i18n/index.js +30 -0
  322. package/lib/composables/i18n/index.js.map +1 -0
  323. package/lib/composables/i18n/locale.js +5 -0
  324. package/lib/composables/i18n/locale.js.map +1 -0
  325. package/lib/composables/i18n/rtl.js +34 -0
  326. package/lib/composables/i18n/rtl.js.map +1 -0
  327. package/lib/composables/i18n/share.js +2 -0
  328. package/lib/composables/i18n/share.js.map +1 -0
  329. package/lib/composables/icon.js +164 -0
  330. package/lib/composables/icon.js.map +1 -0
  331. package/lib/composables/index.js +11 -0
  332. package/lib/composables/index.js.map +1 -0
  333. package/lib/composables/layer-group.js +66 -0
  334. package/lib/composables/layer-group.js.map +1 -0
  335. package/lib/composables/layout.js +13 -0
  336. package/lib/composables/layout.js.map +1 -0
  337. package/lib/composables/list-items.js +66 -0
  338. package/lib/composables/list-items.js.map +1 -0
  339. package/lib/composables/progress.js +26 -0
  340. package/lib/composables/progress.js.map +1 -0
  341. package/lib/composables/ref.js +13 -0
  342. package/lib/composables/ref.js.map +1 -0
  343. package/lib/composables/resize-observer.js +33 -0
  344. package/lib/composables/resize-observer.js.map +1 -0
  345. package/lib/composables/scope.js +26 -0
  346. package/lib/composables/scope.js.map +1 -0
  347. package/lib/composables/style-color.js +37 -0
  348. package/lib/composables/style-color.js.map +1 -0
  349. package/lib/composables/theme/factory.js +47 -0
  350. package/lib/composables/theme/factory.js.map +1 -0
  351. package/lib/composables/theme/helper.js +14 -0
  352. package/lib/composables/theme/helper.js.map +1 -0
  353. package/lib/composables/theme/index.js +187 -0
  354. package/lib/composables/theme/index.js.map +1 -0
  355. package/lib/composables/theme/setting.js +112 -0
  356. package/lib/composables/theme/setting.js.map +1 -0
  357. package/lib/composables/theme/types.js +2 -0
  358. package/lib/composables/theme/types.js.map +1 -0
  359. package/lib/composables/timing.js +102 -0
  360. package/lib/composables/timing.js.map +1 -0
  361. package/lib/composables/transition.js +51 -0
  362. package/lib/composables/transition.js.map +1 -0
  363. package/lib/composables/validation.js +126 -0
  364. package/lib/composables/validation.js.map +1 -0
  365. package/lib/composables/vue-router.js +32 -0
  366. package/lib/composables/vue-router.js.map +1 -0
  367. package/lib/directives/complement-click/index.js +78 -0
  368. package/lib/directives/complement-click/index.js.map +1 -0
  369. package/lib/directives/plate-wave/index.js +100 -0
  370. package/lib/directives/plate-wave/index.js.map +1 -0
  371. package/lib/directives/theme-class.js +24 -0
  372. package/lib/directives/theme-class.js.map +1 -0
  373. package/lib/etc/index.js +6 -0
  374. package/lib/etc/index.js.map +1 -0
  375. package/lib/i18n/built-in.js +77 -0
  376. package/lib/i18n/built-in.js.map +1 -0
  377. package/lib/i18n/config.js +82 -0
  378. package/lib/i18n/config.js.map +1 -0
  379. package/lib/i18n/types.js +2 -0
  380. package/lib/i18n/types.js.map +1 -0
  381. package/lib/index.js +103 -0
  382. package/lib/index.js.map +1 -0
  383. package/lib/locales/en.js +6 -0
  384. package/lib/locales/en.js.map +1 -0
  385. package/lib/locales/index.js +3 -0
  386. package/lib/locales/index.js.map +1 -0
  387. package/lib/locales/ko.js +6 -0
  388. package/lib/locales/ko.js.map +1 -0
  389. package/lib/mixins/di.js +19 -0
  390. package/lib/mixins/di.js.map +1 -0
  391. package/lib/mixins/rebind-attrs.js +37 -0
  392. package/lib/mixins/rebind-attrs.js.map +1 -0
  393. package/lib/types/index.js +2 -0
  394. package/lib/types/index.js.map +1 -0
  395. package/lib/util/anchor.js +53 -0
  396. package/lib/util/anchor.js.map +1 -0
  397. package/lib/util/array.js +13 -0
  398. package/lib/util/array.js.map +1 -0
  399. package/lib/util/collection.js +10 -0
  400. package/lib/util/collection.js.map +1 -0
  401. package/lib/util/color/apca.js +201 -0
  402. package/lib/util/color/apca.js.map +1 -0
  403. package/lib/util/color/const.js +6 -0
  404. package/lib/util/color/const.js.map +1 -0
  405. package/lib/util/color/contrast/contrast.js +149 -0
  406. package/lib/util/color/contrast/contrast.js.map +1 -0
  407. package/lib/util/color/conversion.js +310 -0
  408. package/lib/util/color/conversion.js.map +1 -0
  409. package/lib/util/color/hct/cam16.js +349 -0
  410. package/lib/util/color/hct/cam16.js.map +1 -0
  411. package/lib/util/color/hct/hct-solver.js +389 -0
  412. package/lib/util/color/hct/hct-solver.js.map +1 -0
  413. package/lib/util/color/hct/hct.js +153 -0
  414. package/lib/util/color/hct/hct.js.map +1 -0
  415. package/lib/util/color/hct/viewing-conditions.js +110 -0
  416. package/lib/util/color/hct/viewing-conditions.js.map +1 -0
  417. package/lib/util/color/index.js +40 -0
  418. package/lib/util/color/index.js.map +1 -0
  419. package/lib/util/color/palettes/core-palette.js +99 -0
  420. package/lib/util/color/palettes/core-palette.js.map +1 -0
  421. package/lib/util/color/palettes/tonal-palette.js +112 -0
  422. package/lib/util/color/palettes/tonal-palette.js.map +1 -0
  423. package/lib/util/color/types.js +2 -0
  424. package/lib/util/color/types.js.map +1 -0
  425. package/lib/util/color/utils/math-utils.js +139 -0
  426. package/lib/util/color/utils/math-utils.js.map +1 -0
  427. package/lib/util/common.js +107 -0
  428. package/lib/util/common.js.map +1 -0
  429. package/lib/util/component/component.js +26 -0
  430. package/lib/util/component/component.js.map +1 -0
  431. package/lib/util/component/index.js +65 -0
  432. package/lib/util/component/index.js.map +1 -0
  433. package/lib/util/component/inject-self.js +10 -0
  434. package/lib/util/component/inject-self.js.map +1 -0
  435. package/lib/util/component/props.js +41 -0
  436. package/lib/util/component/props.js.map +1 -0
  437. package/lib/util/component/types.js +2 -0
  438. package/lib/util/component/types.js.map +1 -0
  439. package/lib/util/date/adapters/yuyeon-date-adapter.js +111 -0
  440. package/lib/util/date/adapters/yuyeon-date-adapter.js.map +1 -0
  441. package/lib/util/date/built-in.js +416 -0
  442. package/lib/util/date/built-in.js.map +1 -0
  443. package/lib/util/date/index.js +4 -0
  444. package/lib/util/date/index.js.map +1 -0
  445. package/lib/util/date/types.js +2 -0
  446. package/lib/util/date/types.js.map +1 -0
  447. package/lib/util/debounce.js +114 -0
  448. package/lib/util/debounce.js.map +1 -0
  449. package/lib/util/dom.js +23 -0
  450. package/lib/util/dom.js.map +1 -0
  451. package/lib/util/environments.js +8 -0
  452. package/lib/util/environments.js.map +1 -0
  453. package/lib/util/frame-scheduler.js +29 -0
  454. package/lib/util/frame-scheduler.js.map +1 -0
  455. package/lib/util/index.js +17 -0
  456. package/lib/util/index.js.map +1 -0
  457. package/lib/util/reactivity.js +19 -0
  458. package/lib/util/reactivity.js.map +1 -0
  459. package/lib/util/rect.js +39 -0
  460. package/lib/util/rect.js.map +1 -0
  461. package/lib/util/scroll.js +28 -0
  462. package/lib/util/scroll.js.map +1 -0
  463. package/lib/util/string.js +69 -0
  464. package/lib/util/string.js.map +1 -0
  465. package/lib/util/ui.js +60 -0
  466. package/lib/util/ui.js.map +1 -0
  467. package/lib/util/validation.js +5 -0
  468. package/lib/util/validation.js.map +1 -0
  469. package/package.json +12 -12
  470. package/lib/abstract/items.mjs +0 -20
  471. package/lib/abstract/items.mjs.map +0 -1
  472. package/lib/components/alert/YAlert.mjs +0 -83
  473. package/lib/components/alert/YAlert.mjs.map +0 -1
  474. package/lib/components/alert/index.mjs +0 -2
  475. package/lib/components/alert/index.mjs.map +0 -1
  476. package/lib/components/app/YApp.mjs +0 -21
  477. package/lib/components/app/YApp.mjs.map +0 -1
  478. package/lib/components/app/index.mjs +0 -2
  479. package/lib/components/app/index.mjs.map +0 -1
  480. package/lib/components/badge/YBadge.mjs +0 -83
  481. package/lib/components/badge/YBadge.mjs.map +0 -1
  482. package/lib/components/badge/index.mjs +0 -2
  483. package/lib/components/badge/index.mjs.map +0 -1
  484. package/lib/components/bench/YBench.mjs +0 -43
  485. package/lib/components/bench/YBench.mjs.map +0 -1
  486. package/lib/components/bench/index.mjs +0 -2
  487. package/lib/components/bench/index.mjs.map +0 -1
  488. package/lib/components/button/YButton.mjs +0 -169
  489. package/lib/components/button/YButton.mjs.map +0 -1
  490. package/lib/components/button/index.mjs +0 -2
  491. package/lib/components/button/index.mjs.map +0 -1
  492. package/lib/components/card/YCard.mjs +0 -28
  493. package/lib/components/card/YCard.mjs.map +0 -1
  494. package/lib/components/card/YCardBody.mjs +0 -11
  495. package/lib/components/card/YCardBody.mjs.map +0 -1
  496. package/lib/components/card/YCardFooter.mjs +0 -11
  497. package/lib/components/card/YCardFooter.mjs.map +0 -1
  498. package/lib/components/card/YCardHeader.mjs +0 -11
  499. package/lib/components/card/YCardHeader.mjs.map +0 -1
  500. package/lib/components/card/index.mjs +0 -5
  501. package/lib/components/card/index.mjs.map +0 -1
  502. package/lib/components/checkbox/YCheckbox.mjs +0 -160
  503. package/lib/components/checkbox/YCheckbox.mjs.map +0 -1
  504. package/lib/components/checkbox/YInputCheckbox.mjs +0 -114
  505. package/lib/components/checkbox/YInputCheckbox.mjs.map +0 -1
  506. package/lib/components/checkbox/index.mjs +0 -4
  507. package/lib/components/checkbox/index.mjs.map +0 -1
  508. package/lib/components/chip/YChip.mjs +0 -39
  509. package/lib/components/chip/YChip.mjs.map +0 -1
  510. package/lib/components/chip/index.mjs +0 -2
  511. package/lib/components/chip/index.mjs.map +0 -1
  512. package/lib/components/date-picker/YDateCalendar.mjs +0 -243
  513. package/lib/components/date-picker/YDateCalendar.mjs.map +0 -1
  514. package/lib/components/date-picker/YDatePicker.mjs +0 -132
  515. package/lib/components/date-picker/YDatePicker.mjs.map +0 -1
  516. package/lib/components/date-picker/YDatePickerControl.mjs +0 -107
  517. package/lib/components/date-picker/YDatePickerControl.mjs.map +0 -1
  518. package/lib/components/date-picker/YMonthPicker.mjs +0 -64
  519. package/lib/components/date-picker/YMonthPicker.mjs.map +0 -1
  520. package/lib/components/date-picker/YYearPicker.mjs +0 -87
  521. package/lib/components/date-picker/YYearPicker.mjs.map +0 -1
  522. package/lib/components/date-picker/index.mjs +0 -4
  523. package/lib/components/date-picker/index.mjs.map +0 -1
  524. package/lib/components/default-provider/YDefaultProvider.mjs +0 -2
  525. package/lib/components/default-provider/YDefaultProvider.mjs.map +0 -1
  526. package/lib/components/default-provider/index.mjs +0 -2
  527. package/lib/components/default-provider/index.mjs.map +0 -1
  528. package/lib/components/dialog/YDialog.mjs +0 -213
  529. package/lib/components/dialog/YDialog.mjs.map +0 -1
  530. package/lib/components/dialog/index.mjs +0 -2
  531. package/lib/components/dialog/index.mjs.map +0 -1
  532. package/lib/components/divider/YDivider.mjs +0 -20
  533. package/lib/components/divider/YDivider.mjs.map +0 -1
  534. package/lib/components/divider/index.mjs +0 -2
  535. package/lib/components/divider/index.mjs.map +0 -1
  536. package/lib/components/draggable/YDraggable.mjs +0 -95
  537. package/lib/components/draggable/YDraggable.mjs.map +0 -1
  538. package/lib/components/dropdown/YDropdown.mjs +0 -109
  539. package/lib/components/dropdown/YDropdown.mjs.map +0 -1
  540. package/lib/components/dropdown/index.mjs +0 -2
  541. package/lib/components/dropdown/index.mjs.map +0 -1
  542. package/lib/components/field-input/YFieldInput.mjs +0 -229
  543. package/lib/components/field-input/YFieldInput.mjs.map +0 -1
  544. package/lib/components/field-input/index.mjs +0 -2
  545. package/lib/components/field-input/index.mjs.map +0 -1
  546. package/lib/components/form/YForm.mjs +0 -65
  547. package/lib/components/form/YForm.mjs.map +0 -1
  548. package/lib/components/form/index.mjs +0 -2
  549. package/lib/components/form/index.mjs.map +0 -1
  550. package/lib/components/hover/YHover.mjs +0 -54
  551. package/lib/components/hover/YHover.mjs.map +0 -1
  552. package/lib/components/hover/index.mjs +0 -2
  553. package/lib/components/hover/index.mjs.map +0 -1
  554. package/lib/components/icon/YIcon.mjs +0 -63
  555. package/lib/components/icon/YIcon.mjs.map +0 -1
  556. package/lib/components/icon/index.mjs +0 -2
  557. package/lib/components/icon/index.mjs.map +0 -1
  558. package/lib/components/icon/poly.mjs +0 -57
  559. package/lib/components/icon/poly.mjs.map +0 -1
  560. package/lib/components/icons/YIconCheckbox.mjs +0 -32
  561. package/lib/components/icons/YIconCheckbox.mjs.map +0 -1
  562. package/lib/components/icons/YIconClear.mjs +0 -16
  563. package/lib/components/icons/YIconClear.mjs.map +0 -1
  564. package/lib/components/icons/YIconDropdown.mjs +0 -16
  565. package/lib/components/icons/YIconDropdown.mjs.map +0 -1
  566. package/lib/components/icons/YIconExpand.mjs +0 -20
  567. package/lib/components/icons/YIconExpand.mjs.map +0 -1
  568. package/lib/components/icons/YIconPageControl.mjs +0 -32
  569. package/lib/components/icons/YIconPageControl.mjs.map +0 -1
  570. package/lib/components/icons/YIconSort.mjs +0 -45
  571. package/lib/components/icons/YIconSort.mjs.map +0 -1
  572. package/lib/components/icons/index.mjs +0 -32
  573. package/lib/components/icons/index.mjs.map +0 -1
  574. package/lib/components/img/YImg.mjs +0 -173
  575. package/lib/components/img/YImg.mjs.map +0 -1
  576. package/lib/components/img/index.mjs +0 -2
  577. package/lib/components/img/index.mjs.map +0 -1
  578. package/lib/components/index.mjs +0 -39
  579. package/lib/components/index.mjs.map +0 -1
  580. package/lib/components/input/YInput.mjs +0 -258
  581. package/lib/components/input/YInput.mjs.map +0 -1
  582. package/lib/components/input/index.mjs +0 -2
  583. package/lib/components/input/index.mjs.map +0 -1
  584. package/lib/components/ip-field/YIpv4Field.mjs +0 -297
  585. package/lib/components/ip-field/YIpv4Field.mjs.map +0 -1
  586. package/lib/components/ip-field/index.mjs +0 -2
  587. package/lib/components/ip-field/index.mjs.map +0 -1
  588. package/lib/components/layer/YLayer.mjs +0 -326
  589. package/lib/components/layer/YLayer.mjs.map +0 -1
  590. package/lib/components/layer/active-delay.mjs +0 -28
  591. package/lib/components/layer/active-delay.mjs.map +0 -1
  592. package/lib/components/layer/active-stack.mjs +0 -52
  593. package/lib/components/layer/active-stack.mjs.map +0 -1
  594. package/lib/components/layer/base.mjs +0 -87
  595. package/lib/components/layer/base.mjs.map +0 -1
  596. package/lib/components/layer/content.mjs +0 -22
  597. package/lib/components/layer/content.mjs.map +0 -1
  598. package/lib/components/layer/index.mjs +0 -2
  599. package/lib/components/layer/index.mjs.map +0 -1
  600. package/lib/components/layer/scroll-strategies.mjs +0 -132
  601. package/lib/components/layer/scroll-strategies.mjs.map +0 -1
  602. package/lib/components/list/YList.mjs +0 -55
  603. package/lib/components/list/YList.mjs.map +0 -1
  604. package/lib/components/list/YListItem.mjs +0 -59
  605. package/lib/components/list/YListItem.mjs.map +0 -1
  606. package/lib/components/list/index.mjs +0 -3
  607. package/lib/components/list/index.mjs.map +0 -1
  608. package/lib/components/loading/YSpinnerRing.mjs +0 -25
  609. package/lib/components/loading/YSpinnerRing.mjs.map +0 -1
  610. package/lib/components/loading/index.mjs +0 -2
  611. package/lib/components/loading/index.mjs.map +0 -1
  612. package/lib/components/menu/YMenu.mjs +0 -211
  613. package/lib/components/menu/YMenu.mjs.map +0 -1
  614. package/lib/components/menu/index.mjs +0 -2
  615. package/lib/components/menu/index.mjs.map +0 -1
  616. package/lib/components/navigation/YNavigation.mjs +0 -18
  617. package/lib/components/navigation/YNavigation.mjs.map +0 -1
  618. package/lib/components/navigation/index.mjs +0 -2
  619. package/lib/components/navigation/index.mjs.map +0 -1
  620. package/lib/components/pagination/YPagination.mjs +0 -288
  621. package/lib/components/pagination/YPagination.mjs.map +0 -1
  622. package/lib/components/pagination/index.mjs +0 -2
  623. package/lib/components/pagination/index.mjs.map +0 -1
  624. package/lib/components/panel/YDividePanel.mjs +0 -90
  625. package/lib/components/panel/YDividePanel.mjs.map +0 -1
  626. package/lib/components/panel/index.mjs +0 -2
  627. package/lib/components/panel/index.mjs.map +0 -1
  628. package/lib/components/plate/YPlate.mjs +0 -28
  629. package/lib/components/plate/YPlate.mjs.map +0 -1
  630. package/lib/components/plate/index.mjs +0 -2
  631. package/lib/components/plate/index.mjs.map +0 -1
  632. package/lib/components/progress-bar/YProgressBar.mjs +0 -117
  633. package/lib/components/progress-bar/YProgressBar.mjs.map +0 -1
  634. package/lib/components/progress-bar/index.mjs +0 -2
  635. package/lib/components/progress-bar/index.mjs.map +0 -1
  636. package/lib/components/progress-ring/YProgressRing.mjs +0 -128
  637. package/lib/components/progress-ring/YProgressRing.mjs.map +0 -1
  638. package/lib/components/progress-ring/index.mjs +0 -2
  639. package/lib/components/progress-ring/index.mjs.map +0 -1
  640. package/lib/components/select/YSelect.mjs +0 -344
  641. package/lib/components/select/YSelect.mjs.map +0 -1
  642. package/lib/components/select/index.mjs +0 -2
  643. package/lib/components/select/index.mjs.map +0 -1
  644. package/lib/components/slider/YSlider.mjs +0 -26
  645. package/lib/components/slider/YSlider.mjs.map +0 -1
  646. package/lib/components/slider/index.mjs +0 -2
  647. package/lib/components/slider/index.mjs.map +0 -1
  648. package/lib/components/snackbar/YSnackbar.mjs +0 -209
  649. package/lib/components/snackbar/YSnackbar.mjs.map +0 -1
  650. package/lib/components/snackbar/index.mjs +0 -2
  651. package/lib/components/snackbar/index.mjs.map +0 -1
  652. package/lib/components/switch/YSwitch.mjs +0 -184
  653. package/lib/components/switch/YSwitch.mjs.map +0 -1
  654. package/lib/components/switch/index.mjs +0 -2
  655. package/lib/components/switch/index.mjs.map +0 -1
  656. package/lib/components/tab/YTab.mjs +0 -64
  657. package/lib/components/tab/YTab.mjs.map +0 -1
  658. package/lib/components/tab/YTabs.mjs +0 -86
  659. package/lib/components/tab/YTabs.mjs.map +0 -1
  660. package/lib/components/tab/index.mjs +0 -4
  661. package/lib/components/tab/index.mjs.map +0 -1
  662. package/lib/components/tab/shared.mjs +0 -2
  663. package/lib/components/tab/shared.mjs.map +0 -1
  664. package/lib/components/tab/types.mjs +0 -2
  665. package/lib/components/tab/types.mjs.map +0 -1
  666. package/lib/components/table/YDataTable.mjs +0 -182
  667. package/lib/components/table/YDataTable.mjs.map +0 -1
  668. package/lib/components/table/YDataTableBody.mjs +0 -131
  669. package/lib/components/table/YDataTableBody.mjs.map +0 -1
  670. package/lib/components/table/YDataTableCell.mjs +0 -78
  671. package/lib/components/table/YDataTableCell.mjs.map +0 -1
  672. package/lib/components/table/YDataTableControl.mjs +0 -46
  673. package/lib/components/table/YDataTableControl.mjs.map +0 -1
  674. package/lib/components/table/YDataTableHead.mjs +0 -172
  675. package/lib/components/table/YDataTableHead.mjs.map +0 -1
  676. package/lib/components/table/YDataTableLayer.mjs +0 -29
  677. package/lib/components/table/YDataTableLayer.mjs.map +0 -1
  678. package/lib/components/table/YDataTableRow.mjs +0 -150
  679. package/lib/components/table/YDataTableRow.mjs.map +0 -1
  680. package/lib/components/table/YDataTableServer.mjs +0 -173
  681. package/lib/components/table/YDataTableServer.mjs.map +0 -1
  682. package/lib/components/table/YTable.mjs +0 -77
  683. package/lib/components/table/YTable.mjs.map +0 -1
  684. package/lib/components/table/composibles/header.mjs +0 -127
  685. package/lib/components/table/composibles/header.mjs.map +0 -1
  686. package/lib/components/table/composibles/items.mjs +0 -52
  687. package/lib/components/table/composibles/items.mjs.map +0 -1
  688. package/lib/components/table/composibles/measure.mjs +0 -39
  689. package/lib/components/table/composibles/measure.mjs.map +0 -1
  690. package/lib/components/table/composibles/options.mjs +0 -33
  691. package/lib/components/table/composibles/options.mjs.map +0 -1
  692. package/lib/components/table/composibles/pagination.mjs +0 -99
  693. package/lib/components/table/composibles/pagination.mjs.map +0 -1
  694. package/lib/components/table/composibles/selection.mjs +0 -196
  695. package/lib/components/table/composibles/selection.mjs.map +0 -1
  696. package/lib/components/table/composibles/sorted-items.mjs +0 -50
  697. package/lib/components/table/composibles/sorted-items.mjs.map +0 -1
  698. package/lib/components/table/composibles/sorting.mjs +0 -73
  699. package/lib/components/table/composibles/sorting.mjs.map +0 -1
  700. package/lib/components/table/index.mjs +0 -9
  701. package/lib/components/table/index.mjs.map +0 -1
  702. package/lib/components/table/types/common.mjs +0 -2
  703. package/lib/components/table/types/common.mjs.map +0 -1
  704. package/lib/components/table/types/header.mjs +0 -2
  705. package/lib/components/table/types/header.mjs.map +0 -1
  706. package/lib/components/table/types/index.mjs +0 -2
  707. package/lib/components/table/types/index.mjs.map +0 -1
  708. package/lib/components/table/types/item.mjs +0 -2
  709. package/lib/components/table/types/item.mjs.map +0 -1
  710. package/lib/components/table/types/row.mjs +0 -2
  711. package/lib/components/table/types/row.mjs.map +0 -1
  712. package/lib/components/text-ellipsis/YTextEllipsis.mjs +0 -66
  713. package/lib/components/text-ellipsis/YTextEllipsis.mjs.map +0 -1
  714. package/lib/components/text-ellipsis/index.mjs +0 -2
  715. package/lib/components/text-ellipsis/index.mjs.map +0 -1
  716. package/lib/components/text-highlighter/YTextHighlighter.mjs +0 -95
  717. package/lib/components/text-highlighter/YTextHighlighter.mjs.map +0 -1
  718. package/lib/components/text-highlighter/index.mjs +0 -2
  719. package/lib/components/text-highlighter/index.mjs.map +0 -1
  720. package/lib/components/text-interpolation/YTi.mjs +0 -47
  721. package/lib/components/text-interpolation/YTi.mjs.map +0 -1
  722. package/lib/components/text-interpolation/index.mjs +0 -2
  723. package/lib/components/text-interpolation/index.mjs.map +0 -1
  724. package/lib/components/textarea/YTextarea.mjs +0 -157
  725. package/lib/components/textarea/YTextarea.mjs.map +0 -1
  726. package/lib/components/textarea/index.mjs +0 -2
  727. package/lib/components/textarea/index.mjs.map +0 -1
  728. package/lib/components/toggle-button/YToggleButton.mjs +0 -2
  729. package/lib/components/toggle-button/YToggleButton.mjs.map +0 -1
  730. package/lib/components/toggle-button/index.mjs +0 -2
  731. package/lib/components/toggle-button/index.mjs.map +0 -1
  732. package/lib/components/tooltip/YTooltip.mjs +0 -157
  733. package/lib/components/tooltip/YTooltip.mjs.map +0 -1
  734. package/lib/components/tooltip/index.mjs +0 -2
  735. package/lib/components/tooltip/index.mjs.map +0 -1
  736. package/lib/components/transitions/expand-transition.mjs +0 -109
  737. package/lib/components/transitions/expand-transition.mjs.map +0 -1
  738. package/lib/components/transitions/index.mjs +0 -4
  739. package/lib/components/transitions/index.mjs.map +0 -1
  740. package/lib/components/tree-view/YTreeView.mjs +0 -289
  741. package/lib/components/tree-view/YTreeView.mjs.map +0 -1
  742. package/lib/components/tree-view/YTreeViewNode.mjs +0 -250
  743. package/lib/components/tree-view/YTreeViewNode.mjs.map +0 -1
  744. package/lib/components/tree-view/index.mjs +0 -3
  745. package/lib/components/tree-view/index.mjs.map +0 -1
  746. package/lib/components/tree-view/tree-view.mjs +0 -179
  747. package/lib/components/tree-view/tree-view.mjs.map +0 -1
  748. package/lib/components/tree-view/types.mjs +0 -2
  749. package/lib/components/tree-view/types.mjs.map +0 -1
  750. package/lib/components/tree-view/util.mjs +0 -40
  751. package/lib/components/tree-view/util.mjs.map +0 -1
  752. package/lib/composables/choice-link.mjs +0 -13
  753. package/lib/composables/choice-link.mjs.map +0 -1
  754. package/lib/composables/choice.mjs +0 -187
  755. package/lib/composables/choice.mjs.map +0 -1
  756. package/lib/composables/communication.mjs +0 -55
  757. package/lib/composables/communication.mjs.map +0 -1
  758. package/lib/composables/component.mjs +0 -8
  759. package/lib/composables/component.mjs.map +0 -1
  760. package/lib/composables/coordinate/arrangement.mjs +0 -14
  761. package/lib/composables/coordinate/arrangement.mjs.map +0 -1
  762. package/lib/composables/coordinate/index.mjs +0 -67
  763. package/lib/composables/coordinate/index.mjs.map +0 -1
  764. package/lib/composables/coordinate/levitation.mjs +0 -315
  765. package/lib/composables/coordinate/levitation.mjs.map +0 -1
  766. package/lib/composables/coordinate/types.mjs +0 -2
  767. package/lib/composables/coordinate/types.mjs.map +0 -1
  768. package/lib/composables/coordinate/utils/point.mjs +0 -55
  769. package/lib/composables/coordinate/utils/point.mjs.map +0 -1
  770. package/lib/composables/date/factory.mjs +0 -12
  771. package/lib/composables/date/factory.mjs.map +0 -1
  772. package/lib/composables/date/index.mjs +0 -20
  773. package/lib/composables/date/index.mjs.map +0 -1
  774. package/lib/composables/date/setting.mjs +0 -11
  775. package/lib/composables/date/setting.mjs.map +0 -1
  776. package/lib/composables/date/types.mjs +0 -2
  777. package/lib/composables/date/types.mjs.map +0 -1
  778. package/lib/composables/defaults/index.mjs +0 -99
  779. package/lib/composables/defaults/index.mjs.map +0 -1
  780. package/lib/composables/defaults/share.mjs +0 -2
  781. package/lib/composables/defaults/share.mjs.map +0 -1
  782. package/lib/composables/defaults/types.mjs +0 -2
  783. package/lib/composables/defaults/types.mjs.map +0 -1
  784. package/lib/composables/dimension.mjs +0 -26
  785. package/lib/composables/dimension.mjs.map +0 -1
  786. package/lib/composables/focus.mjs +0 -29
  787. package/lib/composables/focus.mjs.map +0 -1
  788. package/lib/composables/form.mjs +0 -100
  789. package/lib/composables/form.mjs.map +0 -1
  790. package/lib/composables/group.mjs +0 -194
  791. package/lib/composables/group.mjs.map +0 -1
  792. package/lib/composables/i18n/index.mjs +0 -30
  793. package/lib/composables/i18n/index.mjs.map +0 -1
  794. package/lib/composables/i18n/locale.mjs +0 -5
  795. package/lib/composables/i18n/locale.mjs.map +0 -1
  796. package/lib/composables/i18n/rtl.mjs +0 -34
  797. package/lib/composables/i18n/rtl.mjs.map +0 -1
  798. package/lib/composables/i18n/share.mjs +0 -2
  799. package/lib/composables/i18n/share.mjs.map +0 -1
  800. package/lib/composables/icon.mjs +0 -164
  801. package/lib/composables/icon.mjs.map +0 -1
  802. package/lib/composables/index.mjs +0 -11
  803. package/lib/composables/index.mjs.map +0 -1
  804. package/lib/composables/layer-group.mjs +0 -66
  805. package/lib/composables/layer-group.mjs.map +0 -1
  806. package/lib/composables/layout.mjs +0 -13
  807. package/lib/composables/layout.mjs.map +0 -1
  808. package/lib/composables/list-items.mjs +0 -66
  809. package/lib/composables/list-items.mjs.map +0 -1
  810. package/lib/composables/progress.mjs +0 -26
  811. package/lib/composables/progress.mjs.map +0 -1
  812. package/lib/composables/ref.mjs +0 -13
  813. package/lib/composables/ref.mjs.map +0 -1
  814. package/lib/composables/resize-observer.mjs +0 -33
  815. package/lib/composables/resize-observer.mjs.map +0 -1
  816. package/lib/composables/scope.mjs +0 -26
  817. package/lib/composables/scope.mjs.map +0 -1
  818. package/lib/composables/style-color.mjs +0 -37
  819. package/lib/composables/style-color.mjs.map +0 -1
  820. package/lib/composables/theme/factory.mjs +0 -47
  821. package/lib/composables/theme/factory.mjs.map +0 -1
  822. package/lib/composables/theme/helper.mjs +0 -14
  823. package/lib/composables/theme/helper.mjs.map +0 -1
  824. package/lib/composables/theme/index.mjs +0 -187
  825. package/lib/composables/theme/index.mjs.map +0 -1
  826. package/lib/composables/theme/setting.mjs +0 -112
  827. package/lib/composables/theme/setting.mjs.map +0 -1
  828. package/lib/composables/theme/types.mjs +0 -2
  829. package/lib/composables/theme/types.mjs.map +0 -1
  830. package/lib/composables/timing.mjs +0 -102
  831. package/lib/composables/timing.mjs.map +0 -1
  832. package/lib/composables/transition.mjs +0 -51
  833. package/lib/composables/transition.mjs.map +0 -1
  834. package/lib/composables/validation.mjs +0 -126
  835. package/lib/composables/validation.mjs.map +0 -1
  836. package/lib/composables/vue-router.mjs +0 -32
  837. package/lib/composables/vue-router.mjs.map +0 -1
  838. package/lib/directives/complement-click/index.mjs +0 -78
  839. package/lib/directives/complement-click/index.mjs.map +0 -1
  840. package/lib/directives/plate-wave/index.mjs +0 -100
  841. package/lib/directives/plate-wave/index.mjs.map +0 -1
  842. package/lib/directives/theme-class.mjs +0 -24
  843. package/lib/directives/theme-class.mjs.map +0 -1
  844. package/lib/etc/index.mjs +0 -6
  845. package/lib/etc/index.mjs.map +0 -1
  846. package/lib/i18n/built-in.mjs +0 -77
  847. package/lib/i18n/built-in.mjs.map +0 -1
  848. package/lib/i18n/config.mjs +0 -82
  849. package/lib/i18n/config.mjs.map +0 -1
  850. package/lib/i18n/types.mjs +0 -2
  851. package/lib/i18n/types.mjs.map +0 -1
  852. package/lib/index.mjs +0 -103
  853. package/lib/index.mjs.map +0 -1
  854. package/lib/locales/en.mjs +0 -6
  855. package/lib/locales/en.mjs.map +0 -1
  856. package/lib/locales/index.mjs +0 -3
  857. package/lib/locales/index.mjs.map +0 -1
  858. package/lib/locales/ko.mjs +0 -6
  859. package/lib/locales/ko.mjs.map +0 -1
  860. package/lib/mixins/di.mjs +0 -19
  861. package/lib/mixins/di.mjs.map +0 -1
  862. package/lib/mixins/rebind-attrs.mjs +0 -37
  863. package/lib/mixins/rebind-attrs.mjs.map +0 -1
  864. package/lib/types/index.mjs +0 -2
  865. package/lib/types/index.mjs.map +0 -1
  866. package/lib/util/anchor.mjs +0 -53
  867. package/lib/util/anchor.mjs.map +0 -1
  868. package/lib/util/array.mjs +0 -13
  869. package/lib/util/array.mjs.map +0 -1
  870. package/lib/util/collection.mjs +0 -10
  871. package/lib/util/collection.mjs.map +0 -1
  872. package/lib/util/color/apca.mjs +0 -201
  873. package/lib/util/color/apca.mjs.map +0 -1
  874. package/lib/util/color/const.mjs +0 -6
  875. package/lib/util/color/const.mjs.map +0 -1
  876. package/lib/util/color/contrast/contrast.mjs +0 -149
  877. package/lib/util/color/contrast/contrast.mjs.map +0 -1
  878. package/lib/util/color/conversion.mjs +0 -310
  879. package/lib/util/color/conversion.mjs.map +0 -1
  880. package/lib/util/color/hct/cam16.mjs +0 -349
  881. package/lib/util/color/hct/cam16.mjs.map +0 -1
  882. package/lib/util/color/hct/hct-solver.mjs +0 -389
  883. package/lib/util/color/hct/hct-solver.mjs.map +0 -1
  884. package/lib/util/color/hct/hct.mjs +0 -153
  885. package/lib/util/color/hct/hct.mjs.map +0 -1
  886. package/lib/util/color/hct/viewing-conditions.mjs +0 -110
  887. package/lib/util/color/hct/viewing-conditions.mjs.map +0 -1
  888. package/lib/util/color/index.mjs +0 -40
  889. package/lib/util/color/index.mjs.map +0 -1
  890. package/lib/util/color/palettes/core-palette.mjs +0 -99
  891. package/lib/util/color/palettes/core-palette.mjs.map +0 -1
  892. package/lib/util/color/palettes/tonal-palette.mjs +0 -112
  893. package/lib/util/color/palettes/tonal-palette.mjs.map +0 -1
  894. package/lib/util/color/types.mjs +0 -2
  895. package/lib/util/color/types.mjs.map +0 -1
  896. package/lib/util/color/utils/math-utils.mjs +0 -139
  897. package/lib/util/color/utils/math-utils.mjs.map +0 -1
  898. package/lib/util/common.mjs +0 -107
  899. package/lib/util/common.mjs.map +0 -1
  900. package/lib/util/component/component.mjs +0 -26
  901. package/lib/util/component/component.mjs.map +0 -1
  902. package/lib/util/component/index.mjs +0 -65
  903. package/lib/util/component/index.mjs.map +0 -1
  904. package/lib/util/component/inject-self.mjs +0 -10
  905. package/lib/util/component/inject-self.mjs.map +0 -1
  906. package/lib/util/component/props.mjs +0 -41
  907. package/lib/util/component/props.mjs.map +0 -1
  908. package/lib/util/component/types.mjs +0 -2
  909. package/lib/util/component/types.mjs.map +0 -1
  910. package/lib/util/date/adapters/yuyeon-date-adapter.mjs +0 -111
  911. package/lib/util/date/adapters/yuyeon-date-adapter.mjs.map +0 -1
  912. package/lib/util/date/built-in.mjs +0 -416
  913. package/lib/util/date/built-in.mjs.map +0 -1
  914. package/lib/util/date/index.mjs +0 -4
  915. package/lib/util/date/index.mjs.map +0 -1
  916. package/lib/util/date/types.mjs +0 -2
  917. package/lib/util/date/types.mjs.map +0 -1
  918. package/lib/util/debounce.mjs +0 -114
  919. package/lib/util/debounce.mjs.map +0 -1
  920. package/lib/util/dom.mjs +0 -23
  921. package/lib/util/dom.mjs.map +0 -1
  922. package/lib/util/environments.mjs +0 -8
  923. package/lib/util/environments.mjs.map +0 -1
  924. package/lib/util/frame-scheduler.mjs +0 -29
  925. package/lib/util/frame-scheduler.mjs.map +0 -1
  926. package/lib/util/index.mjs +0 -17
  927. package/lib/util/index.mjs.map +0 -1
  928. package/lib/util/parser.mjs +0 -31
  929. package/lib/util/parser.mjs.map +0 -1
  930. package/lib/util/reactivity.mjs +0 -19
  931. package/lib/util/reactivity.mjs.map +0 -1
  932. package/lib/util/rect.mjs +0 -39
  933. package/lib/util/rect.mjs.map +0 -1
  934. package/lib/util/scroll.mjs +0 -28
  935. package/lib/util/scroll.mjs.map +0 -1
  936. package/lib/util/string.mjs +0 -69
  937. package/lib/util/string.mjs.map +0 -1
  938. package/lib/util/ui.mjs +0 -60
  939. package/lib/util/ui.mjs.map +0 -1
  940. package/lib/util/validation.mjs +0 -5
  941. package/lib/util/validation.mjs.map +0 -1
  942. package/lib/util/vue-component/index.mjs +0 -63
  943. package/lib/util/vue-component/index.mjs.map +0 -1
  944. package/lib/util/vue-component/props.mjs +0 -37
  945. package/lib/util/vue-component/props.mjs.map +0 -1
  946. package/lib/util/vue-component/types.mjs +0 -2
  947. package/lib/util/vue-component/types.mjs.map +0 -1
  948. package/lib/util/vue-component.mjs +0 -102
  949. package/lib/util/vue-component.mjs.map +0 -1
@@ -1,389 +0,0 @@
1
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
3
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
4
- /**
5
- * @license
6
- * Copyright 2021 Google LLC
7
- *
8
- * Licensed under the Apache License, Version 2.0 (the "License");
9
- * you may not use this file except in compliance with the License.
10
- * You may obtain a copy of the License at
11
- *
12
- * http://www.apache.org/licenses/LICENSE-2.0
13
- *
14
- * Unless required by applicable law or agreed to in writing, software
15
- * distributed under the License is distributed on an "AS IS" BASIS,
16
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17
- * See the License for the specific language governing permissions and
18
- * limitations under the License.
19
- */
20
- // This file is automatically generated. Do not modify it.
21
- import { Cam16 } from "./cam16.mjs";
22
- import { ViewingConditions } from "./viewing-conditions.mjs";
23
- import { argbFromLinrgb, argbFromLstar, yFromLstar } from "../conversion.mjs";
24
- import * as mathUtils from "../utils/math-utils.mjs"; // material_color_utilities is designed to have a consistent API across
25
- // platforms and modular components that can be moved around easily. Using a
26
- // class as a namespace facilitates this.
27
- //
28
- // tslint:disable:class-as-namespace
29
- /**
30
- * A class that solves the HCT equation.
31
- */
32
- export class HctSolver {
33
- /**
34
- * Sanitizes a small enough angle in radians.
35
- *
36
- * @param angle An angle in radians; must not deviate too much
37
- * from 0.
38
- * @return A coterminal angle between 0 and 2pi.
39
- */
40
- static sanitizeRadians(angle) {
41
- return (angle + Math.PI * 8) % (Math.PI * 2);
42
- }
43
-
44
- /**
45
- * Delinearizes an RGB component, returning a floating-point
46
- * number.
47
- *
48
- * @param rgbComponent 0.0 <= rgb_component <= 100.0, represents
49
- * linear R/G/B channel
50
- * @return 0.0 <= output <= 255.0, color channel converted to
51
- * regular RGB space
52
- */
53
- static trueDelinearized(rgbComponent) {
54
- const normalized = rgbComponent / 100.0;
55
- let delinearized = 0.0;
56
- if (normalized <= 0.0031308) {
57
- delinearized = normalized * 12.92;
58
- } else {
59
- delinearized = 1.055 * Math.pow(normalized, 1.0 / 2.4) - 0.055;
60
- }
61
- return delinearized * 255.0;
62
- }
63
- static chromaticAdaptation(component) {
64
- const af = Math.pow(Math.abs(component), 0.42);
65
- return mathUtils.signum(component) * 400.0 * af / (af + 27.13);
66
- }
67
-
68
- /**
69
- * Returns the hue of a linear RGB color in CAM16.
70
- *
71
- * @param linrgb The linear RGB coordinates of a color.
72
- * @return The hue of the color in CAM16, in radians.
73
- */
74
- static hueOf(linrgb) {
75
- const scaledDiscount = mathUtils.matrixMultiply(linrgb, HctSolver.SCALED_DISCOUNT_FROM_LINRGB);
76
- const rA = HctSolver.chromaticAdaptation(scaledDiscount[0]);
77
- const gA = HctSolver.chromaticAdaptation(scaledDiscount[1]);
78
- const bA = HctSolver.chromaticAdaptation(scaledDiscount[2]);
79
- // redness-greenness
80
- const a = (11.0 * rA + -12.0 * gA + bA) / 11.0;
81
- // yellowness-blueness
82
- const b = (rA + gA - 2.0 * bA) / 9.0;
83
- return Math.atan2(b, a);
84
- }
85
- static areInCyclicOrder(a, b, c) {
86
- const deltaAB = HctSolver.sanitizeRadians(b - a);
87
- const deltaAC = HctSolver.sanitizeRadians(c - a);
88
- return deltaAB < deltaAC;
89
- }
90
-
91
- /**
92
- * Solves the lerp equation.
93
- *
94
- * @param source The starting number.
95
- * @param mid The number in the middle.
96
- * @param target The ending number.
97
- * @return A number t such that lerp(source, target, t) = mid.
98
- */
99
- static intercept(source, mid, target) {
100
- return (mid - source) / (target - source);
101
- }
102
- static lerpPoint(source, t, target) {
103
- return [source[0] + (target[0] - source[0]) * t, source[1] + (target[1] - source[1]) * t, source[2] + (target[2] - source[2]) * t];
104
- }
105
-
106
- /**
107
- * Intersects a segment with a plane.
108
- *
109
- * @param source The coordinates of point A.
110
- * @param coordinate The R-, G-, or B-coordinate of the plane.
111
- * @param target The coordinates of point B.
112
- * @param axis The axis the plane is perpendicular with. (0: R, 1:
113
- * G, 2: B)
114
- * @return The intersection point of the segment AB with the plane
115
- * R=coordinate, G=coordinate, or B=coordinate
116
- */
117
- static setCoordinate(source, coordinate, target, axis) {
118
- const t = HctSolver.intercept(source[axis], coordinate, target[axis]);
119
- return HctSolver.lerpPoint(source, t, target);
120
- }
121
- static isBounded(x) {
122
- return 0.0 <= x && x <= 100.0;
123
- }
124
-
125
- /**
126
- * Returns the nth possible vertex of the polygonal intersection.
127
- *
128
- * @param y The Y value of the plane.
129
- * @param n The zero-based index of the point. 0 <= n <= 11.
130
- * @return The nth possible vertex of the polygonal intersection
131
- * of the y plane and the RGB cube, in linear RGB coordinates, if
132
- * it exists. If this possible vertex lies outside of the cube,
133
- * [-1.0, -1.0, -1.0] is returned.
134
- */
135
- static nthVertex(y, n) {
136
- const kR = HctSolver.Y_FROM_LINRGB[0];
137
- const kG = HctSolver.Y_FROM_LINRGB[1];
138
- const kB = HctSolver.Y_FROM_LINRGB[2];
139
- const coordA = n % 4 <= 1 ? 0.0 : 100.0;
140
- const coordB = n % 2 === 0 ? 0.0 : 100.0;
141
- if (n < 4) {
142
- const g = coordA;
143
- const b = coordB;
144
- const r = (y - g * kG - b * kB) / kR;
145
- if (HctSolver.isBounded(r)) {
146
- return [r, g, b];
147
- } else {
148
- return [-1.0, -1.0, -1.0];
149
- }
150
- } else if (n < 8) {
151
- const b = coordA;
152
- const r = coordB;
153
- const g = (y - r * kR - b * kB) / kG;
154
- if (HctSolver.isBounded(g)) {
155
- return [r, g, b];
156
- } else {
157
- return [-1.0, -1.0, -1.0];
158
- }
159
- } else {
160
- const r = coordA;
161
- const g = coordB;
162
- const b = (y - r * kR - g * kG) / kB;
163
- if (HctSolver.isBounded(b)) {
164
- return [r, g, b];
165
- } else {
166
- return [-1.0, -1.0, -1.0];
167
- }
168
- }
169
- }
170
-
171
- /**
172
- * Finds the segment containing the desired color.
173
- *
174
- * @param y The Y value of the color.
175
- * @param targetHue The hue of the color.
176
- * @return A list of two sets of linear RGB coordinates, each
177
- * corresponding to an endpoint of the segment containing the
178
- * desired color.
179
- */
180
- static bisectToSegment(y, targetHue) {
181
- let left = [-1.0, -1.0, -1.0];
182
- let right = left;
183
- let leftHue = 0.0;
184
- let rightHue = 0.0;
185
- let initialized = false;
186
- let uncut = true;
187
- for (let n = 0; n < 12; n++) {
188
- const mid = HctSolver.nthVertex(y, n);
189
- if (mid[0] < 0) {
190
- continue;
191
- }
192
- const midHue = HctSolver.hueOf(mid);
193
- if (!initialized) {
194
- left = mid;
195
- right = mid;
196
- leftHue = midHue;
197
- rightHue = midHue;
198
- initialized = true;
199
- continue;
200
- }
201
- if (uncut || HctSolver.areInCyclicOrder(leftHue, midHue, rightHue)) {
202
- uncut = false;
203
- if (HctSolver.areInCyclicOrder(leftHue, targetHue, midHue)) {
204
- right = mid;
205
- rightHue = midHue;
206
- } else {
207
- left = mid;
208
- leftHue = midHue;
209
- }
210
- }
211
- }
212
- return [left, right];
213
- }
214
- static midpoint(a, b) {
215
- return [(a[0] + b[0]) / 2, (a[1] + b[1]) / 2, (a[2] + b[2]) / 2];
216
- }
217
- static criticalPlaneBelow(x) {
218
- return Math.floor(x - 0.5);
219
- }
220
- static criticalPlaneAbove(x) {
221
- return Math.ceil(x - 0.5);
222
- }
223
-
224
- /**
225
- * Finds a color with the given Y and hue on the boundary of the
226
- * cube.
227
- *
228
- * @param y The Y value of the color.
229
- * @param targetHue The hue of the color.
230
- * @return The desired color, in linear RGB coordinates.
231
- */
232
- static bisectToLimit(y, targetHue) {
233
- const segment = HctSolver.bisectToSegment(y, targetHue);
234
- let left = segment[0];
235
- let leftHue = HctSolver.hueOf(left);
236
- let right = segment[1];
237
- for (let axis = 0; axis < 3; axis++) {
238
- if (left[axis] !== right[axis]) {
239
- let lPlane = -1;
240
- let rPlane = 255;
241
- if (left[axis] < right[axis]) {
242
- lPlane = HctSolver.criticalPlaneBelow(HctSolver.trueDelinearized(left[axis]));
243
- rPlane = HctSolver.criticalPlaneAbove(HctSolver.trueDelinearized(right[axis]));
244
- } else {
245
- lPlane = HctSolver.criticalPlaneAbove(HctSolver.trueDelinearized(left[axis]));
246
- rPlane = HctSolver.criticalPlaneBelow(HctSolver.trueDelinearized(right[axis]));
247
- }
248
- for (let i = 0; i < 8; i++) {
249
- if (Math.abs(rPlane - lPlane) <= 1) {
250
- break;
251
- } else {
252
- const mPlane = Math.floor((lPlane + rPlane) / 2.0);
253
- const midPlaneCoordinate = HctSolver.CRITICAL_PLANES[mPlane];
254
- const mid = HctSolver.setCoordinate(left, midPlaneCoordinate, right, axis);
255
- const midHue = HctSolver.hueOf(mid);
256
- if (HctSolver.areInCyclicOrder(leftHue, targetHue, midHue)) {
257
- right = mid;
258
- rPlane = mPlane;
259
- } else {
260
- left = mid;
261
- leftHue = midHue;
262
- lPlane = mPlane;
263
- }
264
- }
265
- }
266
- }
267
- }
268
- return HctSolver.midpoint(left, right);
269
- }
270
- static inverseChromaticAdaptation(adapted) {
271
- const adaptedAbs = Math.abs(adapted);
272
- const base = Math.max(0, 27.13 * adaptedAbs / (400.0 - adaptedAbs));
273
- return mathUtils.signum(adapted) * Math.pow(base, 1.0 / 0.42);
274
- }
275
-
276
- /**
277
- * Finds a color with the given hue, chroma, and Y.
278
- *
279
- * @param hueRadians The desired hue in radians.
280
- * @param chroma The desired chroma.
281
- * @param y The desired Y.
282
- * @return The desired color as a hexadecimal integer, if found; 0
283
- * otherwise.
284
- */
285
- static findResultByJ(hueRadians, chroma, y) {
286
- // Initial estimate of j.
287
- let j = Math.sqrt(y) * 11.0;
288
- // ===========================================================
289
- // Operations inlined from Cam16 to avoid repeated calculation
290
- // ===========================================================
291
- const viewingConditions = ViewingConditions.DEFAULT;
292
- const tInnerCoeff = 1 / Math.pow(1.64 - Math.pow(0.29, viewingConditions.n), 0.73);
293
- const eHue = 0.25 * (Math.cos(hueRadians + 2.0) + 3.8);
294
- const p1 = eHue * (50000.0 / 13.0) * viewingConditions.nc * viewingConditions.ncb;
295
- const hSin = Math.sin(hueRadians);
296
- const hCos = Math.cos(hueRadians);
297
- for (let iterationRound = 0; iterationRound < 5; iterationRound++) {
298
- // ===========================================================
299
- // Operations inlined from Cam16 to avoid repeated calculation
300
- // ===========================================================
301
- const jNormalized = j / 100.0;
302
- const alpha = chroma === 0.0 || j === 0.0 ? 0.0 : chroma / Math.sqrt(jNormalized);
303
- const t = Math.pow(alpha * tInnerCoeff, 1.0 / 0.9);
304
- const ac = viewingConditions.aw * Math.pow(jNormalized, 1.0 / viewingConditions.c / viewingConditions.z);
305
- const p2 = ac / viewingConditions.nbb;
306
- const gamma = 23.0 * (p2 + 0.305) * t / (23.0 * p1 + 11 * t * hCos + 108.0 * t * hSin);
307
- const a = gamma * hCos;
308
- const b = gamma * hSin;
309
- const rA = (460.0 * p2 + 451.0 * a + 288.0 * b) / 1403.0;
310
- const gA = (460.0 * p2 - 891.0 * a - 261.0 * b) / 1403.0;
311
- const bA = (460.0 * p2 - 220.0 * a - 6300.0 * b) / 1403.0;
312
- const rCScaled = HctSolver.inverseChromaticAdaptation(rA);
313
- const gCScaled = HctSolver.inverseChromaticAdaptation(gA);
314
- const bCScaled = HctSolver.inverseChromaticAdaptation(bA);
315
- const linrgb = mathUtils.matrixMultiply([rCScaled, gCScaled, bCScaled], HctSolver.LINRGB_FROM_SCALED_DISCOUNT);
316
- // ===========================================================
317
- // Operations inlined from Cam16 to avoid repeated calculation
318
- // ===========================================================
319
- if (linrgb[0] < 0 || linrgb[1] < 0 || linrgb[2] < 0) {
320
- return 0;
321
- }
322
- const kR = HctSolver.Y_FROM_LINRGB[0];
323
- const kG = HctSolver.Y_FROM_LINRGB[1];
324
- const kB = HctSolver.Y_FROM_LINRGB[2];
325
- const fnj = kR * linrgb[0] + kG * linrgb[1] + kB * linrgb[2];
326
- if (fnj <= 0) {
327
- return 0;
328
- }
329
- if (iterationRound === 4 || Math.abs(fnj - y) < 0.002) {
330
- if (linrgb[0] > 100.01 || linrgb[1] > 100.01 || linrgb[2] > 100.01) {
331
- return 0;
332
- }
333
- return argbFromLinrgb(linrgb);
334
- }
335
- // Iterates with Newton method,
336
- // Using 2 * fn(j) / j as the approximation of fn'(j)
337
- j = j - (fnj - y) * j / (2 * fnj);
338
- }
339
- return 0;
340
- }
341
-
342
- /**
343
- * Finds an sRGB color with the given hue, chroma, and L*, if
344
- * possible.
345
- *
346
- * @param hueDegrees The desired hue, in degrees.
347
- * @param chroma The desired chroma.
348
- * @param lstar The desired L*.
349
- * @return A hexadecimal representing the sRGB color. The color
350
- * has sufficiently close hue, chroma, and L* to the desired
351
- * values, if possible; otherwise, the hue and L* will be
352
- * sufficiently close, and chroma will be maximized.
353
- */
354
- static solveToInt(hueDegrees, chroma, lstar) {
355
- if (chroma < 0.0001 || lstar < 0.0001 || lstar > 99.9999) {
356
- return argbFromLstar(lstar);
357
- }
358
- hueDegrees = mathUtils.sanitizeDegreesDouble(hueDegrees);
359
- const hueRadians = hueDegrees / 180 * Math.PI;
360
- const y = yFromLstar(lstar);
361
- const exactAnswer = HctSolver.findResultByJ(hueRadians, chroma, y);
362
- if (exactAnswer !== 0) {
363
- return exactAnswer;
364
- }
365
- const linrgb = HctSolver.bisectToLimit(y, hueRadians);
366
- return argbFromLinrgb(linrgb);
367
- }
368
-
369
- /**
370
- * Finds an sRGB color with the given hue, chroma, and L*, if
371
- * possible.
372
- *
373
- * @param hueDegrees The desired hue, in degrees.
374
- * @param chroma The desired chroma.
375
- * @param lstar The desired L*.
376
- * @return An CAM16 object representing the sRGB color. The color
377
- * has sufficiently close hue, chroma, and L* to the desired
378
- * values, if possible; otherwise, the hue and L* will be
379
- * sufficiently close, and chroma will be maximized.
380
- */
381
- static solveToCam(hueDegrees, chroma, lstar) {
382
- return Cam16.fromInt(HctSolver.solveToInt(hueDegrees, chroma, lstar));
383
- }
384
- }
385
- _defineProperty(HctSolver, "SCALED_DISCOUNT_FROM_LINRGB", [[0.001200833568784504, 0.002389694492170889, 0.0002795742885861124], [0.0005891086651375999, 0.0029785502573438758, 0.0003270666104008398], [0.00010146692491640572, 0.0005364214359186694, 0.0032979401770712076]]);
386
- _defineProperty(HctSolver, "LINRGB_FROM_SCALED_DISCOUNT", [[1373.2198709594231, -1100.4251190754821, -7.278681089101213], [-271.815969077903, 559.6580465940733, -32.46047482791194], [1.9622899599665666, -57.173814538844006, 308.7233197812385]]);
387
- _defineProperty(HctSolver, "Y_FROM_LINRGB", [0.2126, 0.7152, 0.0722]);
388
- _defineProperty(HctSolver, "CRITICAL_PLANES", [0.015176349177441876, 0.045529047532325624, 0.07588174588720938, 0.10623444424209313, 0.13658714259697685, 0.16693984095186062, 0.19729253930674434, 0.2276452376616281, 0.2579979360165119, 0.28835063437139563, 0.3188300904430532, 0.350925934958123, 0.3848314933096426, 0.42057480301049466, 0.458183274052838, 0.4976837250274023, 0.5391024159806381, 0.5824650784040898, 0.6277969426914107, 0.6751227633498623, 0.7244668422128921, 0.775853049866786, 0.829304845476233, 0.8848452951698498, 0.942497089126609, 1.0022825574869039, 1.0642236851973577, 1.1283421258858297, 1.1946592148522128, 1.2631959812511864, 1.3339731595349034, 1.407011200216447, 1.4823302800086415, 1.5599503113873272, 1.6398909516233677, 1.7221716113234105, 1.8068114625156377, 1.8938294463134073, 1.9832442801866852, 2.075074464868551, 2.1693382909216234, 2.2660538449872063, 2.36523901573795, 2.4669114995532007, 2.5710888059345764, 2.6777882626779785, 2.7870270208169257, 2.898822059350997, 3.0131901897720907, 3.1301480604002863, 3.2497121605402226, 3.3718988244681087, 3.4967242352587946, 3.624204428461639, 3.754355295633311, 3.887192587735158, 4.022731918402185, 4.160988767090289, 4.301978482107941, 4.445716283538092, 4.592217266055746, 4.741496401646282, 4.893568542229298, 5.048448422192488, 5.20615066083972, 5.3666897647573375, 5.5300801301023865, 5.696336044816294, 5.865471690767354, 6.037501145825082, 6.212438385869475, 6.390297286737924, 6.571091626112461, 6.7548350853498045, 6.941541251256611, 7.131223617812143, 7.323895587840543, 7.5195704746346665, 7.7182615035334345, 7.919981813454504, 8.124744458384042, 8.332562408825165, 8.543448553206703, 8.757415699253682, 8.974476575321063, 9.194643831691977, 9.417930041841839, 9.644347703669503, 9.873909240696694, 10.106627003236781, 10.342513269534024, 10.58158024687427, 10.8238400726681, 11.069304815507364, 11.317986476196008, 11.569896988756009, 11.825048221409341, 12.083451977536606, 12.345119996613247, 12.610063955123938, 12.878295467455942, 13.149826086772048, 13.42466730586372, 13.702830557985108, 13.984327217668513, 14.269168601521828, 14.55736596900856, 14.848930523210871, 15.143873411576273, 15.44220572664832, 15.743938506781891, 16.04908273684337, 16.35764934889634, 16.66964922287304, 16.985093187232053, 17.30399201960269, 17.62635644741625, 17.95219714852476, 18.281524751807332, 18.614349837764564, 18.95068293910138, 19.290534541298456, 19.633915083172692, 19.98083495742689, 20.331304511189067, 20.685334046541502, 21.042933821039977, 21.404114048223256, 21.76888489811322, 22.137256497705877, 22.50923893145328, 22.884842241736916, 23.264076429332462, 23.6469514538663, 24.033477234264016, 24.42366364919083, 24.817520537484558, 25.21505769858089, 25.61628489293138, 26.021211842414342, 26.429848230738664, 26.842203703840827, 27.258287870275353, 27.678110301598522, 28.10168053274597, 28.529008062403893, 28.96010235337422, 29.39497283293396, 29.83362889318845, 30.276079891419332, 30.722335150426627, 31.172403958865512, 31.62629557157785, 32.08401920991837, 32.54558406207592, 33.010999283389665, 33.4802739966603, 33.953417292456834, 34.430438229418264, 34.911345834551085, 35.39614910352207, 35.88485700094671, 36.37747846067349, 36.87402238606382, 37.37449765026789, 37.87891309649659, 38.38727753828926, 38.89959975977785, 39.41588851594697, 39.93615253289054, 40.460400508064545, 40.98864111053629, 41.520882981230194, 42.05713473317016, 42.597404951718396, 43.141702194811224, 43.6900349931913, 44.24241185063697, 44.798841244188324, 45.35933162437017, 45.92389141541209, 46.49252901546552, 47.065252796817916, 47.64207110610409, 48.22299226451468, 48.808024568002054, 49.3971762874833, 49.9904556690408, 50.587870934119984, 51.189430279724725, 51.79514187861014, 52.40501387947288, 53.0190544071392, 53.637271562750364, 54.259673423945976, 54.88626804504493, 55.517063457223934, 56.15206766869424, 56.79128866487574, 57.43473440856916, 58.08241284012621, 58.734331877617365, 59.39049941699807, 60.05092333227251, 60.715611475655585, 61.38457167773311, 62.057811747619894, 62.7353394731159, 63.417162620860914, 64.10328893648692, 64.79372614476921, 65.48848194977529, 66.18756403501224, 66.89098006357258, 67.59873767827808, 68.31084450182222, 69.02730813691093, 69.74813616640164, 70.47333615344107, 71.20291564160104, 71.93688215501312, 72.67524319850172, 73.41800625771542, 74.16517879925733, 74.9167682708136, 75.67278210128072, 76.43322770089146, 77.1981124613393, 77.96744375590167, 78.74122893956174, 79.51947534912904, 80.30219030335869, 81.08938110306934, 81.88105503125999, 82.67721935322541, 83.4778813166706, 84.28304815182372, 85.09272707154808, 85.90692527145302, 86.72564993000343, 87.54890820862819, 88.3767072518277, 89.2090541872801, 90.04595612594655, 90.88742016217518, 91.73345337380438, 92.58406282226491, 93.43925555268066, 94.29903859396902, 95.16341895893969, 96.03240364439274, 96.9059996312159, 97.78421388448044, 98.6670533535366, 99.55452497210776]);
389
- //# sourceMappingURL=hct-solver.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hct-solver.mjs","names":["Cam16","ViewingConditions","argbFromLinrgb","argbFromLstar","yFromLstar","mathUtils","HctSolver","sanitizeRadians","angle","Math","PI","trueDelinearized","rgbComponent","normalized","delinearized","pow","chromaticAdaptation","component","af","abs","signum","hueOf","linrgb","scaledDiscount","matrixMultiply","SCALED_DISCOUNT_FROM_LINRGB","rA","gA","bA","a","b","atan2","areInCyclicOrder","c","deltaAB","deltaAC","intercept","source","mid","target","lerpPoint","t","setCoordinate","coordinate","axis","isBounded","x","nthVertex","y","n","kR","Y_FROM_LINRGB","kG","kB","coordA","coordB","g","r","bisectToSegment","targetHue","left","right","leftHue","rightHue","initialized","uncut","midHue","midpoint","criticalPlaneBelow","floor","criticalPlaneAbove","ceil","bisectToLimit","segment","lPlane","rPlane","i","mPlane","midPlaneCoordinate","CRITICAL_PLANES","inverseChromaticAdaptation","adapted","adaptedAbs","base","max","findResultByJ","hueRadians","chroma","j","sqrt","viewingConditions","DEFAULT","tInnerCoeff","eHue","cos","p1","nc","ncb","hSin","sin","hCos","iterationRound","jNormalized","alpha","ac","aw","z","p2","nbb","gamma","rCScaled","gCScaled","bCScaled","LINRGB_FROM_SCALED_DISCOUNT","fnj","solveToInt","hueDegrees","lstar","sanitizeDegreesDouble","exactAnswer","solveToCam","fromInt","_defineProperty"],"sources":["../../../../src/util/color/hct/hct-solver.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n// This file is automatically generated. Do not modify it.\nimport { Cam16 } from './cam16';\nimport { ViewingConditions } from './viewing-conditions';\n\nimport { argbFromLinrgb, argbFromLstar, yFromLstar } from '../conversion';\nimport * as mathUtils from '../utils/math-utils';\n\n// material_color_utilities is designed to have a consistent API across\n// platforms and modular components that can be moved around easily. Using a\n// class as a namespace facilitates this.\n//\n// tslint:disable:class-as-namespace\n/**\n * A class that solves the HCT equation.\n */\nexport class HctSolver {\n static SCALED_DISCOUNT_FROM_LINRGB = [\n [0.001200833568784504, 0.002389694492170889, 0.0002795742885861124],\n [0.0005891086651375999, 0.0029785502573438758, 0.0003270666104008398],\n [0.00010146692491640572, 0.0005364214359186694, 0.0032979401770712076],\n ];\n\n static LINRGB_FROM_SCALED_DISCOUNT = [\n [1373.2198709594231, -1100.4251190754821, -7.278681089101213],\n [-271.815969077903, 559.6580465940733, -32.46047482791194],\n [1.9622899599665666, -57.173814538844006, 308.7233197812385],\n ];\n\n static Y_FROM_LINRGB = [0.2126, 0.7152, 0.0722];\n\n static CRITICAL_PLANES = [\n 0.015176349177441876, 0.045529047532325624, 0.07588174588720938,\n 0.10623444424209313, 0.13658714259697685, 0.16693984095186062,\n 0.19729253930674434, 0.2276452376616281, 0.2579979360165119,\n 0.28835063437139563, 0.3188300904430532, 0.350925934958123,\n 0.3848314933096426, 0.42057480301049466, 0.458183274052838,\n 0.4976837250274023, 0.5391024159806381, 0.5824650784040898,\n 0.6277969426914107, 0.6751227633498623, 0.7244668422128921,\n 0.775853049866786, 0.829304845476233, 0.8848452951698498, 0.942497089126609,\n 1.0022825574869039, 1.0642236851973577, 1.1283421258858297,\n 1.1946592148522128, 1.2631959812511864, 1.3339731595349034,\n 1.407011200216447, 1.4823302800086415, 1.5599503113873272,\n 1.6398909516233677, 1.7221716113234105, 1.8068114625156377,\n 1.8938294463134073, 1.9832442801866852, 2.075074464868551,\n 2.1693382909216234, 2.2660538449872063, 2.36523901573795,\n 2.4669114995532007, 2.5710888059345764, 2.6777882626779785,\n 2.7870270208169257, 2.898822059350997, 3.0131901897720907,\n 3.1301480604002863, 3.2497121605402226, 3.3718988244681087,\n 3.4967242352587946, 3.624204428461639, 3.754355295633311, 3.887192587735158,\n 4.022731918402185, 4.160988767090289, 4.301978482107941, 4.445716283538092,\n 4.592217266055746, 4.741496401646282, 4.893568542229298, 5.048448422192488,\n 5.20615066083972, 5.3666897647573375, 5.5300801301023865, 5.696336044816294,\n 5.865471690767354, 6.037501145825082, 6.212438385869475, 6.390297286737924,\n 6.571091626112461, 6.7548350853498045, 6.941541251256611, 7.131223617812143,\n 7.323895587840543, 7.5195704746346665, 7.7182615035334345,\n 7.919981813454504, 8.124744458384042, 8.332562408825165, 8.543448553206703,\n 8.757415699253682, 8.974476575321063, 9.194643831691977, 9.417930041841839,\n 9.644347703669503, 9.873909240696694, 10.106627003236781,\n 10.342513269534024, 10.58158024687427, 10.8238400726681, 11.069304815507364,\n 11.317986476196008, 11.569896988756009, 11.825048221409341,\n 12.083451977536606, 12.345119996613247, 12.610063955123938,\n 12.878295467455942, 13.149826086772048, 13.42466730586372,\n 13.702830557985108, 13.984327217668513, 14.269168601521828,\n 14.55736596900856, 14.848930523210871, 15.143873411576273,\n 15.44220572664832, 15.743938506781891, 16.04908273684337, 16.35764934889634,\n 16.66964922287304, 16.985093187232053, 17.30399201960269, 17.62635644741625,\n 17.95219714852476, 18.281524751807332, 18.614349837764564,\n 18.95068293910138, 19.290534541298456, 19.633915083172692,\n 19.98083495742689, 20.331304511189067, 20.685334046541502,\n 21.042933821039977, 21.404114048223256, 21.76888489811322,\n 22.137256497705877, 22.50923893145328, 22.884842241736916,\n 23.264076429332462, 23.6469514538663, 24.033477234264016, 24.42366364919083,\n 24.817520537484558, 25.21505769858089, 25.61628489293138,\n 26.021211842414342, 26.429848230738664, 26.842203703840827,\n 27.258287870275353, 27.678110301598522, 28.10168053274597,\n 28.529008062403893, 28.96010235337422, 29.39497283293396, 29.83362889318845,\n 30.276079891419332, 30.722335150426627, 31.172403958865512,\n 31.62629557157785, 32.08401920991837, 32.54558406207592, 33.010999283389665,\n 33.4802739966603, 33.953417292456834, 34.430438229418264,\n 34.911345834551085, 35.39614910352207, 35.88485700094671, 36.37747846067349,\n 36.87402238606382, 37.37449765026789, 37.87891309649659, 38.38727753828926,\n 38.89959975977785, 39.41588851594697, 39.93615253289054, 40.460400508064545,\n 40.98864111053629, 41.520882981230194, 42.05713473317016,\n 42.597404951718396, 43.141702194811224, 43.6900349931913, 44.24241185063697,\n 44.798841244188324, 45.35933162437017, 45.92389141541209, 46.49252901546552,\n 47.065252796817916, 47.64207110610409, 48.22299226451468,\n 48.808024568002054, 49.3971762874833, 49.9904556690408, 50.587870934119984,\n 51.189430279724725, 51.79514187861014, 52.40501387947288, 53.0190544071392,\n 53.637271562750364, 54.259673423945976, 54.88626804504493,\n 55.517063457223934, 56.15206766869424, 56.79128866487574, 57.43473440856916,\n 58.08241284012621, 58.734331877617365, 59.39049941699807, 60.05092333227251,\n 60.715611475655585, 61.38457167773311, 62.057811747619894, 62.7353394731159,\n 63.417162620860914, 64.10328893648692, 64.79372614476921, 65.48848194977529,\n 66.18756403501224, 66.89098006357258, 67.59873767827808, 68.31084450182222,\n 69.02730813691093, 69.74813616640164, 70.47333615344107, 71.20291564160104,\n 71.93688215501312, 72.67524319850172, 73.41800625771542, 74.16517879925733,\n 74.9167682708136, 75.67278210128072, 76.43322770089146, 77.1981124613393,\n 77.96744375590167, 78.74122893956174, 79.51947534912904, 80.30219030335869,\n 81.08938110306934, 81.88105503125999, 82.67721935322541, 83.4778813166706,\n 84.28304815182372, 85.09272707154808, 85.90692527145302, 86.72564993000343,\n 87.54890820862819, 88.3767072518277, 89.2090541872801, 90.04595612594655,\n 90.88742016217518, 91.73345337380438, 92.58406282226491, 93.43925555268066,\n 94.29903859396902, 95.16341895893969, 96.03240364439274, 96.9059996312159,\n 97.78421388448044, 98.6670533535366, 99.55452497210776,\n ];\n\n /**\n * Sanitizes a small enough angle in radians.\n *\n * @param angle An angle in radians; must not deviate too much\n * from 0.\n * @return A coterminal angle between 0 and 2pi.\n */\n private static sanitizeRadians(angle: number): number {\n return (angle + Math.PI * 8) % (Math.PI * 2);\n }\n\n /**\n * Delinearizes an RGB component, returning a floating-point\n * number.\n *\n * @param rgbComponent 0.0 <= rgb_component <= 100.0, represents\n * linear R/G/B channel\n * @return 0.0 <= output <= 255.0, color channel converted to\n * regular RGB space\n */\n private static trueDelinearized(rgbComponent: number): number {\n const normalized = rgbComponent / 100.0;\n let delinearized = 0.0;\n if (normalized <= 0.0031308) {\n delinearized = normalized * 12.92;\n } else {\n delinearized = 1.055 * Math.pow(normalized, 1.0 / 2.4) - 0.055;\n }\n return delinearized * 255.0;\n }\n\n private static chromaticAdaptation(component: number): number {\n const af = Math.pow(Math.abs(component), 0.42);\n return (mathUtils.signum(component) * 400.0 * af) / (af + 27.13);\n }\n\n /**\n * Returns the hue of a linear RGB color in CAM16.\n *\n * @param linrgb The linear RGB coordinates of a color.\n * @return The hue of the color in CAM16, in radians.\n */\n private static hueOf(linrgb: number[]): number {\n const scaledDiscount = mathUtils.matrixMultiply(\n linrgb,\n HctSolver.SCALED_DISCOUNT_FROM_LINRGB,\n );\n const rA = HctSolver.chromaticAdaptation(scaledDiscount[0]);\n const gA = HctSolver.chromaticAdaptation(scaledDiscount[1]);\n const bA = HctSolver.chromaticAdaptation(scaledDiscount[2]);\n // redness-greenness\n const a = (11.0 * rA + -12.0 * gA + bA) / 11.0;\n // yellowness-blueness\n const b = (rA + gA - 2.0 * bA) / 9.0;\n return Math.atan2(b, a);\n }\n\n private static areInCyclicOrder(a: number, b: number, c: number): boolean {\n const deltaAB = HctSolver.sanitizeRadians(b - a);\n const deltaAC = HctSolver.sanitizeRadians(c - a);\n return deltaAB < deltaAC;\n }\n\n /**\n * Solves the lerp equation.\n *\n * @param source The starting number.\n * @param mid The number in the middle.\n * @param target The ending number.\n * @return A number t such that lerp(source, target, t) = mid.\n */\n private static intercept(\n source: number,\n mid: number,\n target: number,\n ): number {\n return (mid - source) / (target - source);\n }\n\n private static lerpPoint(\n source: number[],\n t: number,\n target: number[],\n ): number[] {\n return [\n source[0] + (target[0] - source[0]) * t,\n source[1] + (target[1] - source[1]) * t,\n source[2] + (target[2] - source[2]) * t,\n ];\n }\n\n /**\n * Intersects a segment with a plane.\n *\n * @param source The coordinates of point A.\n * @param coordinate The R-, G-, or B-coordinate of the plane.\n * @param target The coordinates of point B.\n * @param axis The axis the plane is perpendicular with. (0: R, 1:\n * G, 2: B)\n * @return The intersection point of the segment AB with the plane\n * R=coordinate, G=coordinate, or B=coordinate\n */\n private static setCoordinate(\n source: number[],\n coordinate: number,\n target: number[],\n axis: number,\n ): number[] {\n const t = HctSolver.intercept(source[axis], coordinate, target[axis]);\n return HctSolver.lerpPoint(source, t, target);\n }\n\n private static isBounded(x: number): boolean {\n return 0.0 <= x && x <= 100.0;\n }\n\n /**\n * Returns the nth possible vertex of the polygonal intersection.\n *\n * @param y The Y value of the plane.\n * @param n The zero-based index of the point. 0 <= n <= 11.\n * @return The nth possible vertex of the polygonal intersection\n * of the y plane and the RGB cube, in linear RGB coordinates, if\n * it exists. If this possible vertex lies outside of the cube,\n * [-1.0, -1.0, -1.0] is returned.\n */\n private static nthVertex(y: number, n: number): number[] {\n const kR = HctSolver.Y_FROM_LINRGB[0];\n const kG = HctSolver.Y_FROM_LINRGB[1];\n const kB = HctSolver.Y_FROM_LINRGB[2];\n const coordA = n % 4 <= 1 ? 0.0 : 100.0;\n const coordB = n % 2 === 0 ? 0.0 : 100.0;\n if (n < 4) {\n const g = coordA;\n const b = coordB;\n const r = (y - g * kG - b * kB) / kR;\n if (HctSolver.isBounded(r)) {\n return [r, g, b];\n } else {\n return [-1.0, -1.0, -1.0];\n }\n } else if (n < 8) {\n const b = coordA;\n const r = coordB;\n const g = (y - r * kR - b * kB) / kG;\n if (HctSolver.isBounded(g)) {\n return [r, g, b];\n } else {\n return [-1.0, -1.0, -1.0];\n }\n } else {\n const r = coordA;\n const g = coordB;\n const b = (y - r * kR - g * kG) / kB;\n if (HctSolver.isBounded(b)) {\n return [r, g, b];\n } else {\n return [-1.0, -1.0, -1.0];\n }\n }\n }\n\n /**\n * Finds the segment containing the desired color.\n *\n * @param y The Y value of the color.\n * @param targetHue The hue of the color.\n * @return A list of two sets of linear RGB coordinates, each\n * corresponding to an endpoint of the segment containing the\n * desired color.\n */\n private static bisectToSegment(y: number, targetHue: number): number[][] {\n let left = [-1.0, -1.0, -1.0];\n let right = left;\n let leftHue = 0.0;\n let rightHue = 0.0;\n let initialized = false;\n let uncut = true;\n for (let n = 0; n < 12; n++) {\n const mid = HctSolver.nthVertex(y, n);\n if (mid[0] < 0) {\n continue;\n }\n const midHue = HctSolver.hueOf(mid);\n if (!initialized) {\n left = mid;\n right = mid;\n leftHue = midHue;\n rightHue = midHue;\n initialized = true;\n continue;\n }\n if (uncut || HctSolver.areInCyclicOrder(leftHue, midHue, rightHue)) {\n uncut = false;\n if (HctSolver.areInCyclicOrder(leftHue, targetHue, midHue)) {\n right = mid;\n rightHue = midHue;\n } else {\n left = mid;\n leftHue = midHue;\n }\n }\n }\n return [left, right];\n }\n\n private static midpoint(a: number[], b: number[]): number[] {\n return [(a[0] + b[0]) / 2, (a[1] + b[1]) / 2, (a[2] + b[2]) / 2];\n }\n\n private static criticalPlaneBelow(x: number): number {\n return Math.floor(x - 0.5);\n }\n\n private static criticalPlaneAbove(x: number): number {\n return Math.ceil(x - 0.5);\n }\n\n /**\n * Finds a color with the given Y and hue on the boundary of the\n * cube.\n *\n * @param y The Y value of the color.\n * @param targetHue The hue of the color.\n * @return The desired color, in linear RGB coordinates.\n */\n private static bisectToLimit(y: number, targetHue: number): number[] {\n const segment = HctSolver.bisectToSegment(y, targetHue);\n let left = segment[0];\n let leftHue = HctSolver.hueOf(left);\n let right = segment[1];\n for (let axis = 0; axis < 3; axis++) {\n if (left[axis] !== right[axis]) {\n let lPlane = -1;\n let rPlane = 255;\n if (left[axis] < right[axis]) {\n lPlane = HctSolver.criticalPlaneBelow(\n HctSolver.trueDelinearized(left[axis]),\n );\n rPlane = HctSolver.criticalPlaneAbove(\n HctSolver.trueDelinearized(right[axis]),\n );\n } else {\n lPlane = HctSolver.criticalPlaneAbove(\n HctSolver.trueDelinearized(left[axis]),\n );\n rPlane = HctSolver.criticalPlaneBelow(\n HctSolver.trueDelinearized(right[axis]),\n );\n }\n for (let i = 0; i < 8; i++) {\n if (Math.abs(rPlane - lPlane) <= 1) {\n break;\n } else {\n const mPlane = Math.floor((lPlane + rPlane) / 2.0);\n const midPlaneCoordinate = HctSolver.CRITICAL_PLANES[mPlane];\n const mid = HctSolver.setCoordinate(\n left,\n midPlaneCoordinate,\n right,\n axis,\n );\n const midHue = HctSolver.hueOf(mid);\n if (HctSolver.areInCyclicOrder(leftHue, targetHue, midHue)) {\n right = mid;\n rPlane = mPlane;\n } else {\n left = mid;\n leftHue = midHue;\n lPlane = mPlane;\n }\n }\n }\n }\n }\n return HctSolver.midpoint(left, right);\n }\n\n private static inverseChromaticAdaptation(adapted: number): number {\n const adaptedAbs = Math.abs(adapted);\n const base = Math.max(0, (27.13 * adaptedAbs) / (400.0 - adaptedAbs));\n return mathUtils.signum(adapted) * Math.pow(base, 1.0 / 0.42);\n }\n\n /**\n * Finds a color with the given hue, chroma, and Y.\n *\n * @param hueRadians The desired hue in radians.\n * @param chroma The desired chroma.\n * @param y The desired Y.\n * @return The desired color as a hexadecimal integer, if found; 0\n * otherwise.\n */\n private static findResultByJ(\n hueRadians: number,\n chroma: number,\n y: number,\n ): number {\n // Initial estimate of j.\n let j = Math.sqrt(y) * 11.0;\n // ===========================================================\n // Operations inlined from Cam16 to avoid repeated calculation\n // ===========================================================\n const viewingConditions = ViewingConditions.DEFAULT;\n const tInnerCoeff =\n 1 / Math.pow(1.64 - Math.pow(0.29, viewingConditions.n), 0.73);\n const eHue = 0.25 * (Math.cos(hueRadians + 2.0) + 3.8);\n const p1 =\n eHue * (50000.0 / 13.0) * viewingConditions.nc * viewingConditions.ncb;\n const hSin = Math.sin(hueRadians);\n const hCos = Math.cos(hueRadians);\n for (let iterationRound = 0; iterationRound < 5; iterationRound++) {\n // ===========================================================\n // Operations inlined from Cam16 to avoid repeated calculation\n // ===========================================================\n const jNormalized = j / 100.0;\n const alpha =\n chroma === 0.0 || j === 0.0 ? 0.0 : chroma / Math.sqrt(jNormalized);\n const t = Math.pow(alpha * tInnerCoeff, 1.0 / 0.9);\n const ac =\n viewingConditions.aw *\n Math.pow(jNormalized, 1.0 / viewingConditions.c / viewingConditions.z);\n const p2 = ac / viewingConditions.nbb;\n const gamma =\n (23.0 * (p2 + 0.305) * t) /\n (23.0 * p1 + 11 * t * hCos + 108.0 * t * hSin);\n const a = gamma * hCos;\n const b = gamma * hSin;\n const rA = (460.0 * p2 + 451.0 * a + 288.0 * b) / 1403.0;\n const gA = (460.0 * p2 - 891.0 * a - 261.0 * b) / 1403.0;\n const bA = (460.0 * p2 - 220.0 * a - 6300.0 * b) / 1403.0;\n const rCScaled = HctSolver.inverseChromaticAdaptation(rA);\n const gCScaled = HctSolver.inverseChromaticAdaptation(gA);\n const bCScaled = HctSolver.inverseChromaticAdaptation(bA);\n const linrgb = mathUtils.matrixMultiply(\n [rCScaled, gCScaled, bCScaled],\n HctSolver.LINRGB_FROM_SCALED_DISCOUNT,\n );\n // ===========================================================\n // Operations inlined from Cam16 to avoid repeated calculation\n // ===========================================================\n if (linrgb[0] < 0 || linrgb[1] < 0 || linrgb[2] < 0) {\n return 0;\n }\n const kR = HctSolver.Y_FROM_LINRGB[0];\n const kG = HctSolver.Y_FROM_LINRGB[1];\n const kB = HctSolver.Y_FROM_LINRGB[2];\n const fnj = kR * linrgb[0] + kG * linrgb[1] + kB * linrgb[2];\n if (fnj <= 0) {\n return 0;\n }\n if (iterationRound === 4 || Math.abs(fnj - y) < 0.002) {\n if (linrgb[0] > 100.01 || linrgb[1] > 100.01 || linrgb[2] > 100.01) {\n return 0;\n }\n return argbFromLinrgb(linrgb);\n }\n // Iterates with Newton method,\n // Using 2 * fn(j) / j as the approximation of fn'(j)\n j = j - ((fnj - y) * j) / (2 * fnj);\n }\n return 0;\n }\n\n /**\n * Finds an sRGB color with the given hue, chroma, and L*, if\n * possible.\n *\n * @param hueDegrees The desired hue, in degrees.\n * @param chroma The desired chroma.\n * @param lstar The desired L*.\n * @return A hexadecimal representing the sRGB color. The color\n * has sufficiently close hue, chroma, and L* to the desired\n * values, if possible; otherwise, the hue and L* will be\n * sufficiently close, and chroma will be maximized.\n */\n static solveToInt(hueDegrees: number, chroma: number, lstar: number): number {\n if (chroma < 0.0001 || lstar < 0.0001 || lstar > 99.9999) {\n return argbFromLstar(lstar);\n }\n hueDegrees = mathUtils.sanitizeDegreesDouble(hueDegrees);\n const hueRadians = (hueDegrees / 180) * Math.PI;\n const y = yFromLstar(lstar);\n const exactAnswer = HctSolver.findResultByJ(hueRadians, chroma, y);\n if (exactAnswer !== 0) {\n return exactAnswer;\n }\n const linrgb = HctSolver.bisectToLimit(y, hueRadians);\n return argbFromLinrgb(linrgb);\n }\n\n /**\n * Finds an sRGB color with the given hue, chroma, and L*, if\n * possible.\n *\n * @param hueDegrees The desired hue, in degrees.\n * @param chroma The desired chroma.\n * @param lstar The desired L*.\n * @return An CAM16 object representing the sRGB color. The color\n * has sufficiently close hue, chroma, and L* to the desired\n * values, if possible; otherwise, the hue and L* will be\n * sufficiently close, and chroma will be maximized.\n */\n static solveToCam(hueDegrees: number, chroma: number, lstar: number): Cam16 {\n return Cam16.fromInt(HctSolver.solveToInt(hueDegrees, chroma, lstar));\n }\n}\n"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA,SACSA,KAAK;AAAA,SACLC,iBAAiB;AAAA,SAEjBC,cAAc,EAAEC,aAAa,EAAEC,UAAU;AAAA,OAC3C,KAAKC,SAAS,iCAErB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,SAAS,CAAC;EA2FrB;AACF;AACA;AACA;AACA;AACA;AACA;EACE,OAAe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BAAiB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,iBAAiB,EACxE,iBAAiB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,iBAAiB,EAC1E,iBAAiB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,gBAAgB,EACzE,iBAAiB,EAAE,gBAAgB,EAAE,iBAAiB,CACvD"}
@@ -1,153 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2021 Google LLC
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */
17
- /**
18
- * A color system built using CAM16 hue and chroma, and L* from
19
- * L*a*b*.
20
- *
21
- * Using L* creates a link between the color system, contrast, and thus
22
- * accessibility. Contrast ratio depends on relative luminance, or Y in the XYZ
23
- * color space. L*, or perceptual luminance can be calculated from Y.
24
- *
25
- * Unlike Y, L* is linear to human perception, allowing trivial creation of
26
- * accurate color tones.
27
- *
28
- * Unlike contrast ratio, measuring contrast in L* is linear, and simple to
29
- * calculate. A difference of 40 in HCT tone guarantees a contrast ratio >= 3.0,
30
- * and a difference of 50 guarantees a contrast ratio >= 4.5.
31
- */
32
- import { Cam16 } from "./cam16.mjs";
33
- import { HctSolver } from "./hct-solver.mjs";
34
- import { ViewingConditions } from "./viewing-conditions.mjs";
35
- import { lstarFromArgb, lstarFromY } from "../conversion.mjs";
36
- /**
37
- * HCT, hue, chroma, and tone. A color system that provides a perceptually
38
- * accurate color measurement system that can also accurately render what colors
39
- * will appear as in different lighting environments.
40
- */
41
- export class Hct {
42
- /**
43
- * @param hue 0 <= hue < 360; invalid values are corrected.
44
- * @param chroma 0 <= chroma < ?; Informally, colorfulness. The color
45
- * returned may be lower than the requested chroma. Chroma has a different
46
- * maximum for any given hue and tone.
47
- * @param tone 0 <= tone <= 100; invalid values are corrected.
48
- * @return HCT representation of a color in default viewing conditions.
49
- */
50
-
51
- static from(hue, chroma, tone) {
52
- return new Hct(HctSolver.solveToInt(hue, chroma, tone));
53
- }
54
-
55
- /**
56
- * @param argb ARGB representation of a color.
57
- * @return HCT representation of a color in default viewing conditions
58
- */
59
- static fromInt(argb) {
60
- return new Hct(argb);
61
- }
62
- toInt() {
63
- return this.argb;
64
- }
65
-
66
- /**
67
- * A number, in degrees, representing ex. red, orange, yellow, etc.
68
- * Ranges from 0 <= hue < 360.
69
- */
70
- get hue() {
71
- return this.internalHue;
72
- }
73
-
74
- /**
75
- * @param newHue 0 <= newHue < 360; invalid values are corrected.
76
- * Chroma may decrease because chroma has a different maximum for any given
77
- * hue and tone.
78
- */
79
- set hue(newHue) {
80
- this.setInternalState(HctSolver.solveToInt(newHue, this.internalChroma, this.internalTone));
81
- }
82
- get chroma() {
83
- return this.internalChroma;
84
- }
85
-
86
- /**
87
- * @param newChroma 0 <= newChroma < ?
88
- * Chroma may decrease because chroma has a different maximum for any given
89
- * hue and tone.
90
- */
91
- set chroma(newChroma) {
92
- this.setInternalState(HctSolver.solveToInt(this.internalHue, newChroma, this.internalTone));
93
- }
94
-
95
- /** Lightness. Ranges from 0 to 100. */
96
- get tone() {
97
- return this.internalTone;
98
- }
99
-
100
- /**
101
- * @param newTone 0 <= newTone <= 100; invalid valids are corrected.
102
- * Chroma may decrease because chroma has a different maximum for any given
103
- * hue and tone.
104
- */
105
- set tone(newTone) {
106
- this.setInternalState(HctSolver.solveToInt(this.internalHue, this.internalChroma, newTone));
107
- }
108
- constructor(argb) {
109
- this.argb = argb;
110
- const cam = Cam16.fromInt(argb);
111
- this.internalHue = cam.hue;
112
- this.internalChroma = cam.chroma;
113
- this.internalTone = lstarFromArgb(argb);
114
- this.argb = argb;
115
- }
116
- setInternalState(argb) {
117
- const cam = Cam16.fromInt(argb);
118
- this.internalHue = cam.hue;
119
- this.internalChroma = cam.chroma;
120
- this.internalTone = lstarFromArgb(argb);
121
- this.argb = argb;
122
- }
123
-
124
- /**
125
- * Translates a color into different [ViewingConditions].
126
- *
127
- * Colors change appearance. They look different with lights on versus off,
128
- * the same color, as in hex code, on white looks different when on black.
129
- * This is called color relativity, most famously explicated by Josef Albers
130
- * in Interaction of Color.
131
- *
132
- * In color science, color appearance models can account for this and
133
- * calculate the appearance of a color in different settings. HCT is based on
134
- * CAM16, a color appearance model, and uses it to make these calculations.
135
- *
136
- * See [ViewingConditions.make] for parameters affecting color appearance.
137
- */
138
- inViewingConditions(vc) {
139
- // 1. Use CAM16 to find XYZ coordinates of color in specified VC.
140
- const cam = Cam16.fromInt(this.toInt());
141
- const viewedInVc = cam.xyzInViewingConditions(vc);
142
-
143
- // 2. Create CAM16 of those XYZ coordinates in default VC.
144
- const recastInVc = Cam16.fromXyzInViewingConditions(viewedInVc[0], viewedInVc[1], viewedInVc[2], ViewingConditions.make());
145
-
146
- // 3. Create HCT from:
147
- // - CAM16 using default VC with XYZ coordinates in specified VC.
148
- // - L* converted from Y in XYZ coordinates in specified VC.
149
- const recastHct = Hct.from(recastInVc.hue, recastInVc.chroma, lstarFromY(viewedInVc[1]));
150
- return recastHct;
151
- }
152
- }
153
- //# sourceMappingURL=hct.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hct.mjs","names":["Cam16","HctSolver","ViewingConditions","lstarFromArgb","lstarFromY","Hct","from","hue","chroma","tone","solveToInt","fromInt","argb","toInt","internalHue","newHue","setInternalState","internalChroma","internalTone","newChroma","newTone","constructor","cam","inViewingConditions","vc","viewedInVc","xyzInViewingConditions","recastInVc","fromXyzInViewingConditions","make","recastHct"],"sources":["../../../../src/util/color/hct/hct.ts"],"sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * A color system built using CAM16 hue and chroma, and L* from\n * L*a*b*.\n *\n * Using L* creates a link between the color system, contrast, and thus\n * accessibility. Contrast ratio depends on relative luminance, or Y in the XYZ\n * color space. L*, or perceptual luminance can be calculated from Y.\n *\n * Unlike Y, L* is linear to human perception, allowing trivial creation of\n * accurate color tones.\n *\n * Unlike contrast ratio, measuring contrast in L* is linear, and simple to\n * calculate. A difference of 40 in HCT tone guarantees a contrast ratio >= 3.0,\n * and a difference of 50 guarantees a contrast ratio >= 4.5.\n */\nimport { Cam16 } from './cam16';\nimport { HctSolver } from './hct-solver';\nimport { ViewingConditions } from './viewing-conditions';\nimport { lstarFromArgb, lstarFromY } from \"../conversion\";\n\n/**\n * HCT, hue, chroma, and tone. A color system that provides a perceptually\n * accurate color measurement system that can also accurately render what colors\n * will appear as in different lighting environments.\n */\nexport class Hct {\n /**\n * @param hue 0 <= hue < 360; invalid values are corrected.\n * @param chroma 0 <= chroma < ?; Informally, colorfulness. The color\n * returned may be lower than the requested chroma. Chroma has a different\n * maximum for any given hue and tone.\n * @param tone 0 <= tone <= 100; invalid values are corrected.\n * @return HCT representation of a color in default viewing conditions.\n */\n\n internalHue: number;\n internalChroma: number;\n internalTone: number;\n\n static from(hue: number, chroma: number, tone: number) {\n return new Hct(HctSolver.solveToInt(hue, chroma, tone));\n }\n\n /**\n * @param argb ARGB representation of a color.\n * @return HCT representation of a color in default viewing conditions\n */\n static fromInt(argb: number) {\n return new Hct(argb);\n }\n\n toInt(): number {\n return this.argb;\n }\n\n /**\n * A number, in degrees, representing ex. red, orange, yellow, etc.\n * Ranges from 0 <= hue < 360.\n */\n get hue(): number {\n return this.internalHue;\n }\n\n /**\n * @param newHue 0 <= newHue < 360; invalid values are corrected.\n * Chroma may decrease because chroma has a different maximum for any given\n * hue and tone.\n */\n set hue(newHue: number) {\n this.setInternalState(\n HctSolver.solveToInt(newHue, this.internalChroma, this.internalTone),\n );\n }\n\n get chroma(): number {\n return this.internalChroma;\n }\n\n /**\n * @param newChroma 0 <= newChroma < ?\n * Chroma may decrease because chroma has a different maximum for any given\n * hue and tone.\n */\n set chroma(newChroma: number) {\n this.setInternalState(\n HctSolver.solveToInt(this.internalHue, newChroma, this.internalTone),\n );\n }\n\n /** Lightness. Ranges from 0 to 100. */\n get tone(): number {\n return this.internalTone;\n }\n\n /**\n * @param newTone 0 <= newTone <= 100; invalid valids are corrected.\n * Chroma may decrease because chroma has a different maximum for any given\n * hue and tone.\n */\n set tone(newTone: number) {\n this.setInternalState(\n HctSolver.solveToInt(this.internalHue, this.internalChroma, newTone),\n );\n }\n\n private constructor(private argb: number) {\n const cam = Cam16.fromInt(argb);\n this.internalHue = cam.hue;\n this.internalChroma = cam.chroma;\n this.internalTone = lstarFromArgb(argb);\n this.argb = argb;\n }\n\n private setInternalState(argb: number) {\n const cam = Cam16.fromInt(argb);\n this.internalHue = cam.hue;\n this.internalChroma = cam.chroma;\n this.internalTone = lstarFromArgb(argb);\n this.argb = argb;\n }\n\n /**\n * Translates a color into different [ViewingConditions].\n *\n * Colors change appearance. They look different with lights on versus off,\n * the same color, as in hex code, on white looks different when on black.\n * This is called color relativity, most famously explicated by Josef Albers\n * in Interaction of Color.\n *\n * In color science, color appearance models can account for this and\n * calculate the appearance of a color in different settings. HCT is based on\n * CAM16, a color appearance model, and uses it to make these calculations.\n *\n * See [ViewingConditions.make] for parameters affecting color appearance.\n */\n inViewingConditions(vc: ViewingConditions): Hct {\n // 1. Use CAM16 to find XYZ coordinates of color in specified VC.\n const cam = Cam16.fromInt(this.toInt());\n const viewedInVc = cam.xyzInViewingConditions(vc);\n\n // 2. Create CAM16 of those XYZ coordinates in default VC.\n const recastInVc = Cam16.fromXyzInViewingConditions(\n viewedInVc[0],\n viewedInVc[1],\n viewedInVc[2],\n ViewingConditions.make(),\n );\n\n // 3. Create HCT from:\n // - CAM16 using default VC with XYZ coordinates in specified VC.\n // - L* converted from Y in XYZ coordinates in specified VC.\n const recastHct = Hct.from(\n recastInVc.hue,\n recastInVc.chroma,\n lstarFromY(viewedInVc[1]),\n );\n return recastHct;\n }\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAdA,SAeSA,KAAK;AAAA,SACLC,SAAS;AAAA,SACTC,iBAAiB;AAAA,SACjBC,aAAa,EAAEC,UAAU;AAElC;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,GAAG,CAAC;EACf;AACF;AACA;AACA;AACA;AACA;AACA;AACA;;EAME,OAAOC,IAAIA,CAACC,GAAW,EAAEC,MAAc,EAAEC,IAAY,EAAE;IACrD,OAAO,IAAIJ,GAAG,CAACJ,SAAS,CAACS,UAAU,CAACH,GAAG,EAAEC,MAAM,EAAEC,IAAI,CAAC,CAAC;EACzD;;EAEA;AACF;AACA;AACA;EACE,OAAOE,OAAOA,CAACC,IAAY,EAAE;IAC3B,OAAO,IAAIP,GAAG,CAACO,IAAI,CAAC;EACtB;EAEAC,KAAKA,CAAA,EAAW;IACd,OAAO,IAAI,CAACD,IAAI;EAClB;;EAEA;AACF;AACA;AACA;EACE,IAAIL,GAAGA,CAAA,EAAW;IAChB,OAAO,IAAI,CAACO,WAAW;EACzB;;EAEA;AACF;AACA;AACA;AACA;EACE,IAAIP,GAAGA,CAACQ,MAAc,EAAE;IACtB,IAAI,CAACC,gBAAgB,CACnBf,SAAS,CAACS,UAAU,CAACK,MAAM,EAAE,IAAI,CAACE,cAAc,EAAE,IAAI,CAACC,YAAY,CACrE,CAAC;EACH;EAEA,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