@m3e/theme 1.0.0-rc.4 → 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.
- package/dist/index.js +5067 -3908
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +38 -443
- package/dist/index.min.js.map +1 -1
- package/dist/src/ThemeElement.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/index.min.js
CHANGED
|
@@ -9,461 +9,56 @@ import{css as t,LitElement as e,html as r}from"lit";import{DesignToken as a}from
|
|
|
9
9
|
* Copyright 2017 Google LLC
|
|
10
10
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
11
11
|
*/
|
|
12
|
-
const s=globalThis,c=s.ShadowRoot&&(void 0===s.ShadyCSS||s.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,
|
|
12
|
+
const s=globalThis,c=s.ShadowRoot&&(void 0===s.ShadyCSS||s.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,u=Symbol(),l=new WeakMap;
|
|
13
13
|
/**
|
|
14
14
|
* @license
|
|
15
15
|
* Copyright 2019 Google LLC
|
|
16
16
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
17
|
-
*/let
|
|
17
|
+
*/let h=class{constructor(t,e,r){if(this._$cssResult$=!0,r!==u)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(c&&void 0===t){const r=void 0!==e&&1===e.length;r&&(t=l.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),r&&l.set(e,t))}return t}toString(){return this.cssText}};const d=(t,e)=>{if(c)t.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const r of e){const e=document.createElement("style"),a=s.litNonce;void 0!==a&&e.setAttribute("nonce",a),e.textContent=r.cssText,t.appendChild(e)}},m=c?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const r of t.cssRules)e+=r.cssText;return(t=>new h("string"==typeof t?t:t+"",void 0,u))(e)})(t):t,{is:p,defineProperty:f,getOwnPropertyDescriptor:y,getOwnPropertyNames:g,getOwnPropertySymbols:P,getPrototypeOf:C}=Object,S=globalThis,v=S.trustedTypes,E=v?v.emptyScript:"",b=S.reactiveElementPolyfillSupport,k=(t,e)=>t,w={toAttribute(t,e){switch(e){case Boolean:t=t?E:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let r=t;switch(e){case Boolean:r=null!==t;break;case Number:r=null===t?null:Number(t);break;case Object:case Array:try{r=JSON.parse(t)}catch(t){r=null}}return r}},_=(t,e)=>!p(t,e),T={attribute:!0,type:String,converter:w,reflect:!1,useDefault:!1,hasChanged:_};
|
|
18
18
|
/**
|
|
19
19
|
* @license
|
|
20
20
|
* Copyright 2017 Google LLC
|
|
21
21
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
22
|
-
*/Symbol.metadata??=Symbol("metadata"),
|
|
22
|
+
*/Symbol.metadata??=Symbol("metadata"),S.litPropertyMetadata??=new WeakMap;class A extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=T){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const r=Symbol(),a=this.getPropertyDescriptor(t,r,e);void 0!==a&&f(this.prototype,t,a)}}static getPropertyDescriptor(t,e,r){const{get:a,set:n}=y(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:a,set(e){const o=a?.call(this);n?.call(this,e),this.requestUpdate(t,o,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??T}static _$Ei(){if(this.hasOwnProperty(k("elementProperties")))return;const t=C(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(k("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(k("properties"))){const t=this.properties,e=[...g(t),...P(t)];for(const r of e)this.createProperty(r,t[r])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,r]of e)this.elementProperties.set(t,r)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const r=this._$Eu(t,e);void 0!==r&&this._$Eh.set(r,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const r=new Set(t.flat(1/0).reverse());for(const t of r)e.unshift(m(t))}else void 0!==t&&e.push(m(t));return e}static _$Eu(t,e){const r=e.attribute;return!1===r?void 0:"string"==typeof r?r:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const r of e.keys())this.hasOwnProperty(r)&&(t.set(r,this[r]),delete this[r]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return d(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,r){this._$AK(t,r)}_$ET(t,e){const r=this.constructor.elementProperties.get(t),a=this.constructor._$Eu(t,r);if(void 0!==a&&!0===r.reflect){const n=(void 0!==r.converter?.toAttribute?r.converter:w).toAttribute(e,r.type);this._$Em=t,null==n?this.removeAttribute(a):this.setAttribute(a,n),this._$Em=null}}_$AK(t,e){const r=this.constructor,a=r._$Eh.get(t);if(void 0!==a&&this._$Em!==a){const t=r.getPropertyOptions(a),n="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:w;this._$Em=a;const o=n.fromAttribute(e,t.type);this[a]=o??this._$Ej?.get(a)??o,this._$Em=null}}requestUpdate(t,e,r){if(void 0!==t){const a=this.constructor,n=this[t];if(r??=a.getPropertyOptions(t),!((r.hasChanged??_)(n,e)||r.useDefault&&r.reflect&&n===this._$Ej?.get(t)&&!this.hasAttribute(a._$Eu(t,r))))return;this.C(t,e,r)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:r,reflect:a,wrapped:n},o){r&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,o??e??this[t]),!0!==n||void 0!==o)||(this._$AL.has(t)||(this.hasUpdated||r||(e=void 0),this._$AL.set(t,e)),!0===a&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,r]of t){const{wrapped:t}=r,a=this[e];!0!==t||this._$AL.has(e)||void 0===a||this.C(e,void 0,r,a)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(e)):this._$EM()}catch(e){throw t=!1,this._$EM(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(t){}firstUpdated(t){}}A.elementStyles=[],A.shadowRootOptions={mode:"open"},A[k("elementProperties")]=new Map,A[k("finalized")]=new Map,b?.({ReactiveElement:A}),(S.reactiveElementVersions??=[]).push("2.1.1");
|
|
23
23
|
/**
|
|
24
24
|
* @license
|
|
25
25
|
* Copyright 2017 Google LLC
|
|
26
26
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
27
27
|
*/
|
|
28
|
-
const
|
|
29
|
-
/**
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
*/function I(t){return t<0?-1:0===t?0:1}function H(t,e,r){return(1-r)*t+r*e}function B(t,e,r){return r<t?t:r>e?e:r}function L(t){return(t%=360)<0&&(t+=360),t}function F(t){return(t%=360)<0&&(t+=360),t}function R(t,e){return[t[0]*e[0][0]+t[1]*e[0][1]+t[2]*e[0][2],t[0]*e[1][0]+t[1]*e[1][1]+t[2]*e[1][2],t[0]*e[2][0]+t[1]*e[2][1]+t[2]*e[2][2]]}
|
|
45
|
-
/**
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
/**
|
|
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
|
-
*/((t+16)/116)}function W(t){return 116*X(t/100)-16}function G(t){const e=t/255;return e<=.040449936?e/12.92*100:100*Math.pow((e+.055)/1.055,2.4)}function J(t){const e=t/100;let r=0;return r=e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055,a=0,n=255,(o=Math.round(255*r))<a?a:o>n?n:o;var a,n,o}function X(t){const e=24389/27;return t>216/24389?Math.pow(t,1/3):(e*t+16)/116}class Z{static make(t=function(){return V}(),e=200/Math.PI*Y(50)/100,r=50,a=2,n=!1){const o=t,i=.401288*o[0]+.650173*o[1]+-.051461*o[2],s=-.250268*o[0]+1.204414*o[1]+.045854*o[2],c=-.002079*o[0]+.048952*o[1]+.953127*o[2],h=.8+a/10,u=h>=.9?H(.59,.69,10*(h-.9)):H(.525,.59,10*(h-.8));let l=n?1:h*(1-1/3.6*Math.exp((-e-42)/92));l=l>1?1:l<0?0:l;const d=h,m=[l*(100/i)+1-l,l*(100/s)+1-l,l*(100/c)+1-l],f=1/(5*e+1),g=f*f*f*f,p=1-g,y=g*e+.1*p*p*Math.cbrt(5*e),C=Y(r)/t[1],P=1.48+Math.sqrt(C),b=.725/Math.pow(C,.2),w=b,M=[Math.pow(y*m[0]*i/100,.42),Math.pow(y*m[1]*s/100,.42),Math.pow(y*m[2]*c/100,.42)],k=[400*M[0]/(M[0]+27.13),400*M[1]/(M[1]+27.13),400*M[2]/(M[2]+27.13)];return new Z(C,(2*k[0]+k[1]+.05*k[2])*b,b,w,u,d,m,y,Math.pow(y,.25),P)}constructor(t,e,r,a,n,o,i,s,c,h){this.n=t,this.aw=e,this.nbb=r,this.ncb=a,this.c=n,this.nc=o,this.rgbD=i,this.fl=s,this.fLRoot=c,this.z=h}}Z.DEFAULT=Z.make();
|
|
77
|
-
/**
|
|
78
|
-
* @license
|
|
79
|
-
* Copyright 2021 Google LLC
|
|
80
|
-
*
|
|
81
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
82
|
-
* you may not use this file except in compliance with the License.
|
|
83
|
-
* You may obtain a copy of the License at
|
|
84
|
-
*
|
|
85
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
86
|
-
*
|
|
87
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
88
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
89
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
90
|
-
* See the License for the specific language governing permissions and
|
|
91
|
-
* limitations under the License.
|
|
92
|
-
*/
|
|
93
|
-
class Q{constructor(t,e,r,a,n,o,i,s,c){this.hue=t,this.chroma=e,this.j=r,this.q=a,this.m=n,this.s=o,this.jstar=i,this.astar=s,this.bstar=c}distance(t){const e=this.jstar-t.jstar,r=this.astar-t.astar,a=this.bstar-t.bstar,n=Math.sqrt(e*e+r*r+a*a);return 1.41*Math.pow(n,.63)}static fromInt(t){return Q.fromIntInViewingConditions(t,Z.DEFAULT)}static fromIntInViewingConditions(t,e){const r=(65280&t)>>8,a=255&t,n=G((16711680&t)>>16),o=G(r),i=G(a),s=.41233895*n+.35762064*o+.18051042*i,c=.2126*n+.7152*o+.0722*i,h=.01932141*n+.11916382*o+.95034478*i,u=.401288*s+.650173*c-.051461*h,l=-.250268*s+1.204414*c+.045854*h,d=-.002079*s+.048952*c+.953127*h,m=e.rgbD[0]*u,f=e.rgbD[1]*l,g=e.rgbD[2]*d,p=Math.pow(e.fl*Math.abs(m)/100,.42),y=Math.pow(e.fl*Math.abs(f)/100,.42),C=Math.pow(e.fl*Math.abs(g)/100,.42),P=400*I(m)*p/(p+27.13),b=400*I(f)*y/(y+27.13),w=400*I(g)*C/(C+27.13),M=(11*P+-12*b+w)/11,k=(P+b-2*w)/9,v=(20*P+20*b+21*w)/20,A=(40*P+20*b+w)/20,_=180*Math.atan2(k,M)/Math.PI,D=_<0?_+360:_>=360?_-360:_,S=D*Math.PI/180,E=A*e.nbb,T=100*Math.pow(E/e.aw,e.c*e.z),x=4/e.c*Math.sqrt(T/100)*(e.aw+4)*e.fLRoot,H=D<20.14?D+360:D,B=5e4/13*(.25*(Math.cos(H*Math.PI/180+2)+3.8))*e.nc*e.ncb*Math.sqrt(M*M+k*k)/(v+.305),L=Math.pow(B,.9)*Math.pow(1.64-Math.pow(.29,e.n),.73),F=L*Math.sqrt(T/100),R=F*e.fLRoot,O=50*Math.sqrt(L*e.c/(e.aw+4)),$=(1+100*.007)*T/(1+.007*T),V=1/.0228*Math.log(1+.0228*R),U=V*Math.cos(S),N=V*Math.sin(S);return new Q(D,F,T,x,R,O,$,U,N)}static fromJch(t,e,r){return Q.fromJchInViewingConditions(t,e,r,Z.DEFAULT)}static fromJchInViewingConditions(t,e,r,a){const n=4/a.c*Math.sqrt(t/100)*(a.aw+4)*a.fLRoot,o=e*a.fLRoot,i=e/Math.sqrt(t/100),s=50*Math.sqrt(i*a.c/(a.aw+4)),c=r*Math.PI/180,h=(1+100*.007)*t/(1+.007*t),u=1/.0228*Math.log(1+.0228*o),l=u*Math.cos(c),d=u*Math.sin(c);return new Q(r,e,t,n,o,s,h,l,d)}static fromUcs(t,e,r){return Q.fromUcsInViewingConditions(t,e,r,Z.DEFAULT)}static fromUcsInViewingConditions(t,e,r,a){const n=e,o=r,i=Math.sqrt(n*n+o*o),s=(Math.exp(.0228*i)-1)/.0228/a.fLRoot;let c=Math.atan2(o,n)*(180/Math.PI);c<0&&(c+=360);const h=t/(1-.007*(t-100));return Q.fromJchInViewingConditions(h,s,c,a)}toInt(){return this.viewed(Z.DEFAULT)}viewed(t){const e=0===this.chroma||0===this.j?0:this.chroma/Math.sqrt(this.j/100),r=Math.pow(e/Math.pow(1.64-Math.pow(.29,t.n),.73),1/.9),a=this.hue*Math.PI/180,n=.25*(Math.cos(a+2)+3.8),o=t.aw*Math.pow(this.j/100,1/t.c/t.z),i=n*(5e4/13)*t.nc*t.ncb,s=o/t.nbb,c=Math.sin(a),h=Math.cos(a),u=23*(s+.305)*r/(23*i+11*r*h+108*r*c),l=u*h,d=u*c,m=(460*s+451*l+288*d)/1403,f=(460*s-891*l-261*d)/1403,g=(460*s-220*l-6300*d)/1403,p=Math.max(0,27.13*Math.abs(m)/(400-Math.abs(m))),y=I(m)*(100/t.fl)*Math.pow(p,1/.42),C=Math.max(0,27.13*Math.abs(f)/(400-Math.abs(f))),P=I(f)*(100/t.fl)*Math.pow(C,1/.42),b=Math.max(0,27.13*Math.abs(g)/(400-Math.abs(g))),w=I(g)*(100/t.fl)*Math.pow(b,1/.42),M=y/t.rgbD[0],k=P/t.rgbD[1],v=w/t.rgbD[2],A=function(t,e,r){const a=$,n=a[0][0]*t+a[0][1]*e+a[0][2]*r,o=a[1][0]*t+a[1][1]*e+a[1][2]*r,i=a[2][0]*t+a[2][1]*e+a[2][2]*r;return U(J(n),J(o),J(i))}(1.86206786*M-1.01125463*k+.14918677*v,.38752654*M+.62144744*k-.00897398*v,-.0158415*M-.03412294*k+1.04996444*v);return A}static fromXyzInViewingConditions(t,e,r,a){const n=.401288*t+.650173*e-.051461*r,o=-.250268*t+1.204414*e+.045854*r,i=-.002079*t+.048952*e+.953127*r,s=a.rgbD[0]*n,c=a.rgbD[1]*o,h=a.rgbD[2]*i,u=Math.pow(a.fl*Math.abs(s)/100,.42),l=Math.pow(a.fl*Math.abs(c)/100,.42),d=Math.pow(a.fl*Math.abs(h)/100,.42),m=400*I(s)*u/(u+27.13),f=400*I(c)*l/(l+27.13),g=400*I(h)*d/(d+27.13),p=(11*m+-12*f+g)/11,y=(m+f-2*g)/9,C=(20*m+20*f+21*g)/20,P=(40*m+20*f+g)/20,b=180*Math.atan2(y,p)/Math.PI,w=b<0?b+360:b>=360?b-360:b,M=w*Math.PI/180,k=P*a.nbb,v=100*Math.pow(k/a.aw,a.c*a.z),A=4/a.c*Math.sqrt(v/100)*(a.aw+4)*a.fLRoot,_=w<20.14?w+360:w,D=5e4/13*(1/4*(Math.cos(_*Math.PI/180+2)+3.8))*a.nc*a.ncb*Math.sqrt(p*p+y*y)/(C+.305),S=Math.pow(D,.9)*Math.pow(1.64-Math.pow(.29,a.n),.73),E=S*Math.sqrt(v/100),T=E*a.fLRoot,x=50*Math.sqrt(S*a.c/(a.aw+4)),H=(1+100*.007)*v/(1+.007*v),B=Math.log(1+.0228*T)/.0228,L=B*Math.cos(M),F=B*Math.sin(M);return new Q(w,E,v,A,T,x,H,L,F)}xyzInViewingConditions(t){const e=0===this.chroma||0===this.j?0:this.chroma/Math.sqrt(this.j/100),r=Math.pow(e/Math.pow(1.64-Math.pow(.29,t.n),.73),1/.9),a=this.hue*Math.PI/180,n=.25*(Math.cos(a+2)+3.8),o=t.aw*Math.pow(this.j/100,1/t.c/t.z),i=n*(5e4/13)*t.nc*t.ncb,s=o/t.nbb,c=Math.sin(a),h=Math.cos(a),u=23*(s+.305)*r/(23*i+11*r*h+108*r*c),l=u*h,d=u*c,m=(460*s+451*l+288*d)/1403,f=(460*s-891*l-261*d)/1403,g=(460*s-220*l-6300*d)/1403,p=Math.max(0,27.13*Math.abs(m)/(400-Math.abs(m))),y=I(m)*(100/t.fl)*Math.pow(p,1/.42),C=Math.max(0,27.13*Math.abs(f)/(400-Math.abs(f))),P=I(f)*(100/t.fl)*Math.pow(C,1/.42),b=Math.max(0,27.13*Math.abs(g)/(400-Math.abs(g))),w=I(g)*(100/t.fl)*Math.pow(b,1/.42),M=y/t.rgbD[0],k=P/t.rgbD[1],v=w/t.rgbD[2];return[1.86206786*M-1.01125463*k+.14918677*v,.38752654*M+.62144744*k-.00897398*v,-.0158415*M-.03412294*k+1.04996444*v]}}
|
|
94
|
-
/**
|
|
95
|
-
* @license
|
|
96
|
-
* Copyright 2021 Google LLC
|
|
97
|
-
*
|
|
98
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
99
|
-
* you may not use this file except in compliance with the License.
|
|
100
|
-
* You may obtain a copy of the License at
|
|
101
|
-
*
|
|
102
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
103
|
-
*
|
|
104
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
105
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
106
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
107
|
-
* See the License for the specific language governing permissions and
|
|
108
|
-
* limitations under the License.
|
|
109
|
-
*/class tt{static sanitizeRadians(t){return(t+8*Math.PI)%(2*Math.PI)}static trueDelinearized(t){const e=t/100;let r=0;return r=e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055,255*r}static chromaticAdaptation(t){const e=Math.pow(Math.abs(t),.42);return 400*I(t)*e/(e+27.13)}static hueOf(t){const e=R(t,tt.SCALED_DISCOUNT_FROM_LINRGB),r=tt.chromaticAdaptation(e[0]),a=tt.chromaticAdaptation(e[1]),n=tt.chromaticAdaptation(e[2]),o=(11*r+-12*a+n)/11,i=(r+a-2*n)/9;return Math.atan2(i,o)}static areInCyclicOrder(t,e,r){return tt.sanitizeRadians(e-t)<tt.sanitizeRadians(r-t)}static intercept(t,e,r){return(e-t)/(r-t)}static lerpPoint(t,e,r){return[t[0]+(r[0]-t[0])*e,t[1]+(r[1]-t[1])*e,t[2]+(r[2]-t[2])*e]}static setCoordinate(t,e,r,a){const n=tt.intercept(t[a],e,r[a]);return tt.lerpPoint(t,n,r)}static isBounded(t){return 0<=t&&t<=100}static nthVertex(t,e){const r=tt.Y_FROM_LINRGB[0],a=tt.Y_FROM_LINRGB[1],n=tt.Y_FROM_LINRGB[2],o=e%4<=1?0:100,i=e%2==0?0:100;if(e<4){const e=o,s=i,c=(t-e*a-s*n)/r;return tt.isBounded(c)?[c,e,s]:[-1,-1,-1]}if(e<8){const e=o,s=i,c=(t-s*r-e*n)/a;return tt.isBounded(c)?[s,c,e]:[-1,-1,-1]}{const e=o,s=i,c=(t-e*r-s*a)/n;return tt.isBounded(c)?[e,s,c]:[-1,-1,-1]}}static bisectToSegment(t,e){let r=[-1,-1,-1],a=r,n=0,o=0,i=!1,s=!0;for(let c=0;c<12;c++){const h=tt.nthVertex(t,c);if(h[0]<0)continue;const u=tt.hueOf(h);i?(s||tt.areInCyclicOrder(n,u,o))&&(s=!1,tt.areInCyclicOrder(n,e,u)?(a=h,o=u):(r=h,n=u)):(r=h,a=h,n=u,o=u,i=!0)}return[r,a]}static midpoint(t,e){return[(t[0]+e[0])/2,(t[1]+e[1])/2,(t[2]+e[2])/2]}static criticalPlaneBelow(t){return Math.floor(t-.5)}static criticalPlaneAbove(t){return Math.ceil(t-.5)}static bisectToLimit(t,e){const r=tt.bisectToSegment(t,e);let a=r[0],n=tt.hueOf(a),o=r[1];for(let t=0;t<3;t++)if(a[t]!==o[t]){let r=-1,i=255;a[t]<o[t]?(r=tt.criticalPlaneBelow(tt.trueDelinearized(a[t])),i=tt.criticalPlaneAbove(tt.trueDelinearized(o[t]))):(r=tt.criticalPlaneAbove(tt.trueDelinearized(a[t])),i=tt.criticalPlaneBelow(tt.trueDelinearized(o[t])));for(let s=0;s<8&&!(Math.abs(i-r)<=1);s++){const s=Math.floor((r+i)/2),c=tt.CRITICAL_PLANES[s],h=tt.setCoordinate(a,c,o,t),u=tt.hueOf(h);tt.areInCyclicOrder(n,e,u)?(o=h,i=s):(a=h,n=u,r=s)}}return tt.midpoint(a,o)}static inverseChromaticAdaptation(t){const e=Math.abs(t),r=Math.max(0,27.13*e/(400-e));return I(t)*Math.pow(r,1/.42)}static findResultByJ(t,e,r){let a=11*Math.sqrt(r);const n=Z.DEFAULT,o=1/Math.pow(1.64-Math.pow(.29,n.n),.73),i=.25*(Math.cos(t+2)+3.8)*(5e4/13)*n.nc*n.ncb,s=Math.sin(t),c=Math.cos(t);for(let t=0;t<5;t++){const h=a/100,u=0===e||0===a?0:e/Math.sqrt(h),l=Math.pow(u*o,1/.9),d=n.aw*Math.pow(h,1/n.c/n.z)/n.nbb,m=23*(d+.305)*l/(23*i+11*l*c+108*l*s),f=m*c,g=m*s,p=(460*d+451*f+288*g)/1403,y=(460*d-891*f-261*g)/1403,C=(460*d-220*f-6300*g)/1403,P=R([tt.inverseChromaticAdaptation(p),tt.inverseChromaticAdaptation(y),tt.inverseChromaticAdaptation(C)],tt.LINRGB_FROM_SCALED_DISCOUNT);if(P[0]<0||P[1]<0||P[2]<0)return 0;const b=tt.Y_FROM_LINRGB[0],w=tt.Y_FROM_LINRGB[1],M=tt.Y_FROM_LINRGB[2],k=b*P[0]+w*P[1]+M*P[2];if(k<=0)return 0;if(4===t||Math.abs(k-r)<.002)return P[0]>100.01||P[1]>100.01||P[2]>100.01?0:N(P);a-=(k-r)*a/(2*k)}return 0}static solveToInt(t,e,r){if(e<1e-4||r<1e-4||r>99.9999)return function(t){const e=J(Y(t));return U(e,e,e)}(r);const a=(t=F(t))/180*Math.PI,n=Y(r),o=tt.findResultByJ(a,e,n);if(0!==o)return o;return N(tt.bisectToLimit(n,a))}static solveToCam(t,e,r){return Q.fromInt(tt.solveToInt(t,e,r))}}tt.SCALED_DISCOUNT_FROM_LINRGB=[[.001200833568784504,.002389694492170889,.0002795742885861124],[.0005891086651375999,.0029785502573438758,.0003270666104008398],[.00010146692491640572,.0005364214359186694,.0032979401770712076]],tt.LINRGB_FROM_SCALED_DISCOUNT=[[1373.2198709594231,-1100.4251190754821,-7.278681089101213],[-271.815969077903,559.6580465940733,-32.46047482791194],[1.9622899599665666,-57.173814538844006,308.7233197812385]],tt.Y_FROM_LINRGB=[.2126,.7152,.0722],tt.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];
|
|
110
|
-
/**
|
|
111
|
-
* @license
|
|
112
|
-
* Copyright 2021 Google LLC
|
|
113
|
-
*
|
|
114
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
115
|
-
* you may not use this file except in compliance with the License.
|
|
116
|
-
* You may obtain a copy of the License at
|
|
117
|
-
*
|
|
118
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
119
|
-
*
|
|
120
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
121
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
122
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
123
|
-
* See the License for the specific language governing permissions and
|
|
124
|
-
* limitations under the License.
|
|
125
|
-
*/
|
|
126
|
-
class et{static from(t,e,r){return new et(tt.solveToInt(t,e,r))}static fromInt(t){return new et(t)}toInt(){return this.argb}get hue(){return this.internalHue}set hue(t){this.setInternalState(tt.solveToInt(t,this.internalChroma,this.internalTone))}get chroma(){return this.internalChroma}set chroma(t){this.setInternalState(tt.solveToInt(this.internalHue,t,this.internalTone))}get tone(){return this.internalTone}set tone(t){this.setInternalState(tt.solveToInt(this.internalHue,this.internalChroma,t))}constructor(t){this.argb=t;const e=Q.fromInt(t);this.internalHue=e.hue,this.internalChroma=e.chroma,this.internalTone=K(t),this.argb=t}setInternalState(t){const e=Q.fromInt(t);this.internalHue=e.hue,this.internalChroma=e.chroma,this.internalTone=K(t),this.argb=t}inViewingConditions(t){const e=Q.fromInt(this.toInt()).xyzInViewingConditions(t),r=Q.fromXyzInViewingConditions(e[0],e[1],e[2],Z.make());return et.from(r.hue,r.chroma,W(e[1]))}}
|
|
127
|
-
/**
|
|
128
|
-
* @license
|
|
129
|
-
* Copyright 2022 Google LLC
|
|
130
|
-
*
|
|
131
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
132
|
-
* you may not use this file except in compliance with the License.
|
|
133
|
-
* You may obtain a copy of the License at
|
|
134
|
-
*
|
|
135
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
136
|
-
*
|
|
137
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
138
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
139
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
140
|
-
* See the License for the specific language governing permissions and
|
|
141
|
-
* limitations under the License.
|
|
142
|
-
*/class rt{static ratioOfTones(t,e){return t=B(0,100,t),e=B(0,100,e),rt.ratioOfYs(Y(t),Y(e))}static ratioOfYs(t,e){const r=t>e?t:e;return(r+5)/((r===e?t:e)+5)}static lighter(t,e){if(t<0||t>100)return-1;const r=Y(t),a=e*(r+5)-5,n=rt.ratioOfYs(a,r),o=Math.abs(n-e);if(n<e&&o>.04)return-1;const i=W(a)+.4;return i<0||i>100?-1:i}static darker(t,e){if(t<0||t>100)return-1;const r=Y(t),a=(r+5)/e-5,n=rt.ratioOfYs(r,a),o=Math.abs(n-e);if(n<e&&o>.04)return-1;const i=W(a)-.4;return i<0||i>100?-1:i}static lighterUnsafe(t,e){const r=rt.lighter(t,e);return r<0?100:r}static darkerUnsafe(t,e){const r=rt.darker(t,e);return r<0?0:r}}
|
|
143
|
-
/**
|
|
144
|
-
* @license
|
|
145
|
-
* Copyright 2023 Google LLC
|
|
146
|
-
*
|
|
147
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
148
|
-
* you may not use this file except in compliance with the License.
|
|
149
|
-
* You may obtain a copy of the License at
|
|
150
|
-
*
|
|
151
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
152
|
-
*
|
|
153
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
154
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
155
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
156
|
-
* See the License for the specific language governing permissions and
|
|
157
|
-
* limitations under the License.
|
|
158
|
-
*/class at{static isDisliked(t){const e=Math.round(t.hue)>=90&&Math.round(t.hue)<=111,r=Math.round(t.chroma)>16,a=Math.round(t.tone)<65;return e&&r&&a}static fixIfDisliked(t){return at.isDisliked(t)?et.from(t.hue,t.chroma,70):t}}
|
|
159
|
-
/**
|
|
160
|
-
* @license
|
|
161
|
-
* Copyright 2022 Google LLC
|
|
162
|
-
*
|
|
163
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
164
|
-
* you may not use this file except in compliance with the License.
|
|
165
|
-
* You may obtain a copy of the License at
|
|
166
|
-
*
|
|
167
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
168
|
-
*
|
|
169
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
170
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
171
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
172
|
-
* See the License for the specific language governing permissions and
|
|
173
|
-
* limitations under the License.
|
|
174
|
-
*/class nt{static fromPalette(t){return new nt(t.name??"",t.palette,t.tone,t.isBackground??!1,t.background,t.secondBackground,t.contrastCurve,t.toneDeltaPair)}constructor(t,e,r,a,n,o,i,s){if(this.name=t,this.palette=e,this.tone=r,this.isBackground=a,this.background=n,this.secondBackground=o,this.contrastCurve=i,this.toneDeltaPair=s,this.hctCache=new Map,!n&&o)throw new Error(`Color ${t} has secondBackgrounddefined, but background is not defined.`);if(!n&&i)throw new Error(`Color ${t} has contrastCurvedefined, but background is not defined.`);if(n&&!i)throw new Error(`Color ${t} has backgrounddefined, but contrastCurve is not defined.`)}getArgb(t){return this.getHct(t).toInt()}getHct(t){const e=this.hctCache.get(t);if(null!=e)return e;const r=this.getTone(t),a=this.palette(t).getHct(r);return this.hctCache.size>4&&this.hctCache.clear(),this.hctCache.set(t,a),a}getTone(t){const e=t.contrastLevel<0;if(this.toneDeltaPair){const r=this.toneDeltaPair(t),a=r.roleA,n=r.roleB,o=r.delta,i=r.polarity,s=r.stayTogether,c=this.background(t).getTone(t),h="nearer"===i||"lighter"===i&&!t.isDark||"darker"===i&&t.isDark,u=h?a:n,l=h?n:a,d=this.name===u.name,m=t.isDark?1:-1,f=u.contrastCurve.get(t.contrastLevel),g=l.contrastCurve.get(t.contrastLevel),p=u.tone(t);let y=rt.ratioOfTones(c,p)>=f?p:nt.foregroundTone(c,f);const C=l.tone(t);let P=rt.ratioOfTones(c,C)>=g?C:nt.foregroundTone(c,g);return e&&(y=nt.foregroundTone(c,f),P=nt.foregroundTone(c,g)),(P-y)*m>=o||(P=B(0,100,y+o*m),(P-y)*m>=o||(y=B(0,100,P-o*m))),50<=y&&y<60?m>0?(y=60,P=Math.max(P,y+o*m)):(y=49,P=Math.min(P,y+o*m)):50<=P&&P<60&&(s?m>0?(y=60,P=Math.max(P,y+o*m)):(y=49,P=Math.min(P,y+o*m)):P=m>0?60:49),d?y:P}{let r=this.tone(t);if(null==this.background)return r;const a=this.background(t).getTone(t),n=this.contrastCurve.get(t.contrastLevel);if(rt.ratioOfTones(a,r)>=n||(r=nt.foregroundTone(a,n)),e&&(r=nt.foregroundTone(a,n)),this.isBackground&&50<=r&&r<60&&(r=rt.ratioOfTones(49,a)>=n?49:60),this.secondBackground){const[e,a]=[this.background,this.secondBackground],[o,i]=[e(t).getTone(t),a(t).getTone(t)],[s,c]=[Math.max(o,i),Math.min(o,i)];if(rt.ratioOfTones(s,r)>=n&&rt.ratioOfTones(c,r)>=n)return r;const h=rt.lighter(s,n),u=rt.darker(c,n),l=[];-1!==h&&l.push(h),-1!==u&&l.push(u);return nt.tonePrefersLightForeground(o)||nt.tonePrefersLightForeground(i)?h<0?100:h:1===l.length?l[0]:u<0?0:u}return r}}static foregroundTone(t,e){const r=rt.lighterUnsafe(t,e),a=rt.darkerUnsafe(t,e),n=rt.ratioOfTones(r,t),o=rt.ratioOfTones(a,t);if(nt.tonePrefersLightForeground(t)){const t=Math.abs(n-o)<.1&&n<e&&o<e;return n>=e||n>=o||t?r:a}return o>=e||o>=n?a:r}static tonePrefersLightForeground(t){return Math.round(t)<60}static toneAllowsLightForeground(t){return Math.round(t)<=49}static enableLightForeground(t){return nt.tonePrefersLightForeground(t)&&!nt.toneAllowsLightForeground(t)?49:t}}
|
|
175
|
-
/**
|
|
176
|
-
* @license
|
|
177
|
-
* Copyright 2021 Google LLC
|
|
178
|
-
*
|
|
179
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
180
|
-
* you may not use this file except in compliance with the License.
|
|
181
|
-
* You may obtain a copy of the License at
|
|
182
|
-
*
|
|
183
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
184
|
-
*
|
|
185
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
186
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
187
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
188
|
-
* See the License for the specific language governing permissions and
|
|
189
|
-
* limitations under the License.
|
|
190
|
-
*/class ot{static fromInt(t){const e=et.fromInt(t);return ot.fromHct(e)}static fromHct(t){return new ot(t.hue,t.chroma,t)}static fromHueAndChroma(t,e){const r=new it(t,e).create();return new ot(t,e,r)}constructor(t,e,r){this.hue=t,this.chroma=e,this.keyColor=r,this.cache=new Map}tone(t){let e=this.cache.get(t);return void 0===e&&(e=et.from(this.hue,this.chroma,t).toInt(),this.cache.set(t,e)),e}getHct(t){return et.fromInt(this.tone(t))}}class it{constructor(t,e){this.hue=t,this.requestedChroma=e,this.chromaCache=new Map,this.maxChromaValue=200}create(){let t=0,e=100;for(;t<e;){const r=Math.floor((t+e)/2),a=this.maxChroma(r)<this.maxChroma(r+1);if(this.maxChroma(r)>=this.requestedChroma-.01)if(Math.abs(t-50)<Math.abs(e-50))e=r;else{if(t===r)return et.from(this.hue,this.requestedChroma,t);t=r}else a?t=r+1:e=r}return et.from(this.hue,this.requestedChroma,t)}maxChroma(t){if(this.chromaCache.has(t))return this.chromaCache.get(t);const e=et.from(this.hue,this.maxChromaValue,t).chroma;return this.chromaCache.set(t,e),e}}
|
|
191
|
-
/**
|
|
192
|
-
* @license
|
|
193
|
-
* Copyright 2023 Google LLC
|
|
194
|
-
*
|
|
195
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
196
|
-
* you may not use this file except in compliance with the License.
|
|
197
|
-
* You may obtain a copy of the License at
|
|
198
|
-
*
|
|
199
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
200
|
-
*
|
|
201
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
202
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
203
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
204
|
-
* See the License for the specific language governing permissions and
|
|
205
|
-
* limitations under the License.
|
|
206
|
-
*/class st{constructor(t,e,r,a){this.low=t,this.normal=e,this.medium=r,this.high=a}get(t){return t<=-1?this.low:t<0?H(this.low,this.normal,(t- -1)/1):t<.5?H(this.normal,this.medium,(t-0)/.5):t<1?H(this.medium,this.high,(t-.5)/.5):this.high}}
|
|
207
|
-
/**
|
|
208
|
-
* @license
|
|
209
|
-
* Copyright 2023 Google LLC
|
|
210
|
-
*
|
|
211
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
212
|
-
* you may not use this file except in compliance with the License.
|
|
213
|
-
* You may obtain a copy of the License at
|
|
214
|
-
*
|
|
215
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
216
|
-
*
|
|
217
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
218
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
219
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
220
|
-
* See the License for the specific language governing permissions and
|
|
221
|
-
* limitations under the License.
|
|
222
|
-
*/class ct{constructor(t,e,r,a,n){this.roleA=t,this.roleB=e,this.delta=r,this.polarity=a,this.stayTogether=n}}
|
|
223
|
-
/**
|
|
224
|
-
* @license
|
|
225
|
-
* Copyright 2022 Google LLC
|
|
226
|
-
*
|
|
227
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
228
|
-
* you may not use this file except in compliance with the License.
|
|
229
|
-
* You may obtain a copy of the License at
|
|
230
|
-
*
|
|
231
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
232
|
-
*
|
|
233
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
234
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
235
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
236
|
-
* See the License for the specific language governing permissions and
|
|
237
|
-
* limitations under the License.
|
|
238
|
-
*/var ht,ut,lt,dt,mt,ft,gt,pt,yt,Ct,Pt;
|
|
239
|
-
/**
|
|
240
|
-
* @license
|
|
241
|
-
* Copyright 2022 Google LLC
|
|
242
|
-
*
|
|
243
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
244
|
-
* you may not use this file except in compliance with the License.
|
|
245
|
-
* You may obtain a copy of the License at
|
|
246
|
-
*
|
|
247
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
248
|
-
*
|
|
249
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
250
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
251
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
252
|
-
* See the License for the specific language governing permissions and
|
|
253
|
-
* limitations under the License.
|
|
254
|
-
*/
|
|
255
|
-
function bt(t){return t.variant===ht.FIDELITY||t.variant===ht.CONTENT}function wt(t){return t.variant===ht.MONOCHROME}!function(t){t[t.MONOCHROME=0]="MONOCHROME",t[t.NEUTRAL=1]="NEUTRAL",t[t.TONAL_SPOT=2]="TONAL_SPOT",t[t.VIBRANT=3]="VIBRANT",t[t.EXPRESSIVE=4]="EXPRESSIVE",t[t.FIDELITY=5]="FIDELITY",t[t.CONTENT=6]="CONTENT",t[t.RAINBOW=7]="RAINBOW",t[t.FRUIT_SALAD=8]="FRUIT_SALAD"}(ht||(ht={}));class Mt{static highestSurface(t){return t.isDark?Mt.surfaceBright:Mt.surfaceDim}}Mt.contentAccentToneDelta=15,Mt.primaryPaletteKeyColor=nt.fromPalette({name:"primary_palette_key_color",palette:t=>t.primaryPalette,tone:t=>t.primaryPalette.keyColor.tone}),Mt.secondaryPaletteKeyColor=nt.fromPalette({name:"secondary_palette_key_color",palette:t=>t.secondaryPalette,tone:t=>t.secondaryPalette.keyColor.tone}),Mt.tertiaryPaletteKeyColor=nt.fromPalette({name:"tertiary_palette_key_color",palette:t=>t.tertiaryPalette,tone:t=>t.tertiaryPalette.keyColor.tone}),Mt.neutralPaletteKeyColor=nt.fromPalette({name:"neutral_palette_key_color",palette:t=>t.neutralPalette,tone:t=>t.neutralPalette.keyColor.tone}),Mt.neutralVariantPaletteKeyColor=nt.fromPalette({name:"neutral_variant_palette_key_color",palette:t=>t.neutralVariantPalette,tone:t=>t.neutralVariantPalette.keyColor.tone}),Mt.background=nt.fromPalette({name:"background",palette:t=>t.neutralPalette,tone:t=>t.isDark?6:98,isBackground:!0}),Mt.onBackground=nt.fromPalette({name:"on_background",palette:t=>t.neutralPalette,tone:t=>t.isDark?90:10,background:t=>Mt.background,contrastCurve:new st(3,3,4.5,7)}),Mt.surface=nt.fromPalette({name:"surface",palette:t=>t.neutralPalette,tone:t=>t.isDark?6:98,isBackground:!0}),Mt.surfaceDim=nt.fromPalette({name:"surface_dim",palette:t=>t.neutralPalette,tone:t=>t.isDark?6:new st(87,87,80,75).get(t.contrastLevel),isBackground:!0}),Mt.surfaceBright=nt.fromPalette({name:"surface_bright",palette:t=>t.neutralPalette,tone:t=>t.isDark?new st(24,24,29,34).get(t.contrastLevel):98,isBackground:!0}),Mt.surfaceContainerLowest=nt.fromPalette({name:"surface_container_lowest",palette:t=>t.neutralPalette,tone:t=>t.isDark?new st(4,4,2,0).get(t.contrastLevel):100,isBackground:!0}),Mt.surfaceContainerLow=nt.fromPalette({name:"surface_container_low",palette:t=>t.neutralPalette,tone:t=>t.isDark?new st(10,10,11,12).get(t.contrastLevel):new st(96,96,96,95).get(t.contrastLevel),isBackground:!0}),Mt.surfaceContainer=nt.fromPalette({name:"surface_container",palette:t=>t.neutralPalette,tone:t=>t.isDark?new st(12,12,16,20).get(t.contrastLevel):new st(94,94,92,90).get(t.contrastLevel),isBackground:!0}),Mt.surfaceContainerHigh=nt.fromPalette({name:"surface_container_high",palette:t=>t.neutralPalette,tone:t=>t.isDark?new st(17,17,21,25).get(t.contrastLevel):new st(92,92,88,85).get(t.contrastLevel),isBackground:!0}),Mt.surfaceContainerHighest=nt.fromPalette({name:"surface_container_highest",palette:t=>t.neutralPalette,tone:t=>t.isDark?new st(22,22,26,30).get(t.contrastLevel):new st(90,90,84,80).get(t.contrastLevel),isBackground:!0}),Mt.onSurface=nt.fromPalette({name:"on_surface",palette:t=>t.neutralPalette,tone:t=>t.isDark?90:10,background:t=>Mt.highestSurface(t),contrastCurve:new st(4.5,7,11,21)}),Mt.surfaceVariant=nt.fromPalette({name:"surface_variant",palette:t=>t.neutralVariantPalette,tone:t=>t.isDark?30:90,isBackground:!0}),Mt.onSurfaceVariant=nt.fromPalette({name:"on_surface_variant",palette:t=>t.neutralVariantPalette,tone:t=>t.isDark?80:30,background:t=>Mt.highestSurface(t),contrastCurve:new st(3,4.5,7,11)}),Mt.inverseSurface=nt.fromPalette({name:"inverse_surface",palette:t=>t.neutralPalette,tone:t=>t.isDark?90:20}),Mt.inverseOnSurface=nt.fromPalette({name:"inverse_on_surface",palette:t=>t.neutralPalette,tone:t=>t.isDark?20:95,background:t=>Mt.inverseSurface,contrastCurve:new st(4.5,7,11,21)}),Mt.outline=nt.fromPalette({name:"outline",palette:t=>t.neutralVariantPalette,tone:t=>t.isDark?60:50,background:t=>Mt.highestSurface(t),contrastCurve:new st(1.5,3,4.5,7)}),Mt.outlineVariant=nt.fromPalette({name:"outline_variant",palette:t=>t.neutralVariantPalette,tone:t=>t.isDark?30:80,background:t=>Mt.highestSurface(t),contrastCurve:new st(1,1,3,4.5)}),Mt.shadow=nt.fromPalette({name:"shadow",palette:t=>t.neutralPalette,tone:t=>0}),Mt.scrim=nt.fromPalette({name:"scrim",palette:t=>t.neutralPalette,tone:t=>0}),Mt.surfaceTint=nt.fromPalette({name:"surface_tint",palette:t=>t.primaryPalette,tone:t=>t.isDark?80:40,isBackground:!0}),Mt.primary=nt.fromPalette({name:"primary",palette:t=>t.primaryPalette,tone:t=>wt(t)?t.isDark?100:0:t.isDark?80:40,isBackground:!0,background:t=>Mt.highestSurface(t),contrastCurve:new st(3,4.5,7,7),toneDeltaPair:t=>new ct(Mt.primaryContainer,Mt.primary,10,"nearer",!1)}),Mt.onPrimary=nt.fromPalette({name:"on_primary",palette:t=>t.primaryPalette,tone:t=>wt(t)?t.isDark?10:90:t.isDark?20:100,background:t=>Mt.primary,contrastCurve:new st(4.5,7,11,21)}),Mt.primaryContainer=nt.fromPalette({name:"primary_container",palette:t=>t.primaryPalette,tone:t=>bt(t)?t.sourceColorHct.tone:wt(t)?t.isDark?85:25:t.isDark?30:90,isBackground:!0,background:t=>Mt.highestSurface(t),contrastCurve:new st(1,1,3,4.5),toneDeltaPair:t=>new ct(Mt.primaryContainer,Mt.primary,10,"nearer",!1)}),Mt.onPrimaryContainer=nt.fromPalette({name:"on_primary_container",palette:t=>t.primaryPalette,tone:t=>bt(t)?nt.foregroundTone(Mt.primaryContainer.tone(t),4.5):wt(t)?t.isDark?0:100:t.isDark?90:30,background:t=>Mt.primaryContainer,contrastCurve:new st(3,4.5,7,11)}),Mt.inversePrimary=nt.fromPalette({name:"inverse_primary",palette:t=>t.primaryPalette,tone:t=>t.isDark?40:80,background:t=>Mt.inverseSurface,contrastCurve:new st(3,4.5,7,7)}),Mt.secondary=nt.fromPalette({name:"secondary",palette:t=>t.secondaryPalette,tone:t=>t.isDark?80:40,isBackground:!0,background:t=>Mt.highestSurface(t),contrastCurve:new st(3,4.5,7,7),toneDeltaPair:t=>new ct(Mt.secondaryContainer,Mt.secondary,10,"nearer",!1)}),Mt.onSecondary=nt.fromPalette({name:"on_secondary",palette:t=>t.secondaryPalette,tone:t=>wt(t)?t.isDark?10:100:t.isDark?20:100,background:t=>Mt.secondary,contrastCurve:new st(4.5,7,11,21)}),Mt.secondaryContainer=nt.fromPalette({name:"secondary_container",palette:t=>t.secondaryPalette,tone:t=>{const e=t.isDark?30:90;return wt(t)?t.isDark?30:85:bt(t)?function(t,e,r,a){let n=r,o=et.from(t,e,r);if(o.chroma<e){let r=o.chroma;for(;o.chroma<e;){n+=a?-1:1;const i=et.from(t,e,n);if(r>i.chroma)break;if(Math.abs(i.chroma-e)<.4)break;Math.abs(i.chroma-e)<Math.abs(o.chroma-e)&&(o=i),r=Math.max(r,i.chroma)}}return n}(t.secondaryPalette.hue,t.secondaryPalette.chroma,e,!t.isDark):e},isBackground:!0,background:t=>Mt.highestSurface(t),contrastCurve:new st(1,1,3,4.5),toneDeltaPair:t=>new ct(Mt.secondaryContainer,Mt.secondary,10,"nearer",!1)}),Mt.onSecondaryContainer=nt.fromPalette({name:"on_secondary_container",palette:t=>t.secondaryPalette,tone:t=>wt(t)?t.isDark?90:10:bt(t)?nt.foregroundTone(Mt.secondaryContainer.tone(t),4.5):t.isDark?90:30,background:t=>Mt.secondaryContainer,contrastCurve:new st(3,4.5,7,11)}),Mt.tertiary=nt.fromPalette({name:"tertiary",palette:t=>t.tertiaryPalette,tone:t=>wt(t)?t.isDark?90:25:t.isDark?80:40,isBackground:!0,background:t=>Mt.highestSurface(t),contrastCurve:new st(3,4.5,7,7),toneDeltaPair:t=>new ct(Mt.tertiaryContainer,Mt.tertiary,10,"nearer",!1)}),Mt.onTertiary=nt.fromPalette({name:"on_tertiary",palette:t=>t.tertiaryPalette,tone:t=>wt(t)?t.isDark?10:90:t.isDark?20:100,background:t=>Mt.tertiary,contrastCurve:new st(4.5,7,11,21)}),Mt.tertiaryContainer=nt.fromPalette({name:"tertiary_container",palette:t=>t.tertiaryPalette,tone:t=>{if(wt(t))return t.isDark?60:49;if(!bt(t))return t.isDark?30:90;const e=t.tertiaryPalette.getHct(t.sourceColorHct.tone);return at.fixIfDisliked(e).tone},isBackground:!0,background:t=>Mt.highestSurface(t),contrastCurve:new st(1,1,3,4.5),toneDeltaPair:t=>new ct(Mt.tertiaryContainer,Mt.tertiary,10,"nearer",!1)}),Mt.onTertiaryContainer=nt.fromPalette({name:"on_tertiary_container",palette:t=>t.tertiaryPalette,tone:t=>wt(t)?t.isDark?0:100:bt(t)?nt.foregroundTone(Mt.tertiaryContainer.tone(t),4.5):t.isDark?90:30,background:t=>Mt.tertiaryContainer,contrastCurve:new st(3,4.5,7,11)}),Mt.error=nt.fromPalette({name:"error",palette:t=>t.errorPalette,tone:t=>t.isDark?80:40,isBackground:!0,background:t=>Mt.highestSurface(t),contrastCurve:new st(3,4.5,7,7),toneDeltaPair:t=>new ct(Mt.errorContainer,Mt.error,10,"nearer",!1)}),Mt.onError=nt.fromPalette({name:"on_error",palette:t=>t.errorPalette,tone:t=>t.isDark?20:100,background:t=>Mt.error,contrastCurve:new st(4.5,7,11,21)}),Mt.errorContainer=nt.fromPalette({name:"error_container",palette:t=>t.errorPalette,tone:t=>t.isDark?30:90,isBackground:!0,background:t=>Mt.highestSurface(t),contrastCurve:new st(1,1,3,4.5),toneDeltaPair:t=>new ct(Mt.errorContainer,Mt.error,10,"nearer",!1)}),Mt.onErrorContainer=nt.fromPalette({name:"on_error_container",palette:t=>t.errorPalette,tone:t=>wt(t)?t.isDark?90:10:t.isDark?90:30,background:t=>Mt.errorContainer,contrastCurve:new st(3,4.5,7,11)}),Mt.primaryFixed=nt.fromPalette({name:"primary_fixed",palette:t=>t.primaryPalette,tone:t=>wt(t)?40:90,isBackground:!0,background:t=>Mt.highestSurface(t),contrastCurve:new st(1,1,3,4.5),toneDeltaPair:t=>new ct(Mt.primaryFixed,Mt.primaryFixedDim,10,"lighter",!0)}),Mt.primaryFixedDim=nt.fromPalette({name:"primary_fixed_dim",palette:t=>t.primaryPalette,tone:t=>wt(t)?30:80,isBackground:!0,background:t=>Mt.highestSurface(t),contrastCurve:new st(1,1,3,4.5),toneDeltaPair:t=>new ct(Mt.primaryFixed,Mt.primaryFixedDim,10,"lighter",!0)}),Mt.onPrimaryFixed=nt.fromPalette({name:"on_primary_fixed",palette:t=>t.primaryPalette,tone:t=>wt(t)?100:10,background:t=>Mt.primaryFixedDim,secondBackground:t=>Mt.primaryFixed,contrastCurve:new st(4.5,7,11,21)}),Mt.onPrimaryFixedVariant=nt.fromPalette({name:"on_primary_fixed_variant",palette:t=>t.primaryPalette,tone:t=>wt(t)?90:30,background:t=>Mt.primaryFixedDim,secondBackground:t=>Mt.primaryFixed,contrastCurve:new st(3,4.5,7,11)}),Mt.secondaryFixed=nt.fromPalette({name:"secondary_fixed",palette:t=>t.secondaryPalette,tone:t=>wt(t)?80:90,isBackground:!0,background:t=>Mt.highestSurface(t),contrastCurve:new st(1,1,3,4.5),toneDeltaPair:t=>new ct(Mt.secondaryFixed,Mt.secondaryFixedDim,10,"lighter",!0)}),Mt.secondaryFixedDim=nt.fromPalette({name:"secondary_fixed_dim",palette:t=>t.secondaryPalette,tone:t=>wt(t)?70:80,isBackground:!0,background:t=>Mt.highestSurface(t),contrastCurve:new st(1,1,3,4.5),toneDeltaPair:t=>new ct(Mt.secondaryFixed,Mt.secondaryFixedDim,10,"lighter",!0)}),Mt.onSecondaryFixed=nt.fromPalette({name:"on_secondary_fixed",palette:t=>t.secondaryPalette,tone:t=>10,background:t=>Mt.secondaryFixedDim,secondBackground:t=>Mt.secondaryFixed,contrastCurve:new st(4.5,7,11,21)}),Mt.onSecondaryFixedVariant=nt.fromPalette({name:"on_secondary_fixed_variant",palette:t=>t.secondaryPalette,tone:t=>wt(t)?25:30,background:t=>Mt.secondaryFixedDim,secondBackground:t=>Mt.secondaryFixed,contrastCurve:new st(3,4.5,7,11)}),Mt.tertiaryFixed=nt.fromPalette({name:"tertiary_fixed",palette:t=>t.tertiaryPalette,tone:t=>wt(t)?40:90,isBackground:!0,background:t=>Mt.highestSurface(t),contrastCurve:new st(1,1,3,4.5),toneDeltaPair:t=>new ct(Mt.tertiaryFixed,Mt.tertiaryFixedDim,10,"lighter",!0)}),Mt.tertiaryFixedDim=nt.fromPalette({name:"tertiary_fixed_dim",palette:t=>t.tertiaryPalette,tone:t=>wt(t)?30:80,isBackground:!0,background:t=>Mt.highestSurface(t),contrastCurve:new st(1,1,3,4.5),toneDeltaPair:t=>new ct(Mt.tertiaryFixed,Mt.tertiaryFixedDim,10,"lighter",!0)}),Mt.onTertiaryFixed=nt.fromPalette({name:"on_tertiary_fixed",palette:t=>t.tertiaryPalette,tone:t=>wt(t)?100:10,background:t=>Mt.tertiaryFixedDim,secondBackground:t=>Mt.tertiaryFixed,contrastCurve:new st(4.5,7,11,21)}),Mt.onTertiaryFixedVariant=nt.fromPalette({name:"on_tertiary_fixed_variant",palette:t=>t.tertiaryPalette,tone:t=>wt(t)?90:30,background:t=>Mt.tertiaryFixedDim,secondBackground:t=>Mt.tertiaryFixed,contrastCurve:new st(3,4.5,7,11)});
|
|
256
|
-
/**
|
|
257
|
-
* @license
|
|
258
|
-
* Copyright 2022 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
|
-
*/
|
|
272
|
-
class kt{constructor(t){this.sourceColorArgb=t.sourceColorArgb,this.variant=t.variant,this.contrastLevel=t.contrastLevel,this.isDark=t.isDark,this.sourceColorHct=et.fromInt(t.sourceColorArgb),this.primaryPalette=t.primaryPalette,this.secondaryPalette=t.secondaryPalette,this.tertiaryPalette=t.tertiaryPalette,this.neutralPalette=t.neutralPalette,this.neutralVariantPalette=t.neutralVariantPalette,this.errorPalette=ot.fromHueAndChroma(25,84)}static getRotatedHue(t,e,r){const a=t.hue;if(e.length!==r.length)throw new Error(`mismatch between hue length ${e.length} & rotations ${r.length}`);if(1===r.length)return F(t.hue+r[0]);const n=e.length;for(let t=0;t<=n-2;t++){const n=e[t],o=e[t+1];if(n<a&&a<o)return F(a+r[t])}return a}getArgb(t){return t.getArgb(this)}getHct(t){return t.getHct(this)}get primaryPaletteKeyColor(){return this.getArgb(Mt.primaryPaletteKeyColor)}get secondaryPaletteKeyColor(){return this.getArgb(Mt.secondaryPaletteKeyColor)}get tertiaryPaletteKeyColor(){return this.getArgb(Mt.tertiaryPaletteKeyColor)}get neutralPaletteKeyColor(){return this.getArgb(Mt.neutralPaletteKeyColor)}get neutralVariantPaletteKeyColor(){return this.getArgb(Mt.neutralVariantPaletteKeyColor)}get background(){return this.getArgb(Mt.background)}get onBackground(){return this.getArgb(Mt.onBackground)}get surface(){return this.getArgb(Mt.surface)}get surfaceDim(){return this.getArgb(Mt.surfaceDim)}get surfaceBright(){return this.getArgb(Mt.surfaceBright)}get surfaceContainerLowest(){return this.getArgb(Mt.surfaceContainerLowest)}get surfaceContainerLow(){return this.getArgb(Mt.surfaceContainerLow)}get surfaceContainer(){return this.getArgb(Mt.surfaceContainer)}get surfaceContainerHigh(){return this.getArgb(Mt.surfaceContainerHigh)}get surfaceContainerHighest(){return this.getArgb(Mt.surfaceContainerHighest)}get onSurface(){return this.getArgb(Mt.onSurface)}get surfaceVariant(){return this.getArgb(Mt.surfaceVariant)}get onSurfaceVariant(){return this.getArgb(Mt.onSurfaceVariant)}get inverseSurface(){return this.getArgb(Mt.inverseSurface)}get inverseOnSurface(){return this.getArgb(Mt.inverseOnSurface)}get outline(){return this.getArgb(Mt.outline)}get outlineVariant(){return this.getArgb(Mt.outlineVariant)}get shadow(){return this.getArgb(Mt.shadow)}get scrim(){return this.getArgb(Mt.scrim)}get surfaceTint(){return this.getArgb(Mt.surfaceTint)}get primary(){return this.getArgb(Mt.primary)}get onPrimary(){return this.getArgb(Mt.onPrimary)}get primaryContainer(){return this.getArgb(Mt.primaryContainer)}get onPrimaryContainer(){return this.getArgb(Mt.onPrimaryContainer)}get inversePrimary(){return this.getArgb(Mt.inversePrimary)}get secondary(){return this.getArgb(Mt.secondary)}get onSecondary(){return this.getArgb(Mt.onSecondary)}get secondaryContainer(){return this.getArgb(Mt.secondaryContainer)}get onSecondaryContainer(){return this.getArgb(Mt.onSecondaryContainer)}get tertiary(){return this.getArgb(Mt.tertiary)}get onTertiary(){return this.getArgb(Mt.onTertiary)}get tertiaryContainer(){return this.getArgb(Mt.tertiaryContainer)}get onTertiaryContainer(){return this.getArgb(Mt.onTertiaryContainer)}get error(){return this.getArgb(Mt.error)}get onError(){return this.getArgb(Mt.onError)}get errorContainer(){return this.getArgb(Mt.errorContainer)}get onErrorContainer(){return this.getArgb(Mt.onErrorContainer)}get primaryFixed(){return this.getArgb(Mt.primaryFixed)}get primaryFixedDim(){return this.getArgb(Mt.primaryFixedDim)}get onPrimaryFixed(){return this.getArgb(Mt.onPrimaryFixed)}get onPrimaryFixedVariant(){return this.getArgb(Mt.onPrimaryFixedVariant)}get secondaryFixed(){return this.getArgb(Mt.secondaryFixed)}get secondaryFixedDim(){return this.getArgb(Mt.secondaryFixedDim)}get onSecondaryFixed(){return this.getArgb(Mt.onSecondaryFixed)}get onSecondaryFixedVariant(){return this.getArgb(Mt.onSecondaryFixedVariant)}get tertiaryFixed(){return this.getArgb(Mt.tertiaryFixed)}get tertiaryFixedDim(){return this.getArgb(Mt.tertiaryFixedDim)}get onTertiaryFixed(){return this.getArgb(Mt.onTertiaryFixed)}get onTertiaryFixedVariant(){return this.getArgb(Mt.onTertiaryFixedVariant)}}
|
|
273
|
-
/**
|
|
274
|
-
* @license
|
|
275
|
-
* Copyright 2021 Google LLC
|
|
276
|
-
*
|
|
277
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
278
|
-
* you may not use this file except in compliance with the License.
|
|
279
|
-
* You may obtain a copy of the License at
|
|
280
|
-
*
|
|
281
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
282
|
-
*
|
|
283
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
284
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
285
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
286
|
-
* See the License for the specific language governing permissions and
|
|
287
|
-
* limitations under the License.
|
|
288
|
-
*/class vt{static of(t){return new vt(t,!1)}static contentOf(t){return new vt(t,!0)}static fromColors(t){return vt.createPaletteFromColors(!1,t)}static contentFromColors(t){return vt.createPaletteFromColors(!0,t)}static createPaletteFromColors(t,e){const r=new vt(e.primary,t);if(e.secondary){const a=new vt(e.secondary,t);r.a2=a.a1}if(e.tertiary){const a=new vt(e.tertiary,t);r.a3=a.a1}if(e.error){const a=new vt(e.error,t);r.error=a.a1}if(e.neutral){const a=new vt(e.neutral,t);r.n1=a.n1}if(e.neutralVariant){const a=new vt(e.neutralVariant,t);r.n2=a.n2}return r}constructor(t,e){const r=et.fromInt(t),a=r.hue,n=r.chroma;e?(this.a1=ot.fromHueAndChroma(a,n),this.a2=ot.fromHueAndChroma(a,n/3),this.a3=ot.fromHueAndChroma(a+60,n/2),this.n1=ot.fromHueAndChroma(a,Math.min(n/12,4)),this.n2=ot.fromHueAndChroma(a,Math.min(n/6,8))):(this.a1=ot.fromHueAndChroma(a,Math.max(48,n)),this.a2=ot.fromHueAndChroma(a,16),this.a3=ot.fromHueAndChroma(a+60,24),this.n1=ot.fromHueAndChroma(a,4),this.n2=ot.fromHueAndChroma(a,8)),this.error=ot.fromHueAndChroma(25,84)}}
|
|
289
|
-
/**
|
|
290
|
-
* @license
|
|
291
|
-
* Copyright 2023 Google LLC
|
|
292
|
-
*
|
|
293
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
294
|
-
* you may not use this file except in compliance with the License.
|
|
295
|
-
* You may obtain a copy of the License at
|
|
296
|
-
*
|
|
297
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
298
|
-
*
|
|
299
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
300
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
301
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
302
|
-
* See the License for the specific language governing permissions and
|
|
303
|
-
* limitations under the License.
|
|
304
|
-
*/class At{constructor(t){this.input=t,this.hctsByTempCache=[],this.hctsByHueCache=[],this.tempsByHctCache=new Map,this.inputRelativeTemperatureCache=-1,this.complementCache=null}get hctsByTemp(){if(this.hctsByTempCache.length>0)return this.hctsByTempCache;const t=this.hctsByHue.concat([this.input]),e=this.tempsByHct;return t.sort((t,r)=>e.get(t)-e.get(r)),this.hctsByTempCache=t,t}get warmest(){return this.hctsByTemp[this.hctsByTemp.length-1]}get coldest(){return this.hctsByTemp[0]}analogous(t=5,e=12){const r=Math.round(this.input.hue),a=this.hctsByHue[r];let n=this.relativeTemperature(a);const o=[a];let i=0;for(let t=0;t<360;t++){const e=L(r+t),a=this.hctsByHue[e],o=this.relativeTemperature(a),s=Math.abs(o-n);n=o,i+=s}let s=1;const c=i/e;let h=0;for(n=this.relativeTemperature(a);o.length<e;){const t=L(r+s),a=this.hctsByHue[t],i=this.relativeTemperature(a);h+=Math.abs(i-n);let u=h>=o.length*c,l=1;for(;u&&o.length<e;){o.push(a);u=h>=(o.length+l)*c,l++}if(n=i,s++,s>360){for(;o.length<e;)o.push(a);break}}const u=[this.input],l=Math.floor((t-1)/2);for(let t=1;t<l+1;t++){let e=0-t;for(;e<0;)e=o.length+e;e>=o.length&&(e%=o.length),u.splice(0,0,o[e])}const d=t-l-1;for(let t=1;t<d+1;t++){let e=t;for(;e<0;)e=o.length+e;e>=o.length&&(e%=o.length),u.push(o[e])}return u}get complement(){if(null!=this.complementCache)return this.complementCache;const t=this.coldest.hue,e=this.tempsByHct.get(this.coldest),r=this.warmest.hue,a=this.tempsByHct.get(this.warmest)-e,n=At.isBetween(this.input.hue,t,r),o=n?r:t,i=n?t:r;let s=1e3,c=this.hctsByHue[Math.round(this.input.hue)];const h=1-this.inputRelativeTemperature;for(let t=0;t<=360;t+=1){const r=F(o+1*t);if(!At.isBetween(r,o,i))continue;const n=this.hctsByHue[Math.round(r)],u=(this.tempsByHct.get(n)-e)/a,l=Math.abs(h-u);l<s&&(s=l,c=n)}return this.complementCache=c,this.complementCache}relativeTemperature(t){const e=this.tempsByHct.get(this.warmest)-this.tempsByHct.get(this.coldest),r=this.tempsByHct.get(t)-this.tempsByHct.get(this.coldest);return 0===e?.5:r/e}get inputRelativeTemperature(){return this.inputRelativeTemperatureCache>=0||(this.inputRelativeTemperatureCache=this.relativeTemperature(this.input)),this.inputRelativeTemperatureCache}get tempsByHct(){if(this.tempsByHctCache.size>0)return this.tempsByHctCache;const t=this.hctsByHue.concat([this.input]),e=new Map;for(const r of t)e.set(r,At.rawTemperature(r));return this.tempsByHctCache=e,e}get hctsByHue(){if(this.hctsByHueCache.length>0)return this.hctsByHueCache;const t=[];for(let e=0;e<=360;e+=1){const r=et.from(e,this.input.chroma,this.input.tone);t.push(r)}return this.hctsByHueCache=t,this.hctsByHueCache}static isBetween(t,e,r){return e<r?e<=t&&t<=r:e<=t||t<=r}static rawTemperature(t){const e=function(t){const e=G(z(t)),r=G(q(t)),a=G(j(t)),n=O,o=n[0][0]*e+n[0][1]*r+n[0][2]*a,i=n[1][0]*e+n[1][1]*r+n[1][2]*a,s=n[2][0]*e+n[2][1]*r+n[2][2]*a,c=i/V[1],h=s/V[2],u=X(o/V[0]),l=X(c);return[116*l-16,500*(u-l),200*(l-X(h))]}(t.toInt()),r=F(180*Math.atan2(e[2],e[1])/Math.PI),a=Math.sqrt(e[1]*e[1]+e[2]*e[2]);return.02*Math.pow(a,1.07)*Math.cos(F(r-50)*Math.PI/180)-.5}}
|
|
305
|
-
/**
|
|
306
|
-
* @license
|
|
307
|
-
* Copyright 2023 Google LLC
|
|
308
|
-
*
|
|
309
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
310
|
-
* you may not use this file except in compliance with the License.
|
|
311
|
-
* You may obtain a copy of the License at
|
|
312
|
-
*
|
|
313
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
314
|
-
*
|
|
315
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
316
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
317
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
318
|
-
* See the License for the specific language governing permissions and
|
|
319
|
-
* limitations under the License.
|
|
320
|
-
*/class _t extends kt{constructor(t,e,r){super({sourceColorArgb:t.toInt(),variant:ht.CONTENT,contrastLevel:r,isDark:e,primaryPalette:ot.fromHueAndChroma(t.hue,t.chroma),secondaryPalette:ot.fromHueAndChroma(t.hue,Math.max(t.chroma-32,.5*t.chroma)),tertiaryPalette:ot.fromInt(at.fixIfDisliked(new At(t).analogous(3,6)[2]).toInt()),neutralPalette:ot.fromHueAndChroma(t.hue,t.chroma/8),neutralVariantPalette:ot.fromHueAndChroma(t.hue,t.chroma/8+4)})}}
|
|
321
|
-
/**
|
|
322
|
-
* @license
|
|
323
|
-
* Copyright 2022 Google LLC
|
|
324
|
-
*
|
|
325
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
326
|
-
* you may not use this file except in compliance with the License.
|
|
327
|
-
* You may obtain a copy of the License at
|
|
328
|
-
*
|
|
329
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
330
|
-
*
|
|
331
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
332
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
333
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
334
|
-
* See the License for the specific language governing permissions and
|
|
335
|
-
* limitations under the License.
|
|
336
|
-
*/class Dt extends kt{constructor(t,e,r){super({sourceColorArgb:t.toInt(),variant:ht.EXPRESSIVE,contrastLevel:r,isDark:e,primaryPalette:ot.fromHueAndChroma(F(t.hue+240),40),secondaryPalette:ot.fromHueAndChroma(kt.getRotatedHue(t,Dt.hues,Dt.secondaryRotations),24),tertiaryPalette:ot.fromHueAndChroma(kt.getRotatedHue(t,Dt.hues,Dt.tertiaryRotations),32),neutralPalette:ot.fromHueAndChroma(t.hue+15,8),neutralVariantPalette:ot.fromHueAndChroma(t.hue+15,12)})}}Dt.hues=[0,21,51,121,151,191,271,321,360],Dt.secondaryRotations=[45,95,45,20,45,90,45,45,45],Dt.tertiaryRotations=[120,120,20,45,20,15,20,120,120];
|
|
337
|
-
/**
|
|
338
|
-
* @license
|
|
339
|
-
* Copyright 2023 Google LLC
|
|
340
|
-
*
|
|
341
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
342
|
-
* you may not use this file except in compliance with the License.
|
|
343
|
-
* You may obtain a copy of the License at
|
|
344
|
-
*
|
|
345
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
346
|
-
*
|
|
347
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
348
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
349
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
350
|
-
* See the License for the specific language governing permissions and
|
|
351
|
-
* limitations under the License.
|
|
352
|
-
*/
|
|
353
|
-
class St extends kt{constructor(t,e,r){super({sourceColorArgb:t.toInt(),variant:ht.FIDELITY,contrastLevel:r,isDark:e,primaryPalette:ot.fromHueAndChroma(t.hue,t.chroma),secondaryPalette:ot.fromHueAndChroma(t.hue,Math.max(t.chroma-32,.5*t.chroma)),tertiaryPalette:ot.fromInt(at.fixIfDisliked(new At(t).complement).toInt()),neutralPalette:ot.fromHueAndChroma(t.hue,t.chroma/8),neutralVariantPalette:ot.fromHueAndChroma(t.hue,t.chroma/8+4)})}}
|
|
354
|
-
/**
|
|
355
|
-
* @license
|
|
356
|
-
* Copyright 2022 Google LLC
|
|
357
|
-
*
|
|
358
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
359
|
-
* you may not use this file except in compliance with the License.
|
|
360
|
-
* You may obtain a copy of the License at
|
|
361
|
-
*
|
|
362
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
363
|
-
*
|
|
364
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
365
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
366
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
367
|
-
* See the License for the specific language governing permissions and
|
|
368
|
-
* limitations under the License.
|
|
369
|
-
*/class Et extends kt{constructor(t,e,r){super({sourceColorArgb:t.toInt(),variant:ht.FRUIT_SALAD,contrastLevel:r,isDark:e,primaryPalette:ot.fromHueAndChroma(F(t.hue-50),48),secondaryPalette:ot.fromHueAndChroma(F(t.hue-50),36),tertiaryPalette:ot.fromHueAndChroma(t.hue,36),neutralPalette:ot.fromHueAndChroma(t.hue,10),neutralVariantPalette:ot.fromHueAndChroma(t.hue,16)})}}
|
|
370
|
-
/**
|
|
371
|
-
* @license
|
|
372
|
-
* Copyright 2022 Google LLC
|
|
373
|
-
*
|
|
374
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
375
|
-
* you may not use this file except in compliance with the License.
|
|
376
|
-
* You may obtain a copy of the License at
|
|
377
|
-
*
|
|
378
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
379
|
-
*
|
|
380
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
381
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
382
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
383
|
-
* See the License for the specific language governing permissions and
|
|
384
|
-
* limitations under the License.
|
|
385
|
-
*/class Tt extends kt{constructor(t,e,r){super({sourceColorArgb:t.toInt(),variant:ht.MONOCHROME,contrastLevel:r,isDark:e,primaryPalette:ot.fromHueAndChroma(t.hue,0),secondaryPalette:ot.fromHueAndChroma(t.hue,0),tertiaryPalette:ot.fromHueAndChroma(t.hue,0),neutralPalette:ot.fromHueAndChroma(t.hue,0),neutralVariantPalette:ot.fromHueAndChroma(t.hue,0)})}}
|
|
386
|
-
/**
|
|
387
|
-
* @license
|
|
388
|
-
* Copyright 2022 Google LLC
|
|
389
|
-
*
|
|
390
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
391
|
-
* you may not use this file except in compliance with the License.
|
|
392
|
-
* You may obtain a copy of the License at
|
|
393
|
-
*
|
|
394
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
395
|
-
*
|
|
396
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
397
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
398
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
399
|
-
* See the License for the specific language governing permissions and
|
|
400
|
-
* limitations under the License.
|
|
401
|
-
*/class xt extends kt{constructor(t,e,r){super({sourceColorArgb:t.toInt(),variant:ht.NEUTRAL,contrastLevel:r,isDark:e,primaryPalette:ot.fromHueAndChroma(t.hue,12),secondaryPalette:ot.fromHueAndChroma(t.hue,8),tertiaryPalette:ot.fromHueAndChroma(t.hue,16),neutralPalette:ot.fromHueAndChroma(t.hue,2),neutralVariantPalette:ot.fromHueAndChroma(t.hue,2)})}}
|
|
402
|
-
/**
|
|
403
|
-
* @license
|
|
404
|
-
* Copyright 2022 Google LLC
|
|
405
|
-
*
|
|
406
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
407
|
-
* you may not use this file except in compliance with the License.
|
|
408
|
-
* You may obtain a copy of the License at
|
|
409
|
-
*
|
|
410
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
411
|
-
*
|
|
412
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
413
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
414
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
415
|
-
* See the License for the specific language governing permissions and
|
|
416
|
-
* limitations under the License.
|
|
417
|
-
*/class It extends kt{constructor(t,e,r){super({sourceColorArgb:t.toInt(),variant:ht.RAINBOW,contrastLevel:r,isDark:e,primaryPalette:ot.fromHueAndChroma(t.hue,48),secondaryPalette:ot.fromHueAndChroma(t.hue,16),tertiaryPalette:ot.fromHueAndChroma(F(t.hue+60),24),neutralPalette:ot.fromHueAndChroma(t.hue,0),neutralVariantPalette:ot.fromHueAndChroma(t.hue,0)})}}
|
|
418
|
-
/**
|
|
419
|
-
* @license
|
|
420
|
-
* Copyright 2022 Google LLC
|
|
421
|
-
*
|
|
422
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
423
|
-
* you may not use this file except in compliance with the License.
|
|
424
|
-
* You may obtain a copy of the License at
|
|
425
|
-
*
|
|
426
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
427
|
-
*
|
|
428
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
429
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
430
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
431
|
-
* See the License for the specific language governing permissions and
|
|
432
|
-
* limitations under the License.
|
|
433
|
-
*/class Ht extends kt{constructor(t,e,r){super({sourceColorArgb:t.toInt(),variant:ht.TONAL_SPOT,contrastLevel:r,isDark:e,primaryPalette:ot.fromHueAndChroma(t.hue,36),secondaryPalette:ot.fromHueAndChroma(t.hue,16),tertiaryPalette:ot.fromHueAndChroma(F(t.hue+60),24),neutralPalette:ot.fromHueAndChroma(t.hue,6),neutralVariantPalette:ot.fromHueAndChroma(t.hue,8)})}}
|
|
434
|
-
/**
|
|
435
|
-
* @license
|
|
436
|
-
* Copyright 2022 Google LLC
|
|
437
|
-
*
|
|
438
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
439
|
-
* you may not use this file except in compliance with the License.
|
|
440
|
-
* You may obtain a copy of the License at
|
|
441
|
-
*
|
|
442
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
443
|
-
*
|
|
444
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
445
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
446
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
447
|
-
* See the License for the specific language governing permissions and
|
|
448
|
-
* limitations under the License.
|
|
449
|
-
*/class Bt extends kt{constructor(t,e,r){super({sourceColorArgb:t.toInt(),variant:ht.VIBRANT,contrastLevel:r,isDark:e,primaryPalette:ot.fromHueAndChroma(t.hue,200),secondaryPalette:ot.fromHueAndChroma(kt.getRotatedHue(t,Bt.hues,Bt.secondaryRotations),24),tertiaryPalette:ot.fromHueAndChroma(kt.getRotatedHue(t,Bt.hues,Bt.tertiaryRotations),32),neutralPalette:ot.fromHueAndChroma(t.hue,10),neutralVariantPalette:ot.fromHueAndChroma(t.hue,12)})}}
|
|
450
|
-
/**
|
|
451
|
-
* @license
|
|
452
|
-
* Copyright 2021 Google LLC
|
|
453
|
-
*
|
|
454
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
455
|
-
* you may not use this file except in compliance with the License.
|
|
456
|
-
* You may obtain a copy of the License at
|
|
457
|
-
*
|
|
458
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
459
|
-
*
|
|
460
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
461
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
462
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
463
|
-
* See the License for the specific language governing permissions and
|
|
464
|
-
* limitations under the License.
|
|
465
|
-
*/
|
|
466
|
-
function Lt(t){const e=z(t),r=q(t),a=j(t),n=[e.toString(16),r.toString(16),a.toString(16)];for(const[t,e]of n.entries())1===e.length&&(n[t]="0"+e);return"#"+n.join("")}function Ft(t){return parseInt(t,16)}Bt.hues=[0,41,61,101,131,181,251,301,360],Bt.secondaryRotations=[18,15,10,12,15,18,15,12,12],Bt.tertiaryRotations=[35,30,20,25,30,35,30,25,25];let Rt=class extends e{constructor(){super(...arguments),ut.add(this),lt.set(this,new CSSStyleSheet),dt.set(this,!1),mt.set(this,void 0),ft.set(this,void 0),gt.set(this,void 0),pt.set(this,()=>o(this,ut,"m",Ct).call(this)),this.color="#6750A4",this.variant="content",this.scheme="auto",this.contrast="standard",this.strongFocus=!1,this.density=0,this.motion="standard"}get isDark(){switch(this.scheme){case"light":return!1;case"dark":return!0;default:return o(this,ft,"f")?.matches??!1}}connectedCallback(){super.connectedCallback(),this.shadowRoot&&!this.shadowRoot.adoptedStyleSheets.includes(o(this,lt,"f"))&&(this.shadowRoot.adoptedStyleSheets=[...this.shadowRoot.adoptedStyleSheets,o(this,lt,"f")]),i(this,mt,matchMedia("(prefers-color-scheme: light)"),"f"),i(this,ft,matchMedia("(prefers-color-scheme: dark)"),"f"),i(this,gt,matchMedia("(forced-colors: active)"),"f"),[o(this,mt,"f"),o(this,ft,"f"),o(this,gt,"f")].forEach(t=>t.addEventListener("change",o(this,pt,"f")))}disconnectedCallback(){super.disconnectedCallback(),[o(this,mt,"f"),o(this,ft,"f"),o(this,gt,"f")].forEach(t=>t?.removeEventListener("change",o(this,pt,"f"))),i(this,mt,i(this,ft,i(this,gt,void 0,"f"),"f"),"f")}updated(t){super.updated(t),o(this,ut,"m",Ct).call(this)}firstUpdated(t){super.firstUpdated(t),i(this,dt,!0,"f")}render(){return r`<slot></slot>`}};lt=new WeakMap,dt=new WeakMap,mt=new WeakMap,ft=new WeakMap,gt=new WeakMap,pt=new WeakMap,ut=new WeakSet,yt=function(t){switch(this.variant){case"content":return new _t(t,this.isDark,o(this,ut,"m",Pt).call(this));case"expressive":return new Dt(t,this.isDark,o(this,ut,"m",Pt).call(this));case"fidelity":return new St(t,this.isDark,o(this,ut,"m",Pt).call(this));case"fruit-salad":return new Et(t,this.isDark,o(this,ut,"m",Pt).call(this));case"monochrome":return new Tt(t,this.isDark,o(this,ut,"m",Pt).call(this));case"neutral":return new xt(t,this.isDark,o(this,ut,"m",Pt).call(this));case"rainbow":return new It(t,this.isDark,o(this,ut,"m",Pt).call(this));case"tonal-spot":return new Ht(t,this.isDark,o(this,ut,"m",Pt).call(this));case"vibrant":return new Bt(t,this.isDark,o(this,ut,"m",Pt).call(this))}},Ct=function(){const t=function(t){const e=3===(t=t.replace("#","")).length,r=6===t.length,a=8===t.length;if(!e&&!r&&!a)throw new Error("unexpected hex "+t);let n=0,o=0,i=0;return e?(n=Ft(t.slice(0,1).repeat(2)),o=Ft(t.slice(1,2).repeat(2)),i=Ft(t.slice(2,3).repeat(2))):r?(n=Ft(t.slice(0,2)),o=Ft(t.slice(2,4)),i=Ft(t.slice(4,6))):a&&(n=Ft(t.slice(2,4)),o=Ft(t.slice(4,6)),i=Ft(t.slice(6,8))),(255<<24|(255&n)<<16|(255&o)<<8|255&i)>>>0}(this.color),e=vt.of(t),r=o(this,ut,"m",yt).call(this,et.fromInt(t));let a="";for(const t in Mt)if(!t.endsWith("PaletteKeyColor")){const e=Mt[t];e instanceof nt&&(a+=`--md-sys-color-${t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}: ${Lt(e.getArgb(r))};`)}if("expressive"===this.motion&&(a+="--md-sys-motion-spring-fast-spatial: 350ms cubic-bezier(0.42, 1.67, 0.21, 0.90);",a+="--md-sys-motion-spring-default-spatial: 500ms cubic-bezier(0.38, 1.21, 0.22, 1.00);",a+="--md-sys-motion-spring-slow-spatial: 650ms cubic-bezier(0.39, 1.29, 0.35, 0.98);",a+="--md-sys-motion-spring-fast-effects: 150ms cubic-bezier(0.31, 0.94, 0.34, 1.00);",a+="--md-sys-motion-spring-default-effects: 200ms cubic-bezier(0.34, 0.80, 0.34, 1.00);",a+="--md-sys-motion-spring-slow-effects: 300ms cubic-bezier(0.34, 0.88, 0.34, 1.00);"),a+=`--md-sys-density-scale: ${this.density};`,a+=`--m3e-scrollbar-thumb-color: ${Lt(e.n1.tone(60))};`,a+=`--m3e-focus-ring-visibility: ${this.strongFocus?"visible":"hidden"};`,o(this,lt,"f").replaceSync(`:host { ${a} }`),this.parentElement instanceof HTMLBodyElement){const t=getComputedStyle(this);o(this,gt,"f")?.matches?this.parentElement.style.backgroundColor=this.parentElement.style.color=this.parentElement.ownerDocument.documentElement.style.scrollbarColor=this.parentElement.style.scrollbarColor="":(this.parentElement.style.backgroundColor=t.getPropertyValue("--md-sys-color-background"),this.parentElement.style.color=t.getPropertyValue("--md-sys-color-on-background"),this.parentElement.ownerDocument.documentElement.style.scrollbarColor=this.parentElement.style.scrollbarColor=`${t.getPropertyValue("--m3e-scrollbar-thumb-color")} ${t.getPropertyValue("--m3e-scrollbar-track-color")}`)}o(this,dt,"f")&&this.dispatchEvent(new Event("change",{bubbles:!0}))},Pt=function(){switch(this.contrast){case"high":return 1;case"medium":return.5;default:return 0}},Rt.styles=t`
|
|
28
|
+
const D={attribute:!0,type:String,converter:w,reflect:!1,hasChanged:_},O=(t=D,e,r)=>{const{kind:a,metadata:n}=r;let o=globalThis.litPropertyMetadata.get(n);if(void 0===o&&globalThis.litPropertyMetadata.set(n,o=new Map),"setter"===a&&((t=Object.create(t)).wrapped=!0),o.set(r.name,t),"accessor"===a){const{name:a}=r;return{set(r){const n=e.get.call(this);e.set.call(this,r),this.requestUpdate(a,n,t)},init(e){return void 0!==e&&this.C(a,void 0,t,e),e}}}if("setter"===a){const{name:a}=r;return function(r){const n=this[a];e.call(this,r),this.requestUpdate(a,n,t)}}throw Error("Unsupported decorator location: "+a)};function H(t){return(e,r)=>"object"==typeof r?O(t,e,r):((t,e,r)=>{const a=e.hasOwnProperty(r);return e.constructor.createProperty(r,t),a?Object.getOwnPropertyDescriptor(e,r):void 0})(t,e,r)}
|
|
29
|
+
/**
|
|
30
|
+
* @license
|
|
31
|
+
* Copyright 2021 Google LLC
|
|
32
|
+
*
|
|
33
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
34
|
+
* you may not use this file except in compliance with the License.
|
|
35
|
+
* You may obtain a copy of the License at
|
|
36
|
+
*
|
|
37
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
38
|
+
*
|
|
39
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
40
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
41
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
42
|
+
* See the License for the specific language governing permissions and
|
|
43
|
+
* limitations under the License.
|
|
44
|
+
*/function x(t){return t<0?-1:0===t?0:1}function N(t,e,r){return(1-r)*t+r*e}function M(t,e,r){return r<t?t:r>e?e:r}function F(t,e,r){return r<t?t:r>e?e:r}function B(t){return(t%=360)<0&&(t+=360),t}function I(t){return(t%=360)<0&&(t+=360),t}function L(t,e){return[t[0]*e[0][0]+t[1]*e[0][1]+t[2]*e[0][2],t[0]*e[1][0]+t[1]*e[1][1]+t[2]*e[1][2],t[0]*e[2][0]+t[1]*e[2][1]+t[2]*e[2][2]]}const R=[[.41233895,.35762064,.18051042],[.2126,.7152,.0722],[.01932141,.11916382,.95034478]],V=[[3.2413774792388685,-1.5376652402851851,-.49885366846268053],[-.9691452513005321,1.8758853451067872,.04156585616912061],[.05562093689691305,-.20395524564742123,1.0571799111220335]],U=[95.047,100,108.883];function $(t,e,r){return(255<<24|(255&t)<<16|(255&e)<<8|255&r)>>>0}function K(t){return $(J(t[0]),J(t[1]),J(t[2]))}function Y(t){return t>>16&255}function z(t){return t>>8&255}function j(t){return 255&t}function q(t){const e=function(t){return L([G(Y(t)),G(z(t)),G(j(t))],R)}(t)[1];return 116*Q(e/100)-16}function W(t){return 100*function(t){const e=216/24389,r=24389/27,a=t*t*t;return a>e?a:(116*t-16)/r}((t+16)/116)}function X(t){return 116*Q(t/100)-16}function G(t){const e=t/255;return e<=.040449936?e/12.92*100:100*Math.pow((e+.055)/1.055,2.4)}function J(t){const e=t/100;let r=0;return r=e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055,M(0,255,Math.round(255*r))}function Q(t){return t>216/24389?Math.pow(t,1/3):(24389/27*t+16)/116}var Z=class t{static DEFAULT=t.make();static make(e=function(){return U}(),r=200/Math.PI*W(50)/100,a=50,n=2,o=!1){const i=e,s=.401288*i[0]+.650173*i[1]+-.051461*i[2],c=-.250268*i[0]+1.204414*i[1]+.045854*i[2],u=-.002079*i[0]+.048952*i[1]+.953127*i[2],l=.8+n/10,h=l>=.9?N(.59,.69,10*(l-.9)):N(.525,.59,10*(l-.8));let d=o?1:l*(1-1/3.6*Math.exp((-r-42)/92));d=d>1?1:d<0?0:d;const m=l,p=[d*(100/s)+1-d,d*(100/c)+1-d,d*(100/u)+1-d],f=1/(5*r+1),y=f*f*f*f,g=1-y,P=y*r+.1*g*g*Math.cbrt(5*r),C=W(a)/e[1],S=1.48+Math.sqrt(C),v=.725/Math.pow(C,.2),E=v,b=[Math.pow(P*p[0]*s/100,.42),Math.pow(P*p[1]*c/100,.42),Math.pow(P*p[2]*u/100,.42)],k=[400*b[0]/(b[0]+27.13),400*b[1]/(b[1]+27.13),400*b[2]/(b[2]+27.13)];return new t(C,(2*k[0]+k[1]+.05*k[2])*v,v,E,h,m,p,P,Math.pow(P,.25),S)}constructor(t,e,r,a,n,o,i,s,c,u){this.n=t,this.aw=e,this.nbb=r,this.ncb=a,this.c=n,this.nc=o,this.rgbD=i,this.fl=s,this.fLRoot=c,this.z=u}},tt=class t{constructor(t,e,r,a,n,o,i,s,c){this.hue=t,this.chroma=e,this.j=r,this.q=a,this.m=n,this.s=o,this.jstar=i,this.astar=s,this.bstar=c}distance(t){const e=this.jstar-t.jstar,r=this.astar-t.astar,a=this.bstar-t.bstar,n=Math.sqrt(e*e+r*r+a*a);return 1.41*Math.pow(n,.63)}static fromInt(e){return t.fromIntInViewingConditions(e,Z.DEFAULT)}static fromIntInViewingConditions(e,r){const a=(65280&e)>>8,n=255&e,o=G((16711680&e)>>16),i=G(a),s=G(n),c=.41233895*o+.35762064*i+.18051042*s,u=.2126*o+.7152*i+.0722*s,l=.01932141*o+.11916382*i+.95034478*s,h=.401288*c+.650173*u-.051461*l,d=-.250268*c+1.204414*u+.045854*l,m=-.002079*c+.048952*u+.953127*l,p=r.rgbD[0]*h,f=r.rgbD[1]*d,y=r.rgbD[2]*m,g=Math.pow(r.fl*Math.abs(p)/100,.42),P=Math.pow(r.fl*Math.abs(f)/100,.42),C=Math.pow(r.fl*Math.abs(y)/100,.42),S=400*x(p)*g/(g+27.13),v=400*x(f)*P/(P+27.13),E=400*x(y)*C/(C+27.13),b=(11*S+-12*v+E)/11,k=(S+v-2*E)/9,w=(20*S+20*v+21*E)/20,_=(40*S+20*v+E)/20,T=180*Math.atan2(k,b)/Math.PI,A=T<0?T+360:T>=360?T-360:T,D=A*Math.PI/180,O=_*r.nbb,H=100*Math.pow(O/r.aw,r.c*r.z),N=4/r.c*Math.sqrt(H/100)*(r.aw+4)*r.fLRoot,M=A<20.14?A+360:A,F=5e4/13*(.25*(Math.cos(M*Math.PI/180+2)+3.8))*r.nc*r.ncb*Math.sqrt(b*b+k*k)/(w+.305),B=Math.pow(F,.9)*Math.pow(1.64-Math.pow(.29,r.n),.73),I=B*Math.sqrt(H/100),L=I*r.fLRoot,R=50*Math.sqrt(B*r.c/(r.aw+4)),V=1.7000000000000002*H/(1+.007*H),U=1/.0228*Math.log(1+.0228*L),$=U*Math.cos(D),K=U*Math.sin(D);return new t(A,I,H,N,L,R,V,$,K)}static fromJch(e,r,a){return t.fromJchInViewingConditions(e,r,a,Z.DEFAULT)}static fromJchInViewingConditions(e,r,a,n){const o=4/n.c*Math.sqrt(e/100)*(n.aw+4)*n.fLRoot,i=r*n.fLRoot,s=r/Math.sqrt(e/100),c=50*Math.sqrt(s*n.c/(n.aw+4)),u=a*Math.PI/180,l=1.7000000000000002*e/(1+.007*e),h=1/.0228*Math.log(1+.0228*i),d=h*Math.cos(u),m=h*Math.sin(u);return new t(a,r,e,o,i,c,l,d,m)}static fromUcs(e,r,a){return t.fromUcsInViewingConditions(e,r,a,Z.DEFAULT)}static fromUcsInViewingConditions(e,r,a,n){const o=r,i=a,s=Math.sqrt(o*o+i*i),c=(Math.exp(.0228*s)-1)/.0228/n.fLRoot;let u=Math.atan2(i,o)*(180/Math.PI);u<0&&(u+=360);const l=e/(1-.007*(e-100));return t.fromJchInViewingConditions(l,c,u,n)}toInt(){return this.viewed(Z.DEFAULT)}viewed(t){const e=0===this.chroma||0===this.j?0:this.chroma/Math.sqrt(this.j/100),r=Math.pow(e/Math.pow(1.64-Math.pow(.29,t.n),.73),1/.9),a=this.hue*Math.PI/180,n=.25*(Math.cos(a+2)+3.8),o=t.aw*Math.pow(this.j/100,1/t.c/t.z),i=n*(5e4/13)*t.nc*t.ncb,s=o/t.nbb,c=Math.sin(a),u=Math.cos(a),l=23*(s+.305)*r/(23*i+11*r*u+108*r*c),h=l*u,d=l*c,m=(460*s+451*h+288*d)/1403,p=(460*s-891*h-261*d)/1403,f=(460*s-220*h-6300*d)/1403,y=Math.max(0,27.13*Math.abs(m)/(400-Math.abs(m))),g=x(m)*(100/t.fl)*Math.pow(y,1/.42),P=Math.max(0,27.13*Math.abs(p)/(400-Math.abs(p))),C=x(p)*(100/t.fl)*Math.pow(P,1/.42),S=Math.max(0,27.13*Math.abs(f)/(400-Math.abs(f))),v=x(f)*(100/t.fl)*Math.pow(S,1/.42),E=g/t.rgbD[0],b=C/t.rgbD[1],k=v/t.rgbD[2],w=function(t,e,r){const a=V,n=a[0][0]*t+a[0][1]*e+a[0][2]*r,o=a[1][0]*t+a[1][1]*e+a[1][2]*r,i=a[2][0]*t+a[2][1]*e+a[2][2]*r;return $(J(n),J(o),J(i))}(1.86206786*E-1.01125463*b+.14918677*k,.38752654*E+.62144744*b-.00897398*k,-.0158415*E-.03412294*b+1.04996444*k);return w}static fromXyzInViewingConditions(e,r,a,n){const o=.401288*e+.650173*r-.051461*a,i=-.250268*e+1.204414*r+.045854*a,s=-.002079*e+.048952*r+.953127*a,c=n.rgbD[0]*o,u=n.rgbD[1]*i,l=n.rgbD[2]*s,h=Math.pow(n.fl*Math.abs(c)/100,.42),d=Math.pow(n.fl*Math.abs(u)/100,.42),m=Math.pow(n.fl*Math.abs(l)/100,.42),p=400*x(c)*h/(h+27.13),f=400*x(u)*d/(d+27.13),y=400*x(l)*m/(m+27.13),g=(11*p+-12*f+y)/11,P=(p+f-2*y)/9,C=(20*p+20*f+21*y)/20,S=(40*p+20*f+y)/20,v=180*Math.atan2(P,g)/Math.PI,E=v<0?v+360:v>=360?v-360:v,b=E*Math.PI/180,k=S*n.nbb,w=100*Math.pow(k/n.aw,n.c*n.z),_=4/n.c*Math.sqrt(w/100)*(n.aw+4)*n.fLRoot,T=E<20.14?E+360:E,A=5e4/13*(1/4*(Math.cos(T*Math.PI/180+2)+3.8))*n.nc*n.ncb*Math.sqrt(g*g+P*P)/(C+.305),D=Math.pow(A,.9)*Math.pow(1.64-Math.pow(.29,n.n),.73),O=D*Math.sqrt(w/100),H=O*n.fLRoot,N=50*Math.sqrt(D*n.c/(n.aw+4)),M=1.7000000000000002*w/(1+.007*w),F=Math.log(1+.0228*H)/.0228,B=F*Math.cos(b),I=F*Math.sin(b);return new t(E,O,w,_,H,N,M,B,I)}xyzInViewingConditions(t){const e=0===this.chroma||0===this.j?0:this.chroma/Math.sqrt(this.j/100),r=Math.pow(e/Math.pow(1.64-Math.pow(.29,t.n),.73),1/.9),a=this.hue*Math.PI/180,n=.25*(Math.cos(a+2)+3.8),o=t.aw*Math.pow(this.j/100,1/t.c/t.z),i=n*(5e4/13)*t.nc*t.ncb,s=o/t.nbb,c=Math.sin(a),u=Math.cos(a),l=23*(s+.305)*r/(23*i+11*r*u+108*r*c),h=l*u,d=l*c,m=(460*s+451*h+288*d)/1403,p=(460*s-891*h-261*d)/1403,f=(460*s-220*h-6300*d)/1403,y=Math.max(0,27.13*Math.abs(m)/(400-Math.abs(m))),g=x(m)*(100/t.fl)*Math.pow(y,1/.42),P=Math.max(0,27.13*Math.abs(p)/(400-Math.abs(p))),C=x(p)*(100/t.fl)*Math.pow(P,1/.42),S=Math.max(0,27.13*Math.abs(f)/(400-Math.abs(f))),v=x(f)*(100/t.fl)*Math.pow(S,1/.42),E=g/t.rgbD[0],b=C/t.rgbD[1],k=v/t.rgbD[2];return[1.86206786*E-1.01125463*b+.14918677*k,.38752654*E+.62144744*b-.00897398*k,-.0158415*E-.03412294*b+1.04996444*k]}},et=class t{static SCALED_DISCOUNT_FROM_LINRGB=[[.001200833568784504,.002389694492170889,.0002795742885861124],[.0005891086651375999,.0029785502573438758,.0003270666104008398],[.00010146692491640572,.0005364214359186694,.0032979401770712076]];static LINRGB_FROM_SCALED_DISCOUNT=[[1373.2198709594231,-1100.4251190754821,-7.278681089101213],[-271.815969077903,559.6580465940733,-32.46047482791194],[1.9622899599665666,-57.173814538844006,308.7233197812385]];static Y_FROM_LINRGB=[.2126,.7152,.0722];static 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];static sanitizeRadians(t){return(t+8*Math.PI)%(2*Math.PI)}static trueDelinearized(t){const e=t/100;let r=0;return r=e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055,255*r}static chromaticAdaptation(t){const e=Math.pow(Math.abs(t),.42);return 400*x(t)*e/(e+27.13)}static hueOf(e){const r=L(e,t.SCALED_DISCOUNT_FROM_LINRGB),a=t.chromaticAdaptation(r[0]),n=t.chromaticAdaptation(r[1]),o=t.chromaticAdaptation(r[2]),i=(11*a+-12*n+o)/11,s=(a+n-2*o)/9;return Math.atan2(s,i)}static areInCyclicOrder(e,r,a){return t.sanitizeRadians(r-e)<t.sanitizeRadians(a-e)}static intercept(t,e,r){return(e-t)/(r-t)}static lerpPoint(t,e,r){return[t[0]+(r[0]-t[0])*e,t[1]+(r[1]-t[1])*e,t[2]+(r[2]-t[2])*e]}static setCoordinate(e,r,a,n){const o=t.intercept(e[n],r,a[n]);return t.lerpPoint(e,o,a)}static isBounded(t){return 0<=t&&t<=100}static nthVertex(e,r){const a=t.Y_FROM_LINRGB[0],n=t.Y_FROM_LINRGB[1],o=t.Y_FROM_LINRGB[2],i=r%4<=1?0:100,s=r%2==0?0:100;if(r<4){const r=i,c=s,u=(e-r*n-c*o)/a;return t.isBounded(u)?[u,r,c]:[-1,-1,-1]}if(r<8){const r=i,c=s,u=(e-c*a-r*o)/n;return t.isBounded(u)?[c,u,r]:[-1,-1,-1]}{const r=i,c=s,u=(e-r*a-c*n)/o;return t.isBounded(u)?[r,c,u]:[-1,-1,-1]}}static bisectToSegment(e,r){let a=[-1,-1,-1],n=a,o=0,i=0,s=!1,c=!0;for(let u=0;u<12;u++){const l=t.nthVertex(e,u);if(l[0]<0)continue;const h=t.hueOf(l);s?(c||t.areInCyclicOrder(o,h,i))&&(c=!1,t.areInCyclicOrder(o,r,h)?(n=l,i=h):(a=l,o=h)):(a=l,n=l,o=h,i=h,s=!0)}return[a,n]}static midpoint(t,e){return[(t[0]+e[0])/2,(t[1]+e[1])/2,(t[2]+e[2])/2]}static criticalPlaneBelow(t){return Math.floor(t-.5)}static criticalPlaneAbove(t){return Math.ceil(t-.5)}static bisectToLimit(e,r){const a=t.bisectToSegment(e,r);let n=a[0],o=t.hueOf(n),i=a[1];for(let e=0;e<3;e++)if(n[e]!==i[e]){let a=-1,s=255;n[e]<i[e]?(a=t.criticalPlaneBelow(t.trueDelinearized(n[e])),s=t.criticalPlaneAbove(t.trueDelinearized(i[e]))):(a=t.criticalPlaneAbove(t.trueDelinearized(n[e])),s=t.criticalPlaneBelow(t.trueDelinearized(i[e])));for(let c=0;c<8&&!(Math.abs(s-a)<=1);c++){const c=Math.floor((a+s)/2),u=t.CRITICAL_PLANES[c],l=t.setCoordinate(n,u,i,e),h=t.hueOf(l);t.areInCyclicOrder(o,r,h)?(i=l,s=c):(n=l,o=h,a=c)}}return t.midpoint(n,i)}static inverseChromaticAdaptation(t){const e=Math.abs(t),r=Math.max(0,27.13*e/(400-e));return x(t)*Math.pow(r,1/.42)}static findResultByJ(e,r,a){let n=11*Math.sqrt(a);const o=Z.DEFAULT,i=1/Math.pow(1.64-Math.pow(.29,o.n),.73),s=.25*(Math.cos(e+2)+3.8)*(5e4/13)*o.nc*o.ncb,c=Math.sin(e),u=Math.cos(e);for(let e=0;e<5;e++){const l=n/100,h=0===r||0===n?0:r/Math.sqrt(l),d=Math.pow(h*i,1/.9),m=o.aw*Math.pow(l,1/o.c/o.z)/o.nbb,p=23*(m+.305)*d/(23*s+11*d*u+108*d*c),f=p*u,y=p*c,g=(460*m+451*f+288*y)/1403,P=(460*m-891*f-261*y)/1403,C=(460*m-220*f-6300*y)/1403,S=L([t.inverseChromaticAdaptation(g),t.inverseChromaticAdaptation(P),t.inverseChromaticAdaptation(C)],t.LINRGB_FROM_SCALED_DISCOUNT);if(S[0]<0||S[1]<0||S[2]<0)return 0;const v=t.Y_FROM_LINRGB[0],E=t.Y_FROM_LINRGB[1],b=t.Y_FROM_LINRGB[2],k=v*S[0]+E*S[1]+b*S[2];if(k<=0)return 0;if(4===e||Math.abs(k-a)<.002)return S[0]>100.01||S[1]>100.01||S[2]>100.01?0:K(S);n-=(k-a)*n/(2*k)}return 0}static solveToInt(e,r,a){if(r<1e-4||a<1e-4||a>99.9999)return function(t){const e=J(W(t));return $(e,e,e)}(a);const n=(e=I(e))/180*Math.PI,o=W(a),i=t.findResultByJ(n,r,o);if(0!==i)return i;return K(t.bisectToLimit(o,n))}static solveToCam(e,r,a){return tt.fromInt(t.solveToInt(e,r,a))}},rt=class t{internalHue;internalChroma;internalTone;static from(e,r,a){return new t(et.solveToInt(e,r,a))}static fromInt(e){return new t(e)}toInt(){return this.argb}get hue(){return this.internalHue}set hue(t){this.setInternalState(et.solveToInt(t,this.internalChroma,this.internalTone))}get chroma(){return this.internalChroma}set chroma(t){this.setInternalState(et.solveToInt(this.internalHue,t,this.internalTone))}get tone(){return this.internalTone}set tone(t){this.setInternalState(et.solveToInt(this.internalHue,this.internalChroma,t))}setValue(t,e){this[t]=e}toString(){return`HCT(${this.hue.toFixed(0)}, ${this.chroma.toFixed(0)}, ${this.tone.toFixed(0)})`}static isBlue(t){return t>=250&&t<270}static isYellow(t){return t>=105&&t<125}static isCyan(t){return t>=170&&t<207}constructor(t){this.argb=t;const e=tt.fromInt(t);this.internalHue=e.hue,this.internalChroma=e.chroma,this.internalTone=q(t),this.argb=t}setInternalState(t){const e=tt.fromInt(t);this.internalHue=e.hue,this.internalChroma=e.chroma,this.internalTone=q(t),this.argb=t}inViewingConditions(e){const r=tt.fromInt(this.toInt()).xyzInViewingConditions(e),a=tt.fromXyzInViewingConditions(r[0],r[1],r[2],Z.make());return t.from(a.hue,a.chroma,X(r[1]))}},at=class t{static ratioOfTones(e,r){return e=F(0,100,e),r=F(0,100,r),t.ratioOfYs(W(e),W(r))}static ratioOfYs(t,e){const r=t>e?t:e;return(r+5)/((r===e?t:e)+5)}static lighter(e,r){if(e<0||e>100)return-1;const a=W(e),n=r*(a+5)-5,o=t.ratioOfYs(n,a),i=Math.abs(o-r);if(o<r&&i>.04)return-1;const s=X(n)+.4;return s<0||s>100?-1:s}static darker(e,r){if(e<0||e>100)return-1;const a=W(e),n=(a+5)/r-5,o=t.ratioOfYs(a,n),i=Math.abs(o-r);if(o<r&&i>.04)return-1;const s=X(n)-.4;return s<0||s>100?-1:s}static lighterUnsafe(e,r){const a=t.lighter(e,r);return a<0?100:a}static darkerUnsafe(e,r){const a=t.darker(e,r);return a<0?0:a}},nt=class t{static isDisliked(t){const e=Math.round(t.hue)>=90&&Math.round(t.hue)<=111,r=Math.round(t.chroma)>16,a=Math.round(t.tone)<65;return e&&r&&a}static fixIfDisliked(e){return t.isDisliked(e)?rt.from(e.hue,e.chroma,70):e}},ot=class{constructor(t,e,r,a){this.low=t,this.normal=e,this.medium=r,this.high=a}get(t){return t<=-1?this.low:t<0?N(this.low,this.normal,(t- -1)/1):t<.5?N(this.normal,this.medium,(t-0)/.5):t<1?N(this.medium,this.high,(t-.5)/.5):this.high}};function it(t,e,r){return function(t,e,r){if(t.name!==r.name)throw new Error(`Attempting to extend color ${t.name} with color ${r.name} of different name for spec version ${e}.`);if(t.isBackground!==r.isBackground)throw new Error(`Attempting to extend color ${t.name} as a ${t.isBackground?"background":"foreground"} with color ${r.name} as a ${r.isBackground?"background":"foreground"} for spec version ${e}.`)}(t,e,r),st.fromPalette({name:t.name,palette:a=>a.specVersion===e?r.palette(a):t.palette(a),tone:a=>a.specVersion===e?r.tone(a):t.tone(a),isBackground:t.isBackground,chromaMultiplier:a=>{const n=a.specVersion===e?r.chromaMultiplier:t.chromaMultiplier;return void 0!==n?n(a):1},background:a=>{const n=a.specVersion===e?r.background:t.background;return void 0!==n?n(a):void 0},secondBackground:a=>{const n=a.specVersion===e?r.secondBackground:t.secondBackground;return void 0!==n?n(a):void 0},contrastCurve:a=>{const n=a.specVersion===e?r.contrastCurve:t.contrastCurve;return void 0!==n?n(a):void 0},toneDeltaPair:a=>{const n=a.specVersion===e?r.toneDeltaPair:t.toneDeltaPair;return void 0!==n?n(a):void 0},opacity:a=>{const n=a.specVersion===e?r.opacity:t.opacity;return void 0!==n?n(a):void 0}})}var st=class t{hctCache=new Map;static fromPalette(e){return new t(e.name??"",e.palette,e.tone??t.getInitialToneFromBackground(e.background),e.isBackground??!1,e.chromaMultiplier,e.background,e.secondBackground,e.contrastCurve,e.toneDeltaPair,e.opacity)}static getInitialToneFromBackground(t){return void 0===t?t=>50:e=>t(e)?t(e).getTone(e):50}constructor(t,e,r,a,n,o,i,s,c,u){if(this.name=t,this.palette=e,this.tone=r,this.isBackground=a,this.chromaMultiplier=n,this.background=o,this.secondBackground=i,this.contrastCurve=s,this.toneDeltaPair=c,this.opacity=u,!o&&i)throw new Error(`Color ${t} has secondBackgrounddefined, but background is not defined.`);if(!o&&s)throw new Error(`Color ${t} has contrastCurvedefined, but background is not defined.`);if(o&&!s)throw new Error(`Color ${t} has backgrounddefined, but contrastCurve is not defined.`)}clone(){return t.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,opacity:this.opacity})}clearCache(){this.hctCache.clear()}getArgb(t){const e=this.getHct(t).toInt();if(null==this.opacity)return e;const r=this.opacity(t);if(null==r)return e;return 16777215&e|M(0,255,Math.round(255*r))<<24}getHct(t){const e=this.hctCache.get(t);if(null!=e)return e;const r=lt(t.specVersion).getHct(t,this);return this.hctCache.size>4&&this.hctCache.clear(),this.hctCache.set(t,r),r}getTone(t){return lt(t.specVersion).getTone(t,this)}static foregroundTone(e,r){const a=at.lighterUnsafe(e,r),n=at.darkerUnsafe(e,r),o=at.ratioOfTones(a,e),i=at.ratioOfTones(n,e);if(t.tonePrefersLightForeground(e)){const t=Math.abs(o-i)<.1&&o<r&&i<r;return o>=r||o>=i||t?a:n}return i>=r||i>=o?n:a}static tonePrefersLightForeground(t){return Math.round(t)<60}static toneAllowsLightForeground(t){return Math.round(t)<=49}static enableLightForeground(e){return t.tonePrefersLightForeground(e)&&!t.toneAllowsLightForeground(e)?49:e}};const ct=new class{getHct(t,e){const r=e.getTone(t);return e.palette(t).getHct(r)}getTone(t,e){const r=t.contrastLevel<0,a=e.toneDeltaPair?e.toneDeltaPair(t):void 0;if(a){const n=a.roleA,o=a.roleB,i=a.delta,s=a.polarity,c=a.stayTogether,u="nearer"===s||"lighter"===s&&!t.isDark||"darker"===s&&t.isDark,l=u?n:o,h=u?o:n,d=e.name===l.name,m=t.isDark?1:-1;let p=l.tone(t),f=h.tone(t);if(e.background&&l.contrastCurve&&h.contrastCurve){const a=e.background(t),n=l.contrastCurve(t),o=h.contrastCurve(t);if(a&&n&&o){const e=a.getTone(t),i=n.get(t.contrastLevel),s=o.get(t.contrastLevel);at.ratioOfTones(e,p)<i&&(p=st.foregroundTone(e,i)),at.ratioOfTones(e,f)<s&&(f=st.foregroundTone(e,s)),r&&(p=st.foregroundTone(e,i),f=st.foregroundTone(e,s))}}return(f-p)*m<i&&(f=F(0,100,p+i*m),(f-p)*m>=i||(p=F(0,100,f-i*m))),50<=p&&p<60?m>0?(p=60,f=Math.max(f,p+i*m)):(p=49,f=Math.min(f,p+i*m)):50<=f&&f<60&&(c?m>0?(p=60,f=Math.max(f,p+i*m)):(p=49,f=Math.min(f,p+i*m)):f=m>0?60:49),d?p:f}{let a=e.tone(t);if(null==e.background||void 0===e.background(t)||null==e.contrastCurve||void 0===e.contrastCurve(t))return a;const n=e.background(t).getTone(t),o=e.contrastCurve(t).get(t.contrastLevel);if(at.ratioOfTones(n,a)>=o||(a=st.foregroundTone(n,o)),r&&(a=st.foregroundTone(n,o)),e.isBackground&&50<=a&&a<60&&(a=at.ratioOfTones(49,n)>=o?49:60),null==e.secondBackground||void 0===e.secondBackground(t))return a;const[i,s]=[e.background,e.secondBackground],[c,u]=[i(t).getTone(t),s(t).getTone(t)],[l,h]=[Math.max(c,u),Math.min(c,u)];if(at.ratioOfTones(l,a)>=o&&at.ratioOfTones(h,a)>=o)return a;const d=at.lighter(l,o),m=at.darker(h,o),p=[];-1!==d&&p.push(d),-1!==m&&p.push(m);return st.tonePrefersLightForeground(c)||st.tonePrefersLightForeground(u)?d<0?100:d:1===p.length?p[0]:m<0?0:m}}},ut=new class{getHct(t,e){const r=e.palette(t),a=e.getTone(t),n=r.hue,o=r.chroma*(e.chromaMultiplier?e.chromaMultiplier(t):1);return rt.from(n,o,a)}getTone(t,e){const r=e.toneDeltaPair?e.toneDeltaPair(t):void 0;if(r){const a=r.roleA,n=r.roleB,o=r.polarity,i=r.constraint,s="darker"===o||"relative_lighter"===o&&t.isDark||"relative_darker"===o&&!t.isDark?-r.delta:r.delta,c=e.name===a.name,u=c?n:a;let l=(c?a:n).tone(t),h=u.getTone(t);const d=s*(c?1:-1);if("exact"===i?l=F(0,100,h+d):"nearer"===i?l=F(0,100,d>0?F(h,h+d,l):F(h+d,h,l)):"farther"===i&&(l=d>0?F(h+d,100,l):F(0,h+d,l)),e.background&&e.contrastCurve){const r=e.background(t),a=e.contrastCurve(t);if(r&&a){const e=r.getTone(t),n=a.get(t.contrastLevel);l=at.ratioOfTones(e,l)>=n&&t.contrastLevel>=0?l:st.foregroundTone(e,n)}}return e.isBackground&&!e.name.endsWith("_fixed_dim")&&(l=l>=57?F(65,100,l):F(0,49,l)),l}{let r=e.tone(t);if(null==e.background||void 0===e.background(t)||null==e.contrastCurve||void 0===e.contrastCurve(t))return r;const a=e.background(t).getTone(t),n=e.contrastCurve(t).get(t.contrastLevel);if(r=at.ratioOfTones(a,r)>=n&&t.contrastLevel>=0?r:st.foregroundTone(a,n),e.isBackground&&!e.name.endsWith("_fixed_dim")&&(r=r>=57?F(65,100,r):F(0,49,r)),null==e.secondBackground||void 0===e.secondBackground(t))return r;const[o,i]=[e.background,e.secondBackground],[s,c]=[o(t).getTone(t),i(t).getTone(t)],[u,l]=[Math.max(s,c),Math.min(s,c)];if(at.ratioOfTones(u,r)>=n&&at.ratioOfTones(l,r)>=n)return r;const h=at.lighter(u,n),d=at.darker(l,n),m=[];-1!==h&&m.push(h),-1!==d&&m.push(d);return st.tonePrefersLightForeground(s)||st.tonePrefersLightForeground(c)?h<0?100:h:1===m.length?m[0]:d<0?0:d}}};function lt(t){return"2025"===t?ut:ct}var ht=class t{cache=new Map;static fromInt(e){const r=rt.fromInt(e);return t.fromHct(r)}static fromHct(e){return new t(e.hue,e.chroma,e)}static fromHueAndChroma(e,r){const a=new dt(e,r).create();return new t(e,r,a)}constructor(t,e,r){this.hue=t,this.chroma=e,this.keyColor=r}tone(t){let e=this.cache.get(t);return void 0===e&&(e=99==t&&rt.isYellow(this.hue)?this.averageArgb(this.tone(98),this.tone(100)):rt.from(this.hue,this.chroma,t).toInt(),this.cache.set(t,e)),e}getHct(t){return rt.fromInt(this.tone(t))}averageArgb(t,e){const r=t>>>16&255,a=t>>>8&255,n=255&t,o=e>>>16&255,i=e>>>8&255,s=255&e;return(255<<24|(255&Math.round((r+o)/2))<<16|(255&Math.round((a+i)/2))<<8|255&Math.round((n+s)/2))>>>0}},dt=class{chromaCache=new Map;maxChromaValue=200;constructor(t,e){this.hue=t,this.requestedChroma=e}create(){let t=0,e=100;for(;t<e;){const r=Math.floor((t+e)/2),a=this.maxChroma(r)<this.maxChroma(r+1);if(this.maxChroma(r)>=this.requestedChroma-.01)if(Math.abs(t-50)<Math.abs(e-50))e=r;else{if(t===r)return rt.from(this.hue,this.requestedChroma,t);t=r}else a?t=r+1:e=r}return rt.from(this.hue,this.requestedChroma,t)}maxChroma(t){if(this.chromaCache.has(t))return this.chromaCache.get(t);const e=rt.from(this.hue,this.maxChromaValue,t).chroma;return this.chromaCache.set(t,e),e}},mt=class t{constructor(t){this.input=t}hctsByTempCache=[];hctsByHueCache=[];tempsByHctCache=new Map;inputRelativeTemperatureCache=-1;complementCache=null;get hctsByTemp(){if(this.hctsByTempCache.length>0)return this.hctsByTempCache;const t=this.hctsByHue.concat([this.input]),e=this.tempsByHct;return t.sort((t,r)=>e.get(t)-e.get(r)),this.hctsByTempCache=t,t}get warmest(){return this.hctsByTemp[this.hctsByTemp.length-1]}get coldest(){return this.hctsByTemp[0]}analogous(t=5,e=12){const r=Math.round(this.input.hue),a=this.hctsByHue[r];let n=this.relativeTemperature(a);const o=[a];let i=0;for(let t=0;t<360;t++){const e=B(r+t),a=this.hctsByHue[e],o=this.relativeTemperature(a),s=Math.abs(o-n);n=o,i+=s}let s=1;const c=i/e;let u=0;for(n=this.relativeTemperature(a);o.length<e;){const t=B(r+s),a=this.hctsByHue[t],i=this.relativeTemperature(a);u+=Math.abs(i-n);let l=u>=o.length*c,h=1;for(;l&&o.length<e;){o.push(a);l=u>=(o.length+h)*c,h++}if(n=i,s++,s>360){for(;o.length<e;)o.push(a);break}}const l=[this.input],h=Math.floor((t-1)/2);for(let t=1;t<h+1;t++){let e=0-t;for(;e<0;)e=o.length+e;e>=o.length&&(e%=o.length),l.splice(0,0,o[e])}const d=t-h-1;for(let t=1;t<d+1;t++){let e=t;for(;e<0;)e=o.length+e;e>=o.length&&(e%=o.length),l.push(o[e])}return l}get complement(){if(null!=this.complementCache)return this.complementCache;const e=this.coldest.hue,r=this.tempsByHct.get(this.coldest),a=this.warmest.hue,n=this.tempsByHct.get(this.warmest)-r,o=t.isBetween(this.input.hue,e,a),i=o?a:e,s=o?e:a;let c=1e3,u=this.hctsByHue[Math.round(this.input.hue)];const l=1-this.inputRelativeTemperature;for(let e=0;e<=360;e+=1){const a=I(i+1*e);if(!t.isBetween(a,i,s))continue;const o=this.hctsByHue[Math.round(a)],h=(this.tempsByHct.get(o)-r)/n,d=Math.abs(l-h);d<c&&(c=d,u=o)}return this.complementCache=u,this.complementCache}relativeTemperature(t){const e=this.tempsByHct.get(this.warmest)-this.tempsByHct.get(this.coldest),r=this.tempsByHct.get(t)-this.tempsByHct.get(this.coldest);return 0===e?.5:r/e}get inputRelativeTemperature(){return this.inputRelativeTemperatureCache>=0||(this.inputRelativeTemperatureCache=this.relativeTemperature(this.input)),this.inputRelativeTemperatureCache}get tempsByHct(){if(this.tempsByHctCache.size>0)return this.tempsByHctCache;const e=this.hctsByHue.concat([this.input]),r=new Map;for(const a of e)r.set(a,t.rawTemperature(a));return this.tempsByHctCache=r,r}get hctsByHue(){if(this.hctsByHueCache.length>0)return this.hctsByHueCache;const t=[];for(let e=0;e<=360;e+=1){const r=rt.from(e,this.input.chroma,this.input.tone);t.push(r)}return this.hctsByHueCache=t,this.hctsByHueCache}static isBetween(t,e,r){return e<r?e<=t&&t<=r:e<=t||t<=r}static rawTemperature(t){const e=function(t){const e=G(Y(t)),r=G(z(t)),a=G(j(t)),n=R,o=n[0][0]*e+n[0][1]*r+n[0][2]*a,i=n[1][0]*e+n[1][1]*r+n[1][2]*a,s=n[2][0]*e+n[2][1]*r+n[2][2]*a,c=i/U[1],u=s/U[2],l=Q(o/U[0]),h=Q(c);return[116*h-16,500*(l-h),200*(h-Q(u))]}(t.toInt()),r=I(180*Math.atan2(e[2],e[1])/Math.PI),a=Math.sqrt(e[1]*e[1]+e[2]*e[2]);return.02*Math.pow(a,1.07)*Math.cos(I(r-50)*Math.PI/180)-.5}},pt=class{constructor(t,e,r,a,n,o){this.roleA=t,this.roleB=e,this.delta=r,this.polarity=a,this.stayTogether=n,this.constraint=o,this.constraint=o??"exact"}};
|
|
45
|
+
/**
|
|
46
|
+
* @license
|
|
47
|
+
* Copyright 2022 Google LLC
|
|
48
|
+
*
|
|
49
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
50
|
+
* you may not use this file except in compliance with the License.
|
|
51
|
+
* You may obtain a copy of the License at
|
|
52
|
+
*
|
|
53
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
54
|
+
*
|
|
55
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
56
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
57
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
58
|
+
* See the License for the specific language governing permissions and
|
|
59
|
+
* limitations under the License.
|
|
60
|
+
*/
|
|
61
|
+
let ft=function(t){return t[t.MONOCHROME=0]="MONOCHROME",t[t.NEUTRAL=1]="NEUTRAL",t[t.TONAL_SPOT=2]="TONAL_SPOT",t[t.VIBRANT=3]="VIBRANT",t[t.EXPRESSIVE=4]="EXPRESSIVE",t[t.FIDELITY=5]="FIDELITY",t[t.CONTENT=6]="CONTENT",t[t.RAINBOW=7]="RAINBOW",t[t.FRUIT_SALAD=8]="FRUIT_SALAD",t}({});function yt(t){return t.variant===ft.FIDELITY||t.variant===ft.CONTENT}function gt(t){return t.variant===ft.MONOCHROME}var Pt=class{primaryPaletteKeyColor(){return st.fromPalette({name:"primary_palette_key_color",palette:t=>t.primaryPalette,tone:t=>t.primaryPalette.keyColor.tone})}secondaryPaletteKeyColor(){return st.fromPalette({name:"secondary_palette_key_color",palette:t=>t.secondaryPalette,tone:t=>t.secondaryPalette.keyColor.tone})}tertiaryPaletteKeyColor(){return st.fromPalette({name:"tertiary_palette_key_color",palette:t=>t.tertiaryPalette,tone:t=>t.tertiaryPalette.keyColor.tone})}neutralPaletteKeyColor(){return st.fromPalette({name:"neutral_palette_key_color",palette:t=>t.neutralPalette,tone:t=>t.neutralPalette.keyColor.tone})}neutralVariantPaletteKeyColor(){return st.fromPalette({name:"neutral_variant_palette_key_color",palette:t=>t.neutralVariantPalette,tone:t=>t.neutralVariantPalette.keyColor.tone})}errorPaletteKeyColor(){return st.fromPalette({name:"error_palette_key_color",palette:t=>t.errorPalette,tone:t=>t.errorPalette.keyColor.tone})}background(){return st.fromPalette({name:"background",palette:t=>t.neutralPalette,tone:t=>t.isDark?6:98,isBackground:!0})}onBackground(){return st.fromPalette({name:"on_background",palette:t=>t.neutralPalette,tone:t=>t.isDark?90:10,background:t=>this.background(),contrastCurve:t=>new ot(3,3,4.5,7)})}surface(){return st.fromPalette({name:"surface",palette:t=>t.neutralPalette,tone:t=>t.isDark?6:98,isBackground:!0})}surfaceDim(){return st.fromPalette({name:"surface_dim",palette:t=>t.neutralPalette,tone:t=>t.isDark?6:new ot(87,87,80,75).get(t.contrastLevel),isBackground:!0})}surfaceBright(){return st.fromPalette({name:"surface_bright",palette:t=>t.neutralPalette,tone:t=>t.isDark?new ot(24,24,29,34).get(t.contrastLevel):98,isBackground:!0})}surfaceContainerLowest(){return st.fromPalette({name:"surface_container_lowest",palette:t=>t.neutralPalette,tone:t=>t.isDark?new ot(4,4,2,0).get(t.contrastLevel):100,isBackground:!0})}surfaceContainerLow(){return st.fromPalette({name:"surface_container_low",palette:t=>t.neutralPalette,tone:t=>t.isDark?new ot(10,10,11,12).get(t.contrastLevel):new ot(96,96,96,95).get(t.contrastLevel),isBackground:!0})}surfaceContainer(){return st.fromPalette({name:"surface_container",palette:t=>t.neutralPalette,tone:t=>t.isDark?new ot(12,12,16,20).get(t.contrastLevel):new ot(94,94,92,90).get(t.contrastLevel),isBackground:!0})}surfaceContainerHigh(){return st.fromPalette({name:"surface_container_high",palette:t=>t.neutralPalette,tone:t=>t.isDark?new ot(17,17,21,25).get(t.contrastLevel):new ot(92,92,88,85).get(t.contrastLevel),isBackground:!0})}surfaceContainerHighest(){return st.fromPalette({name:"surface_container_highest",palette:t=>t.neutralPalette,tone:t=>t.isDark?new ot(22,22,26,30).get(t.contrastLevel):new ot(90,90,84,80).get(t.contrastLevel),isBackground:!0})}onSurface(){return st.fromPalette({name:"on_surface",palette:t=>t.neutralPalette,tone:t=>t.isDark?90:10,background:t=>this.highestSurface(t),contrastCurve:t=>new ot(4.5,7,11,21)})}surfaceVariant(){return st.fromPalette({name:"surface_variant",palette:t=>t.neutralVariantPalette,tone:t=>t.isDark?30:90,isBackground:!0})}onSurfaceVariant(){return st.fromPalette({name:"on_surface_variant",palette:t=>t.neutralVariantPalette,tone:t=>t.isDark?80:30,background:t=>this.highestSurface(t),contrastCurve:t=>new ot(3,4.5,7,11)})}inverseSurface(){return st.fromPalette({name:"inverse_surface",palette:t=>t.neutralPalette,tone:t=>t.isDark?90:20,isBackground:!0})}inverseOnSurface(){return st.fromPalette({name:"inverse_on_surface",palette:t=>t.neutralPalette,tone:t=>t.isDark?20:95,background:t=>this.inverseSurface(),contrastCurve:t=>new ot(4.5,7,11,21)})}outline(){return st.fromPalette({name:"outline",palette:t=>t.neutralVariantPalette,tone:t=>t.isDark?60:50,background:t=>this.highestSurface(t),contrastCurve:t=>new ot(1.5,3,4.5,7)})}outlineVariant(){return st.fromPalette({name:"outline_variant",palette:t=>t.neutralVariantPalette,tone:t=>t.isDark?30:80,background:t=>this.highestSurface(t),contrastCurve:t=>new ot(1,1,3,4.5)})}shadow(){return st.fromPalette({name:"shadow",palette:t=>t.neutralPalette,tone:t=>0})}scrim(){return st.fromPalette({name:"scrim",palette:t=>t.neutralPalette,tone:t=>0})}surfaceTint(){return st.fromPalette({name:"surface_tint",palette:t=>t.primaryPalette,tone:t=>t.isDark?80:40,isBackground:!0})}primary(){return st.fromPalette({name:"primary",palette:t=>t.primaryPalette,tone:t=>gt(t)?t.isDark?100:0:t.isDark?80:40,isBackground:!0,background:t=>this.highestSurface(t),contrastCurve:t=>new ot(3,4.5,7,7),toneDeltaPair:t=>new pt(this.primaryContainer(),this.primary(),10,"nearer",!1)})}primaryDim(){}onPrimary(){return st.fromPalette({name:"on_primary",palette:t=>t.primaryPalette,tone:t=>gt(t)?t.isDark?10:90:t.isDark?20:100,background:t=>this.primary(),contrastCurve:t=>new ot(4.5,7,11,21)})}primaryContainer(){return st.fromPalette({name:"primary_container",palette:t=>t.primaryPalette,tone:t=>yt(t)?t.sourceColorHct.tone:gt(t)?t.isDark?85:25:t.isDark?30:90,isBackground:!0,background:t=>this.highestSurface(t),contrastCurve:t=>new ot(1,1,3,4.5),toneDeltaPair:t=>new pt(this.primaryContainer(),this.primary(),10,"nearer",!1)})}onPrimaryContainer(){return st.fromPalette({name:"on_primary_container",palette:t=>t.primaryPalette,tone:t=>yt(t)?st.foregroundTone(this.primaryContainer().tone(t),4.5):gt(t)?t.isDark?0:100:t.isDark?90:30,background:t=>this.primaryContainer(),contrastCurve:t=>new ot(3,4.5,7,11)})}inversePrimary(){return st.fromPalette({name:"inverse_primary",palette:t=>t.primaryPalette,tone:t=>t.isDark?40:80,background:t=>this.inverseSurface(),contrastCurve:t=>new ot(3,4.5,7,7)})}secondary(){return st.fromPalette({name:"secondary",palette:t=>t.secondaryPalette,tone:t=>t.isDark?80:40,isBackground:!0,background:t=>this.highestSurface(t),contrastCurve:t=>new ot(3,4.5,7,7),toneDeltaPair:t=>new pt(this.secondaryContainer(),this.secondary(),10,"nearer",!1)})}secondaryDim(){}onSecondary(){return st.fromPalette({name:"on_secondary",palette:t=>t.secondaryPalette,tone:t=>gt(t)?t.isDark?10:100:t.isDark?20:100,background:t=>this.secondary(),contrastCurve:t=>new ot(4.5,7,11,21)})}secondaryContainer(){return st.fromPalette({name:"secondary_container",palette:t=>t.secondaryPalette,tone:t=>{const e=t.isDark?30:90;return gt(t)?t.isDark?30:85:yt(t)?function(t,e,r,a){let n=r,o=rt.from(t,e,r);if(o.chroma<e){let r=o.chroma;for(;o.chroma<e;){n+=a?-1:1;const i=rt.from(t,e,n);if(r>i.chroma)break;if(Math.abs(i.chroma-e)<.4)break;Math.abs(i.chroma-e)<Math.abs(o.chroma-e)&&(o=i),r=Math.max(r,i.chroma)}}return n}(t.secondaryPalette.hue,t.secondaryPalette.chroma,e,!t.isDark):e},isBackground:!0,background:t=>this.highestSurface(t),contrastCurve:t=>new ot(1,1,3,4.5),toneDeltaPair:t=>new pt(this.secondaryContainer(),this.secondary(),10,"nearer",!1)})}onSecondaryContainer(){return st.fromPalette({name:"on_secondary_container",palette:t=>t.secondaryPalette,tone:t=>gt(t)?t.isDark?90:10:yt(t)?st.foregroundTone(this.secondaryContainer().tone(t),4.5):t.isDark?90:30,background:t=>this.secondaryContainer(),contrastCurve:t=>new ot(3,4.5,7,11)})}tertiary(){return st.fromPalette({name:"tertiary",palette:t=>t.tertiaryPalette,tone:t=>gt(t)?t.isDark?90:25:t.isDark?80:40,isBackground:!0,background:t=>this.highestSurface(t),contrastCurve:t=>new ot(3,4.5,7,7),toneDeltaPair:t=>new pt(this.tertiaryContainer(),this.tertiary(),10,"nearer",!1)})}tertiaryDim(){}onTertiary(){return st.fromPalette({name:"on_tertiary",palette:t=>t.tertiaryPalette,tone:t=>gt(t)?t.isDark?10:90:t.isDark?20:100,background:t=>this.tertiary(),contrastCurve:t=>new ot(4.5,7,11,21)})}tertiaryContainer(){return st.fromPalette({name:"tertiary_container",palette:t=>t.tertiaryPalette,tone:t=>{if(gt(t))return t.isDark?60:49;if(!yt(t))return t.isDark?30:90;const e=t.tertiaryPalette.getHct(t.sourceColorHct.tone);return nt.fixIfDisliked(e).tone},isBackground:!0,background:t=>this.highestSurface(t),contrastCurve:t=>new ot(1,1,3,4.5),toneDeltaPair:t=>new pt(this.tertiaryContainer(),this.tertiary(),10,"nearer",!1)})}onTertiaryContainer(){return st.fromPalette({name:"on_tertiary_container",palette:t=>t.tertiaryPalette,tone:t=>gt(t)?t.isDark?0:100:yt(t)?st.foregroundTone(this.tertiaryContainer().tone(t),4.5):t.isDark?90:30,background:t=>this.tertiaryContainer(),contrastCurve:t=>new ot(3,4.5,7,11)})}error(){return st.fromPalette({name:"error",palette:t=>t.errorPalette,tone:t=>t.isDark?80:40,isBackground:!0,background:t=>this.highestSurface(t),contrastCurve:t=>new ot(3,4.5,7,7),toneDeltaPair:t=>new pt(this.errorContainer(),this.error(),10,"nearer",!1)})}errorDim(){}onError(){return st.fromPalette({name:"on_error",palette:t=>t.errorPalette,tone:t=>t.isDark?20:100,background:t=>this.error(),contrastCurve:t=>new ot(4.5,7,11,21)})}errorContainer(){return st.fromPalette({name:"error_container",palette:t=>t.errorPalette,tone:t=>t.isDark?30:90,isBackground:!0,background:t=>this.highestSurface(t),contrastCurve:t=>new ot(1,1,3,4.5),toneDeltaPair:t=>new pt(this.errorContainer(),this.error(),10,"nearer",!1)})}onErrorContainer(){return st.fromPalette({name:"on_error_container",palette:t=>t.errorPalette,tone:t=>gt(t)?t.isDark?90:10:t.isDark?90:30,background:t=>this.errorContainer(),contrastCurve:t=>new ot(3,4.5,7,11)})}primaryFixed(){return st.fromPalette({name:"primary_fixed",palette:t=>t.primaryPalette,tone:t=>gt(t)?40:90,isBackground:!0,background:t=>this.highestSurface(t),contrastCurve:t=>new ot(1,1,3,4.5),toneDeltaPair:t=>new pt(this.primaryFixed(),this.primaryFixedDim(),10,"lighter",!0)})}primaryFixedDim(){return st.fromPalette({name:"primary_fixed_dim",palette:t=>t.primaryPalette,tone:t=>gt(t)?30:80,isBackground:!0,background:t=>this.highestSurface(t),contrastCurve:t=>new ot(1,1,3,4.5),toneDeltaPair:t=>new pt(this.primaryFixed(),this.primaryFixedDim(),10,"lighter",!0)})}onPrimaryFixed(){return st.fromPalette({name:"on_primary_fixed",palette:t=>t.primaryPalette,tone:t=>gt(t)?100:10,background:t=>this.primaryFixedDim(),secondBackground:t=>this.primaryFixed(),contrastCurve:t=>new ot(4.5,7,11,21)})}onPrimaryFixedVariant(){return st.fromPalette({name:"on_primary_fixed_variant",palette:t=>t.primaryPalette,tone:t=>gt(t)?90:30,background:t=>this.primaryFixedDim(),secondBackground:t=>this.primaryFixed(),contrastCurve:t=>new ot(3,4.5,7,11)})}secondaryFixed(){return st.fromPalette({name:"secondary_fixed",palette:t=>t.secondaryPalette,tone:t=>gt(t)?80:90,isBackground:!0,background:t=>this.highestSurface(t),contrastCurve:t=>new ot(1,1,3,4.5),toneDeltaPair:t=>new pt(this.secondaryFixed(),this.secondaryFixedDim(),10,"lighter",!0)})}secondaryFixedDim(){return st.fromPalette({name:"secondary_fixed_dim",palette:t=>t.secondaryPalette,tone:t=>gt(t)?70:80,isBackground:!0,background:t=>this.highestSurface(t),contrastCurve:t=>new ot(1,1,3,4.5),toneDeltaPair:t=>new pt(this.secondaryFixed(),this.secondaryFixedDim(),10,"lighter",!0)})}onSecondaryFixed(){return st.fromPalette({name:"on_secondary_fixed",palette:t=>t.secondaryPalette,tone:t=>10,background:t=>this.secondaryFixedDim(),secondBackground:t=>this.secondaryFixed(),contrastCurve:t=>new ot(4.5,7,11,21)})}onSecondaryFixedVariant(){return st.fromPalette({name:"on_secondary_fixed_variant",palette:t=>t.secondaryPalette,tone:t=>gt(t)?25:30,background:t=>this.secondaryFixedDim(),secondBackground:t=>this.secondaryFixed(),contrastCurve:t=>new ot(3,4.5,7,11)})}tertiaryFixed(){return st.fromPalette({name:"tertiary_fixed",palette:t=>t.tertiaryPalette,tone:t=>gt(t)?40:90,isBackground:!0,background:t=>this.highestSurface(t),contrastCurve:t=>new ot(1,1,3,4.5),toneDeltaPair:t=>new pt(this.tertiaryFixed(),this.tertiaryFixedDim(),10,"lighter",!0)})}tertiaryFixedDim(){return st.fromPalette({name:"tertiary_fixed_dim",palette:t=>t.tertiaryPalette,tone:t=>gt(t)?30:80,isBackground:!0,background:t=>this.highestSurface(t),contrastCurve:t=>new ot(1,1,3,4.5),toneDeltaPair:t=>new pt(this.tertiaryFixed(),this.tertiaryFixedDim(),10,"lighter",!0)})}onTertiaryFixed(){return st.fromPalette({name:"on_tertiary_fixed",palette:t=>t.tertiaryPalette,tone:t=>gt(t)?100:10,background:t=>this.tertiaryFixedDim(),secondBackground:t=>this.tertiaryFixed(),contrastCurve:t=>new ot(4.5,7,11,21)})}onTertiaryFixedVariant(){return st.fromPalette({name:"on_tertiary_fixed_variant",palette:t=>t.tertiaryPalette,tone:t=>gt(t)?90:30,background:t=>this.tertiaryFixedDim(),secondBackground:t=>this.tertiaryFixed(),contrastCurve:t=>new ot(3,4.5,7,11)})}controlActivated(){return st.fromPalette({name:"control_activated",palette:t=>t.primaryPalette,tone:t=>t.isDark?30:90,isBackground:!0})}controlNormal(){return st.fromPalette({name:"control_normal",palette:t=>t.neutralVariantPalette,tone:t=>t.isDark?80:30})}controlHighlight(){return st.fromPalette({name:"control_highlight",palette:t=>t.neutralPalette,tone:t=>t.isDark?100:0,opacity:t=>t.isDark?.2:.12})}textPrimaryInverse(){return st.fromPalette({name:"text_primary_inverse",palette:t=>t.neutralPalette,tone:t=>t.isDark?10:90})}textSecondaryAndTertiaryInverse(){return st.fromPalette({name:"text_secondary_and_tertiary_inverse",palette:t=>t.neutralVariantPalette,tone:t=>t.isDark?30:80})}textPrimaryInverseDisableOnly(){return st.fromPalette({name:"text_primary_inverse_disable_only",palette:t=>t.neutralPalette,tone:t=>t.inverseOnSurface?10:90})}textSecondaryAndTertiaryInverseDisabled(){return st.fromPalette({name:"text_secondary_and_tertiary_inverse_disabled",palette:t=>t.neutralPalette,tone:t=>t.isDark?10:90})}textHintInverse(){return st.fromPalette({name:"text_hint_inverse",palette:t=>t.neutralPalette,tone:t=>t.isDark?10:90})}highestSurface(t){return t.isDark?this.surfaceBright():this.surfaceDim()}};let Ct=function(t){return t.SPEC_2021="2021",t.SPEC_2025="2025",t}({}),St=function(t){return t[t.PHONE=0]="PHONE",t[t.WATCH=1]="WATCH",t}({});function vt(t,e=0,r=100,a=1){return F(e,r,bt(t.hue,t.chroma*a,100,!0))}function Et(t,e=0,r=100){return F(e,r,bt(t.hue,t.chroma,0,!1))}function bt(t,e,r,a){let n=r,o=rt.from(t,e,n);for(;o.chroma<e&&!(r<0||r>100);){r+=a?-1:1;const i=rt.from(t,e,r);o.chroma<i.chroma&&(o=i,n=r)}return n}function kt(t){return 1.5===t?new ot(1.5,1.5,3,4.5):3===t?new ot(3,3,4.5,7):4.5===t?new ot(4.5,4.5,7,11):6===t?new ot(6,6,7,11):7===t?new ot(7,7,11,21):9===t?new ot(9,9,11,21):11===t?new ot(11,11,21,21):21===t?new ot(21,21,21,21):new ot(t,t,7,21)}var wt=class extends Pt{surface(){const t=st.fromPalette({name:"surface",palette:t=>t.neutralPalette,tone:t=>(super.surface().tone(t),t.platform===St.PHONE?t.isDark?4:rt.isYellow(t.neutralPalette.hue)?99:t.variant===ft.VIBRANT?97:98:0),isBackground:!0});return it(super.surface(),Ct.SPEC_2025,t)}surfaceDim(){const t=st.fromPalette({name:"surface_dim",palette:t=>t.neutralPalette,tone:t=>t.isDark?4:rt.isYellow(t.neutralPalette.hue)?90:t.variant===ft.VIBRANT?85:87,isBackground:!0,chromaMultiplier:t=>{if(!t.isDark){if(t.variant===ft.NEUTRAL)return 2.5;if(t.variant===ft.TONAL_SPOT)return 1.7;if(t.variant===ft.EXPRESSIVE)return rt.isYellow(t.neutralPalette.hue)?2.7:1.75;if(t.variant===ft.VIBRANT)return 1.36}return 1}});return it(super.surfaceDim(),Ct.SPEC_2025,t)}surfaceBright(){const t=st.fromPalette({name:"surface_bright",palette:t=>t.neutralPalette,tone:t=>t.isDark?18:rt.isYellow(t.neutralPalette.hue)?99:t.variant===ft.VIBRANT?97:98,isBackground:!0,chromaMultiplier:t=>{if(t.isDark){if(t.variant===ft.NEUTRAL)return 2.5;if(t.variant===ft.TONAL_SPOT)return 1.7;if(t.variant===ft.EXPRESSIVE)return rt.isYellow(t.neutralPalette.hue)?2.7:1.75;if(t.variant===ft.VIBRANT)return 1.36}return 1}});return it(super.surfaceBright(),Ct.SPEC_2025,t)}surfaceContainerLowest(){const t=st.fromPalette({name:"surface_container_lowest",palette:t=>t.neutralPalette,tone:t=>t.isDark?0:100,isBackground:!0});return it(super.surfaceContainerLowest(),Ct.SPEC_2025,t)}surfaceContainerLow(){const t=st.fromPalette({name:"surface_container_low",palette:t=>t.neutralPalette,tone:t=>t.platform===St.PHONE?t.isDark?6:rt.isYellow(t.neutralPalette.hue)?98:t.variant===ft.VIBRANT?95:96:15,isBackground:!0,chromaMultiplier:t=>{if(t.platform===St.PHONE){if(t.variant===ft.NEUTRAL)return 1.3;if(t.variant===ft.TONAL_SPOT)return 1.25;if(t.variant===ft.EXPRESSIVE)return rt.isYellow(t.neutralPalette.hue)?1.3:1.15;if(t.variant===ft.VIBRANT)return 1.08}return 1}});return it(super.surfaceContainerLow(),Ct.SPEC_2025,t)}surfaceContainer(){const t=st.fromPalette({name:"surface_container",palette:t=>t.neutralPalette,tone:t=>t.platform===St.PHONE?t.isDark?9:rt.isYellow(t.neutralPalette.hue)?96:t.variant===ft.VIBRANT?92:94:20,isBackground:!0,chromaMultiplier:t=>{if(t.platform===St.PHONE){if(t.variant===ft.NEUTRAL)return 1.6;if(t.variant===ft.TONAL_SPOT)return 1.4;if(t.variant===ft.EXPRESSIVE)return rt.isYellow(t.neutralPalette.hue)?1.6:1.3;if(t.variant===ft.VIBRANT)return 1.15}return 1}});return it(super.surfaceContainer(),Ct.SPEC_2025,t)}surfaceContainerHigh(){const t=st.fromPalette({name:"surface_container_high",palette:t=>t.neutralPalette,tone:t=>t.platform===St.PHONE?t.isDark?12:rt.isYellow(t.neutralPalette.hue)?94:t.variant===ft.VIBRANT?90:92:25,isBackground:!0,chromaMultiplier:t=>{if(t.platform===St.PHONE){if(t.variant===ft.NEUTRAL)return 1.9;if(t.variant===ft.TONAL_SPOT)return 1.5;if(t.variant===ft.EXPRESSIVE)return rt.isYellow(t.neutralPalette.hue)?1.95:1.45;if(t.variant===ft.VIBRANT)return 1.22}return 1}});return it(super.surfaceContainerHigh(),Ct.SPEC_2025,t)}surfaceContainerHighest(){const t=st.fromPalette({name:"surface_container_highest",palette:t=>t.neutralPalette,tone:t=>t.isDark?15:rt.isYellow(t.neutralPalette.hue)?92:t.variant===ft.VIBRANT?88:90,isBackground:!0,chromaMultiplier:t=>t.variant===ft.NEUTRAL?2.2:t.variant===ft.TONAL_SPOT?1.7:t.variant===ft.EXPRESSIVE?rt.isYellow(t.neutralPalette.hue)?2.3:1.6:t.variant===ft.VIBRANT?1.29:1});return it(super.surfaceContainerHighest(),Ct.SPEC_2025,t)}onSurface(){const t=st.fromPalette({name:"on_surface",palette:t=>t.neutralPalette,tone:t=>t.variant===ft.VIBRANT?vt(t.neutralPalette,0,100,1.1):st.getInitialToneFromBackground(t=>t.platform===St.PHONE?this.highestSurface(t):this.surfaceContainerHigh())(t),chromaMultiplier:t=>{if(t.platform===St.PHONE){if(t.variant===ft.NEUTRAL)return 2.2;if(t.variant===ft.TONAL_SPOT)return 1.7;if(t.variant===ft.EXPRESSIVE)return rt.isYellow(t.neutralPalette.hue)?t.isDark?3:2.3:1.6}return 1},background:t=>t.platform===St.PHONE?this.highestSurface(t):this.surfaceContainerHigh(),contrastCurve:t=>t.isDark?kt(11):kt(9)});return it(super.onSurface(),Ct.SPEC_2025,t)}onSurfaceVariant(){const t=st.fromPalette({name:"on_surface_variant",palette:t=>t.neutralPalette,chromaMultiplier:t=>{if(t.platform===St.PHONE){if(t.variant===ft.NEUTRAL)return 2.2;if(t.variant===ft.TONAL_SPOT)return 1.7;if(t.variant===ft.EXPRESSIVE)return rt.isYellow(t.neutralPalette.hue)?t.isDark?3:2.3:1.6}return 1},background:t=>t.platform===St.PHONE?this.highestSurface(t):this.surfaceContainerHigh(),contrastCurve:t=>t.platform===St.PHONE?t.isDark?kt(6):kt(4.5):kt(7)});return it(super.onSurfaceVariant(),Ct.SPEC_2025,t)}outline(){const t=st.fromPalette({name:"outline",palette:t=>t.neutralPalette,chromaMultiplier:t=>{if(t.platform===St.PHONE){if(t.variant===ft.NEUTRAL)return 2.2;if(t.variant===ft.TONAL_SPOT)return 1.7;if(t.variant===ft.EXPRESSIVE)return rt.isYellow(t.neutralPalette.hue)?t.isDark?3:2.3:1.6}return 1},background:t=>t.platform===St.PHONE?this.highestSurface(t):this.surfaceContainerHigh(),contrastCurve:t=>t.platform===St.PHONE?kt(3):kt(4.5)});return it(super.outline(),Ct.SPEC_2025,t)}outlineVariant(){const t=st.fromPalette({name:"outline_variant",palette:t=>t.neutralPalette,chromaMultiplier:t=>{if(t.platform===St.PHONE){if(t.variant===ft.NEUTRAL)return 2.2;if(t.variant===ft.TONAL_SPOT)return 1.7;if(t.variant===ft.EXPRESSIVE)return rt.isYellow(t.neutralPalette.hue)?t.isDark?3:2.3:1.6}return 1},background:t=>t.platform===St.PHONE?this.highestSurface(t):this.surfaceContainerHigh(),contrastCurve:t=>t.platform===St.PHONE?kt(1.5):kt(3)});return it(super.outlineVariant(),Ct.SPEC_2025,t)}inverseSurface(){const t=st.fromPalette({name:"inverse_surface",palette:t=>t.neutralPalette,tone:t=>t.isDark?98:4,isBackground:!0});return it(super.inverseSurface(),Ct.SPEC_2025,t)}inverseOnSurface(){const t=st.fromPalette({name:"inverse_on_surface",palette:t=>t.neutralPalette,background:t=>this.inverseSurface(),contrastCurve:t=>kt(7)});return it(super.inverseOnSurface(),Ct.SPEC_2025,t)}primary(){const t=st.fromPalette({name:"primary",palette:t=>t.primaryPalette,tone:t=>t.variant===ft.NEUTRAL?t.platform===St.PHONE?t.isDark?80:40:90:t.variant===ft.TONAL_SPOT?t.platform===St.PHONE?t.isDark?80:vt(t.primaryPalette):vt(t.primaryPalette,0,90):t.variant===ft.EXPRESSIVE?vt(t.primaryPalette,0,rt.isYellow(t.primaryPalette.hue)?25:rt.isCyan(t.primaryPalette.hue)?88:98):vt(t.primaryPalette,0,rt.isCyan(t.primaryPalette.hue)?88:98),isBackground:!0,background:t=>t.platform===St.PHONE?this.highestSurface(t):this.surfaceContainerHigh(),contrastCurve:t=>t.platform===St.PHONE?kt(4.5):kt(7),toneDeltaPair:t=>t.platform===St.PHONE?new pt(this.primaryContainer(),this.primary(),5,"relative_lighter",!0,"farther"):void 0});return it(super.primary(),Ct.SPEC_2025,t)}primaryDim(){return st.fromPalette({name:"primary_dim",palette:t=>t.primaryPalette,tone:t=>t.variant===ft.NEUTRAL?85:t.variant===ft.TONAL_SPOT?vt(t.primaryPalette,0,90):vt(t.primaryPalette),isBackground:!0,background:t=>this.surfaceContainerHigh(),contrastCurve:t=>kt(4.5),toneDeltaPair:t=>new pt(this.primaryDim(),this.primary(),5,"darker",!0,"farther")})}onPrimary(){const t=st.fromPalette({name:"on_primary",palette:t=>t.primaryPalette,background:t=>t.platform===St.PHONE?this.primary():this.primaryDim(),contrastCurve:t=>t.platform===St.PHONE?kt(6):kt(7)});return it(super.onPrimary(),Ct.SPEC_2025,t)}primaryContainer(){const t=st.fromPalette({name:"primary_container",palette:t=>t.primaryPalette,tone:t=>t.platform===St.WATCH?30:t.variant===ft.NEUTRAL?t.isDark?30:90:t.variant===ft.TONAL_SPOT?t.isDark?Et(t.primaryPalette,35,93):vt(t.primaryPalette,0,90):t.variant===ft.EXPRESSIVE?t.isDark?vt(t.primaryPalette,30,93):vt(t.primaryPalette,78,rt.isCyan(t.primaryPalette.hue)?88:90):t.isDark?Et(t.primaryPalette,66,93):vt(t.primaryPalette,66,rt.isCyan(t.primaryPalette.hue)?88:93),isBackground:!0,background:t=>t.platform===St.PHONE?this.highestSurface(t):void 0,toneDeltaPair:t=>t.platform===St.PHONE?void 0:new pt(this.primaryContainer(),this.primaryDim(),10,"darker",!0,"farther"),contrastCurve:t=>t.platform===St.PHONE&&t.contrastLevel>0?kt(1.5):void 0});return it(super.primaryContainer(),Ct.SPEC_2025,t)}onPrimaryContainer(){const t=st.fromPalette({name:"on_primary_container",palette:t=>t.primaryPalette,background:t=>this.primaryContainer(),contrastCurve:t=>t.platform===St.PHONE?kt(6):kt(7)});return it(super.onPrimaryContainer(),Ct.SPEC_2025,t)}primaryFixed(){const t=st.fromPalette({name:"primary_fixed",palette:t=>t.primaryPalette,tone:t=>{let e=Object.assign({},t,{isDark:!1,contrastLevel:0});return this.primaryContainer().getTone(e)},isBackground:!0,background:t=>t.platform===St.PHONE?this.highestSurface(t):void 0,contrastCurve:t=>t.platform===St.PHONE&&t.contrastLevel>0?kt(1.5):void 0});return it(super.primaryFixed(),Ct.SPEC_2025,t)}primaryFixedDim(){const t=st.fromPalette({name:"primary_fixed_dim",palette:t=>t.primaryPalette,tone:t=>this.primaryFixed().getTone(t),isBackground:!0,toneDeltaPair:t=>new pt(this.primaryFixedDim(),this.primaryFixed(),5,"darker",!0,"exact")});return it(super.primaryFixedDim(),Ct.SPEC_2025,t)}onPrimaryFixed(){const t=st.fromPalette({name:"on_primary_fixed",palette:t=>t.primaryPalette,background:t=>this.primaryFixedDim(),contrastCurve:t=>kt(7)});return it(super.onPrimaryFixed(),Ct.SPEC_2025,t)}onPrimaryFixedVariant(){const t=st.fromPalette({name:"on_primary_fixed_variant",palette:t=>t.primaryPalette,background:t=>this.primaryFixedDim(),contrastCurve:t=>kt(4.5)});return it(super.onPrimaryFixedVariant(),Ct.SPEC_2025,t)}inversePrimary(){const t=st.fromPalette({name:"inverse_primary",palette:t=>t.primaryPalette,tone:t=>vt(t.primaryPalette),background:t=>this.inverseSurface(),contrastCurve:t=>t.platform===St.PHONE?kt(6):kt(7)});return it(super.inversePrimary(),Ct.SPEC_2025,t)}secondary(){const t=st.fromPalette({name:"secondary",palette:t=>t.secondaryPalette,tone:t=>t.platform===St.WATCH?t.variant===ft.NEUTRAL?90:vt(t.secondaryPalette,0,90):t.variant===ft.NEUTRAL?t.isDark?Et(t.secondaryPalette,0,98):vt(t.secondaryPalette):t.variant===ft.VIBRANT?vt(t.secondaryPalette,0,t.isDark?90:98):t.isDark?80:vt(t.secondaryPalette),isBackground:!0,background:t=>t.platform===St.PHONE?this.highestSurface(t):this.surfaceContainerHigh(),contrastCurve:t=>t.platform===St.PHONE?kt(4.5):kt(7),toneDeltaPair:t=>t.platform===St.PHONE?new pt(this.secondaryContainer(),this.secondary(),5,"relative_lighter",!0,"farther"):void 0});return it(super.secondary(),Ct.SPEC_2025,t)}secondaryDim(){return st.fromPalette({name:"secondary_dim",palette:t=>t.secondaryPalette,tone:t=>t.variant===ft.NEUTRAL?85:vt(t.secondaryPalette,0,90),isBackground:!0,background:t=>this.surfaceContainerHigh(),contrastCurve:t=>kt(4.5),toneDeltaPair:t=>new pt(this.secondaryDim(),this.secondary(),5,"darker",!0,"farther")})}onSecondary(){const t=st.fromPalette({name:"on_secondary",palette:t=>t.secondaryPalette,background:t=>t.platform===St.PHONE?this.secondary():this.secondaryDim(),contrastCurve:t=>t.platform===St.PHONE?kt(6):kt(7)});return it(super.onSecondary(),Ct.SPEC_2025,t)}secondaryContainer(){const t=st.fromPalette({name:"secondary_container",palette:t=>t.secondaryPalette,tone:t=>t.platform===St.WATCH?30:t.variant===ft.VIBRANT?t.isDark?Et(t.secondaryPalette,30,40):vt(t.secondaryPalette,84,90):t.variant===ft.EXPRESSIVE?t.isDark?15:vt(t.secondaryPalette,90,95):t.isDark?25:90,isBackground:!0,background:t=>t.platform===St.PHONE?this.highestSurface(t):void 0,toneDeltaPair:t=>t.platform===St.WATCH?new pt(this.secondaryContainer(),this.secondaryDim(),10,"darker",!0,"farther"):void 0,contrastCurve:t=>t.platform===St.PHONE&&t.contrastLevel>0?kt(1.5):void 0});return it(super.secondaryContainer(),Ct.SPEC_2025,t)}onSecondaryContainer(){const t=st.fromPalette({name:"on_secondary_container",palette:t=>t.secondaryPalette,background:t=>this.secondaryContainer(),contrastCurve:t=>t.platform===St.PHONE?kt(6):kt(7)});return it(super.onSecondaryContainer(),Ct.SPEC_2025,t)}secondaryFixed(){const t=st.fromPalette({name:"secondary_fixed",palette:t=>t.secondaryPalette,tone:t=>{let e=Object.assign({},t,{isDark:!1,contrastLevel:0});return this.secondaryContainer().getTone(e)},isBackground:!0,background:t=>t.platform===St.PHONE?this.highestSurface(t):void 0,contrastCurve:t=>t.platform===St.PHONE&&t.contrastLevel>0?kt(1.5):void 0});return it(super.secondaryFixed(),Ct.SPEC_2025,t)}secondaryFixedDim(){const t=st.fromPalette({name:"secondary_fixed_dim",palette:t=>t.secondaryPalette,tone:t=>this.secondaryFixed().getTone(t),isBackground:!0,toneDeltaPair:t=>new pt(this.secondaryFixedDim(),this.secondaryFixed(),5,"darker",!0,"exact")});return it(super.secondaryFixedDim(),Ct.SPEC_2025,t)}onSecondaryFixed(){const t=st.fromPalette({name:"on_secondary_fixed",palette:t=>t.secondaryPalette,background:t=>this.secondaryFixedDim(),contrastCurve:t=>kt(7)});return it(super.onSecondaryFixed(),Ct.SPEC_2025,t)}onSecondaryFixedVariant(){const t=st.fromPalette({name:"on_secondary_fixed_variant",palette:t=>t.secondaryPalette,background:t=>this.secondaryFixedDim(),contrastCurve:t=>kt(4.5)});return it(super.onSecondaryFixedVariant(),Ct.SPEC_2025,t)}tertiary(){const t=st.fromPalette({name:"tertiary",palette:t=>t.tertiaryPalette,tone:t=>t.platform===St.WATCH?t.variant===ft.TONAL_SPOT?vt(t.tertiaryPalette,0,90):vt(t.tertiaryPalette):t.variant===ft.EXPRESSIVE||t.variant===ft.VIBRANT?vt(t.tertiaryPalette,0,rt.isCyan(t.tertiaryPalette.hue)?88:t.isDark?98:100):t.isDark?vt(t.tertiaryPalette,0,98):vt(t.tertiaryPalette),isBackground:!0,background:t=>t.platform===St.PHONE?this.highestSurface(t):this.surfaceContainerHigh(),contrastCurve:t=>t.platform===St.PHONE?kt(4.5):kt(7),toneDeltaPair:t=>t.platform===St.PHONE?new pt(this.tertiaryContainer(),this.tertiary(),5,"relative_lighter",!0,"farther"):void 0});return it(super.tertiary(),Ct.SPEC_2025,t)}tertiaryDim(){return st.fromPalette({name:"tertiary_dim",palette:t=>t.tertiaryPalette,tone:t=>t.variant===ft.TONAL_SPOT?vt(t.tertiaryPalette,0,90):vt(t.tertiaryPalette),isBackground:!0,background:t=>this.surfaceContainerHigh(),contrastCurve:t=>kt(4.5),toneDeltaPair:t=>new pt(this.tertiaryDim(),this.tertiary(),5,"darker",!0,"farther")})}onTertiary(){const t=st.fromPalette({name:"on_tertiary",palette:t=>t.tertiaryPalette,background:t=>t.platform===St.PHONE?this.tertiary():this.tertiaryDim(),contrastCurve:t=>t.platform===St.PHONE?kt(6):kt(7)});return it(super.onTertiary(),Ct.SPEC_2025,t)}tertiaryContainer(){const t=st.fromPalette({name:"tertiary_container",palette:t=>t.tertiaryPalette,tone:t=>t.platform===St.WATCH?t.variant===ft.TONAL_SPOT?vt(t.tertiaryPalette,0,90):vt(t.tertiaryPalette):t.variant===ft.NEUTRAL?t.isDark?vt(t.tertiaryPalette,0,93):vt(t.tertiaryPalette,0,96):t.variant===ft.TONAL_SPOT?vt(t.tertiaryPalette,0,t.isDark?93:100):t.variant===ft.EXPRESSIVE?vt(t.tertiaryPalette,75,rt.isCyan(t.tertiaryPalette.hue)?88:t.isDark?93:100):t.isDark?vt(t.tertiaryPalette,0,93):vt(t.tertiaryPalette,72,100),isBackground:!0,background:t=>t.platform===St.PHONE?this.highestSurface(t):void 0,toneDeltaPair:t=>t.platform===St.WATCH?new pt(this.tertiaryContainer(),this.tertiaryDim(),10,"darker",!0,"farther"):void 0,contrastCurve:t=>t.platform===St.PHONE&&t.contrastLevel>0?kt(1.5):void 0});return it(super.tertiaryContainer(),Ct.SPEC_2025,t)}onTertiaryContainer(){const t=st.fromPalette({name:"on_tertiary_container",palette:t=>t.tertiaryPalette,background:t=>this.tertiaryContainer(),contrastCurve:t=>t.platform===St.PHONE?kt(6):kt(7)});return it(super.onTertiaryContainer(),Ct.SPEC_2025,t)}tertiaryFixed(){const t=st.fromPalette({name:"tertiary_fixed",palette:t=>t.tertiaryPalette,tone:t=>{let e=Object.assign({},t,{isDark:!1,contrastLevel:0});return this.tertiaryContainer().getTone(e)},isBackground:!0,background:t=>t.platform===St.PHONE?this.highestSurface(t):void 0,contrastCurve:t=>t.platform===St.PHONE&&t.contrastLevel>0?kt(1.5):void 0});return it(super.tertiaryFixed(),Ct.SPEC_2025,t)}tertiaryFixedDim(){const t=st.fromPalette({name:"tertiary_fixed_dim",palette:t=>t.tertiaryPalette,tone:t=>this.tertiaryFixed().getTone(t),isBackground:!0,toneDeltaPair:t=>new pt(this.tertiaryFixedDim(),this.tertiaryFixed(),5,"darker",!0,"exact")});return it(super.tertiaryFixedDim(),Ct.SPEC_2025,t)}onTertiaryFixed(){const t=st.fromPalette({name:"on_tertiary_fixed",palette:t=>t.tertiaryPalette,background:t=>this.tertiaryFixedDim(),contrastCurve:t=>kt(7)});return it(super.onTertiaryFixed(),Ct.SPEC_2025,t)}onTertiaryFixedVariant(){const t=st.fromPalette({name:"on_tertiary_fixed_variant",palette:t=>t.tertiaryPalette,background:t=>this.tertiaryFixedDim(),contrastCurve:t=>kt(4.5)});return it(super.onTertiaryFixedVariant(),Ct.SPEC_2025,t)}error(){const t=st.fromPalette({name:"error",palette:t=>t.errorPalette,tone:t=>t.platform===St.PHONE?t.isDark?Et(t.errorPalette,0,98):vt(t.errorPalette):Et(t.errorPalette),isBackground:!0,background:t=>t.platform===St.PHONE?this.highestSurface(t):this.surfaceContainerHigh(),contrastCurve:t=>t.platform===St.PHONE?kt(4.5):kt(7),toneDeltaPair:t=>t.platform===St.PHONE?new pt(this.errorContainer(),this.error(),5,"relative_lighter",!0,"farther"):void 0});return it(super.error(),Ct.SPEC_2025,t)}errorDim(){return st.fromPalette({name:"error_dim",palette:t=>t.errorPalette,tone:t=>Et(t.errorPalette),isBackground:!0,background:t=>this.surfaceContainerHigh(),contrastCurve:t=>kt(4.5),toneDeltaPair:t=>new pt(this.errorDim(),this.error(),5,"darker",!0,"farther")})}onError(){const t=st.fromPalette({name:"on_error",palette:t=>t.errorPalette,background:t=>t.platform===St.PHONE?this.error():this.errorDim(),contrastCurve:t=>t.platform===St.PHONE?kt(6):kt(7)});return it(super.onError(),Ct.SPEC_2025,t)}errorContainer(){const t=st.fromPalette({name:"error_container",palette:t=>t.errorPalette,tone:t=>t.platform===St.WATCH?30:t.isDark?Et(t.errorPalette,30,93):vt(t.errorPalette,0,90),isBackground:!0,background:t=>t.platform===St.PHONE?this.highestSurface(t):void 0,toneDeltaPair:t=>t.platform===St.WATCH?new pt(this.errorContainer(),this.errorDim(),10,"darker",!0,"farther"):void 0,contrastCurve:t=>t.platform===St.PHONE&&t.contrastLevel>0?kt(1.5):void 0});return it(super.errorContainer(),Ct.SPEC_2025,t)}onErrorContainer(){const t=st.fromPalette({name:"on_error_container",palette:t=>t.errorPalette,background:t=>this.errorContainer(),contrastCurve:t=>t.platform===St.PHONE?kt(4.5):kt(7)});return it(super.onErrorContainer(),Ct.SPEC_2025,t)}surfaceVariant(){const t=Object.assign(this.surfaceContainerHighest().clone(),{name:"surface_variant"});return it(super.surfaceVariant(),Ct.SPEC_2025,t)}surfaceTint(){const t=Object.assign(this.primary().clone(),{name:"surface_tint"});return it(super.surfaceTint(),Ct.SPEC_2025,t)}background(){const t=Object.assign(this.surface().clone(),{name:"background"});return it(super.background(),Ct.SPEC_2025,t)}onBackground(){const t=Object.assign(this.onSurface().clone(),{name:"on_background",tone:t=>t.platform===St.WATCH?100:this.onSurface().getTone(t)});return it(super.onBackground(),Ct.SPEC_2025,t)}controlActivated(){const t=Object.assign(this.primaryContainer().clone(),{name:"control_activated"});return it(super.controlActivated(),Ct.SPEC_2025,t)}controlNormal(){const t=Object.assign(this.onSurfaceVariant().clone(),{name:"control_normal"});return it(super.controlNormal(),Ct.SPEC_2025,t)}textPrimaryInverse(){const t=Object.assign(this.inverseOnSurface().clone(),{name:"text_primary_inverse"});return it(super.textPrimaryInverse(),Ct.SPEC_2025,t)}},_t=class t{static contentAccentToneDelta=15;static colorSpec=new wt;highestSurface(e){return t.colorSpec.highestSurface(e)}primaryPaletteKeyColor(){return t.colorSpec.primaryPaletteKeyColor()}secondaryPaletteKeyColor(){return t.colorSpec.secondaryPaletteKeyColor()}tertiaryPaletteKeyColor(){return t.colorSpec.tertiaryPaletteKeyColor()}neutralPaletteKeyColor(){return t.colorSpec.neutralPaletteKeyColor()}neutralVariantPaletteKeyColor(){return t.colorSpec.neutralVariantPaletteKeyColor()}errorPaletteKeyColor(){return t.colorSpec.errorPaletteKeyColor()}background(){return t.colorSpec.background()}onBackground(){return t.colorSpec.onBackground()}surface(){return t.colorSpec.surface()}surfaceDim(){return t.colorSpec.surfaceDim()}surfaceBright(){return t.colorSpec.surfaceBright()}surfaceContainerLowest(){return t.colorSpec.surfaceContainerLowest()}surfaceContainerLow(){return t.colorSpec.surfaceContainerLow()}surfaceContainer(){return t.colorSpec.surfaceContainer()}surfaceContainerHigh(){return t.colorSpec.surfaceContainerHigh()}surfaceContainerHighest(){return t.colorSpec.surfaceContainerHighest()}onSurface(){return t.colorSpec.onSurface()}surfaceVariant(){return t.colorSpec.surfaceVariant()}onSurfaceVariant(){return t.colorSpec.onSurfaceVariant()}outline(){return t.colorSpec.outline()}outlineVariant(){return t.colorSpec.outlineVariant()}inverseSurface(){return t.colorSpec.inverseSurface()}inverseOnSurface(){return t.colorSpec.inverseOnSurface()}shadow(){return t.colorSpec.shadow()}scrim(){return t.colorSpec.scrim()}surfaceTint(){return t.colorSpec.surfaceTint()}primary(){return t.colorSpec.primary()}primaryDim(){return t.colorSpec.primaryDim()}onPrimary(){return t.colorSpec.onPrimary()}primaryContainer(){return t.colorSpec.primaryContainer()}onPrimaryContainer(){return t.colorSpec.onPrimaryContainer()}inversePrimary(){return t.colorSpec.inversePrimary()}primaryFixed(){return t.colorSpec.primaryFixed()}primaryFixedDim(){return t.colorSpec.primaryFixedDim()}onPrimaryFixed(){return t.colorSpec.onPrimaryFixed()}onPrimaryFixedVariant(){return t.colorSpec.onPrimaryFixedVariant()}secondary(){return t.colorSpec.secondary()}secondaryDim(){return t.colorSpec.secondaryDim()}onSecondary(){return t.colorSpec.onSecondary()}secondaryContainer(){return t.colorSpec.secondaryContainer()}onSecondaryContainer(){return t.colorSpec.onSecondaryContainer()}secondaryFixed(){return t.colorSpec.secondaryFixed()}secondaryFixedDim(){return t.colorSpec.secondaryFixedDim()}onSecondaryFixed(){return t.colorSpec.onSecondaryFixed()}onSecondaryFixedVariant(){return t.colorSpec.onSecondaryFixedVariant()}tertiary(){return t.colorSpec.tertiary()}tertiaryDim(){return t.colorSpec.tertiaryDim()}onTertiary(){return t.colorSpec.onTertiary()}tertiaryContainer(){return t.colorSpec.tertiaryContainer()}onTertiaryContainer(){return t.colorSpec.onTertiaryContainer()}tertiaryFixed(){return t.colorSpec.tertiaryFixed()}tertiaryFixedDim(){return t.colorSpec.tertiaryFixedDim()}onTertiaryFixed(){return t.colorSpec.onTertiaryFixed()}onTertiaryFixedVariant(){return t.colorSpec.onTertiaryFixedVariant()}error(){return t.colorSpec.error()}errorDim(){return t.colorSpec.errorDim()}onError(){return t.colorSpec.onError()}errorContainer(){return t.colorSpec.errorContainer()}onErrorContainer(){return t.colorSpec.onErrorContainer()}controlActivated(){return t.colorSpec.controlActivated()}controlNormal(){return t.colorSpec.controlNormal()}controlHighlight(){return t.colorSpec.controlHighlight()}textPrimaryInverse(){return t.colorSpec.textPrimaryInverse()}textSecondaryAndTertiaryInverse(){return t.colorSpec.textSecondaryAndTertiaryInverse()}textPrimaryInverseDisableOnly(){return t.colorSpec.textPrimaryInverseDisableOnly()}textSecondaryAndTertiaryInverseDisabled(){return t.colorSpec.textSecondaryAndTertiaryInverseDisabled()}textHintInverse(){return t.colorSpec.textHintInverse()}allDynamicColors=[this.primaryPaletteKeyColor(),this.secondaryPaletteKeyColor(),this.tertiaryPaletteKeyColor(),this.neutralPaletteKeyColor(),this.neutralVariantPaletteKeyColor(),this.errorPaletteKeyColor(),this.background(),this.onBackground(),this.surface(),this.surfaceDim(),this.surfaceBright(),this.surfaceContainerLowest(),this.surfaceContainerLow(),this.surfaceContainer(),this.surfaceContainerHigh(),this.surfaceContainerHighest(),this.onSurface(),this.surfaceVariant(),this.onSurfaceVariant(),this.outline(),this.outlineVariant(),this.inverseSurface(),this.inverseOnSurface(),this.shadow(),this.scrim(),this.surfaceTint(),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(),this.controlActivated(),this.controlNormal(),this.controlHighlight(),this.textPrimaryInverse(),this.textSecondaryAndTertiaryInverse(),this.textPrimaryInverseDisableOnly(),this.textSecondaryAndTertiaryInverseDisabled(),this.textHintInverse()];static highestSurface(e){return t.colorSpec.highestSurface(e)}static primaryPaletteKeyColor=t.colorSpec.primaryPaletteKeyColor();static secondaryPaletteKeyColor=t.colorSpec.secondaryPaletteKeyColor();static tertiaryPaletteKeyColor=t.colorSpec.tertiaryPaletteKeyColor();static neutralPaletteKeyColor=t.colorSpec.neutralPaletteKeyColor();static neutralVariantPaletteKeyColor=t.colorSpec.neutralVariantPaletteKeyColor();static background=t.colorSpec.background();static onBackground=t.colorSpec.onBackground();static surface=t.colorSpec.surface();static surfaceDim=t.colorSpec.surfaceDim();static surfaceBright=t.colorSpec.surfaceBright();static surfaceContainerLowest=t.colorSpec.surfaceContainerLowest();static surfaceContainerLow=t.colorSpec.surfaceContainerLow();static surfaceContainer=t.colorSpec.surfaceContainer();static surfaceContainerHigh=t.colorSpec.surfaceContainerHigh();static surfaceContainerHighest=t.colorSpec.surfaceContainerHighest();static onSurface=t.colorSpec.onSurface();static surfaceVariant=t.colorSpec.surfaceVariant();static onSurfaceVariant=t.colorSpec.onSurfaceVariant();static inverseSurface=t.colorSpec.inverseSurface();static inverseOnSurface=t.colorSpec.inverseOnSurface();static outline=t.colorSpec.outline();static outlineVariant=t.colorSpec.outlineVariant();static shadow=t.colorSpec.shadow();static scrim=t.colorSpec.scrim();static surfaceTint=t.colorSpec.surfaceTint();static primary=t.colorSpec.primary();static onPrimary=t.colorSpec.onPrimary();static primaryContainer=t.colorSpec.primaryContainer();static onPrimaryContainer=t.colorSpec.onPrimaryContainer();static inversePrimary=t.colorSpec.inversePrimary();static secondary=t.colorSpec.secondary();static onSecondary=t.colorSpec.onSecondary();static secondaryContainer=t.colorSpec.secondaryContainer();static onSecondaryContainer=t.colorSpec.onSecondaryContainer();static tertiary=t.colorSpec.tertiary();static onTertiary=t.colorSpec.onTertiary();static tertiaryContainer=t.colorSpec.tertiaryContainer();static onTertiaryContainer=t.colorSpec.onTertiaryContainer();static error=t.colorSpec.error();static onError=t.colorSpec.onError();static errorContainer=t.colorSpec.errorContainer();static onErrorContainer=t.colorSpec.onErrorContainer();static primaryFixed=t.colorSpec.primaryFixed();static primaryFixedDim=t.colorSpec.primaryFixedDim();static onPrimaryFixed=t.colorSpec.onPrimaryFixed();static onPrimaryFixedVariant=t.colorSpec.onPrimaryFixedVariant();static secondaryFixed=t.colorSpec.secondaryFixed();static secondaryFixedDim=t.colorSpec.secondaryFixedDim();static onSecondaryFixed=t.colorSpec.onSecondaryFixed();static onSecondaryFixedVariant=t.colorSpec.onSecondaryFixedVariant();static tertiaryFixed=t.colorSpec.tertiaryFixed();static tertiaryFixedDim=t.colorSpec.tertiaryFixedDim();static onTertiaryFixed=t.colorSpec.onTertiaryFixed();static onTertiaryFixedVariant=t.colorSpec.onTertiaryFixedVariant()},Tt=class t{static DEFAULT_SPEC_VERSION=Ct.SPEC_2021;static DEFAULT_PLATFORM=St.PHONE;sourceColorHct;sourceColorArgb;variant;contrastLevel;isDark;platform;specVersion;primaryPalette;secondaryPalette;tertiaryPalette;neutralPalette;neutralVariantPalette;errorPalette;colors;constructor({sourceColorHct:e,isDark:r,contrastLevel:a=0,variant:n,specVersion:o=t.DEFAULT_SPEC_VERSION,platform:i=t.DEFAULT_PLATFORM,primaryPalette:s,secondaryPalette:c,tertiaryPalette:u,neutralPalette:l,neutralVariantPalette:h,errorPalette:d}){this.sourceColorArgb=e.toInt(),this.variant=n,this.contrastLevel=a,this.isDark=r,this.platform=i,this.specVersion=o,this.sourceColorHct=e,this.primaryPalette=s??Ht(o).getPrimaryPalette(n,e,r,i,a),this.secondaryPalette=c??Ht(o).getSecondaryPalette(n,e,r,i,a),this.tertiaryPalette=u??Ht(o).getTertiaryPalette(n,e,r,i,a),this.neutralPalette=l??Ht(o).getNeutralPalette(n,e,r,i,a),this.neutralVariantPalette=h??Ht(o).getNeutralVariantPalette(n,e,r,i,a),this.errorPalette=d??Ht(o).getErrorPalette(n,e,r,i,a)??ht.fromHueAndChroma(25,84),this.colors=new _t}static from({sourceColorHct:e=rt.fromInt(4284960932),isDark:r,contrastLevel:a=0,variant:n=ft.TONAL_SPOT,specVersion:o=t.DEFAULT_SPEC_VERSION,platform:i=t.DEFAULT_PLATFORM,primaryPalette:s,secondaryPalette:c,tertiaryPalette:u,neutralPalette:l,neutralVariantPalette:h,errorPalette:d,primaryPaletteKeyColor:m,secondaryPaletteKeyColor:p,tertiaryPaletteKeyColor:f,neutralPaletteKeyColor:y,neutralVariantPaletteKeyColor:g,errorPaletteKeyColor:P}){return new t({sourceColorHct:e,isDark:r,contrastLevel:a,variant:n,specVersion:o,platform:i,primaryPalette:s??Ht(o).getPrimaryPalette(n,m??e,r,i,a),secondaryPalette:c??Ht(o).getSecondaryPalette(n,p??e,r,i,a),tertiaryPalette:u??Ht(o).getTertiaryPalette(n,f??e,r,i,a),neutralPalette:l??Ht(o).getNeutralPalette(n,y??e,r,i,a),neutralVariantPalette:h??Ht(o).getNeutralVariantPalette(n,g??e,r,i,a),errorPalette:d??Ht(o).getErrorPalette(n,P??e,r,i,a)??ht.fromHueAndChroma(25,84)})}toString(){return`Scheme: variant=${ft[this.variant]}, mode=${this.isDark?"dark":"light"}, platform=${this.platform}, contrastLevel=${this.contrastLevel.toFixed(1)}, seed=${this.sourceColorHct.toString()}, specVersion=${this.specVersion}`}static getPiecewiseHue(t,e,r){const a=Math.min(e.length-1,r.length),n=t.hue;for(let t=0;t<a;t++)if(n>=e[t]&&n<e[t+1])return I(r[t]);return n}static getRotatedHue(e,r,a){let n=t.getPiecewiseHue(e,r,a);return Math.min(r.length-1,a.length)<=0&&(n=0),I(e.hue+n)}getArgb(t){return t.getArgb(this)}getHct(t){return t.getHct(this)}get primaryPaletteKeyColor(){return this.getArgb(this.colors.primaryPaletteKeyColor())}get secondaryPaletteKeyColor(){return this.getArgb(this.colors.secondaryPaletteKeyColor())}get tertiaryPaletteKeyColor(){return this.getArgb(this.colors.tertiaryPaletteKeyColor())}get neutralPaletteKeyColor(){return this.getArgb(this.colors.neutralPaletteKeyColor())}get neutralVariantPaletteKeyColor(){return this.getArgb(this.colors.neutralVariantPaletteKeyColor())}get errorPaletteKeyColor(){return this.getArgb(this.colors.errorPaletteKeyColor())}get background(){return this.getArgb(this.colors.background())}get onBackground(){return this.getArgb(this.colors.onBackground())}get surface(){return this.getArgb(this.colors.surface())}get surfaceDim(){return this.getArgb(this.colors.surfaceDim())}get surfaceBright(){return this.getArgb(this.colors.surfaceBright())}get surfaceContainerLowest(){return this.getArgb(this.colors.surfaceContainerLowest())}get surfaceContainerLow(){return this.getArgb(this.colors.surfaceContainerLow())}get surfaceContainer(){return this.getArgb(this.colors.surfaceContainer())}get surfaceContainerHigh(){return this.getArgb(this.colors.surfaceContainerHigh())}get surfaceContainerHighest(){return this.getArgb(this.colors.surfaceContainerHighest())}get onSurface(){return this.getArgb(this.colors.onSurface())}get surfaceVariant(){return this.getArgb(this.colors.surfaceVariant())}get onSurfaceVariant(){return this.getArgb(this.colors.onSurfaceVariant())}get inverseSurface(){return this.getArgb(this.colors.inverseSurface())}get inverseOnSurface(){return this.getArgb(this.colors.inverseOnSurface())}get outline(){return this.getArgb(this.colors.outline())}get outlineVariant(){return this.getArgb(this.colors.outlineVariant())}get shadow(){return this.getArgb(this.colors.shadow())}get scrim(){return this.getArgb(this.colors.scrim())}get surfaceTint(){return this.getArgb(this.colors.surfaceTint())}get primary(){return this.getArgb(this.colors.primary())}get primaryDim(){const t=this.colors.primaryDim();if(void 0===t)throw new Error("`primaryDim` color is undefined prior to 2025 spec.");return this.getArgb(t)}get onPrimary(){return this.getArgb(this.colors.onPrimary())}get primaryContainer(){return this.getArgb(this.colors.primaryContainer())}get onPrimaryContainer(){return this.getArgb(this.colors.onPrimaryContainer())}get primaryFixed(){return this.getArgb(this.colors.primaryFixed())}get primaryFixedDim(){return this.getArgb(this.colors.primaryFixedDim())}get onPrimaryFixed(){return this.getArgb(this.colors.onPrimaryFixed())}get onPrimaryFixedVariant(){return this.getArgb(this.colors.onPrimaryFixedVariant())}get inversePrimary(){return this.getArgb(this.colors.inversePrimary())}get secondary(){return this.getArgb(this.colors.secondary())}get secondaryDim(){const t=this.colors.secondaryDim();if(void 0===t)throw new Error("`secondaryDim` color is undefined prior to 2025 spec.");return this.getArgb(t)}get onSecondary(){return this.getArgb(this.colors.onSecondary())}get secondaryContainer(){return this.getArgb(this.colors.secondaryContainer())}get onSecondaryContainer(){return this.getArgb(this.colors.onSecondaryContainer())}get secondaryFixed(){return this.getArgb(this.colors.secondaryFixed())}get secondaryFixedDim(){return this.getArgb(this.colors.secondaryFixedDim())}get onSecondaryFixed(){return this.getArgb(this.colors.onSecondaryFixed())}get onSecondaryFixedVariant(){return this.getArgb(this.colors.onSecondaryFixedVariant())}get tertiary(){return this.getArgb(this.colors.tertiary())}get tertiaryDim(){const t=this.colors.tertiaryDim();if(void 0===t)throw new Error("`tertiaryDim` color is undefined prior to 2025 spec.");return this.getArgb(t)}get onTertiary(){return this.getArgb(this.colors.onTertiary())}get tertiaryContainer(){return this.getArgb(this.colors.tertiaryContainer())}get onTertiaryContainer(){return this.getArgb(this.colors.onTertiaryContainer())}get tertiaryFixed(){return this.getArgb(this.colors.tertiaryFixed())}get tertiaryFixedDim(){return this.getArgb(this.colors.tertiaryFixedDim())}get onTertiaryFixed(){return this.getArgb(this.colors.onTertiaryFixed())}get onTertiaryFixedVariant(){return this.getArgb(this.colors.onTertiaryFixedVariant())}get error(){return this.getArgb(this.colors.error())}get errorDim(){const t=this.colors.errorDim();if(void 0===t)throw new Error("`errorDim` color is undefined prior to 2025 spec.");return this.getArgb(t)}get onError(){return this.getArgb(this.colors.onError())}get errorContainer(){return this.getArgb(this.colors.errorContainer())}get onErrorContainer(){return this.getArgb(this.colors.onErrorContainer())}get controlActivated(){return this.getArgb(this.colors.controlActivated())}get controlNormal(){return this.getArgb(this.colors.controlNormal())}get controlHighlight(){return this.getArgb(this.colors.controlHighlight())}get textPrimaryInverse(){return this.getArgb(this.colors.textPrimaryInverse())}get textSecondaryAndTertiaryInverse(){return this.getArgb(this.colors.textSecondaryAndTertiaryInverse())}get textPrimaryInverseDisableOnly(){return this.getArgb(this.colors.textPrimaryInverseDisableOnly())}get textSecondaryAndTertiaryInverseDisabled(){return this.getArgb(this.colors.textSecondaryAndTertiaryInverseDisabled())}get textHintInverse(){return this.getArgb(this.colors.textHintInverse())}},At=class{getPrimaryPalette(t,e,r,a,n){switch(t){case ft.CONTENT:case ft.FIDELITY:return ht.fromHueAndChroma(e.hue,e.chroma);case ft.FRUIT_SALAD:return ht.fromHueAndChroma(I(e.hue-50),48);case ft.MONOCHROME:return ht.fromHueAndChroma(e.hue,0);case ft.NEUTRAL:return ht.fromHueAndChroma(e.hue,12);case ft.RAINBOW:return ht.fromHueAndChroma(e.hue,48);case ft.TONAL_SPOT:return ht.fromHueAndChroma(e.hue,36);case ft.EXPRESSIVE:return ht.fromHueAndChroma(I(e.hue+240),40);case ft.VIBRANT:return ht.fromHueAndChroma(e.hue,200);default:throw new Error(`Unsupported variant: ${t}`)}}getSecondaryPalette(t,e,r,a,n){switch(t){case ft.CONTENT:case ft.FIDELITY:return ht.fromHueAndChroma(e.hue,Math.max(e.chroma-32,.5*e.chroma));case ft.FRUIT_SALAD:return ht.fromHueAndChroma(I(e.hue-50),36);case ft.MONOCHROME:return ht.fromHueAndChroma(e.hue,0);case ft.NEUTRAL:return ht.fromHueAndChroma(e.hue,8);case ft.RAINBOW:case ft.TONAL_SPOT:return ht.fromHueAndChroma(e.hue,16);case ft.EXPRESSIVE:return ht.fromHueAndChroma(Tt.getRotatedHue(e,[0,21,51,121,151,191,271,321,360],[45,95,45,20,45,90,45,45,45]),24);case ft.VIBRANT:return ht.fromHueAndChroma(Tt.getRotatedHue(e,[0,41,61,101,131,181,251,301,360],[18,15,10,12,15,18,15,12,12]),24);default:throw new Error(`Unsupported variant: ${t}`)}}getTertiaryPalette(t,e,r,a,n){switch(t){case ft.CONTENT:return ht.fromHct(nt.fixIfDisliked(new mt(e).analogous(3,6)[2]));case ft.FIDELITY:return ht.fromHct(nt.fixIfDisliked(new mt(e).complement));case ft.FRUIT_SALAD:return ht.fromHueAndChroma(e.hue,36);case ft.MONOCHROME:return ht.fromHueAndChroma(e.hue,0);case ft.NEUTRAL:return ht.fromHueAndChroma(e.hue,16);case ft.RAINBOW:case ft.TONAL_SPOT:return ht.fromHueAndChroma(I(e.hue+60),24);case ft.EXPRESSIVE:return ht.fromHueAndChroma(Tt.getRotatedHue(e,[0,21,51,121,151,191,271,321,360],[120,120,20,45,20,15,20,120,120]),32);case ft.VIBRANT:return ht.fromHueAndChroma(Tt.getRotatedHue(e,[0,41,61,101,131,181,251,301,360],[35,30,20,25,30,35,30,25,25]),32);default:throw new Error(`Unsupported variant: ${t}`)}}getNeutralPalette(t,e,r,a,n){switch(t){case ft.CONTENT:case ft.FIDELITY:return ht.fromHueAndChroma(e.hue,e.chroma/8);case ft.FRUIT_SALAD:return ht.fromHueAndChroma(e.hue,10);case ft.MONOCHROME:return ht.fromHueAndChroma(e.hue,0);case ft.NEUTRAL:return ht.fromHueAndChroma(e.hue,2);case ft.RAINBOW:return ht.fromHueAndChroma(e.hue,0);case ft.TONAL_SPOT:return ht.fromHueAndChroma(e.hue,6);case ft.EXPRESSIVE:return ht.fromHueAndChroma(I(e.hue+15),8);case ft.VIBRANT:return ht.fromHueAndChroma(e.hue,10);default:throw new Error(`Unsupported variant: ${t}`)}}getNeutralVariantPalette(t,e,r,a,n){switch(t){case ft.CONTENT:case ft.FIDELITY:return ht.fromHueAndChroma(e.hue,e.chroma/8+4);case ft.FRUIT_SALAD:return ht.fromHueAndChroma(e.hue,16);case ft.MONOCHROME:return ht.fromHueAndChroma(e.hue,0);case ft.NEUTRAL:return ht.fromHueAndChroma(e.hue,2);case ft.RAINBOW:return ht.fromHueAndChroma(e.hue,0);case ft.TONAL_SPOT:return ht.fromHueAndChroma(e.hue,8);case ft.EXPRESSIVE:return ht.fromHueAndChroma(I(e.hue+15),12);case ft.VIBRANT:return ht.fromHueAndChroma(e.hue,12);default:throw new Error(`Unsupported variant: ${t}`)}}getErrorPalette(t,e,r,a,n){}};const Dt=new At,Ot=new class t extends At{getPrimaryPalette(t,e,r,a,n){switch(t){case ft.NEUTRAL:return ht.fromHueAndChroma(e.hue,a===St.PHONE?rt.isBlue(e.hue)?12:8:rt.isBlue(e.hue)?16:12);case ft.TONAL_SPOT:return ht.fromHueAndChroma(e.hue,a===St.PHONE&&r?26:32);case ft.EXPRESSIVE:return ht.fromHueAndChroma(e.hue,a===St.PHONE?r?36:48:40);case ft.VIBRANT:return ht.fromHueAndChroma(e.hue,a===St.PHONE?74:56);default:return super.getPrimaryPalette(t,e,r,a,n)}}getSecondaryPalette(t,e,r,a,n){switch(t){case ft.NEUTRAL:return ht.fromHueAndChroma(e.hue,a===St.PHONE?rt.isBlue(e.hue)?6:4:rt.isBlue(e.hue)?10:6);case ft.TONAL_SPOT:return ht.fromHueAndChroma(e.hue,16);case ft.EXPRESSIVE:return ht.fromHueAndChroma(Tt.getRotatedHue(e,[0,105,140,204,253,278,300,333,360],[-160,155,-100,96,-96,-156,-165,-160]),a===St.PHONE&&r?16:24);case ft.VIBRANT:return ht.fromHueAndChroma(Tt.getRotatedHue(e,[0,38,105,140,333,360],[-14,10,-14,10,-14]),a===St.PHONE?56:36);default:return super.getSecondaryPalette(t,e,r,a,n)}}getTertiaryPalette(t,e,r,a,n){switch(t){case ft.NEUTRAL:return ht.fromHueAndChroma(Tt.getRotatedHue(e,[0,38,105,161,204,278,333,360],[-32,26,10,-39,24,-15,-32]),a===St.PHONE?20:36);case ft.TONAL_SPOT:return ht.fromHueAndChroma(Tt.getRotatedHue(e,[0,20,71,161,333,360],[-40,48,-32,40,-32]),a===St.PHONE?28:32);case ft.EXPRESSIVE:return ht.fromHueAndChroma(Tt.getRotatedHue(e,[0,105,140,204,253,278,300,333,360],[-165,160,-105,101,-101,-160,-170,-165]),48);case ft.VIBRANT:return ht.fromHueAndChroma(Tt.getRotatedHue(e,[0,38,71,105,140,161,253,333,360],[-72,35,24,-24,62,50,62,-72]),56);default:return super.getTertiaryPalette(t,e,r,a,n)}}static getExpressiveNeutralHue(t){return Tt.getRotatedHue(t,[0,71,124,253,278,300,360],[10,0,10,0,10,0])}static getExpressiveNeutralChroma(e,r,a){const n=t.getExpressiveNeutralHue(e);return a===St.PHONE?r?rt.isYellow(n)?6:14:18:12}static getVibrantNeutralHue(t){return Tt.getRotatedHue(t,[0,38,105,140,333,360],[-14,10,-14,10,-14])}static getVibrantNeutralChroma(e,r){const a=t.getVibrantNeutralHue(e);return r===St.PHONE||rt.isBlue(a)?28:20}getNeutralPalette(e,r,a,n,o){switch(e){case ft.NEUTRAL:return ht.fromHueAndChroma(r.hue,n===St.PHONE?1.4:6);case ft.TONAL_SPOT:return ht.fromHueAndChroma(r.hue,n===St.PHONE?5:10);case ft.EXPRESSIVE:return ht.fromHueAndChroma(t.getExpressiveNeutralHue(r),t.getExpressiveNeutralChroma(r,a,n));case ft.VIBRANT:return ht.fromHueAndChroma(t.getVibrantNeutralHue(r),t.getVibrantNeutralChroma(r,n));default:return super.getNeutralPalette(e,r,a,n,o)}}getNeutralVariantPalette(e,r,a,n,o){switch(e){case ft.NEUTRAL:return ht.fromHueAndChroma(r.hue,2.2*(n===St.PHONE?1.4:6));case ft.TONAL_SPOT:return ht.fromHueAndChroma(r.hue,1.7*(n===St.PHONE?5:10));case ft.EXPRESSIVE:const i=t.getExpressiveNeutralHue(r),s=t.getExpressiveNeutralChroma(r,a,n);return ht.fromHueAndChroma(i,s*(i>=105&&i<125?1.6:2.3));case ft.VIBRANT:const c=t.getVibrantNeutralHue(r),u=t.getVibrantNeutralChroma(r,n);return ht.fromHueAndChroma(c,1.29*u);default:return super.getNeutralVariantPalette(e,r,a,n,o)}}getErrorPalette(t,e,r,a,n){const o=Tt.getPiecewiseHue(e,[0,3,13,23,33,43,153,273,360],[12,22,32,12,22,32,22,12]);switch(t){case ft.NEUTRAL:return ht.fromHueAndChroma(o,a===St.PHONE?50:40);case ft.TONAL_SPOT:return ht.fromHueAndChroma(o,a===St.PHONE?60:48);case ft.EXPRESSIVE:return ht.fromHueAndChroma(o,a===St.PHONE?64:48);case ft.VIBRANT:return ht.fromHueAndChroma(o,a===St.PHONE?80:60);default:return super.getErrorPalette(t,e,r,a,n)}}};function Ht(t){return"2025"===t?Ot:Dt}function xt(t){const e=Y(t),r=z(t),a=j(t),n=[e.toString(16),r.toString(16),a.toString(16)];for(const[t,e]of n.entries())1===e.length&&(n[t]="0"+e);return"#"+n.join("")}function Nt(t){return parseInt(t,16)}var Mt,Ft,Bt,It,Lt,Rt,Vt,Ut,$t,Kt;let Yt=class extends e{constructor(){super(...arguments),Mt.add(this),Ft.set(this,new CSSStyleSheet),Bt.set(this,!1),It.set(this,void 0),Lt.set(this,void 0),Rt.set(this,void 0),Vt.set(this,()=>o(this,Mt,"m",$t).call(this)),this.color="#6750A4",this.variant="content",this.scheme="auto",this.contrast="standard",this.strongFocus=!1,this.density=0,this.motion="standard"}get isDark(){switch(this.scheme){case"light":return!1;case"dark":return!0;default:return o(this,Lt,"f")?.matches??!1}}connectedCallback(){super.connectedCallback(),this.shadowRoot&&!this.shadowRoot.adoptedStyleSheets.includes(o(this,Ft,"f"))&&(this.shadowRoot.adoptedStyleSheets=[...this.shadowRoot.adoptedStyleSheets,o(this,Ft,"f")]),i(this,It,matchMedia("(prefers-color-scheme: light)"),"f"),i(this,Lt,matchMedia("(prefers-color-scheme: dark)"),"f"),i(this,Rt,matchMedia("(forced-colors: active)"),"f"),[o(this,It,"f"),o(this,Lt,"f"),o(this,Rt,"f")].forEach(t=>t.addEventListener("change",o(this,Vt,"f")))}disconnectedCallback(){super.disconnectedCallback(),[o(this,It,"f"),o(this,Lt,"f"),o(this,Rt,"f")].forEach(t=>t?.removeEventListener("change",o(this,Vt,"f"))),i(this,It,i(this,Lt,i(this,Rt,void 0,"f"),"f"),"f")}updated(t){super.updated(t),o(this,Mt,"m",$t).call(this)}firstUpdated(t){super.firstUpdated(t),i(this,Bt,!0,"f")}render(){return r`<slot></slot>`}};Ft=new WeakMap,Bt=new WeakMap,It=new WeakMap,Lt=new WeakMap,Rt=new WeakMap,Vt=new WeakMap,Mt=new WeakSet,Ut=function(t){let e=ft.CONTENT;switch(this.variant){case"expressive":e=ft.EXPRESSIVE;break;case"fidelity":e=ft.FIDELITY;break;case"fruit-salad":e=ft.FRUIT_SALAD;break;case"monochrome":e=ft.MONOCHROME;break;case"neutral":e=ft.NEUTRAL;break;case"rainbow":e=ft.RAINBOW;break;case"tonal-spot":e=ft.TONAL_SPOT;break;case"vibrant":e=ft.VIBRANT}return Tt.from({sourceColorHct:t,isDark:this.isDark,contrastLevel:o(this,Mt,"m",Kt).call(this),variant:e,specVersion:Ct.SPEC_2025,platform:St.PHONE})},$t=function(){const t=function(t){const e=3===(t=t.replace("#","")).length,r=6===t.length,a=8===t.length;if(!e&&!r&&!a)throw new Error("unexpected hex "+t);let n=0,o=0,i=0;return e?(n=Nt(t.slice(0,1).repeat(2)),o=Nt(t.slice(1,2).repeat(2)),i=Nt(t.slice(2,3).repeat(2))):r?(n=Nt(t.slice(0,2)),o=Nt(t.slice(2,4)),i=Nt(t.slice(4,6))):a&&(n=Nt(t.slice(2,4)),o=Nt(t.slice(4,6)),i=Nt(t.slice(6,8))),(255<<24|(255&n)<<16|(255&o)<<8|255&i)>>>0}(this.color),e=o(this,Mt,"m",Ut).call(this,rt.fromInt(t));let r="";for(const t of(new _t).allDynamicColors.filter(t=>!t.name.includes("palette")))r+=`--md-sys-color-${t.name.replace(/_/g,"-").toLowerCase()}: ${xt(t.getArgb(e))};`;if("expressive"===this.motion&&(r+="--md-sys-motion-spring-fast-spatial: 350ms cubic-bezier(0.42, 1.67, 0.21, 0.90);",r+="--md-sys-motion-spring-default-spatial: 500ms cubic-bezier(0.38, 1.21, 0.22, 1.00);",r+="--md-sys-motion-spring-slow-spatial: 650ms cubic-bezier(0.39, 1.29, 0.35, 0.98);",r+="--md-sys-motion-spring-fast-effects: 150ms cubic-bezier(0.31, 0.94, 0.34, 1.00);",r+="--md-sys-motion-spring-default-effects: 200ms cubic-bezier(0.34, 0.80, 0.34, 1.00);",r+="--md-sys-motion-spring-slow-effects: 300ms cubic-bezier(0.34, 0.88, 0.34, 1.00);"),r+=`--md-sys-density-scale: ${this.density};`,r+=`--m3e-scrollbar-thumb-color: ${xt(e.neutralPalette.tone(60))};`,r+=`--m3e-focus-ring-visibility: ${this.strongFocus?"visible":"hidden"};`,o(this,Ft,"f").replaceSync(`:host { ${r} }`),this.parentElement instanceof HTMLBodyElement){const t=getComputedStyle(this);o(this,Rt,"f")?.matches?this.parentElement.style.backgroundColor=this.parentElement.style.color=this.parentElement.ownerDocument.documentElement.style.scrollbarColor=this.parentElement.style.scrollbarColor="":(this.parentElement.style.backgroundColor=t.getPropertyValue("--md-sys-color-background"),this.parentElement.style.color=t.getPropertyValue("--md-sys-color-on-background"),this.parentElement.ownerDocument.documentElement.style.scrollbarColor=this.parentElement.style.scrollbarColor=`${t.getPropertyValue("--m3e-scrollbar-thumb-color")} ${t.getPropertyValue("--m3e-scrollbar-track-color")}`)}o(this,Bt,"f")&&this.dispatchEvent(new Event("change",{bubbles:!0}))},Kt=function(){switch(this.contrast){case"high":return 1;case"medium":return.5;default:return 0}},Yt.styles=t`
|
|
467
62
|
:host {
|
|
468
63
|
display: contents;
|
|
469
64
|
font-size: ${a.typescale.standard.body.large.fontSize};
|
|
@@ -471,5 +66,5 @@ function Lt(t){const e=z(t),r=q(t),a=j(t),n=[e.toString(16),r.toString(16),a.toS
|
|
|
471
66
|
line-height: ${a.typescale.standard.body.large.lineHeight};
|
|
472
67
|
letter-spacing: ${a.typescale.standard.body.large.tracking};
|
|
473
68
|
}
|
|
474
|
-
`,n([
|
|
69
|
+
`,n([H()],Yt.prototype,"color",void 0),n([H()],Yt.prototype,"variant",void 0),n([H()],Yt.prototype,"scheme",void 0),n([H()],Yt.prototype,"contrast",void 0),n([H({attribute:"strong-focus",type:Boolean})],Yt.prototype,"strongFocus",void 0),n([H({type:Number})],Yt.prototype,"density",void 0),n([H()],Yt.prototype,"motion",void 0),Yt=n([(t=>(e,r)=>{void 0!==r?r.addInitializer(()=>{customElements.define(t,e)}):customElements.define(t,e)})("m3e-theme")],Yt);export{Yt as M3eThemeElement};
|
|
475
70
|
//# sourceMappingURL=index.min.js.map
|