@gradient-ui/gradient-engine 0.6.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/README.md +0 -6
  2. package/dist/animation.cjs +13 -13
  3. package/dist/animation.mjs +36 -36
  4. package/dist/core.cjs +1 -1
  5. package/dist/core.mjs +17 -17
  6. package/dist/css-B3xGfmW1.js +17 -0
  7. package/dist/css-CREh0Awz.cjs +1 -0
  8. package/dist/design-tokens.cjs +1 -1
  9. package/dist/design-tokens.mjs +5 -5
  10. package/dist/designTokens-Bw-HZ1f1.js +116 -0
  11. package/dist/designTokens-DsIk5RSi.cjs +1 -0
  12. package/dist/effects.cjs +67 -67
  13. package/dist/effects.mjs +153 -153
  14. package/dist/formatters.cjs +1 -1
  15. package/dist/formatters.mjs +33 -33
  16. package/dist/index.cjs +1 -1
  17. package/dist/index.mjs +63 -63
  18. package/dist/material.cjs +8 -8
  19. package/dist/material.mjs +170 -170
  20. package/dist/presets-DA-6KYJh.cjs +316 -0
  21. package/dist/presets-Du6aTLtD.js +4025 -0
  22. package/dist/svg-B2CaHCLv.js +118 -0
  23. package/dist/svg-BtMrj3fP.cjs +32 -0
  24. package/dist/types/animation/css.d.ts +2 -2
  25. package/dist/types/animation/index.d.ts +1 -1
  26. package/dist/types/colorSystem.d.ts +3 -3
  27. package/dist/types/core.d.ts +7 -7
  28. package/dist/types/designTokens.d.ts +4 -4
  29. package/dist/types/effects/index.d.ts +2 -2
  30. package/dist/types/effects/morph.d.ts +1 -1
  31. package/dist/types/effects/shadow.d.ts +1 -1
  32. package/dist/types/formatters/canvas.d.ts +1 -1
  33. package/dist/types/formatters/css.d.ts +1 -1
  34. package/dist/types/formatters/index.d.ts +3 -3
  35. package/dist/types/formatters/svg.d.ts +1 -1
  36. package/dist/types/index.d.ts +11 -11
  37. package/dist/types/material.d.ts +1 -1
  38. package/dist/types/model.d.ts +3 -3
  39. package/dist/types/palette.d.ts +1 -1
  40. package/dist/types/presets.d.ts +1 -1
  41. package/dist/types/recipes.d.ts +12 -12
  42. package/dist/types/tokens.d.ts +3 -3
  43. package/dist/types/types.d.ts +1 -1
  44. package/dist/types/utils.d.ts +1 -1
  45. package/dist/{types-BFr1fN-7.js → types-B0eCazk8.js} +4 -4
  46. package/dist/types-BFkUlDkW.cjs +1 -0
  47. package/dist/types-cjs/animation/css.d.cts +12 -0
  48. package/dist/types-cjs/animation/index.d.cts +1 -0
  49. package/dist/types-cjs/color.d.cts +11 -0
  50. package/dist/types-cjs/colorMath.d.cts +3 -0
  51. package/dist/types-cjs/colorSeeds.d.cts +22 -0
  52. package/dist/types-cjs/colorSystem.d.cts +20 -0
  53. package/dist/types-cjs/constants.d.cts +3 -0
  54. package/dist/types-cjs/core.d.cts +9 -0
  55. package/dist/types-cjs/designTokens.d.cts +24 -0
  56. package/dist/types-cjs/effects/index.d.cts +2 -0
  57. package/dist/types-cjs/effects/morph.d.cts +8 -0
  58. package/dist/types-cjs/effects/shadow.d.cts +3 -0
  59. package/dist/types-cjs/formatters/canvas.d.cts +2 -0
  60. package/dist/types-cjs/formatters/css.d.cts +3 -0
  61. package/dist/types-cjs/formatters/index.d.cts +3 -0
  62. package/dist/types-cjs/formatters/svg.d.cts +5 -0
  63. package/dist/types-cjs/index.d.cts +11 -0
  64. package/dist/types-cjs/material.d.cts +1 -0
  65. package/dist/types-cjs/model.d.cts +5 -0
  66. package/dist/types-cjs/package.json +3 -0
  67. package/dist/types-cjs/palette.d.cts +13 -0
  68. package/dist/types-cjs/presets.d.cts +239 -0
  69. package/dist/types-cjs/recipes.d.cts +14 -0
  70. package/dist/types-cjs/scheme.d.cts +3 -0
  71. package/dist/types-cjs/tokens.d.cts +107 -0
  72. package/dist/types-cjs/types.d.cts +127 -0
  73. package/dist/types-cjs/utils.d.cts +10 -0
  74. package/dist/utils-Bry9BTmj.cjs +1 -0
  75. package/dist/utils-VaqPefmS.js +76 -0
  76. package/package.json +59 -23
  77. package/dist/css-BVHXLMRl.cjs +0 -1
  78. package/dist/css-DVaTTIqS.js +0 -17
  79. package/dist/designTokens-BnzZfRES.js +0 -116
  80. package/dist/designTokens-C1WdzS3v.cjs +0 -1
  81. package/dist/presets-BBLdqUE4.cjs +0 -316
  82. package/dist/presets-DYXLx_nN.js +0 -4025
  83. package/dist/svg-dGtLYnIJ.cjs +0 -32
  84. package/dist/svg-hZus3ztj.js +0 -118
  85. package/dist/types-BMLEvdee.cjs +0 -1
  86. package/dist/utils-BzSNCfat.js +0 -76
  87. package/dist/utils-D83DMCMa.cjs +0 -1
@@ -1,316 +0,0 @@
1
- "use strict";const w=require("./utils-D83DMCMa.cjs");/**
2
- * @license
3
- * Copyright 2021 Google LLC
4
- *
5
- * Licensed under the Apache License, Version 2.0 (the "License");
6
- * you may not use this file except in compliance with the License.
7
- * You may obtain a copy of the License at
8
- *
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS,
13
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- * See the License for the specific language governing permissions and
15
- * limitations under the License.
16
- */function K(r){return r<0?-1:r===0?0:1}function se(r,e,t){return(1-t)*r+t*e}function Ze(r,e,t){return t<r?r:t>e?e:t}function U(r,e,t){return t<r?r:t>e?e:t}function me(r){return r=r%360,r<0&&(r=r+360),r}function Qe(r,e){return me(e-r)<=180?1:-1}function et(r,e){return 180-Math.abs(Math.abs(r-e)-180)}function ke(r,e){const t=r[0]*e[0][0]+r[1]*e[0][1]+r[2]*e[0][2],n=r[0]*e[1][0]+r[1]*e[1][1]+r[2]*e[1][2],a=r[0]*e[2][0]+r[1]*e[2][1]+r[2]*e[2][2];return[t,n,a]}/**
17
- * @license
18
- * Copyright 2021 Google LLC
19
- *
20
- * Licensed under the Apache License, Version 2.0 (the "License");
21
- * you may not use this file except in compliance with the License.
22
- * You may obtain a copy of the License at
23
- *
24
- * http://www.apache.org/licenses/LICENSE-2.0
25
- *
26
- * Unless required by applicable law or agreed to in writing, software
27
- * distributed under the License is distributed on an "AS IS" BASIS,
28
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
29
- * See the License for the specific language governing permissions and
30
- * limitations under the License.
31
- */const tt=[[.41233895,.35762064,.18051042],[.2126,.7152,.0722],[.01932141,.11916382,.95034478]],rt=[[3.2413774792388685,-1.5376652402851851,-.49885366846268053],[-.9691452513005321,1.8758853451067872,.04156585616912061],[.05562093689691305,-.20395524564742123,1.0571799111220335]],nt=[95.047,100,108.883];function De(r,e,t){return(255<<24|(r&255)<<16|(e&255)<<8|t&255)>>>0}function Ee(r){const e=ne(r[0]),t=ne(r[1]),n=ne(r[2]);return De(e,t,n)}function Oe(r){return r>>16&255}function Re(r){return r>>8&255}function Ve(r){return r&255}function at(r,e,t){const n=rt,a=n[0][0]*r+n[0][1]*e+n[0][2]*t,s=n[1][0]*r+n[1][1]*e+n[1][2]*t,i=n[2][0]*r+n[2][1]*e+n[2][2]*t,u=ne(a),l=ne(s),f=ne(i);return De(u,l,f)}function ot(r){const e=ie(Oe(r)),t=ie(Re(r)),n=ie(Ve(r));return ke([e,t,n],tt)}function it(r){const e=re(r),t=ne(e);return De(t,t,t)}function Ce(r){const e=ot(r)[1];return 116*Ne(e/100)-16}function re(r){return 100*ct((r+16)/116)}function be(r){return Ne(r/100)*116-16}function ie(r){const e=r/255;return e<=.040449936?e/12.92*100:Math.pow((e+.055)/1.055,2.4)*100}function ne(r){const e=r/100;let t=0;return e<=.0031308?t=e*12.92:t=1.055*Math.pow(e,1/2.4)-.055,Ze(0,255,Math.round(t*255))}function st(){return nt}function Ne(r){const e=.008856451679035631,t=24389/27;return r>e?Math.pow(r,1/3):(t*r+16)/116}function ct(r){const e=.008856451679035631,t=24389/27,n=r*r*r;return n>e?n:(116*r-16)/t}/**
32
- * @license
33
- * Copyright 2021 Google LLC
34
- *
35
- * Licensed under the Apache License, Version 2.0 (the "License");
36
- * you may not use this file except in compliance with the License.
37
- * You may obtain a copy of the License at
38
- *
39
- * http://www.apache.org/licenses/LICENSE-2.0
40
- *
41
- * Unless required by applicable law or agreed to in writing, software
42
- * distributed under the License is distributed on an "AS IS" BASIS,
43
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
44
- * See the License for the specific language governing permissions and
45
- * limitations under the License.
46
- */class j{static make(e=st(),t=200/Math.PI*re(50)/100,n=50,a=2,s=!1){const i=e,u=i[0]*.401288+i[1]*.650173+i[2]*-.051461,l=i[0]*-.250268+i[1]*1.204414+i[2]*.045854,f=i[0]*-.002079+i[1]*.048952+i[2]*.953127,p=.8+a/10,k=p>=.9?se(.59,.69,(p-.9)*10):se(.525,.59,(p-.8)*10);let d=s?1:p*(1-1/3.6*Math.exp((-t-42)/92));d=d>1?1:d<0?0:d;const D=p,m=[d*(100/u)+1-d,d*(100/l)+1-d,d*(100/f)+1-d],g=1/(5*t+1),P=g*g*g*g,M=1-P,B=P*t+.1*M*M*Math.cbrt(5*t),R=re(n)/e[1],V=1.48+Math.sqrt(R),N=.725/Math.pow(R,.2),E=N,v=[Math.pow(B*m[0]*u/100,.42),Math.pow(B*m[1]*l/100,.42),Math.pow(B*m[2]*f/100,.42)],O=[400*v[0]/(v[0]+27.13),400*v[1]/(v[1]+27.13),400*v[2]/(v[2]+27.13)],H=(2*O[0]+O[1]+.05*O[2])*N;return new j(R,H,N,E,k,D,m,B,Math.pow(B,.25),V)}constructor(e,t,n,a,s,i,u,l,f,p){this.n=e,this.aw=t,this.nbb=n,this.ncb=a,this.c=s,this.nc=i,this.rgbD=u,this.fl=l,this.fLRoot=f,this.z=p}}j.DEFAULT=j.make();/**
47
- * @license
48
- * Copyright 2021 Google LLC
49
- *
50
- * Licensed under the Apache License, Version 2.0 (the "License");
51
- * you may not use this file except in compliance with the License.
52
- * You may obtain a copy of the License at
53
- *
54
- * http://www.apache.org/licenses/LICENSE-2.0
55
- *
56
- * Unless required by applicable law or agreed to in writing, software
57
- * distributed under the License is distributed on an "AS IS" BASIS,
58
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
59
- * See the License for the specific language governing permissions and
60
- * limitations under the License.
61
- */class _{constructor(e,t,n,a,s,i,u,l,f){this.hue=e,this.chroma=t,this.j=n,this.q=a,this.m=s,this.s=i,this.jstar=u,this.astar=l,this.bstar=f}distance(e){const t=this.jstar-e.jstar,n=this.astar-e.astar,a=this.bstar-e.bstar,s=Math.sqrt(t*t+n*n+a*a);return 1.41*Math.pow(s,.63)}static fromInt(e){return _.fromIntInViewingConditions(e,j.DEFAULT)}static fromIntInViewingConditions(e,t){const n=(e&16711680)>>16,a=(e&65280)>>8,s=e&255,i=ie(n),u=ie(a),l=ie(s),f=.41233895*i+.35762064*u+.18051042*l,p=.2126*i+.7152*u+.0722*l,k=.01932141*i+.11916382*u+.95034478*l,d=.401288*f+.650173*p-.051461*k,D=-.250268*f+1.204414*p+.045854*k,m=-.002079*f+.048952*p+.953127*k,g=t.rgbD[0]*d,P=t.rgbD[1]*D,M=t.rgbD[2]*m,B=Math.pow(t.fl*Math.abs(g)/100,.42),R=Math.pow(t.fl*Math.abs(P)/100,.42),V=Math.pow(t.fl*Math.abs(M)/100,.42),N=K(g)*400*B/(B+27.13),E=K(P)*400*R/(R+27.13),v=K(M)*400*V/(V+27.13),O=(11*N+-12*E+v)/11,H=(N+E-2*v)/9,L=(20*N+20*E+21*v)/20,$=(40*N+20*E+v)/20,ae=Math.atan2(H,O)*180/Math.PI,q=me(ae),he=q*Math.PI/180,fe=$*t.nbb,ee=100*Math.pow(fe/t.aw,t.c*t.z),pe=4/t.c*Math.sqrt(ee/100)*(t.aw+4)*t.fLRoot,ye=q<20.14?q+360:q,ge=.25*(Math.cos(ye*Math.PI/180+2)+3.8),Se=5e4/13*ge*t.nc*t.ncb*Math.sqrt(O*O+H*H)/(L+.305),de=Math.pow(Se,.9)*Math.pow(1.64-Math.pow(.29,t.n),.73),Ae=de*Math.sqrt(ee/100),Me=Ae*t.fLRoot,Xe=50*Math.sqrt(de*t.c/(t.aw+4)),$e=(1+100*.007)*ee/(1+.007*ee),Ie=1/.0228*Math.log(1+.0228*Me),Je=Ie*Math.cos(he),We=Ie*Math.sin(he);return new _(q,Ae,ee,pe,Me,Xe,$e,Je,We)}static fromJch(e,t,n){return _.fromJchInViewingConditions(e,t,n,j.DEFAULT)}static fromJchInViewingConditions(e,t,n,a){const s=4/a.c*Math.sqrt(e/100)*(a.aw+4)*a.fLRoot,i=t*a.fLRoot,u=t/Math.sqrt(e/100),l=50*Math.sqrt(u*a.c/(a.aw+4)),f=n*Math.PI/180,p=(1+100*.007)*e/(1+.007*e),k=1/.0228*Math.log(1+.0228*i),d=k*Math.cos(f),D=k*Math.sin(f);return new _(n,t,e,s,i,l,p,d,D)}static fromUcs(e,t,n){return _.fromUcsInViewingConditions(e,t,n,j.DEFAULT)}static fromUcsInViewingConditions(e,t,n,a){const s=t,i=n,u=Math.sqrt(s*s+i*i),f=(Math.exp(u*.0228)-1)/.0228/a.fLRoot;let p=Math.atan2(i,s)*(180/Math.PI);p<0&&(p+=360);const k=e/(1-(e-100)*.007);return _.fromJchInViewingConditions(k,f,p,a)}toInt(){return this.viewed(j.DEFAULT)}viewed(e){const t=this.chroma===0||this.j===0?0:this.chroma/Math.sqrt(this.j/100),n=Math.pow(t/Math.pow(1.64-Math.pow(.29,e.n),.73),1/.9),a=this.hue*Math.PI/180,s=.25*(Math.cos(a+2)+3.8),i=e.aw*Math.pow(this.j/100,1/e.c/e.z),u=s*(5e4/13)*e.nc*e.ncb,l=i/e.nbb,f=Math.sin(a),p=Math.cos(a),k=23*(l+.305)*n/(23*u+11*n*p+108*n*f),d=k*p,D=k*f,m=(460*l+451*d+288*D)/1403,g=(460*l-891*d-261*D)/1403,P=(460*l-220*d-6300*D)/1403,M=Math.max(0,27.13*Math.abs(m)/(400-Math.abs(m))),B=K(m)*(100/e.fl)*Math.pow(M,1/.42),R=Math.max(0,27.13*Math.abs(g)/(400-Math.abs(g))),V=K(g)*(100/e.fl)*Math.pow(R,1/.42),N=Math.max(0,27.13*Math.abs(P)/(400-Math.abs(P))),E=K(P)*(100/e.fl)*Math.pow(N,1/.42),v=B/e.rgbD[0],O=V/e.rgbD[1],H=E/e.rgbD[2],L=1.86206786*v-1.01125463*O+.14918677*H,$=.38752654*v+.62144744*O-.00897398*H,Q=-.0158415*v-.03412294*O+1.04996444*H;return at(L,$,Q)}static fromXyzInViewingConditions(e,t,n,a){const s=.401288*e+.650173*t-.051461*n,i=-.250268*e+1.204414*t+.045854*n,u=-.002079*e+.048952*t+.953127*n,l=a.rgbD[0]*s,f=a.rgbD[1]*i,p=a.rgbD[2]*u,k=Math.pow(a.fl*Math.abs(l)/100,.42),d=Math.pow(a.fl*Math.abs(f)/100,.42),D=Math.pow(a.fl*Math.abs(p)/100,.42),m=K(l)*400*k/(k+27.13),g=K(f)*400*d/(d+27.13),P=K(p)*400*D/(D+27.13),M=(11*m+-12*g+P)/11,B=(m+g-2*P)/9,R=(20*m+20*g+21*P)/20,V=(40*m+20*g+P)/20,E=Math.atan2(B,M)*180/Math.PI,v=E<0?E+360:E>=360?E-360:E,O=v*Math.PI/180,H=V*a.nbb,L=100*Math.pow(H/a.aw,a.c*a.z),$=4/a.c*Math.sqrt(L/100)*(a.aw+4)*a.fLRoot,Q=v<20.14?v+360:v,ae=1/4*(Math.cos(Q*Math.PI/180+2)+3.8),he=5e4/13*ae*a.nc*a.ncb*Math.sqrt(M*M+B*B)/(R+.305),fe=Math.pow(he,.9)*Math.pow(1.64-Math.pow(.29,a.n),.73),ee=fe*Math.sqrt(L/100),pe=ee*a.fLRoot,ye=50*Math.sqrt(fe*a.c/(a.aw+4)),ge=(1+100*.007)*L/(1+.007*L),Pe=Math.log(1+.0228*pe)/.0228,Se=Pe*Math.cos(O),de=Pe*Math.sin(O);return new _(v,ee,L,$,pe,ye,ge,Se,de)}xyzInViewingConditions(e){const t=this.chroma===0||this.j===0?0:this.chroma/Math.sqrt(this.j/100),n=Math.pow(t/Math.pow(1.64-Math.pow(.29,e.n),.73),1/.9),a=this.hue*Math.PI/180,s=.25*(Math.cos(a+2)+3.8),i=e.aw*Math.pow(this.j/100,1/e.c/e.z),u=s*(5e4/13)*e.nc*e.ncb,l=i/e.nbb,f=Math.sin(a),p=Math.cos(a),k=23*(l+.305)*n/(23*u+11*n*p+108*n*f),d=k*p,D=k*f,m=(460*l+451*d+288*D)/1403,g=(460*l-891*d-261*D)/1403,P=(460*l-220*d-6300*D)/1403,M=Math.max(0,27.13*Math.abs(m)/(400-Math.abs(m))),B=K(m)*(100/e.fl)*Math.pow(M,1/.42),R=Math.max(0,27.13*Math.abs(g)/(400-Math.abs(g))),V=K(g)*(100/e.fl)*Math.pow(R,1/.42),N=Math.max(0,27.13*Math.abs(P)/(400-Math.abs(P))),E=K(P)*(100/e.fl)*Math.pow(N,1/.42),v=B/e.rgbD[0],O=V/e.rgbD[1],H=E/e.rgbD[2],L=1.86206786*v-1.01125463*O+.14918677*H,$=.38752654*v+.62144744*O-.00897398*H,Q=-.0158415*v-.03412294*O+1.04996444*H;return[L,$,Q]}}/**
62
- * @license
63
- * Copyright 2021 Google LLC
64
- *
65
- * Licensed under the Apache License, Version 2.0 (the "License");
66
- * you may not use this file except in compliance with the License.
67
- * You may obtain a copy of the License at
68
- *
69
- * http://www.apache.org/licenses/LICENSE-2.0
70
- *
71
- * Unless required by applicable law or agreed to in writing, software
72
- * distributed under the License is distributed on an "AS IS" BASIS,
73
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
74
- * See the License for the specific language governing permissions and
75
- * limitations under the License.
76
- */class C{static sanitizeRadians(e){return(e+Math.PI*8)%(Math.PI*2)}static trueDelinearized(e){const t=e/100;let n=0;return t<=.0031308?n=t*12.92:n=1.055*Math.pow(t,1/2.4)-.055,n*255}static chromaticAdaptation(e){const t=Math.pow(Math.abs(e),.42);return K(e)*400*t/(t+27.13)}static hueOf(e){const t=ke(e,C.SCALED_DISCOUNT_FROM_LINRGB),n=C.chromaticAdaptation(t[0]),a=C.chromaticAdaptation(t[1]),s=C.chromaticAdaptation(t[2]),i=(11*n+-12*a+s)/11,u=(n+a-2*s)/9;return Math.atan2(u,i)}static areInCyclicOrder(e,t,n){const a=C.sanitizeRadians(t-e),s=C.sanitizeRadians(n-e);return a<s}static intercept(e,t,n){return(t-e)/(n-e)}static lerpPoint(e,t,n){return[e[0]+(n[0]-e[0])*t,e[1]+(n[1]-e[1])*t,e[2]+(n[2]-e[2])*t]}static setCoordinate(e,t,n,a){const s=C.intercept(e[a],t,n[a]);return C.lerpPoint(e,s,n)}static isBounded(e){return 0<=e&&e<=100}static nthVertex(e,t){const n=C.Y_FROM_LINRGB[0],a=C.Y_FROM_LINRGB[1],s=C.Y_FROM_LINRGB[2],i=t%4<=1?0:100,u=t%2===0?0:100;if(t<4){const l=i,f=u,p=(e-l*a-f*s)/n;return C.isBounded(p)?[p,l,f]:[-1,-1,-1]}else if(t<8){const l=i,f=u,p=(e-f*n-l*s)/a;return C.isBounded(p)?[f,p,l]:[-1,-1,-1]}else{const l=i,f=u,p=(e-l*n-f*a)/s;return C.isBounded(p)?[l,f,p]:[-1,-1,-1]}}static bisectToSegment(e,t){let n=[-1,-1,-1],a=n,s=0,i=0,u=!1,l=!0;for(let f=0;f<12;f++){const p=C.nthVertex(e,f);if(p[0]<0)continue;const k=C.hueOf(p);if(!u){n=p,a=p,s=k,i=k,u=!0;continue}(l||C.areInCyclicOrder(s,k,i))&&(l=!1,C.areInCyclicOrder(s,t,k)?(a=p,i=k):(n=p,s=k))}return[n,a]}static midpoint(e,t){return[(e[0]+t[0])/2,(e[1]+t[1])/2,(e[2]+t[2])/2]}static criticalPlaneBelow(e){return Math.floor(e-.5)}static criticalPlaneAbove(e){return Math.ceil(e-.5)}static bisectToLimit(e,t){const n=C.bisectToSegment(e,t);let a=n[0],s=C.hueOf(a),i=n[1];for(let u=0;u<3;u++)if(a[u]!==i[u]){let l=-1,f=255;a[u]<i[u]?(l=C.criticalPlaneBelow(C.trueDelinearized(a[u])),f=C.criticalPlaneAbove(C.trueDelinearized(i[u]))):(l=C.criticalPlaneAbove(C.trueDelinearized(a[u])),f=C.criticalPlaneBelow(C.trueDelinearized(i[u])));for(let p=0;p<8&&!(Math.abs(f-l)<=1);p++){const k=Math.floor((l+f)/2),d=C.CRITICAL_PLANES[k],D=C.setCoordinate(a,d,i,u),m=C.hueOf(D);C.areInCyclicOrder(s,t,m)?(i=D,f=k):(a=D,s=m,l=k)}}return C.midpoint(a,i)}static inverseChromaticAdaptation(e){const t=Math.abs(e),n=Math.max(0,27.13*t/(400-t));return K(e)*Math.pow(n,1/.42)}static findResultByJ(e,t,n){let a=Math.sqrt(n)*11;const s=j.DEFAULT,i=1/Math.pow(1.64-Math.pow(.29,s.n),.73),l=.25*(Math.cos(e+2)+3.8)*(5e4/13)*s.nc*s.ncb,f=Math.sin(e),p=Math.cos(e);for(let k=0;k<5;k++){const d=a/100,D=t===0||a===0?0:t/Math.sqrt(d),m=Math.pow(D*i,1/.9),P=s.aw*Math.pow(d,1/s.c/s.z)/s.nbb,M=23*(P+.305)*m/(23*l+11*m*p+108*m*f),B=M*p,R=M*f,V=(460*P+451*B+288*R)/1403,N=(460*P-891*B-261*R)/1403,E=(460*P-220*B-6300*R)/1403,v=C.inverseChromaticAdaptation(V),O=C.inverseChromaticAdaptation(N),H=C.inverseChromaticAdaptation(E),L=ke([v,O,H],C.LINRGB_FROM_SCALED_DISCOUNT);if(L[0]<0||L[1]<0||L[2]<0)return 0;const $=C.Y_FROM_LINRGB[0],Q=C.Y_FROM_LINRGB[1],ae=C.Y_FROM_LINRGB[2],q=$*L[0]+Q*L[1]+ae*L[2];if(q<=0)return 0;if(k===4||Math.abs(q-n)<.002)return L[0]>100.01||L[1]>100.01||L[2]>100.01?0:Ee(L);a=a-(q-n)*a/(2*q)}return 0}static solveToInt(e,t,n){if(t<1e-4||n<1e-4||n>99.9999)return it(n);e=me(e);const a=e/180*Math.PI,s=re(n),i=C.findResultByJ(a,t,s);if(i!==0)return i;const u=C.bisectToLimit(s,a);return Ee(u)}static solveToCam(e,t,n){return _.fromInt(C.solveToInt(e,t,n))}}C.SCALED_DISCOUNT_FROM_LINRGB=[[.001200833568784504,.002389694492170889,.0002795742885861124],[.0005891086651375999,.0029785502573438758,.0003270666104008398],[.00010146692491640572,.0005364214359186694,.0032979401770712076]];C.LINRGB_FROM_SCALED_DISCOUNT=[[1373.2198709594231,-1100.4251190754821,-7.278681089101213],[-271.815969077903,559.6580465940733,-32.46047482791194],[1.9622899599665666,-57.173814538844006,308.7233197812385]];C.Y_FROM_LINRGB=[.2126,.7152,.0722];C.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];/**
77
- * @license
78
- * Copyright 2021 Google LLC
79
- *
80
- * Licensed under the Apache License, Version 2.0 (the "License");
81
- * you may not use this file except in compliance with the License.
82
- * You may obtain a copy of the License at
83
- *
84
- * http://www.apache.org/licenses/LICENSE-2.0
85
- *
86
- * Unless required by applicable law or agreed to in writing, software
87
- * distributed under the License is distributed on an "AS IS" BASIS,
88
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
89
- * See the License for the specific language governing permissions and
90
- * limitations under the License.
91
- */class b{static from(e,t,n){return new b(C.solveToInt(e,t,n))}static fromInt(e){return new b(e)}toInt(){return this.argb}get hue(){return this.internalHue}set hue(e){this.setInternalState(C.solveToInt(e,this.internalChroma,this.internalTone))}get chroma(){return this.internalChroma}set chroma(e){this.setInternalState(C.solveToInt(this.internalHue,e,this.internalTone))}get tone(){return this.internalTone}set tone(e){this.setInternalState(C.solveToInt(this.internalHue,this.internalChroma,e))}setValue(e,t){this[e]=t}toString(){return`HCT(${this.hue.toFixed(0)}, ${this.chroma.toFixed(0)}, ${this.tone.toFixed(0)})`}static isBlue(e){return e>=250&&e<270}static isYellow(e){return e>=105&&e<125}static isCyan(e){return e>=170&&e<207}constructor(e){this.argb=e;const t=_.fromInt(e);this.internalHue=t.hue,this.internalChroma=t.chroma,this.internalTone=Ce(e),this.argb=e}setInternalState(e){const t=_.fromInt(e);this.internalHue=t.hue,this.internalChroma=t.chroma,this.internalTone=Ce(e),this.argb=e}inViewingConditions(e){const n=_.fromInt(this.toInt()).xyzInViewingConditions(e),a=_.fromXyzInViewingConditions(n[0],n[1],n[2],j.make());return b.from(a.hue,a.chroma,be(n[1]))}}/**
92
- * @license
93
- * Copyright 2021 Google LLC
94
- *
95
- * Licensed under the Apache License, Version 2.0 (the "License");
96
- * you may not use this file except in compliance with the License.
97
- * You may obtain a copy of the License at
98
- *
99
- * http://www.apache.org/licenses/LICENSE-2.0
100
- *
101
- * Unless required by applicable law or agreed to in writing, software
102
- * distributed under the License is distributed on an "AS IS" BASIS,
103
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
104
- * See the License for the specific language governing permissions and
105
- * limitations under the License.
106
- */class we{static harmonize(e,t){const n=b.fromInt(e),a=b.fromInt(t),s=et(n.hue,a.hue),i=Math.min(s*.5,15),u=me(n.hue+i*Qe(n.hue,a.hue));return b.from(u,n.chroma,n.tone).toInt()}static hctHue(e,t,n){const a=we.cam16Ucs(e,t,n),s=_.fromInt(a),i=_.fromInt(e);return b.from(s.hue,i.chroma,Ce(e)).toInt()}static cam16Ucs(e,t,n){const a=_.fromInt(e),s=_.fromInt(t),i=a.jstar,u=a.astar,l=a.bstar,f=s.jstar,p=s.astar,k=s.bstar,d=i+(f-i)*n,D=u+(p-u)*n,m=l+(k-l)*n;return _.fromUcs(d,D,m).toInt()}}/**
107
- * @license
108
- * Copyright 2022 Google LLC
109
- *
110
- * Licensed under the Apache License, Version 2.0 (the "License");
111
- * you may not use this file except in compliance with the License.
112
- * You may obtain a copy of the License at
113
- *
114
- * http://www.apache.org/licenses/LICENSE-2.0
115
- *
116
- * Unless required by applicable law or agreed to in writing, software
117
- * distributed under the License is distributed on an "AS IS" BASIS,
118
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
119
- * See the License for the specific language governing permissions and
120
- * limitations under the License.
121
- */class A{static ratioOfTones(e,t){return e=U(0,100,e),t=U(0,100,t),A.ratioOfYs(re(e),re(t))}static ratioOfYs(e,t){const n=e>t?e:t,a=n===t?e:t;return(n+5)/(a+5)}static lighter(e,t){if(e<0||e>100)return-1;const n=re(e),a=t*(n+5)-5,s=A.ratioOfYs(a,n),i=Math.abs(s-t);if(s<t&&i>.04)return-1;const u=be(a)+.4;return u<0||u>100?-1:u}static darker(e,t){if(e<0||e>100)return-1;const n=re(e),a=(n+5)/t-5,s=A.ratioOfYs(n,a),i=Math.abs(s-t);if(s<t&&i>.04)return-1;const u=be(a)-.4;return u<0||u>100?-1:u}static lighterUnsafe(e,t){const n=A.lighter(e,t);return n<0?100:n}static darkerUnsafe(e,t){const n=A.darker(e,t);return n<0?0:n}}/**
122
- * @license
123
- * Copyright 2023 Google LLC
124
- *
125
- * Licensed under the Apache License, Version 2.0 (the "License");
126
- * you may not use this file except in compliance with the License.
127
- * You may obtain a copy of the License at
128
- *
129
- * http://www.apache.org/licenses/LICENSE-2.0
130
- *
131
- * Unless required by applicable law or agreed to in writing, software
132
- * distributed under the License is distributed on an "AS IS" BASIS,
133
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
134
- * See the License for the specific language governing permissions and
135
- * limitations under the License.
136
- */class Fe{static isDisliked(e){const t=Math.round(e.hue)>=90&&Math.round(e.hue)<=111,n=Math.round(e.chroma)>16,a=Math.round(e.tone)<65;return t&&n&&a}static fixIfDisliked(e){return Fe.isDisliked(e)?b.from(e.hue,e.chroma,70):e}}/**
137
- * @license
138
- * Copyright 2022 Google LLC
139
- *
140
- * Licensed under the Apache License, Version 2.0 (the "License");
141
- * you may not use this file except in compliance with the License.
142
- * You may obtain a copy of the License at
143
- *
144
- * http://www.apache.org/licenses/LICENSE-2.0
145
- *
146
- * Unless required by applicable law or agreed to in writing, software
147
- * distributed under the License is distributed on an "AS IS" BASIS,
148
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
149
- * See the License for the specific language governing permissions and
150
- * limitations under the License.
151
- */function ut(r,e,t){if(r.name!==t.name)throw new Error(`Attempting to extend color ${r.name} with color ${t.name} of different name for spec version ${e}.`);if(r.isBackground!==t.isBackground)throw new Error(`Attempting to extend color ${r.name} as a ${r.isBackground?"background":"foreground"} with color ${t.name} as a ${t.isBackground?"background":"foreground"} for spec version ${e}.`)}function T(r,e,t){return ut(r,e,t),c.fromPalette({name:r.name,palette:n=>n.specVersion===e?t.palette(n):r.palette(n),tone:n=>n.specVersion===e?t.tone(n):r.tone(n),isBackground:r.isBackground,chromaMultiplier:n=>{const a=n.specVersion===e?t.chromaMultiplier:r.chromaMultiplier;return a!==void 0?a(n):1},background:n=>{const a=n.specVersion===e?t.background:r.background;return a!==void 0?a(n):void 0},secondBackground:n=>{const a=n.specVersion===e?t.secondBackground:r.secondBackground;return a!==void 0?a(n):void 0},contrastCurve:n=>{const a=n.specVersion===e?t.contrastCurve:r.contrastCurve;return a!==void 0?a(n):void 0},toneDeltaPair:n=>{const a=n.specVersion===e?t.toneDeltaPair:r.toneDeltaPair;return a!==void 0?a(n):void 0}})}class c{static fromPalette(e){return new c(e.name??"",e.palette,e.tone??c.getInitialToneFromBackground(e.background),e.isBackground??!1,e.chromaMultiplier,e.background,e.secondBackground,e.contrastCurve,e.toneDeltaPair)}static getInitialToneFromBackground(e){return e===void 0?t=>50:t=>e(t)?e(t).getTone(t):50}constructor(e,t,n,a,s,i,u,l,f){if(this.name=e,this.palette=t,this.tone=n,this.isBackground=a,this.chromaMultiplier=s,this.background=i,this.secondBackground=u,this.contrastCurve=l,this.toneDeltaPair=f,this.hctCache=new Map,!i&&u)throw new Error(`Color ${e} has secondBackgrounddefined, but background is not defined.`);if(!i&&l)throw new Error(`Color ${e} has contrastCurvedefined, but background is not defined.`);if(i&&!l)throw new Error(`Color ${e} has backgrounddefined, but contrastCurve is not defined.`)}clone(){return c.fromPalette({name:this.name,palette:this.palette,tone:this.tone,isBackground:this.isBackground,chromaMultiplier:this.chromaMultiplier,background:this.background,secondBackground:this.secondBackground,contrastCurve:this.contrastCurve,toneDeltaPair:this.toneDeltaPair})}clearCache(){this.hctCache.clear()}getArgb(e){return this.getHct(e).toInt()}getHct(e){const t=this.hctCache.get(e);if(t!=null)return t;const n=Le(e.specVersion).getHct(e,this);return this.hctCache.size>4&&this.hctCache.clear(),this.hctCache.set(e,n),n}getTone(e){return Le(e.specVersion).getTone(e,this)}static foregroundTone(e,t){const n=A.lighterUnsafe(e,t),a=A.darkerUnsafe(e,t),s=A.ratioOfTones(n,e),i=A.ratioOfTones(a,e);if(c.tonePrefersLightForeground(e)){const l=Math.abs(s-i)<.1&&s<t&&i<t;return s>=t||s>=i||l?n:a}else return i>=t||i>=s?a:n}static tonePrefersLightForeground(e){return Math.round(e)<60}static toneAllowsLightForeground(e){return Math.round(e)<=49}static enableLightForeground(e){return c.tonePrefersLightForeground(e)&&!c.toneAllowsLightForeground(e)?49:e}}class lt{getHct(e,t){const n=t.getTone(e);return t.palette(e).getHct(n)}getTone(e,t){const n=e.contrastLevel<0,a=t.toneDeltaPair?t.toneDeltaPair(e):void 0;if(a){const s=a.roleA,i=a.roleB,u=a.delta,l=a.polarity,f=a.stayTogether,p=l==="nearer"||l==="lighter"&&!e.isDark||l==="darker"&&e.isDark,k=p?s:i,d=p?i:s,D=t.name===k.name,m=e.isDark?1:-1;let g=k.tone(e),P=d.tone(e);if(t.background&&k.contrastCurve&&d.contrastCurve){const M=t.background(e),B=k.contrastCurve(e),R=d.contrastCurve(e);if(M&&B&&R){const V=M.getTone(e),N=B.get(e.contrastLevel),E=R.get(e.contrastLevel);A.ratioOfTones(V,g)<N&&(g=c.foregroundTone(V,N)),A.ratioOfTones(V,P)<E&&(P=c.foregroundTone(V,E)),n&&(g=c.foregroundTone(V,N),P=c.foregroundTone(V,E))}}return(P-g)*m<u&&(P=U(0,100,g+u*m),(P-g)*m>=u||(g=U(0,100,P-u*m))),50<=g&&g<60?m>0?(g=60,P=Math.max(P,g+u*m)):(g=49,P=Math.min(P,g+u*m)):50<=P&&P<60&&(f?m>0?(g=60,P=Math.max(P,g+u*m)):(g=49,P=Math.min(P,g+u*m)):m>0?P=60:P=49),D?g:P}else{let s=t.tone(e);if(t.background==null||t.background(e)===void 0||t.contrastCurve==null||t.contrastCurve(e)===void 0)return s;const i=t.background(e).getTone(e),u=t.contrastCurve(e).get(e.contrastLevel);if(A.ratioOfTones(i,s)>=u||(s=c.foregroundTone(i,u)),n&&(s=c.foregroundTone(i,u)),t.isBackground&&50<=s&&s<60&&(A.ratioOfTones(49,i)>=u?s=49:s=60),t.secondBackground==null||t.secondBackground(e)===void 0)return s;const[l,f]=[t.background,t.secondBackground],[p,k]=[l(e).getTone(e),f(e).getTone(e)],[d,D]=[Math.max(p,k),Math.min(p,k)];if(A.ratioOfTones(d,s)>=u&&A.ratioOfTones(D,s)>=u)return s;const m=A.lighter(d,u),g=A.darker(D,u),P=[];return m!==-1&&P.push(m),g!==-1&&P.push(g),c.tonePrefersLightForeground(p)||c.tonePrefersLightForeground(k)?m<0?100:m:P.length===1?P[0]:g<0?0:g}}}class ht{getHct(e,t){const n=t.palette(e),a=t.getTone(e),s=n.hue,i=n.chroma*(t.chromaMultiplier?t.chromaMultiplier(e):1);return b.from(s,i,a)}getTone(e,t){const n=t.toneDeltaPair?t.toneDeltaPair(e):void 0;if(n){const a=n.roleA,s=n.roleB,i=n.polarity,u=n.constraint,l=i==="darker"||i==="relative_lighter"&&e.isDark||i==="relative_darker"&&!e.isDark?-n.delta:n.delta,f=t.name===a.name,p=f?a:s,k=f?s:a;let d=p.tone(e),D=k.getTone(e);const m=l*(f?1:-1);if(u==="exact"?d=U(0,100,D+m):u==="nearer"?m>0?d=U(0,100,U(D,D+m,d)):d=U(0,100,U(D+m,D,d)):u==="farther"&&(m>0?d=U(D+m,100,d):d=U(0,D+m,d)),t.background&&t.contrastCurve){const g=t.background(e),P=t.contrastCurve(e);if(g&&P){const M=g.getTone(e),B=P.get(e.contrastLevel);d=A.ratioOfTones(M,d)>=B&&e.contrastLevel>=0?d:c.foregroundTone(M,B)}}return t.isBackground&&!t.name.endsWith("_fixed_dim")&&(d>=57?d=U(65,100,d):d=U(0,49,d)),d}else{let a=t.tone(e);if(t.background==null||t.background(e)===void 0||t.contrastCurve==null||t.contrastCurve(e)===void 0)return a;const s=t.background(e).getTone(e),i=t.contrastCurve(e).get(e.contrastLevel);if(a=A.ratioOfTones(s,a)>=i&&e.contrastLevel>=0?a:c.foregroundTone(s,i),t.isBackground&&!t.name.endsWith("_fixed_dim")&&(a>=57?a=U(65,100,a):a=U(0,49,a)),t.secondBackground==null||t.secondBackground(e)===void 0)return a;const[u,l]=[t.background,t.secondBackground],[f,p]=[u(e).getTone(e),l(e).getTone(e)],[k,d]=[Math.max(f,p),Math.min(f,p)];if(A.ratioOfTones(k,a)>=i&&A.ratioOfTones(d,a)>=i)return a;const D=A.lighter(k,i),m=A.darker(d,i),g=[];return D!==-1&&g.push(D),m!==-1&&g.push(m),c.tonePrefersLightForeground(f)||c.tonePrefersLightForeground(p)?D<0?100:D:g.length===1?g[0]:m<0?0:m}}}const ft=new lt,pt=new ht;function Le(r){return r==="2025"?pt:ft}/**
152
- * @license
153
- * Copyright 2021 Google LLC
154
- *
155
- * Licensed under the Apache License, Version 2.0 (the "License");
156
- * you may not use this file except in compliance with the License.
157
- * You may obtain a copy of the License at
158
- *
159
- * http://www.apache.org/licenses/LICENSE-2.0
160
- *
161
- * Unless required by applicable law or agreed to in writing, software
162
- * distributed under the License is distributed on an "AS IS" BASIS,
163
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
164
- * See the License for the specific language governing permissions and
165
- * limitations under the License.
166
- */class G{static fromInt(e){const t=b.fromInt(e);return G.fromHct(t)}static fromHct(e){return new G(e.hue,e.chroma,e)}static fromHueAndChroma(e,t){const n=new dt(e,t).create();return new G(e,t,n)}constructor(e,t,n){this.hue=e,this.chroma=t,this.keyColor=n,this.cache=new Map}tone(e){let t=this.cache.get(e);return t===void 0&&(e==99&&b.isYellow(this.hue)?t=this.averageArgb(this.tone(98),this.tone(100)):t=b.from(this.hue,this.chroma,e).toInt(),this.cache.set(e,t)),t}getHct(e){return b.fromInt(this.tone(e))}averageArgb(e,t){const n=e>>>16&255,a=e>>>8&255,s=e&255,i=t>>>16&255,u=t>>>8&255,l=t&255,f=Math.round((n+i)/2),p=Math.round((a+u)/2),k=Math.round((s+l)/2);return(255<<24|(f&255)<<16|(p&255)<<8|k&255)>>>0}}class dt{constructor(e,t){this.hue=e,this.requestedChroma=t,this.chromaCache=new Map,this.maxChromaValue=200}create(){let a=0,s=100;for(;a<s;){const i=Math.floor((a+s)/2),u=this.maxChroma(i)<this.maxChroma(i+1);if(this.maxChroma(i)>=this.requestedChroma-.01)if(Math.abs(a-50)<Math.abs(s-50))s=i;else{if(a===i)return b.from(this.hue,this.requestedChroma,a);a=i}else u?a=i+1:s=i}return b.from(this.hue,this.requestedChroma,a)}maxChroma(e){if(this.chromaCache.has(e))return this.chromaCache.get(e);const t=b.from(this.hue,this.maxChromaValue,e).chroma;return this.chromaCache.set(e,t),t}}/**
167
- * @license
168
- * Copyright 2023 Google LLC
169
- *
170
- * Licensed under the Apache License, Version 2.0 (the "License");
171
- * you may not use this file except in compliance with the License.
172
- * You may obtain a copy of the License at
173
- *
174
- * http://www.apache.org/licenses/LICENSE-2.0
175
- *
176
- * Unless required by applicable law or agreed to in writing, software
177
- * distributed under the License is distributed on an "AS IS" BASIS,
178
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
179
- * See the License for the specific language governing permissions and
180
- * limitations under the License.
181
- */class y{constructor(e,t,n,a){this.low=e,this.normal=t,this.medium=n,this.high=a}get(e){return e<=-1?this.low:e<0?se(this.low,this.normal,(e- -1)/1):e<.5?se(this.normal,this.medium,(e-0)/.5):e<1?se(this.medium,this.high,(e-.5)/.5):this.high}}/**
182
- * @license
183
- * Copyright 2023 Google LLC
184
- *
185
- * Licensed under the Apache License, Version 2.0 (the "License");
186
- * you may not use this file except in compliance with the License.
187
- * You may obtain a copy of the License at
188
- *
189
- * http://www.apache.org/licenses/LICENSE-2.0
190
- *
191
- * Unless required by applicable law or agreed to in writing, software
192
- * distributed under the License is distributed on an "AS IS" BASIS,
193
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
194
- * See the License for the specific language governing permissions and
195
- * limitations under the License.
196
- */class x{constructor(e,t,n,a,s,i){this.roleA=e,this.roleB=t,this.delta=n,this.polarity=a,this.stayTogether=s,this.constraint=i,this.constraint=i??"exact"}}/**
197
- * @license
198
- * Copyright 2022 Google LLC
199
- *
200
- * Licensed under the Apache License, Version 2.0 (the "License");
201
- * you may not use this file except in compliance with the License.
202
- * You may obtain a copy of the License at
203
- *
204
- * http://www.apache.org/licenses/LICENSE-2.0
205
- *
206
- * Unless required by applicable law or agreed to in writing, software
207
- * distributed under the License is distributed on an "AS IS" BASIS,
208
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
209
- * See the License for the specific language governing permissions and
210
- * limitations under the License.
211
- */var h;(function(r){r[r.MONOCHROME=0]="MONOCHROME",r[r.NEUTRAL=1]="NEUTRAL",r[r.TONAL_SPOT=2]="TONAL_SPOT",r[r.VIBRANT=3]="VIBRANT",r[r.EXPRESSIVE=4]="EXPRESSIVE",r[r.FIDELITY=5]="FIDELITY",r[r.CONTENT=6]="CONTENT",r[r.RAINBOW=7]="RAINBOW",r[r.FRUIT_SALAD=8]="FRUIT_SALAD"})(h||(h={}));/**
212
- * @license
213
- * Copyright 2025 Google LLC
214
- *
215
- * Licensed under the Apache License, Version 2.0 (the "License");
216
- * you may not use this file except in compliance with the License.
217
- * You may obtain a copy of the License at
218
- *
219
- * http://www.apache.org/licenses/LICENSE-2.0
220
- *
221
- * Unless required by applicable law or agreed to in writing, software
222
- * distributed under the License is distributed on an "AS IS" BASIS,
223
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
224
- * See the License for the specific language governing permissions and
225
- * limitations under the License.
226
- */function oe(r){return r.variant===h.FIDELITY||r.variant===h.CONTENT}function I(r){return r.variant===h.MONOCHROME}function mt(r,e,t,n){let a=t,s=b.from(r,e,t);if(s.chroma<e){let i=s.chroma;for(;s.chroma<e;){a+=n?-1:1;const u=b.from(r,e,a);if(i>u.chroma||Math.abs(u.chroma-e)<.4)break;const l=Math.abs(u.chroma-e),f=Math.abs(s.chroma-e);l<f&&(s=u),i=Math.max(i,u.chroma)}}return a}class yt{primaryPaletteKeyColor(){return c.fromPalette({name:"primary_palette_key_color",palette:e=>e.primaryPalette,tone:e=>e.primaryPalette.keyColor.tone})}secondaryPaletteKeyColor(){return c.fromPalette({name:"secondary_palette_key_color",palette:e=>e.secondaryPalette,tone:e=>e.secondaryPalette.keyColor.tone})}tertiaryPaletteKeyColor(){return c.fromPalette({name:"tertiary_palette_key_color",palette:e=>e.tertiaryPalette,tone:e=>e.tertiaryPalette.keyColor.tone})}neutralPaletteKeyColor(){return c.fromPalette({name:"neutral_palette_key_color",palette:e=>e.neutralPalette,tone:e=>e.neutralPalette.keyColor.tone})}neutralVariantPaletteKeyColor(){return c.fromPalette({name:"neutral_variant_palette_key_color",palette:e=>e.neutralVariantPalette,tone:e=>e.neutralVariantPalette.keyColor.tone})}errorPaletteKeyColor(){return c.fromPalette({name:"error_palette_key_color",palette:e=>e.errorPalette,tone:e=>e.errorPalette.keyColor.tone})}background(){return c.fromPalette({name:"background",palette:e=>e.neutralPalette,tone:e=>e.isDark?6:98,isBackground:!0})}onBackground(){return c.fromPalette({name:"on_background",palette:e=>e.neutralPalette,tone:e=>e.isDark?90:10,background:e=>this.background(),contrastCurve:e=>new y(3,3,4.5,7)})}surface(){return c.fromPalette({name:"surface",palette:e=>e.neutralPalette,tone:e=>e.isDark?6:98,isBackground:!0})}surfaceDim(){return c.fromPalette({name:"surface_dim",palette:e=>e.neutralPalette,tone:e=>e.isDark?6:new y(87,87,80,75).get(e.contrastLevel),isBackground:!0})}surfaceBright(){return c.fromPalette({name:"surface_bright",palette:e=>e.neutralPalette,tone:e=>e.isDark?new y(24,24,29,34).get(e.contrastLevel):98,isBackground:!0})}surfaceContainerLowest(){return c.fromPalette({name:"surface_container_lowest",palette:e=>e.neutralPalette,tone:e=>e.isDark?new y(4,4,2,0).get(e.contrastLevel):100,isBackground:!0})}surfaceContainerLow(){return c.fromPalette({name:"surface_container_low",palette:e=>e.neutralPalette,tone:e=>e.isDark?new y(10,10,11,12).get(e.contrastLevel):new y(96,96,96,95).get(e.contrastLevel),isBackground:!0})}surfaceContainer(){return c.fromPalette({name:"surface_container",palette:e=>e.neutralPalette,tone:e=>e.isDark?new y(12,12,16,20).get(e.contrastLevel):new y(94,94,92,90).get(e.contrastLevel),isBackground:!0})}surfaceContainerHigh(){return c.fromPalette({name:"surface_container_high",palette:e=>e.neutralPalette,tone:e=>e.isDark?new y(17,17,21,25).get(e.contrastLevel):new y(92,92,88,85).get(e.contrastLevel),isBackground:!0})}surfaceContainerHighest(){return c.fromPalette({name:"surface_container_highest",palette:e=>e.neutralPalette,tone:e=>e.isDark?new y(22,22,26,30).get(e.contrastLevel):new y(90,90,84,80).get(e.contrastLevel),isBackground:!0})}onSurface(){return c.fromPalette({name:"on_surface",palette:e=>e.neutralPalette,tone:e=>e.isDark?90:10,background:e=>this.highestSurface(e),contrastCurve:e=>new y(4.5,7,11,21)})}surfaceVariant(){return c.fromPalette({name:"surface_variant",palette:e=>e.neutralVariantPalette,tone:e=>e.isDark?30:90,isBackground:!0})}onSurfaceVariant(){return c.fromPalette({name:"on_surface_variant",palette:e=>e.neutralVariantPalette,tone:e=>e.isDark?80:30,background:e=>this.highestSurface(e),contrastCurve:e=>new y(3,4.5,7,11)})}inverseSurface(){return c.fromPalette({name:"inverse_surface",palette:e=>e.neutralPalette,tone:e=>e.isDark?90:20,isBackground:!0})}inverseOnSurface(){return c.fromPalette({name:"inverse_on_surface",palette:e=>e.neutralPalette,tone:e=>e.isDark?20:95,background:e=>this.inverseSurface(),contrastCurve:e=>new y(4.5,7,11,21)})}outline(){return c.fromPalette({name:"outline",palette:e=>e.neutralVariantPalette,tone:e=>e.isDark?60:50,background:e=>this.highestSurface(e),contrastCurve:e=>new y(1.5,3,4.5,7)})}outlineVariant(){return c.fromPalette({name:"outline_variant",palette:e=>e.neutralVariantPalette,tone:e=>e.isDark?30:80,background:e=>this.highestSurface(e),contrastCurve:e=>new y(1,1,3,4.5)})}shadow(){return c.fromPalette({name:"shadow",palette:e=>e.neutralPalette,tone:e=>0})}scrim(){return c.fromPalette({name:"scrim",palette:e=>e.neutralPalette,tone:e=>0})}surfaceTint(){return c.fromPalette({name:"surface_tint",palette:e=>e.primaryPalette,tone:e=>e.isDark?80:40,isBackground:!0})}primary(){return c.fromPalette({name:"primary",palette:e=>e.primaryPalette,tone:e=>I(e)?e.isDark?100:0:e.isDark?80:40,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new y(3,4.5,7,7),toneDeltaPair:e=>new x(this.primaryContainer(),this.primary(),10,"nearer",!1)})}primaryDim(){}onPrimary(){return c.fromPalette({name:"on_primary",palette:e=>e.primaryPalette,tone:e=>I(e)?e.isDark?10:90:e.isDark?20:100,background:e=>this.primary(),contrastCurve:e=>new y(4.5,7,11,21)})}primaryContainer(){return c.fromPalette({name:"primary_container",palette:e=>e.primaryPalette,tone:e=>oe(e)?e.sourceColorHct.tone:I(e)?e.isDark?85:25:e.isDark?30:90,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new y(1,1,3,4.5),toneDeltaPair:e=>new x(this.primaryContainer(),this.primary(),10,"nearer",!1)})}onPrimaryContainer(){return c.fromPalette({name:"on_primary_container",palette:e=>e.primaryPalette,tone:e=>oe(e)?c.foregroundTone(this.primaryContainer().tone(e),4.5):I(e)?e.isDark?0:100:e.isDark?90:30,background:e=>this.primaryContainer(),contrastCurve:e=>new y(3,4.5,7,11)})}inversePrimary(){return c.fromPalette({name:"inverse_primary",palette:e=>e.primaryPalette,tone:e=>e.isDark?40:80,background:e=>this.inverseSurface(),contrastCurve:e=>new y(3,4.5,7,7)})}secondary(){return c.fromPalette({name:"secondary",palette:e=>e.secondaryPalette,tone:e=>e.isDark?80:40,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new y(3,4.5,7,7),toneDeltaPair:e=>new x(this.secondaryContainer(),this.secondary(),10,"nearer",!1)})}secondaryDim(){}onSecondary(){return c.fromPalette({name:"on_secondary",palette:e=>e.secondaryPalette,tone:e=>I(e)?e.isDark?10:100:e.isDark?20:100,background:e=>this.secondary(),contrastCurve:e=>new y(4.5,7,11,21)})}secondaryContainer(){return c.fromPalette({name:"secondary_container",palette:e=>e.secondaryPalette,tone:e=>{const t=e.isDark?30:90;return I(e)?e.isDark?30:85:oe(e)?mt(e.secondaryPalette.hue,e.secondaryPalette.chroma,t,!e.isDark):t},isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new y(1,1,3,4.5),toneDeltaPair:e=>new x(this.secondaryContainer(),this.secondary(),10,"nearer",!1)})}onSecondaryContainer(){return c.fromPalette({name:"on_secondary_container",palette:e=>e.secondaryPalette,tone:e=>I(e)?e.isDark?90:10:oe(e)?c.foregroundTone(this.secondaryContainer().tone(e),4.5):e.isDark?90:30,background:e=>this.secondaryContainer(),contrastCurve:e=>new y(3,4.5,7,11)})}tertiary(){return c.fromPalette({name:"tertiary",palette:e=>e.tertiaryPalette,tone:e=>I(e)?e.isDark?90:25:e.isDark?80:40,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new y(3,4.5,7,7),toneDeltaPair:e=>new x(this.tertiaryContainer(),this.tertiary(),10,"nearer",!1)})}tertiaryDim(){}onTertiary(){return c.fromPalette({name:"on_tertiary",palette:e=>e.tertiaryPalette,tone:e=>I(e)?e.isDark?10:90:e.isDark?20:100,background:e=>this.tertiary(),contrastCurve:e=>new y(4.5,7,11,21)})}tertiaryContainer(){return c.fromPalette({name:"tertiary_container",palette:e=>e.tertiaryPalette,tone:e=>{if(I(e))return e.isDark?60:49;if(!oe(e))return e.isDark?30:90;const t=e.tertiaryPalette.getHct(e.sourceColorHct.tone);return Fe.fixIfDisliked(t).tone},isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new y(1,1,3,4.5),toneDeltaPair:e=>new x(this.tertiaryContainer(),this.tertiary(),10,"nearer",!1)})}onTertiaryContainer(){return c.fromPalette({name:"on_tertiary_container",palette:e=>e.tertiaryPalette,tone:e=>I(e)?e.isDark?0:100:oe(e)?c.foregroundTone(this.tertiaryContainer().tone(e),4.5):e.isDark?90:30,background:e=>this.tertiaryContainer(),contrastCurve:e=>new y(3,4.5,7,11)})}error(){return c.fromPalette({name:"error",palette:e=>e.errorPalette,tone:e=>e.isDark?80:40,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new y(3,4.5,7,7),toneDeltaPair:e=>new x(this.errorContainer(),this.error(),10,"nearer",!1)})}errorDim(){}onError(){return c.fromPalette({name:"on_error",palette:e=>e.errorPalette,tone:e=>e.isDark?20:100,background:e=>this.error(),contrastCurve:e=>new y(4.5,7,11,21)})}errorContainer(){return c.fromPalette({name:"error_container",palette:e=>e.errorPalette,tone:e=>e.isDark?30:90,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new y(1,1,3,4.5),toneDeltaPair:e=>new x(this.errorContainer(),this.error(),10,"nearer",!1)})}onErrorContainer(){return c.fromPalette({name:"on_error_container",palette:e=>e.errorPalette,tone:e=>I(e)?e.isDark?90:10:e.isDark?90:30,background:e=>this.errorContainer(),contrastCurve:e=>new y(3,4.5,7,11)})}primaryFixed(){return c.fromPalette({name:"primary_fixed",palette:e=>e.primaryPalette,tone:e=>I(e)?40:90,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new y(1,1,3,4.5),toneDeltaPair:e=>new x(this.primaryFixed(),this.primaryFixedDim(),10,"lighter",!0)})}primaryFixedDim(){return c.fromPalette({name:"primary_fixed_dim",palette:e=>e.primaryPalette,tone:e=>I(e)?30:80,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new y(1,1,3,4.5),toneDeltaPair:e=>new x(this.primaryFixed(),this.primaryFixedDim(),10,"lighter",!0)})}onPrimaryFixed(){return c.fromPalette({name:"on_primary_fixed",palette:e=>e.primaryPalette,tone:e=>I(e)?100:10,background:e=>this.primaryFixedDim(),secondBackground:e=>this.primaryFixed(),contrastCurve:e=>new y(4.5,7,11,21)})}onPrimaryFixedVariant(){return c.fromPalette({name:"on_primary_fixed_variant",palette:e=>e.primaryPalette,tone:e=>I(e)?90:30,background:e=>this.primaryFixedDim(),secondBackground:e=>this.primaryFixed(),contrastCurve:e=>new y(3,4.5,7,11)})}secondaryFixed(){return c.fromPalette({name:"secondary_fixed",palette:e=>e.secondaryPalette,tone:e=>I(e)?80:90,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new y(1,1,3,4.5),toneDeltaPair:e=>new x(this.secondaryFixed(),this.secondaryFixedDim(),10,"lighter",!0)})}secondaryFixedDim(){return c.fromPalette({name:"secondary_fixed_dim",palette:e=>e.secondaryPalette,tone:e=>I(e)?70:80,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new y(1,1,3,4.5),toneDeltaPair:e=>new x(this.secondaryFixed(),this.secondaryFixedDim(),10,"lighter",!0)})}onSecondaryFixed(){return c.fromPalette({name:"on_secondary_fixed",palette:e=>e.secondaryPalette,tone:e=>10,background:e=>this.secondaryFixedDim(),secondBackground:e=>this.secondaryFixed(),contrastCurve:e=>new y(4.5,7,11,21)})}onSecondaryFixedVariant(){return c.fromPalette({name:"on_secondary_fixed_variant",palette:e=>e.secondaryPalette,tone:e=>I(e)?25:30,background:e=>this.secondaryFixedDim(),secondBackground:e=>this.secondaryFixed(),contrastCurve:e=>new y(3,4.5,7,11)})}tertiaryFixed(){return c.fromPalette({name:"tertiary_fixed",palette:e=>e.tertiaryPalette,tone:e=>I(e)?40:90,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new y(1,1,3,4.5),toneDeltaPair:e=>new x(this.tertiaryFixed(),this.tertiaryFixedDim(),10,"lighter",!0)})}tertiaryFixedDim(){return c.fromPalette({name:"tertiary_fixed_dim",palette:e=>e.tertiaryPalette,tone:e=>I(e)?30:80,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new y(1,1,3,4.5),toneDeltaPair:e=>new x(this.tertiaryFixed(),this.tertiaryFixedDim(),10,"lighter",!0)})}onTertiaryFixed(){return c.fromPalette({name:"on_tertiary_fixed",palette:e=>e.tertiaryPalette,tone:e=>I(e)?100:10,background:e=>this.tertiaryFixedDim(),secondBackground:e=>this.tertiaryFixed(),contrastCurve:e=>new y(4.5,7,11,21)})}onTertiaryFixedVariant(){return c.fromPalette({name:"on_tertiary_fixed_variant",palette:e=>e.tertiaryPalette,tone:e=>I(e)?90:30,background:e=>this.tertiaryFixedDim(),secondBackground:e=>this.tertiaryFixed(),contrastCurve:e=>new y(3,4.5,7,11)})}highestSurface(e){return e.isDark?this.surfaceBright():this.surfaceDim()}}/**
227
- * @license
228
- * Copyright 2025 Google LLC
229
- *
230
- * Licensed under the Apache License, Version 2.0 (the "License");
231
- * you may not use this file except in compliance with the License.
232
- * You may obtain a copy of the License at
233
- *
234
- * http://www.apache.org/licenses/LICENSE-2.0
235
- *
236
- * Unless required by applicable law or agreed to in writing, software
237
- * distributed under the License is distributed on an "AS IS" BASIS,
238
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
239
- * See the License for the specific language governing permissions and
240
- * limitations under the License.
241
- */function F(r,e=0,t=100,n=1){let a=_e(r.hue,r.chroma*n,100,!0);return U(e,t,a)}function te(r,e=0,t=100){let n=_e(r.hue,r.chroma,0,!1);return U(e,t,n)}function _e(r,e,t,n){let a=t,s=b.from(r,e,a);for(;s.chroma<e&&!(t<0||t>100);){t+=n?-1:1;const i=b.from(r,e,t);s.chroma<i.chroma&&(s=i,a=t)}return a}function S(r){return r===1.5?new y(1.5,1.5,3,5.5):r===3?new y(3,3,4.5,7):r===4.5?new y(4.5,4.5,7,11):r===6?new y(6,6,7,11):r===7?new y(7,7,11,21):r===9?new y(9,9,11,21):r===11?new y(11,11,21,21):r===21?new y(21,21,21,21):new y(r,r,7,21)}class gt extends yt{surface(){const e=c.fromPalette({name:"surface",palette:t=>t.neutralPalette,tone:t=>(super.surface().tone(t),t.platform==="phone"?t.isDark?4:b.isYellow(t.neutralPalette.hue)?99:t.variant===h.VIBRANT?97:98:0),isBackground:!0});return T(super.surface(),"2025",e)}surfaceDim(){const e=c.fromPalette({name:"surface_dim",palette:t=>t.neutralPalette,tone:t=>t.isDark?4:b.isYellow(t.neutralPalette.hue)?90:t.variant===h.VIBRANT?85:87,isBackground:!0,chromaMultiplier:t=>{if(!t.isDark){if(t.variant===h.NEUTRAL)return 2.5;if(t.variant===h.TONAL_SPOT)return 1.7;if(t.variant===h.EXPRESSIVE)return b.isYellow(t.neutralPalette.hue)?2.7:1.75;if(t.variant===h.VIBRANT)return 1.36}return 1}});return T(super.surfaceDim(),"2025",e)}surfaceBright(){const e=c.fromPalette({name:"surface_bright",palette:t=>t.neutralPalette,tone:t=>t.isDark?18:b.isYellow(t.neutralPalette.hue)?99:t.variant===h.VIBRANT?97:98,isBackground:!0,chromaMultiplier:t=>{if(t.isDark){if(t.variant===h.NEUTRAL)return 2.5;if(t.variant===h.TONAL_SPOT)return 1.7;if(t.variant===h.EXPRESSIVE)return b.isYellow(t.neutralPalette.hue)?2.7:1.75;if(t.variant===h.VIBRANT)return 1.36}return 1}});return T(super.surfaceBright(),"2025",e)}surfaceContainerLowest(){const e=c.fromPalette({name:"surface_container_lowest",palette:t=>t.neutralPalette,tone:t=>t.isDark?0:100,isBackground:!0});return T(super.surfaceContainerLowest(),"2025",e)}surfaceContainerLow(){const e=c.fromPalette({name:"surface_container_low",palette:t=>t.neutralPalette,tone:t=>t.platform==="phone"?t.isDark?6:b.isYellow(t.neutralPalette.hue)?98:t.variant===h.VIBRANT?95:96:15,isBackground:!0,chromaMultiplier:t=>{if(t.platform==="phone"){if(t.variant===h.NEUTRAL)return 1.3;if(t.variant===h.TONAL_SPOT)return 1.25;if(t.variant===h.EXPRESSIVE)return b.isYellow(t.neutralPalette.hue)?1.3:1.15;if(t.variant===h.VIBRANT)return 1.08}return 1}});return T(super.surfaceContainerLow(),"2025",e)}surfaceContainer(){const e=c.fromPalette({name:"surface_container",palette:t=>t.neutralPalette,tone:t=>t.platform==="phone"?t.isDark?9:b.isYellow(t.neutralPalette.hue)?96:t.variant===h.VIBRANT?92:94:20,isBackground:!0,chromaMultiplier:t=>{if(t.platform==="phone"){if(t.variant===h.NEUTRAL)return 1.6;if(t.variant===h.TONAL_SPOT)return 1.4;if(t.variant===h.EXPRESSIVE)return b.isYellow(t.neutralPalette.hue)?1.6:1.3;if(t.variant===h.VIBRANT)return 1.15}return 1}});return T(super.surfaceContainer(),"2025",e)}surfaceContainerHigh(){const e=c.fromPalette({name:"surface_container_high",palette:t=>t.neutralPalette,tone:t=>t.platform==="phone"?t.isDark?12:b.isYellow(t.neutralPalette.hue)?94:t.variant===h.VIBRANT?90:92:25,isBackground:!0,chromaMultiplier:t=>{if(t.platform==="phone"){if(t.variant===h.NEUTRAL)return 1.9;if(t.variant===h.TONAL_SPOT)return 1.5;if(t.variant===h.EXPRESSIVE)return b.isYellow(t.neutralPalette.hue)?1.95:1.45;if(t.variant===h.VIBRANT)return 1.22}return 1}});return T(super.surfaceContainerHigh(),"2025",e)}surfaceContainerHighest(){const e=c.fromPalette({name:"surface_container_highest",palette:t=>t.neutralPalette,tone:t=>t.isDark?15:b.isYellow(t.neutralPalette.hue)?92:t.variant===h.VIBRANT?88:90,isBackground:!0,chromaMultiplier:t=>t.variant===h.NEUTRAL?2.2:t.variant===h.TONAL_SPOT?1.7:t.variant===h.EXPRESSIVE?b.isYellow(t.neutralPalette.hue)?2.3:1.6:t.variant===h.VIBRANT?1.29:1});return T(super.surfaceContainerHighest(),"2025",e)}onSurface(){const e=c.fromPalette({name:"on_surface",palette:t=>t.neutralPalette,tone:t=>t.variant===h.VIBRANT?F(t.neutralPalette,0,100,1.1):c.getInitialToneFromBackground(n=>n.platform==="phone"?this.highestSurface(n):this.surfaceContainerHigh())(t),chromaMultiplier:t=>{if(t.platform==="phone"){if(t.variant===h.NEUTRAL)return 2.2;if(t.variant===h.TONAL_SPOT)return 1.7;if(t.variant===h.EXPRESSIVE)return b.isYellow(t.neutralPalette.hue)?t.isDark?3:2.3:1.6}return 1},background:t=>t.platform==="phone"?this.highestSurface(t):this.surfaceContainerHigh(),contrastCurve:t=>t.isDark&&t.platform==="phone"?S(11):S(9)});return T(super.onSurface(),"2025",e)}onSurfaceVariant(){const e=c.fromPalette({name:"on_surface_variant",palette:t=>t.neutralPalette,chromaMultiplier:t=>{if(t.platform==="phone"){if(t.variant===h.NEUTRAL)return 2.2;if(t.variant===h.TONAL_SPOT)return 1.7;if(t.variant===h.EXPRESSIVE)return b.isYellow(t.neutralPalette.hue)?t.isDark?3:2.3:1.6}return 1},background:t=>t.platform==="phone"?this.highestSurface(t):this.surfaceContainerHigh(),contrastCurve:t=>t.platform==="phone"?t.isDark?S(6):S(4.5):S(7)});return T(super.onSurfaceVariant(),"2025",e)}outline(){const e=c.fromPalette({name:"outline",palette:t=>t.neutralPalette,chromaMultiplier:t=>{if(t.platform==="phone"){if(t.variant===h.NEUTRAL)return 2.2;if(t.variant===h.TONAL_SPOT)return 1.7;if(t.variant===h.EXPRESSIVE)return b.isYellow(t.neutralPalette.hue)?t.isDark?3:2.3:1.6}return 1},background:t=>t.platform==="phone"?this.highestSurface(t):this.surfaceContainerHigh(),contrastCurve:t=>t.platform==="phone"?S(3):S(4.5)});return T(super.outline(),"2025",e)}outlineVariant(){const e=c.fromPalette({name:"outline_variant",palette:t=>t.neutralPalette,chromaMultiplier:t=>{if(t.platform==="phone"){if(t.variant===h.NEUTRAL)return 2.2;if(t.variant===h.TONAL_SPOT)return 1.7;if(t.variant===h.EXPRESSIVE)return b.isYellow(t.neutralPalette.hue)?t.isDark?3:2.3:1.6}return 1},background:t=>t.platform==="phone"?this.highestSurface(t):this.surfaceContainerHigh(),contrastCurve:t=>t.platform==="phone"?S(1.5):S(3)});return T(super.outlineVariant(),"2025",e)}inverseSurface(){const e=c.fromPalette({name:"inverse_surface",palette:t=>t.neutralPalette,tone:t=>t.isDark?98:4,isBackground:!0});return T(super.inverseSurface(),"2025",e)}inverseOnSurface(){const e=c.fromPalette({name:"inverse_on_surface",palette:t=>t.neutralPalette,background:t=>this.inverseSurface(),contrastCurve:t=>S(7)});return T(super.inverseOnSurface(),"2025",e)}primary(){const e=c.fromPalette({name:"primary",palette:t=>t.primaryPalette,tone:t=>t.variant===h.NEUTRAL?t.platform==="phone"?t.isDark?80:40:90:t.variant===h.TONAL_SPOT?t.platform==="phone"?t.isDark?80:F(t.primaryPalette):F(t.primaryPalette,0,90):t.variant===h.EXPRESSIVE?t.platform==="phone"?F(t.primaryPalette,0,b.isYellow(t.primaryPalette.hue)?25:b.isCyan(t.primaryPalette.hue)?88:98):F(t.primaryPalette):t.platform==="phone"?F(t.primaryPalette,0,b.isCyan(t.primaryPalette.hue)?88:98):F(t.primaryPalette),isBackground:!0,background:t=>t.platform==="phone"?this.highestSurface(t):this.surfaceContainerHigh(),contrastCurve:t=>t.platform==="phone"?S(4.5):S(7),toneDeltaPair:t=>t.platform==="phone"?new x(this.primaryContainer(),this.primary(),5,"relative_lighter",!0,"farther"):void 0});return T(super.primary(),"2025",e)}primaryDim(){return c.fromPalette({name:"primary_dim",palette:e=>e.primaryPalette,tone:e=>e.variant===h.NEUTRAL?85:e.variant===h.TONAL_SPOT?F(e.primaryPalette,0,90):F(e.primaryPalette),isBackground:!0,background:e=>this.surfaceContainerHigh(),contrastCurve:e=>S(4.5),toneDeltaPair:e=>new x(this.primaryDim(),this.primary(),5,"darker",!0,"farther")})}onPrimary(){const e=c.fromPalette({name:"on_primary",palette:t=>t.primaryPalette,background:t=>t.platform==="phone"?this.primary():this.primaryDim(),contrastCurve:t=>t.platform==="phone"?S(6):S(7)});return T(super.onPrimary(),"2025",e)}primaryContainer(){const e=c.fromPalette({name:"primary_container",palette:t=>t.primaryPalette,tone:t=>t.platform==="watch"?30:t.variant===h.NEUTRAL?t.isDark?30:90:t.variant===h.TONAL_SPOT?t.isDark?te(t.primaryPalette,35,93):F(t.primaryPalette,0,90):t.variant===h.EXPRESSIVE?t.isDark?F(t.primaryPalette,30,93):F(t.primaryPalette,78,b.isCyan(t.primaryPalette.hue)?88:90):t.isDark?te(t.primaryPalette,66,93):F(t.primaryPalette,66,b.isCyan(t.primaryPalette.hue)?88:93),isBackground:!0,background:t=>t.platform==="phone"?this.highestSurface(t):void 0,toneDeltaPair:t=>t.platform==="phone"?void 0:new x(this.primaryContainer(),this.primaryDim(),10,"darker",!0,"farther"),contrastCurve:t=>t.platform==="phone"&&t.contrastLevel>0?S(1.5):void 0});return T(super.primaryContainer(),"2025",e)}onPrimaryContainer(){const e=c.fromPalette({name:"on_primary_container",palette:t=>t.primaryPalette,background:t=>this.primaryContainer(),contrastCurve:t=>t.platform==="phone"?S(6):S(7)});return T(super.onPrimaryContainer(),"2025",e)}primaryFixed(){const e=c.fromPalette({name:"primary_fixed",palette:t=>t.primaryPalette,tone:t=>{let n=Object.assign({},t,{isDark:!1,contrastLevel:0});return this.primaryContainer().getTone(n)},isBackground:!0,background:t=>t.platform==="phone"?this.highestSurface(t):void 0,contrastCurve:t=>t.platform==="phone"&&t.contrastLevel>0?S(1.5):void 0});return T(super.primaryFixed(),"2025",e)}primaryFixedDim(){const e=c.fromPalette({name:"primary_fixed_dim",palette:t=>t.primaryPalette,tone:t=>this.primaryFixed().getTone(t),isBackground:!0,toneDeltaPair:t=>new x(this.primaryFixedDim(),this.primaryFixed(),5,"darker",!0,"exact")});return T(super.primaryFixedDim(),"2025",e)}onPrimaryFixed(){const e=c.fromPalette({name:"on_primary_fixed",palette:t=>t.primaryPalette,background:t=>this.primaryFixedDim(),contrastCurve:t=>S(7)});return T(super.onPrimaryFixed(),"2025",e)}onPrimaryFixedVariant(){const e=c.fromPalette({name:"on_primary_fixed_variant",palette:t=>t.primaryPalette,background:t=>this.primaryFixedDim(),contrastCurve:t=>S(4.5)});return T(super.onPrimaryFixedVariant(),"2025",e)}inversePrimary(){const e=c.fromPalette({name:"inverse_primary",palette:t=>t.primaryPalette,tone:t=>F(t.primaryPalette),background:t=>this.inverseSurface(),contrastCurve:t=>t.platform==="phone"?S(6):S(7)});return T(super.inversePrimary(),"2025",e)}secondary(){const e=c.fromPalette({name:"secondary",palette:t=>t.secondaryPalette,tone:t=>t.platform==="watch"?t.variant===h.NEUTRAL?90:F(t.secondaryPalette,0,90):t.variant===h.NEUTRAL?t.isDark?te(t.secondaryPalette,0,98):F(t.secondaryPalette):t.variant===h.VIBRANT?F(t.secondaryPalette,0,t.isDark?90:98):t.isDark?80:F(t.secondaryPalette),isBackground:!0,background:t=>t.platform==="phone"?this.highestSurface(t):this.surfaceContainerHigh(),contrastCurve:t=>t.platform==="phone"?S(4.5):S(7),toneDeltaPair:t=>t.platform==="phone"?new x(this.secondaryContainer(),this.secondary(),5,"relative_lighter",!0,"farther"):void 0});return T(super.secondary(),"2025",e)}secondaryDim(){return c.fromPalette({name:"secondary_dim",palette:e=>e.secondaryPalette,tone:e=>e.variant===h.NEUTRAL?85:F(e.secondaryPalette,0,90),isBackground:!0,background:e=>this.surfaceContainerHigh(),contrastCurve:e=>S(4.5),toneDeltaPair:e=>new x(this.secondaryDim(),this.secondary(),5,"darker",!0,"farther")})}onSecondary(){const e=c.fromPalette({name:"on_secondary",palette:t=>t.secondaryPalette,background:t=>t.platform==="phone"?this.secondary():this.secondaryDim(),contrastCurve:t=>t.platform==="phone"?S(6):S(7)});return T(super.onSecondary(),"2025",e)}secondaryContainer(){const e=c.fromPalette({name:"secondary_container",palette:t=>t.secondaryPalette,tone:t=>t.platform==="watch"?30:t.variant===h.VIBRANT?t.isDark?te(t.secondaryPalette,30,40):F(t.secondaryPalette,84,90):t.variant===h.EXPRESSIVE?t.isDark?15:F(t.secondaryPalette,90,95):t.isDark?25:90,isBackground:!0,background:t=>t.platform==="phone"?this.highestSurface(t):void 0,toneDeltaPair:t=>t.platform==="watch"?new x(this.secondaryContainer(),this.secondaryDim(),10,"darker",!0,"farther"):void 0,contrastCurve:t=>t.platform==="phone"&&t.contrastLevel>0?S(1.5):void 0});return T(super.secondaryContainer(),"2025",e)}onSecondaryContainer(){const e=c.fromPalette({name:"on_secondary_container",palette:t=>t.secondaryPalette,background:t=>this.secondaryContainer(),contrastCurve:t=>t.platform==="phone"?S(6):S(7)});return T(super.onSecondaryContainer(),"2025",e)}secondaryFixed(){const e=c.fromPalette({name:"secondary_fixed",palette:t=>t.secondaryPalette,tone:t=>{let n=Object.assign({},t,{isDark:!1,contrastLevel:0});return this.secondaryContainer().getTone(n)},isBackground:!0,background:t=>t.platform==="phone"?this.highestSurface(t):void 0,contrastCurve:t=>t.platform==="phone"&&t.contrastLevel>0?S(1.5):void 0});return T(super.secondaryFixed(),"2025",e)}secondaryFixedDim(){const e=c.fromPalette({name:"secondary_fixed_dim",palette:t=>t.secondaryPalette,tone:t=>this.secondaryFixed().getTone(t),isBackground:!0,toneDeltaPair:t=>new x(this.secondaryFixedDim(),this.secondaryFixed(),5,"darker",!0,"exact")});return T(super.secondaryFixedDim(),"2025",e)}onSecondaryFixed(){const e=c.fromPalette({name:"on_secondary_fixed",palette:t=>t.secondaryPalette,background:t=>this.secondaryFixedDim(),contrastCurve:t=>S(7)});return T(super.onSecondaryFixed(),"2025",e)}onSecondaryFixedVariant(){const e=c.fromPalette({name:"on_secondary_fixed_variant",palette:t=>t.secondaryPalette,background:t=>this.secondaryFixedDim(),contrastCurve:t=>S(4.5)});return T(super.onSecondaryFixedVariant(),"2025",e)}tertiary(){const e=c.fromPalette({name:"tertiary",palette:t=>t.tertiaryPalette,tone:t=>t.platform==="watch"?t.variant===h.TONAL_SPOT?F(t.tertiaryPalette,0,90):F(t.tertiaryPalette):t.variant===h.EXPRESSIVE||t.variant===h.VIBRANT?F(t.tertiaryPalette,0,b.isCyan(t.tertiaryPalette.hue)?88:t.isDark?98:100):t.isDark?F(t.tertiaryPalette,0,98):F(t.tertiaryPalette),isBackground:!0,background:t=>t.platform==="phone"?this.highestSurface(t):this.surfaceContainerHigh(),contrastCurve:t=>t.platform==="phone"?S(4.5):S(7),toneDeltaPair:t=>t.platform==="phone"?new x(this.tertiaryContainer(),this.tertiary(),5,"relative_lighter",!0,"farther"):void 0});return T(super.tertiary(),"2025",e)}tertiaryDim(){return c.fromPalette({name:"tertiary_dim",palette:e=>e.tertiaryPalette,tone:e=>e.variant===h.TONAL_SPOT?F(e.tertiaryPalette,0,90):F(e.tertiaryPalette),isBackground:!0,background:e=>this.surfaceContainerHigh(),contrastCurve:e=>S(4.5),toneDeltaPair:e=>new x(this.tertiaryDim(),this.tertiary(),5,"darker",!0,"farther")})}onTertiary(){const e=c.fromPalette({name:"on_tertiary",palette:t=>t.tertiaryPalette,background:t=>t.platform==="phone"?this.tertiary():this.tertiaryDim(),contrastCurve:t=>t.platform==="phone"?S(6):S(7)});return T(super.onTertiary(),"2025",e)}tertiaryContainer(){const e=c.fromPalette({name:"tertiary_container",palette:t=>t.tertiaryPalette,tone:t=>t.platform==="watch"?t.variant===h.TONAL_SPOT?F(t.tertiaryPalette,0,90):F(t.tertiaryPalette):t.variant===h.NEUTRAL?t.isDark?F(t.tertiaryPalette,0,93):F(t.tertiaryPalette,0,96):t.variant===h.TONAL_SPOT?F(t.tertiaryPalette,0,t.isDark?93:100):t.variant===h.EXPRESSIVE?F(t.tertiaryPalette,75,b.isCyan(t.tertiaryPalette.hue)?88:t.isDark?93:100):t.isDark?F(t.tertiaryPalette,0,93):F(t.tertiaryPalette,72,100),isBackground:!0,background:t=>t.platform==="phone"?this.highestSurface(t):void 0,toneDeltaPair:t=>t.platform==="watch"?new x(this.tertiaryContainer(),this.tertiaryDim(),10,"darker",!0,"farther"):void 0,contrastCurve:t=>t.platform==="phone"&&t.contrastLevel>0?S(1.5):void 0});return T(super.tertiaryContainer(),"2025",e)}onTertiaryContainer(){const e=c.fromPalette({name:"on_tertiary_container",palette:t=>t.tertiaryPalette,background:t=>this.tertiaryContainer(),contrastCurve:t=>t.platform==="phone"?S(6):S(7)});return T(super.onTertiaryContainer(),"2025",e)}tertiaryFixed(){const e=c.fromPalette({name:"tertiary_fixed",palette:t=>t.tertiaryPalette,tone:t=>{let n=Object.assign({},t,{isDark:!1,contrastLevel:0});return this.tertiaryContainer().getTone(n)},isBackground:!0,background:t=>t.platform==="phone"?this.highestSurface(t):void 0,contrastCurve:t=>t.platform==="phone"&&t.contrastLevel>0?S(1.5):void 0});return T(super.tertiaryFixed(),"2025",e)}tertiaryFixedDim(){const e=c.fromPalette({name:"tertiary_fixed_dim",palette:t=>t.tertiaryPalette,tone:t=>this.tertiaryFixed().getTone(t),isBackground:!0,toneDeltaPair:t=>new x(this.tertiaryFixedDim(),this.tertiaryFixed(),5,"darker",!0,"exact")});return T(super.tertiaryFixedDim(),"2025",e)}onTertiaryFixed(){const e=c.fromPalette({name:"on_tertiary_fixed",palette:t=>t.tertiaryPalette,background:t=>this.tertiaryFixedDim(),contrastCurve:t=>S(7)});return T(super.onTertiaryFixed(),"2025",e)}onTertiaryFixedVariant(){const e=c.fromPalette({name:"on_tertiary_fixed_variant",palette:t=>t.tertiaryPalette,background:t=>this.tertiaryFixedDim(),contrastCurve:t=>S(4.5)});return T(super.onTertiaryFixedVariant(),"2025",e)}error(){const e=c.fromPalette({name:"error",palette:t=>t.errorPalette,tone:t=>t.platform==="phone"?t.isDark?te(t.errorPalette,0,98):F(t.errorPalette):te(t.errorPalette),isBackground:!0,background:t=>t.platform==="phone"?this.highestSurface(t):this.surfaceContainerHigh(),contrastCurve:t=>t.platform==="phone"?S(4.5):S(7),toneDeltaPair:t=>t.platform==="phone"?new x(this.errorContainer(),this.error(),5,"relative_lighter",!0,"farther"):void 0});return T(super.error(),"2025",e)}errorDim(){return c.fromPalette({name:"error_dim",palette:e=>e.errorPalette,tone:e=>te(e.errorPalette),isBackground:!0,background:e=>this.surfaceContainerHigh(),contrastCurve:e=>S(4.5),toneDeltaPair:e=>new x(this.errorDim(),this.error(),5,"darker",!0,"farther")})}onError(){const e=c.fromPalette({name:"on_error",palette:t=>t.errorPalette,background:t=>t.platform==="phone"?this.error():this.errorDim(),contrastCurve:t=>t.platform==="phone"?S(6):S(7)});return T(super.onError(),"2025",e)}errorContainer(){const e=c.fromPalette({name:"error_container",palette:t=>t.errorPalette,tone:t=>t.platform==="watch"?30:t.isDark?te(t.errorPalette,30,93):F(t.errorPalette,0,90),isBackground:!0,background:t=>t.platform==="phone"?this.highestSurface(t):void 0,toneDeltaPair:t=>t.platform==="watch"?new x(this.errorContainer(),this.errorDim(),10,"darker",!0,"farther"):void 0,contrastCurve:t=>t.platform==="phone"&&t.contrastLevel>0?S(1.5):void 0});return T(super.errorContainer(),"2025",e)}onErrorContainer(){const e=c.fromPalette({name:"on_error_container",palette:t=>t.errorPalette,background:t=>this.errorContainer(),contrastCurve:t=>t.platform==="phone"?S(4.5):S(7)});return T(super.onErrorContainer(),"2025",e)}surfaceVariant(){const e=Object.assign(this.surfaceContainerHighest().clone(),{name:"surface_variant"});return T(super.surfaceVariant(),"2025",e)}surfaceTint(){const e=Object.assign(this.primary().clone(),{name:"surface_tint"});return T(super.surfaceTint(),"2025",e)}background(){const e=Object.assign(this.surface().clone(),{name:"background"});return T(super.background(),"2025",e)}onBackground(){const e=Object.assign(this.onSurface().clone(),{name:"on_background",tone:t=>t.platform==="watch"?100:this.onSurface().getTone(t)});return T(super.onBackground(),"2025",e)}}/**
242
- * @license
243
- * Copyright 2022 Google LLC
244
- *
245
- * Licensed under the Apache License, Version 2.0 (the "License");
246
- * you may not use this file except in compliance with the License.
247
- * You may obtain a copy of the License at
248
- *
249
- * http://www.apache.org/licenses/LICENSE-2.0
250
- *
251
- * Unless required by applicable law or agreed to in writing, software
252
- * distributed under the License is distributed on an "AS IS" BASIS,
253
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
254
- * See the License for the specific language governing permissions and
255
- * limitations under the License.
256
- */class o{constructor(){this.allColors=[this.background(),this.onBackground(),this.surface(),this.surfaceDim(),this.surfaceBright(),this.surfaceContainerLowest(),this.surfaceContainerLow(),this.surfaceContainer(),this.surfaceContainerHigh(),this.surfaceContainerHighest(),this.onSurface(),this.onSurfaceVariant(),this.outline(),this.outlineVariant(),this.inverseSurface(),this.inverseOnSurface(),this.primary(),this.primaryDim(),this.onPrimary(),this.primaryContainer(),this.onPrimaryContainer(),this.primaryFixed(),this.primaryFixedDim(),this.onPrimaryFixed(),this.onPrimaryFixedVariant(),this.inversePrimary(),this.secondary(),this.secondaryDim(),this.onSecondary(),this.secondaryContainer(),this.onSecondaryContainer(),this.secondaryFixed(),this.secondaryFixedDim(),this.onSecondaryFixed(),this.onSecondaryFixedVariant(),this.tertiary(),this.tertiaryDim(),this.onTertiary(),this.tertiaryContainer(),this.onTertiaryContainer(),this.tertiaryFixed(),this.tertiaryFixedDim(),this.onTertiaryFixed(),this.onTertiaryFixedVariant(),this.error(),this.errorDim(),this.onError(),this.errorContainer(),this.onErrorContainer()].filter(e=>e!==void 0)}highestSurface(e){return o.colorSpec.highestSurface(e)}primaryPaletteKeyColor(){return o.colorSpec.primaryPaletteKeyColor()}secondaryPaletteKeyColor(){return o.colorSpec.secondaryPaletteKeyColor()}tertiaryPaletteKeyColor(){return o.colorSpec.tertiaryPaletteKeyColor()}neutralPaletteKeyColor(){return o.colorSpec.neutralPaletteKeyColor()}neutralVariantPaletteKeyColor(){return o.colorSpec.neutralVariantPaletteKeyColor()}errorPaletteKeyColor(){return o.colorSpec.errorPaletteKeyColor()}background(){return o.colorSpec.background()}onBackground(){return o.colorSpec.onBackground()}surface(){return o.colorSpec.surface()}surfaceDim(){return o.colorSpec.surfaceDim()}surfaceBright(){return o.colorSpec.surfaceBright()}surfaceContainerLowest(){return o.colorSpec.surfaceContainerLowest()}surfaceContainerLow(){return o.colorSpec.surfaceContainerLow()}surfaceContainer(){return o.colorSpec.surfaceContainer()}surfaceContainerHigh(){return o.colorSpec.surfaceContainerHigh()}surfaceContainerHighest(){return o.colorSpec.surfaceContainerHighest()}onSurface(){return o.colorSpec.onSurface()}surfaceVariant(){return o.colorSpec.surfaceVariant()}onSurfaceVariant(){return o.colorSpec.onSurfaceVariant()}outline(){return o.colorSpec.outline()}outlineVariant(){return o.colorSpec.outlineVariant()}inverseSurface(){return o.colorSpec.inverseSurface()}inverseOnSurface(){return o.colorSpec.inverseOnSurface()}shadow(){return o.colorSpec.shadow()}scrim(){return o.colorSpec.scrim()}surfaceTint(){return o.colorSpec.surfaceTint()}primary(){return o.colorSpec.primary()}primaryDim(){return o.colorSpec.primaryDim()}onPrimary(){return o.colorSpec.onPrimary()}primaryContainer(){return o.colorSpec.primaryContainer()}onPrimaryContainer(){return o.colorSpec.onPrimaryContainer()}inversePrimary(){return o.colorSpec.inversePrimary()}primaryFixed(){return o.colorSpec.primaryFixed()}primaryFixedDim(){return o.colorSpec.primaryFixedDim()}onPrimaryFixed(){return o.colorSpec.onPrimaryFixed()}onPrimaryFixedVariant(){return o.colorSpec.onPrimaryFixedVariant()}secondary(){return o.colorSpec.secondary()}secondaryDim(){return o.colorSpec.secondaryDim()}onSecondary(){return o.colorSpec.onSecondary()}secondaryContainer(){return o.colorSpec.secondaryContainer()}onSecondaryContainer(){return o.colorSpec.onSecondaryContainer()}secondaryFixed(){return o.colorSpec.secondaryFixed()}secondaryFixedDim(){return o.colorSpec.secondaryFixedDim()}onSecondaryFixed(){return o.colorSpec.onSecondaryFixed()}onSecondaryFixedVariant(){return o.colorSpec.onSecondaryFixedVariant()}tertiary(){return o.colorSpec.tertiary()}tertiaryDim(){return o.colorSpec.tertiaryDim()}onTertiary(){return o.colorSpec.onTertiary()}tertiaryContainer(){return o.colorSpec.tertiaryContainer()}onTertiaryContainer(){return o.colorSpec.onTertiaryContainer()}tertiaryFixed(){return o.colorSpec.tertiaryFixed()}tertiaryFixedDim(){return o.colorSpec.tertiaryFixedDim()}onTertiaryFixed(){return o.colorSpec.onTertiaryFixed()}onTertiaryFixedVariant(){return o.colorSpec.onTertiaryFixedVariant()}error(){return o.colorSpec.error()}errorDim(){return o.colorSpec.errorDim()}onError(){return o.colorSpec.onError()}errorContainer(){return o.colorSpec.errorContainer()}onErrorContainer(){return o.colorSpec.onErrorContainer()}static highestSurface(e){return o.colorSpec.highestSurface(e)}}o.contentAccentToneDelta=15;o.colorSpec=new gt;o.primaryPaletteKeyColor=o.colorSpec.primaryPaletteKeyColor();o.secondaryPaletteKeyColor=o.colorSpec.secondaryPaletteKeyColor();o.tertiaryPaletteKeyColor=o.colorSpec.tertiaryPaletteKeyColor();o.neutralPaletteKeyColor=o.colorSpec.neutralPaletteKeyColor();o.neutralVariantPaletteKeyColor=o.colorSpec.neutralVariantPaletteKeyColor();o.background=o.colorSpec.background();o.onBackground=o.colorSpec.onBackground();o.surface=o.colorSpec.surface();o.surfaceDim=o.colorSpec.surfaceDim();o.surfaceBright=o.colorSpec.surfaceBright();o.surfaceContainerLowest=o.colorSpec.surfaceContainerLowest();o.surfaceContainerLow=o.colorSpec.surfaceContainerLow();o.surfaceContainer=o.colorSpec.surfaceContainer();o.surfaceContainerHigh=o.colorSpec.surfaceContainerHigh();o.surfaceContainerHighest=o.colorSpec.surfaceContainerHighest();o.onSurface=o.colorSpec.onSurface();o.surfaceVariant=o.colorSpec.surfaceVariant();o.onSurfaceVariant=o.colorSpec.onSurfaceVariant();o.inverseSurface=o.colorSpec.inverseSurface();o.inverseOnSurface=o.colorSpec.inverseOnSurface();o.outline=o.colorSpec.outline();o.outlineVariant=o.colorSpec.outlineVariant();o.shadow=o.colorSpec.shadow();o.scrim=o.colorSpec.scrim();o.surfaceTint=o.colorSpec.surfaceTint();o.primary=o.colorSpec.primary();o.onPrimary=o.colorSpec.onPrimary();o.primaryContainer=o.colorSpec.primaryContainer();o.onPrimaryContainer=o.colorSpec.onPrimaryContainer();o.inversePrimary=o.colorSpec.inversePrimary();o.secondary=o.colorSpec.secondary();o.onSecondary=o.colorSpec.onSecondary();o.secondaryContainer=o.colorSpec.secondaryContainer();o.onSecondaryContainer=o.colorSpec.onSecondaryContainer();o.tertiary=o.colorSpec.tertiary();o.onTertiary=o.colorSpec.onTertiary();o.tertiaryContainer=o.colorSpec.tertiaryContainer();o.onTertiaryContainer=o.colorSpec.onTertiaryContainer();o.error=o.colorSpec.error();o.onError=o.colorSpec.onError();o.errorContainer=o.colorSpec.errorContainer();o.onErrorContainer=o.colorSpec.onErrorContainer();o.primaryFixed=o.colorSpec.primaryFixed();o.primaryFixedDim=o.colorSpec.primaryFixedDim();o.onPrimaryFixed=o.colorSpec.onPrimaryFixed();o.onPrimaryFixedVariant=o.colorSpec.onPrimaryFixedVariant();o.secondaryFixed=o.colorSpec.secondaryFixed();o.secondaryFixedDim=o.colorSpec.secondaryFixedDim();o.onSecondaryFixed=o.colorSpec.onSecondaryFixed();o.onSecondaryFixedVariant=o.colorSpec.onSecondaryFixedVariant();o.tertiaryFixed=o.colorSpec.tertiaryFixed();o.tertiaryFixedDim=o.colorSpec.tertiaryFixedDim();o.onTertiaryFixed=o.colorSpec.onTertiaryFixed();o.onTertiaryFixedVariant=o.colorSpec.onTertiaryFixedVariant();/**
257
- * @license
258
- * Copyright 2021 Google LLC
259
- *
260
- * Licensed under the Apache License, Version 2.0 (the "License");
261
- * you may not use this file except in compliance with the License.
262
- * You may obtain a copy of the License at
263
- *
264
- * http://www.apache.org/licenses/LICENSE-2.0
265
- *
266
- * Unless required by applicable law or agreed to in writing, software
267
- * distributed under the License is distributed on an "AS IS" BASIS,
268
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
269
- * See the License for the specific language governing permissions and
270
- * limitations under the License.
271
- */class Y{static of(e){return new Y(e,!1)}static contentOf(e){return new Y(e,!0)}static fromColors(e){return Y.createPaletteFromColors(!1,e)}static contentFromColors(e){return Y.createPaletteFromColors(!0,e)}static createPaletteFromColors(e,t){const n=new Y(t.primary,e);if(t.secondary){const a=new Y(t.secondary,e);n.a2=a.a1}if(t.tertiary){const a=new Y(t.tertiary,e);n.a3=a.a1}if(t.error){const a=new Y(t.error,e);n.error=a.a1}if(t.neutral){const a=new Y(t.neutral,e);n.n1=a.n1}if(t.neutralVariant){const a=new Y(t.neutralVariant,e);n.n2=a.n2}return n}constructor(e,t){const n=b.fromInt(e),a=n.hue,s=n.chroma;t?(this.a1=G.fromHueAndChroma(a,s),this.a2=G.fromHueAndChroma(a,s/3),this.a3=G.fromHueAndChroma(a+60,s/2),this.n1=G.fromHueAndChroma(a,Math.min(s/12,4)),this.n2=G.fromHueAndChroma(a,Math.min(s/6,8))):(this.a1=G.fromHueAndChroma(a,Math.max(48,s)),this.a2=G.fromHueAndChroma(a,16),this.a3=G.fromHueAndChroma(a+60,24),this.n1=G.fromHueAndChroma(a,4),this.n2=G.fromHueAndChroma(a,8)),this.error=G.fromHueAndChroma(25,84)}}/**
272
- * @license
273
- * Copyright 2021 Google LLC
274
- *
275
- * Licensed under the Apache License, Version 2.0 (the "License");
276
- * you may not use this file except in compliance with the License.
277
- * You may obtain a copy of the License at
278
- *
279
- * http://www.apache.org/licenses/LICENSE-2.0
280
- *
281
- * Unless required by applicable law or agreed to in writing, software
282
- * distributed under the License is distributed on an "AS IS" BASIS,
283
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
284
- * See the License for the specific language governing permissions and
285
- * limitations under the License.
286
- */class Z{get primary(){return this.props.primary}get onPrimary(){return this.props.onPrimary}get primaryContainer(){return this.props.primaryContainer}get onPrimaryContainer(){return this.props.onPrimaryContainer}get secondary(){return this.props.secondary}get onSecondary(){return this.props.onSecondary}get secondaryContainer(){return this.props.secondaryContainer}get onSecondaryContainer(){return this.props.onSecondaryContainer}get tertiary(){return this.props.tertiary}get onTertiary(){return this.props.onTertiary}get tertiaryContainer(){return this.props.tertiaryContainer}get onTertiaryContainer(){return this.props.onTertiaryContainer}get error(){return this.props.error}get onError(){return this.props.onError}get errorContainer(){return this.props.errorContainer}get onErrorContainer(){return this.props.onErrorContainer}get background(){return this.props.background}get onBackground(){return this.props.onBackground}get surface(){return this.props.surface}get onSurface(){return this.props.onSurface}get surfaceVariant(){return this.props.surfaceVariant}get onSurfaceVariant(){return this.props.onSurfaceVariant}get outline(){return this.props.outline}get outlineVariant(){return this.props.outlineVariant}get shadow(){return this.props.shadow}get scrim(){return this.props.scrim}get inverseSurface(){return this.props.inverseSurface}get inverseOnSurface(){return this.props.inverseOnSurface}get inversePrimary(){return this.props.inversePrimary}static light(e){return Z.lightFromCorePalette(Y.of(e))}static dark(e){return Z.darkFromCorePalette(Y.of(e))}static lightContent(e){return Z.lightFromCorePalette(Y.contentOf(e))}static darkContent(e){return Z.darkFromCorePalette(Y.contentOf(e))}static lightFromCorePalette(e){return new Z({primary:e.a1.tone(40),onPrimary:e.a1.tone(100),primaryContainer:e.a1.tone(90),onPrimaryContainer:e.a1.tone(10),secondary:e.a2.tone(40),onSecondary:e.a2.tone(100),secondaryContainer:e.a2.tone(90),onSecondaryContainer:e.a2.tone(10),tertiary:e.a3.tone(40),onTertiary:e.a3.tone(100),tertiaryContainer:e.a3.tone(90),onTertiaryContainer:e.a3.tone(10),error:e.error.tone(40),onError:e.error.tone(100),errorContainer:e.error.tone(90),onErrorContainer:e.error.tone(10),background:e.n1.tone(99),onBackground:e.n1.tone(10),surface:e.n1.tone(99),onSurface:e.n1.tone(10),surfaceVariant:e.n2.tone(90),onSurfaceVariant:e.n2.tone(30),outline:e.n2.tone(50),outlineVariant:e.n2.tone(80),shadow:e.n1.tone(0),scrim:e.n1.tone(0),inverseSurface:e.n1.tone(20),inverseOnSurface:e.n1.tone(95),inversePrimary:e.a1.tone(80)})}static darkFromCorePalette(e){return new Z({primary:e.a1.tone(80),onPrimary:e.a1.tone(20),primaryContainer:e.a1.tone(30),onPrimaryContainer:e.a1.tone(90),secondary:e.a2.tone(80),onSecondary:e.a2.tone(20),secondaryContainer:e.a2.tone(30),onSecondaryContainer:e.a2.tone(90),tertiary:e.a3.tone(80),onTertiary:e.a3.tone(20),tertiaryContainer:e.a3.tone(30),onTertiaryContainer:e.a3.tone(90),error:e.error.tone(80),onError:e.error.tone(20),errorContainer:e.error.tone(30),onErrorContainer:e.error.tone(80),background:e.n1.tone(10),onBackground:e.n1.tone(90),surface:e.n1.tone(10),onSurface:e.n1.tone(90),surfaceVariant:e.n2.tone(30),onSurfaceVariant:e.n2.tone(80),outline:e.n2.tone(60),outlineVariant:e.n2.tone(30),shadow:e.n1.tone(0),scrim:e.n1.tone(0),inverseSurface:e.n1.tone(90),inverseOnSurface:e.n1.tone(20),inversePrimary:e.a1.tone(40)})}constructor(e){this.props=e}toJSON(){return{...this.props}}}/**
287
- * @license
288
- * Copyright 2021 Google LLC
289
- *
290
- * Licensed under the Apache License, Version 2.0 (the "License");
291
- * you may not use this file except in compliance with the License.
292
- * You may obtain a copy of the License at
293
- *
294
- * http://www.apache.org/licenses/LICENSE-2.0
295
- *
296
- * Unless required by applicable law or agreed to in writing, software
297
- * distributed under the License is distributed on an "AS IS" BASIS,
298
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
299
- * See the License for the specific language governing permissions and
300
- * limitations under the License.
301
- */function ue(r){const e=Oe(r),t=Re(r),n=Ve(r),a=[e.toString(16),t.toString(16),n.toString(16)];for(const[s,i]of a.entries())i.length===1&&(a[s]="0"+i);return"#"+a.join("")}function le(r){r=r.replace("#","");const e=r.length===3,t=r.length===6,n=r.length===8;if(!e&&!t&&!n)throw new Error("unexpected hex "+r);let a=0,s=0,i=0;return e?(a=J(r.slice(0,1).repeat(2)),s=J(r.slice(1,2).repeat(2)),i=J(r.slice(2,3).repeat(2))):t?(a=J(r.slice(0,2)),s=J(r.slice(2,4)),i=J(r.slice(4,6))):n&&(a=J(r.slice(2,4)),s=J(r.slice(4,6)),i=J(r.slice(6,8))),(255<<24|(a&255)<<16|(s&255)<<8|i&255)>>>0}function J(r){return parseInt(r,16)}/**
302
- * @license
303
- * Copyright 2021 Google LLC
304
- *
305
- * Licensed under the Apache License, Version 2.0 (the "License");
306
- * you may not use this file except in compliance with the License.
307
- * You may obtain a copy of the License at
308
- *
309
- * http://www.apache.org/licenses/LICENSE-2.0
310
- *
311
- * Unless required by applicable law or agreed to in writing, software
312
- * distributed under the License is distributed on an "AS IS" BASIS,
313
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
314
- * See the License for the specific language governing permissions and
315
- * limitations under the License.
316
- */function He(r,e=[]){const t=Y.of(r);return{source:r,schemes:{light:Z.light(r),dark:Z.dark(r)},palettes:{primary:t.a1,secondary:t.a2,tertiary:t.a3,neutral:t.n1,neutralVariant:t.n2,error:t.error},customColors:e.map(n=>Pt(r,n))}}function Pt(r,e){let t=e.value;const n=t,a=r;e.blend&&(t=we.harmonize(n,a));const i=Y.of(t).a1;return{color:e,value:t,light:{color:i.tone(40),onColor:i.tone(100),colorContainer:i.tone(90),onColorContainer:i.tone(10)},dark:{color:i.tone(80),onColor:i.tone(20),colorContainer:i.tone(30),onColorContainer:i.tone(90)}}}const xe=[50,100,200,300,400,500,600,700,800,900],ve={50:90,100:80,200:70,300:60,400:50,500:40,600:35,700:30,800:20,900:10},Ue=Object.fromEntries(xe.map(r=>[r,ve[r]>=60?10:100])),St=r=>{const e=w.colorToHex(r,"#000000");return He(le(e)).palettes.primary},Ye=(r,e)=>{const t=St(r);return Object.fromEntries(xe.map(n=>[n,ue(t.tone(e[n]))]))},Be=r=>Ye(r,ve),ze=r=>Ye(r,Ue),kt=r=>({colors:Be(r),onColors:ze(r)}),X=(r,e)=>{const t=b.fromInt(le(r));return ue(b.from(t.hue,t.chroma,e).toInt())},z=(r,e,t,n=1)=>{const a=b.fromInt(le(r)),s=(a.hue+e+360)%360,i=Math.min(a.chroma*n,100);return ue(b.from(s,i,t).toInt())},ce=r=>{const e=b.fromInt(le(r)),t=(e.hue+110)%360,n=Math.min(e.chroma*1.2,100),a=e.tone<50?65:Math.min(e.tone+10,75);return ue(b.from(t,n,a).toInt())},Ct=r=>{const e=ce(r);return[w.createStop(X(e,95),0),w.createStop(e,25),w.createStop(r,50),w.createStop(X(r,80),75),w.createStop(X(r,20),100)]},bt=r=>[w.createStop(X(r,94),0),w.createStop(X(r,72),28),w.createStop(r,55),w.createStop(X(r,24),100)],Tt=r=>[w.createStop(X(ce(r),88),0),w.createStop(r,50),w.createStop(X(ce(r),32),100)],Dt=r=>[w.createStop(z(r,148,82,.95),0),w.createStop(z(r,-148,70,1.05),28),w.createStop(r,56),w.createStop(z(r,150,34,1.08),100)],wt=r=>[w.createStop(z(r,-34,72,.95),0),w.createStop(r,50),w.createStop(z(r,34,34,1.05),100)],Ft=r=>[w.createStop(z(r,-120,78,.9),0),w.createStop(r,50),w.createStop(z(r,120,36,1.05),100)],xt=r=>[w.createStop(z(r,-90,78,.92),0),w.createStop(r,32),w.createStop(z(r,90,62,1),58),w.createStop(z(r,180,34,1.08),100)],vt=r=>[w.createStop(z(r,-28,82,.96),0),w.createStop(r,27),w.createStop(z(r,152,66,1.02),62),w.createStop(z(r,180,34,1.08),100)],Bt=r=>[w.createStop(z(r,-90,78,.94),0),w.createStop(r,30),w.createStop(z(r,90,62,1),62),w.createStop(z(r,180,36,1.08),100)],At=(r,e)=>{const t=(e==null?void 0:e[0])??X(r,84),n=(e==null?void 0:e[1])??ce(r);return[w.createStop(t,0),w.createStop(r,48),w.createStop(n,100)]},Ge={glare:Ct,monochrome:bt,complementary:Tt,"split-complementary":Dt,analogous:wt,triadic:Ft,tetradic:xt,rectangle:vt,square:Bt,duotone:At},Ke=(r,e,t)=>Ge[e](r,t),qe=(r,e={})=>{const t=e.shade??500,n=e.recipe??"glare";return{type:e.type??"linear",stops:Ke(r[t],n,e.colors),direction:e.direction??w.DEFAULT_GRADIENT_DIRECTION,shape:e.shape??"ellipse",position:e.position??w.DEFAULT_GRADIENT_POSITION,size:e.size??w.DEFAULT_GRADIENT_SIZE}},Mt=(r,e={})=>qe(Be(r),e),W=r=>r,je=r=>r,Te=je({materialBorder:W({label:"Material border",description:"Default Gradient UI border material.",gradient:{recipe:"glare",type:"linear",direction:135},shadow:{layers:2,opacity:.22,blur:12,y:4,spread:-3},dropShadow:{layers:2,opacity:.32,blur:12,y:5},animation:{preset:"shift",duration:6400,easing:"ease-in-out"}}),materialAction:W({label:"Material action",description:"Compact action material for buttons, chips and controls.",gradient:{recipe:"glare",type:"linear",direction:135},shadow:{layers:2,opacity:.2,blur:10,y:3,spread:-2},dropShadow:{layers:2,opacity:.28,blur:10,y:4},animation:{preset:"shift",duration:6800,easing:"ease-in-out"}}),materialSurface:W({label:"Material surface",description:"Soft surface material for calm gradient backgrounds.",gradient:{recipe:"monochrome",type:"linear",direction:145},shadow:{layers:2,opacity:.18,blur:14,y:5,spread:-3},dropShadow:{layers:2,opacity:.22,blur:14,y:5},animation:{preset:"pulse",duration:7600,easing:"ease-in-out"}}),brandGlare:W({label:"Brand glare",description:"Classic Gradient UI glare with a vivid complementary highlight.",gradient:{recipe:"glare",type:"linear",direction:135},shadow:{layers:2,opacity:.24,blur:16,y:6,spread:-3},dropShadow:{layers:3,opacity:.38,blur:16,y:6},animation:{preset:"shift",duration:6e3,easing:"ease-in-out"}}),softMono:W({label:"Soft mono",description:"Quiet monochrome ramp for subtle surfaces.",gradient:{recipe:"monochrome",type:"linear",direction:145},shadow:{layers:2,opacity:.18,blur:18,y:7,spread:-4},dropShadow:{layers:2,opacity:.26,blur:16,y:6},animation:{preset:"pulse",duration:7200,easing:"ease-in-out"}}),neonDuo:W({label:"Neon duo",description:"Punchy duotone setup with stronger glow defaults.",gradient:{recipe:"duotone",type:"linear",direction:120},shadow:{layers:2,opacity:.32,blur:18,y:7,spread:-3},dropShadow:{layers:3,opacity:.52,blur:18,y:7},animation:{preset:"shift",duration:5200,easing:"ease-in-out"}}),orbitalConic:W({label:"Orbital conic",description:"Smooth mirrored conic gradient for badges and marks.",gradient:{recipe:"triadic",type:"conic",direction:35,position:"center"},shadow:{layers:2,opacity:.24,blur:16,y:6,spread:-3},dropShadow:{layers:3,opacity:.36,blur:16,y:6},animation:{preset:"rotate",duration:9e3}}),auroraRadial:W({label:"Aurora radial",description:"Radial analogous gradient with slow hue motion.",gradient:{recipe:"analogous",type:"radial",direction:0,position:"top left",shape:"circle"},shadow:{layers:2,opacity:.22,blur:18,y:7,spread:-4},dropShadow:{layers:3,opacity:.32,blur:18,y:7},animation:{preset:"hue-rotate",duration:8e3,easing:"ease-in-out"}})}),It=(r,e=Te)=>e[r]??Te.brandGlare;exports.COLOR_SHADES=xe;exports.ON_SHADE_TONES=Ue;exports.SHADE_TONES=ve;exports.argbFromHex=le;exports.changeTone=X;exports.createGradientModel=qe;exports.createGradientModelFromColor=Mt;exports.createOnPalette=ze;exports.createPalette=Be;exports.createPalettePair=kt;exports.createRecipeStops=Ke;exports.defineGradientPreset=W;exports.defineGradientPresetRegistry=je;exports.getComplementaryColor=ce;exports.getGradientPreset=It;exports.gradientPresets=Te;exports.gradientRecipes=Ge;exports.hexFromArgb=ue;exports.shiftHue=z;exports.themeFromSourceColor=He;