@m3e/theme 1.0.5 → 1.1.0

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.min.js CHANGED
@@ -57,7 +57,7 @@ const E={attribute:!0,type:String,converter:_,reflect:!1,hasChanged:A},x=(t=E,e,
57
57
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
58
58
  * See the License for the specific language governing permissions and
59
59
  * limitations under the License.
60
- */const $=[[.41233895,.35762064,.18051042],[.2126,.7152,.0722],[.01932141,.11916382,.95034478]],B=[[3.2413774792388685,-1.5376652402851851,-.49885366846268053],[-.9691452513005321,1.8758853451067872,.04156585616912061],[.05562093689691305,-.20395524564742123,1.0571799111220335]],V=[95.047,100,108.883];function U(t,e,r){return(255<<24|(255&t)<<16|(255&e)<<8|255&r)>>>0}function H(t){return U(G(t[0]),G(t[1]),G(t[2]))}function N(t){return t>>16&255}function z(t){return t>>8&255}function q(t){return 255&t}function j(t){const e=function(t){return R([W(N(t)),W(z(t)),W(q(t))],$)}(t)[1];return 116*J(e/100)-16}function K(t){return 100*function(t){const e=216/24389,r=24389/27,a=t*t*t;return a>e?a:(116*t-16)/r}
60
+ */const $=[[.41233895,.35762064,.18051042],[.2126,.7152,.0722],[.01932141,.11916382,.95034478]],B=[[3.2413774792388685,-1.5376652402851851,-.49885366846268053],[-.9691452513005321,1.8758853451067872,.04156585616912061],[.05562093689691305,-.20395524564742123,1.0571799111220335]],V=[95.047,100,108.883];function H(t,e,r){return(255<<24|(255&t)<<16|(255&e)<<8|255&r)>>>0}function U(t){return H(G(t[0]),G(t[1]),G(t[2]))}function N(t){return t>>16&255}function z(t){return t>>8&255}function q(t){return 255&t}function j(t){const e=function(t){return R([W(N(t)),W(z(t)),W(q(t))],$)}(t)[1];return 116*J(e/100)-16}function K(t){return 100*function(t){const e=216/24389,r=24389/27,a=t*t*t;return a>e?a:(116*t-16)/r}
61
61
  /**
62
62
  * @license
63
63
  * Copyright 2021 Google LLC
@@ -90,7 +90,7 @@ const E={attribute:!0,type:String,converter:_,reflect:!1,hasChanged:A},x=(t=E,e,
90
90
  * See the License for the specific language governing permissions and
91
91
  * limitations under the License.
92
92
  */
93
- class Z{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 Z.fromIntInViewingConditions(t,X.DEFAULT)}static fromIntInViewingConditions(t,e){const r=(65280&t)>>8,a=255&t,n=W((16711680&t)>>16),o=W(r),i=W(a),s=.41233895*n+.35762064*o+.18051042*i,c=.2126*n+.7152*o+.0722*i,h=.01932141*n+.11916382*o+.95034478*i,l=.401288*s+.650173*c-.051461*h,u=-.250268*s+1.204414*c+.045854*h,d=-.002079*s+.048952*c+.953127*h,m=e.rgbD[0]*l,g=e.rgbD[1]*u,f=e.rgbD[2]*d,p=Math.pow(e.fl*Math.abs(m)/100,.42),y=Math.pow(e.fl*Math.abs(g)/100,.42),b=Math.pow(e.fl*Math.abs(f)/100,.42),P=400*I(m)*p/(p+27.13),w=400*I(g)*y/(y+27.13),C=400*I(f)*b/(b+27.13),M=(11*P+-12*w+C)/11,k=(P+w-2*C)/9,v=(20*P+20*w+21*C)/20,_=(40*P+20*w+C)/20,A=180*Math.atan2(k,M)/Math.PI,D=A<0?A+360:A>=360?A-360:A,S=D*Math.PI/180,E=_*e.nbb,x=100*Math.pow(E/e.aw,e.c*e.z),T=4/e.c*Math.sqrt(x/100)*(e.aw+4)*e.fLRoot,F=D<20.14?D+360:D,O=5e4/13*(.25*(Math.cos(F*Math.PI/180+2)+3.8))*e.nc*e.ncb*Math.sqrt(M*M+k*k)/(v+.305),L=Math.pow(O,.9)*Math.pow(1.64-Math.pow(.29,e.n),.73),R=L*Math.sqrt(x/100),$=R*e.fLRoot,B=50*Math.sqrt(L*e.c/(e.aw+4)),V=(1+100*.007)*x/(1+.007*x),U=1/.0228*Math.log(1+.0228*$),H=U*Math.cos(S),N=U*Math.sin(S);return new Z(D,R,x,T,$,B,V,H,N)}static fromJch(t,e,r){return Z.fromJchInViewingConditions(t,e,r,X.DEFAULT)}static fromJchInViewingConditions(t,e,r,a){const n=4/a.c*Math.sqrt(t/100)*(a.aw+4)*a.fLRoot,o=e*a.fLRoot,i=e/Math.sqrt(t/100),s=50*Math.sqrt(i*a.c/(a.aw+4)),c=r*Math.PI/180,h=(1+100*.007)*t/(1+.007*t),l=1/.0228*Math.log(1+.0228*o),u=l*Math.cos(c),d=l*Math.sin(c);return new Z(r,e,t,n,o,s,h,u,d)}static fromUcs(t,e,r){return Z.fromUcsInViewingConditions(t,e,r,X.DEFAULT)}static fromUcsInViewingConditions(t,e,r,a){const n=e,o=r,i=Math.sqrt(n*n+o*o),s=(Math.exp(.0228*i)-1)/.0228/a.fLRoot;let c=Math.atan2(o,n)*(180/Math.PI);c<0&&(c+=360);const h=t/(1-.007*(t-100));return Z.fromJchInViewingConditions(h,s,c,a)}toInt(){return this.viewed(X.DEFAULT)}viewed(t){const e=0===this.chroma||0===this.j?0:this.chroma/Math.sqrt(this.j/100),r=Math.pow(e/Math.pow(1.64-Math.pow(.29,t.n),.73),1/.9),a=this.hue*Math.PI/180,n=.25*(Math.cos(a+2)+3.8),o=t.aw*Math.pow(this.j/100,1/t.c/t.z),i=n*(5e4/13)*t.nc*t.ncb,s=o/t.nbb,c=Math.sin(a),h=Math.cos(a),l=23*(s+.305)*r/(23*i+11*r*h+108*r*c),u=l*h,d=l*c,m=(460*s+451*u+288*d)/1403,g=(460*s-891*u-261*d)/1403,f=(460*s-220*u-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),b=Math.max(0,27.13*Math.abs(g)/(400-Math.abs(g))),P=I(g)*(100/t.fl)*Math.pow(b,1/.42),w=Math.max(0,27.13*Math.abs(f)/(400-Math.abs(f))),C=I(f)*(100/t.fl)*Math.pow(w,1/.42),M=y/t.rgbD[0],k=P/t.rgbD[1],v=C/t.rgbD[2],_=function(t,e,r){const a=B,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(G(n),G(o),G(i))}(1.86206786*M-1.01125463*k+.14918677*v,.38752654*M+.62144744*k-.00897398*v,-.0158415*M-.03412294*k+1.04996444*v);return _}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,l=Math.pow(a.fl*Math.abs(s)/100,.42),u=Math.pow(a.fl*Math.abs(c)/100,.42),d=Math.pow(a.fl*Math.abs(h)/100,.42),m=400*I(s)*l/(l+27.13),g=400*I(c)*u/(u+27.13),f=400*I(h)*d/(d+27.13),p=(11*m+-12*g+f)/11,y=(m+g-2*f)/9,b=(20*m+20*g+21*f)/20,P=(40*m+20*g+f)/20,w=180*Math.atan2(y,p)/Math.PI,C=w<0?w+360:w>=360?w-360:w,M=C*Math.PI/180,k=P*a.nbb,v=100*Math.pow(k/a.aw,a.c*a.z),_=4/a.c*Math.sqrt(v/100)*(a.aw+4)*a.fLRoot,A=C<20.14?C+360:C,D=5e4/13*(1/4*(Math.cos(A*Math.PI/180+2)+3.8))*a.nc*a.ncb*Math.sqrt(p*p+y*y)/(b+.305),S=Math.pow(D,.9)*Math.pow(1.64-Math.pow(.29,a.n),.73),E=S*Math.sqrt(v/100),x=E*a.fLRoot,T=50*Math.sqrt(S*a.c/(a.aw+4)),F=(1+100*.007)*v/(1+.007*v),O=Math.log(1+.0228*x)/.0228,L=O*Math.cos(M),R=O*Math.sin(M);return new Z(C,E,v,_,x,T,F,L,R)}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),l=23*(s+.305)*r/(23*i+11*r*h+108*r*c),u=l*h,d=l*c,m=(460*s+451*u+288*d)/1403,g=(460*s-891*u-261*d)/1403,f=(460*s-220*u-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),b=Math.max(0,27.13*Math.abs(g)/(400-Math.abs(g))),P=I(g)*(100/t.fl)*Math.pow(b,1/.42),w=Math.max(0,27.13*Math.abs(f)/(400-Math.abs(f))),C=I(f)*(100/t.fl)*Math.pow(w,1/.42),M=y/t.rgbD[0],k=P/t.rgbD[1],v=C/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]}}
93
+ class Z{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 Z.fromIntInViewingConditions(t,X.DEFAULT)}static fromIntInViewingConditions(t,e){const r=(65280&t)>>8,a=255&t,n=W((16711680&t)>>16),o=W(r),i=W(a),s=.41233895*n+.35762064*o+.18051042*i,c=.2126*n+.7152*o+.0722*i,h=.01932141*n+.11916382*o+.95034478*i,l=.401288*s+.650173*c-.051461*h,u=-.250268*s+1.204414*c+.045854*h,d=-.002079*s+.048952*c+.953127*h,m=e.rgbD[0]*l,g=e.rgbD[1]*u,f=e.rgbD[2]*d,p=Math.pow(e.fl*Math.abs(m)/100,.42),y=Math.pow(e.fl*Math.abs(g)/100,.42),b=Math.pow(e.fl*Math.abs(f)/100,.42),P=400*I(m)*p/(p+27.13),w=400*I(g)*y/(y+27.13),C=400*I(f)*b/(b+27.13),M=(11*P+-12*w+C)/11,k=(P+w-2*C)/9,v=(20*P+20*w+21*C)/20,_=(40*P+20*w+C)/20,A=180*Math.atan2(k,M)/Math.PI,D=A<0?A+360:A>=360?A-360:A,S=D*Math.PI/180,E=_*e.nbb,x=100*Math.pow(E/e.aw,e.c*e.z),T=4/e.c*Math.sqrt(x/100)*(e.aw+4)*e.fLRoot,F=D<20.14?D+360:D,O=5e4/13*(.25*(Math.cos(F*Math.PI/180+2)+3.8))*e.nc*e.ncb*Math.sqrt(M*M+k*k)/(v+.305),L=Math.pow(O,.9)*Math.pow(1.64-Math.pow(.29,e.n),.73),R=L*Math.sqrt(x/100),$=R*e.fLRoot,B=50*Math.sqrt(L*e.c/(e.aw+4)),V=(1+100*.007)*x/(1+.007*x),H=1/.0228*Math.log(1+.0228*$),U=H*Math.cos(S),N=H*Math.sin(S);return new Z(D,R,x,T,$,B,V,U,N)}static fromJch(t,e,r){return Z.fromJchInViewingConditions(t,e,r,X.DEFAULT)}static fromJchInViewingConditions(t,e,r,a){const n=4/a.c*Math.sqrt(t/100)*(a.aw+4)*a.fLRoot,o=e*a.fLRoot,i=e/Math.sqrt(t/100),s=50*Math.sqrt(i*a.c/(a.aw+4)),c=r*Math.PI/180,h=(1+100*.007)*t/(1+.007*t),l=1/.0228*Math.log(1+.0228*o),u=l*Math.cos(c),d=l*Math.sin(c);return new Z(r,e,t,n,o,s,h,u,d)}static fromUcs(t,e,r){return Z.fromUcsInViewingConditions(t,e,r,X.DEFAULT)}static fromUcsInViewingConditions(t,e,r,a){const n=e,o=r,i=Math.sqrt(n*n+o*o),s=(Math.exp(.0228*i)-1)/.0228/a.fLRoot;let c=Math.atan2(o,n)*(180/Math.PI);c<0&&(c+=360);const h=t/(1-.007*(t-100));return Z.fromJchInViewingConditions(h,s,c,a)}toInt(){return this.viewed(X.DEFAULT)}viewed(t){const e=0===this.chroma||0===this.j?0:this.chroma/Math.sqrt(this.j/100),r=Math.pow(e/Math.pow(1.64-Math.pow(.29,t.n),.73),1/.9),a=this.hue*Math.PI/180,n=.25*(Math.cos(a+2)+3.8),o=t.aw*Math.pow(this.j/100,1/t.c/t.z),i=n*(5e4/13)*t.nc*t.ncb,s=o/t.nbb,c=Math.sin(a),h=Math.cos(a),l=23*(s+.305)*r/(23*i+11*r*h+108*r*c),u=l*h,d=l*c,m=(460*s+451*u+288*d)/1403,g=(460*s-891*u-261*d)/1403,f=(460*s-220*u-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),b=Math.max(0,27.13*Math.abs(g)/(400-Math.abs(g))),P=I(g)*(100/t.fl)*Math.pow(b,1/.42),w=Math.max(0,27.13*Math.abs(f)/(400-Math.abs(f))),C=I(f)*(100/t.fl)*Math.pow(w,1/.42),M=y/t.rgbD[0],k=P/t.rgbD[1],v=C/t.rgbD[2],_=function(t,e,r){const a=B,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 H(G(n),G(o),G(i))}(1.86206786*M-1.01125463*k+.14918677*v,.38752654*M+.62144744*k-.00897398*v,-.0158415*M-.03412294*k+1.04996444*v);return _}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,l=Math.pow(a.fl*Math.abs(s)/100,.42),u=Math.pow(a.fl*Math.abs(c)/100,.42),d=Math.pow(a.fl*Math.abs(h)/100,.42),m=400*I(s)*l/(l+27.13),g=400*I(c)*u/(u+27.13),f=400*I(h)*d/(d+27.13),p=(11*m+-12*g+f)/11,y=(m+g-2*f)/9,b=(20*m+20*g+21*f)/20,P=(40*m+20*g+f)/20,w=180*Math.atan2(y,p)/Math.PI,C=w<0?w+360:w>=360?w-360:w,M=C*Math.PI/180,k=P*a.nbb,v=100*Math.pow(k/a.aw,a.c*a.z),_=4/a.c*Math.sqrt(v/100)*(a.aw+4)*a.fLRoot,A=C<20.14?C+360:C,D=5e4/13*(1/4*(Math.cos(A*Math.PI/180+2)+3.8))*a.nc*a.ncb*Math.sqrt(p*p+y*y)/(b+.305),S=Math.pow(D,.9)*Math.pow(1.64-Math.pow(.29,a.n),.73),E=S*Math.sqrt(v/100),x=E*a.fLRoot,T=50*Math.sqrt(S*a.c/(a.aw+4)),F=(1+100*.007)*v/(1+.007*v),O=Math.log(1+.0228*x)/.0228,L=O*Math.cos(M),R=O*Math.sin(M);return new Z(C,E,v,_,x,T,F,L,R)}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),l=23*(s+.305)*r/(23*i+11*r*h+108*r*c),u=l*h,d=l*c,m=(460*s+451*u+288*d)/1403,g=(460*s-891*u-261*d)/1403,f=(460*s-220*u-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),b=Math.max(0,27.13*Math.abs(g)/(400-Math.abs(g))),P=I(g)*(100/t.fl)*Math.pow(b,1/.42),w=Math.max(0,27.13*Math.abs(f)/(400-Math.abs(f))),C=I(f)*(100/t.fl)*Math.pow(w,1/.42),M=y/t.rgbD[0],k=P/t.rgbD[1],v=C/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
94
  /**
95
95
  * @license
96
96
  * Copyright 2021 Google LLC
@@ -106,7 +106,7 @@ class Z{constructor(t,e,r,a,n,o,i,s,c){this.hue=t,this.chroma=e,this.j=r,this.q=
106
106
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
107
107
  * See the License for the specific language governing permissions and
108
108
  * limitations under the License.
109
- */class Q{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,Q.SCALED_DISCOUNT_FROM_LINRGB),r=Q.chromaticAdaptation(e[0]),a=Q.chromaticAdaptation(e[1]),n=Q.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 Q.sanitizeRadians(e-t)<Q.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=Q.intercept(t[a],e,r[a]);return Q.lerpPoint(t,n,r)}static isBounded(t){return 0<=t&&t<=100}static nthVertex(t,e){const r=Q.Y_FROM_LINRGB[0],a=Q.Y_FROM_LINRGB[1],n=Q.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 Q.isBounded(c)?[c,e,s]:[-1,-1,-1]}if(e<8){const e=o,s=i,c=(t-s*r-e*n)/a;return Q.isBounded(c)?[s,c,e]:[-1,-1,-1]}{const e=o,s=i,c=(t-e*r-s*a)/n;return Q.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=Q.nthVertex(t,c);if(h[0]<0)continue;const l=Q.hueOf(h);i?(s||Q.areInCyclicOrder(n,l,o))&&(s=!1,Q.areInCyclicOrder(n,e,l)?(a=h,o=l):(r=h,n=l)):(r=h,a=h,n=l,o=l,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=Q.bisectToSegment(t,e);let a=r[0],n=Q.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=Q.criticalPlaneBelow(Q.trueDelinearized(a[t])),i=Q.criticalPlaneAbove(Q.trueDelinearized(o[t]))):(r=Q.criticalPlaneAbove(Q.trueDelinearized(a[t])),i=Q.criticalPlaneBelow(Q.trueDelinearized(o[t])));for(let s=0;s<8&&!(Math.abs(i-r)<=1);s++){const s=Math.floor((r+i)/2),c=Q.CRITICAL_PLANES[s],h=Q.setCoordinate(a,c,o,t),l=Q.hueOf(h);Q.areInCyclicOrder(n,e,l)?(o=h,i=s):(a=h,n=l,r=s)}}return Q.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=X.DEFAULT,o=1/Math.pow(1.64-Math.pow(.29,n.n),.73),i=.25*(Math.cos(t+2)+3.8)*(5e4/13)*n.nc*n.ncb,s=Math.sin(t),c=Math.cos(t);for(let t=0;t<5;t++){const h=a/100,l=0===e||0===a?0:e/Math.sqrt(h),u=Math.pow(l*o,1/.9),d=n.aw*Math.pow(h,1/n.c/n.z)/n.nbb,m=23*(d+.305)*u/(23*i+11*u*c+108*u*s),g=m*c,f=m*s,p=(460*d+451*g+288*f)/1403,y=(460*d-891*g-261*f)/1403,b=(460*d-220*g-6300*f)/1403,P=R([Q.inverseChromaticAdaptation(p),Q.inverseChromaticAdaptation(y),Q.inverseChromaticAdaptation(b)],Q.LINRGB_FROM_SCALED_DISCOUNT);if(P[0]<0||P[1]<0||P[2]<0)return 0;const w=Q.Y_FROM_LINRGB[0],C=Q.Y_FROM_LINRGB[1],M=Q.Y_FROM_LINRGB[2],k=w*P[0]+C*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:H(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=G(K(t));return U(e,e,e)}(r);const a=(t=L(t))/180*Math.PI,n=K(r),o=Q.findResultByJ(a,e,n);if(0!==o)return o;return H(Q.bisectToLimit(n,a))}static solveToCam(t,e,r){return Z.fromInt(Q.solveToInt(t,e,r))}}Q.SCALED_DISCOUNT_FROM_LINRGB=[[.001200833568784504,.002389694492170889,.0002795742885861124],[.0005891086651375999,.0029785502573438758,.0003270666104008398],[.00010146692491640572,.0005364214359186694,.0032979401770712076]],Q.LINRGB_FROM_SCALED_DISCOUNT=[[1373.2198709594231,-1100.4251190754821,-7.278681089101213],[-271.815969077903,559.6580465940733,-32.46047482791194],[1.9622899599665666,-57.173814538844006,308.7233197812385]],Q.Y_FROM_LINRGB=[.2126,.7152,.0722],Q.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];
109
+ */class Q{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,Q.SCALED_DISCOUNT_FROM_LINRGB),r=Q.chromaticAdaptation(e[0]),a=Q.chromaticAdaptation(e[1]),n=Q.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 Q.sanitizeRadians(e-t)<Q.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=Q.intercept(t[a],e,r[a]);return Q.lerpPoint(t,n,r)}static isBounded(t){return 0<=t&&t<=100}static nthVertex(t,e){const r=Q.Y_FROM_LINRGB[0],a=Q.Y_FROM_LINRGB[1],n=Q.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 Q.isBounded(c)?[c,e,s]:[-1,-1,-1]}if(e<8){const e=o,s=i,c=(t-s*r-e*n)/a;return Q.isBounded(c)?[s,c,e]:[-1,-1,-1]}{const e=o,s=i,c=(t-e*r-s*a)/n;return Q.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=Q.nthVertex(t,c);if(h[0]<0)continue;const l=Q.hueOf(h);i?(s||Q.areInCyclicOrder(n,l,o))&&(s=!1,Q.areInCyclicOrder(n,e,l)?(a=h,o=l):(r=h,n=l)):(r=h,a=h,n=l,o=l,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=Q.bisectToSegment(t,e);let a=r[0],n=Q.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=Q.criticalPlaneBelow(Q.trueDelinearized(a[t])),i=Q.criticalPlaneAbove(Q.trueDelinearized(o[t]))):(r=Q.criticalPlaneAbove(Q.trueDelinearized(a[t])),i=Q.criticalPlaneBelow(Q.trueDelinearized(o[t])));for(let s=0;s<8&&!(Math.abs(i-r)<=1);s++){const s=Math.floor((r+i)/2),c=Q.CRITICAL_PLANES[s],h=Q.setCoordinate(a,c,o,t),l=Q.hueOf(h);Q.areInCyclicOrder(n,e,l)?(o=h,i=s):(a=h,n=l,r=s)}}return Q.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=X.DEFAULT,o=1/Math.pow(1.64-Math.pow(.29,n.n),.73),i=.25*(Math.cos(t+2)+3.8)*(5e4/13)*n.nc*n.ncb,s=Math.sin(t),c=Math.cos(t);for(let t=0;t<5;t++){const h=a/100,l=0===e||0===a?0:e/Math.sqrt(h),u=Math.pow(l*o,1/.9),d=n.aw*Math.pow(h,1/n.c/n.z)/n.nbb,m=23*(d+.305)*u/(23*i+11*u*c+108*u*s),g=m*c,f=m*s,p=(460*d+451*g+288*f)/1403,y=(460*d-891*g-261*f)/1403,b=(460*d-220*g-6300*f)/1403,P=R([Q.inverseChromaticAdaptation(p),Q.inverseChromaticAdaptation(y),Q.inverseChromaticAdaptation(b)],Q.LINRGB_FROM_SCALED_DISCOUNT);if(P[0]<0||P[1]<0||P[2]<0)return 0;const w=Q.Y_FROM_LINRGB[0],C=Q.Y_FROM_LINRGB[1],M=Q.Y_FROM_LINRGB[2],k=w*P[0]+C*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:U(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=G(K(t));return H(e,e,e)}(r);const a=(t=L(t))/180*Math.PI,n=K(r),o=Q.findResultByJ(a,e,n);if(0!==o)return o;return U(Q.bisectToLimit(n,a))}static solveToCam(t,e,r){return Z.fromInt(Q.solveToInt(t,e,r))}}Q.SCALED_DISCOUNT_FROM_LINRGB=[[.001200833568784504,.002389694492170889,.0002795742885861124],[.0005891086651375999,.0029785502573438758,.0003270666104008398],[.00010146692491640572,.0005364214359186694,.0032979401770712076]],Q.LINRGB_FROM_SCALED_DISCOUNT=[[1373.2198709594231,-1100.4251190754821,-7.278681089101213],[-271.815969077903,559.6580465940733,-32.46047482791194],[1.9622899599665666,-57.173814538844006,308.7233197812385]],Q.Y_FROM_LINRGB=[.2126,.7152,.0722],Q.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
110
  /**
111
111
  * @license
112
112
  * Copyright 2021 Google LLC
@@ -335,13 +335,5 @@ class vt extends Ct{constructor(t,e,r){super({sourceColorArgb:t.toInt(),variant:
335
335
  * See the License for the specific language governing permissions and
336
336
  * limitations under the License.
337
337
  */
338
- function _t(t){const e=N(t),r=z(t),a=q(t),n=[e.toString(16),r.toString(16),a.toString(16)];for(const[t,e]of n.entries())1===e.length&&(n[t]="0"+e);return"#"+n.join("")}function At(t){return parseInt(t,16)}vt.hues=[0,41,61,101,131,181,251,301,360],vt.secondaryRotations=[18,15,10,12,15,18,15,12,12],vt.tertiaryRotations=[35,30,20,25,30,35,30,25,25];let Dt=class extends e{constructor(){super(...arguments),ht.add(this),lt.set(this,new CSSStyleSheet),ut.set(this,!1),dt.set(this,void 0),mt.set(this,void 0),gt.set(this,void 0),ft.set(this,()=>o(this,ht,"m",pt).call(this)),this.color="#6750A4",this.scheme="auto",this.contrast="standard",this.strongFocus=!1,this.density=0,this.motion="standard"}get isDark(){switch(this.scheme){case"light":return!1;case"dark":return!0;default:return o(this,mt,"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,dt,matchMedia("(prefers-color-scheme: light)"),"f"),i(this,mt,matchMedia("(prefers-color-scheme: dark)"),"f"),i(this,gt,matchMedia("(forced-colors: active)"),"f"),[o(this,dt,"f"),o(this,mt,"f"),o(this,gt,"f")].forEach(t=>t.addEventListener("change",o(this,ft,"f")))}disconnectedCallback(){super.disconnectedCallback(),[o(this,dt,"f"),o(this,mt,"f"),o(this,gt,"f")].forEach(t=>t?.removeEventListener("change",o(this,ft,"f"))),i(this,dt,i(this,mt,i(this,gt,void 0,"f"),"f"),"f")}updated(t){super.updated(t),o(this,ht,"m",pt).call(this)}firstUpdated(t){super.firstUpdated(t),i(this,ut,!0,"f")}render(){return r`<slot></slot>`}};lt=new WeakMap,ut=new WeakMap,dt=new WeakMap,mt=new WeakMap,gt=new WeakMap,ft=new WeakMap,ht=new WeakSet,pt=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=At(t.slice(0,1).repeat(2)),o=At(t.slice(1,2).repeat(2)),i=At(t.slice(2,3).repeat(2))):r?(n=At(t.slice(0,2)),o=At(t.slice(2,4)),i=At(t.slice(4,6))):a&&(n=At(t.slice(2,4)),o=At(t.slice(4,6)),i=At(t.slice(6,8))),(255<<24|(255&n)<<16|(255&o)<<8|255&i)>>>0}(this.color),e=Mt.of(t),r=new Ct({sourceColorArgb:t,variant:1,contrastLevel:o(this,ht,"m",yt).call(this),isDark:this.isDark,primaryPalette:e.a1,secondaryPalette:e.a2,tertiaryPalette:e.a3,neutralPalette:e.n1,neutralVariantPalette:e.n2});let a="";for(const t in wt)if(!t.endsWith("PaletteKeyColor")){const e=wt[t];e instanceof at&&(a+=`--md-sys-color-${t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}: ${_t(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: ${_t(r.neutralPalette.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,ut,"f")&&this.dispatchEvent(new Event("change",{bubbles:!0}))},yt=function(){switch(this.contrast){case"high":return 1;case"medium":return.5;default:return 0}},Dt.styles=t`
339
- :host {
340
- display: contents;
341
- font-size: ${a.typescale.standard.body.large.fontSize};
342
- font-weight: ${a.typescale.standard.body.large.fontWeight};
343
- line-height: ${a.typescale.standard.body.large.lineHeight};
344
- letter-spacing: ${a.typescale.standard.body.large.tracking};
345
- }
346
- `,n([T()],Dt.prototype,"color",void 0),n([T()],Dt.prototype,"scheme",void 0),n([T()],Dt.prototype,"contrast",void 0),n([T({attribute:"strong-focus",type:Boolean})],Dt.prototype,"strongFocus",void 0),n([T({type:Number})],Dt.prototype,"density",void 0),n([T()],Dt.prototype,"motion",void 0),Dt=n([(t=>(e,r)=>{void 0!==r?r.addInitializer(()=>{customElements.define(t,e)}):customElements.define(t,e)})("m3e-theme")],Dt);export{Dt as M3eThemeElement};
338
+ function _t(t){const e=N(t),r=z(t),a=q(t),n=[e.toString(16),r.toString(16),a.toString(16)];for(const[t,e]of n.entries())1===e.length&&(n[t]="0"+e);return"#"+n.join("")}function At(t){return parseInt(t,16)}vt.hues=[0,41,61,101,131,181,251,301,360],vt.secondaryRotations=[18,15,10,12,15,18,15,12,12],vt.tertiaryRotations=[35,30,20,25,30,35,30,25,25];let Dt=class extends e{constructor(){super(...arguments),ht.add(this),lt.set(this,new CSSStyleSheet),ut.set(this,!1),dt.set(this,void 0),mt.set(this,void 0),gt.set(this,void 0),ft.set(this,()=>o(this,ht,"m",pt).call(this,!0)),this.color="#6750A4",this.scheme="auto",this.contrast="standard",this.strongFocus=!1,this.density=0,this.motion="standard"}get isDark(){switch(this.scheme){case"light":return!1;case"dark":return!0;default:return o(this,mt,"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,dt,matchMedia("(prefers-color-scheme: light)"),"f"),i(this,mt,matchMedia("(prefers-color-scheme: dark)"),"f"),i(this,gt,matchMedia("(forced-colors: active)"),"f"),[o(this,dt,"f"),o(this,mt,"f"),o(this,gt,"f")].forEach(t=>t.addEventListener("change",o(this,ft,"f")))}disconnectedCallback(){super.disconnectedCallback(),[o(this,dt,"f"),o(this,mt,"f"),o(this,gt,"f")].forEach(t=>t?.removeEventListener("change",o(this,ft,"f"))),i(this,dt,i(this,mt,i(this,gt,void 0,"f"),"f"),"f")}updated(t){super.updated(t),o(this,ht,"m",pt).call(this,o(this,ut,"f")&&["color","scheme","contrast"].some(e=>t.has(e)))}firstUpdated(t){super.firstUpdated(t),i(this,ut,!0,"f")}render(){return r`<slot></slot>`}};lt=new WeakMap,ut=new WeakMap,dt=new WeakMap,mt=new WeakMap,gt=new WeakMap,ft=new WeakMap,ht=new WeakSet,pt=function(t){const e=function(t){const e=3===(t=t.replace("#","")).length,r=6===t.length,a=8===t.length;if(!e&&!r&&!a)throw new Error("unexpected hex "+t);let n=0,o=0,i=0;return e?(n=At(t.slice(0,1).repeat(2)),o=At(t.slice(1,2).repeat(2)),i=At(t.slice(2,3).repeat(2))):r?(n=At(t.slice(0,2)),o=At(t.slice(2,4)),i=At(t.slice(4,6))):a&&(n=At(t.slice(2,4)),o=At(t.slice(4,6)),i=At(t.slice(6,8))),(255<<24|(255&n)<<16|(255&o)<<8|255&i)>>>0}(this.color),r=Mt.of(e),a=new Ct({sourceColorArgb:e,variant:1,contrastLevel:o(this,ht,"m",yt).call(this),isDark:this.isDark,primaryPalette:r.a1,secondaryPalette:r.a2,tertiaryPalette:r.a3,neutralPalette:r.n1,neutralVariantPalette:r.n2});let n="";for(const t in wt)if(!t.endsWith("PaletteKeyColor")){const e=wt[t];e instanceof at&&(n+=`--md-sys-color-${t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}: ${_t(e.getArgb(a))};`)}if("expressive"===this.motion&&(n+="--md-sys-motion-spring-fast-spatial: 350ms cubic-bezier(0.42, 1.67, 0.21, 0.90);",n+="--md-sys-motion-spring-default-spatial: 500ms cubic-bezier(0.38, 1.21, 0.22, 1.00);",n+="--md-sys-motion-spring-slow-spatial: 650ms cubic-bezier(0.39, 1.29, 0.35, 0.98);",n+="--md-sys-motion-spring-fast-effects: 150ms cubic-bezier(0.31, 0.94, 0.34, 1.00);",n+="--md-sys-motion-spring-default-effects: 200ms cubic-bezier(0.34, 0.80, 0.34, 1.00);",n+="--md-sys-motion-spring-slow-effects: 300ms cubic-bezier(0.34, 0.88, 0.34, 1.00);"),n+=`--md-sys-density-scale: ${this.density};`,n+=`--m3e-scrollbar-thumb-color: ${_t(a.neutralPalette.tone(60))};`,n+=`--m3e-focus-ring-visibility: ${this.strongFocus?"visible":"hidden"};`,o(this,lt,"f").replaceSync(`:host { ${n} }`),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,ut,"f")&&this.dispatchEvent(new Event("change",{bubbles:!0})),t&&document.body.offsetHeight},yt=function(){switch(this.contrast){case"high":return 1;case"medium":return.5;default:return 0}},Dt.styles=t`:host { display: contents; font-size: ${a.typescale.standard.body.large.fontSize}; font-weight: ${a.typescale.standard.body.large.fontWeight}; line-height: ${a.typescale.standard.body.large.lineHeight}; letter-spacing: ${a.typescale.standard.body.large.tracking}; }`,n([T()],Dt.prototype,"color",void 0),n([T()],Dt.prototype,"scheme",void 0),n([T()],Dt.prototype,"contrast",void 0),n([T({attribute:"strong-focus",type:Boolean})],Dt.prototype,"strongFocus",void 0),n([T({type:Number})],Dt.prototype,"density",void 0),n([T()],Dt.prototype,"motion",void 0),Dt=n([(t=>(e,r)=>{void 0!==r?r.addInitializer(()=>{customElements.define(t,e)}):customElements.define(t,e)})("m3e-theme")],Dt);export{Dt as M3eThemeElement};
347
339
  //# sourceMappingURL=index.min.js.map