Module 153469

2,312 characters · in no known chunk
Dependencies
Required by (2)
Lazily required by (0)none
Lazily requires (0)none
Source Raw
function(e,t,n){"use strict";n.d(t,{Gc:()=>l,V9:()=>v,dY:()=>S,hK:()=>u,hm:()=>y}),n(321073);var r=n(310784),i=n.n(r),s=n(827734),a=n(582754),o=n(345815);let l="custom-theme-background",u="custom-client-theme",c=.05,d=.9,_=30,f=.7,p=60,h=.4,m=30,E=-.2,g=30,A=40,I=.1,T=.05;function S(e,t,n,r){let s=e.slice();1===e.length&&s.push(e[0]);let u=e.map(e=>i()(e).luminance()),S=i()(e[u.indexOf(Math.min(...u))]),y=i()(e[u.indexOf(Math.max(...u))]),v=`linear-gradient(${t}deg, ${s.join(", ")})`,N=(0,a.Mw)(r),C={light:i()(y).set("hsl.s",1).set("hsl.l",d),dark:i()(S).set("hsl.s",1).set("hsl.l",c)},R=100-n,O=`
      --custom-theme-background: ${v};
      --custom-background-gradient-chat-opacity-base-light: 0.95;
      --custom-background-gradient-highest-opacity-base-light: 1.0;
      --custom-background-gradient-opacity-mix-amount: ${((_+f*R)/100).toFixed(2)};
      --custom-theme-border-color-amount: 5%;
      `,b=N?`
      ${o.RB.THEME_BASE_MIX_AMOUNT}: ${p+h*R}%;
      ${o.RB.THEME_TEXT_MIX_AMOUNT}: ${g}%;
    `:`
      ${o.RB.THEME_BASE_MIX_AMOUNT}: ${m+E*n}%;
      ${o.RB.THEME_TEXT_MIX_AMOUNT}: ${A}%;
    `,D=`
      ${o.RB.DARK_THEME_BASE_COLOR}: ${C.dark.css()};
      ${o.RB.DARK_THEME_BASE_COLOR_HSL}: ${(0,o.FT)(C.dark)};
      ${o.RB.DARK_THEME_TEXT_COLOR}: ${i()(S).set("hsl.l",((100-I*R)/100).toFixed(2)).css()};
    `,L=`
      ${o.RB.LIGHT_THEME_BASE_COLOR}: ${C.light.css()};
      ${o.RB.LIGHT_THEME_BASE_COLOR_HSL}: ${(0,o.FT)(C.light)};
      ${o.RB.LIGHT_THEME_TEXT_COLOR}: ${i()(y).set("hsl.l",(T*R/100).toFixed(2)).css()};
    `;return`.${l} {
      ${O}
      ${b}
      ${D}
      ${L}
      }`}function y(e,t){let n=s.A.unsafe_rawColors[e.colors[0].token].resolve({saturation:1}).hex(),r=s.A.unsafe_rawColors[e.colors[e.colors.length-1].token].resolve({saturation:1}).hex(),i=(0,o.Zk)({enabled:!0,primaryColor:n,secondaryColor:r,isDarkTheme:(0,a.Mw)(e.theme)}),u=`
      ${Object.entries(i).map(e=>{let[t,n]=e;return`${t}: ${n};`}).join("\n")}
    `;return`.${l} {
      --custom-theme-background: ${t};
      --custom-theme-primary-color: ${n};
      --custom-theme-secondary-color: ${r};
      ${u}
    }`}let v=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=e.slice();return 1===e.length&&n.push(e[0]),`linear-gradient(${t}deg, ${n.join(", ")})`}}