@m3e/web 2.1.1 → 2.1.2

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 (262) hide show
  1. package/dist/all.js +605 -1296
  2. package/dist/all.js.map +1 -1
  3. package/dist/all.min.js +54 -114
  4. package/dist/all.min.js.map +1 -1
  5. package/dist/app-bar.js +2 -34
  6. package/dist/app-bar.js.map +1 -1
  7. package/dist/app-bar.min.js +1 -1
  8. package/dist/app-bar.min.js.map +1 -1
  9. package/dist/autocomplete.js +17 -40
  10. package/dist/autocomplete.js.map +1 -1
  11. package/dist/autocomplete.min.js +1 -1
  12. package/dist/autocomplete.min.js.map +1 -1
  13. package/dist/avatar.js +1 -28
  14. package/dist/avatar.js.map +1 -1
  15. package/dist/avatar.min.js +1 -1
  16. package/dist/avatar.min.js.map +1 -1
  17. package/dist/badge.js +1 -39
  18. package/dist/badge.js.map +1 -1
  19. package/dist/badge.min.js +1 -1
  20. package/dist/badge.min.js.map +1 -1
  21. package/dist/bottom-sheet.js +22 -58
  22. package/dist/bottom-sheet.js.map +1 -1
  23. package/dist/bottom-sheet.min.js +1 -1
  24. package/dist/bottom-sheet.min.js.map +1 -1
  25. package/dist/button-group.js +2 -34
  26. package/dist/button-group.js.map +1 -1
  27. package/dist/button-group.min.js +1 -1
  28. package/dist/button-group.min.js.map +1 -1
  29. package/dist/button.js +2 -34
  30. package/dist/button.js.map +1 -1
  31. package/dist/button.min.js +1 -1
  32. package/dist/button.min.js.map +1 -1
  33. package/dist/card.js +4 -34
  34. package/dist/card.js.map +1 -1
  35. package/dist/card.min.js +1 -1
  36. package/dist/card.min.js.map +1 -1
  37. package/dist/checkbox.js +2 -34
  38. package/dist/checkbox.js.map +1 -1
  39. package/dist/checkbox.min.js +1 -1
  40. package/dist/checkbox.min.js.map +1 -1
  41. package/dist/chips.js +2 -40
  42. package/dist/chips.js.map +1 -1
  43. package/dist/chips.min.js +1 -1
  44. package/dist/chips.min.js.map +1 -1
  45. package/dist/core-a11y.js +1 -39
  46. package/dist/core-a11y.js.map +1 -1
  47. package/dist/core-a11y.min.js +4 -4
  48. package/dist/core-a11y.min.js.map +1 -1
  49. package/dist/core-anchoring.js +164 -177
  50. package/dist/core-anchoring.js.map +1 -1
  51. package/dist/core-anchoring.min.js +1 -1
  52. package/dist/core-anchoring.min.js.map +1 -1
  53. package/dist/core-bidi.js +1 -31
  54. package/dist/core-bidi.js.map +1 -1
  55. package/dist/core-bidi.min.js +2 -3
  56. package/dist/core-bidi.min.js.map +1 -1
  57. package/dist/core.js +53 -40
  58. package/dist/core.js.map +1 -1
  59. package/dist/core.min.js +1 -1
  60. package/dist/core.min.js.map +1 -1
  61. package/dist/css-custom-data.json +517 -512
  62. package/dist/custom-elements.json +5201 -4336
  63. package/dist/dialog.js +3 -41
  64. package/dist/dialog.js.map +1 -1
  65. package/dist/dialog.min.js +1 -1
  66. package/dist/dialog.min.js.map +1 -1
  67. package/dist/divider.js +1 -28
  68. package/dist/divider.js.map +1 -1
  69. package/dist/divider.min.js +1 -1
  70. package/dist/divider.min.js.map +1 -1
  71. package/dist/drawer-container.js +18 -48
  72. package/dist/drawer-container.js.map +1 -1
  73. package/dist/drawer-container.min.js +1 -1
  74. package/dist/drawer-container.min.js.map +1 -1
  75. package/dist/expansion-panel.js +8 -41
  76. package/dist/expansion-panel.js.map +1 -1
  77. package/dist/expansion-panel.min.js +1 -1
  78. package/dist/expansion-panel.min.js.map +1 -1
  79. package/dist/fab-menu.js +3 -47
  80. package/dist/fab-menu.js.map +1 -1
  81. package/dist/fab-menu.min.js +1 -1
  82. package/dist/fab-menu.min.js.map +1 -1
  83. package/dist/fab.js +1 -33
  84. package/dist/fab.js.map +1 -1
  85. package/dist/fab.min.js +1 -1
  86. package/dist/fab.min.js.map +1 -1
  87. package/dist/form-field.js +19 -49
  88. package/dist/form-field.js.map +1 -1
  89. package/dist/form-field.min.js +3 -4
  90. package/dist/form-field.min.js.map +1 -1
  91. package/dist/heading.js +1 -28
  92. package/dist/heading.js.map +1 -1
  93. package/dist/heading.min.js +1 -1
  94. package/dist/heading.min.js.map +1 -1
  95. package/dist/html-custom-data.json +192 -171
  96. package/dist/icon-button.js +2 -34
  97. package/dist/icon-button.js.map +1 -1
  98. package/dist/icon-button.min.js +1 -1
  99. package/dist/icon-button.min.js.map +1 -1
  100. package/dist/icon.js +1 -28
  101. package/dist/icon.js.map +1 -1
  102. package/dist/icon.min.js +1 -1
  103. package/dist/icon.min.js.map +1 -1
  104. package/dist/index.js.map +1 -1
  105. package/dist/index.min.js +7 -0
  106. package/dist/index.min.js.map +1 -0
  107. package/dist/list.js +17 -46
  108. package/dist/list.js.map +1 -1
  109. package/dist/list.min.js +1 -1
  110. package/dist/list.min.js.map +1 -1
  111. package/dist/loading-indicator.js +8 -31
  112. package/dist/loading-indicator.js.map +1 -1
  113. package/dist/loading-indicator.min.js +1 -1
  114. package/dist/loading-indicator.min.js.map +1 -1
  115. package/dist/menu.js +3 -47
  116. package/dist/menu.js.map +1 -1
  117. package/dist/menu.min.js +1 -1
  118. package/dist/menu.min.js.map +1 -1
  119. package/dist/nav-bar.js +3 -41
  120. package/dist/nav-bar.js.map +1 -1
  121. package/dist/nav-bar.min.js +1 -1
  122. package/dist/nav-bar.min.js.map +1 -1
  123. package/dist/nav-menu.js +2 -40
  124. package/dist/nav-menu.js.map +1 -1
  125. package/dist/nav-menu.min.js +1 -1
  126. package/dist/nav-menu.min.js.map +1 -1
  127. package/dist/nav-rail.js +1 -33
  128. package/dist/nav-rail.js.map +1 -1
  129. package/dist/nav-rail.min.js +1 -1
  130. package/dist/nav-rail.min.js.map +1 -1
  131. package/dist/option.js +3 -59
  132. package/dist/option.js.map +1 -1
  133. package/dist/option.min.js +1 -1
  134. package/dist/option.min.js.map +1 -1
  135. package/dist/paginator.js +2 -34
  136. package/dist/paginator.js.map +1 -1
  137. package/dist/paginator.min.js +2 -3
  138. package/dist/paginator.min.js.map +1 -1
  139. package/dist/progress-indicator.js +41 -63
  140. package/dist/progress-indicator.js.map +1 -1
  141. package/dist/progress-indicator.min.js +32 -32
  142. package/dist/progress-indicator.min.js.map +1 -1
  143. package/dist/radio-group.js +1 -39
  144. package/dist/radio-group.js.map +1 -1
  145. package/dist/radio-group.min.js +1 -1
  146. package/dist/radio-group.min.js.map +1 -1
  147. package/dist/segmented-button.js +2 -40
  148. package/dist/segmented-button.js.map +1 -1
  149. package/dist/segmented-button.min.js +1 -1
  150. package/dist/segmented-button.min.js.map +1 -1
  151. package/dist/select.js +16 -40
  152. package/dist/select.js.map +1 -1
  153. package/dist/select.min.js +1 -1
  154. package/dist/select.min.js.map +1 -1
  155. package/dist/shape.js +1 -28
  156. package/dist/shape.js.map +1 -1
  157. package/dist/shape.min.js +1 -1
  158. package/dist/shape.min.js.map +1 -1
  159. package/dist/slide-group.js +9 -42
  160. package/dist/slide-group.js.map +1 -1
  161. package/dist/slide-group.min.js +1 -1
  162. package/dist/slide-group.min.js.map +1 -1
  163. package/dist/slider.js +1 -39
  164. package/dist/slider.js.map +1 -1
  165. package/dist/slider.min.js +1 -1
  166. package/dist/slider.min.js.map +1 -1
  167. package/dist/snackbar.js +2 -40
  168. package/dist/snackbar.js.map +1 -1
  169. package/dist/snackbar.min.js +1 -1
  170. package/dist/snackbar.min.js.map +1 -1
  171. package/dist/split-button.js +1 -39
  172. package/dist/split-button.js.map +1 -1
  173. package/dist/split-button.min.js +1 -1
  174. package/dist/split-button.min.js.map +1 -1
  175. package/dist/src/autocomplete/AutocompleteElement.d.ts +6 -0
  176. package/dist/src/autocomplete/AutocompleteElement.d.ts.map +1 -1
  177. package/dist/src/bottom-sheet/BottomSheetElement.d.ts +3 -3
  178. package/dist/src/bottom-sheet/BottomSheetElement.d.ts.map +1 -1
  179. package/dist/src/card/CardElement.d.ts +1 -0
  180. package/dist/src/card/CardElement.d.ts.map +1 -1
  181. package/dist/src/card/styles/CardVariantToken.d.ts +1 -1
  182. package/dist/src/card/styles/CardVariantToken.d.ts.map +1 -1
  183. package/dist/src/core/anchoring/FloatingPanelElement.d.ts +6 -3
  184. package/dist/src/core/anchoring/FloatingPanelElement.d.ts.map +1 -1
  185. package/dist/src/core/anchoring/FloatingPanelScrollStrategy.d.ts +3 -0
  186. package/dist/src/core/anchoring/FloatingPanelScrollStrategy.d.ts.map +1 -0
  187. package/dist/src/core/anchoring/index.d.ts +1 -0
  188. package/dist/src/core/anchoring/index.d.ts.map +1 -1
  189. package/dist/src/core/shared/mixins/ReconnectedCallback.d.ts +15 -0
  190. package/dist/src/core/shared/mixins/ReconnectedCallback.d.ts.map +1 -0
  191. package/dist/src/core/shared/mixins/SuppressInitialAnimation.d.ts +11 -0
  192. package/dist/src/core/shared/mixins/SuppressInitialAnimation.d.ts.map +1 -0
  193. package/dist/src/core/shared/mixins/index.d.ts +2 -0
  194. package/dist/src/core/shared/mixins/index.d.ts.map +1 -1
  195. package/dist/src/drawer-container/DrawerContainerElement.d.ts +4 -2
  196. package/dist/src/drawer-container/DrawerContainerElement.d.ts.map +1 -1
  197. package/dist/src/expansion-panel/ExpansionPanelElement.d.ts +3 -1
  198. package/dist/src/expansion-panel/ExpansionPanelElement.d.ts.map +1 -1
  199. package/dist/src/fab-menu/FabMenuElement.d.ts +1 -3
  200. package/dist/src/fab-menu/FabMenuElement.d.ts.map +1 -1
  201. package/dist/src/form-field/FormFieldElement.d.ts +4 -2
  202. package/dist/src/form-field/FormFieldElement.d.ts.map +1 -1
  203. package/dist/src/list/ActionListElement.d.ts.map +1 -1
  204. package/dist/src/list/ListItemElement.d.ts +3 -1
  205. package/dist/src/list/ListItemElement.d.ts.map +1 -1
  206. package/dist/src/loading-indicator/LoadingIndicatorElement.d.ts +3 -1
  207. package/dist/src/loading-indicator/LoadingIndicatorElement.d.ts.map +1 -1
  208. package/dist/src/menu/MenuElement.d.ts +1 -3
  209. package/dist/src/menu/MenuElement.d.ts.map +1 -1
  210. package/dist/src/nav-bar/NavBarElement.d.ts +1 -1
  211. package/dist/src/nav-bar/NavBarElement.d.ts.map +1 -1
  212. package/dist/src/option/OptionPanelElement.d.ts +0 -4
  213. package/dist/src/option/OptionPanelElement.d.ts.map +1 -1
  214. package/dist/src/progress-indicator/CircularProgressIndicatorElement.d.ts +2 -0
  215. package/dist/src/progress-indicator/CircularProgressIndicatorElement.d.ts.map +1 -1
  216. package/dist/src/progress-indicator/LinearProgressIndicatorElement.d.ts +2 -0
  217. package/dist/src/progress-indicator/LinearProgressIndicatorElement.d.ts.map +1 -1
  218. package/dist/src/progress-indicator/ProgressElementIndicatorBase.d.ts +1 -1
  219. package/dist/src/progress-indicator/ProgressElementIndicatorBase.d.ts.map +1 -1
  220. package/dist/src/select/SelectElement.d.ts +6 -0
  221. package/dist/src/select/SelectElement.d.ts.map +1 -1
  222. package/dist/src/slide-group/SlideGroupElement.d.ts +5 -1
  223. package/dist/src/slide-group/SlideGroupElement.d.ts.map +1 -1
  224. package/dist/src/stepper/StepperElement.d.ts +1 -1
  225. package/dist/src/stepper/StepperElement.d.ts.map +1 -1
  226. package/dist/src/toc/TocElement.d.ts +1 -1
  227. package/dist/src/toc/TocElement.d.ts.map +1 -1
  228. package/dist/src/tooltip/TooltipElementBase.d.ts +3 -1
  229. package/dist/src/tooltip/TooltipElementBase.d.ts.map +1 -1
  230. package/dist/stepper.js +3 -41
  231. package/dist/stepper.js.map +1 -1
  232. package/dist/stepper.min.js +1 -1
  233. package/dist/stepper.min.js.map +1 -1
  234. package/dist/switch.js +1 -33
  235. package/dist/switch.js.map +1 -1
  236. package/dist/switch.min.js +1 -1
  237. package/dist/switch.min.js.map +1 -1
  238. package/dist/tabs.js +1 -39
  239. package/dist/tabs.js.map +1 -1
  240. package/dist/tabs.min.js +1 -1
  241. package/dist/tabs.min.js.map +1 -1
  242. package/dist/textarea-autosize.js +1 -39
  243. package/dist/textarea-autosize.js.map +1 -1
  244. package/dist/textarea-autosize.min.js +2 -3
  245. package/dist/textarea-autosize.min.js.map +1 -1
  246. package/dist/theme.js +1 -39
  247. package/dist/theme.js.map +1 -1
  248. package/dist/theme.min.js +19 -19
  249. package/dist/theme.min.js.map +1 -1
  250. package/dist/toc.js +4 -42
  251. package/dist/toc.js.map +1 -1
  252. package/dist/toc.min.js +1 -1
  253. package/dist/toc.min.js.map +1 -1
  254. package/dist/toolbar.js +1 -39
  255. package/dist/toolbar.js.map +1 -1
  256. package/dist/toolbar.min.js +1 -1
  257. package/dist/toolbar.min.js.map +1 -1
  258. package/dist/tooltip.js +15 -46
  259. package/dist/tooltip.js.map +1 -1
  260. package/dist/tooltip.min.js +1 -1
  261. package/dist/tooltip.min.js.map +1 -1
  262. package/package.json +3 -2
package/dist/theme.min.js CHANGED
@@ -3,7 +3,7 @@
3
3
  * Copyright (c) 2025 matraic
4
4
  * See LICENSE file in the project root for full license text.
5
5
  */
6
- import{css as t,LitElement as e,html as r}from"lit";import{property as a}from"lit/decorators.js";import{DesignToken as n,customElement as o}from"@m3e/web/core";function i(t,e,r,a){var n,o=arguments.length,i=o<3?e:null===a?a=Object.getOwnPropertyDescriptor(e,r):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,e,r,a);else for(var s=t.length-1;s>=0;s--)(n=t[s])&&(i=(o<3?n(i):o>3?n(e,r,i):n(e,r))||i);return o>3&&i&&Object.defineProperty(e,r,i),i}function s(t,e,r,a){if("a"===r&&!a)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!a:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?a:"a"===r?a.call(t):a?a.value:e.get(t)}function c(t,e,r,a,n){if("m"===a)throw new TypeError("Private method is not writable");if("a"===a&&!n)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===a?n.call(t,r):n?n.value=r:e.set(t,r),r}
6
+ import{__decorate as t,__classPrivateFieldGet as e,__classPrivateFieldSet as r}from"tslib";import{css as a,LitElement as n,html as o}from"lit";import{property as i}from"lit/decorators.js";import{DesignToken as s,customElement as c}from"@m3e/web/core";
7
7
  /**
8
8
  * @license
9
9
  * Copyright 2021 Google LLC
@@ -36,7 +36,7 @@ function h(t){return t<0?-1:0===t?0:1}function u(t,e,r){return(1-r)*t+r*e}functi
36
36
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
37
37
  * See the License for the specific language governing permissions and
38
38
  * limitations under the License.
39
- */"function"==typeof SuppressedError&&SuppressedError;const g=[[.41233895,.35762064,.18051042],[.2126,.7152,.0722],[.01932141,.11916382,.95034478]],f=[[3.2413774792388685,-1.5376652402851851,-.49885366846268053],[-.9691452513005321,1.8758853451067872,.04156585616912061],[.05562093689691305,-.20395524564742123,1.0571799111220335]],y=[95.047,100,108.883];function p(t,e,r){return(255<<24|(255&t)<<16|(255&e)<<8|255&r)>>>0}function b(t){return p(A(t[0]),A(t[1]),A(t[2]))}function P(t){return t>>16&255}function C(t){return t>>8&255}function w(t){return 255&t}function k(t){const e=function(t){return m([v(P(t)),v(C(t)),v(w(t))],g)}(t)[1];return 116*_(e/100)-16}function M(t){return 100*function(t){const e=24389/27,r=t*t*t;return r>216/24389?r:(116*t-16)/e}
39
+ */const g=[[.41233895,.35762064,.18051042],[.2126,.7152,.0722],[.01932141,.11916382,.95034478]],f=[[3.2413774792388685,-1.5376652402851851,-.49885366846268053],[-.9691452513005321,1.8758853451067872,.04156585616912061],[.05562093689691305,-.20395524564742123,1.0571799111220335]],y=[95.047,100,108.883];function p(t,e,r){return(255<<24|(255&t)<<16|(255&e)<<8|255&r)>>>0}function b(t){return p(v(t[0]),v(t[1]),v(t[2]))}function C(t){return t>>16&255}function P(t){return t>>8&255}function w(t){return 255&t}function k(t){const e=function(t){return m([A(C(t)),A(P(t)),A(w(t))],g)}(t)[1];return 116*_(e/100)-16}function M(t){return 100*function(t){const e=24389/27,r=t*t*t;return r>216/24389?r:(116*t-16)/e}
40
40
  /**
41
41
  * @license
42
42
  * Copyright 2021 Google LLC
@@ -52,7 +52,7 @@ function h(t){return t<0?-1:0===t?0:1}function u(t,e,r){return(1-r)*t+r*e}functi
52
52
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
53
53
  * See the License for the specific language governing permissions and
54
54
  * limitations under the License.
55
- */((t+16)/116)}function D(t){return 116*_(t/100)-16}function v(t){const e=t/255;return e<=.040449936?e/12.92*100:100*Math.pow((e+.055)/1.055,2.4)}function A(t){const e=t/100;let r=0;return r=e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055,a=0,n=255,(o=Math.round(255*r))<a?a:o>n?n:o;var a,n,o}function _(t){const e=24389/27;return t>216/24389?Math.pow(t,1/3):(e*t+16)/116}class x{static make(t=function(){return y}(),e=200/Math.PI*M(50)/100,r=50,a=2,n=!1){const o=t,i=.401288*o[0]+.650173*o[1]+-.051461*o[2],s=-.250268*o[0]+1.204414*o[1]+.045854*o[2],c=-.002079*o[0]+.048952*o[1]+.953127*o[2],h=.8+a/10,l=h>=.9?u(.59,.69,10*(h-.9)):u(.525,.59,10*(h-.8));let d=n?1:h*(1-1/3.6*Math.exp((-e-42)/92));d=d>1?1:d<0?0:d;const m=h,g=[d*(100/i)+1-d,d*(100/s)+1-d,d*(100/c)+1-d],f=1/(5*e+1),p=f*f*f*f,b=1-p,P=p*e+.1*b*b*Math.cbrt(5*e),C=M(r)/t[1],w=1.48+Math.sqrt(C),k=.725/Math.pow(C,.2),D=k,v=[Math.pow(P*g[0]*i/100,.42),Math.pow(P*g[1]*s/100,.42),Math.pow(P*g[2]*c/100,.42)],A=[400*v[0]/(v[0]+27.13),400*v[1]/(v[1]+27.13),400*v[2]/(v[2]+27.13)];return new x(C,(2*A[0]+A[1]+.05*A[2])*k,k,D,l,m,g,P,Math.pow(P,.25),w)}constructor(t,e,r,a,n,o,i,s,c,h){this.n=t,this.aw=e,this.nbb=r,this.ncb=a,this.c=n,this.nc=o,this.rgbD=i,this.fl=s,this.fLRoot=c,this.z=h}}x.DEFAULT=x.make();
55
+ */((t+16)/116)}function D(t){return 116*_(t/100)-16}function A(t){const e=t/255;return e<=.040449936?e/12.92*100:100*Math.pow((e+.055)/1.055,2.4)}function v(t){const e=t/100;let r=0;return r=e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055,a=0,n=255,(o=Math.round(255*r))<a?a:o>n?n:o;var a,n,o}function _(t){const e=24389/27;return t>216/24389?Math.pow(t,1/3):(e*t+16)/116}class x{static make(t=function(){return y}(),e=200/Math.PI*M(50)/100,r=50,a=2,n=!1){const o=t,i=.401288*o[0]+.650173*o[1]+-.051461*o[2],s=-.250268*o[0]+1.204414*o[1]+.045854*o[2],c=-.002079*o[0]+.048952*o[1]+.953127*o[2],h=.8+a/10,l=h>=.9?u(.59,.69,10*(h-.9)):u(.525,.59,10*(h-.8));let d=n?1:h*(1-1/3.6*Math.exp((-e-42)/92));d=d>1?1:d<0?0:d;const m=h,g=[d*(100/i)+1-d,d*(100/s)+1-d,d*(100/c)+1-d],f=1/(5*e+1),p=f*f*f*f,b=1-p,C=p*e+.1*b*b*Math.cbrt(5*e),P=M(r)/t[1],w=1.48+Math.sqrt(P),k=.725/Math.pow(P,.2),D=k,A=[Math.pow(C*g[0]*i/100,.42),Math.pow(C*g[1]*s/100,.42),Math.pow(C*g[2]*c/100,.42)],v=[400*A[0]/(A[0]+27.13),400*A[1]/(A[1]+27.13),400*A[2]/(A[2]+27.13)];return new x(P,(2*v[0]+v[1]+.05*v[2])*k,k,D,l,m,g,C,Math.pow(C,.25),w)}constructor(t,e,r,a,n,o,i,s,c,h){this.n=t,this.aw=e,this.nbb=r,this.ncb=a,this.c=n,this.nc=o,this.rgbD=i,this.fl=s,this.fLRoot=c,this.z=h}}x.DEFAULT=x.make();
56
56
  /**
57
57
  * @license
58
58
  * Copyright 2021 Google LLC
@@ -69,7 +69,7 @@ function h(t){return t<0?-1:0===t?0:1}function u(t,e,r){return(1-r)*t+r*e}functi
69
69
  * See the License for the specific language governing permissions and
70
70
  * limitations under the License.
71
71
  */
72
- class T{constructor(t,e,r,a,n,o,i,s,c){this.hue=t,this.chroma=e,this.j=r,this.q=a,this.m=n,this.s=o,this.jstar=i,this.astar=s,this.bstar=c}distance(t){const e=this.jstar-t.jstar,r=this.astar-t.astar,a=this.bstar-t.bstar,n=Math.sqrt(e*e+r*r+a*a);return 1.41*Math.pow(n,.63)}static fromInt(t){return T.fromIntInViewingConditions(t,x.DEFAULT)}static fromIntInViewingConditions(t,e){const r=(65280&t)>>8,a=255&t,n=v((16711680&t)>>16),o=v(r),i=v(a),s=.41233895*n+.35762064*o+.18051042*i,c=.2126*n+.7152*o+.0722*i,u=.01932141*n+.11916382*o+.95034478*i,l=.401288*s+.650173*c-.051461*u,d=-.250268*s+1.204414*c+.045854*u,m=-.002079*s+.048952*c+.953127*u,g=e.rgbD[0]*l,f=e.rgbD[1]*d,y=e.rgbD[2]*m,p=Math.pow(e.fl*Math.abs(g)/100,.42),b=Math.pow(e.fl*Math.abs(f)/100,.42),P=Math.pow(e.fl*Math.abs(y)/100,.42),C=400*h(g)*p/(p+27.13),w=400*h(f)*b/(b+27.13),k=400*h(y)*P/(P+27.13),M=(11*C+-12*w+k)/11,D=(C+w-2*k)/9,A=(20*C+20*w+21*k)/20,_=(40*C+20*w+k)/20,x=180*Math.atan2(D,M)/Math.PI,F=x<0?x+360:x>=360?x-360:x,I=F*Math.PI/180,S=_*e.nbb,L=100*Math.pow(S/e.aw,e.c*e.z),B=4/e.c*Math.sqrt(L/100)*(e.aw+4)*e.fLRoot,E=F<20.14?F+360:F,R=5e4/13*(.25*(Math.cos(E*Math.PI/180+2)+3.8))*e.nc*e.ncb*Math.sqrt(M*M+D*D)/(A+.305),O=Math.pow(R,.9)*Math.pow(1.64-Math.pow(.29,e.n),.73),V=O*Math.sqrt(L/100),H=V*e.fLRoot,N=50*Math.sqrt(O*e.c/(e.aw+4)),z=(1+100*.007)*L/(1+.007*L),q=1/.0228*Math.log(1+.0228*H),U=q*Math.cos(I),$=q*Math.sin(I);return new T(F,V,L,B,H,N,z,U,$)}static fromJch(t,e,r){return T.fromJchInViewingConditions(t,e,r,x.DEFAULT)}static fromJchInViewingConditions(t,e,r,a){const n=4/a.c*Math.sqrt(t/100)*(a.aw+4)*a.fLRoot,o=e*a.fLRoot,i=e/Math.sqrt(t/100),s=50*Math.sqrt(i*a.c/(a.aw+4)),c=r*Math.PI/180,h=(1+100*.007)*t/(1+.007*t),u=1/.0228*Math.log(1+.0228*o),l=u*Math.cos(c),d=u*Math.sin(c);return new T(r,e,t,n,o,s,h,l,d)}static fromUcs(t,e,r){return T.fromUcsInViewingConditions(t,e,r,x.DEFAULT)}static fromUcsInViewingConditions(t,e,r,a){const n=e,o=r,i=Math.sqrt(n*n+o*o),s=(Math.exp(.0228*i)-1)/.0228/a.fLRoot;let c=Math.atan2(o,n)*(180/Math.PI);c<0&&(c+=360);const h=t/(1-.007*(t-100));return T.fromJchInViewingConditions(h,s,c,a)}toInt(){return this.viewed(x.DEFAULT)}viewed(t){const e=0===this.chroma||0===this.j?0:this.chroma/Math.sqrt(this.j/100),r=Math.pow(e/Math.pow(1.64-Math.pow(.29,t.n),.73),1/.9),a=this.hue*Math.PI/180,n=.25*(Math.cos(a+2)+3.8),o=t.aw*Math.pow(this.j/100,1/t.c/t.z),i=n*(5e4/13)*t.nc*t.ncb,s=o/t.nbb,c=Math.sin(a),u=Math.cos(a),l=23*(s+.305)*r/(23*i+11*r*u+108*r*c),d=l*u,m=l*c,g=(460*s+451*d+288*m)/1403,y=(460*s-891*d-261*m)/1403,b=(460*s-220*d-6300*m)/1403,P=Math.max(0,27.13*Math.abs(g)/(400-Math.abs(g))),C=h(g)*(100/t.fl)*Math.pow(P,1/.42),w=Math.max(0,27.13*Math.abs(y)/(400-Math.abs(y))),k=h(y)*(100/t.fl)*Math.pow(w,1/.42),M=Math.max(0,27.13*Math.abs(b)/(400-Math.abs(b))),D=h(b)*(100/t.fl)*Math.pow(M,1/.42),v=C/t.rgbD[0],_=k/t.rgbD[1],x=D/t.rgbD[2],T=function(t,e,r){const a=f,n=a[0][0]*t+a[0][1]*e+a[0][2]*r,o=a[1][0]*t+a[1][1]*e+a[1][2]*r,i=a[2][0]*t+a[2][1]*e+a[2][2]*r;return p(A(n),A(o),A(i))}(1.86206786*v-1.01125463*_+.14918677*x,.38752654*v+.62144744*_-.00897398*x,-.0158415*v-.03412294*_+1.04996444*x);return T}static fromXyzInViewingConditions(t,e,r,a){const n=.401288*t+.650173*e-.051461*r,o=-.250268*t+1.204414*e+.045854*r,i=-.002079*t+.048952*e+.953127*r,s=a.rgbD[0]*n,c=a.rgbD[1]*o,u=a.rgbD[2]*i,l=Math.pow(a.fl*Math.abs(s)/100,.42),d=Math.pow(a.fl*Math.abs(c)/100,.42),m=Math.pow(a.fl*Math.abs(u)/100,.42),g=400*h(s)*l/(l+27.13),f=400*h(c)*d/(d+27.13),y=400*h(u)*m/(m+27.13),p=(11*g+-12*f+y)/11,b=(g+f-2*y)/9,P=(20*g+20*f+21*y)/20,C=(40*g+20*f+y)/20,w=180*Math.atan2(b,p)/Math.PI,k=w<0?w+360:w>=360?w-360:w,M=k*Math.PI/180,D=C*a.nbb,v=100*Math.pow(D/a.aw,a.c*a.z),A=4/a.c*Math.sqrt(v/100)*(a.aw+4)*a.fLRoot,_=k<20.14?k+360:k,x=5e4/13*(1/4*(Math.cos(_*Math.PI/180+2)+3.8))*a.nc*a.ncb*Math.sqrt(p*p+b*b)/(P+.305),F=Math.pow(x,.9)*Math.pow(1.64-Math.pow(.29,a.n),.73),I=F*Math.sqrt(v/100),S=I*a.fLRoot,L=50*Math.sqrt(F*a.c/(a.aw+4)),B=(1+100*.007)*v/(1+.007*v),E=Math.log(1+.0228*S)/.0228,R=E*Math.cos(M),O=E*Math.sin(M);return new T(k,I,v,A,S,L,B,R,O)}xyzInViewingConditions(t){const e=0===this.chroma||0===this.j?0:this.chroma/Math.sqrt(this.j/100),r=Math.pow(e/Math.pow(1.64-Math.pow(.29,t.n),.73),1/.9),a=this.hue*Math.PI/180,n=.25*(Math.cos(a+2)+3.8),o=t.aw*Math.pow(this.j/100,1/t.c/t.z),i=n*(5e4/13)*t.nc*t.ncb,s=o/t.nbb,c=Math.sin(a),u=Math.cos(a),l=23*(s+.305)*r/(23*i+11*r*u+108*r*c),d=l*u,m=l*c,g=(460*s+451*d+288*m)/1403,f=(460*s-891*d-261*m)/1403,y=(460*s-220*d-6300*m)/1403,p=Math.max(0,27.13*Math.abs(g)/(400-Math.abs(g))),b=h(g)*(100/t.fl)*Math.pow(p,1/.42),P=Math.max(0,27.13*Math.abs(f)/(400-Math.abs(f))),C=h(f)*(100/t.fl)*Math.pow(P,1/.42),w=Math.max(0,27.13*Math.abs(y)/(400-Math.abs(y))),k=h(y)*(100/t.fl)*Math.pow(w,1/.42),M=b/t.rgbD[0],D=C/t.rgbD[1],v=k/t.rgbD[2];return[1.86206786*M-1.01125463*D+.14918677*v,.38752654*M+.62144744*D-.00897398*v,-.0158415*M-.03412294*D+1.04996444*v]}}
72
+ class F{constructor(t,e,r,a,n,o,i,s,c){this.hue=t,this.chroma=e,this.j=r,this.q=a,this.m=n,this.s=o,this.jstar=i,this.astar=s,this.bstar=c}distance(t){const e=this.jstar-t.jstar,r=this.astar-t.astar,a=this.bstar-t.bstar,n=Math.sqrt(e*e+r*r+a*a);return 1.41*Math.pow(n,.63)}static fromInt(t){return F.fromIntInViewingConditions(t,x.DEFAULT)}static fromIntInViewingConditions(t,e){const r=(65280&t)>>8,a=255&t,n=A((16711680&t)>>16),o=A(r),i=A(a),s=.41233895*n+.35762064*o+.18051042*i,c=.2126*n+.7152*o+.0722*i,u=.01932141*n+.11916382*o+.95034478*i,l=.401288*s+.650173*c-.051461*u,d=-.250268*s+1.204414*c+.045854*u,m=-.002079*s+.048952*c+.953127*u,g=e.rgbD[0]*l,f=e.rgbD[1]*d,y=e.rgbD[2]*m,p=Math.pow(e.fl*Math.abs(g)/100,.42),b=Math.pow(e.fl*Math.abs(f)/100,.42),C=Math.pow(e.fl*Math.abs(y)/100,.42),P=400*h(g)*p/(p+27.13),w=400*h(f)*b/(b+27.13),k=400*h(y)*C/(C+27.13),M=(11*P+-12*w+k)/11,D=(P+w-2*k)/9,v=(20*P+20*w+21*k)/20,_=(40*P+20*w+k)/20,x=180*Math.atan2(D,M)/Math.PI,I=x<0?x+360:x>=360?x-360:x,S=I*Math.PI/180,T=_*e.nbb,L=100*Math.pow(T/e.aw,e.c*e.z),B=4/e.c*Math.sqrt(L/100)*(e.aw+4)*e.fLRoot,R=I<20.14?I+360:I,E=5e4/13*(.25*(Math.cos(R*Math.PI/180+2)+3.8))*e.nc*e.ncb*Math.sqrt(M*M+D*D)/(v+.305),V=Math.pow(E,.9)*Math.pow(1.64-Math.pow(.29,e.n),.73),H=V*Math.sqrt(L/100),O=H*e.fLRoot,N=50*Math.sqrt(V*e.c/(e.aw+4)),z=(1+100*.007)*L/(1+.007*L),q=1/.0228*Math.log(1+.0228*O),U=q*Math.cos(S),$=q*Math.sin(S);return new F(I,H,L,B,O,N,z,U,$)}static fromJch(t,e,r){return F.fromJchInViewingConditions(t,e,r,x.DEFAULT)}static fromJchInViewingConditions(t,e,r,a){const n=4/a.c*Math.sqrt(t/100)*(a.aw+4)*a.fLRoot,o=e*a.fLRoot,i=e/Math.sqrt(t/100),s=50*Math.sqrt(i*a.c/(a.aw+4)),c=r*Math.PI/180,h=(1+100*.007)*t/(1+.007*t),u=1/.0228*Math.log(1+.0228*o),l=u*Math.cos(c),d=u*Math.sin(c);return new F(r,e,t,n,o,s,h,l,d)}static fromUcs(t,e,r){return F.fromUcsInViewingConditions(t,e,r,x.DEFAULT)}static fromUcsInViewingConditions(t,e,r,a){const n=e,o=r,i=Math.sqrt(n*n+o*o),s=(Math.exp(.0228*i)-1)/.0228/a.fLRoot;let c=Math.atan2(o,n)*(180/Math.PI);c<0&&(c+=360);const h=t/(1-.007*(t-100));return F.fromJchInViewingConditions(h,s,c,a)}toInt(){return this.viewed(x.DEFAULT)}viewed(t){const e=0===this.chroma||0===this.j?0:this.chroma/Math.sqrt(this.j/100),r=Math.pow(e/Math.pow(1.64-Math.pow(.29,t.n),.73),1/.9),a=this.hue*Math.PI/180,n=.25*(Math.cos(a+2)+3.8),o=t.aw*Math.pow(this.j/100,1/t.c/t.z),i=n*(5e4/13)*t.nc*t.ncb,s=o/t.nbb,c=Math.sin(a),u=Math.cos(a),l=23*(s+.305)*r/(23*i+11*r*u+108*r*c),d=l*u,m=l*c,g=(460*s+451*d+288*m)/1403,y=(460*s-891*d-261*m)/1403,b=(460*s-220*d-6300*m)/1403,C=Math.max(0,27.13*Math.abs(g)/(400-Math.abs(g))),P=h(g)*(100/t.fl)*Math.pow(C,1/.42),w=Math.max(0,27.13*Math.abs(y)/(400-Math.abs(y))),k=h(y)*(100/t.fl)*Math.pow(w,1/.42),M=Math.max(0,27.13*Math.abs(b)/(400-Math.abs(b))),D=h(b)*(100/t.fl)*Math.pow(M,1/.42),A=P/t.rgbD[0],_=k/t.rgbD[1],x=D/t.rgbD[2],F=function(t,e,r){const a=f,n=a[0][0]*t+a[0][1]*e+a[0][2]*r,o=a[1][0]*t+a[1][1]*e+a[1][2]*r,i=a[2][0]*t+a[2][1]*e+a[2][2]*r;return p(v(n),v(o),v(i))}(1.86206786*A-1.01125463*_+.14918677*x,.38752654*A+.62144744*_-.00897398*x,-.0158415*A-.03412294*_+1.04996444*x);return F}static fromXyzInViewingConditions(t,e,r,a){const n=.401288*t+.650173*e-.051461*r,o=-.250268*t+1.204414*e+.045854*r,i=-.002079*t+.048952*e+.953127*r,s=a.rgbD[0]*n,c=a.rgbD[1]*o,u=a.rgbD[2]*i,l=Math.pow(a.fl*Math.abs(s)/100,.42),d=Math.pow(a.fl*Math.abs(c)/100,.42),m=Math.pow(a.fl*Math.abs(u)/100,.42),g=400*h(s)*l/(l+27.13),f=400*h(c)*d/(d+27.13),y=400*h(u)*m/(m+27.13),p=(11*g+-12*f+y)/11,b=(g+f-2*y)/9,C=(20*g+20*f+21*y)/20,P=(40*g+20*f+y)/20,w=180*Math.atan2(b,p)/Math.PI,k=w<0?w+360:w>=360?w-360:w,M=k*Math.PI/180,D=P*a.nbb,A=100*Math.pow(D/a.aw,a.c*a.z),v=4/a.c*Math.sqrt(A/100)*(a.aw+4)*a.fLRoot,_=k<20.14?k+360:k,x=5e4/13*(1/4*(Math.cos(_*Math.PI/180+2)+3.8))*a.nc*a.ncb*Math.sqrt(p*p+b*b)/(C+.305),I=Math.pow(x,.9)*Math.pow(1.64-Math.pow(.29,a.n),.73),S=I*Math.sqrt(A/100),T=S*a.fLRoot,L=50*Math.sqrt(I*a.c/(a.aw+4)),B=(1+100*.007)*A/(1+.007*A),R=Math.log(1+.0228*T)/.0228,E=R*Math.cos(M),V=R*Math.sin(M);return new F(k,S,A,v,T,L,B,E,V)}xyzInViewingConditions(t){const e=0===this.chroma||0===this.j?0:this.chroma/Math.sqrt(this.j/100),r=Math.pow(e/Math.pow(1.64-Math.pow(.29,t.n),.73),1/.9),a=this.hue*Math.PI/180,n=.25*(Math.cos(a+2)+3.8),o=t.aw*Math.pow(this.j/100,1/t.c/t.z),i=n*(5e4/13)*t.nc*t.ncb,s=o/t.nbb,c=Math.sin(a),u=Math.cos(a),l=23*(s+.305)*r/(23*i+11*r*u+108*r*c),d=l*u,m=l*c,g=(460*s+451*d+288*m)/1403,f=(460*s-891*d-261*m)/1403,y=(460*s-220*d-6300*m)/1403,p=Math.max(0,27.13*Math.abs(g)/(400-Math.abs(g))),b=h(g)*(100/t.fl)*Math.pow(p,1/.42),C=Math.max(0,27.13*Math.abs(f)/(400-Math.abs(f))),P=h(f)*(100/t.fl)*Math.pow(C,1/.42),w=Math.max(0,27.13*Math.abs(y)/(400-Math.abs(y))),k=h(y)*(100/t.fl)*Math.pow(w,1/.42),M=b/t.rgbD[0],D=P/t.rgbD[1],A=k/t.rgbD[2];return[1.86206786*M-1.01125463*D+.14918677*A,.38752654*M+.62144744*D-.00897398*A,-.0158415*M-.03412294*D+1.04996444*A]}}
73
73
  /**
74
74
  * @license
75
75
  * Copyright 2021 Google LLC
@@ -85,7 +85,7 @@ class T{constructor(t,e,r,a,n,o,i,s,c){this.hue=t,this.chroma=e,this.j=r,this.q=
85
85
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
86
86
  * See the License for the specific language governing permissions and
87
87
  * limitations under the License.
88
- */class F{static sanitizeRadians(t){return(t+8*Math.PI)%(2*Math.PI)}static trueDelinearized(t){const e=t/100;let r=0;return r=e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055,255*r}static chromaticAdaptation(t){const e=Math.pow(Math.abs(t),.42);return 400*h(t)*e/(e+27.13)}static hueOf(t){const e=m(t,F.SCALED_DISCOUNT_FROM_LINRGB),r=F.chromaticAdaptation(e[0]),a=F.chromaticAdaptation(e[1]),n=F.chromaticAdaptation(e[2]),o=(11*r+-12*a+n)/11,i=(r+a-2*n)/9;return Math.atan2(i,o)}static areInCyclicOrder(t,e,r){return F.sanitizeRadians(e-t)<F.sanitizeRadians(r-t)}static intercept(t,e,r){return(e-t)/(r-t)}static lerpPoint(t,e,r){return[t[0]+(r[0]-t[0])*e,t[1]+(r[1]-t[1])*e,t[2]+(r[2]-t[2])*e]}static setCoordinate(t,e,r,a){const n=F.intercept(t[a],e,r[a]);return F.lerpPoint(t,n,r)}static isBounded(t){return 0<=t&&t<=100}static nthVertex(t,e){const r=F.Y_FROM_LINRGB[0],a=F.Y_FROM_LINRGB[1],n=F.Y_FROM_LINRGB[2],o=e%4<=1?0:100,i=e%2==0?0:100;if(e<4){const e=o,s=i,c=(t-e*a-s*n)/r;return F.isBounded(c)?[c,e,s]:[-1,-1,-1]}if(e<8){const e=o,s=i,c=(t-s*r-e*n)/a;return F.isBounded(c)?[s,c,e]:[-1,-1,-1]}{const e=o,s=i,c=(t-e*r-s*a)/n;return F.isBounded(c)?[e,s,c]:[-1,-1,-1]}}static bisectToSegment(t,e){let r=[-1,-1,-1],a=r,n=0,o=0,i=!1,s=!0;for(let c=0;c<12;c++){const h=F.nthVertex(t,c);if(h[0]<0)continue;const u=F.hueOf(h);i?(s||F.areInCyclicOrder(n,u,o))&&(s=!1,F.areInCyclicOrder(n,e,u)?(a=h,o=u):(r=h,n=u)):(r=h,a=h,n=u,o=u,i=!0)}return[r,a]}static midpoint(t,e){return[(t[0]+e[0])/2,(t[1]+e[1])/2,(t[2]+e[2])/2]}static criticalPlaneBelow(t){return Math.floor(t-.5)}static criticalPlaneAbove(t){return Math.ceil(t-.5)}static bisectToLimit(t,e){const r=F.bisectToSegment(t,e);let a=r[0],n=F.hueOf(a),o=r[1];for(let t=0;t<3;t++)if(a[t]!==o[t]){let r=-1,i=255;a[t]<o[t]?(r=F.criticalPlaneBelow(F.trueDelinearized(a[t])),i=F.criticalPlaneAbove(F.trueDelinearized(o[t]))):(r=F.criticalPlaneAbove(F.trueDelinearized(a[t])),i=F.criticalPlaneBelow(F.trueDelinearized(o[t])));for(let s=0;s<8&&!(Math.abs(i-r)<=1);s++){const s=Math.floor((r+i)/2),c=F.CRITICAL_PLANES[s],h=F.setCoordinate(a,c,o,t),u=F.hueOf(h);F.areInCyclicOrder(n,e,u)?(o=h,i=s):(a=h,n=u,r=s)}}return F.midpoint(a,o)}static inverseChromaticAdaptation(t){const e=Math.abs(t),r=Math.max(0,27.13*e/(400-e));return h(t)*Math.pow(r,1/.42)}static findResultByJ(t,e,r){let a=11*Math.sqrt(r);const n=x.DEFAULT,o=1/Math.pow(1.64-Math.pow(.29,n.n),.73),i=.25*(Math.cos(t+2)+3.8)*(5e4/13)*n.nc*n.ncb,s=Math.sin(t),c=Math.cos(t);for(let t=0;t<5;t++){const h=a/100,u=0===e||0===a?0:e/Math.sqrt(h),l=Math.pow(u*o,1/.9),d=n.aw*Math.pow(h,1/n.c/n.z)/n.nbb,g=23*(d+.305)*l/(23*i+11*l*c+108*l*s),f=g*c,y=g*s,p=(460*d+451*f+288*y)/1403,P=(460*d-891*f-261*y)/1403,C=(460*d-220*f-6300*y)/1403,w=m([F.inverseChromaticAdaptation(p),F.inverseChromaticAdaptation(P),F.inverseChromaticAdaptation(C)],F.LINRGB_FROM_SCALED_DISCOUNT);if(w[0]<0||w[1]<0||w[2]<0)return 0;const k=F.Y_FROM_LINRGB[0],M=F.Y_FROM_LINRGB[1],D=F.Y_FROM_LINRGB[2],v=k*w[0]+M*w[1]+D*w[2];if(v<=0)return 0;if(4===t||Math.abs(v-r)<.002)return w[0]>100.01||w[1]>100.01||w[2]>100.01?0:b(w);a-=(v-r)*a/(2*v)}return 0}static solveToInt(t,e,r){if(e<1e-4||r<1e-4||r>99.9999)return function(t){const e=A(M(t));return p(e,e,e)}(r);const a=(t=d(t))/180*Math.PI,n=M(r),o=F.findResultByJ(a,e,n);if(0!==o)return o;return b(F.bisectToLimit(n,a))}static solveToCam(t,e,r){return T.fromInt(F.solveToInt(t,e,r))}}F.SCALED_DISCOUNT_FROM_LINRGB=[[.001200833568784504,.002389694492170889,.0002795742885861124],[.0005891086651375999,.0029785502573438758,.0003270666104008398],[.00010146692491640572,.0005364214359186694,.0032979401770712076]],F.LINRGB_FROM_SCALED_DISCOUNT=[[1373.2198709594231,-1100.4251190754821,-7.278681089101213],[-271.815969077903,559.6580465940733,-32.46047482791194],[1.9622899599665666,-57.173814538844006,308.7233197812385]],F.Y_FROM_LINRGB=[.2126,.7152,.0722],F.CRITICAL_PLANES=[.015176349177441876,.045529047532325624,.07588174588720938,.10623444424209313,.13658714259697685,.16693984095186062,.19729253930674434,.2276452376616281,.2579979360165119,.28835063437139563,.3188300904430532,.350925934958123,.3848314933096426,.42057480301049466,.458183274052838,.4976837250274023,.5391024159806381,.5824650784040898,.6277969426914107,.6751227633498623,.7244668422128921,.775853049866786,.829304845476233,.8848452951698498,.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];
88
+ */class I{static sanitizeRadians(t){return(t+8*Math.PI)%(2*Math.PI)}static trueDelinearized(t){const e=t/100;let r=0;return r=e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055,255*r}static chromaticAdaptation(t){const e=Math.pow(Math.abs(t),.42);return 400*h(t)*e/(e+27.13)}static hueOf(t){const e=m(t,I.SCALED_DISCOUNT_FROM_LINRGB),r=I.chromaticAdaptation(e[0]),a=I.chromaticAdaptation(e[1]),n=I.chromaticAdaptation(e[2]),o=(11*r+-12*a+n)/11,i=(r+a-2*n)/9;return Math.atan2(i,o)}static areInCyclicOrder(t,e,r){return I.sanitizeRadians(e-t)<I.sanitizeRadians(r-t)}static intercept(t,e,r){return(e-t)/(r-t)}static lerpPoint(t,e,r){return[t[0]+(r[0]-t[0])*e,t[1]+(r[1]-t[1])*e,t[2]+(r[2]-t[2])*e]}static setCoordinate(t,e,r,a){const n=I.intercept(t[a],e,r[a]);return I.lerpPoint(t,n,r)}static isBounded(t){return 0<=t&&t<=100}static nthVertex(t,e){const r=I.Y_FROM_LINRGB[0],a=I.Y_FROM_LINRGB[1],n=I.Y_FROM_LINRGB[2],o=e%4<=1?0:100,i=e%2==0?0:100;if(e<4){const e=o,s=i,c=(t-e*a-s*n)/r;return I.isBounded(c)?[c,e,s]:[-1,-1,-1]}if(e<8){const e=o,s=i,c=(t-s*r-e*n)/a;return I.isBounded(c)?[s,c,e]:[-1,-1,-1]}{const e=o,s=i,c=(t-e*r-s*a)/n;return I.isBounded(c)?[e,s,c]:[-1,-1,-1]}}static bisectToSegment(t,e){let r=[-1,-1,-1],a=r,n=0,o=0,i=!1,s=!0;for(let c=0;c<12;c++){const h=I.nthVertex(t,c);if(h[0]<0)continue;const u=I.hueOf(h);i?(s||I.areInCyclicOrder(n,u,o))&&(s=!1,I.areInCyclicOrder(n,e,u)?(a=h,o=u):(r=h,n=u)):(r=h,a=h,n=u,o=u,i=!0)}return[r,a]}static midpoint(t,e){return[(t[0]+e[0])/2,(t[1]+e[1])/2,(t[2]+e[2])/2]}static criticalPlaneBelow(t){return Math.floor(t-.5)}static criticalPlaneAbove(t){return Math.ceil(t-.5)}static bisectToLimit(t,e){const r=I.bisectToSegment(t,e);let a=r[0],n=I.hueOf(a),o=r[1];for(let t=0;t<3;t++)if(a[t]!==o[t]){let r=-1,i=255;a[t]<o[t]?(r=I.criticalPlaneBelow(I.trueDelinearized(a[t])),i=I.criticalPlaneAbove(I.trueDelinearized(o[t]))):(r=I.criticalPlaneAbove(I.trueDelinearized(a[t])),i=I.criticalPlaneBelow(I.trueDelinearized(o[t])));for(let s=0;s<8&&!(Math.abs(i-r)<=1);s++){const s=Math.floor((r+i)/2),c=I.CRITICAL_PLANES[s],h=I.setCoordinate(a,c,o,t),u=I.hueOf(h);I.areInCyclicOrder(n,e,u)?(o=h,i=s):(a=h,n=u,r=s)}}return I.midpoint(a,o)}static inverseChromaticAdaptation(t){const e=Math.abs(t),r=Math.max(0,27.13*e/(400-e));return h(t)*Math.pow(r,1/.42)}static findResultByJ(t,e,r){let a=11*Math.sqrt(r);const n=x.DEFAULT,o=1/Math.pow(1.64-Math.pow(.29,n.n),.73),i=.25*(Math.cos(t+2)+3.8)*(5e4/13)*n.nc*n.ncb,s=Math.sin(t),c=Math.cos(t);for(let t=0;t<5;t++){const h=a/100,u=0===e||0===a?0:e/Math.sqrt(h),l=Math.pow(u*o,1/.9),d=n.aw*Math.pow(h,1/n.c/n.z)/n.nbb,g=23*(d+.305)*l/(23*i+11*l*c+108*l*s),f=g*c,y=g*s,p=(460*d+451*f+288*y)/1403,C=(460*d-891*f-261*y)/1403,P=(460*d-220*f-6300*y)/1403,w=m([I.inverseChromaticAdaptation(p),I.inverseChromaticAdaptation(C),I.inverseChromaticAdaptation(P)],I.LINRGB_FROM_SCALED_DISCOUNT);if(w[0]<0||w[1]<0||w[2]<0)return 0;const k=I.Y_FROM_LINRGB[0],M=I.Y_FROM_LINRGB[1],D=I.Y_FROM_LINRGB[2],A=k*w[0]+M*w[1]+D*w[2];if(A<=0)return 0;if(4===t||Math.abs(A-r)<.002)return w[0]>100.01||w[1]>100.01||w[2]>100.01?0:b(w);a-=(A-r)*a/(2*A)}return 0}static solveToInt(t,e,r){if(e<1e-4||r<1e-4||r>99.9999)return function(t){const e=v(M(t));return p(e,e,e)}(r);const a=(t=d(t))/180*Math.PI,n=M(r),o=I.findResultByJ(a,e,n);if(0!==o)return o;return b(I.bisectToLimit(n,a))}static solveToCam(t,e,r){return F.fromInt(I.solveToInt(t,e,r))}}I.SCALED_DISCOUNT_FROM_LINRGB=[[.001200833568784504,.002389694492170889,.0002795742885861124],[.0005891086651375999,.0029785502573438758,.0003270666104008398],[.00010146692491640572,.0005364214359186694,.0032979401770712076]],I.LINRGB_FROM_SCALED_DISCOUNT=[[1373.2198709594231,-1100.4251190754821,-7.278681089101213],[-271.815969077903,559.6580465940733,-32.46047482791194],[1.9622899599665666,-57.173814538844006,308.7233197812385]],I.Y_FROM_LINRGB=[.2126,.7152,.0722],I.CRITICAL_PLANES=[.015176349177441876,.045529047532325624,.07588174588720938,.10623444424209313,.13658714259697685,.16693984095186062,.19729253930674434,.2276452376616281,.2579979360165119,.28835063437139563,.3188300904430532,.350925934958123,.3848314933096426,.42057480301049466,.458183274052838,.4976837250274023,.5391024159806381,.5824650784040898,.6277969426914107,.6751227633498623,.7244668422128921,.775853049866786,.829304845476233,.8848452951698498,.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];
89
89
  /**
90
90
  * @license
91
91
  * Copyright 2021 Google LLC
@@ -102,7 +102,7 @@ class T{constructor(t,e,r,a,n,o,i,s,c){this.hue=t,this.chroma=e,this.j=r,this.q=
102
102
  * See the License for the specific language governing permissions and
103
103
  * limitations under the License.
104
104
  */
105
- class I{static from(t,e,r){return new I(F.solveToInt(t,e,r))}static fromInt(t){return new I(t)}toInt(){return this.argb}get hue(){return this.internalHue}set hue(t){this.setInternalState(F.solveToInt(t,this.internalChroma,this.internalTone))}get chroma(){return this.internalChroma}set chroma(t){this.setInternalState(F.solveToInt(this.internalHue,t,this.internalTone))}get tone(){return this.internalTone}set tone(t){this.setInternalState(F.solveToInt(this.internalHue,this.internalChroma,t))}constructor(t){this.argb=t;const e=T.fromInt(t);this.internalHue=e.hue,this.internalChroma=e.chroma,this.internalTone=k(t),this.argb=t}setInternalState(t){const e=T.fromInt(t);this.internalHue=e.hue,this.internalChroma=e.chroma,this.internalTone=k(t),this.argb=t}inViewingConditions(t){const e=T.fromInt(this.toInt()).xyzInViewingConditions(t),r=T.fromXyzInViewingConditions(e[0],e[1],e[2],x.make());return I.from(r.hue,r.chroma,D(e[1]))}}
105
+ class S{static from(t,e,r){return new S(I.solveToInt(t,e,r))}static fromInt(t){return new S(t)}toInt(){return this.argb}get hue(){return this.internalHue}set hue(t){this.setInternalState(I.solveToInt(t,this.internalChroma,this.internalTone))}get chroma(){return this.internalChroma}set chroma(t){this.setInternalState(I.solveToInt(this.internalHue,t,this.internalTone))}get tone(){return this.internalTone}set tone(t){this.setInternalState(I.solveToInt(this.internalHue,this.internalChroma,t))}constructor(t){this.argb=t;const e=F.fromInt(t);this.internalHue=e.hue,this.internalChroma=e.chroma,this.internalTone=k(t),this.argb=t}setInternalState(t){const e=F.fromInt(t);this.internalHue=e.hue,this.internalChroma=e.chroma,this.internalTone=k(t),this.argb=t}inViewingConditions(t){const e=F.fromInt(this.toInt()).xyzInViewingConditions(t),r=F.fromXyzInViewingConditions(e[0],e[1],e[2],x.make());return S.from(r.hue,r.chroma,D(e[1]))}}
106
106
  /**
107
107
  * @license
108
108
  * Copyright 2022 Google LLC
@@ -118,7 +118,7 @@ class I{static from(t,e,r){return new I(F.solveToInt(t,e,r))}static fromInt(t){r
118
118
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
119
119
  * See the License for the specific language governing permissions and
120
120
  * limitations under the License.
121
- */class S{static ratioOfTones(t,e){return t=l(0,100,t),e=l(0,100,e),S.ratioOfYs(M(t),M(e))}static ratioOfYs(t,e){const r=t>e?t:e;return(r+5)/((r===e?t:e)+5)}static lighter(t,e){if(t<0||t>100)return-1;const r=M(t),a=e*(r+5)-5,n=S.ratioOfYs(a,r),o=Math.abs(n-e);if(n<e&&o>.04)return-1;const i=D(a)+.4;return i<0||i>100?-1:i}static darker(t,e){if(t<0||t>100)return-1;const r=M(t),a=(r+5)/e-5,n=S.ratioOfYs(r,a),o=Math.abs(n-e);if(n<e&&o>.04)return-1;const i=D(a)-.4;return i<0||i>100?-1:i}static lighterUnsafe(t,e){const r=S.lighter(t,e);return r<0?100:r}static darkerUnsafe(t,e){const r=S.darker(t,e);return r<0?0:r}}
121
+ */class T{static ratioOfTones(t,e){return t=l(0,100,t),e=l(0,100,e),T.ratioOfYs(M(t),M(e))}static ratioOfYs(t,e){const r=t>e?t:e;return(r+5)/((r===e?t:e)+5)}static lighter(t,e){if(t<0||t>100)return-1;const r=M(t),a=e*(r+5)-5,n=T.ratioOfYs(a,r),o=Math.abs(n-e);if(n<e&&o>.04)return-1;const i=D(a)+.4;return i<0||i>100?-1:i}static darker(t,e){if(t<0||t>100)return-1;const r=M(t),a=(r+5)/e-5,n=T.ratioOfYs(r,a),o=Math.abs(n-e);if(n<e&&o>.04)return-1;const i=D(a)-.4;return i<0||i>100?-1:i}static lighterUnsafe(t,e){const r=T.lighter(t,e);return r<0?100:r}static darkerUnsafe(t,e){const r=T.darker(t,e);return r<0?0:r}}
122
122
  /**
123
123
  * @license
124
124
  * Copyright 2023 Google LLC
@@ -134,7 +134,7 @@ class I{static from(t,e,r){return new I(F.solveToInt(t,e,r))}static fromInt(t){r
134
134
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
135
135
  * See the License for the specific language governing permissions and
136
136
  * limitations under the License.
137
- */class L{static isDisliked(t){const e=Math.round(t.hue)>=90&&Math.round(t.hue)<=111,r=Math.round(t.chroma)>16,a=Math.round(t.tone)<65;return e&&r&&a}static fixIfDisliked(t){return L.isDisliked(t)?I.from(t.hue,t.chroma,70):t}}
137
+ */class L{static isDisliked(t){const e=Math.round(t.hue)>=90&&Math.round(t.hue)<=111,r=Math.round(t.chroma)>16,a=Math.round(t.tone)<65;return e&&r&&a}static fixIfDisliked(t){return L.isDisliked(t)?S.from(t.hue,t.chroma,70):t}}
138
138
  /**
139
139
  * @license
140
140
  * Copyright 2022 Google LLC
@@ -150,7 +150,7 @@ class I{static from(t,e,r){return new I(F.solveToInt(t,e,r))}static fromInt(t){r
150
150
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
151
151
  * See the License for the specific language governing permissions and
152
152
  * limitations under the License.
153
- */class B{static fromPalette(t){return new B(t.name??"",t.palette,t.tone,t.isBackground??!1,t.background,t.secondBackground,t.contrastCurve,t.toneDeltaPair)}constructor(t,e,r,a,n,o,i,s){if(this.name=t,this.palette=e,this.tone=r,this.isBackground=a,this.background=n,this.secondBackground=o,this.contrastCurve=i,this.toneDeltaPair=s,this.hctCache=new Map,!n&&o)throw new Error(`Color ${t} has secondBackgrounddefined, but background is not defined.`);if(!n&&i)throw new Error(`Color ${t} has contrastCurvedefined, but background is not defined.`);if(n&&!i)throw new Error(`Color ${t} has backgrounddefined, but contrastCurve is not defined.`)}getArgb(t){return this.getHct(t).toInt()}getHct(t){const e=this.hctCache.get(t);if(null!=e)return e;const r=this.getTone(t),a=this.palette(t).getHct(r);return this.hctCache.size>4&&this.hctCache.clear(),this.hctCache.set(t,a),a}getTone(t){const e=t.contrastLevel<0;if(this.toneDeltaPair){const r=this.toneDeltaPair(t),a=r.roleA,n=r.roleB,o=r.delta,i=r.polarity,s=r.stayTogether,c=this.background(t).getTone(t),h="nearer"===i||"lighter"===i&&!t.isDark||"darker"===i&&t.isDark,u=h?a:n,d=h?n:a,m=this.name===u.name,g=t.isDark?1:-1,f=u.contrastCurve.get(t.contrastLevel),y=d.contrastCurve.get(t.contrastLevel),p=u.tone(t);let b=S.ratioOfTones(c,p)>=f?p:B.foregroundTone(c,f);const P=d.tone(t);let C=S.ratioOfTones(c,P)>=y?P:B.foregroundTone(c,y);return e&&(b=B.foregroundTone(c,f),C=B.foregroundTone(c,y)),(C-b)*g>=o||(C=l(0,100,b+o*g),(C-b)*g>=o||(b=l(0,100,C-o*g))),50<=b&&b<60?g>0?(b=60,C=Math.max(C,b+o*g)):(b=49,C=Math.min(C,b+o*g)):50<=C&&C<60&&(s?g>0?(b=60,C=Math.max(C,b+o*g)):(b=49,C=Math.min(C,b+o*g)):C=g>0?60:49),m?b:C}{let r=this.tone(t);if(null==this.background)return r;const a=this.background(t).getTone(t),n=this.contrastCurve.get(t.contrastLevel);if(S.ratioOfTones(a,r)>=n||(r=B.foregroundTone(a,n)),e&&(r=B.foregroundTone(a,n)),this.isBackground&&50<=r&&r<60&&(r=S.ratioOfTones(49,a)>=n?49:60),this.secondBackground){const[e,a]=[this.background,this.secondBackground],[o,i]=[e(t).getTone(t),a(t).getTone(t)],[s,c]=[Math.max(o,i),Math.min(o,i)];if(S.ratioOfTones(s,r)>=n&&S.ratioOfTones(c,r)>=n)return r;const h=S.lighter(s,n),u=S.darker(c,n),l=[];-1!==h&&l.push(h),-1!==u&&l.push(u);return B.tonePrefersLightForeground(o)||B.tonePrefersLightForeground(i)?h<0?100:h:1===l.length?l[0]:u<0?0:u}return r}}static foregroundTone(t,e){const r=S.lighterUnsafe(t,e),a=S.darkerUnsafe(t,e),n=S.ratioOfTones(r,t),o=S.ratioOfTones(a,t);if(B.tonePrefersLightForeground(t)){const t=Math.abs(n-o)<.1&&n<e&&o<e;return n>=e||n>=o||t?r:a}return o>=e||o>=n?a:r}static tonePrefersLightForeground(t){return Math.round(t)<60}static toneAllowsLightForeground(t){return Math.round(t)<=49}static enableLightForeground(t){return B.tonePrefersLightForeground(t)&&!B.toneAllowsLightForeground(t)?49:t}}
153
+ */class B{static fromPalette(t){return new B(t.name??"",t.palette,t.tone,t.isBackground??!1,t.background,t.secondBackground,t.contrastCurve,t.toneDeltaPair)}constructor(t,e,r,a,n,o,i,s){if(this.name=t,this.palette=e,this.tone=r,this.isBackground=a,this.background=n,this.secondBackground=o,this.contrastCurve=i,this.toneDeltaPair=s,this.hctCache=new Map,!n&&o)throw new Error(`Color ${t} has secondBackgrounddefined, but background is not defined.`);if(!n&&i)throw new Error(`Color ${t} has contrastCurvedefined, but background is not defined.`);if(n&&!i)throw new Error(`Color ${t} has backgrounddefined, but contrastCurve is not defined.`)}getArgb(t){return this.getHct(t).toInt()}getHct(t){const e=this.hctCache.get(t);if(null!=e)return e;const r=this.getTone(t),a=this.palette(t).getHct(r);return this.hctCache.size>4&&this.hctCache.clear(),this.hctCache.set(t,a),a}getTone(t){const e=t.contrastLevel<0;if(this.toneDeltaPair){const r=this.toneDeltaPair(t),a=r.roleA,n=r.roleB,o=r.delta,i=r.polarity,s=r.stayTogether,c=this.background(t).getTone(t),h="nearer"===i||"lighter"===i&&!t.isDark||"darker"===i&&t.isDark,u=h?a:n,d=h?n:a,m=this.name===u.name,g=t.isDark?1:-1,f=u.contrastCurve.get(t.contrastLevel),y=d.contrastCurve.get(t.contrastLevel),p=u.tone(t);let b=T.ratioOfTones(c,p)>=f?p:B.foregroundTone(c,f);const C=d.tone(t);let P=T.ratioOfTones(c,C)>=y?C:B.foregroundTone(c,y);return e&&(b=B.foregroundTone(c,f),P=B.foregroundTone(c,y)),(P-b)*g>=o||(P=l(0,100,b+o*g),(P-b)*g>=o||(b=l(0,100,P-o*g))),50<=b&&b<60?g>0?(b=60,P=Math.max(P,b+o*g)):(b=49,P=Math.min(P,b+o*g)):50<=P&&P<60&&(s?g>0?(b=60,P=Math.max(P,b+o*g)):(b=49,P=Math.min(P,b+o*g)):P=g>0?60:49),m?b:P}{let r=this.tone(t);if(null==this.background)return r;const a=this.background(t).getTone(t),n=this.contrastCurve.get(t.contrastLevel);if(T.ratioOfTones(a,r)>=n||(r=B.foregroundTone(a,n)),e&&(r=B.foregroundTone(a,n)),this.isBackground&&50<=r&&r<60&&(r=T.ratioOfTones(49,a)>=n?49:60),this.secondBackground){const[e,a]=[this.background,this.secondBackground],[o,i]=[e(t).getTone(t),a(t).getTone(t)],[s,c]=[Math.max(o,i),Math.min(o,i)];if(T.ratioOfTones(s,r)>=n&&T.ratioOfTones(c,r)>=n)return r;const h=T.lighter(s,n),u=T.darker(c,n),l=[];-1!==h&&l.push(h),-1!==u&&l.push(u);return B.tonePrefersLightForeground(o)||B.tonePrefersLightForeground(i)?h<0?100:h:1===l.length?l[0]:u<0?0:u}return r}}static foregroundTone(t,e){const r=T.lighterUnsafe(t,e),a=T.darkerUnsafe(t,e),n=T.ratioOfTones(r,t),o=T.ratioOfTones(a,t);if(B.tonePrefersLightForeground(t)){const t=Math.abs(n-o)<.1&&n<e&&o<e;return n>=e||n>=o||t?r:a}return o>=e||o>=n?a:r}static tonePrefersLightForeground(t){return Math.round(t)<60}static toneAllowsLightForeground(t){return Math.round(t)<=49}static enableLightForeground(t){return B.tonePrefersLightForeground(t)&&!B.toneAllowsLightForeground(t)?49:t}}
154
154
  /**
155
155
  * @license
156
156
  * Copyright 2021 Google LLC
@@ -166,7 +166,7 @@ class I{static from(t,e,r){return new I(F.solveToInt(t,e,r))}static fromInt(t){r
166
166
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
167
167
  * See the License for the specific language governing permissions and
168
168
  * limitations under the License.
169
- */class E{static fromInt(t){const e=I.fromInt(t);return E.fromHct(e)}static fromHct(t){return new E(t.hue,t.chroma,t)}static fromHueAndChroma(t,e){const r=new R(t,e).create();return new E(t,e,r)}constructor(t,e,r){this.hue=t,this.chroma=e,this.keyColor=r,this.cache=new Map}tone(t){let e=this.cache.get(t);return void 0===e&&(e=I.from(this.hue,this.chroma,t).toInt(),this.cache.set(t,e)),e}getHct(t){return I.fromInt(this.tone(t))}}class R{constructor(t,e){this.hue=t,this.requestedChroma=e,this.chromaCache=new Map,this.maxChromaValue=200}create(){let t=0,e=100;for(;t<e;){const r=Math.floor((t+e)/2),a=this.maxChroma(r)<this.maxChroma(r+1);if(this.maxChroma(r)>=this.requestedChroma-.01)if(Math.abs(t-50)<Math.abs(e-50))e=r;else{if(t===r)return I.from(this.hue,this.requestedChroma,t);t=r}else a?t=r+1:e=r}return I.from(this.hue,this.requestedChroma,t)}maxChroma(t){if(this.chromaCache.has(t))return this.chromaCache.get(t);const e=I.from(this.hue,this.maxChromaValue,t).chroma;return this.chromaCache.set(t,e),e}}
169
+ */class R{static fromInt(t){const e=S.fromInt(t);return R.fromHct(e)}static fromHct(t){return new R(t.hue,t.chroma,t)}static fromHueAndChroma(t,e){const r=new E(t,e).create();return new R(t,e,r)}constructor(t,e,r){this.hue=t,this.chroma=e,this.keyColor=r,this.cache=new Map}tone(t){let e=this.cache.get(t);return void 0===e&&(e=S.from(this.hue,this.chroma,t).toInt(),this.cache.set(t,e)),e}getHct(t){return S.fromInt(this.tone(t))}}class E{constructor(t,e){this.hue=t,this.requestedChroma=e,this.chromaCache=new Map,this.maxChromaValue=200}create(){let t=0,e=100;for(;t<e;){const r=Math.floor((t+e)/2),a=this.maxChroma(r)<this.maxChroma(r+1);if(this.maxChroma(r)>=this.requestedChroma-.01)if(Math.abs(t-50)<Math.abs(e-50))e=r;else{if(t===r)return S.from(this.hue,this.requestedChroma,t);t=r}else a?t=r+1:e=r}return S.from(this.hue,this.requestedChroma,t)}maxChroma(t){if(this.chromaCache.has(t))return this.chromaCache.get(t);const e=S.from(this.hue,this.maxChromaValue,t).chroma;return this.chromaCache.set(t,e),e}}
170
170
  /**
171
171
  * @license
172
172
  * Copyright 2023 Google LLC
@@ -182,7 +182,7 @@ class I{static from(t,e,r){return new I(F.solveToInt(t,e,r))}static fromInt(t){r
182
182
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
183
183
  * See the License for the specific language governing permissions and
184
184
  * limitations under the License.
185
- */class O{constructor(t,e,r,a){this.low=t,this.normal=e,this.medium=r,this.high=a}get(t){return t<=-1?this.low:t<0?u(this.low,this.normal,(t- -1)/1):t<.5?u(this.normal,this.medium,(t-0)/.5):t<1?u(this.medium,this.high,(t-.5)/.5):this.high}}
185
+ */class V{constructor(t,e,r,a){this.low=t,this.normal=e,this.medium=r,this.high=a}get(t){return t<=-1?this.low:t<0?u(this.low,this.normal,(t- -1)/1):t<.5?u(this.normal,this.medium,(t-0)/.5):t<1?u(this.medium,this.high,(t-.5)/.5):this.high}}
186
186
  /**
187
187
  * @license
188
188
  * Copyright 2023 Google LLC
@@ -198,7 +198,7 @@ class I{static from(t,e,r){return new I(F.solveToInt(t,e,r))}static fromInt(t){r
198
198
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
199
199
  * See the License for the specific language governing permissions and
200
200
  * limitations under the License.
201
- */class V{constructor(t,e,r,a,n){this.roleA=t,this.roleB=e,this.delta=r,this.polarity=a,this.stayTogether=n}}
201
+ */class H{constructor(t,e,r,a,n){this.roleA=t,this.roleB=e,this.delta=r,this.polarity=a,this.stayTogether=n}}
202
202
  /**
203
203
  * @license
204
204
  * Copyright 2022 Google LLC
@@ -214,7 +214,7 @@ class I{static from(t,e,r){return new I(F.solveToInt(t,e,r))}static fromInt(t){r
214
214
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
215
215
  * See the License for the specific language governing permissions and
216
216
  * limitations under the License.
217
- */var H,N,z,q,U,$,j,K,Y,G;
217
+ */var O,N,z,q,U,$,K,Y,j,G;
218
218
  /**
219
219
  * @license
220
220
  * Copyright 2022 Google LLC
@@ -231,7 +231,7 @@ class I{static from(t,e,r){return new I(F.solveToInt(t,e,r))}static fromInt(t){r
231
231
  * See the License for the specific language governing permissions and
232
232
  * limitations under the License.
233
233
  */
234
- function W(t){return t.variant===H.FIDELITY||t.variant===H.CONTENT}function J(t){return t.variant===H.MONOCHROME}!function(t){t[t.MONOCHROME=0]="MONOCHROME",t[t.NEUTRAL=1]="NEUTRAL",t[t.TONAL_SPOT=2]="TONAL_SPOT",t[t.VIBRANT=3]="VIBRANT",t[t.EXPRESSIVE=4]="EXPRESSIVE",t[t.FIDELITY=5]="FIDELITY",t[t.CONTENT=6]="CONTENT",t[t.RAINBOW=7]="RAINBOW",t[t.FRUIT_SALAD=8]="FRUIT_SALAD"}(H||(H={}));class X{static highestSurface(t){return t.isDark?X.surfaceBright:X.surfaceDim}}X.contentAccentToneDelta=15,X.primaryPaletteKeyColor=B.fromPalette({name:"primary_palette_key_color",palette:t=>t.primaryPalette,tone:t=>t.primaryPalette.keyColor.tone}),X.secondaryPaletteKeyColor=B.fromPalette({name:"secondary_palette_key_color",palette:t=>t.secondaryPalette,tone:t=>t.secondaryPalette.keyColor.tone}),X.tertiaryPaletteKeyColor=B.fromPalette({name:"tertiary_palette_key_color",palette:t=>t.tertiaryPalette,tone:t=>t.tertiaryPalette.keyColor.tone}),X.neutralPaletteKeyColor=B.fromPalette({name:"neutral_palette_key_color",palette:t=>t.neutralPalette,tone:t=>t.neutralPalette.keyColor.tone}),X.neutralVariantPaletteKeyColor=B.fromPalette({name:"neutral_variant_palette_key_color",palette:t=>t.neutralVariantPalette,tone:t=>t.neutralVariantPalette.keyColor.tone}),X.background=B.fromPalette({name:"background",palette:t=>t.neutralPalette,tone:t=>t.isDark?6:98,isBackground:!0}),X.onBackground=B.fromPalette({name:"on_background",palette:t=>t.neutralPalette,tone:t=>t.isDark?90:10,background:t=>X.background,contrastCurve:new O(3,3,4.5,7)}),X.surface=B.fromPalette({name:"surface",palette:t=>t.neutralPalette,tone:t=>t.isDark?6:98,isBackground:!0}),X.surfaceDim=B.fromPalette({name:"surface_dim",palette:t=>t.neutralPalette,tone:t=>t.isDark?6:new O(87,87,80,75).get(t.contrastLevel),isBackground:!0}),X.surfaceBright=B.fromPalette({name:"surface_bright",palette:t=>t.neutralPalette,tone:t=>t.isDark?new O(24,24,29,34).get(t.contrastLevel):98,isBackground:!0}),X.surfaceContainerLowest=B.fromPalette({name:"surface_container_lowest",palette:t=>t.neutralPalette,tone:t=>t.isDark?new O(4,4,2,0).get(t.contrastLevel):100,isBackground:!0}),X.surfaceContainerLow=B.fromPalette({name:"surface_container_low",palette:t=>t.neutralPalette,tone:t=>t.isDark?new O(10,10,11,12).get(t.contrastLevel):new O(96,96,96,95).get(t.contrastLevel),isBackground:!0}),X.surfaceContainer=B.fromPalette({name:"surface_container",palette:t=>t.neutralPalette,tone:t=>t.isDark?new O(12,12,16,20).get(t.contrastLevel):new O(94,94,92,90).get(t.contrastLevel),isBackground:!0}),X.surfaceContainerHigh=B.fromPalette({name:"surface_container_high",palette:t=>t.neutralPalette,tone:t=>t.isDark?new O(17,17,21,25).get(t.contrastLevel):new O(92,92,88,85).get(t.contrastLevel),isBackground:!0}),X.surfaceContainerHighest=B.fromPalette({name:"surface_container_highest",palette:t=>t.neutralPalette,tone:t=>t.isDark?new O(22,22,26,30).get(t.contrastLevel):new O(90,90,84,80).get(t.contrastLevel),isBackground:!0}),X.onSurface=B.fromPalette({name:"on_surface",palette:t=>t.neutralPalette,tone:t=>t.isDark?90:10,background:t=>X.highestSurface(t),contrastCurve:new O(4.5,7,11,21)}),X.surfaceVariant=B.fromPalette({name:"surface_variant",palette:t=>t.neutralVariantPalette,tone:t=>t.isDark?30:90,isBackground:!0}),X.onSurfaceVariant=B.fromPalette({name:"on_surface_variant",palette:t=>t.neutralVariantPalette,tone:t=>t.isDark?80:30,background:t=>X.highestSurface(t),contrastCurve:new O(3,4.5,7,11)}),X.inverseSurface=B.fromPalette({name:"inverse_surface",palette:t=>t.neutralPalette,tone:t=>t.isDark?90:20}),X.inverseOnSurface=B.fromPalette({name:"inverse_on_surface",palette:t=>t.neutralPalette,tone:t=>t.isDark?20:95,background:t=>X.inverseSurface,contrastCurve:new O(4.5,7,11,21)}),X.outline=B.fromPalette({name:"outline",palette:t=>t.neutralVariantPalette,tone:t=>t.isDark?60:50,background:t=>X.highestSurface(t),contrastCurve:new O(1.5,3,4.5,7)}),X.outlineVariant=B.fromPalette({name:"outline_variant",palette:t=>t.neutralVariantPalette,tone:t=>t.isDark?30:80,background:t=>X.highestSurface(t),contrastCurve:new O(1,1,3,4.5)}),X.shadow=B.fromPalette({name:"shadow",palette:t=>t.neutralPalette,tone:t=>0}),X.scrim=B.fromPalette({name:"scrim",palette:t=>t.neutralPalette,tone:t=>0}),X.surfaceTint=B.fromPalette({name:"surface_tint",palette:t=>t.primaryPalette,tone:t=>t.isDark?80:40,isBackground:!0}),X.primary=B.fromPalette({name:"primary",palette:t=>t.primaryPalette,tone:t=>J(t)?t.isDark?100:0:t.isDark?80:40,isBackground:!0,background:t=>X.highestSurface(t),contrastCurve:new O(3,4.5,7,7),toneDeltaPair:t=>new V(X.primaryContainer,X.primary,10,"nearer",!1)}),X.onPrimary=B.fromPalette({name:"on_primary",palette:t=>t.primaryPalette,tone:t=>J(t)?t.isDark?10:90:t.isDark?20:100,background:t=>X.primary,contrastCurve:new O(4.5,7,11,21)}),X.primaryContainer=B.fromPalette({name:"primary_container",palette:t=>t.primaryPalette,tone:t=>W(t)?t.sourceColorHct.tone:J(t)?t.isDark?85:25:t.isDark?30:90,isBackground:!0,background:t=>X.highestSurface(t),contrastCurve:new O(1,1,3,4.5),toneDeltaPair:t=>new V(X.primaryContainer,X.primary,10,"nearer",!1)}),X.onPrimaryContainer=B.fromPalette({name:"on_primary_container",palette:t=>t.primaryPalette,tone:t=>W(t)?B.foregroundTone(X.primaryContainer.tone(t),4.5):J(t)?t.isDark?0:100:t.isDark?90:30,background:t=>X.primaryContainer,contrastCurve:new O(3,4.5,7,11)}),X.inversePrimary=B.fromPalette({name:"inverse_primary",palette:t=>t.primaryPalette,tone:t=>t.isDark?40:80,background:t=>X.inverseSurface,contrastCurve:new O(3,4.5,7,7)}),X.secondary=B.fromPalette({name:"secondary",palette:t=>t.secondaryPalette,tone:t=>t.isDark?80:40,isBackground:!0,background:t=>X.highestSurface(t),contrastCurve:new O(3,4.5,7,7),toneDeltaPair:t=>new V(X.secondaryContainer,X.secondary,10,"nearer",!1)}),X.onSecondary=B.fromPalette({name:"on_secondary",palette:t=>t.secondaryPalette,tone:t=>J(t)?t.isDark?10:100:t.isDark?20:100,background:t=>X.secondary,contrastCurve:new O(4.5,7,11,21)}),X.secondaryContainer=B.fromPalette({name:"secondary_container",palette:t=>t.secondaryPalette,tone:t=>{const e=t.isDark?30:90;return J(t)?t.isDark?30:85:W(t)?function(t,e,r,a){let n=r,o=I.from(t,e,r);if(o.chroma<e){let r=o.chroma;for(;o.chroma<e;){n+=a?-1:1;const i=I.from(t,e,n);if(r>i.chroma)break;if(Math.abs(i.chroma-e)<.4)break;Math.abs(i.chroma-e)<Math.abs(o.chroma-e)&&(o=i),r=Math.max(r,i.chroma)}}return n}(t.secondaryPalette.hue,t.secondaryPalette.chroma,e,!t.isDark):e},isBackground:!0,background:t=>X.highestSurface(t),contrastCurve:new O(1,1,3,4.5),toneDeltaPair:t=>new V(X.secondaryContainer,X.secondary,10,"nearer",!1)}),X.onSecondaryContainer=B.fromPalette({name:"on_secondary_container",palette:t=>t.secondaryPalette,tone:t=>J(t)?t.isDark?90:10:W(t)?B.foregroundTone(X.secondaryContainer.tone(t),4.5):t.isDark?90:30,background:t=>X.secondaryContainer,contrastCurve:new O(3,4.5,7,11)}),X.tertiary=B.fromPalette({name:"tertiary",palette:t=>t.tertiaryPalette,tone:t=>J(t)?t.isDark?90:25:t.isDark?80:40,isBackground:!0,background:t=>X.highestSurface(t),contrastCurve:new O(3,4.5,7,7),toneDeltaPair:t=>new V(X.tertiaryContainer,X.tertiary,10,"nearer",!1)}),X.onTertiary=B.fromPalette({name:"on_tertiary",palette:t=>t.tertiaryPalette,tone:t=>J(t)?t.isDark?10:90:t.isDark?20:100,background:t=>X.tertiary,contrastCurve:new O(4.5,7,11,21)}),X.tertiaryContainer=B.fromPalette({name:"tertiary_container",palette:t=>t.tertiaryPalette,tone:t=>{if(J(t))return t.isDark?60:49;if(!W(t))return t.isDark?30:90;const e=t.tertiaryPalette.getHct(t.sourceColorHct.tone);return L.fixIfDisliked(e).tone},isBackground:!0,background:t=>X.highestSurface(t),contrastCurve:new O(1,1,3,4.5),toneDeltaPair:t=>new V(X.tertiaryContainer,X.tertiary,10,"nearer",!1)}),X.onTertiaryContainer=B.fromPalette({name:"on_tertiary_container",palette:t=>t.tertiaryPalette,tone:t=>J(t)?t.isDark?0:100:W(t)?B.foregroundTone(X.tertiaryContainer.tone(t),4.5):t.isDark?90:30,background:t=>X.tertiaryContainer,contrastCurve:new O(3,4.5,7,11)}),X.error=B.fromPalette({name:"error",palette:t=>t.errorPalette,tone:t=>t.isDark?80:40,isBackground:!0,background:t=>X.highestSurface(t),contrastCurve:new O(3,4.5,7,7),toneDeltaPair:t=>new V(X.errorContainer,X.error,10,"nearer",!1)}),X.onError=B.fromPalette({name:"on_error",palette:t=>t.errorPalette,tone:t=>t.isDark?20:100,background:t=>X.error,contrastCurve:new O(4.5,7,11,21)}),X.errorContainer=B.fromPalette({name:"error_container",palette:t=>t.errorPalette,tone:t=>t.isDark?30:90,isBackground:!0,background:t=>X.highestSurface(t),contrastCurve:new O(1,1,3,4.5),toneDeltaPair:t=>new V(X.errorContainer,X.error,10,"nearer",!1)}),X.onErrorContainer=B.fromPalette({name:"on_error_container",palette:t=>t.errorPalette,tone:t=>J(t)?t.isDark?90:10:t.isDark?90:30,background:t=>X.errorContainer,contrastCurve:new O(3,4.5,7,11)}),X.primaryFixed=B.fromPalette({name:"primary_fixed",palette:t=>t.primaryPalette,tone:t=>J(t)?40:90,isBackground:!0,background:t=>X.highestSurface(t),contrastCurve:new O(1,1,3,4.5),toneDeltaPair:t=>new V(X.primaryFixed,X.primaryFixedDim,10,"lighter",!0)}),X.primaryFixedDim=B.fromPalette({name:"primary_fixed_dim",palette:t=>t.primaryPalette,tone:t=>J(t)?30:80,isBackground:!0,background:t=>X.highestSurface(t),contrastCurve:new O(1,1,3,4.5),toneDeltaPair:t=>new V(X.primaryFixed,X.primaryFixedDim,10,"lighter",!0)}),X.onPrimaryFixed=B.fromPalette({name:"on_primary_fixed",palette:t=>t.primaryPalette,tone:t=>J(t)?100:10,background:t=>X.primaryFixedDim,secondBackground:t=>X.primaryFixed,contrastCurve:new O(4.5,7,11,21)}),X.onPrimaryFixedVariant=B.fromPalette({name:"on_primary_fixed_variant",palette:t=>t.primaryPalette,tone:t=>J(t)?90:30,background:t=>X.primaryFixedDim,secondBackground:t=>X.primaryFixed,contrastCurve:new O(3,4.5,7,11)}),X.secondaryFixed=B.fromPalette({name:"secondary_fixed",palette:t=>t.secondaryPalette,tone:t=>J(t)?80:90,isBackground:!0,background:t=>X.highestSurface(t),contrastCurve:new O(1,1,3,4.5),toneDeltaPair:t=>new V(X.secondaryFixed,X.secondaryFixedDim,10,"lighter",!0)}),X.secondaryFixedDim=B.fromPalette({name:"secondary_fixed_dim",palette:t=>t.secondaryPalette,tone:t=>J(t)?70:80,isBackground:!0,background:t=>X.highestSurface(t),contrastCurve:new O(1,1,3,4.5),toneDeltaPair:t=>new V(X.secondaryFixed,X.secondaryFixedDim,10,"lighter",!0)}),X.onSecondaryFixed=B.fromPalette({name:"on_secondary_fixed",palette:t=>t.secondaryPalette,tone:t=>10,background:t=>X.secondaryFixedDim,secondBackground:t=>X.secondaryFixed,contrastCurve:new O(4.5,7,11,21)}),X.onSecondaryFixedVariant=B.fromPalette({name:"on_secondary_fixed_variant",palette:t=>t.secondaryPalette,tone:t=>J(t)?25:30,background:t=>X.secondaryFixedDim,secondBackground:t=>X.secondaryFixed,contrastCurve:new O(3,4.5,7,11)}),X.tertiaryFixed=B.fromPalette({name:"tertiary_fixed",palette:t=>t.tertiaryPalette,tone:t=>J(t)?40:90,isBackground:!0,background:t=>X.highestSurface(t),contrastCurve:new O(1,1,3,4.5),toneDeltaPair:t=>new V(X.tertiaryFixed,X.tertiaryFixedDim,10,"lighter",!0)}),X.tertiaryFixedDim=B.fromPalette({name:"tertiary_fixed_dim",palette:t=>t.tertiaryPalette,tone:t=>J(t)?30:80,isBackground:!0,background:t=>X.highestSurface(t),contrastCurve:new O(1,1,3,4.5),toneDeltaPair:t=>new V(X.tertiaryFixed,X.tertiaryFixedDim,10,"lighter",!0)}),X.onTertiaryFixed=B.fromPalette({name:"on_tertiary_fixed",palette:t=>t.tertiaryPalette,tone:t=>J(t)?100:10,background:t=>X.tertiaryFixedDim,secondBackground:t=>X.tertiaryFixed,contrastCurve:new O(4.5,7,11,21)}),X.onTertiaryFixedVariant=B.fromPalette({name:"on_tertiary_fixed_variant",palette:t=>t.tertiaryPalette,tone:t=>J(t)?90:30,background:t=>X.tertiaryFixedDim,secondBackground:t=>X.tertiaryFixed,contrastCurve:new O(3,4.5,7,11)});
234
+ function W(t){return t.variant===O.FIDELITY||t.variant===O.CONTENT}function J(t){return t.variant===O.MONOCHROME}!function(t){t[t.MONOCHROME=0]="MONOCHROME",t[t.NEUTRAL=1]="NEUTRAL",t[t.TONAL_SPOT=2]="TONAL_SPOT",t[t.VIBRANT=3]="VIBRANT",t[t.EXPRESSIVE=4]="EXPRESSIVE",t[t.FIDELITY=5]="FIDELITY",t[t.CONTENT=6]="CONTENT",t[t.RAINBOW=7]="RAINBOW",t[t.FRUIT_SALAD=8]="FRUIT_SALAD"}(O||(O={}));class X{static highestSurface(t){return t.isDark?X.surfaceBright:X.surfaceDim}}X.contentAccentToneDelta=15,X.primaryPaletteKeyColor=B.fromPalette({name:"primary_palette_key_color",palette:t=>t.primaryPalette,tone:t=>t.primaryPalette.keyColor.tone}),X.secondaryPaletteKeyColor=B.fromPalette({name:"secondary_palette_key_color",palette:t=>t.secondaryPalette,tone:t=>t.secondaryPalette.keyColor.tone}),X.tertiaryPaletteKeyColor=B.fromPalette({name:"tertiary_palette_key_color",palette:t=>t.tertiaryPalette,tone:t=>t.tertiaryPalette.keyColor.tone}),X.neutralPaletteKeyColor=B.fromPalette({name:"neutral_palette_key_color",palette:t=>t.neutralPalette,tone:t=>t.neutralPalette.keyColor.tone}),X.neutralVariantPaletteKeyColor=B.fromPalette({name:"neutral_variant_palette_key_color",palette:t=>t.neutralVariantPalette,tone:t=>t.neutralVariantPalette.keyColor.tone}),X.background=B.fromPalette({name:"background",palette:t=>t.neutralPalette,tone:t=>t.isDark?6:98,isBackground:!0}),X.onBackground=B.fromPalette({name:"on_background",palette:t=>t.neutralPalette,tone:t=>t.isDark?90:10,background:t=>X.background,contrastCurve:new V(3,3,4.5,7)}),X.surface=B.fromPalette({name:"surface",palette:t=>t.neutralPalette,tone:t=>t.isDark?6:98,isBackground:!0}),X.surfaceDim=B.fromPalette({name:"surface_dim",palette:t=>t.neutralPalette,tone:t=>t.isDark?6:new V(87,87,80,75).get(t.contrastLevel),isBackground:!0}),X.surfaceBright=B.fromPalette({name:"surface_bright",palette:t=>t.neutralPalette,tone:t=>t.isDark?new V(24,24,29,34).get(t.contrastLevel):98,isBackground:!0}),X.surfaceContainerLowest=B.fromPalette({name:"surface_container_lowest",palette:t=>t.neutralPalette,tone:t=>t.isDark?new V(4,4,2,0).get(t.contrastLevel):100,isBackground:!0}),X.surfaceContainerLow=B.fromPalette({name:"surface_container_low",palette:t=>t.neutralPalette,tone:t=>t.isDark?new V(10,10,11,12).get(t.contrastLevel):new V(96,96,96,95).get(t.contrastLevel),isBackground:!0}),X.surfaceContainer=B.fromPalette({name:"surface_container",palette:t=>t.neutralPalette,tone:t=>t.isDark?new V(12,12,16,20).get(t.contrastLevel):new V(94,94,92,90).get(t.contrastLevel),isBackground:!0}),X.surfaceContainerHigh=B.fromPalette({name:"surface_container_high",palette:t=>t.neutralPalette,tone:t=>t.isDark?new V(17,17,21,25).get(t.contrastLevel):new V(92,92,88,85).get(t.contrastLevel),isBackground:!0}),X.surfaceContainerHighest=B.fromPalette({name:"surface_container_highest",palette:t=>t.neutralPalette,tone:t=>t.isDark?new V(22,22,26,30).get(t.contrastLevel):new V(90,90,84,80).get(t.contrastLevel),isBackground:!0}),X.onSurface=B.fromPalette({name:"on_surface",palette:t=>t.neutralPalette,tone:t=>t.isDark?90:10,background:t=>X.highestSurface(t),contrastCurve:new V(4.5,7,11,21)}),X.surfaceVariant=B.fromPalette({name:"surface_variant",palette:t=>t.neutralVariantPalette,tone:t=>t.isDark?30:90,isBackground:!0}),X.onSurfaceVariant=B.fromPalette({name:"on_surface_variant",palette:t=>t.neutralVariantPalette,tone:t=>t.isDark?80:30,background:t=>X.highestSurface(t),contrastCurve:new V(3,4.5,7,11)}),X.inverseSurface=B.fromPalette({name:"inverse_surface",palette:t=>t.neutralPalette,tone:t=>t.isDark?90:20}),X.inverseOnSurface=B.fromPalette({name:"inverse_on_surface",palette:t=>t.neutralPalette,tone:t=>t.isDark?20:95,background:t=>X.inverseSurface,contrastCurve:new V(4.5,7,11,21)}),X.outline=B.fromPalette({name:"outline",palette:t=>t.neutralVariantPalette,tone:t=>t.isDark?60:50,background:t=>X.highestSurface(t),contrastCurve:new V(1.5,3,4.5,7)}),X.outlineVariant=B.fromPalette({name:"outline_variant",palette:t=>t.neutralVariantPalette,tone:t=>t.isDark?30:80,background:t=>X.highestSurface(t),contrastCurve:new V(1,1,3,4.5)}),X.shadow=B.fromPalette({name:"shadow",palette:t=>t.neutralPalette,tone:t=>0}),X.scrim=B.fromPalette({name:"scrim",palette:t=>t.neutralPalette,tone:t=>0}),X.surfaceTint=B.fromPalette({name:"surface_tint",palette:t=>t.primaryPalette,tone:t=>t.isDark?80:40,isBackground:!0}),X.primary=B.fromPalette({name:"primary",palette:t=>t.primaryPalette,tone:t=>J(t)?t.isDark?100:0:t.isDark?80:40,isBackground:!0,background:t=>X.highestSurface(t),contrastCurve:new V(3,4.5,7,7),toneDeltaPair:t=>new H(X.primaryContainer,X.primary,10,"nearer",!1)}),X.onPrimary=B.fromPalette({name:"on_primary",palette:t=>t.primaryPalette,tone:t=>J(t)?t.isDark?10:90:t.isDark?20:100,background:t=>X.primary,contrastCurve:new V(4.5,7,11,21)}),X.primaryContainer=B.fromPalette({name:"primary_container",palette:t=>t.primaryPalette,tone:t=>W(t)?t.sourceColorHct.tone:J(t)?t.isDark?85:25:t.isDark?30:90,isBackground:!0,background:t=>X.highestSurface(t),contrastCurve:new V(1,1,3,4.5),toneDeltaPair:t=>new H(X.primaryContainer,X.primary,10,"nearer",!1)}),X.onPrimaryContainer=B.fromPalette({name:"on_primary_container",palette:t=>t.primaryPalette,tone:t=>W(t)?B.foregroundTone(X.primaryContainer.tone(t),4.5):J(t)?t.isDark?0:100:t.isDark?90:30,background:t=>X.primaryContainer,contrastCurve:new V(3,4.5,7,11)}),X.inversePrimary=B.fromPalette({name:"inverse_primary",palette:t=>t.primaryPalette,tone:t=>t.isDark?40:80,background:t=>X.inverseSurface,contrastCurve:new V(3,4.5,7,7)}),X.secondary=B.fromPalette({name:"secondary",palette:t=>t.secondaryPalette,tone:t=>t.isDark?80:40,isBackground:!0,background:t=>X.highestSurface(t),contrastCurve:new V(3,4.5,7,7),toneDeltaPair:t=>new H(X.secondaryContainer,X.secondary,10,"nearer",!1)}),X.onSecondary=B.fromPalette({name:"on_secondary",palette:t=>t.secondaryPalette,tone:t=>J(t)?t.isDark?10:100:t.isDark?20:100,background:t=>X.secondary,contrastCurve:new V(4.5,7,11,21)}),X.secondaryContainer=B.fromPalette({name:"secondary_container",palette:t=>t.secondaryPalette,tone:t=>{const e=t.isDark?30:90;return J(t)?t.isDark?30:85:W(t)?function(t,e,r,a){let n=r,o=S.from(t,e,r);if(o.chroma<e){let r=o.chroma;for(;o.chroma<e;){n+=a?-1:1;const i=S.from(t,e,n);if(r>i.chroma)break;if(Math.abs(i.chroma-e)<.4)break;Math.abs(i.chroma-e)<Math.abs(o.chroma-e)&&(o=i),r=Math.max(r,i.chroma)}}return n}(t.secondaryPalette.hue,t.secondaryPalette.chroma,e,!t.isDark):e},isBackground:!0,background:t=>X.highestSurface(t),contrastCurve:new V(1,1,3,4.5),toneDeltaPair:t=>new H(X.secondaryContainer,X.secondary,10,"nearer",!1)}),X.onSecondaryContainer=B.fromPalette({name:"on_secondary_container",palette:t=>t.secondaryPalette,tone:t=>J(t)?t.isDark?90:10:W(t)?B.foregroundTone(X.secondaryContainer.tone(t),4.5):t.isDark?90:30,background:t=>X.secondaryContainer,contrastCurve:new V(3,4.5,7,11)}),X.tertiary=B.fromPalette({name:"tertiary",palette:t=>t.tertiaryPalette,tone:t=>J(t)?t.isDark?90:25:t.isDark?80:40,isBackground:!0,background:t=>X.highestSurface(t),contrastCurve:new V(3,4.5,7,7),toneDeltaPair:t=>new H(X.tertiaryContainer,X.tertiary,10,"nearer",!1)}),X.onTertiary=B.fromPalette({name:"on_tertiary",palette:t=>t.tertiaryPalette,tone:t=>J(t)?t.isDark?10:90:t.isDark?20:100,background:t=>X.tertiary,contrastCurve:new V(4.5,7,11,21)}),X.tertiaryContainer=B.fromPalette({name:"tertiary_container",palette:t=>t.tertiaryPalette,tone:t=>{if(J(t))return t.isDark?60:49;if(!W(t))return t.isDark?30:90;const e=t.tertiaryPalette.getHct(t.sourceColorHct.tone);return L.fixIfDisliked(e).tone},isBackground:!0,background:t=>X.highestSurface(t),contrastCurve:new V(1,1,3,4.5),toneDeltaPair:t=>new H(X.tertiaryContainer,X.tertiary,10,"nearer",!1)}),X.onTertiaryContainer=B.fromPalette({name:"on_tertiary_container",palette:t=>t.tertiaryPalette,tone:t=>J(t)?t.isDark?0:100:W(t)?B.foregroundTone(X.tertiaryContainer.tone(t),4.5):t.isDark?90:30,background:t=>X.tertiaryContainer,contrastCurve:new V(3,4.5,7,11)}),X.error=B.fromPalette({name:"error",palette:t=>t.errorPalette,tone:t=>t.isDark?80:40,isBackground:!0,background:t=>X.highestSurface(t),contrastCurve:new V(3,4.5,7,7),toneDeltaPair:t=>new H(X.errorContainer,X.error,10,"nearer",!1)}),X.onError=B.fromPalette({name:"on_error",palette:t=>t.errorPalette,tone:t=>t.isDark?20:100,background:t=>X.error,contrastCurve:new V(4.5,7,11,21)}),X.errorContainer=B.fromPalette({name:"error_container",palette:t=>t.errorPalette,tone:t=>t.isDark?30:90,isBackground:!0,background:t=>X.highestSurface(t),contrastCurve:new V(1,1,3,4.5),toneDeltaPair:t=>new H(X.errorContainer,X.error,10,"nearer",!1)}),X.onErrorContainer=B.fromPalette({name:"on_error_container",palette:t=>t.errorPalette,tone:t=>J(t)?t.isDark?90:10:t.isDark?90:30,background:t=>X.errorContainer,contrastCurve:new V(3,4.5,7,11)}),X.primaryFixed=B.fromPalette({name:"primary_fixed",palette:t=>t.primaryPalette,tone:t=>J(t)?40:90,isBackground:!0,background:t=>X.highestSurface(t),contrastCurve:new V(1,1,3,4.5),toneDeltaPair:t=>new H(X.primaryFixed,X.primaryFixedDim,10,"lighter",!0)}),X.primaryFixedDim=B.fromPalette({name:"primary_fixed_dim",palette:t=>t.primaryPalette,tone:t=>J(t)?30:80,isBackground:!0,background:t=>X.highestSurface(t),contrastCurve:new V(1,1,3,4.5),toneDeltaPair:t=>new H(X.primaryFixed,X.primaryFixedDim,10,"lighter",!0)}),X.onPrimaryFixed=B.fromPalette({name:"on_primary_fixed",palette:t=>t.primaryPalette,tone:t=>J(t)?100:10,background:t=>X.primaryFixedDim,secondBackground:t=>X.primaryFixed,contrastCurve:new V(4.5,7,11,21)}),X.onPrimaryFixedVariant=B.fromPalette({name:"on_primary_fixed_variant",palette:t=>t.primaryPalette,tone:t=>J(t)?90:30,background:t=>X.primaryFixedDim,secondBackground:t=>X.primaryFixed,contrastCurve:new V(3,4.5,7,11)}),X.secondaryFixed=B.fromPalette({name:"secondary_fixed",palette:t=>t.secondaryPalette,tone:t=>J(t)?80:90,isBackground:!0,background:t=>X.highestSurface(t),contrastCurve:new V(1,1,3,4.5),toneDeltaPair:t=>new H(X.secondaryFixed,X.secondaryFixedDim,10,"lighter",!0)}),X.secondaryFixedDim=B.fromPalette({name:"secondary_fixed_dim",palette:t=>t.secondaryPalette,tone:t=>J(t)?70:80,isBackground:!0,background:t=>X.highestSurface(t),contrastCurve:new V(1,1,3,4.5),toneDeltaPair:t=>new H(X.secondaryFixed,X.secondaryFixedDim,10,"lighter",!0)}),X.onSecondaryFixed=B.fromPalette({name:"on_secondary_fixed",palette:t=>t.secondaryPalette,tone:t=>10,background:t=>X.secondaryFixedDim,secondBackground:t=>X.secondaryFixed,contrastCurve:new V(4.5,7,11,21)}),X.onSecondaryFixedVariant=B.fromPalette({name:"on_secondary_fixed_variant",palette:t=>t.secondaryPalette,tone:t=>J(t)?25:30,background:t=>X.secondaryFixedDim,secondBackground:t=>X.secondaryFixed,contrastCurve:new V(3,4.5,7,11)}),X.tertiaryFixed=B.fromPalette({name:"tertiary_fixed",palette:t=>t.tertiaryPalette,tone:t=>J(t)?40:90,isBackground:!0,background:t=>X.highestSurface(t),contrastCurve:new V(1,1,3,4.5),toneDeltaPair:t=>new H(X.tertiaryFixed,X.tertiaryFixedDim,10,"lighter",!0)}),X.tertiaryFixedDim=B.fromPalette({name:"tertiary_fixed_dim",palette:t=>t.tertiaryPalette,tone:t=>J(t)?30:80,isBackground:!0,background:t=>X.highestSurface(t),contrastCurve:new V(1,1,3,4.5),toneDeltaPair:t=>new H(X.tertiaryFixed,X.tertiaryFixedDim,10,"lighter",!0)}),X.onTertiaryFixed=B.fromPalette({name:"on_tertiary_fixed",palette:t=>t.tertiaryPalette,tone:t=>J(t)?100:10,background:t=>X.tertiaryFixedDim,secondBackground:t=>X.tertiaryFixed,contrastCurve:new V(4.5,7,11,21)}),X.onTertiaryFixedVariant=B.fromPalette({name:"on_tertiary_fixed_variant",palette:t=>t.tertiaryPalette,tone:t=>J(t)?90:30,background:t=>X.tertiaryFixedDim,secondBackground:t=>X.tertiaryFixed,contrastCurve:new V(3,4.5,7,11)});
235
235
  /**
236
236
  * @license
237
237
  * Copyright 2022 Google LLC
@@ -248,7 +248,7 @@ function W(t){return t.variant===H.FIDELITY||t.variant===H.CONTENT}function J(t)
248
248
  * See the License for the specific language governing permissions and
249
249
  * limitations under the License.
250
250
  */
251
- class Z{constructor(t){this.sourceColorArgb=t.sourceColorArgb,this.variant=t.variant,this.contrastLevel=t.contrastLevel,this.isDark=t.isDark,this.sourceColorHct=I.fromInt(t.sourceColorArgb),this.primaryPalette=t.primaryPalette,this.secondaryPalette=t.secondaryPalette,this.tertiaryPalette=t.tertiaryPalette,this.neutralPalette=t.neutralPalette,this.neutralVariantPalette=t.neutralVariantPalette,this.errorPalette=E.fromHueAndChroma(25,84)}static getRotatedHue(t,e,r){const a=t.hue;if(e.length!==r.length)throw new Error(`mismatch between hue length ${e.length} & rotations ${r.length}`);if(1===r.length)return d(t.hue+r[0]);const n=e.length;for(let t=0;t<=n-2;t++){const n=e[t],o=e[t+1];if(n<a&&a<o)return d(a+r[t])}return a}getArgb(t){return t.getArgb(this)}getHct(t){return t.getHct(this)}get primaryPaletteKeyColor(){return this.getArgb(X.primaryPaletteKeyColor)}get secondaryPaletteKeyColor(){return this.getArgb(X.secondaryPaletteKeyColor)}get tertiaryPaletteKeyColor(){return this.getArgb(X.tertiaryPaletteKeyColor)}get neutralPaletteKeyColor(){return this.getArgb(X.neutralPaletteKeyColor)}get neutralVariantPaletteKeyColor(){return this.getArgb(X.neutralVariantPaletteKeyColor)}get background(){return this.getArgb(X.background)}get onBackground(){return this.getArgb(X.onBackground)}get surface(){return this.getArgb(X.surface)}get surfaceDim(){return this.getArgb(X.surfaceDim)}get surfaceBright(){return this.getArgb(X.surfaceBright)}get surfaceContainerLowest(){return this.getArgb(X.surfaceContainerLowest)}get surfaceContainerLow(){return this.getArgb(X.surfaceContainerLow)}get surfaceContainer(){return this.getArgb(X.surfaceContainer)}get surfaceContainerHigh(){return this.getArgb(X.surfaceContainerHigh)}get surfaceContainerHighest(){return this.getArgb(X.surfaceContainerHighest)}get onSurface(){return this.getArgb(X.onSurface)}get surfaceVariant(){return this.getArgb(X.surfaceVariant)}get onSurfaceVariant(){return this.getArgb(X.onSurfaceVariant)}get inverseSurface(){return this.getArgb(X.inverseSurface)}get inverseOnSurface(){return this.getArgb(X.inverseOnSurface)}get outline(){return this.getArgb(X.outline)}get outlineVariant(){return this.getArgb(X.outlineVariant)}get shadow(){return this.getArgb(X.shadow)}get scrim(){return this.getArgb(X.scrim)}get surfaceTint(){return this.getArgb(X.surfaceTint)}get primary(){return this.getArgb(X.primary)}get onPrimary(){return this.getArgb(X.onPrimary)}get primaryContainer(){return this.getArgb(X.primaryContainer)}get onPrimaryContainer(){return this.getArgb(X.onPrimaryContainer)}get inversePrimary(){return this.getArgb(X.inversePrimary)}get secondary(){return this.getArgb(X.secondary)}get onSecondary(){return this.getArgb(X.onSecondary)}get secondaryContainer(){return this.getArgb(X.secondaryContainer)}get onSecondaryContainer(){return this.getArgb(X.onSecondaryContainer)}get tertiary(){return this.getArgb(X.tertiary)}get onTertiary(){return this.getArgb(X.onTertiary)}get tertiaryContainer(){return this.getArgb(X.tertiaryContainer)}get onTertiaryContainer(){return this.getArgb(X.onTertiaryContainer)}get error(){return this.getArgb(X.error)}get onError(){return this.getArgb(X.onError)}get errorContainer(){return this.getArgb(X.errorContainer)}get onErrorContainer(){return this.getArgb(X.onErrorContainer)}get primaryFixed(){return this.getArgb(X.primaryFixed)}get primaryFixedDim(){return this.getArgb(X.primaryFixedDim)}get onPrimaryFixed(){return this.getArgb(X.onPrimaryFixed)}get onPrimaryFixedVariant(){return this.getArgb(X.onPrimaryFixedVariant)}get secondaryFixed(){return this.getArgb(X.secondaryFixed)}get secondaryFixedDim(){return this.getArgb(X.secondaryFixedDim)}get onSecondaryFixed(){return this.getArgb(X.onSecondaryFixed)}get onSecondaryFixedVariant(){return this.getArgb(X.onSecondaryFixedVariant)}get tertiaryFixed(){return this.getArgb(X.tertiaryFixed)}get tertiaryFixedDim(){return this.getArgb(X.tertiaryFixedDim)}get onTertiaryFixed(){return this.getArgb(X.onTertiaryFixed)}get onTertiaryFixedVariant(){return this.getArgb(X.onTertiaryFixedVariant)}}
251
+ class Z{constructor(t){this.sourceColorArgb=t.sourceColorArgb,this.variant=t.variant,this.contrastLevel=t.contrastLevel,this.isDark=t.isDark,this.sourceColorHct=S.fromInt(t.sourceColorArgb),this.primaryPalette=t.primaryPalette,this.secondaryPalette=t.secondaryPalette,this.tertiaryPalette=t.tertiaryPalette,this.neutralPalette=t.neutralPalette,this.neutralVariantPalette=t.neutralVariantPalette,this.errorPalette=R.fromHueAndChroma(25,84)}static getRotatedHue(t,e,r){const a=t.hue;if(e.length!==r.length)throw new Error(`mismatch between hue length ${e.length} & rotations ${r.length}`);if(1===r.length)return d(t.hue+r[0]);const n=e.length;for(let t=0;t<=n-2;t++){const n=e[t],o=e[t+1];if(n<a&&a<o)return d(a+r[t])}return a}getArgb(t){return t.getArgb(this)}getHct(t){return t.getHct(this)}get primaryPaletteKeyColor(){return this.getArgb(X.primaryPaletteKeyColor)}get secondaryPaletteKeyColor(){return this.getArgb(X.secondaryPaletteKeyColor)}get tertiaryPaletteKeyColor(){return this.getArgb(X.tertiaryPaletteKeyColor)}get neutralPaletteKeyColor(){return this.getArgb(X.neutralPaletteKeyColor)}get neutralVariantPaletteKeyColor(){return this.getArgb(X.neutralVariantPaletteKeyColor)}get background(){return this.getArgb(X.background)}get onBackground(){return this.getArgb(X.onBackground)}get surface(){return this.getArgb(X.surface)}get surfaceDim(){return this.getArgb(X.surfaceDim)}get surfaceBright(){return this.getArgb(X.surfaceBright)}get surfaceContainerLowest(){return this.getArgb(X.surfaceContainerLowest)}get surfaceContainerLow(){return this.getArgb(X.surfaceContainerLow)}get surfaceContainer(){return this.getArgb(X.surfaceContainer)}get surfaceContainerHigh(){return this.getArgb(X.surfaceContainerHigh)}get surfaceContainerHighest(){return this.getArgb(X.surfaceContainerHighest)}get onSurface(){return this.getArgb(X.onSurface)}get surfaceVariant(){return this.getArgb(X.surfaceVariant)}get onSurfaceVariant(){return this.getArgb(X.onSurfaceVariant)}get inverseSurface(){return this.getArgb(X.inverseSurface)}get inverseOnSurface(){return this.getArgb(X.inverseOnSurface)}get outline(){return this.getArgb(X.outline)}get outlineVariant(){return this.getArgb(X.outlineVariant)}get shadow(){return this.getArgb(X.shadow)}get scrim(){return this.getArgb(X.scrim)}get surfaceTint(){return this.getArgb(X.surfaceTint)}get primary(){return this.getArgb(X.primary)}get onPrimary(){return this.getArgb(X.onPrimary)}get primaryContainer(){return this.getArgb(X.primaryContainer)}get onPrimaryContainer(){return this.getArgb(X.onPrimaryContainer)}get inversePrimary(){return this.getArgb(X.inversePrimary)}get secondary(){return this.getArgb(X.secondary)}get onSecondary(){return this.getArgb(X.onSecondary)}get secondaryContainer(){return this.getArgb(X.secondaryContainer)}get onSecondaryContainer(){return this.getArgb(X.onSecondaryContainer)}get tertiary(){return this.getArgb(X.tertiary)}get onTertiary(){return this.getArgb(X.onTertiary)}get tertiaryContainer(){return this.getArgb(X.tertiaryContainer)}get onTertiaryContainer(){return this.getArgb(X.onTertiaryContainer)}get error(){return this.getArgb(X.error)}get onError(){return this.getArgb(X.onError)}get errorContainer(){return this.getArgb(X.errorContainer)}get onErrorContainer(){return this.getArgb(X.onErrorContainer)}get primaryFixed(){return this.getArgb(X.primaryFixed)}get primaryFixedDim(){return this.getArgb(X.primaryFixedDim)}get onPrimaryFixed(){return this.getArgb(X.onPrimaryFixed)}get onPrimaryFixedVariant(){return this.getArgb(X.onPrimaryFixedVariant)}get secondaryFixed(){return this.getArgb(X.secondaryFixed)}get secondaryFixedDim(){return this.getArgb(X.secondaryFixedDim)}get onSecondaryFixed(){return this.getArgb(X.onSecondaryFixed)}get onSecondaryFixedVariant(){return this.getArgb(X.onSecondaryFixedVariant)}get tertiaryFixed(){return this.getArgb(X.tertiaryFixed)}get tertiaryFixedDim(){return this.getArgb(X.tertiaryFixedDim)}get onTertiaryFixed(){return this.getArgb(X.onTertiaryFixed)}get onTertiaryFixedVariant(){return this.getArgb(X.onTertiaryFixedVariant)}}
252
252
  /**
253
253
  * @license
254
254
  * Copyright 2021 Google LLC
@@ -264,7 +264,7 @@ class Z{constructor(t){this.sourceColorArgb=t.sourceColorArgb,this.variant=t.var
264
264
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
265
265
  * See the License for the specific language governing permissions and
266
266
  * limitations under the License.
267
- */class Q{static of(t){return new Q(t,!1)}static contentOf(t){return new Q(t,!0)}static fromColors(t){return Q.createPaletteFromColors(!1,t)}static contentFromColors(t){return Q.createPaletteFromColors(!0,t)}static createPaletteFromColors(t,e){const r=new Q(e.primary,t);if(e.secondary){const a=new Q(e.secondary,t);r.a2=a.a1}if(e.tertiary){const a=new Q(e.tertiary,t);r.a3=a.a1}if(e.error){const a=new Q(e.error,t);r.error=a.a1}if(e.neutral){const a=new Q(e.neutral,t);r.n1=a.n1}if(e.neutralVariant){const a=new Q(e.neutralVariant,t);r.n2=a.n2}return r}constructor(t,e){const r=I.fromInt(t),a=r.hue,n=r.chroma;e?(this.a1=E.fromHueAndChroma(a,n),this.a2=E.fromHueAndChroma(a,n/3),this.a3=E.fromHueAndChroma(a+60,n/2),this.n1=E.fromHueAndChroma(a,Math.min(n/12,4)),this.n2=E.fromHueAndChroma(a,Math.min(n/6,8))):(this.a1=E.fromHueAndChroma(a,Math.max(48,n)),this.a2=E.fromHueAndChroma(a,16),this.a3=E.fromHueAndChroma(a+60,24),this.n1=E.fromHueAndChroma(a,4),this.n2=E.fromHueAndChroma(a,8)),this.error=E.fromHueAndChroma(25,84)}}
267
+ */class Q{static of(t){return new Q(t,!1)}static contentOf(t){return new Q(t,!0)}static fromColors(t){return Q.createPaletteFromColors(!1,t)}static contentFromColors(t){return Q.createPaletteFromColors(!0,t)}static createPaletteFromColors(t,e){const r=new Q(e.primary,t);if(e.secondary){const a=new Q(e.secondary,t);r.a2=a.a1}if(e.tertiary){const a=new Q(e.tertiary,t);r.a3=a.a1}if(e.error){const a=new Q(e.error,t);r.error=a.a1}if(e.neutral){const a=new Q(e.neutral,t);r.n1=a.n1}if(e.neutralVariant){const a=new Q(e.neutralVariant,t);r.n2=a.n2}return r}constructor(t,e){const r=S.fromInt(t),a=r.hue,n=r.chroma;e?(this.a1=R.fromHueAndChroma(a,n),this.a2=R.fromHueAndChroma(a,n/3),this.a3=R.fromHueAndChroma(a+60,n/2),this.n1=R.fromHueAndChroma(a,Math.min(n/12,4)),this.n2=R.fromHueAndChroma(a,Math.min(n/6,8))):(this.a1=R.fromHueAndChroma(a,Math.max(48,n)),this.a2=R.fromHueAndChroma(a,16),this.a3=R.fromHueAndChroma(a+60,24),this.n1=R.fromHueAndChroma(a,4),this.n2=R.fromHueAndChroma(a,8)),this.error=R.fromHueAndChroma(25,84)}}
268
268
  /**
269
269
  * @license
270
270
  * Copyright 2022 Google LLC
@@ -280,7 +280,7 @@ class Z{constructor(t){this.sourceColorArgb=t.sourceColorArgb,this.variant=t.var
280
280
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
281
281
  * See the License for the specific language governing permissions and
282
282
  * limitations under the License.
283
- */class tt extends Z{constructor(t,e,r){super({sourceColorArgb:t.toInt(),variant:H.EXPRESSIVE,contrastLevel:r,isDark:e,primaryPalette:E.fromHueAndChroma(d(t.hue+240),40),secondaryPalette:E.fromHueAndChroma(Z.getRotatedHue(t,tt.hues,tt.secondaryRotations),24),tertiaryPalette:E.fromHueAndChroma(Z.getRotatedHue(t,tt.hues,tt.tertiaryRotations),32),neutralPalette:E.fromHueAndChroma(t.hue+15,8),neutralVariantPalette:E.fromHueAndChroma(t.hue+15,12)})}}tt.hues=[0,21,51,121,151,191,271,321,360],tt.secondaryRotations=[45,95,45,20,45,90,45,45,45],tt.tertiaryRotations=[120,120,20,45,20,15,20,120,120];
283
+ */class tt extends Z{constructor(t,e,r){super({sourceColorArgb:t.toInt(),variant:O.EXPRESSIVE,contrastLevel:r,isDark:e,primaryPalette:R.fromHueAndChroma(d(t.hue+240),40),secondaryPalette:R.fromHueAndChroma(Z.getRotatedHue(t,tt.hues,tt.secondaryRotations),24),tertiaryPalette:R.fromHueAndChroma(Z.getRotatedHue(t,tt.hues,tt.tertiaryRotations),32),neutralPalette:R.fromHueAndChroma(t.hue+15,8),neutralVariantPalette:R.fromHueAndChroma(t.hue+15,12)})}}tt.hues=[0,21,51,121,151,191,271,321,360],tt.secondaryRotations=[45,95,45,20,45,90,45,45,45],tt.tertiaryRotations=[120,120,20,45,20,15,20,120,120];
284
284
  /**
285
285
  * @license
286
286
  * Copyright 2022 Google LLC
@@ -297,7 +297,7 @@ class Z{constructor(t){this.sourceColorArgb=t.sourceColorArgb,this.variant=t.var
297
297
  * See the License for the specific language governing permissions and
298
298
  * limitations under the License.
299
299
  */
300
- class et extends Z{constructor(t,e,r){super({sourceColorArgb:t.toInt(),variant:H.VIBRANT,contrastLevel:r,isDark:e,primaryPalette:E.fromHueAndChroma(t.hue,200),secondaryPalette:E.fromHueAndChroma(Z.getRotatedHue(t,et.hues,et.secondaryRotations),24),tertiaryPalette:E.fromHueAndChroma(Z.getRotatedHue(t,et.hues,et.tertiaryRotations),32),neutralPalette:E.fromHueAndChroma(t.hue,10),neutralVariantPalette:E.fromHueAndChroma(t.hue,12)})}}
300
+ class et extends Z{constructor(t,e,r){super({sourceColorArgb:t.toInt(),variant:O.VIBRANT,contrastLevel:r,isDark:e,primaryPalette:R.fromHueAndChroma(t.hue,200),secondaryPalette:R.fromHueAndChroma(Z.getRotatedHue(t,et.hues,et.secondaryRotations),24),tertiaryPalette:R.fromHueAndChroma(Z.getRotatedHue(t,et.hues,et.tertiaryRotations),32),neutralPalette:R.fromHueAndChroma(t.hue,10),neutralVariantPalette:R.fromHueAndChroma(t.hue,12)})}}
301
301
  /**
302
302
  * @license
303
303
  * Copyright 2021 Google LLC
@@ -314,5 +314,5 @@ class et extends Z{constructor(t,e,r){super({sourceColorArgb:t.toInt(),variant:H
314
314
  * See the License for the specific language governing permissions and
315
315
  * limitations under the License.
316
316
  */
317
- function rt(t){const e=P(t),r=C(t),a=w(t),n=[e.toString(16),r.toString(16),a.toString(16)];for(const[t,e]of n.entries())1===e.length&&(n[t]="0"+e);return"#"+n.join("")}function at(t){return parseInt(t,16)}et.hues=[0,41,61,101,131,181,251,301,360],et.secondaryRotations=[18,15,10,12,15,18,15,12,12],et.tertiaryRotations=[35,30,20,25,30,35,30,25,25];let nt=class extends e{constructor(){super(...arguments),N.add(this),z.set(this,new CSSStyleSheet),q.set(this,!1),U.set(this,void 0),$.set(this,void 0),j.set(this,void 0),K.set(this,()=>s(this,N,"m",Y).call(this,!0)),this.color="#6750A4",this.scheme="auto",this.contrast="standard",this.strongFocus=!1,this.density=0,this.motion="standard"}get isDark(){switch(this.scheme){case"light":return!1;case"dark":return!0;default:if(this.parentElement instanceof HTMLBodyElement)switch(document.documentElement.style.colorScheme){case"light":return!1;case"dark":return!0}return s(this,$,"f")?.matches??!1}}connectedCallback(){super.connectedCallback(),this.shadowRoot&&!this.shadowRoot.adoptedStyleSheets.includes(s(this,z,"f"))&&(this.shadowRoot.adoptedStyleSheets=[...this.shadowRoot.adoptedStyleSheets,s(this,z,"f")]),c(this,U,matchMedia("(prefers-color-scheme: light)"),"f"),c(this,$,matchMedia("(prefers-color-scheme: dark)"),"f"),c(this,j,matchMedia("(forced-colors: active)"),"f"),[s(this,U,"f"),s(this,$,"f"),s(this,j,"f")].forEach(t=>t.addEventListener("change",s(this,K,"f")))}disconnectedCallback(){super.disconnectedCallback(),[s(this,U,"f"),s(this,$,"f"),s(this,j,"f")].forEach(t=>t?.removeEventListener("change",s(this,K,"f"))),c(this,U,c(this,$,c(this,j,void 0,"f"),"f"),"f")}updated(t){super.updated(t),s(this,N,"m",Y).call(this,s(this,q,"f")&&["color","scheme","contrast"].some(e=>t.has(e)))}firstUpdated(t){super.firstUpdated(t),c(this,q,!0,"f")}render(){return r`<slot></slot>`}};z=new WeakMap,q=new WeakMap,U=new WeakMap,$=new WeakMap,j=new WeakMap,K=new WeakMap,N=new WeakSet,Y=function(t){const e=function(t){const e=3===(t=t.replace("#","")).length,r=6===t.length,a=8===t.length;if(!e&&!r&&!a)throw new Error("unexpected hex "+t);let n=0,o=0,i=0;return e?(n=at(t.slice(0,1).repeat(2)),o=at(t.slice(1,2).repeat(2)),i=at(t.slice(2,3).repeat(2))):r?(n=at(t.slice(0,2)),o=at(t.slice(2,4)),i=at(t.slice(4,6))):a&&(n=at(t.slice(2,4)),o=at(t.slice(4,6)),i=at(t.slice(6,8))),(255<<24|(255&n)<<16|(255&o)<<8|255&i)>>>0}(this.color),r=Q.of(e),a=new Z({sourceColorArgb:e,variant:1,contrastLevel:s(this,N,"m",G).call(this),isDark:this.isDark,primaryPalette:r.a1,secondaryPalette:r.a2,tertiaryPalette:r.a3,neutralPalette:r.n1,neutralVariantPalette:r.n2});let n="";for(const t in X)if(!t.endsWith("PaletteKeyColor")){const e=X[t];e instanceof B&&(n+=`--md-sys-color-${t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}: ${rt(e.getArgb(a))};`)}if("expressive"===this.motion&&(n+="--md-sys-motion-spring-fast-spatial: 350ms cubic-bezier(0.42, 1.67, 0.21, 0.90);",n+="--md-sys-motion-spring-default-spatial: 500ms cubic-bezier(0.38, 1.21, 0.22, 1.00);",n+="--md-sys-motion-spring-slow-spatial: 650ms cubic-bezier(0.39, 1.29, 0.35, 0.98);",n+="--md-sys-motion-spring-fast-effects: 150ms cubic-bezier(0.31, 0.94, 0.34, 1.00);",n+="--md-sys-motion-spring-default-effects: 200ms cubic-bezier(0.34, 0.80, 0.34, 1.00);",n+="--md-sys-motion-spring-slow-effects: 300ms cubic-bezier(0.34, 0.88, 0.34, 1.00);"),n+=`--md-sys-density-scale: ${this.density};`,n+=`--m3e-scrollbar-thumb-color: ${rt(a.neutralPalette.tone(60))};`,n+=`--m3e-focus-ring-visibility: ${this.strongFocus?"visible":"hidden"};`,s(this,z,"f").replaceSync(`:host { ${n} }`),this.parentElement instanceof HTMLBodyElement){const t=getComputedStyle(this);switch(this.scheme){case"light":document.documentElement.style.colorScheme="light";break;case"dark":document.documentElement.style.colorScheme="dark";break;default:switch(document.documentElement.style.colorScheme){case"light":case"dark":document.documentElement.style.colorScheme="light dark"}}s(this,j,"f")?.matches?this.parentElement.style.backgroundColor=this.parentElement.style.color=this.parentElement.ownerDocument.documentElement.style.scrollbarColor=this.parentElement.style.scrollbarColor="":(this.parentElement.style.backgroundColor=t.getPropertyValue("--md-sys-color-background"),this.parentElement.style.color=t.getPropertyValue("--md-sys-color-on-background"),this.parentElement.ownerDocument.documentElement.style.scrollbarColor=this.parentElement.style.scrollbarColor=`${t.getPropertyValue("--m3e-scrollbar-thumb-color")} ${t.getPropertyValue("--m3e-scrollbar-track-color")}`)}s(this,q,"f")&&this.dispatchEvent(new Event("change",{bubbles:!0})),t&&document.body.offsetHeight},G=function(){switch(this.contrast){case"high":return 1;case"medium":return.5;default:return 0}},nt.styles=t`:host { display: contents; font-size: ${n.typescale.standard.body.large.fontSize}; font-weight: ${n.typescale.standard.body.large.fontWeight}; line-height: ${n.typescale.standard.body.large.lineHeight}; letter-spacing: ${n.typescale.standard.body.large.tracking}; }`,i([a()],nt.prototype,"color",void 0),i([a()],nt.prototype,"scheme",void 0),i([a()],nt.prototype,"contrast",void 0),i([a({attribute:"strong-focus",type:Boolean})],nt.prototype,"strongFocus",void 0),i([a({type:Number})],nt.prototype,"density",void 0),i([a()],nt.prototype,"motion",void 0),nt=i([o("m3e-theme")],nt);export{nt as M3eThemeElement};
317
+ function rt(t){const e=C(t),r=P(t),a=w(t),n=[e.toString(16),r.toString(16),a.toString(16)];for(const[t,e]of n.entries())1===e.length&&(n[t]="0"+e);return"#"+n.join("")}function at(t){return parseInt(t,16)}et.hues=[0,41,61,101,131,181,251,301,360],et.secondaryRotations=[18,15,10,12,15,18,15,12,12],et.tertiaryRotations=[35,30,20,25,30,35,30,25,25];let nt=class extends n{constructor(){super(...arguments),N.add(this),z.set(this,new CSSStyleSheet),q.set(this,!1),U.set(this,void 0),$.set(this,void 0),K.set(this,void 0),Y.set(this,()=>e(this,N,"m",j).call(this,!0)),this.color="#6750A4",this.scheme="auto",this.contrast="standard",this.strongFocus=!1,this.density=0,this.motion="standard"}get isDark(){switch(this.scheme){case"light":return!1;case"dark":return!0;default:if(this.parentElement instanceof HTMLBodyElement)switch(document.documentElement.style.colorScheme){case"light":return!1;case"dark":return!0}return e(this,$,"f")?.matches??!1}}connectedCallback(){super.connectedCallback(),this.shadowRoot&&!this.shadowRoot.adoptedStyleSheets.includes(e(this,z,"f"))&&(this.shadowRoot.adoptedStyleSheets=[...this.shadowRoot.adoptedStyleSheets,e(this,z,"f")]),r(this,U,matchMedia("(prefers-color-scheme: light)"),"f"),r(this,$,matchMedia("(prefers-color-scheme: dark)"),"f"),r(this,K,matchMedia("(forced-colors: active)"),"f"),[e(this,U,"f"),e(this,$,"f"),e(this,K,"f")].forEach(t=>t.addEventListener("change",e(this,Y,"f")))}disconnectedCallback(){super.disconnectedCallback(),[e(this,U,"f"),e(this,$,"f"),e(this,K,"f")].forEach(t=>t?.removeEventListener("change",e(this,Y,"f"))),r(this,U,r(this,$,r(this,K,void 0,"f"),"f"),"f")}updated(t){super.updated(t),e(this,N,"m",j).call(this,e(this,q,"f")&&["color","scheme","contrast"].some(e=>t.has(e)))}firstUpdated(t){super.firstUpdated(t),r(this,q,!0,"f")}render(){return o`<slot></slot>`}};z=new WeakMap,q=new WeakMap,U=new WeakMap,$=new WeakMap,K=new WeakMap,Y=new WeakMap,N=new WeakSet,j=function(t){const r=function(t){const e=3===(t=t.replace("#","")).length,r=6===t.length,a=8===t.length;if(!e&&!r&&!a)throw new Error("unexpected hex "+t);let n=0,o=0,i=0;return e?(n=at(t.slice(0,1).repeat(2)),o=at(t.slice(1,2).repeat(2)),i=at(t.slice(2,3).repeat(2))):r?(n=at(t.slice(0,2)),o=at(t.slice(2,4)),i=at(t.slice(4,6))):a&&(n=at(t.slice(2,4)),o=at(t.slice(4,6)),i=at(t.slice(6,8))),(255<<24|(255&n)<<16|(255&o)<<8|255&i)>>>0}(this.color),a=Q.of(r),n=new Z({sourceColorArgb:r,variant:1,contrastLevel:e(this,N,"m",G).call(this),isDark:this.isDark,primaryPalette:a.a1,secondaryPalette:a.a2,tertiaryPalette:a.a3,neutralPalette:a.n1,neutralVariantPalette:a.n2});let o="";for(const t in X)if(!t.endsWith("PaletteKeyColor")){const e=X[t];e instanceof B&&(o+=`--md-sys-color-${t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}: ${rt(e.getArgb(n))};`)}if("expressive"===this.motion&&(o+="--md-sys-motion-spring-fast-spatial: 350ms cubic-bezier(0.42, 1.67, 0.21, 0.90);",o+="--md-sys-motion-spring-default-spatial: 500ms cubic-bezier(0.38, 1.21, 0.22, 1.00);",o+="--md-sys-motion-spring-slow-spatial: 650ms cubic-bezier(0.39, 1.29, 0.35, 0.98);",o+="--md-sys-motion-spring-fast-effects: 150ms cubic-bezier(0.31, 0.94, 0.34, 1.00);",o+="--md-sys-motion-spring-default-effects: 200ms cubic-bezier(0.34, 0.80, 0.34, 1.00);",o+="--md-sys-motion-spring-slow-effects: 300ms cubic-bezier(0.34, 0.88, 0.34, 1.00);"),o+=`--md-sys-density-scale: ${this.density};`,o+=`--m3e-scrollbar-thumb-color: ${rt(n.neutralPalette.tone(60))};`,o+=`--m3e-focus-ring-visibility: ${this.strongFocus?"visible":"hidden"};`,e(this,z,"f").replaceSync(`:host { ${o} }`),this.parentElement instanceof HTMLBodyElement){const t=getComputedStyle(this);switch(this.scheme){case"light":document.documentElement.style.colorScheme="light";break;case"dark":document.documentElement.style.colorScheme="dark";break;default:switch(document.documentElement.style.colorScheme){case"light":case"dark":document.documentElement.style.colorScheme="light dark"}}e(this,K,"f")?.matches?this.parentElement.style.backgroundColor=this.parentElement.style.color=this.parentElement.ownerDocument.documentElement.style.scrollbarColor=this.parentElement.style.scrollbarColor="":(this.parentElement.style.backgroundColor=t.getPropertyValue("--md-sys-color-background"),this.parentElement.style.color=t.getPropertyValue("--md-sys-color-on-background"),this.parentElement.ownerDocument.documentElement.style.scrollbarColor=this.parentElement.style.scrollbarColor=`${t.getPropertyValue("--m3e-scrollbar-thumb-color")} ${t.getPropertyValue("--m3e-scrollbar-track-color")}`)}e(this,q,"f")&&this.dispatchEvent(new Event("change",{bubbles:!0})),t&&document.body.offsetHeight},G=function(){switch(this.contrast){case"high":return 1;case"medium":return.5;default:return 0}},nt.styles=a`:host { display: contents; font-size: ${s.typescale.standard.body.large.fontSize}; font-weight: ${s.typescale.standard.body.large.fontWeight}; line-height: ${s.typescale.standard.body.large.lineHeight}; letter-spacing: ${s.typescale.standard.body.large.tracking}; }`,t([i()],nt.prototype,"color",void 0),t([i()],nt.prototype,"scheme",void 0),t([i()],nt.prototype,"contrast",void 0),t([i({attribute:"strong-focus",type:Boolean})],nt.prototype,"strongFocus",void 0),t([i({type:Number})],nt.prototype,"density",void 0),t([i()],nt.prototype,"motion",void 0),nt=t([c("m3e-theme")],nt);export{nt as M3eThemeElement};
318
318
  //# sourceMappingURL=theme.min.js.map