Files
2025-09-11 10:47:34 +03:00

1725 lines
210 KiB
JavaScript

(()=>{"use strict";var e={530:function(e,t,r){r.d(t,{Z:()=>s});var a=r(468),i=r.n(a),n=r(360),o=r.n(n)()(i());o.push([e.id,`/* Fix label font family, weight, and letter spacing */
.label {
font-family: var(--font-family);
font-weight: var(--md-sys-typescale-label-large-weight);
letter-spacing: var(--md-sys-typescale-label-large-tracking);
}
/* Modify outline if it exists */
.outline {
border: 1px solid var(--md-sys-color-outline-variant);
}
/* Change icon and label color for outline chips */
.outline ~ #button .icon {
/* Cannot reference primary directly, overwritten by host */
color: var(--primary-color);
fill: var(--primary-color);
}
.outline ~ #button .label {
color: var(--md-sys-color-on-surface);
}
/* State layer colors for outline chips */
.outline ~ md-ripple {
--md-ripple-hover-color: var(--md-sys-color-on-surface);
--md-ripple-pressed-color: var(--md-sys-color-on-surface);
}
/* Fix filled container color, but not when given an explicit color */
.filled {
background-color: var(--md-sys-color-secondary-container);
}
:host(.red) .filled {
background-color: var(--label-badge-red, #df4c1e);
}
:host(.green) .filled {
background-color: var(--label-badge-green, #0da035);
}
:host(.yellow) .filled {
background-color: var(--label-badge-yellow, #f4b400);
}
`,""]);let s=o},934:function(e,t,r){r.d(t,{Z:()=>s});var a=r(468),i=r.n(a),n=r(360),o=r.n(n)()(i());o.push([e.id,`/* Label */
.label {
font-family: var(--font-family);
font-size: var(--md-sys-typescale-label-large-size);
font-weight: var(--md-sys-typescale-label-large-weight);
line-height: var(--md-sys-typescale-label-large-line-height);
letter-spacing: var(--md-sys-typescale-label-large-tracking);
}
/* Icons */
.start::slotted(*) {
margin-inline-end: 8px;
}
.end::slotted(*) {
margin-inline-start: 8px;
}
/* Redefine colors to tokens, change border-radius on interaction, icon size */
.button {
background-color: var(
--inherited-background-color,
var(--ha-button-background-color)
);
border-radius: var(--ha-button-border-radius);
transition: border-radius var(--md-sys-motion-expressive-spatial-fast);
-webkit-tap-highlight-color: transparent;
--mdc-icon-size: 20px;
}
slot {
color: var(--inherited-text-color, var(--ha-button-text-color));
}
/* State layer */
.button::after {
content: '';
position: absolute;
pointer-events: none;
top: 0;
left: 0;
height: 100%;
width: 100%;
z-index: 1;
background-color: var(--state-layer-color);
opacity: 0;
border-radius: var(--ha-button-border-radius);
transition:
opacity var(--md-sys-motion-expressive-effects-fast),
border-radius var(--md-sys-motion-expressive-spatial-fast);
}
@media (hover: hover) {
.button:hover {
--ha-button-border-radius: var(--md-sys-shape-corner-small);
}
.button:hover::after {
opacity: 0.08;
}
}
.button:focus-visible,
.button:active {
--ha-button-border-radius: var(--md-sys-shape-corner-small);
}
.button:focus-visible::after,
.button:active::after {
opacity: 0.18;
}
/* Accent -> Tonal */
:host([appearance~='accent']) {
--ha-button-background-color: var(--md-sys-color-secondary-container);
--ha-button-text-color: var(--md-sys-color-on-secondary-container);
--state-layer-color: var(--md-sys-color-on-secondary-container);
}
/* Filled */
:host([appearance~='filled']) {
--ha-button-background-color: var(--md-sys-color-primary);
--ha-button-text-color: var(--md-sys-color-on-primary);
--state-layer-color: var(--md-sys-color-on-primary);
}
/* Outlined */
:host([appearance~='outlined']) {
--ha-button-background-color: transparent;
--ha-button-text-color: var(--md-sys-color-on-surface-variant);
--state-layer-color: var(--md-sys-color-on-surface-variant);
}
:host([appearance~='outlined']) .button {
border-color: var(--md-sys-color-outline-variant);
border-width: 1px;
border-style: solid;
}
/* Plain -> Text */
:host([appearance~='plain']) {
--ha-button-background-color: transparent;
--ha-button-text-color: var(--md-sys-color-primary);
--state-layer-color: var(--md-sys-color-primary);
}
/* Disabled */
:host([disabled]) .button {
background-color: rgba(from var(--md-sys-color-on-surface) r g b / 0.1);
}
:host([disabled]) slot {
color: rgba(from var(--md-sys-color-on-surface) r g b / 0.38);
}
@media (hover: hover) {
:host([disabled]) .button:hover::after {
opacity: 0;
}
}
:host([disabled]) .button:focus-visible::after,
:host([disabled]) .button:active::after {
opacity: 0;
}
/* Fix status variant colors */
.success,
:host([variant~='success']) {
--ha-button-background-color: var(--success-color);
--ha-button-text-color: var(--wa-color-on-loud);
--state-layer-color: var(--button-color-fill-loud-hover);
}
.warning,
:host([variant~='warning']) {
--ha-button-background-color: var(--warning-color);
--ha-button-text-color: var(--wa-color-on-loud);
--state-layer-color: var(--button-color-fill-loud-hover);
}
.danger,
:host([variant~='danger']) {
--ha-button-background-color: var(--error-color);
--ha-button-text-color: var(--on-error-color);
--state-layer-color: var(--on-error-color);
}
`,""]);let s=o},332:function(e,t,r){r.d(t,{Z:()=>s});var a=r(468),i=r.n(a),n=r(360),o=r.n(n)()(i());o.push([e.id,`/* Elevated cards (default) */
:host,
body {
--ha-card-background: var(--md-sys-color-surface-container-low);
--ha-card-box-shadow: var(--md-sys-elevation-level1);
--ha-card-border-width: 0;
--ha-card-border-color: transparent;
}
`,""]);let s=o},168:function(e,t,r){r.d(t,{Z:()=>s});var a=r(468),i=r.n(a),n=r(360),o=r.n(n)()(i());o.push([e.id,`/* Filled cards */
:host,
body {
--ha-card-background: var(--md-sys-color-surface-container-highest);
--ha-card-box-shadow: var(--md-sys-elevation-level0);
--ha-card-border-width: 0;
--ha-card-border-color: transparent;
}
`,""]);let s=o},591:function(e,t,r){r.d(t,{Z:()=>s});var a=r(468),i=r.n(a),n=r(360),o=r.n(n)()(i());o.push([e.id,`/* Outlined cards */
:host,
body {
--ha-card-background: var(--md-sys-color-surface);
--ha-card-box-shadow: var(--md-sys-elevation-level0);
--ha-card-border-width: 1px;
--ha-card-border-color: var(--md-sys-color-outline-variant);
}
`,""]);let s=o},854:function(e,t,r){r.d(t,{Z:()=>s});var a=r(468),i=r.n(a),n=r(360),o=r.n(n)()(i());o.push([e.id,`/* Transparent cards */
:host,
body {
--ha-card-background: transparent;
--ha-card-box-shadow: var(--md-sys-elevation-level0);
--ha-card-border-width: 0;
--ha-card-border-color: transparent;
}
`,""]);let s=o},207:function(e,t,r){r.d(t,{Z:()=>s});var a=r(468),i=r.n(a),n=r(360),o=r.n(n)()(i());o.push([e.id,`/* Make sliders use card background color for handle and fix card-background-color */
:host {
--md-slider-handle-color: var(--ha-card-background);
--card-background-color: var(--ha-card-background);
}
/* Elevated cards (default) */
:host(.elevated),
:host(.raised),
:host([elevated]),
:host([raised]) {
--ha-card-background: var(--md-sys-color-surface-container-low);
--ha-card-box-shadow: var(--md-sys-elevation-level1);
--ha-card-border-width: 0;
--ha-card-border-color: transparent;
}
/* Filled cards */
:host(.filled),
:host([filled]) {
--ha-card-background: var(--md-sys-color-surface-container-highest);
--ha-card-box-shadow: var(--md-sys-elevation-level0);
--ha-card-border-width: 0;
--ha-card-border-color: transparent;
}
/* Outlined cards */
:host(.outlined),
:host([outlined]) {
--ha-card-background: var(--md-sys-color-surface);
--ha-card-box-shadow: var(--md-sys-elevation-level0);
--ha-card-border-width: 1px;
--ha-card-border-color: var(--md-sys-color-outline-variant);
}
/* Transparent cards */
:host(.transparent),
:host([transparent]) {
--ha-card-background: transparent;
--ha-card-box-shadow: var(--md-sys-elevation-level0);
--ha-card-border-width: 0;
--ha-card-border-color: transparent;
}
`,""]);let s=o},350:function(e,t,r){r.d(t,{Z:()=>s});var a=r(468),i=r.n(a),n=r(360),o=r.n(n)()(i());o.push([e.id,`/* Overflow fix for pages list card */
ha-card:has(ha-md-list) {
overflow: hidden;
}
`,""]);let s=o},902:function(e,t,r){r.d(t,{Z:()=>s});var a=r(468),i=r.n(a),n=r(360),o=r.n(n)()(i());o.push([e.id,`/* Overflow fix for updates card list */
ha-card:has(ha-config-updates) {
overflow: hidden;
}
`,""]);let s=o},279:function(e,t,r){r.d(t,{Z:()=>s});var a=r(468),i=r.n(a),n=r(360),o=r.n(n)()(i());o.push([e.id,`/* Fix slider thumb background color */
#content {
--md-slider-handle-color: var(--ha-dialog-surface-background);
}
/* Add elevation and color transition */
.mdc-dialog__surface {
box-shadow: var(--md-sys-elevation-level3);
transition: background var(--md-sys-motion-expressive-effects-slow);
}
/* Expressive transition on dialog open */
.mdc-dialog__container {
transition: all var(--md-sys-motion-expressive-spatial-fast);
}
/* Apply full-screen dialog styles */
@media (max-width: 450px), (max-height: 500px) {
:host {
--ha-dialog-surface-background: var(--md-sys-color-surface);
}
:host([scrolled]) {
--ha-dialog-surface-background: var(--md-sys-color-surface-container);
}
:host ::slotted(ha-dialog-header) {
background: var(--md-sys-color-surface);
}
}
`,""]);let s=o},241:function(e,t,r){r.d(t,{Z:()=>s});var a=r(468),i=r.n(a),n=r(360),o=r.n(n)()(i());o.push([e.id,`/* Remove border, fix border radius, make width dynamic, add transition */
.mdc-drawer {
border-width: 0;
width: calc(var(--mdc-drawer-width) + 64px);
transition: var(--drawer-transition);
padding-inline-start: 64px;
translate: -64px 0;
}
.mdc-drawer:dir(rtl) {
translate: 64px 0;
}
/* Fix non-modal border radius */
.mdc-drawer {
border-radius: 0;
}
/* Add border radius and variable width to modal */
.mdc-drawer--modal {
border-top-right-radius: var(--mdc-shape-large);
border-bottom-right-radius: var(--mdc-shape-large);
min-width: 220px;
width: fit-content;
max-width: 360px;
}
`,""]);let s=o},857:function(e,t,r){r.d(t,{Z:()=>s});var a=r(468),i=r.n(a),n=r(360),o=r.n(n)()(i());o.push([e.id,`/* Fix switch alignment */
:host {
display: flex;
}
`,""]);let s=o},931:function(e,t,r){r.d(t,{Z:()=>s});var a=r(468),i=r.n(a),n=r(360),o=r.n(n)()(i());o.push([e.id,`/* Decrease border radius, increase height, use primary container colors */
.mdc-fab {
inset-block-end: var(--footer-offset, 0);
height: 56px;
border-radius: var(--md-sys-shape-corner-large);
background-color: var(--md-sys-color-primary-container);
}
.mdc-fab__label,
.mdc-fab__icon {
color: var(--md-sys-color-on-primary-container);
}
.ripple {
border-radius: var(--md-sys-shape-corner-large);
--mdc-ripple-color: var(--md-sys-color-on-primary-container);
}
/* Fix icon margins */
.mdc-fab__icon {
margin-left: 0;
margin-right: 8px;
}
/* Expressive extended FAB font */
.mdc-fab--extended {
font-size: 16px;
font-weight: var(--md-ref-typeface-weight-medium);
line-height: 24px;
letter-spacing: 0.15px;
}
`,""]);let s=o},312:function(e,t,r){r.d(t,{Z:()=>s});var a=r(468),i=r.n(a),n=r(360),o=r.n(n)()(i());o.push([e.id,`/* Increase handle height */
:host {
--grid-layout-slider: 44px;
}
/* Scale and translate handle on hover */
.handle {
background: var(--ha-dialog-surface-background);
transition:
left var(--md-sys-motion-expressive-spatial-default),
top var(--md-sys-motion-expressive-spatial-default);
}
.handle::after {
transition: scale var(--md-sys-motion-expressive-spatial-fast);
}
:host(#columns:focus-visible) .handle::after,
:host(#columns:active) .handle::after {
scale: 0.5 1;
}
:host(#rows:focus-visible) .handle::after,
:host(#rows:active) .handle::after {
scale: 1 0.5;
}
/* Change background and dot colors */
.dot {
background-color: var(--md-sys-color-on-primary);
}
.background {
background: var(--md-sys-color-secondary-container);
}
/* Change colors of, position, and increase size of value label */
.tooltip {
display: flex;
align-items: center;
justify-content: center;
height: 44px;
width: 48px;
padding: 0;
border-radius: var(--md-sys-shape-corner-full);
background-color: var(--md-sys-color-inverse-surface);
color: var(--md-sys-color-inverse-on-surface);
}
.tooltip.top {
translate: 0 -4px;
}
.tooltip.left {
translate: -4px 0;
}
`,""]);let s=o},650:function(e,t,r){r.d(t,{Z:()=>s});var a=r(468),i=r.n(a),n=r(360),o=r.n(n)()(i());o.push([e.id,`/* Fix border radius */
:host {
border-radius: var(--md-sys-shape-corner-small);
}
/* Fix unselected and disabled outline */
.outline {
border-color: var(--md-sys-color-outline-variant);
}
.disabled .outline {
border-color: var(--md-input-chip-disabled-outline-color);
opacity: 0.12;
}
/* Fix selected container colors */
.selected::before {
background: var(--color, --md-sys-color-secondary-container);
}
.selected.disabled::before {
background: var(--md-input-chip-disabled-selected-container-color);
opacity: var(--md-input-chip-disabled-selected-container-opacity);
}
/* Fix labels */
.label {
font-family: var(--font-family);
letter-spacing: var(--md-sys-typescale-label-large-tracking);
}
.disabled .label {
color: var(--md-input-chip-disabled-label-text-color);
}
/* Fix icon colors */
.disabled .leading.icon {
color: var(--md-input-chip-disabled-leading-icon-color);
}
.disabled .trailing.icon {
color: var(--md-input-chip-disabled-trailing-icon-color);
}
`,""]);let s=o},891:function(e,t,r){r.d(t,{Z:()=>s});var a=r(468),i=r.n(a),n=r(360),o=r.n(n)()(i());o.push([e.id,`/* Fix font */
.mdc-deprecated-list-item__text {
font-size: var(--md-sys-typescale-body-large-size);
font-weight: var(--md-sys-typescale-body-large-weight);
line-height: var(--md-sys-typescale-body-large-line-height);
letter-spacing: var(--md-sys-typescale-body-large-tracking);
}
/* Fix slot size for switches */
.mdc-deprecated-list-item__meta {
min-width: 24px;
--mdc-list-item-meta-size: min-content;
}
`,""]);let s=o},896:function(e,t,r){r.d(t,{Z:()=>s});var a=r(468),i=r.n(a),n=r(360),o=r.n(n)()(i());o.push([e.id,`/* Update headers to use app bar headline colors and fonts */
/* Titles */
h1,
h2,
h3 {
color: var(--md-sys-color-on-surface);
}
:is(h1, h2, h3):has(+ h4, + h5, + h6) {
margin-bottom: 6px;
}
/* Subtitles */
h4,
h5,
h6 {
color: var(--md-sys-color-on-surface-variant);
}
:is(h1, h2, h3) + :is(h4, h5, h6) {
margin-top: 0;
}
/* Large Flexible Title */
h1 {
font-size: var(--md-sys-typescale-display-small-size);
font-weight: var(--md-sys-typescale-display-small-weight);
line-height: var(--md-sys-typescale-display-small-line-height);
letter-spacing: var(--md-sys-typescale-display-small-tracking);
}
/* Medium Flexible Title */
h2 {
font-size: var(--md-sys-typescale-headline-medium-size);
font-weight: var(--md-sys-typescale-headline-medium-weight);
line-height: var(--md-sys-typescale-headline-medium-line-height);
letter-spacing: var(--md-sys-typescale-headline-medium-tracking);
}
/* Small Title */
h3 {
font-size: var(--md-sys-typescale-title-large-size);
font-weight: var(--md-sys-typescale-title-large-weight);
line-height: var(--md-sys-typescale-title-large-line-height);
letter-spacing: var(--md-sys-typescale-title-large-tracking);
}
/* Large Flexible Subtitle */
h4 {
font-size: var(--md-sys-typescale-title-medium-size);
font-weight: var(--md-sys-typescale-title-medium-weight);
line-height: var(--md-sys-typescale-title-medium-line-height);
letter-spacing: var(--md-sys-typescale-title-medium-tracking);
}
/* Medium Flexible Subtitle */
h5 {
font-size: var(--md-sys-typescale-title-small-size);
font-weight: var(--md-sys-typescale-title-small-weight);
line-height: var(--md-sys-typescale-title-small-line-height);
letter-spacing: var(--md-sys-typescale-title-small-tracking);
}
/* Small Subtitle */
h6 {
font-size: var(--md-sys-typescale-body-small-size);
font-weight: var(--md-sys-typescale-body-small-weight);
line-height: var(--md-sys-typescale-body-small-line-height);
letter-spacing: var(--md-sys-typescale-body-small-tracking);
}
`,""]);let s=o},523:function(e,t,r){r.d(t,{Z:()=>s});var a=r(468),i=r.n(a),n=r(360),o=r.n(n)()(i());o.push([e.id,`/* Change background color */
.container::before {
background: var(--md-sys-color-surface-container-high);
}
/* Headline font */
#headline ::slotted(*) {
font-size: var(--md-sys-typescale-headline-small-size);
font-weight: var(--md-sys-typescale-headline-small-weight);
line-height: var(--md-sys-typescale-headline-small-line-height);
letter-spacing: var(--md-sys-typescale-headline-small-tracking);
}
/* Label font */
.content ::slotted(*) {
font-size: var(--md-sys-typescale-body-medium-size);
font-weight: var(--md-sys-typescale-body-medium-weight);
line-height: var(--md-sys-typescale-body-medium-line-height);
letter-spacing: var(--md-sys-typescale-body-medium-tracking);
}
`,""]);let s=o},974:function(e,t,r){r.d(t,{Z:()=>s});var a=r(468),i=r.n(a),n=r(360),o=r.n(n)()(i());o.push([e.id,`/* Add flex-direction option to set on parent */
md-item {
flex-direction: var(--md-list-item-flex-direction, row);
}
/* Make expanded sidebar clickable area full width */
#item::after {
content: '';
display: var(--sidebar-item-display, none);
position: absolute;
height: 100%;
width: calc(var(--mdc-drawer-width) - env(safe-area-inset-left));
min-width: 220px;
max-width: 360px;
inset-inline-start: -20px;
padding-inline-end: 20px;
}
`,""]);let s=o},151:function(e,t,r){r.d(t,{Z:()=>s});var a=r(468),i=r.n(a),n=r(360),o=r.n(n)()(i());o.push([e.id,`/* Fix icon size */
:host {
--mdc-icon-size: 20px;
}
`,""]);let s=o},644:function(e,t,r){r.d(t,{Z:()=>s});var a=r(468),i=r.n(a),n=r(360),o=r.n(n)()(i());o.push([e.id,`/* Fix small badge size and color */
.dot {
height: 6px;
width: 6px;
background-color: var(--error-color);
}
`,""]);let s=o},917:function(e,t,r){r.d(t,{Z:()=>s});var a=r(468),i=r.n(a),n=r(360),o=r.n(n)()(i());o.push([e.id,`/* Move number input down to unhide tooltip, because I cannnot figure out why its hidden otherwise */
.container[data-domain='input_number'],
.container[data-domain='number'] {
padding-top: 26px;
}
`,""]);let s=o},921:function(e,t,r){r.d(t,{Z:()=>s});var a=r(468),i=r.n(a),n=r(360),o=r.n(n)()(i());o.push([e.id,`/* Fix text alignment */
.option .content {
align-items: center;
}
`,""]);let s=o},463:function(e,t,r){r.d(t,{Z:()=>s});var a=r(468),i=r.n(a),n=r(360),o=r.n(n)()(i());o.push([e.id,`/* Fix top corners */
.mdc-select__anchor {
border-radius: var(--md-sys-shape-corner-extra-small-top);
}
`,""]);let s=o},547:function(e,t,r){r.d(t,{Z:()=>s});var a=r(468),i=r.n(a),n=r(360),o=r.n(n)()(i());o.push([e.id,`/* Fix slot size for switches */
.content {
min-width: min-content;
}
`,""]);let s=o},538:function(e,t,r){r.d(t,{Z:()=>s});var a=r(468),i=r.n(a),n=r(360),o=r.n(n)()(i());o.push([e.id,`/* Kiosk mode hide sidebar */
:host {
width: var(--kiosk-sidebar-width, 100%);
}
/* Hide title but keep it tappable */
.title {
color: transparent;
}
:host([narrow]) .menu:not(:has(mwc-button, ha-icon-button)) {
height: 12px;
}
/* Fix menu button size */
.menu {
width: min-content;
padding: 0;
margin: 0 24px;
border-width: 0;
}
/* Fix list heights*/
ha-md-list {
height: calc(
100% - var(--header-height) - 144px - env(safe-area-inset-bottom)
);
}
:host([narrow]) ha-md-list {
height: calc(
100% - var(--header-height) - 92px - env(safe-area-inset-bottom)
);
}
/* Remove scrollbar */
.ha-scrollbar {
scrollbar-width: none;
}
::-webkit-scrollbar {
width: 0;
}
/* Modify sidebar item size and animate background when expanding/retracting */
ha-md-list-item {
height: 64px;
width: var(--mdc-drawer-width);
transition: all var(--md-sys-motion-expressive-spatial-default);
margin: 0;
flex-direction: column;
justify-content: center;
--sidebar-item-state-layer-shape: var(--md-sys-shape-corner-full);
--md-list-item-leading-space: 16px;
--md-list-item-trailing-space: 16px;
--md-focus-ring-shape-end-end: var(--md-sys-shape-corner-full);
--md-focus-ring-shape-end-start: var(--md-sys-shape-corner-full);
--md-focus-ring-shape-start-end: var(--md-sys-shape-corner-full);
--md-focus-ring-shape-start-start: var(--md-sys-shape-corner-full);
}
/* Expanded rail indicator should fit content width */
:host([expanded]) ha-md-list-item {
height: 56px;
width: calc(var(--mdc-drawer-width) - env(safe-area-inset-left));
max-width: fit-content;
margin: 0 20px;
border-radius: var(--md-sys-shape-corner-full);
--sidebar-item-display: block;
}
/* Modal sidebar item width */
:host([narrow]) ha-md-list-item {
min-width: fit-content;
}
/* Fix collapsed rail selected text color */
ha-md-list-item.selected {
--md-list-item-label-text-color: var(--sidebar-selected-text-color);
}
/* Prevent text jumpiness on opening sidebar */
.item-text {
display: block;
overflow: visible;
white-space: nowrap;
line-height: var(--md-sys-typescale-label-large-line-height);
letter-spacing: var(--md-sys-typescale-label-large-tracking);
}
/* Make collapsed navigation rail items vertical and hide default ripple */
:host(:not([expanded])) ha-md-list-item {
border-radius: 0;
padding-top: 4px;
padding-bottom: 6px;
--md-list-item-flex-direction: column;
--ha-md-list-item-gap: 10px;
--md-ripple-hover-color: transparent;
--md-ripple-pressed-color: transparent;
}
/* Display label when not expanded */
:host(:not([expanded])) ha-md-list-item .item-text {
width: var(--mdc-drawer-width);
text-align: center;
white-space: initial;
box-sizing: border-box;
padding: 0 2px;
margin-top: 2px;
height: var(--md-sys-typescale-label-medium-line-height);
font-weight: var(--md-ref-typeface-weight-medium);
font-size: var(--md-sys-typescale-label-medium-size);
line-height: var(--md-sys-typescale-label-medium-line-height);
letter-spacing: var(--md-sys-typescale-label-small-tracking);
}
:host(:not([expanded])) ha-md-list-item ha-svg-icon,
:host(:not([expanded])) ha-md-list-item ha-icon {
position: relative;
top: 4px;
}
/* Change background of current destination icon and add scale transition */
:host([expanded]) ha-md-list-item::before,
:host(:not([expanded])) .user::before {
content: '';
border-radius: var(--sidebar-item-state-layer-shape);
background-color: var(--sidebar-selected-background);
opacity: 1;
transition: transform var(--md-sys-motion-expressive-spatial-fast);
transform: scaleX(0);
}
:host([expanded]) ha-md-list-item.selected::before,
:host(:not([expanded])) .user.selected::before {
transform: scaleX(1);
}
:host(:not([expanded])) .user.selected::before {
width: 56px;
margin-inline-start: 20px;
}
:host(:not([expanded])) ha-md-list-item:not(.user)::before {
display: none;
}
:host(:not([expanded])) ha-svg-icon::before,
:host(:not([expanded])) ha-icon::before,
:host(:not([expanded])) ha-svg-icon::after,
:host(:not([expanded])) ha-icon::after,
:host(:not([expanded])) ha-user-badge::after {
content: '';
position: absolute;
top: -4px;
left: -16px;
display: block;
height: 32px;
width: 56px;
border-radius: var(--sidebar-item-state-layer-shape);
z-index: -1;
}
:host(:not([expanded])) .notifications ha-svg-icon::after {
height: 56px;
top: -16px;
}
:host(:not([expanded])) ha-user-badge::after {
height: 56px;
top: -8px;
left: -8px;
z-index: 0;
}
:host(:not([expanded])) ha-svg-icon::before,
:host(:not([expanded])) ha-icon::before {
background-color: var(--sidebar-selected-background);
opacity: 1;
transform: scaleX(0);
transition: transform var(--md-sys-motion-expressive-spatial-fast);
}
:host(:not([expanded])) ha-md-list-item.selected ha-svg-icon::before,
:host(:not([expanded])) ha-md-list-item.selected ha-icon::before {
transform: scaleX(1);
}
/* Collapsed navigation rail icon state layers */
:host(:not([expanded])) ha-svg-icon::after,
:host(:not([expanded])) ha-icon::after,
:host(:not([expanded])) ha-user-badge::after {
background-color: var(--md-sys-color-on-secondary-container);
opacity: 0;
transition: opacity var(--md-sys-motion-expressive-effects-default);
}
@media (hover: hover) {
:host(:not([expanded])) ha-md-list-item:hover ha-svg-icon::after,
:host(:not([expanded])) ha-md-list-item:hover ha-icon::after,
:host(:not([expanded])) ha-md-list-item:hover ha-user-badge::after {
opacity: 0.08;
}
}
:host(:not([expanded]))
ha-md-list-item:has(input:focus-visible)
ha-svg-icon::after,
:host(:not([expanded])) ha-md-list-item:has(input:focus-visible) ha-icon::after,
:host(:not([expanded]))
ha-md-list-item:has(input:focus-visible)
ha-user-badge::after,
:host(:not([expanded])) ha-md-list-item:active ha-svg-icon::after,
:host(:not([expanded])) ha-md-list-item:active ha-icon::after,
:host(:not([expanded])) ha-md-list-item:active ha-user-badge::after {
opacity: 0.18;
}
/* Fix navigation rail item icon z-index */
ha-md-list-item ha-svg-icon,
ha-md-list-item ha-icon {
z-index: 0;
}
/* Fix hide/show panel button */
.hide-panel,
.show-panel {
z-index: 1;
}
/* Rail notification badge */
.badge {
color: var(--on-error-color);
background-color: var(--error-color);
font-size: var(--md-sys-typescale-label-small-size);
font-weight: var(--md-sys-typescale-label-small-weight);
line-height: var(--md-sys-typescale-label-small-line-height);
letter-spacing: var(--md-sys-typescale-label-small-tracking);
height: 8px;
min-width: 8px;
padding: 4px;
}
.badge[slot='start'] {
top: 8px;
left: 50%;
z-index: 2;
}
.configuration .badge[slot='start'] {
top: 0;
}
.badge[slot='end'] {
position: absolute;
top: 12px;
left: 28px;
}
/* Disable tooltip */
.tooltip {
display: none;
pointer-events: none;
}
/* Fix user badge position */
ha-user-badge {
margin-left: -8px;
}
/* Fix notifications and user badge size and position */
:host(:not([expanded])) .notifications,
:host(:not([expanded])) .user {
height: 56px;
--md-item-overflow: visible;
}
:host(:not([expanded])) .notifications ha-svg-icon {
position: relative;
top: 12px;
}
:host(:not([expanded])) .user ha-user-badge {
position: relative;
top: 6px;
}
/* Do not use label for bottom section*/
:host(:not([expanded])) .notifications .item-text,
:host(:not([expanded])) .user .item-text {
display: none;
}
`,""]);let s=o},406:function(e,t,r){r.d(t,{Z:()=>s});var a=r(468),i=r.n(a),n=r(360),o=r.n(n)()(i());o.push([e.id,`/* Set Material Design 3 slider variables that should only apply to redesigned sliders */
:host {
padding: 8px 0;
align-items: center;
--md-slider-handle-height: 44px;
--md-slider-handle-width: 16px;
--md-slider-handle-shape: 4px;
--md-slider-hover-handle-color: var(--md-slider-handle-color);
--md-slider-pressed-handle-color: var(--md-slider-handle-color);
--md-slider-focus-handle-color: var(--md-slider-handle-color);
--md-slider-disabled-handle-color: var(--md-slider-handle-color);
}
/* Animation */
/* .track::before,
.track::after,
.handleContainer {
transition:
clip-path var(--md-sys-motion-expressive-spatial-default),
inset-inline-start var(--md-sys-motion-expressive-spatial-default),
inline-size var(--md-sys-motion-expressive-spatial-default);
} */
/* Space around handle */
.handleNub {
height: var(--md-slider-active-track-height);
box-shadow: 0 0 1px 0 var(--md-slider-handle-color);
width: 16px;
border-radius: 0;
}
/* Actual handle */
.handleNub::after {
content: '';
position: absolute;
inset: 0;
width: 4px;
height: 44px;
margin: auto;
background: var(--md-sys-color-primary);
border-radius: var(--md-sys-shape-corner-full);
transition: scale var(--md-sys-motion-expressive-spatial-fast);
}
:host([disabled]) .handleNub::after {
background: var(--md-sys-color-on-surface);
}
.hover .handleNub::after,
input:focus-visible ~ .handleContainerPadded .handleNub::after,
input:active ~ .handleContainerPadded .handleNub::after {
scale: 0.5 1;
}
/* Reshape focus ring */
md-focus-ring {
height: 56px;
width: 12px;
z-index: 1;
}
/* Set label width and position */
.label {
width: var(--md-slider-label-container-width);
translate: 0 -14px;
}
/* Remove teardrop from label */
.label::before {
display: none;
}
/* Do not show label on focus-within if hover class is not present */
:host(:focus-within)
.container
.handleContainerPadded
.handleContainerBlock
:not(.hover)
.label {
transform: scale(0);
}
/* Add track inner corner shape */
.handle::before,
.handle::after {
content: '';
position: relative;
height: var(--md-slider-active-track-height);
width: 4px;
}
.handle::before {
inset-inline-start: -8px;
border-start-end-radius: 2px;
border-end-end-radius: 2px;
}
.handle::before,
.handle:dir(rtl)::after {
box-shadow: 2px 0 0 var(--md-slider-handle-color);
}
.handle::after {
inset-inline-end: -8px;
border-start-start-radius: 2px;
border-end-start-radius: 2px;
}
.handle::after,
.handle:dir(rtl)::before {
box-shadow: -2px 0 0 var(--md-slider-handle-color);
}
`,""]);let s=o},121:function(e,t,r){r.d(t,{Z:()=>s});var a=r(468),i=r.n(a),n=r(360),o=r.n(n)()(i());o.push([e.id,`/* Material 3 colors and adjust padding to match footprint of old switch */
:host {
padding: 0;
--switch-checked-button-color: var(--md-switch-checked-button-color);
--switch-unchecked-button-color: var(--md-switch-unchecked-button-color);
--switch-checked-track-color: var(--md-switch-checked-track-color);
--switch-unchecked-track-color: var(--md-switch-unchecked-track-color);
}
/* Fix style changes causing phantom overflow scroll */
.mdc-switch {
overflow: hidden;
}
/* Increase track size, make always opaque, and border. */
.mdc-switch__track {
height: 32px;
width: 52px;
border-radius: var(--md-sys-shape-corner-full);
opacity: 1;
border: 2px solid var(--switch-unchecked-button-color);
}
/* Remove border when on */
.mdc-switch--checked .mdc-switch__track {
border: none;
}
/* Fix thumb position and update transition */
.mdc-switch__thumb-underlay {
top: -8px;
left: -8px;
transition:
transform var(--md-sys-motion-expressive-spatial-fast),
background-color var(--md-sys-motion-expressive-effects-fast),
border-color var(--md-sys-motion-expressive-effects-fast);
}
/* Thumb position when on */
.mdc-switch--checked .mdc-switch__thumb-underlay {
transform: translateX(20px);
}
/* Switch thumb color and size */
.mdc-switch__thumb {
height: 16px;
width: 16px;
background: var(--switch-unchecked-button-color);
border: none;
box-shadow: unset;
transition: scale var(--md-sys-motion-expressive-spatial-fast);
}
/* Switch on thumb color and size */
.mdc-switch--checked .mdc-switch__thumb {
background: var(--switch-checked-button-color);
scale: 1.5;
}
/* Thumb active size */
@media (hover: hover) {
.mdc-switch__thumb:hover {
scale: 1.75;
}
}
.mdc-switch__thumb:has(input:focus-visible),
.mdc-switch__thumb:active {
scale: 1.75;
}
/* Remove ripple */
mwc-ripple {
display: none;
}
/* Track state layers */
.mdc-switch__track::after {
content: '';
position: absolute;
height: 32px;
width: 52px;
border-radius: var(--md-sys-shape-corner-full);
pointer-events: none;
top: 0;
left: 0;
z-index: 1;
background: var(--switch-unchecked-track-state-layer);
opacity: 0;
transition: opacity var(--md-sys-motion-expressive-effects-default);
}
.mdc-switch--checked .mdc-switch__track::after {
background: var(--switch-checked-track-color);
}
@media (hover: hover) {
.mdc-switch:hover .mdc-switch__track::after {
opacity: 0.08;
}
}
.mdc-switch:has(input:focus-visible) .mdc-switch__track::after,
.mdc-switch:active .mdc-switch__track::after {
opacity: 0.18;
}
/* Thumb state layers */
@media (hover: hover) {
.mdc-switch:hover .mdc-switch__thumb {
background: var(--switch-unchecked-button-state-layer);
}
.mdc-switch--checked:hover .mdc-switch__thumb {
background: var(--switch-checked-button-state-layer);
}
}
.mdc-switch:has(input:focus-visible) .mdc-switch__thumb,
.mdc-switch:active .mdc-switch__thumb {
background: var(--switch-unchecked-button-state-layer);
}
.mdc-switch--checked:has(input:focus-visible) .mdc-switch__thumb,
.mdc-switch--checked:active .mdc-switch__thumb {
background: var(--switch-checked-button-state-layer);
}
/* Input element position corrections */
.mdc-switch__native-control {
position: relative;
top: -16px;
left: -14px;
right: unset;
bottom: unset;
scale: 1;
}
.mdc-switch__native-control:dir(rtl) {
left: 34px;
}
.mdc-switch--checked .mdc-switch__native-control {
transform: translateX(-23px);
scale: 0.7;
}
@media (hover: hover) {
.mdc-switch__thumb:hover .mdc-switch__native-control {
transform: translateX(-8px);
scale: 0.56;
}
.mdc-switch--checked .mdc-switch__thumb:hover .mdc-switch__native-control {
transform: translateX(-25px);
}
}
.mdc-switch__thumb:has(input:focus-visible) .mdc-switch__native-control,
.mdc-switch__thumb:active .mdc-switch__native-control {
scale: 0.6;
}
`,""]);let s=o},337:function(e,t,r){r.d(t,{Z:()=>s});var a=r(468),i=r.n(a),n=r(360),o=r.n(n)()(i());o.push([e.id,`/* Fix top corners */
.mdc-text-field {
border-radius: var(--md-sys-shape-corner-extra-small-top);
}
/* Fix cursor when used for color */
:host([type='color']) label,
:host([type='color']) .mdc-text-field__input {
cursor: pointer;
}
`,""]);let s=o},160:function(e,t,r){r.d(t,{Z:()=>s});var a=r(468),i=r.n(a),n=r(360),o=r.n(n)()(i());o.push([e.id,`/* Move toast above footer */
.mdc-snackbar {
bottom: calc(8px + var(--footer-height) + env(safe-area-inset-bottom));
}
/* Use theme colors */
.mdc-snackbar__surface {
background-color: var(--md-sys-color-inverse-surface);
--inherited-background-color: transparent;
--inherited-text-color: var(--md-sys-color-inverse-primary);
}
.mdc-snackbar__label {
color: var(--md-sys-color-inverse-on-surface);
font-size: var(--md-sys-typescale-label-large-size);
line-height: var(--md-sys-typescale-label-large-line-height);
letter-spacing: var(--md-sys-typescale-label-large-tracking);
}
`,""]);let s=o},936:function(e,t,r){r.d(t,{Z:()=>s});var a=r(468),i=r.n(a),n=r(360),o=r.n(n)()(i());o.push([e.id,`/* Add left padding and translate to header to help hide rail transition */
.mdc-top-app-bar {
width: calc(var(--mdc-top-app-bar-width, 100%) + 128px);
padding-inline-start: 128px;
translate: -128px 0;
}
.mdc-top-app-bar:dir(rtl) {
translate: 128px 0;
}
`,""]);let s=o},365:function(e,t,r){r.d(t,{Z:()=>s});var a=r(468),i=r.n(a),n=r(360),o=r.n(n)()(i());o.push([e.id,`/* Move user picture above navigation background */
:host([slot='item-icon']) .initials,
:host([slot='item-icon']) .picture {
position: absolute;
z-index: 2;
margin: 4px 0;
padding-inline-start: 4px;
}
`,""]);let s=o},362:function(e,t,r){r.d(t,{Z:()=>s});var a=r(468),i=r.n(a),n=r(360),o=r.n(n)()(i());o.push([e.id,`/* Change drawer width */
:host {
--mdc-drawer-width: var(--kiosk-sidebar-width, 96px);
--drawer-transition: all var(--md-sys-motion-expressive-spatial-default);
}
:host([expanded]) {
--mdc-drawer-width: var(--kiosk-sidebar-width, 256px);
--drawer-transition: all var(--md-sys-motion-expressive-spatial-fast);
}
:host([modal]) {
--mdc-drawer-width: var(--kiosk-sidebar-width, 0px);
--drawer-transition: all var(--md-sys-motion-expressive-spatial-fast);
}
`,""]);let s=o},324:function(e,t,r){r.d(t,{Z:()=>s});var a=r(468),i=r.n(a),n=r(360),o=r.n(n)()(i());o.push([e.id,`/* Hide border on notifications drawer */
notification-drawer {
--divider-color: transparent;
}
`,""]);let s=o},980:function(e,t,r){r.d(t,{Z:()=>s});var a=r(468),i=r.n(a),n=r(360),o=r.n(n)()(i());o.push([e.id,`/*
Fixes for this theme when used with hue-like-light-card
https://github.com/Gh61/lovelace-hue-like-light-card
*/
/* Adjust switch position */
ha-switch {
top: 12px;
}
/* Increase margin around slider, fix handle color, fix min/max overflow */
ha-slider {
margin: 4px 0;
--md-slider-handle-color: var(--md-slider-inactive-track-color);
--md-slider-end-handle-shape: var(--md-sys-shape-corner-full);
}
`,""]);let s=o},614:function(e,t,r){r.d(t,{Z:()=>s});var a=r(468),i=r.n(a),n=r(360),o=r.n(n)()(i());o.push([e.id,`/* Add top margin to toggles */
.side-by-side {
margin-top: 16px;
}
`,""]);let s=o},576:function(e,t,r){r.d(t,{Z:()=>s});var a=r(468),i=r.n(a),n=r(360),o=r.n(n)()(i());o.push([e.id,`/* Fix header ha-switch position */
hui-entities-toggle {
position: relative;
padding-inline-end: 6px;
top: 8px;
}
`,""]);let s=o},366:function(e,t,r){r.d(t,{Z:()=>s});var a=r(468),i=r.n(a),n=r(360),o=r.n(n)()(i());o.push([e.id,`/* Fix sections view add card button icon color */
.add {
--icon-primary-color: var(--md-sys-color-on-surface);
}
`,""]);let s=o},992:function(e,t,r){r.d(t,{Z:()=>s});var a=r(468),i=r.n(a),n=r(360),o=r.n(n)()(i());o.push([e.id,`/* Hide navigation bar */
html {
--navbar-display: none;
}
`,""]);let s=o},334:function(e,t,r){r.d(t,{Z:()=>s});var a=r(468),i=r.n(a),n=r(360),o=r.n(n)()(i());o.push([e.id,`/* Make non subview headers transparent */
.header:not(:has(ha-icon-button-arrow-prev ~ .main-title)) {
background-color: transparent;
pointer-events: none;
}
/* Make subview headers match background until scrolled */
.header:has(ha-icon-button-arrow-prev ~ .main-title) {
background-color: var(--md-sys-color-surface);
transition: background-color var(--md-sys-motion-expressive-effects-fast);
}
:host([scrolled]) .header:has(ha-icon-button-arrow-prev ~ .main-title) {
background-color: var(--md-sys-color-surface-container);
}
/* Hide single tab view dashboard title */
ha-menu-button + .main-title {
display: none;
}
/* Subview title font */
.main-title {
font-size: var(--md-sys-typescale-title-large-size);
font-weight: var(--md-sys-typescale-title-large-weight);
line-height: var(--md-sys-typescale-title-large-line-height);
letter-spacing: var(--md-sys-typescale-title-large-tracking);
}
/*
* Move menu and action items buttons to header
* User different color for header trailing icons
* Reduce size of header buttons but increase margin and gap to keep same placement
*/
.main-title,
.action-items,
ha-menu-button,
ha-icon-button-arrow-prev[slot='navigationIcon'] {
pointer-events: all;
}
ha-menu-button,
.action-items {
margin: 0 12px;
}
.action-items {
position: absolute;
inset-inline-end: 0;
gap: 4px;
color: var(--app-header-edit-text-color);
}
/* Add background to header buttons on scroll */
ha-menu-button,
ha-button-menu,
ha-tooltip ha-icon-button {
border-radius: var(--md-sys-shape-corner-full);
transition:
background var(--md-sys-motion-expressive-effects-default),
color var(--md-sys-motion-expressive-effects-default);
--mdc-icon-button-size: 40px;
}
ha-button-menu,
ha-tooltip ha-icon-button {
display: flex;
justify-content: center;
width: 32px;
margin: 0 4px;
}
:host([scrolled]) ha-menu-button {
background: var(--md-sys-color-surface-container);
}
:host([scrolled]) ha-button-menu,
:host([scrolled]) ha-tooltip ha-icon-button {
background: var(--md-sys-color-secondary-container);
color: var(--md-sys-color-on-secondary-container);
}
/* Remove background from subview header buttons on scroll */
:host([scrolled])
ha-icon-button-arrow-prev
~ .main-title
~ .action-items
ha-button-menu,
:host([scrolled])
ha-icon-button-arrow-prev
~ .main-title
~ .action-items
ha-tooltip
ha-icon-button {
background: unset;
color: var(--md-sys-color-on-surface-variant);
}
/* Remove toolbar padding */
.toolbar {
padding: 0;
}
/* Force hide subview tab just in case */
.hide-tab {
display: none;
}
/* Turn view tabs into a separate footer, fix rail transition gap */
sl-tab-group {
width: calc(100vw - var(--mdc-drawer-width, 0px));
margin: 0;
margin-inline: 0;
pointer-events: all;
padding-inline-start: 128px;
translate: -128px 0;
}
sl-tab-group:dir(rtl) {
translate: 128px 0;
}
.edit-mode .tab-bar,
.toolbar > sl-tab-group {
position: fixed;
top: unset;
bottom: 0;
min-height: var(--footer-height);
height: min-content;
background: var(--navbar-background);
box-shadow: var(--md-sys-elevation-level2);
padding-bottom: env(safe-area-inset-bottom);
pointer-events: all;
}
/* Option to hide navigation bar when not in edit mode */
:not(.edit-mode) > .header sl-tab-group {
display: var(--navbar-display, initial);
}
/* Make tabs full width and remove bottom border */
sl-tab-group::part(tabs) {
justify-content: space-evenly;
border-bottom: 0;
}
/* Display view tab contents vertically and calculate width to fill entire toolbar */
sl-tab {
display: flex;
padding: 6px 0;
flex-direction: column;
flex: 1;
gap: 4px;
height: 100%;
box-sizing: border-box;
min-width: 56px;
max-width: 174px;
cursor: pointer;
overflow: hidden;
-webkit-tap-highlight-color: transparent;
}
/* Remove tab padding, icon justify center, and remove tap highlight color */
sl-tab::part(base) {
justify-content: center;
padding: 0px;
-webkit-tap-highlight-color: transparent;
}
/* Add background and color current view icon */
sl-tab ha-icon::before {
content: '';
position: absolute;
height: 32px;
width: 56px;
border-radius: var(--md-sys-shape-corner-full);
background: var(--md-sys-color-secondary-container);
transition: transform var(--md-sys-motion-expressive-spatial-fast);
transform: scaleX(0);
}
sl-tab[active] ha-icon::before {
transform: scaleX(1);
}
sl-tab[active] ha-icon {
color: var(--md-sys-color-on-secondary-container);
}
/* Prevent edit mode icon from shrinking on small width displays */
ha-svg-icon {
min-width: 24px;
}
/* Reduce height of edit mode view icons */
sl-tab[active] .edit-icon.view {
align-items: center;
height: 32px;
z-index: 1;
}
/* View icon display centering and inactive color */
ha-icon {
height: 32px;
width: 56px;
display: inline-flex;
justify-content: center;
align-items: center;
z-index: 1;
color: var(--md-sys-color-on-surface-variant);
}
/* View icon state layers */
sl-tab ha-icon::after {
content: '';
position: absolute;
height: 32px;
width: 56px;
border-radius: var(--md-sys-shape-corner-full);
z-index: 0;
background: var(--md-sys-color-on-secondary-container);
opacity: 0;
transition: opacity var(--md-sys-motion-expressive-effects-default);
}
@media (hover: hover) {
sl-tab:hover ha-icon::after {
opacity: 0.08;
}
}
sl-tab:focus-visible ha-icon::after,
sl-tab:active ha-icon::after {
opacity: 0.18;
}
/* Tabs with no icon */
sl-tab:not(:has(ha-icon))::part(base) {
color: transparent;
line-height: 32px;
}
/* View label */
sl-tab::after {
content: attr(aria-label);
text-transform: none;
text-wrap: wrap;
text-align: center;
margin: 0 auto;
font-weight: var(--md-ref-typeface-weight-medium);
font-size: var(--md-sys-typescale-label-medium-size);
line-height: var(--md-sys-typescale-label-medium-line-height);
letter-spacing: var(--md-sys-typescale-label-small-tracking);
overflow: hidden;
height: 100%;
color: var(--md-sys-color-on-surface-variant);
display: flex;
align-items: flex-start;
z-index: 1;
}
/* Current view label color */
sl-tab[active]::after {
color: var(--md-sys-color-secondary);
}
/* Make edit mode current view tab fit all buttons */
.edit-mode sl-tab[active] {
min-width: fit-content;
}
/* Move edit mode action items back to header */
.edit-mode .action-items {
position: static;
}
/* Style add view button to look like a FAB */
.edit-mode:has(hui-sections-view) {
--add-view-fab-bottom: 16px;
}
#add-view {
position: fixed;
bottom: calc(
var(--add-view-fab-bottom, 84px) +
var(--kiosk-header-height, var(--footer-height)) +
env(safe-area-inset-bottom)
);
inset-inline-end: calc(16px + env(safe-area-inset-right));
border-radius: var(--md-sys-shape-corner-large);
background-color: var(--md-sys-color-primary-container);
color: var(--md-sys-color-on-primary-container);
height: 56px;
width: 56px;
justify-content: center;
overflow: hidden;
box-shadow: var(--mdc-fab-box-shadow);
--mdc-icon-button-size: 64px;
}
/* Restore main title margin in edit mode */
.edit-mode .main-title {
display: flex;
align-items: center;
margin: 0 24px;
}
/* Fix edit mode menu link color */
.menu-link {
color: var(--app-header-edit-text-color);
-webkit-tap-highlight-color: transparent;
}
/* Add bottom footer padding when present */
div:has(sl-tab-group) {
--footer-offset: calc(
var(--kiosk-header-height, var(--footer-height)) +
env(safe-area-inset-bottom)
);
}
.header:has(sl-tab-group) + #view {
padding-bottom: var(--footer-offset);
}
/* Fix edit mode view top padding */
.edit-mode #view {
padding-top: calc(var(--header-height) + env(safe-area-inset-top));
}
/* Header Cards pointer events fix */
#headerCards {
pointer-events: all;
}
/* Large displays alternate navigation bar */
@media (width > 870px) or (orientation: landscape) {
/* Center view tabs */
sl-tab-group::part(tabs) {
justify-content: center;
}
/* Show original label of view tab with no icon */
sl-tab:not(:has(ha-icon))::part(base) {
color: unset;
}
/* Move label to right of icon, ensure that it can contain content, and remove top margin */
sl-tab::part(base) {
justify-content: flex-start;
align-self: center;
width: fit-content;
margin-top: 0;
}
sl-tab {
min-width: fit-content;
justify-content: center;
padding: 16px 0;
}
.edit-mode sl-tab[active]::after {
translate: -120px 0;
}
/* Remove vertical label */
sl-tab::after {
content: unset;
}
/* Position and size of edit view icons */
.edit-icon.view {
padding: 0;
}
/* Position icon on left of indicator */
sl-tab ha-icon {
justify-content: flex-start;
width: 100%;
position: relative;
inset-inline-start: 20px;
}
/* Horizontal label, indicator, and state layers */
sl-tab ha-icon::before,
sl-tab ha-icon::after {
content: attr(title);
display: flex;
align-items: center;
font-weight: var(--md-ref-typeface-weight-medium);
font-size: var(--md-sys-typescale-label-medium-size);
line-height: var(--md-sys-typescale-label-medium-line-height);
letter-spacing: var(--md-sys-typescale-label-small-tracking);
height: 40px;
width: fit-content;
margin-inline-start: -16px;
padding-inline-start: 44px;
padding-inline-end: 16px;
z-index: 0;
}
sl-tab:not([aria-label]) ha-icon::before,
sl-tab:not([aria-label]) ha-icon::after {
margin-inline-start: -18px;
}
sl-tab ha-icon::before {
color: transparent;
}
sl-tab ha-icon::after {
position: relative;
inset-inline-start: -24px;
color: var(--md-sys-color-on-surface-variant);
background: rgba(
from var(--md-sys-color-on-secondary-container) r g b /
var(--state-layer-opacity)
);
opacity: 1;
transition: background var(--md-sys-motion-expressive-effects-default);
--state-layer-opacity: 0;
}
sl-tab[active] ha-icon::after {
color: var(--md-sys-color-secondary);
}
@media (hover: hover) {
sl-tab:hover ha-icon::after {
--state-layer-opacity: 0.08;
opacity: 1;
}
}
sl-tab:focus-visible ha-icon::after,
sl-tab:active ha-icon::after {
--state-layer-opacity: 0.18;
opacity: 1;
}
/* Fix edit mode horizontal item current item position */
.edit-mode sl-tab ha-icon {
position: relative;
inset-inline-start: 20px;
}
}
`,""]);let s=o},903:function(e,t,r){r.d(t,{Z:()=>s});var a=r(468),i=r.n(a),n=r(360),o=r.n(n)()(i());o.push([e.id,`/* Reduce heading top padding */
:host {
padding-top: 4px;
}
/* Remove heading top margin */
.layout {
margin-top: 0;
}
`,""]);let s=o},689:function(e,t,r){r.d(t,{Z:()=>s});var a=r(468),i=r.n(a),n=r(360),o=r.n(n)()(i());o.push([e.id,`/* Fix row ha-switch position */
ha-switch {
right: 8px;
}
`,""]);let s=o},360:function(e){e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var r="",a=void 0!==t[5];return t[4]&&(r+="@supports (".concat(t[4],") {")),t[2]&&(r+="@media ".concat(t[2]," {")),a&&(r+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),r+=e(t),a&&(r+="}"),t[2]&&(r+="}"),t[4]&&(r+="}"),r}).join("")},t.i=function(e,r,a,i,n){"string"==typeof e&&(e=[[null,e,void 0]]);var o={};if(a)for(var s=0;s<this.length;s++){var l=this[s][0];null!=l&&(o[l]=!0)}for(var c=0;c<e.length;c++){var h=[].concat(e[c]);a&&o[h[0]]||(void 0!==n&&(void 0===h[5]||(h[1]="@layer".concat(h[5].length>0?" ".concat(h[5]):""," {").concat(h[1],"}")),h[5]=n),r&&(h[2]&&(h[1]="@media ".concat(h[2]," {").concat(h[1],"}")),h[2]=r),i&&(h[4]?(h[1]="@supports (".concat(h[4],") {").concat(h[1],"}"),h[4]=i):h[4]="".concat(i)),t.push(h))}},t}},468:function(e){e.exports=function(e){return e[1]}},899:function(e,t,r){function a(e){let t=-1;return self.Touch&&e instanceof Touch?t=e.identifier:i(e)&&(t=e.pointerId),{id:t,nativeEvent:e,clientX:e.clientX,clientY:e.clientY}}r.r(t),r.d(t,{DiskColorPicker:()=>v});let i=e=>self.PointerEvent&&e instanceof PointerEvent;class n{constructor(e,t){this.startPointers=[],this.currentPointers=[],this.pointerStart=e=>{0===e.button&&this.triggerPointerStart(a(e),e)&&(i(e)?((e.target&&"setPointerCapture"in e.target?e.target:this._e).setPointerCapture(e.pointerId),this.ael("pointermove",this.move),this.ael("pointerup",this.pointerEnd),this.ael("pointercancel",this.pointerEnd)):(window.addEventListener("mousemove",this.move),window.addEventListener("mouseup",this.pointerEnd)))},this.touchStart=e=>{for(let t of Array.from(e.changedTouches))this.triggerPointerStart(a(t),e)},this.move=e=>{let t="changedTouches"in e?Array.from(e.changedTouches).map(e=>a(e)):[a(e)],r=[];for(let e of t){let t=this.currentPointers.findIndex(t=>t.id===e.id);-1!==t&&(r.push(e),this.currentPointers[t]=e)}0!==r.length&&this._h.onMove(r,e)},this._end=(e,t)=>{let r=this.currentPointers.findIndex(t=>t.id===e.id);return -1!==r&&(this.currentPointers.splice(r,1),this.startPointers.splice(r,1),this._h.onEnd&&this._h.onEnd(e,t,"touchcancel"===t.type||"pointercancel"===t.type),!0)},this.pointerEnd=e=>{if(this._end(a(e),e))if(i(e)){if(this.currentPointers.length)return;this.rel("pointermove",this.move),this.rel("pointerup",this.pointerEnd),this.rel("pointercancel",this.pointerEnd)}else window.removeEventListener("mousemove",this.move),window.removeEventListener("mouseup",this.pointerEnd)},this.touchEnd=e=>{for(let t of Array.from(e.changedTouches))this._end(a(t),e)},this._e=e,this._h=t,self.PointerEvent?this.ael("pointerdown",this.pointerStart):(this.ael("mousedown",this.pointerStart),this.ael("touchstart",this.touchStart),this.ael("touchmove",this.move),this.ael("touchend",this.touchEnd),this.ael("touchcancel",this.touchEnd))}ael(e,t){this._e.addEventListener(e,t)}rel(e,t){this._e.removeEventListener(e,t)}stop(){this.rel("pointerdown",this.pointerStart),this.rel("mousedown",this.pointerStart),this.rel("touchstart",this.touchStart),this.rel("touchmove",this.move),this.rel("touchend",this.touchEnd),this.rel("touchcancel",this.touchEnd),this.rel("pointermove",this.move),this.rel("pointerup",this.pointerEnd),this.rel("pointercancel",this.pointerEnd),window.removeEventListener("mousemove",this.move),window.removeEventListener("mouseup",this.pointerEnd)}triggerPointerStart(e,t){return!!this._h.onStart(e,t)&&(this.currentPointers.push(e),this.startPointers.push(e),!0)}}function o(e){return 180/Math.PI*e}function s(e){return Math.PI/180*e}class l{constructor(e,t,r,a=0,i=360){this.anchor=[0,0,0,0],this.degrees=0,this.e=e,this.ri=t,this.ro=r,this.a1=a,this.a2=i,this.tracker=new n(this.e,this)}clamp(e){for(;e<0;)e+=360;return Math.abs(e%360)}isAngleInRange(e){if(this.a1<0){if(e>=0&&e<=this.a2)return!0;let t=e-360;return t>=this.a1&&t<=0}return e>=this.a1&&e<=this.a2}isOnDial(e,t){let r=e-.5,a=t-.5,i=Math.sqrt(r*r+a*a);if(i>=this.ri&&i<=this.ro){let e=this.clamp(Math.round(o(Math.atan2(a,r))));return this.isAngleInRange(e)}return!1}onStart(e,t){t.preventDefault();let r=this.e.getBoundingClientRect();this.anchor=[r.left||r.x,r.top||r.y,r.width,r.height];let a=this.anchor[2],i=this.anchor[3],n=a?(e.clientX-this.anchor[0])/a:0,o=i?(e.clientY-this.anchor[1])/i:0;return!!this.isOnDial(n,o)&&(this.setPosition(n,o),this.e.style.cursor="pointer",!0)}onMove(e){let t=e[0];if(t){let e=this.anchor[2],r=this.anchor[3],a=e?(t.clientX-this.anchor[0])/e:0,i=r?(t.clientY-this.anchor[1])/r:0;this.setPosition(a,i)}}onEnd(){this.e.style.cursor=""}setPosition(e,t){let r=this.clamp(Math.round(o(Math.atan2(t-.5,e-.5))));return!(!this.isAngleInRange(r)||r===this.degrees)&&(this.degrees=r,this.fire(),!0)}fire(){this.e.dispatchEvent(new CustomEvent("p-input",{bubbles:!0,composed:!0,detail:{angle:this.degrees}}))}detach(){this.tracker.stop()}get angle(){return this.degrees}set angle(e){this.degrees=Math.max(this.a1,Math.min(this.a2,this.clamp(e)))}}class c extends HTMLElement{constructor(){super(),this.__n=new Map,this.root=this.attachShadow({mode:"open"})}static get observedAttributes(){return["value"]}attributeChangedCallback(e,t,r){"value"===e&&(this.value=r)}$(e){if(this.__n.has(e))return this.__n.get(e);let t=this.root.querySelector("#"+e);return this.__n.set(e,t),t}$add(e,t,r){"string"==typeof e&&(e=this.$(e)),e&&e.addEventListener(t,r)}$remove(e,t,r){"string"==typeof e&&(e=this.$(e)),e&&e.removeEventListener(t,r)}fire(e,t){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0,detail:t}))}disconnectedCallback(){this.__n.clear()}}let h=/^hsla\s*\(\s*(\d+.?\d*)\s*,\s*(\d+.?\d*)%\s*,\s*(\d+.?\d*)%\s*,\s*(\d+.?\d*)\s*\)$/i,d=/^hsl\s*\(\s*(\d+.?\d*)\s*,\s*(\d+.?\d*)%\s*,\s*(\d+.?\d*)%\s*\)$/i,u=/^rgba\s*\(\s*(\d+.?\d*)\s*,\s*(\d+.?\d*)\s*,\s*(\d+.?\d*)\s*,\s*(\d+.?\d*)\s*\)$/i,m=/^rgb\s*\(\s*(\d+.?\d*)\s*,\s*(\d+.?\d*)\s*,\s*(\d+.?\d*)\s*\)$/i,p=e=>`hsl(${e[0]%360}, ${e[1]}%, ${e[2]}%)`;function f(e,t,r){e%=360;let a=(1-Math.abs(2*(r/=100)-1))*(t/=100),i=a*(1-Math.abs(e/60%2-1)),n=r-a/2,o=0,s=0,l=0;return[o,s,l]=e<60?[a,i,0]:e<120?[i,a,0]:e<180?[0,a,i]:e<240?[0,i,a]:e<300?[i,0,a]:[a,0,i],[Math.round(255*(o+n)),Math.round(255*(s+n)),Math.round(255*(l+n))]}function g(e,t,r){e/=255;let a=Math.max(e,t/=255,r/=255),i=Math.min(e,t,r),n=a-i,o=0;0===n?o=0:a===e?o=(t-r)/n%6*60:a===t?o=60*((r-e)/n+2):a===r&&(o=60*((e-t)/n+4));let s=(a+i)/2;return[Math.round((360+o)%360),Math.round(100*(0===n?0:n/(1-Math.abs(2*s-1)))),Math.round(100*s)]}function y(e,t,r,a){a=Math.round(255*a);let i=Math.round(e).toString(16),n=Math.round(t).toString(16),o=Math.round(r).toString(16),s=a.toString(16);return 1===i.length&&(i="0"+i),1===n.length&&(n="0"+n),1===o.length&&(o="0"+o),1===s.length&&(s="0"+s),(255===a?`#${i}${n}${o}`:`#${i}${n}${o}${s}`).toUpperCase()}class b{constructor(e,t,r){this.anchor=[0,0,0,0],this._a=0,this._d=0,this.e=e,t&&(this._a=this.clampAngle(t)),r&&(this._d=this.clampDist(r)),this.tracker=new n(this.e,this)}clampAngle(e){for(;e<0;)e+=360;return Math.abs(e%360)}clampDist(e){return Math.max(0,Math.min(1,e))}onMove(e){let t=e[0];if(t){let e=this.anchor[2],r=this.anchor[3],a=e?(t.clientX-this.anchor[0])/e:0,i=r?(t.clientY-this.anchor[1])/r:0;this.setPosition(a,i)}}onEnd(){this.e.style.cursor=""}onStart(e,t){t.preventDefault();let r=this.e.getBoundingClientRect();this.anchor=[r.left||r.x,r.top||r.y,r.width,r.height];let a=this.anchor[2],i=this.anchor[3],n=a?(e.clientX-this.anchor[0])/a:0,o=i?(e.clientY-this.anchor[1])/i:0;return this.setPosition(n,o),this.e.style.cursor="pointer",!0}setPosition(e,t){let r=!1,a=this.clampAngle(Math.round(o(Math.atan2(t-.5,e-.5))));a!==this._a&&(this._a=a,r=!0);let i=e-.5,n=t-.5,s=this.clampDist(2*Math.sqrt(i*i+n*n));return s!==this._d&&(this._d=s,r=!0),r&&this.fire(),r}fire(){this.e.dispatchEvent(new CustomEvent("p-input",{bubbles:!0,composed:!0,detail:{angle:this._a,distance:this._d}}))}detach(){this.tracker.stop()}get angle(){return this._a}set angle(e){this._a=this.clampAngle(e)}get distance(){return this._d}set distance(e){this._d=this.clampDist(e)}}class v extends c{constructor(){super(),this._hsla=[0,100,50,1],this.prevWheelParams=[-1,1],this.onWheelFocus=()=>this.$("wheelThumb").classList.add("focused"),this.onWheelBlur=()=>this.$("wheelThumb").classList.remove("focused"),this.onDiskFocus=()=>this.$("diskThumb").classList.add("focused"),this.onDiskBlur=()=>this.$("diskThumb").classList.remove("focused"),this.onWheelKeyDown=e=>{let t=!0,r=e.code,a=this._hsla[2];switch(r){case"ArrowUp":case"ArrowRight":a>0&&(this._hsla[2]=Math.ceil(a)-1,this.updateColor());break;case"ArrowLeft":case"ArrowDown":a<100&&(this._hsla[2]=Math.floor(a)+1,this.updateColor());break;case"End":0!==a&&(this._hsla[2]=0,this.updateColor());break;case"Home":100!==a&&(this._hsla[2]=100,this.updateColor());break;case"Escape":this.$("wheelThumbInput").blur();break;default:t=!1}t&&(e.preventDefault(),e.stopPropagation())},this.onDiskKeyDown=e=>{let t=!0;switch(e.code){case"ArrowRight":this._hsla[0]=(this._hsla[0]+2)%360,this.updateColor();break;case"ArrowLeft":this._hsla[0]=((this._hsla[0]||360)-2)%360,this.updateColor();break;case"ArrowUp":this._hsla[1]<100&&(this._hsla[1]++,this.updateColor());break;case"ArrowDown":this._hsla[1]>0&&(this._hsla[1]--,this.updateColor());break;case"Escape":this.$("diskThumbInput").blur();break;default:t=!1}t&&(e.preventDefault(),e.stopPropagation())},this._renderPending=!1,this.handleDialInput=e=>{this.$("wheelThumbInput").focus();let t=e.detail.angle;this._hsla[2]=100/180*t,this.updateColor(),this._fire()},this.handleDiskInput=e=>{this.$("diskThumbInput").focus();let{angle:t,distance:r}=e.detail;this._hsla[0]=t,this._hsla[1]=Math.round(100*r),this.updateColor(),this._fire()},this.root.innerHTML='\n <style>\n \n* {box-sizing: border-box;}\n.horizontal {display: flex; flex-direction: row;}\n.vertical {display: flex; flex-direction: column;}\n.center {align-items: center;}\n.flex {flex: 1;}\n\n :host {\n display: inline-block;\n touch-action: none;\n }\n canvas {\n display: block;\n margin: 0 auto;\n }\n #base {\n position: relative;\n }\n #diskPanel {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n display: grid;\n place-items: center;\n place-content: center;\n pointer-events: none;\n padding: 0 0 6px;\n }\n .knob {\n position: relative;\n width: 20px;\n height: 20px;\n border: 2px solid #fff;\n box-shadow: 0 2px 1px -1px rgba(0,0,0,.2), 0 1px 1px 0 rgba(0,0,0,.14), 0 1px 3px 0 rgba(0,0,0,.12);\n border-radius: 50%;\n background: var(--ecp-i-thumb-color);\n }\n .thumb {\n position: absolute;\n width: 40px;\n height: 40px;\n padding: 10px;\n border-radius: 50%;\n overflow: hidden;\n background: transparent;\n top: -20px;\n left: -20px;\n }\n .thumb::before {\n content: \'\';\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n border-radius: 50%;\n opacity: 0.2;\n background: var(--ecp-i-thumb-shadow-color);\n pointer-events: none;\n transform: scale(0);\n transition: transform 0.18s ease;\n }\n .thumb.focused::before {\n transform: scale(1);\n }\n #wheelThumb {\n pointer-events: none;\n }\n #diskThumb {\n pointer-events: auto;\n cursor: pointer;\n }\n #disk {\n border-radius: 50%;\n }\n #diskTarget {\n position: relative;\n border-radius: 50%;\n pointer-events: auto;\n }\n input {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n border: none;\n cursor: pointer;\n opacity: 0;\n font-size: 16px;\n }\n </style>\n <div id="base">\n <canvas id="wheel" width="280" height="280"></canvas>\n <div id="wheelThumb" class="thumb">\n <div class="knob"></div>\n <input readonly id="wheelThumbInput" tabindex="2">\n </div>\n <div id="diskPanel">\n <div id="diskTarget">\n <canvas id="disk" width="180" height="180"></canvas>\n <div id="diskThumb" class="thumb">\n <div class="knob"></div>\n <input readonly id="diskThumbInput" tabindex="1">\n </div>\n </div>\n </div>\n </div>\n '}connectedCallback(){let e=this.$("wheel"),{width:t,height:r}=e,a=Math.min(t,r),i=a/2-2+10;this.dialC=new l(e,(i-50)/a,i/a,0,180),this.$add(e,"p-input",this.handleDialInput);let n=this.$("diskTarget");this.diskC=new b(n,0,0),this.$add(n,"p-input",this.handleDiskInput),this.$add("wheelThumbInput","focus",this.onWheelFocus),this.$add("wheelThumbInput","blur",this.onWheelBlur),this.$add("wheelThumbInput","keydown",this.onWheelKeyDown),this.$add("diskThumbInput","focus",this.onDiskFocus),this.$add("diskThumbInput","blur",this.onDiskBlur),this.$add("diskThumbInput","keydown",this.onDiskKeyDown),this.renderDisk(),this.updateColor()}disconnectedCallback(){this.dialC&&(this.dialC.detach(),this.dialC=void 0),this.diskC&&(this.diskC.detach(),this.diskC=void 0),this.$remove("wheelThumbInput","focus",this.onWheelFocus),this.$remove("wheelThumbInput","blur",this.onWheelBlur),this.$remove("wheelThumbInput","keydown",this.onWheelKeyDown),this.$remove("diskThumbInput","focus",this.onDiskFocus),this.$remove("diskThumbInput","blur",this.onDiskBlur),this.$remove("diskThumbInput","keydown",this.onDiskKeyDown),this.$remove("diskTarget","p-input",this.handleDiskInput),this.$remove("wheel","p-input",this.handleDialInput),super.disconnectedCallback()}updateColor(){let[e,t,r]=this._hsla;this.diskC&&(this.diskC.angle=e,this.diskC.distance=t/100),this.dialC&&(this.dialC.angle=1.8*r),this.deferredRender()}deferredRender(){this._renderPending||(this._renderPending=!0,requestAnimationFrame(()=>{this._renderPending=!1,this.updateDiskThumb(),this.updateWheelThumb(),this.renderWheel()}))}updateDiskThumb(){let e=this.$("diskThumb");if(e&&this.diskC){let t=this.diskC.angle,r=90*this.diskC.distance,a=r*Math.cos(s(t))+90,i=r*Math.sin(s(t))+90;e.style.transform=`translate3d(${a}px, ${i}px, 0)`,e.style.setProperty("--ecp-i-thumb-color",p(this._hsla));let[n,o]=this._hsla;e.style.setProperty("--ecp-i-thumb-shadow-color",p([n,o,40,1]))}}updateWheelThumb(){let e=this.$("wheelThumb");if(e){let[t,r,a]=this._hsla,i=1.8*a,{width:n,height:o}=this.$("wheel"),l=Math.min(n,o)/2-10-2.5,c=n/2+l*Math.cos(s(i)),h=o/2+l*Math.sin(s(i));e.style.transform=`translate3d(${c}px, ${h}px, 0)`,e.style.setProperty("--ecp-i-thumb-color",p(this._hsla)),e.style.setProperty("--ecp-i-thumb-shadow-color",p([t,r,50,1]))}}renderWheel(){let[e,t]=this._hsla,[r,a]=this.prevWheelParams;if(e===r&&t===a)return;let i=this.$("wheel"),n=i.getContext("2d"),{width:o,height:s}=i;n.clearRect(0,0,o,s);let l=Math.PI/40,c=Math.min(o,s)/2-2,h=c-20,d=o/2,u=s/2;for(let r=1;r<=40;r++){let a=r*l,i=(r-1)*l,o=h+(c-h)/2,s=Math.cos(a)*o+d,m=Math.sin(a)*o+u,f=Math.cos(i)*o+d,g=Math.sin(i)*o+u,y=[e,t,2.5*r,1],b=[e,t,2.5*(r-1),1],v=n.createLinearGradient(s,m,f,g);v.addColorStop(0,p(y)),v.addColorStop(1,p(b)),n.beginPath(),n.arc(d,u,c,i-.002,a+.002,!1),n.arc(d,u,h,a+.002,i-.002,!0),n.fillStyle=v,n.fill()}this.prevWheelParams=[e,t]}renderDisk(){let e=this.$("disk").getContext("2d");e.clearRect(0,0,180,180);let t=document.createElement("canvas");t.width=t.height=180;let r=t.getContext("2d"),a=0,i=[255,0,0],n=0;for(;a++<360;){let o=(n+3-1)%3;i[n]<255?i[n]=i[n]+4.322>255?255:i[n]+4.322:i[o]>0?i[o]=i[o]>4.322?i[o]-4.322:0:i[n]>=255&&(i[n]=255,n=(n+1)%3),r.clearRect(0,0,180,180);let l=r.createRadialGradient(90,90,0,90,90,90);l.addColorStop(0,"white"),l.addColorStop(1,"rgb("+i.map(function(e){return Math.floor(e)}).join(",")+")"),r.fillStyle=l,r.globalCompositeOperation="source-over",r.beginPath(),r.arc(90,90,90,0,2*Math.PI),r.closePath(),r.fill(),r.globalCompositeOperation="destination-out",r.beginPath(),r.arc(90,90,0,s(a+1),s(a+1)),r.arc(90,90,91,s(a+1),s(a+1)),r.arc(90,90,91,s(a+1),s(a-1)),r.arc(90,90,0,s(a+1),s(a-1)),r.closePath(),r.fill(),e.drawImage(t,0,0)}}_fire(){this.fire("change")}get hsl(){return[...this._hsla]}get rgb(){let[e,t,r]=f(this._hsla[0],this._hsla[1],this._hsla[2]);return[e,t,r,this._hsla[3]]}get value(){return y(...this.rgb)}set value(e){let t=function(e){let t=(e=e.trim()).match(h);if(t){let e=+t[1],r=+t[2],a=+t[3],i=+t[4],[n,o,s]=f(e,r,a);return{hex:y(n,o,s,i),hsla:[e,r,a,i],rgba:[n,o,s,i]}}if(t=e.match(d)){let e=+t[1],r=+t[2],a=+t[3],[i,n,o]=f(e,r,a);return{hex:y(i,n,o,1),hsla:[e,r,a,1],rgba:[i,n,o,1]}}if(t=e.match(u)){let e=+t[1],r=+t[2],a=+t[3],i=+t[4],[n,o,s]=g(e,r,a);return{hex:y(e,r,a,i),hsla:[n,o,s,i],rgba:[e,r,a,i]}}if(t=e.match(m)){let e=+t[1],r=+t[2],a=+t[3],[i,n,o]=g(e,r,a);return{hex:y(e,r,a,1),hsla:[i,n,o,1],rgba:[e,r,a,1]}}let r=e,a=r.lastIndexOf("#");a>=0&&(r=r.substring(a+1));let i=function(e){switch(e.length){case 3:return[+`0x${e[0]}${e[0]}`,+`0x${e[1]}${e[1]}`,+`0x${e[2]}${e[2]}`,1];case 4:return[+`0x${e[0]}${e[0]}`,+`0x${e[1]}${e[1]}`,+`0x${e[2]}${e[2]}`,`0x${e[3]}${e[3]}`/255];case 6:return[+`0x${e[0]}${e[1]}`,+`0x${e[2]}${e[3]}`,+`0x${e[4]}${e[5]}`,1];case 8:return[+`0x${e[0]}${e[1]}`,+`0x${e[2]}${e[3]}`,+`0x${e[4]}${e[5]}`,`0x${e[6]}${e[7]}`/255]}return null}(r);if(i){let[e,t,r,a]=i;if(isNaN(e)||isNaN(t)||isNaN(r)||isNaN(a))return null;let[n,o,s]=g(e,t,r);return{hex:y(e,t,r,a),hsla:[n,o,s,a],rgba:[e,t,r,a]}}return null}(e);t&&(this._hsla=[...t.hsla],this.updateColor())}}customElements.define("disk-color-picker",v)}},t={};function r(a){var i=t[a];if(void 0!==i)return i.exports;var n=t[a]={id:a,exports:{}};return e[a](n,n.exports,r),n.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var a in t)r.o(t,a)&&!r.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.rv=()=>"1.4.5",r.ruid="bundler=rspack@1.4.5",(()=>{var e,t={i8:"2.0.12"};let a=globalThis,i=a.ShadowRoot&&(void 0===a.ShadyCSS||a.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,n=Symbol(),o=new WeakMap;class s{constructor(e,t,r){if(this._$cssResult$=!0,r!==n)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(i&&void 0===e){let r=void 0!==t&&1===t.length;r&&(e=o.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&o.set(t,e))}return e}toString(){return this.cssText}}let l=(e,...t)=>new s(1===e.length?e[0]:t.reduce((t,r,a)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+e[a+1],e[0]),e,n),c=i?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(let r of e.cssRules)t+=r.cssText;return(e=>new s("string"==typeof e?e:e+"",void 0,n))(t)})(e):e,{is:h,defineProperty:d,getOwnPropertyDescriptor:u,getOwnPropertyNames:m,getOwnPropertySymbols:p,getPrototypeOf:f}=Object,g=globalThis,y=g.trustedTypes,b=y?y.emptyScript:"",v=g.reactiveElementPolyfillSupport,w={toAttribute(e,t){switch(t){case Boolean:e=e?b:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let r=e;switch(t){case Boolean:r=null!==e;break;case Number:r=null===e?null:Number(e);break;case Object:case Array:try{r=JSON.parse(e)}catch(e){r=null}}return r}},x=(e,t)=>!h(e,t),k={attribute:!0,type:String,converter:w,reflect:!1,useDefault:!1,hasChanged:x};Symbol.metadata??=Symbol("metadata"),g.litPropertyMetadata??=new WeakMap;class C extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=k){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let r=Symbol(),a=this.getPropertyDescriptor(e,r,t);void 0!==a&&d(this.prototype,e,a)}}static getPropertyDescriptor(e,t,r){let{get:a,set:i}=u(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:a,set(t){let n=a?.call(this);i?.call(this,t),this.requestUpdate(e,n,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??k}static _$Ei(){if(this.hasOwnProperty("elementProperties"))return;let e=f(this);e.finalize(),void 0!==e.l&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty("finalized"))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty("properties")){let e=this.properties;for(let t of[...m(e),...p(e)])this.createProperty(t,e[t])}let e=this[Symbol.metadata];if(null!==e){let t=litPropertyMetadata.get(e);if(void 0!==t)for(let[e,r]of t)this.elementProperties.set(e,r)}for(let[e,t]of(this._$Eh=new Map,this.elementProperties)){let r=this._$Eu(e,t);void 0!==r&&this._$Eh.set(r,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e))for(let r of new Set(e.flat(1/0).reverse()))t.unshift(c(r));else void 0!==e&&t.push(c(e));return t}static _$Eu(e,t){let r=t.attribute;return!1===r?void 0:"string"==typeof r?r:"string"==typeof e?e.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(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(e=>e(this))}addController(e){(this._$EO??=new Set).add(e),void 0!==this.renderRoot&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map;for(let t of this.constructor.elementProperties.keys())this.hasOwnProperty(t)&&(e.set(t,this[t]),delete this[t]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((e,t)=>{if(i)e.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let r of t){let t=document.createElement("style"),i=a.litNonce;void 0!==i&&t.setAttribute("nonce",i),t.textContent=r.cssText,e.appendChild(t)}})(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(e=>e.hostConnected?.())}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach(e=>e.hostDisconnected?.())}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$ET(e,t){let r=this.constructor.elementProperties.get(e),a=this.constructor._$Eu(e,r);if(void 0!==a&&!0===r.reflect){let i=(void 0!==r.converter?.toAttribute?r.converter:w).toAttribute(t,r.type);this._$Em=e,null==i?this.removeAttribute(a):this.setAttribute(a,i),this._$Em=null}}_$AK(e,t){let r=this.constructor,a=r._$Eh.get(e);if(void 0!==a&&this._$Em!==a){let e=r.getPropertyOptions(a),i="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==e.converter?.fromAttribute?e.converter:w;this._$Em=a,this[a]=i.fromAttribute(t,e.type)??this._$Ej?.get(a)??null,this._$Em=null}}requestUpdate(e,t,r){if(void 0!==e){let a=this.constructor,i=this[e];if(!(((r??=a.getPropertyOptions(e)).hasChanged??x)(i,t)||r.useDefault&&r.reflect&&i===this._$Ej?.get(e)&&!this.hasAttribute(a._$Eu(e,r))))return;this.C(e,t,r)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:r,reflect:a,wrapped:i},n){r&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,n??t??this[e]),!0!==i||void 0!==n)||(this._$AL.has(e)||(this.hasUpdated||r||(t=void 0),this._$AL.set(e,t)),!0===a&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}let e=this.constructor.elementProperties;if(e.size>0)for(let[t,r]of e){let{wrapped:e}=r,a=this[t];!0!==e||this._$AL.has(t)||void 0===a||this.C(t,void 0,r,a)}}let e=!1,t=this._$AL;try{(e=this.shouldUpdate(t))?(this.willUpdate(t),this._$EO?.forEach(e=>e.hostUpdate?.()),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach(e=>e.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach(e=>this._$ET(e,this[e])),this._$EM()}updated(e){}firstUpdated(e){}}C.elementStyles=[],C.shadowRootOptions={mode:"open"},C.elementProperties=new Map,C.finalized=new Map,v?.({ReactiveElement:C}),(g.reactiveElementVersions??=[]).push("2.1.0");let P=globalThis,_=P.trustedTypes,S=_?_.createPolicy("lit-html",{createHTML:e=>e}):void 0,A="$lit$",T=`lit$${Math.random().toFixed(9).slice(2)}$`,E="?"+T,$=`<${E}>`,M=document,D=()=>M.createComment(""),I=e=>null===e||"object"!=typeof e&&"function"!=typeof e,R=Array.isArray,B="[ \n\f\r]",F=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,O=/-->/g,L=/>/g,H=RegExp(`>|${B}(?:([^\\s"'>=/]+)(${B}*=${B}*(?:[^
\f\r"'\`<>=]|("|')|))|$)`,"g"),N=/'/g,V=/"/g,U=/^(?:script|style|textarea|title)$/i,z=e=>(t,...r)=>({_$litType$:e,strings:t,values:r}),Z=z(1),j=(z(2),z(3),Symbol.for("lit-noChange")),q=Symbol.for("lit-nothing"),W=new WeakMap,Y=M.createTreeWalker(M,129);function K(e,t){if(!R(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==S?S.createHTML(t):t}class G{constructor({strings:e,_$litType$:t},r){let a;this.parts=[];let i=0,n=0,o=e.length-1,s=this.parts,[l,c]=((e,t)=>{let r=e.length-1,a=[],i,n=2===t?"<svg>":3===t?"<math>":"",o=F;for(let t=0;t<r;t++){let r=e[t],s,l,c=-1,h=0;for(;h<r.length&&(o.lastIndex=h,null!==(l=o.exec(r)));)h=o.lastIndex,o===F?"!--"===l[1]?o=O:void 0!==l[1]?o=L:void 0!==l[2]?(U.test(l[2])&&(i=RegExp("</"+l[2],"g")),o=H):void 0!==l[3]&&(o=H):o===H?">"===l[0]?(o=i??F,c=-1):void 0===l[1]?c=-2:(c=o.lastIndex-l[2].length,s=l[1],o=void 0===l[3]?H:'"'===l[3]?V:N):o===V||o===N?o=H:o===O||o===L?o=F:(o=H,i=void 0);let d=o===H&&e[t+1].startsWith("/>")?" ":"";n+=o===F?r+$:c>=0?(a.push(s),r.slice(0,c)+A+r.slice(c)+T+d):r+T+(-2===c?t:d)}return[K(e,n+(e[r]||"<?>")+(2===t?"</svg>":3===t?"</math>":"")),a]})(e,t);if(this.el=G.createElement(l,r),Y.currentNode=this.el.content,2===t||3===t){let e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;null!==(a=Y.nextNode())&&s.length<o;){if(1===a.nodeType){if(a.hasAttributes())for(let e of a.getAttributeNames())if(e.endsWith(A)){let t=c[n++],r=a.getAttribute(e).split(T),o=/([.?@])?(.*)/.exec(t);s.push({type:1,index:i,name:o[2],strings:r,ctor:"."===o[1]?et:"?"===o[1]?er:"@"===o[1]?ea:ee}),a.removeAttribute(e)}else e.startsWith(T)&&(s.push({type:6,index:i}),a.removeAttribute(e));if(U.test(a.tagName)){let e=a.textContent.split(T),t=e.length-1;if(t>0){a.textContent=_?_.emptyScript:"";for(let r=0;r<t;r++)a.append(e[r],D()),Y.nextNode(),s.push({type:2,index:++i});a.append(e[t],D())}}}else if(8===a.nodeType)if(a.data===E)s.push({type:2,index:i});else{let e=-1;for(;-1!==(e=a.data.indexOf(T,e+1));)s.push({type:7,index:i}),e+=T.length-1}i++}}static createElement(e,t){let r=M.createElement("template");return r.innerHTML=e,r}}function X(e,t,r=e,a){if(t===j)return t;let i=void 0!==a?r._$Co?.[a]:r._$Cl,n=I(t)?void 0:t._$litDirective$;return i?.constructor!==n&&(i?._$AO?.(!1),void 0===n?i=void 0:(i=new n(e))._$AT(e,r,a),void 0!==a?(r._$Co??=[])[a]=i:r._$Cl=i),void 0!==i&&(t=X(e,i._$AS(e,t.values),i,a)),t}class J{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:r}=this._$AD,a=(e?.creationScope??M).importNode(t,!0);Y.currentNode=a;let i=Y.nextNode(),n=0,o=0,s=r[0];for(;void 0!==s;){if(n===s.index){let t;2===s.type?t=new Q(i,i.nextSibling,this,e):1===s.type?t=new s.ctor(i,s.name,s.strings,this,e):6===s.type&&(t=new ei(i,this,e)),this._$AV.push(t),s=r[++o]}n!==s?.index&&(i=Y.nextNode(),n++)}return Y.currentNode=M,a}p(e){let t=0;for(let r of this._$AV)void 0!==r&&(void 0!==r.strings?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}}class Q{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,r,a){this.type=2,this._$AH=q,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=a,this._$Cv=a?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return void 0!==t&&11===e?.nodeType&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){let r;I(e=X(this,e,t))?e===q||null==e||""===e?(this._$AH!==q&&this._$AR(),this._$AH=q):e!==this._$AH&&e!==j&&this._(e):void 0!==e._$litType$?this.$(e):void 0!==e.nodeType?this.T(e):R(r=e)||"function"==typeof r?.[Symbol.iterator]?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==q&&I(this._$AH)?this._$AA.nextSibling.data=e:this.T(M.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:r}=e,a="number"==typeof r?this._$AC(e):(void 0===r.el&&(r.el=G.createElement(K(r.h,r.h[0]),this.options)),r);if(this._$AH?._$AD===a)this._$AH.p(t);else{let e=new J(a,this),r=e.u(this.options);e.p(t),this.T(r),this._$AH=e}}_$AC(e){let t=W.get(e.strings);return void 0===t&&W.set(e.strings,t=new G(e)),t}k(e){R(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,r,a=0;for(let i of e)a===t.length?t.push(r=new Q(this.O(D()),this.O(D()),this,this.options)):r=t[a],r._$AI(i),a++;a<t.length&&(this._$AR(r&&r._$AB.nextSibling,a),t.length=a)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e&&e!==this._$AB;){let t=e.nextSibling;e.remove(),e=t}}setConnected(e){void 0===this._$AM&&(this._$Cv=e,this._$AP?.(e))}}class ee{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,a,i){this.type=1,this._$AH=q,this._$AN=void 0,this.element=e,this.name=t,this._$AM=a,this.options=i,r.length>2||""!==r[0]||""!==r[1]?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=q}_$AI(e,t=this,r,a){let i=this.strings,n=!1;if(void 0===i)(n=!I(e=X(this,e,t,0))||e!==this._$AH&&e!==j)&&(this._$AH=e);else{let a,o,s=e;for(e=i[0],a=0;a<i.length-1;a++)(o=X(this,s[r+a],t,a))===j&&(o=this._$AH[a]),n||=!I(o)||o!==this._$AH[a],o===q?e=q:e!==q&&(e+=(o??"")+i[a+1]),this._$AH[a]=o}n&&!a&&this.j(e)}j(e){e===q?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class et extends ee{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===q?void 0:e}}class er extends ee{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==q)}}class ea extends ee{constructor(e,t,r,a,i){super(e,t,r,a,i),this.type=5}_$AI(e,t=this){if((e=X(this,e,t,0)??q)===j)return;let r=this._$AH,a=e===q&&r!==q||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,i=e!==q&&(r===q||a);a&&this.element.removeEventListener(this.name,this,r),i&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}}class ei{constructor(e,t,r){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(e){X(this,e)}}let en=P.litHtmlPolyfillSupport;en?.(G,Q),(P.litHtmlVersions??=[]).push("3.3.0");let eo=globalThis;class es extends C{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=((e,t,r)=>{let a=r?.renderBefore??t,i=a._$litPart$;if(void 0===i){let e=r?.renderBefore??null;a._$litPart$=i=new Q(t.insertBefore(D(),e),e,void 0,r??{})}return i._$AI(e),i})(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return j}}es._$litElement$=!0,es.finalized=!0,eo.litElementHydrateSupport?.({LitElement:es});let el=eo.litElementPolyfillSupport;el?.({LitElement:es}),(eo.litElementVersions??=[]).push("4.2.0");let ec={attribute:!0,type:String,converter:w,reflect:!1,hasChanged:x};function eh(e){return(t,r)=>"object"==typeof r?((e=ec,t,r)=>{let{kind:a,metadata:i}=r,n=globalThis.litPropertyMetadata.get(i);if(void 0===n&&globalThis.litPropertyMetadata.set(i,n=new Map),"setter"===a&&((e=Object.create(e)).wrapped=!0),n.set(r.name,e),"accessor"===a){let{name:a}=r;return{set(r){let i=t.get.call(this);t.set.call(this,r),this.requestUpdate(a,i,e)},init(t){return void 0!==t&&this.C(a,void 0,e,t),t}}}if("setter"===a){let{name:a}=r;return function(r){let i=this[a];t.call(this,r),this.requestUpdate(a,i,e)}}throw Error("Unsupported decorator location: "+a)})(e,t,r):((e,t,r)=>{let a=t.hasOwnProperty(r);return t.constructor.createProperty(r,e),a?Object.getOwnPropertyDescriptor(t,r):void 0})(e,t,r)}function ed(e){return eh({...e,state:!0,attribute:!1})}function eu(e){return e<0?-1:+(0!==e)}function em(e,t,r){return r<e?e:r>t?t:r}function ep(e){return(e%=360)<0&&(e+=360),e}function ef(e){return(e%=360)<0&&(e+=360),e}function eg(e,t){return 180-Math.abs(Math.abs(e-t)-180)}function ey(e,t){let r=e[0]*t[0][0]+e[1]*t[0][1]+e[2]*t[0][2];return[r,e[0]*t[1][0]+e[1]*t[1][1]+e[2]*t[1][2],e[0]*t[2][0]+e[1]*t[2][1]+e[2]*t[2][2]]}let eb=[[.41233895,.35762064,.18051042],[.2126,.7152,.0722],[.01932141,.11916382,.95034478]],ev=[[3.2413774792388685,-1.5376652402851851,-.49885366846268053],[-.9691452513005321,1.8758853451067872,.04156585616912061],[.05562093689691305,-.20395524564742123,1.0571799111220335]],ew=[95.047,100,108.883];function ex(e,t,r){return(-0x1000000|(255&e)<<16|(255&t)<<8|255&r)>>>0}function ek(e){let t=eM(e[0]);return ex(t,eM(e[1]),eM(e[2]))}function eC(e){return e>>16&255}function eP(e){return e>>8&255}function e_(e,t,r){let a=ev[0][0]*e+ev[0][1]*t+ev[0][2]*r,i=ev[1][0]*e+ev[1][1]*t+ev[1][2]*r,n=ev[2][0]*e+ev[2][1]*t+ev[2][2]*r,o=eM(a);return ex(o,eM(i),eM(n))}function eS(e){let t=e$(eC(e)),r=e$(eP(e)),a=e$(255&e),i=eb[0][0]*t+eb[0][1]*r+eb[0][2]*a,n=eb[1][0]*t+eb[1][1]*r+eb[1][2]*a,o=eb[2][0]*t+eb[2][1]*r+eb[2][2]*a,s=i/ew[0],l=n/ew[1],c=o/ew[2],h=eD(s),d=eD(l);return[116*d-16,500*(h-d),200*(d-eD(c))]}function eA(e){return 116*eD(function(e){let t=e$(eC(e));return ey([t,e$(eP(e)),e$(255&e)],eb)}(e)[1]/100)-16}function eT(e){return 100*eI((e+16)/116)}function eE(e){return 116*eD(e/100)-16}function e$(e){let t=e/255;return t<=.040449936?t/12.92*100:100*Math.pow((t+.055)/1.055,2.4)}function eM(e){var t;let r=e/100;return(t=Math.round(255*(r<=.0031308?12.92*r:1.055*Math.pow(r,1/2.4)-.055)))<0?0:t>255?255:t}function eD(e){return e>216/24389?Math.pow(e,1/3):(24389/27*e+16)/116}function eI(e){let t=e*e*e;return t>216/24389?t:(116*e-16)/(24389/27)}class eR{static make(e=ew,t=200/Math.PI*eT(50)/100,r=50,a=2,i=!1){var n,o;let s=.401288*e[0]+.650173*e[1]+-.051461*e[2],l=-.250268*e[0]+1.204414*e[1]+.045854*e[2],c=-.002079*e[0]+.048952*e[1]+.953127*e[2],h=.8+a/10,d=h>=.9?(1-(n=(h-.9)*10))*.59+.69*n:(1-(o=(h-.8)*10))*.525+.59*o,u=i?1:h*(1-1/3.6*Math.exp((-t-42)/92)),m=[100/s*(u=u>1?1:u<0?0:u)+1-u,100/l*u+1-u,100/c*u+1-u],p=1/(5*t+1),f=p*p*p*p,g=1-f,y=f*t+.1*g*g*Math.cbrt(5*t),b=eT(r)/e[1],v=1.48+Math.sqrt(b),w=.725/Math.pow(b,.2),x=[Math.pow(y*m[0]*s/100,.42),Math.pow(y*m[1]*l/100,.42),Math.pow(y*m[2]*c/100,.42)],k=[400*x[0]/(x[0]+27.13),400*x[1]/(x[1]+27.13),400*x[2]/(x[2]+27.13)];return new eR(b,(2*k[0]+k[1]+.05*k[2])*w,w,w,d,h,m,y,Math.pow(y,.25),v)}constructor(e,t,r,a,i,n,o,s,l,c){this.n=e,this.aw=t,this.nbb=r,this.ncb=a,this.c=i,this.nc=n,this.rgbD=o,this.fl=s,this.fLRoot=l,this.z=c}}eR.DEFAULT=eR.make();class eB{constructor(e,t,r,a,i,n,o,s,l){this.hue=e,this.chroma=t,this.j=r,this.q=a,this.m=i,this.s=n,this.jstar=o,this.astar=s,this.bstar=l}distance(e){let t=this.jstar-e.jstar,r=this.astar-e.astar,a=this.bstar-e.bstar;return 1.41*Math.pow(Math.sqrt(t*t+r*r+a*a),.63)}static fromInt(e){return eB.fromIntInViewingConditions(e,eR.DEFAULT)}static fromIntInViewingConditions(e,t){let r=e$((0xff0000&e)>>16),a=e$((65280&e)>>8),i=e$(255&e),n=.41233895*r+.35762064*a+.18051042*i,o=.2126*r+.7152*a+.0722*i,s=.01932141*r+.11916382*a+.95034478*i,l=t.rgbD[0]*(.401288*n+.650173*o-.051461*s),c=t.rgbD[1]*(-.250268*n+1.204414*o+.045854*s),h=t.rgbD[2]*(-.002079*n+.048952*o+.953127*s),d=Math.pow(t.fl*Math.abs(l)/100,.42),u=Math.pow(t.fl*Math.abs(c)/100,.42),m=Math.pow(t.fl*Math.abs(h)/100,.42),p=400*eu(l)*d/(d+27.13),f=400*eu(c)*u/(u+27.13),g=400*eu(h)*m/(m+27.13),y=(11*p+-12*f+g)/11,b=(p+f-2*g)/9,v=180*Math.atan2(b,y)/Math.PI,w=v<0?v+360:v>=360?v-360:v,x=w*Math.PI/180,k=100*Math.pow((40*p+20*f+g)/20*t.nbb/t.aw,t.c*t.z),C=4/t.c*Math.sqrt(k/100)*(t.aw+4)*t.fLRoot,P=Math.pow(5e4/13*(.25*(Math.cos((w<20.14?w+360:w)*Math.PI/180+2)+3.8))*t.nc*t.ncb*Math.sqrt(y*y+b*b)/((20*p+20*f+21*g)/20+.305),.9)*Math.pow(1.64-Math.pow(.29,t.n),.73),_=P*Math.sqrt(k/100),S=_*t.fLRoot,A=50*Math.sqrt(P*t.c/(t.aw+4)),T=1/.0228*Math.log(1+.0228*S);return new eB(w,_,k,C,S,A,(1+100*.007)*k/(1+.007*k),T*Math.cos(x),T*Math.sin(x))}static fromJch(e,t,r){return eB.fromJchInViewingConditions(e,t,r,eR.DEFAULT)}static fromJchInViewingConditions(e,t,r,a){let i=4/a.c*Math.sqrt(e/100)*(a.aw+4)*a.fLRoot,n=t*a.fLRoot,o=50*Math.sqrt(t/Math.sqrt(e/100)*a.c/(a.aw+4)),s=r*Math.PI/180,l=1/.0228*Math.log(1+.0228*n);return new eB(r,t,e,i,n,o,(1+100*.007)*e/(1+.007*e),l*Math.cos(s),l*Math.sin(s))}static fromUcs(e,t,r){return eB.fromUcsInViewingConditions(e,t,r,eR.DEFAULT)}static fromUcsInViewingConditions(e,t,r,a){let i=(Math.exp(.0228*Math.sqrt(t*t+r*r))-1)/.0228/a.fLRoot,n=180/Math.PI*Math.atan2(r,t);return n<0&&(n+=360),eB.fromJchInViewingConditions(e/(1-(e-100)*.007),i,n,a)}toInt(){return this.viewed(eR.DEFAULT)}viewed(e){let t=Math.pow((0===this.chroma||0===this.j?0:this.chroma/Math.sqrt(this.j/100))/Math.pow(1.64-Math.pow(.29,e.n),.73),1/.9),r=this.hue*Math.PI/180,a=.25*(Math.cos(r+2)+3.8),i=e.aw*Math.pow(this.j/100,1/e.c/e.z),n=5e4/13*a*e.nc*e.ncb,o=i/e.nbb,s=Math.sin(r),l=Math.cos(r),c=23*(o+.305)*t/(23*n+11*t*l+108*t*s),h=c*l,d=c*s,u=(460*o+451*h+288*d)/1403,m=(460*o-891*h-261*d)/1403,p=(460*o-220*h-6300*d)/1403,f=Math.max(0,27.13*Math.abs(u)/(400-Math.abs(u))),g=eu(u)*(100/e.fl)*Math.pow(f,1/.42),y=Math.max(0,27.13*Math.abs(m)/(400-Math.abs(m))),b=eu(m)*(100/e.fl)*Math.pow(y,1/.42),v=Math.max(0,27.13*Math.abs(p)/(400-Math.abs(p))),w=eu(p)*(100/e.fl)*Math.pow(v,1/.42),x=g/e.rgbD[0],k=b/e.rgbD[1],C=w/e.rgbD[2];return e_(1.86206786*x-1.01125463*k+.14918677*C,.38752654*x+.62144744*k-.00897398*C,-.0158415*x-.03412294*k+1.04996444*C)}static fromXyzInViewingConditions(e,t,r,a){let i=a.rgbD[0]*(.401288*e+.650173*t-.051461*r),n=a.rgbD[1]*(-.250268*e+1.204414*t+.045854*r),o=a.rgbD[2]*(-.002079*e+.048952*t+.953127*r),s=Math.pow(a.fl*Math.abs(i)/100,.42),l=Math.pow(a.fl*Math.abs(n)/100,.42),c=Math.pow(a.fl*Math.abs(o)/100,.42),h=400*eu(i)*s/(s+27.13),d=400*eu(n)*l/(l+27.13),u=400*eu(o)*c/(c+27.13),m=(11*h+-12*d+u)/11,p=(h+d-2*u)/9,f=180*Math.atan2(p,m)/Math.PI,g=f<0?f+360:f>=360?f-360:f,y=g*Math.PI/180,b=100*Math.pow((40*h+20*d+u)/20*a.nbb/a.aw,a.c*a.z),v=4/a.c*Math.sqrt(b/100)*(a.aw+4)*a.fLRoot,w=Math.pow(5e4/13*(.25*(Math.cos((g<20.14?g+360:g)*Math.PI/180+2)+3.8))*a.nc*a.ncb*Math.sqrt(m*m+p*p)/((20*h+20*d+21*u)/20+.305),.9)*Math.pow(1.64-Math.pow(.29,a.n),.73),x=w*Math.sqrt(b/100),k=x*a.fLRoot,C=50*Math.sqrt(w*a.c/(a.aw+4)),P=Math.log(1+.0228*k)/.0228;return new eB(g,x,b,v,k,C,(1+100*.007)*b/(1+.007*b),P*Math.cos(y),P*Math.sin(y))}xyzInViewingConditions(e){let t=Math.pow((0===this.chroma||0===this.j?0:this.chroma/Math.sqrt(this.j/100))/Math.pow(1.64-Math.pow(.29,e.n),.73),1/.9),r=this.hue*Math.PI/180,a=.25*(Math.cos(r+2)+3.8),i=e.aw*Math.pow(this.j/100,1/e.c/e.z),n=5e4/13*a*e.nc*e.ncb,o=i/e.nbb,s=Math.sin(r),l=Math.cos(r),c=23*(o+.305)*t/(23*n+11*t*l+108*t*s),h=c*l,d=c*s,u=(460*o+451*h+288*d)/1403,m=(460*o-891*h-261*d)/1403,p=(460*o-220*h-6300*d)/1403,f=Math.max(0,27.13*Math.abs(u)/(400-Math.abs(u))),g=eu(u)*(100/e.fl)*Math.pow(f,1/.42),y=Math.max(0,27.13*Math.abs(m)/(400-Math.abs(m))),b=eu(m)*(100/e.fl)*Math.pow(y,1/.42),v=Math.max(0,27.13*Math.abs(p)/(400-Math.abs(p))),w=eu(p)*(100/e.fl)*Math.pow(v,1/.42),x=g/e.rgbD[0],k=b/e.rgbD[1],C=w/e.rgbD[2];return[1.86206786*x-1.01125463*k+.14918677*C,.38752654*x+.62144744*k-.00897398*C,-.0158415*x-.03412294*k+1.04996444*C]}}class eF{static sanitizeRadians(e){return(e+8*Math.PI)%(2*Math.PI)}static trueDelinearized(e){let t=e/100;return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}static chromaticAdaptation(e){let t=Math.pow(Math.abs(e),.42);return 400*eu(e)*t/(t+27.13)}static hueOf(e){let t=ey(e,eF.SCALED_DISCOUNT_FROM_LINRGB),r=eF.chromaticAdaptation(t[0]),a=eF.chromaticAdaptation(t[1]),i=eF.chromaticAdaptation(t[2]);return Math.atan2((r+a-2*i)/9,(11*r+-12*a+i)/11)}static areInCyclicOrder(e,t,r){return eF.sanitizeRadians(t-e)<eF.sanitizeRadians(r-e)}static intercept(e,t,r){return(t-e)/(r-e)}static lerpPoint(e,t,r){return[e[0]+(r[0]-e[0])*t,e[1]+(r[1]-e[1])*t,e[2]+(r[2]-e[2])*t]}static setCoordinate(e,t,r,a){let i=eF.intercept(e[a],t,r[a]);return eF.lerpPoint(e,i,r)}static isBounded(e){return 0<=e&&e<=100}static nthVertex(e,t){let r=eF.Y_FROM_LINRGB[0],a=eF.Y_FROM_LINRGB[1],i=eF.Y_FROM_LINRGB[2],n=t%4<=1?0:100,o=100*(t%2!=0);if(t<4){let t=(e-n*a-o*i)/r;return eF.isBounded(t)?[t,n,o]:[-1,-1,-1]}if(t<8){let t=(e-o*r-n*i)/a;return eF.isBounded(t)?[o,t,n]:[-1,-1,-1]}{let t=(e-n*r-o*a)/i;return eF.isBounded(t)?[n,o,t]:[-1,-1,-1]}}static bisectToSegment(e,t){let r=[-1,-1,-1],a=r,i=0,n=0,o=!1,s=!0;for(let l=0;l<12;l++){let c=eF.nthVertex(e,l);if(c[0]<0)continue;let h=eF.hueOf(c);if(!o){r=c,a=c,i=h,n=h,o=!0;continue}(s||eF.areInCyclicOrder(i,h,n))&&(s=!1,eF.areInCyclicOrder(i,t,h)?(a=c,n=h):(r=c,i=h))}return[r,a]}static midpoint(e,t){return[(e[0]+t[0])/2,(e[1]+t[1])/2,(e[2]+t[2])/2]}static criticalPlaneBelow(e){return Math.floor(e-.5)}static criticalPlaneAbove(e){return Math.ceil(e-.5)}static bisectToLimit(e,t){let r=eF.bisectToSegment(e,t),a=r[0],i=eF.hueOf(a),n=r[1];for(let e=0;e<3;e++)if(a[e]!==n[e]){let r=-1,o=255;a[e]<n[e]?(r=eF.criticalPlaneBelow(eF.trueDelinearized(a[e])),o=eF.criticalPlaneAbove(eF.trueDelinearized(n[e]))):(r=eF.criticalPlaneAbove(eF.trueDelinearized(a[e])),o=eF.criticalPlaneBelow(eF.trueDelinearized(n[e])));for(let s=0;s<8;s++)if(1>=Math.abs(o-r))break;else{let s=Math.floor((r+o)/2),l=eF.CRITICAL_PLANES[s],c=eF.setCoordinate(a,l,n,e),h=eF.hueOf(c);eF.areInCyclicOrder(i,t,h)?(n=c,o=s):(a=c,i=h,r=s)}}return eF.midpoint(a,n)}static inverseChromaticAdaptation(e){let t=Math.abs(e),r=Math.max(0,27.13*t/(400-t));return eu(e)*Math.pow(r,1/.42)}static findResultByJ(e,t,r){let a=11*Math.sqrt(r),i=eR.DEFAULT,n=1/Math.pow(1.64-Math.pow(.29,i.n),.73),o=5e4/13*(.25*(Math.cos(e+2)+3.8))*i.nc*i.ncb,s=Math.sin(e),l=Math.cos(e);for(let e=0;e<5;e++){let c=a/100,h=Math.pow((0===t||0===a?0:t/Math.sqrt(c))*n,1/.9),d=i.aw*Math.pow(c,1/i.c/i.z)/i.nbb,u=23*(d+.305)*h/(23*o+11*h*l+108*h*s),m=u*l,p=u*s,f=(460*d+451*m+288*p)/1403,g=(460*d-891*m-261*p)/1403,y=(460*d-220*m-6300*p)/1403,b=eF.inverseChromaticAdaptation(f),v=ey([b,eF.inverseChromaticAdaptation(g),eF.inverseChromaticAdaptation(y)],eF.LINRGB_FROM_SCALED_DISCOUNT);if(v[0]<0||v[1]<0||v[2]<0)break;let w=eF.Y_FROM_LINRGB[0],x=eF.Y_FROM_LINRGB[1],k=eF.Y_FROM_LINRGB[2],C=w*v[0]+x*v[1]+k*v[2];if(C<=0)break;if(4===e||.002>Math.abs(C-r)){if(v[0]>100.01||v[1]>100.01||v[2]>100.01)return 0;return ek(v)}a-=(C-r)*a/(2*C)}return 0}static solveToInt(e,t,r){if(t<1e-4||r<1e-4||r>99.9999){let e=eM(eT(r));return ex(e,e,e)}let a=(e=ef(e))/180*Math.PI,i=eT(r),n=eF.findResultByJ(a,t,i);return 0!==n?n:ek(eF.bisectToLimit(i,a))}static solveToCam(e,t,r){return eB.fromInt(eF.solveToInt(e,t,r))}}eF.SCALED_DISCOUNT_FROM_LINRGB=[[.001200833568784504,.002389694492170889,2795742885861124e-19],[5891086651375999e-19,.0029785502573438758,3270666104008398e-19],[10146692491640572e-20,5364214359186694e-19,.0032979401770712076]],eF.LINRGB_FROM_SCALED_DISCOUNT=[[1373.2198709594231,-1100.4251190754821,-7.278681089101213],[-271.815969077903,559.6580465940733,-32.46047482791194],[1.9622899599665666,-57.173814538844006,308.7233197812385]],eF.Y_FROM_LINRGB=[.2126,.7152,.0722],eF.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];class eO{static from(e,t,r){return new eO(eF.solveToInt(e,t,r))}static fromInt(e){return new eO(e)}toInt(){return this.argb}get hue(){return this.internalHue}set hue(e){this.setInternalState(eF.solveToInt(e,this.internalChroma,this.internalTone))}get chroma(){return this.internalChroma}set chroma(e){this.setInternalState(eF.solveToInt(this.internalHue,e,this.internalTone))}get tone(){return this.internalTone}set tone(e){this.setInternalState(eF.solveToInt(this.internalHue,this.internalChroma,e))}setValue(e,t){this[e]=t}toString(){return`HCT(${this.hue.toFixed(0)}, ${this.chroma.toFixed(0)}, ${this.tone.toFixed(0)})`}static isBlue(e){return e>=250&&e<270}static isYellow(e){return e>=105&&e<125}static isCyan(e){return e>=170&&e<207}constructor(e){this.argb=e;let t=eB.fromInt(e);this.internalHue=t.hue,this.internalChroma=t.chroma,this.internalTone=eA(e),this.argb=e}setInternalState(e){let t=eB.fromInt(e);this.internalHue=t.hue,this.internalChroma=t.chroma,this.internalTone=eA(e),this.argb=e}inViewingConditions(e){let t=eB.fromInt(this.toInt()).xyzInViewingConditions(e),r=eB.fromXyzInViewingConditions(t[0],t[1],t[2],eR.make());return eO.from(r.hue,r.chroma,eE(t[1]))}}class eL{static harmonize(e,t){var r;let a=eO.fromInt(e),i=eO.fromInt(t),n=Math.min(.5*eg(a.hue,i.hue),15),o=ef(a.hue+n*(r=a.hue,180>=ef(i.hue-r)?1:-1));return eO.from(o,a.chroma,a.tone).toInt()}static hctHue(e,t,r){let a=eL.cam16Ucs(e,t,r),i=eB.fromInt(a),n=eB.fromInt(e);return eO.from(i.hue,n.chroma,eA(e)).toInt()}static cam16Ucs(e,t,r){let a=eB.fromInt(e),i=eB.fromInt(t),n=a.jstar,o=a.astar,s=a.bstar,l=i.jstar,c=i.astar,h=i.bstar;return eB.fromUcs(n+(l-n)*r,o+(c-o)*r,s+(h-s)*r).toInt()}}class eH{static isDisliked(e){let t=Math.round(e.hue)>=90&&111>=Math.round(e.hue),r=Math.round(e.chroma)>16,a=65>Math.round(e.tone);return t&&r&&a}static fixIfDisliked(e){return eH.isDisliked(e)?eO.from(e.hue,e.chroma,70):e}}class eN{static ratioOfTones(e,t){return e=em(0,100,e),t=em(0,100,t),eN.ratioOfYs(eT(e),eT(t))}static ratioOfYs(e,t){let r=e>t?e:t;return(r+5)/((r===t?e:t)+5)}static lighter(e,t){if(e<0||e>100)return -1;let r=eT(e),a=t*(r+5)-5,i=eN.ratioOfYs(a,r),n=Math.abs(i-t);if(i<t&&n>.04)return -1;let o=eE(a)+.4;return o<0||o>100?-1:o}static darker(e,t){if(e<0||e>100)return -1;let r=eT(e),a=(r+5)/t-5,i=eN.ratioOfYs(r,a),n=Math.abs(i-t);if(i<t&&n>.04)return -1;let o=eE(a)-.4;return o<0||o>100?-1:o}static lighterUnsafe(e,t){let r=eN.lighter(e,t);return r<0?100:r}static darkerUnsafe(e,t){let r=eN.darker(e,t);return r<0?0:r}}function eV(e,t,r){if(e.name!==r.name)throw Error(`Attempting to extend color ${e.name} with color ${r.name} of different name for spec version ${t}.`);if(e.isBackground!==r.isBackground)throw Error(`Attempting to extend color ${e.name} as a ${e.isBackground?"background":"foreground"} with color ${r.name} as a ${r.isBackground?"background":"foreground"} for spec version ${t}.`);return eU.fromPalette({name:e.name,palette:a=>a.specVersion===t?r.palette(a):e.palette(a),tone:a=>a.specVersion===t?r.tone(a):e.tone(a),isBackground:e.isBackground,chromaMultiplier:a=>{let i=a.specVersion===t?r.chromaMultiplier:e.chromaMultiplier;return void 0!==i?i(a):1},background:a=>{let i=a.specVersion===t?r.background:e.background;return void 0!==i?i(a):void 0},secondBackground:a=>{let i=a.specVersion===t?r.secondBackground:e.secondBackground;return void 0!==i?i(a):void 0},contrastCurve:a=>{let i=a.specVersion===t?r.contrastCurve:e.contrastCurve;return void 0!==i?i(a):void 0},toneDeltaPair:a=>{let i=a.specVersion===t?r.toneDeltaPair:e.toneDeltaPair;return void 0!==i?i(a):void 0}})}class eU{static fromPalette(e){return new eU(e.name??"",e.palette,e.tone??eU.getInitialToneFromBackground(e.background),e.isBackground??!1,e.chromaMultiplier,e.background,e.secondBackground,e.contrastCurve,e.toneDeltaPair)}static getInitialToneFromBackground(e){return void 0===e?e=>50:t=>e(t)?e(t).getTone(t):50}constructor(e,t,r,a,i,n,o,s,l){if(this.name=e,this.palette=t,this.tone=r,this.isBackground=a,this.chromaMultiplier=i,this.background=n,this.secondBackground=o,this.contrastCurve=s,this.toneDeltaPair=l,this.hctCache=new Map,!n&&o)throw Error(`Color ${e} has secondBackgrounddefined, but background is not defined.`);if(!n&&s)throw Error(`Color ${e} has contrastCurvedefined, but background is not defined.`);if(n&&!s)throw Error(`Color ${e} has backgrounddefined, but contrastCurve is not defined.`)}clone(){return eU.fromPalette({name:this.name,palette:this.palette,tone:this.tone,isBackground:this.isBackground,chromaMultiplier:this.chromaMultiplier,background:this.background,secondBackground:this.secondBackground,contrastCurve:this.contrastCurve,toneDeltaPair:this.toneDeltaPair})}clearCache(){this.hctCache.clear()}getArgb(e){return this.getHct(e).toInt()}getHct(e){let t=this.hctCache.get(e);if(null!=t)return t;let r=ej(e.specVersion).getHct(e,this);return this.hctCache.size>4&&this.hctCache.clear(),this.hctCache.set(e,r),r}getTone(e){return ej(e.specVersion).getTone(e,this)}static foregroundTone(e,t){let r=eN.lighterUnsafe(e,t),a=eN.darkerUnsafe(e,t),i=eN.ratioOfTones(r,e),n=eN.ratioOfTones(a,e);if(!eU.tonePrefersLightForeground(e))return n>=t||n>=i?a:r;{let e=.1>Math.abs(i-n)&&i<t&&n<t;return i>=t||i>=n||e?r:a}}static tonePrefersLightForeground(e){return 60>Math.round(e)}static toneAllowsLightForeground(e){return 49>=Math.round(e)}static enableLightForeground(e){return eU.tonePrefersLightForeground(e)&&!eU.toneAllowsLightForeground(e)?49:e}}let ez=new class{getHct(e,t){let r=t.getTone(e);return t.palette(e).getHct(r)}getTone(e,t){let r=e.contrastLevel<0,a=t.toneDeltaPair?t.toneDeltaPair(e):void 0;if(a){let i=a.roleA,n=a.roleB,o=a.delta,s=a.polarity,l=a.stayTogether,c="nearer"===s||"lighter"===s&&!e.isDark||"darker"===s&&e.isDark,h=c?i:n,d=c?n:i,u=t.name===h.name,m=e.isDark?1:-1,p=h.tone(e),f=d.tone(e);if(t.background&&h.contrastCurve&&d.contrastCurve){let a=t.background(e),i=h.contrastCurve(e),n=d.contrastCurve(e);if(a&&i&&n){let t=a.getTone(e),o=i.get(e.contrastLevel),s=n.get(e.contrastLevel);eN.ratioOfTones(t,p)<o&&(p=eU.foregroundTone(t,o)),eN.ratioOfTones(t,f)<s&&(f=eU.foregroundTone(t,s)),r&&(p=eU.foregroundTone(t,o),f=eU.foregroundTone(t,s))}}return(f-p)*m<o&&(((f=em(0,100,p+o*m))-p)*m>=o||(p=em(0,100,f-o*m))),50<=p&&p<60?f=m>0?Math.max(f,(p=60)+o*m):Math.min(f,(p=49)+o*m):50<=f&&f<60&&(f=l?m>0?Math.max(f,(p=60)+o*m):Math.min(f,(p=49)+o*m):m>0?60:49),u?p:f}{let a=t.tone(e);if(void 0==t.background||void 0===t.background(e)||void 0==t.contrastCurve||void 0===t.contrastCurve(e))return a;let i=t.background(e).getTone(e),n=t.contrastCurve(e).get(e.contrastLevel);if(eN.ratioOfTones(i,a)>=n||(a=eU.foregroundTone(i,n)),r&&(a=eU.foregroundTone(i,n)),t.isBackground&&50<=a&&a<60&&(a=eN.ratioOfTones(49,i)>=n?49:60),void 0==t.secondBackground||void 0===t.secondBackground(e))return a;let[o,s]=[t.background,t.secondBackground],[l,c]=[o(e).getTone(e),s(e).getTone(e)],[h,d]=[Math.max(l,c),Math.min(l,c)];if(eN.ratioOfTones(h,a)>=n&&eN.ratioOfTones(d,a)>=n)return a;let u=eN.lighter(h,n),m=eN.darker(d,n),p=[];return(-1!==u&&p.push(u),-1!==m&&p.push(m),eU.tonePrefersLightForeground(l)||eU.tonePrefersLightForeground(c))?u<0?100:u:1===p.length?p[0]:m<0?0:m}}},eZ=new class{getHct(e,t){let r=t.palette(e),a=t.getTone(e),i=r.hue,n=r.chroma*(t.chromaMultiplier?t.chromaMultiplier(e):1);return eO.from(i,n,a)}getTone(e,t){let r=t.toneDeltaPair?t.toneDeltaPair(e):void 0;if(r){let a=r.roleA,i=r.roleB,n=r.polarity,o=r.constraint,s="darker"===n||"relative_lighter"===n&&e.isDark||"relative_darker"===n&&!e.isDark?-r.delta:r.delta,l=t.name===a.name,c=l?a:i,h=l?i:a,d=c.tone(e),u=h.getTone(e),m=s*(l?1:-1);if("exact"===o?d=em(0,100,u+m):"nearer"===o?d=m>0?em(0,100,em(u,u+m,d)):em(0,100,em(u+m,u,d)):"farther"===o&&(d=m>0?em(u+m,100,d):em(0,u+m,d)),t.background&&t.contrastCurve){let r=t.background(e),a=t.contrastCurve(e);if(r&&a){let t=r.getTone(e),i=a.get(e.contrastLevel);d=eN.ratioOfTones(t,d)>=i&&e.contrastLevel>=0?d:eU.foregroundTone(t,i)}}return t.isBackground&&!t.name.endsWith("_fixed_dim")&&(d=d>=57?em(65,100,d):em(0,49,d)),d}{let r=t.tone(e);if(void 0==t.background||void 0===t.background(e)||void 0==t.contrastCurve||void 0===t.contrastCurve(e))return r;let a=t.background(e).getTone(e),i=t.contrastCurve(e).get(e.contrastLevel);if(r=eN.ratioOfTones(a,r)>=i&&e.contrastLevel>=0?r:eU.foregroundTone(a,i),t.isBackground&&!t.name.endsWith("_fixed_dim")&&(r=r>=57?em(65,100,r):em(0,49,r)),void 0==t.secondBackground||void 0===t.secondBackground(e))return r;let[n,o]=[t.background,t.secondBackground],[s,l]=[n(e).getTone(e),o(e).getTone(e)],[c,h]=[Math.max(s,l),Math.min(s,l)];if(eN.ratioOfTones(c,r)>=i&&eN.ratioOfTones(h,r)>=i)return r;let d=eN.lighter(c,i),u=eN.darker(h,i),m=[];return(-1!==d&&m.push(d),-1!==u&&m.push(u),eU.tonePrefersLightForeground(s)||eU.tonePrefersLightForeground(l))?d<0?100:d:1===m.length?m[0]:u<0?0:u}}};function ej(e){return"2025"===e?eZ:ez}class eq{static fromInt(e){let t=eO.fromInt(e);return eq.fromHct(t)}static fromHct(e){return new eq(e.hue,e.chroma,e)}static fromHueAndChroma(e,t){let r=new eW(e,t).create();return new eq(e,t,r)}constructor(e,t,r){this.hue=e,this.chroma=t,this.keyColor=r,this.cache=new Map}tone(e){let t=this.cache.get(e);return void 0===t&&(t=99==e&&eO.isYellow(this.hue)?this.averageArgb(this.tone(98),this.tone(100)):eO.from(this.hue,this.chroma,e).toInt(),this.cache.set(e,t)),t}getHct(e){return eO.fromInt(this.tone(e))}averageArgb(e,t){return(-0x1000000|(255&Math.round(((e>>>16&255)+(t>>>16&255))/2))<<16|(255&Math.round(((e>>>8&255)+(t>>>8&255))/2))<<8|255&Math.round(((255&e)+(255&t))/2))>>>0}}class eW{constructor(e,t){this.hue=e,this.requestedChroma=t,this.chromaCache=new Map,this.maxChromaValue=200}create(){let e=0,t=100;for(;e<t;){let r=Math.floor((e+t)/2),a=this.maxChroma(r)<this.maxChroma(r+1);if(this.maxChroma(r)>=this.requestedChroma-.01)if(Math.abs(e-50)<Math.abs(t-50))t=r;else{if(e===r)return eO.from(this.hue,this.requestedChroma,e);e=r}else a?e=r+1:t=r}return eO.from(this.hue,this.requestedChroma,e)}maxChroma(e){if(this.chromaCache.has(e))return this.chromaCache.get(e);let t=eO.from(this.hue,this.maxChromaValue,e).chroma;return this.chromaCache.set(e,t),t}}class eY{constructor(e){this.input=e,this.hctsByTempCache=[],this.hctsByHueCache=[],this.tempsByHctCache=new Map,this.inputRelativeTemperatureCache=-1,this.complementCache=null}get hctsByTemp(){if(this.hctsByTempCache.length>0)return this.hctsByTempCache;let e=this.hctsByHue.concat([this.input]),t=this.tempsByHct;return e.sort((e,r)=>t.get(e)-t.get(r)),this.hctsByTempCache=e,e}get warmest(){return this.hctsByTemp[this.hctsByTemp.length-1]}get coldest(){return this.hctsByTemp[0]}analogous(e=5,t=12){let r=Math.round(this.input.hue),a=this.hctsByHue[r],i=this.relativeTemperature(a),n=[a],o=0;for(let e=0;e<360;e++){let t=ep(r+e),a=this.hctsByHue[t],n=this.relativeTemperature(a),s=Math.abs(n-i);i=n,o+=s}let s=1,l=o/t,c=0;for(i=this.relativeTemperature(a);n.length<t;){let e=ep(r+s),a=this.hctsByHue[e],o=this.relativeTemperature(a),h=(c+=Math.abs(o-i))>=n.length*l,d=1;for(;h&&n.length<t;)n.push(a),h=c>=(n.length+d)*l,d++;if(i=o,++s>360){for(;n.length<t;)n.push(a);break}}let h=[this.input],d=Math.floor((e-1)/2);for(let e=1;e<d+1;e++){let t=0-e;for(;t<0;)t=n.length+t;t>=n.length&&(t%=n.length),h.splice(0,0,n[t])}let u=e-d-1;for(let e=1;e<u+1;e++){let t=e;for(;t<0;)t=n.length+t;t>=n.length&&(t%=n.length),h.push(n[t])}return h}get complement(){if(null!=this.complementCache)return this.complementCache;let e=this.coldest.hue,t=this.tempsByHct.get(this.coldest),r=this.warmest.hue,a=this.tempsByHct.get(this.warmest)-t,i=eY.isBetween(this.input.hue,e,r),n=i?r:e,o=i?e:r,s=1e3,l=this.hctsByHue[Math.round(this.input.hue)],c=1-this.inputRelativeTemperature;for(let e=0;e<=360;e+=1){let r=ef(n+ +e);if(!eY.isBetween(r,n,o))continue;let i=this.hctsByHue[Math.round(r)],h=Math.abs(c-(this.tempsByHct.get(i)-t)/a);h<s&&(s=h,l=i)}return this.complementCache=l,this.complementCache}relativeTemperature(e){let t=this.tempsByHct.get(this.warmest)-this.tempsByHct.get(this.coldest),r=this.tempsByHct.get(e)-this.tempsByHct.get(this.coldest);return 0===t?.5:r/t}get inputRelativeTemperature(){return this.inputRelativeTemperatureCache>=0||(this.inputRelativeTemperatureCache=this.relativeTemperature(this.input)),this.inputRelativeTemperatureCache}get tempsByHct(){if(this.tempsByHctCache.size>0)return this.tempsByHctCache;let e=this.hctsByHue.concat([this.input]),t=new Map;for(let r of e)t.set(r,eY.rawTemperature(r));return this.tempsByHctCache=t,t}get hctsByHue(){if(this.hctsByHueCache.length>0)return this.hctsByHueCache;let e=[];for(let t=0;t<=360;t+=1){let r=eO.from(t,this.input.chroma,this.input.tone);e.push(r)}return this.hctsByHueCache=e,this.hctsByHueCache}static isBetween(e,t,r){return t<r?t<=e&&e<=r:t<=e||e<=r}static rawTemperature(e){let t=eS(e.toInt()),r=ef(180*Math.atan2(t[2],t[1])/Math.PI);return -.5+.02*Math.pow(Math.sqrt(t[1]*t[1]+t[2]*t[2]),1.07)*Math.cos(ef(r-50)*Math.PI/180)}}class eK{constructor(e,t,r,a){this.low=e,this.normal=t,this.medium=r,this.high=a}get(e){var t,r,a,i,n,o,s,l,c;return e<=-1?this.low:e<0?(t=this.low,r=this.normal,(1-(a=(e- -1)/1))*t+a*r):e<.5?(i=this.normal,n=this.medium,(1-(o=(e-0)/.5))*i+o*n):e<1?(s=this.medium,l=this.high,(1-(c=(e-.5)/.5))*s+c*l):this.high}}class eG{constructor(e,t,r,a,i,n){this.roleA=e,this.roleB=t,this.delta=r,this.polarity=a,this.stayTogether=i,this.constraint=n,this.constraint=n??"exact"}}function eX(t){return t.variant===e.FIDELITY||t.variant===e.CONTENT}function eJ(t){return t.variant===e.MONOCHROME}!function(e){e[e.MONOCHROME=0]="MONOCHROME",e[e.NEUTRAL=1]="NEUTRAL",e[e.TONAL_SPOT=2]="TONAL_SPOT",e[e.VIBRANT=3]="VIBRANT",e[e.EXPRESSIVE=4]="EXPRESSIVE",e[e.FIDELITY=5]="FIDELITY",e[e.CONTENT=6]="CONTENT",e[e.RAINBOW=7]="RAINBOW",e[e.FRUIT_SALAD=8]="FRUIT_SALAD"}(e||(e={}));class eQ{primaryPaletteKeyColor(){return eU.fromPalette({name:"primary_palette_key_color",palette:e=>e.primaryPalette,tone:e=>e.primaryPalette.keyColor.tone})}secondaryPaletteKeyColor(){return eU.fromPalette({name:"secondary_palette_key_color",palette:e=>e.secondaryPalette,tone:e=>e.secondaryPalette.keyColor.tone})}tertiaryPaletteKeyColor(){return eU.fromPalette({name:"tertiary_palette_key_color",palette:e=>e.tertiaryPalette,tone:e=>e.tertiaryPalette.keyColor.tone})}neutralPaletteKeyColor(){return eU.fromPalette({name:"neutral_palette_key_color",palette:e=>e.neutralPalette,tone:e=>e.neutralPalette.keyColor.tone})}neutralVariantPaletteKeyColor(){return eU.fromPalette({name:"neutral_variant_palette_key_color",palette:e=>e.neutralVariantPalette,tone:e=>e.neutralVariantPalette.keyColor.tone})}errorPaletteKeyColor(){return eU.fromPalette({name:"error_palette_key_color",palette:e=>e.errorPalette,tone:e=>e.errorPalette.keyColor.tone})}background(){return eU.fromPalette({name:"background",palette:e=>e.neutralPalette,tone:e=>e.isDark?6:98,isBackground:!0})}onBackground(){return eU.fromPalette({name:"on_background",palette:e=>e.neutralPalette,tone:e=>e.isDark?90:10,background:e=>this.background(),contrastCurve:e=>new eK(3,3,4.5,7)})}surface(){return eU.fromPalette({name:"surface",palette:e=>e.neutralPalette,tone:e=>e.isDark?6:98,isBackground:!0})}surfaceDim(){return eU.fromPalette({name:"surface_dim",palette:e=>e.neutralPalette,tone:e=>e.isDark?6:new eK(87,87,80,75).get(e.contrastLevel),isBackground:!0})}surfaceBright(){return eU.fromPalette({name:"surface_bright",palette:e=>e.neutralPalette,tone:e=>e.isDark?new eK(24,24,29,34).get(e.contrastLevel):98,isBackground:!0})}surfaceContainerLowest(){return eU.fromPalette({name:"surface_container_lowest",palette:e=>e.neutralPalette,tone:e=>e.isDark?new eK(4,4,2,0).get(e.contrastLevel):100,isBackground:!0})}surfaceContainerLow(){return eU.fromPalette({name:"surface_container_low",palette:e=>e.neutralPalette,tone:e=>e.isDark?new eK(10,10,11,12).get(e.contrastLevel):new eK(96,96,96,95).get(e.contrastLevel),isBackground:!0})}surfaceContainer(){return eU.fromPalette({name:"surface_container",palette:e=>e.neutralPalette,tone:e=>e.isDark?new eK(12,12,16,20).get(e.contrastLevel):new eK(94,94,92,90).get(e.contrastLevel),isBackground:!0})}surfaceContainerHigh(){return eU.fromPalette({name:"surface_container_high",palette:e=>e.neutralPalette,tone:e=>e.isDark?new eK(17,17,21,25).get(e.contrastLevel):new eK(92,92,88,85).get(e.contrastLevel),isBackground:!0})}surfaceContainerHighest(){return eU.fromPalette({name:"surface_container_highest",palette:e=>e.neutralPalette,tone:e=>e.isDark?new eK(22,22,26,30).get(e.contrastLevel):new eK(90,90,84,80).get(e.contrastLevel),isBackground:!0})}onSurface(){return eU.fromPalette({name:"on_surface",palette:e=>e.neutralPalette,tone:e=>e.isDark?90:10,background:e=>this.highestSurface(e),contrastCurve:e=>new eK(4.5,7,11,21)})}surfaceVariant(){return eU.fromPalette({name:"surface_variant",palette:e=>e.neutralVariantPalette,tone:e=>e.isDark?30:90,isBackground:!0})}onSurfaceVariant(){return eU.fromPalette({name:"on_surface_variant",palette:e=>e.neutralVariantPalette,tone:e=>e.isDark?80:30,background:e=>this.highestSurface(e),contrastCurve:e=>new eK(3,4.5,7,11)})}inverseSurface(){return eU.fromPalette({name:"inverse_surface",palette:e=>e.neutralPalette,tone:e=>e.isDark?90:20,isBackground:!0})}inverseOnSurface(){return eU.fromPalette({name:"inverse_on_surface",palette:e=>e.neutralPalette,tone:e=>e.isDark?20:95,background:e=>this.inverseSurface(),contrastCurve:e=>new eK(4.5,7,11,21)})}outline(){return eU.fromPalette({name:"outline",palette:e=>e.neutralVariantPalette,tone:e=>e.isDark?60:50,background:e=>this.highestSurface(e),contrastCurve:e=>new eK(1.5,3,4.5,7)})}outlineVariant(){return eU.fromPalette({name:"outline_variant",palette:e=>e.neutralVariantPalette,tone:e=>e.isDark?30:80,background:e=>this.highestSurface(e),contrastCurve:e=>new eK(1,1,3,4.5)})}shadow(){return eU.fromPalette({name:"shadow",palette:e=>e.neutralPalette,tone:e=>0})}scrim(){return eU.fromPalette({name:"scrim",palette:e=>e.neutralPalette,tone:e=>0})}surfaceTint(){return eU.fromPalette({name:"surface_tint",palette:e=>e.primaryPalette,tone:e=>e.isDark?80:40,isBackground:!0})}primary(){return eU.fromPalette({name:"primary",palette:e=>e.primaryPalette,tone:e=>eJ(e)?100*!!e.isDark:e.isDark?80:40,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new eK(3,4.5,7,7),toneDeltaPair:e=>new eG(this.primaryContainer(),this.primary(),10,"nearer",!1)})}primaryDim(){}onPrimary(){return eU.fromPalette({name:"on_primary",palette:e=>e.primaryPalette,tone:e=>eJ(e)?e.isDark?10:90:e.isDark?20:100,background:e=>this.primary(),contrastCurve:e=>new eK(4.5,7,11,21)})}primaryContainer(){return eU.fromPalette({name:"primary_container",palette:e=>e.primaryPalette,tone:e=>eX(e)?e.sourceColorHct.tone:eJ(e)?e.isDark?85:25:e.isDark?30:90,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new eK(1,1,3,4.5),toneDeltaPair:e=>new eG(this.primaryContainer(),this.primary(),10,"nearer",!1)})}onPrimaryContainer(){return eU.fromPalette({name:"on_primary_container",palette:e=>e.primaryPalette,tone:e=>eX(e)?eU.foregroundTone(this.primaryContainer().tone(e),4.5):eJ(e)?100*!e.isDark:e.isDark?90:30,background:e=>this.primaryContainer(),contrastCurve:e=>new eK(3,4.5,7,11)})}inversePrimary(){return eU.fromPalette({name:"inverse_primary",palette:e=>e.primaryPalette,tone:e=>e.isDark?40:80,background:e=>this.inverseSurface(),contrastCurve:e=>new eK(3,4.5,7,7)})}secondary(){return eU.fromPalette({name:"secondary",palette:e=>e.secondaryPalette,tone:e=>e.isDark?80:40,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new eK(3,4.5,7,7),toneDeltaPair:e=>new eG(this.secondaryContainer(),this.secondary(),10,"nearer",!1)})}secondaryDim(){}onSecondary(){return eU.fromPalette({name:"on_secondary",palette:e=>e.secondaryPalette,tone:e=>eJ(e)?e.isDark?10:100:e.isDark?20:100,background:e=>this.secondary(),contrastCurve:e=>new eK(4.5,7,11,21)})}secondaryContainer(){return eU.fromPalette({name:"secondary_container",palette:e=>e.secondaryPalette,tone:e=>{let t=e.isDark?30:90;return eJ(e)?e.isDark?30:85:eX(e)?function(e,t,r,a){let i=r,n=eO.from(e,t,r);if(n.chroma<t){let r=n.chroma;for(;n.chroma<t;){i+=a?-1:1;let o=eO.from(e,t,i);if(r>o.chroma||.4>Math.abs(o.chroma-t))break;Math.abs(o.chroma-t)<Math.abs(n.chroma-t)&&(n=o),r=Math.max(r,o.chroma)}}return i}(e.secondaryPalette.hue,e.secondaryPalette.chroma,t,!e.isDark):t},isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new eK(1,1,3,4.5),toneDeltaPair:e=>new eG(this.secondaryContainer(),this.secondary(),10,"nearer",!1)})}onSecondaryContainer(){return eU.fromPalette({name:"on_secondary_container",palette:e=>e.secondaryPalette,tone:e=>eJ(e)?e.isDark?90:10:eX(e)?eU.foregroundTone(this.secondaryContainer().tone(e),4.5):e.isDark?90:30,background:e=>this.secondaryContainer(),contrastCurve:e=>new eK(3,4.5,7,11)})}tertiary(){return eU.fromPalette({name:"tertiary",palette:e=>e.tertiaryPalette,tone:e=>eJ(e)?e.isDark?90:25:e.isDark?80:40,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new eK(3,4.5,7,7),toneDeltaPair:e=>new eG(this.tertiaryContainer(),this.tertiary(),10,"nearer",!1)})}tertiaryDim(){}onTertiary(){return eU.fromPalette({name:"on_tertiary",palette:e=>e.tertiaryPalette,tone:e=>eJ(e)?e.isDark?10:90:e.isDark?20:100,background:e=>this.tertiary(),contrastCurve:e=>new eK(4.5,7,11,21)})}tertiaryContainer(){return eU.fromPalette({name:"tertiary_container",palette:e=>e.tertiaryPalette,tone:e=>{if(eJ(e))return e.isDark?60:49;if(!eX(e))return e.isDark?30:90;let t=e.tertiaryPalette.getHct(e.sourceColorHct.tone);return eH.fixIfDisliked(t).tone},isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new eK(1,1,3,4.5),toneDeltaPair:e=>new eG(this.tertiaryContainer(),this.tertiary(),10,"nearer",!1)})}onTertiaryContainer(){return eU.fromPalette({name:"on_tertiary_container",palette:e=>e.tertiaryPalette,tone:e=>eJ(e)?100*!e.isDark:eX(e)?eU.foregroundTone(this.tertiaryContainer().tone(e),4.5):e.isDark?90:30,background:e=>this.tertiaryContainer(),contrastCurve:e=>new eK(3,4.5,7,11)})}error(){return eU.fromPalette({name:"error",palette:e=>e.errorPalette,tone:e=>e.isDark?80:40,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new eK(3,4.5,7,7),toneDeltaPair:e=>new eG(this.errorContainer(),this.error(),10,"nearer",!1)})}errorDim(){}onError(){return eU.fromPalette({name:"on_error",palette:e=>e.errorPalette,tone:e=>e.isDark?20:100,background:e=>this.error(),contrastCurve:e=>new eK(4.5,7,11,21)})}errorContainer(){return eU.fromPalette({name:"error_container",palette:e=>e.errorPalette,tone:e=>e.isDark?30:90,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new eK(1,1,3,4.5),toneDeltaPair:e=>new eG(this.errorContainer(),this.error(),10,"nearer",!1)})}onErrorContainer(){return eU.fromPalette({name:"on_error_container",palette:e=>e.errorPalette,tone:e=>eJ(e)?e.isDark?90:10:e.isDark?90:30,background:e=>this.errorContainer(),contrastCurve:e=>new eK(3,4.5,7,11)})}primaryFixed(){return eU.fromPalette({name:"primary_fixed",palette:e=>e.primaryPalette,tone:e=>eJ(e)?40:90,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new eK(1,1,3,4.5),toneDeltaPair:e=>new eG(this.primaryFixed(),this.primaryFixedDim(),10,"lighter",!0)})}primaryFixedDim(){return eU.fromPalette({name:"primary_fixed_dim",palette:e=>e.primaryPalette,tone:e=>eJ(e)?30:80,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new eK(1,1,3,4.5),toneDeltaPair:e=>new eG(this.primaryFixed(),this.primaryFixedDim(),10,"lighter",!0)})}onPrimaryFixed(){return eU.fromPalette({name:"on_primary_fixed",palette:e=>e.primaryPalette,tone:e=>eJ(e)?100:10,background:e=>this.primaryFixedDim(),secondBackground:e=>this.primaryFixed(),contrastCurve:e=>new eK(4.5,7,11,21)})}onPrimaryFixedVariant(){return eU.fromPalette({name:"on_primary_fixed_variant",palette:e=>e.primaryPalette,tone:e=>eJ(e)?90:30,background:e=>this.primaryFixedDim(),secondBackground:e=>this.primaryFixed(),contrastCurve:e=>new eK(3,4.5,7,11)})}secondaryFixed(){return eU.fromPalette({name:"secondary_fixed",palette:e=>e.secondaryPalette,tone:e=>eJ(e)?80:90,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new eK(1,1,3,4.5),toneDeltaPair:e=>new eG(this.secondaryFixed(),this.secondaryFixedDim(),10,"lighter",!0)})}secondaryFixedDim(){return eU.fromPalette({name:"secondary_fixed_dim",palette:e=>e.secondaryPalette,tone:e=>eJ(e)?70:80,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new eK(1,1,3,4.5),toneDeltaPair:e=>new eG(this.secondaryFixed(),this.secondaryFixedDim(),10,"lighter",!0)})}onSecondaryFixed(){return eU.fromPalette({name:"on_secondary_fixed",palette:e=>e.secondaryPalette,tone:e=>10,background:e=>this.secondaryFixedDim(),secondBackground:e=>this.secondaryFixed(),contrastCurve:e=>new eK(4.5,7,11,21)})}onSecondaryFixedVariant(){return eU.fromPalette({name:"on_secondary_fixed_variant",palette:e=>e.secondaryPalette,tone:e=>eJ(e)?25:30,background:e=>this.secondaryFixedDim(),secondBackground:e=>this.secondaryFixed(),contrastCurve:e=>new eK(3,4.5,7,11)})}tertiaryFixed(){return eU.fromPalette({name:"tertiary_fixed",palette:e=>e.tertiaryPalette,tone:e=>eJ(e)?40:90,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new eK(1,1,3,4.5),toneDeltaPair:e=>new eG(this.tertiaryFixed(),this.tertiaryFixedDim(),10,"lighter",!0)})}tertiaryFixedDim(){return eU.fromPalette({name:"tertiary_fixed_dim",palette:e=>e.tertiaryPalette,tone:e=>eJ(e)?30:80,isBackground:!0,background:e=>this.highestSurface(e),contrastCurve:e=>new eK(1,1,3,4.5),toneDeltaPair:e=>new eG(this.tertiaryFixed(),this.tertiaryFixedDim(),10,"lighter",!0)})}onTertiaryFixed(){return eU.fromPalette({name:"on_tertiary_fixed",palette:e=>e.tertiaryPalette,tone:e=>eJ(e)?100:10,background:e=>this.tertiaryFixedDim(),secondBackground:e=>this.tertiaryFixed(),contrastCurve:e=>new eK(4.5,7,11,21)})}onTertiaryFixedVariant(){return eU.fromPalette({name:"on_tertiary_fixed_variant",palette:e=>e.tertiaryPalette,tone:e=>eJ(e)?90:30,background:e=>this.tertiaryFixedDim(),secondBackground:e=>this.tertiaryFixed(),contrastCurve:e=>new eK(3,4.5,7,11)})}highestSurface(e){return e.isDark?this.surfaceBright():this.surfaceDim()}}function e0(e,t=0,r=100,a=1){return em(t,r,e2(e.hue,e.chroma*a,100,!0))}function e1(e,t=0,r=100){return em(t,r,e2(e.hue,e.chroma,0,!1))}function e2(e,t,r,a){let i=r,n=eO.from(e,t,i);for(;n.chroma<t&&!(r<0)&&!(r>100);){r+=a?-1:1;let o=eO.from(e,t,r);n.chroma<o.chroma&&(n=o,i=r)}return i}function e4(e){if(1.5===e)return new eK(1.5,1.5,3,4.5);if(3===e)return new eK(3,3,4.5,7);if(4.5===e)return new eK(4.5,4.5,7,11);if(6===e)return new eK(6,6,7,11);if(7===e)return new eK(7,7,11,21);else if(9===e)return new eK(9,9,11,21);else if(11===e)return new eK(11,11,21,21);else if(21===e)return new eK(21,21,21,21);else return new eK(e,e,7,21)}class e5{constructor(){this.allColors=[this.background(),this.onBackground(),this.surface(),this.surfaceDim(),this.surfaceBright(),this.surfaceContainerLowest(),this.surfaceContainerLow(),this.surfaceContainer(),this.surfaceContainerHigh(),this.surfaceContainerHighest(),this.onSurface(),this.onSurfaceVariant(),this.outline(),this.outlineVariant(),this.inverseSurface(),this.inverseOnSurface(),this.primary(),this.primaryDim(),this.onPrimary(),this.primaryContainer(),this.onPrimaryContainer(),this.primaryFixed(),this.primaryFixedDim(),this.onPrimaryFixed(),this.onPrimaryFixedVariant(),this.inversePrimary(),this.secondary(),this.secondaryDim(),this.onSecondary(),this.secondaryContainer(),this.onSecondaryContainer(),this.secondaryFixed(),this.secondaryFixedDim(),this.onSecondaryFixed(),this.onSecondaryFixedVariant(),this.tertiary(),this.tertiaryDim(),this.onTertiary(),this.tertiaryContainer(),this.onTertiaryContainer(),this.tertiaryFixed(),this.tertiaryFixedDim(),this.onTertiaryFixed(),this.onTertiaryFixedVariant(),this.error(),this.errorDim(),this.onError(),this.errorContainer(),this.onErrorContainer()].filter(e=>void 0!==e)}highestSurface(e){return e5.colorSpec.highestSurface(e)}primaryPaletteKeyColor(){return e5.colorSpec.primaryPaletteKeyColor()}secondaryPaletteKeyColor(){return e5.colorSpec.secondaryPaletteKeyColor()}tertiaryPaletteKeyColor(){return e5.colorSpec.tertiaryPaletteKeyColor()}neutralPaletteKeyColor(){return e5.colorSpec.neutralPaletteKeyColor()}neutralVariantPaletteKeyColor(){return e5.colorSpec.neutralVariantPaletteKeyColor()}errorPaletteKeyColor(){return e5.colorSpec.errorPaletteKeyColor()}background(){return e5.colorSpec.background()}onBackground(){return e5.colorSpec.onBackground()}surface(){return e5.colorSpec.surface()}surfaceDim(){return e5.colorSpec.surfaceDim()}surfaceBright(){return e5.colorSpec.surfaceBright()}surfaceContainerLowest(){return e5.colorSpec.surfaceContainerLowest()}surfaceContainerLow(){return e5.colorSpec.surfaceContainerLow()}surfaceContainer(){return e5.colorSpec.surfaceContainer()}surfaceContainerHigh(){return e5.colorSpec.surfaceContainerHigh()}surfaceContainerHighest(){return e5.colorSpec.surfaceContainerHighest()}onSurface(){return e5.colorSpec.onSurface()}surfaceVariant(){return e5.colorSpec.surfaceVariant()}onSurfaceVariant(){return e5.colorSpec.onSurfaceVariant()}outline(){return e5.colorSpec.outline()}outlineVariant(){return e5.colorSpec.outlineVariant()}inverseSurface(){return e5.colorSpec.inverseSurface()}inverseOnSurface(){return e5.colorSpec.inverseOnSurface()}shadow(){return e5.colorSpec.shadow()}scrim(){return e5.colorSpec.scrim()}surfaceTint(){return e5.colorSpec.surfaceTint()}primary(){return e5.colorSpec.primary()}primaryDim(){return e5.colorSpec.primaryDim()}onPrimary(){return e5.colorSpec.onPrimary()}primaryContainer(){return e5.colorSpec.primaryContainer()}onPrimaryContainer(){return e5.colorSpec.onPrimaryContainer()}inversePrimary(){return e5.colorSpec.inversePrimary()}primaryFixed(){return e5.colorSpec.primaryFixed()}primaryFixedDim(){return e5.colorSpec.primaryFixedDim()}onPrimaryFixed(){return e5.colorSpec.onPrimaryFixed()}onPrimaryFixedVariant(){return e5.colorSpec.onPrimaryFixedVariant()}secondary(){return e5.colorSpec.secondary()}secondaryDim(){return e5.colorSpec.secondaryDim()}onSecondary(){return e5.colorSpec.onSecondary()}secondaryContainer(){return e5.colorSpec.secondaryContainer()}onSecondaryContainer(){return e5.colorSpec.onSecondaryContainer()}secondaryFixed(){return e5.colorSpec.secondaryFixed()}secondaryFixedDim(){return e5.colorSpec.secondaryFixedDim()}onSecondaryFixed(){return e5.colorSpec.onSecondaryFixed()}onSecondaryFixedVariant(){return e5.colorSpec.onSecondaryFixedVariant()}tertiary(){return e5.colorSpec.tertiary()}tertiaryDim(){return e5.colorSpec.tertiaryDim()}onTertiary(){return e5.colorSpec.onTertiary()}tertiaryContainer(){return e5.colorSpec.tertiaryContainer()}onTertiaryContainer(){return e5.colorSpec.onTertiaryContainer()}tertiaryFixed(){return e5.colorSpec.tertiaryFixed()}tertiaryFixedDim(){return e5.colorSpec.tertiaryFixedDim()}onTertiaryFixed(){return e5.colorSpec.onTertiaryFixed()}onTertiaryFixedVariant(){return e5.colorSpec.onTertiaryFixedVariant()}error(){return e5.colorSpec.error()}errorDim(){return e5.colorSpec.errorDim()}onError(){return e5.colorSpec.onError()}errorContainer(){return e5.colorSpec.errorContainer()}onErrorContainer(){return e5.colorSpec.onErrorContainer()}static highestSurface(e){return e5.colorSpec.highestSurface(e)}}e5.contentAccentToneDelta=15,e5.colorSpec=new class extends eQ{surface(){let t=eU.fromPalette({name:"surface",palette:e=>e.neutralPalette,tone:t=>(super.surface().tone(t),"phone"!==t.platform)?0:t.isDark?4:eO.isYellow(t.neutralPalette.hue)?99:t.variant===e.VIBRANT?97:98,isBackground:!0});return eV(super.surface(),"2025",t)}surfaceDim(){let t=eU.fromPalette({name:"surface_dim",palette:e=>e.neutralPalette,tone:t=>t.isDark?4:eO.isYellow(t.neutralPalette.hue)?90:t.variant===e.VIBRANT?85:87,isBackground:!0,chromaMultiplier:t=>{if(!t.isDark){if(t.variant===e.NEUTRAL)return 2.5;else if(t.variant===e.TONAL_SPOT)return 1.7;else if(t.variant===e.EXPRESSIVE)return eO.isYellow(t.neutralPalette.hue)?2.7:1.75;else if(t.variant===e.VIBRANT)return 1.36}return 1}});return eV(super.surfaceDim(),"2025",t)}surfaceBright(){let t=eU.fromPalette({name:"surface_bright",palette:e=>e.neutralPalette,tone:t=>t.isDark?18:eO.isYellow(t.neutralPalette.hue)?99:t.variant===e.VIBRANT?97:98,isBackground:!0,chromaMultiplier:t=>{if(t.isDark){if(t.variant===e.NEUTRAL)return 2.5;else if(t.variant===e.TONAL_SPOT)return 1.7;else if(t.variant===e.EXPRESSIVE)return eO.isYellow(t.neutralPalette.hue)?2.7:1.75;else if(t.variant===e.VIBRANT)return 1.36}return 1}});return eV(super.surfaceBright(),"2025",t)}surfaceContainerLowest(){let e=eU.fromPalette({name:"surface_container_lowest",palette:e=>e.neutralPalette,tone:e=>100*!e.isDark,isBackground:!0});return eV(super.surfaceContainerLowest(),"2025",e)}surfaceContainerLow(){let t=eU.fromPalette({name:"surface_container_low",palette:e=>e.neutralPalette,tone:t=>"phone"!==t.platform?15:t.isDark?6:eO.isYellow(t.neutralPalette.hue)?98:t.variant===e.VIBRANT?95:96,isBackground:!0,chromaMultiplier:t=>{if("phone"===t.platform){if(t.variant===e.NEUTRAL)return 1.3;else if(t.variant===e.TONAL_SPOT)return 1.25;else if(t.variant===e.EXPRESSIVE)return eO.isYellow(t.neutralPalette.hue)?1.3:1.15;else if(t.variant===e.VIBRANT)return 1.08}return 1}});return eV(super.surfaceContainerLow(),"2025",t)}surfaceContainer(){let t=eU.fromPalette({name:"surface_container",palette:e=>e.neutralPalette,tone:t=>"phone"!==t.platform?20:t.isDark?9:eO.isYellow(t.neutralPalette.hue)?96:t.variant===e.VIBRANT?92:94,isBackground:!0,chromaMultiplier:t=>{if("phone"===t.platform){if(t.variant===e.NEUTRAL)return 1.6;else if(t.variant===e.TONAL_SPOT)return 1.4;else if(t.variant===e.EXPRESSIVE)return eO.isYellow(t.neutralPalette.hue)?1.6:1.3;else if(t.variant===e.VIBRANT)return 1.15}return 1}});return eV(super.surfaceContainer(),"2025",t)}surfaceContainerHigh(){let t=eU.fromPalette({name:"surface_container_high",palette:e=>e.neutralPalette,tone:t=>"phone"!==t.platform?25:t.isDark?12:eO.isYellow(t.neutralPalette.hue)?94:t.variant===e.VIBRANT?90:92,isBackground:!0,chromaMultiplier:t=>{if("phone"===t.platform){if(t.variant===e.NEUTRAL)return 1.9;else if(t.variant===e.TONAL_SPOT)return 1.5;else if(t.variant===e.EXPRESSIVE)return eO.isYellow(t.neutralPalette.hue)?1.95:1.45;else if(t.variant===e.VIBRANT)return 1.22}return 1}});return eV(super.surfaceContainerHigh(),"2025",t)}surfaceContainerHighest(){let t=eU.fromPalette({name:"surface_container_highest",palette:e=>e.neutralPalette,tone:t=>t.isDark?15:eO.isYellow(t.neutralPalette.hue)?92:t.variant===e.VIBRANT?88:90,isBackground:!0,chromaMultiplier:t=>t.variant===e.NEUTRAL?2.2:t.variant===e.TONAL_SPOT?1.7:t.variant===e.EXPRESSIVE?eO.isYellow(t.neutralPalette.hue)?2.3:1.6:t.variant===e.VIBRANT?1.29:1});return eV(super.surfaceContainerHighest(),"2025",t)}onSurface(){let t=eU.fromPalette({name:"on_surface",palette:e=>e.neutralPalette,tone:t=>t.variant===e.VIBRANT?e0(t.neutralPalette,0,100,1.1):eU.getInitialToneFromBackground(e=>"phone"===e.platform?this.highestSurface(e):this.surfaceContainerHigh())(t),chromaMultiplier:t=>{if("phone"===t.platform){if(t.variant===e.NEUTRAL)return 2.2;else if(t.variant===e.TONAL_SPOT)return 1.7;else if(t.variant===e.EXPRESSIVE)return eO.isYellow(t.neutralPalette.hue)?t.isDark?3:2.3:1.6}return 1},background:e=>"phone"===e.platform?this.highestSurface(e):this.surfaceContainerHigh(),contrastCurve:e=>e.isDark?e4(11):e4(9)});return eV(super.onSurface(),"2025",t)}onSurfaceVariant(){let t=eU.fromPalette({name:"on_surface_variant",palette:e=>e.neutralPalette,chromaMultiplier:t=>{if("phone"===t.platform){if(t.variant===e.NEUTRAL)return 2.2;else if(t.variant===e.TONAL_SPOT)return 1.7;else if(t.variant===e.EXPRESSIVE)return eO.isYellow(t.neutralPalette.hue)?t.isDark?3:2.3:1.6}return 1},background:e=>"phone"===e.platform?this.highestSurface(e):this.surfaceContainerHigh(),contrastCurve:e=>"phone"===e.platform?e4(4.5):e4(7)});return eV(super.onSurfaceVariant(),"2025",t)}outline(){let t=eU.fromPalette({name:"outline",palette:e=>e.neutralPalette,chromaMultiplier:t=>{if("phone"===t.platform){if(t.variant===e.NEUTRAL)return 2.2;else if(t.variant===e.TONAL_SPOT)return 1.7;else if(t.variant===e.EXPRESSIVE)return eO.isYellow(t.neutralPalette.hue)?t.isDark?3:2.3:1.6}return 1},background:e=>"phone"===e.platform?this.highestSurface(e):this.surfaceContainerHigh(),contrastCurve:e=>"phone"===e.platform?e4(3):e4(4.5)});return eV(super.outline(),"2025",t)}outlineVariant(){let t=eU.fromPalette({name:"outline_variant",palette:e=>e.neutralPalette,chromaMultiplier:t=>{if("phone"===t.platform){if(t.variant===e.NEUTRAL)return 2.2;else if(t.variant===e.TONAL_SPOT)return 1.7;else if(t.variant===e.EXPRESSIVE)return eO.isYellow(t.neutralPalette.hue)?t.isDark?3:2.3:1.6}return 1},background:e=>"phone"===e.platform?this.highestSurface(e):this.surfaceContainerHigh(),contrastCurve:e=>"phone"===e.platform?e4(1.5):e4(3)});return eV(super.outlineVariant(),"2025",t)}inverseSurface(){let e=eU.fromPalette({name:"inverse_surface",palette:e=>e.neutralPalette,tone:e=>e.isDark?98:4,isBackground:!0});return eV(super.inverseSurface(),"2025",e)}inverseOnSurface(){let e=eU.fromPalette({name:"inverse_on_surface",palette:e=>e.neutralPalette,background:e=>this.inverseSurface(),contrastCurve:e=>e4(7)});return eV(super.inverseOnSurface(),"2025",e)}primary(){let t=eU.fromPalette({name:"primary",palette:e=>e.primaryPalette,tone:t=>{if(t.variant===e.NEUTRAL)if("phone"===t.platform)return t.isDark?80:40;else return 90;if(t.variant===e.TONAL_SPOT)if("phone"!==t.platform)return e0(t.primaryPalette,0,90);else if(t.isDark)return 80;else return e0(t.primaryPalette);return t.variant===e.EXPRESSIVE?e0(t.primaryPalette,0,eO.isYellow(t.primaryPalette.hue)?25:eO.isCyan(t.primaryPalette.hue)?88:98):e0(t.primaryPalette,0,eO.isCyan(t.primaryPalette.hue)?88:98)},isBackground:!0,background:e=>"phone"===e.platform?this.highestSurface(e):this.surfaceContainerHigh(),contrastCurve:e=>"phone"===e.platform?e4(4.5):e4(7),toneDeltaPair:e=>"phone"===e.platform?new eG(this.primaryContainer(),this.primary(),5,"relative_lighter",!0,"farther"):void 0});return eV(super.primary(),"2025",t)}primaryDim(){return eU.fromPalette({name:"primary_dim",palette:e=>e.primaryPalette,tone:t=>t.variant===e.NEUTRAL?85:t.variant===e.TONAL_SPOT?e0(t.primaryPalette,0,90):e0(t.primaryPalette),isBackground:!0,background:e=>this.surfaceContainerHigh(),contrastCurve:e=>e4(4.5),toneDeltaPair:e=>new eG(this.primaryDim(),this.primary(),5,"darker",!0,"farther")})}onPrimary(){let e=eU.fromPalette({name:"on_primary",palette:e=>e.primaryPalette,background:e=>"phone"===e.platform?this.primary():this.primaryDim(),contrastCurve:e=>"phone"===e.platform?e4(6):e4(7)});return eV(super.onPrimary(),"2025",e)}primaryContainer(){let t=eU.fromPalette({name:"primary_container",palette:e=>e.primaryPalette,tone:t=>"watch"===t.platform?30:t.variant===e.NEUTRAL?t.isDark?30:90:t.variant===e.TONAL_SPOT?t.isDark?e1(t.primaryPalette,35,93):e0(t.primaryPalette,0,90):t.variant===e.EXPRESSIVE?t.isDark?e0(t.primaryPalette,30,93):e0(t.primaryPalette,78,eO.isCyan(t.primaryPalette.hue)?88:90):t.isDark?e1(t.primaryPalette,66,93):e0(t.primaryPalette,66,eO.isCyan(t.primaryPalette.hue)?88:93),isBackground:!0,background:e=>"phone"===e.platform?this.highestSurface(e):void 0,toneDeltaPair:e=>"phone"===e.platform?void 0:new eG(this.primaryContainer(),this.primaryDim(),10,"darker",!0,"farther"),contrastCurve:e=>"phone"===e.platform&&e.contrastLevel>0?e4(1.5):void 0});return eV(super.primaryContainer(),"2025",t)}onPrimaryContainer(){let e=eU.fromPalette({name:"on_primary_container",palette:e=>e.primaryPalette,background:e=>this.primaryContainer(),contrastCurve:e=>"phone"===e.platform?e4(6):e4(7)});return eV(super.onPrimaryContainer(),"2025",e)}primaryFixed(){let e=eU.fromPalette({name:"primary_fixed",palette:e=>e.primaryPalette,tone:e=>{let t=Object.assign({},e,{isDark:!1,contrastLevel:0});return this.primaryContainer().getTone(t)},isBackground:!0,background:e=>"phone"===e.platform?this.highestSurface(e):void 0,contrastCurve:e=>"phone"===e.platform&&e.contrastLevel>0?e4(1.5):void 0});return eV(super.primaryFixed(),"2025",e)}primaryFixedDim(){let e=eU.fromPalette({name:"primary_fixed_dim",palette:e=>e.primaryPalette,tone:e=>this.primaryFixed().getTone(e),isBackground:!0,toneDeltaPair:e=>new eG(this.primaryFixedDim(),this.primaryFixed(),5,"darker",!0,"exact")});return eV(super.primaryFixedDim(),"2025",e)}onPrimaryFixed(){let e=eU.fromPalette({name:"on_primary_fixed",palette:e=>e.primaryPalette,background:e=>this.primaryFixedDim(),contrastCurve:e=>e4(7)});return eV(super.onPrimaryFixed(),"2025",e)}onPrimaryFixedVariant(){let e=eU.fromPalette({name:"on_primary_fixed_variant",palette:e=>e.primaryPalette,background:e=>this.primaryFixedDim(),contrastCurve:e=>e4(4.5)});return eV(super.onPrimaryFixedVariant(),"2025",e)}inversePrimary(){let e=eU.fromPalette({name:"inverse_primary",palette:e=>e.primaryPalette,tone:e=>e0(e.primaryPalette),background:e=>this.inverseSurface(),contrastCurve:e=>"phone"===e.platform?e4(6):e4(7)});return eV(super.inversePrimary(),"2025",e)}secondary(){let t=eU.fromPalette({name:"secondary",palette:e=>e.secondaryPalette,tone:t=>"watch"===t.platform?t.variant===e.NEUTRAL?90:e0(t.secondaryPalette,0,90):t.variant===e.NEUTRAL?t.isDark?e1(t.secondaryPalette,0,98):e0(t.secondaryPalette):t.variant===e.VIBRANT?e0(t.secondaryPalette,0,t.isDark?90:98):t.isDark?80:e0(t.secondaryPalette),isBackground:!0,background:e=>"phone"===e.platform?this.highestSurface(e):this.surfaceContainerHigh(),contrastCurve:e=>"phone"===e.platform?e4(4.5):e4(7),toneDeltaPair:e=>"phone"===e.platform?new eG(this.secondaryContainer(),this.secondary(),5,"relative_lighter",!0,"farther"):void 0});return eV(super.secondary(),"2025",t)}secondaryDim(){return eU.fromPalette({name:"secondary_dim",palette:e=>e.secondaryPalette,tone:t=>t.variant===e.NEUTRAL?85:e0(t.secondaryPalette,0,90),isBackground:!0,background:e=>this.surfaceContainerHigh(),contrastCurve:e=>e4(4.5),toneDeltaPair:e=>new eG(this.secondaryDim(),this.secondary(),5,"darker",!0,"farther")})}onSecondary(){let e=eU.fromPalette({name:"on_secondary",palette:e=>e.secondaryPalette,background:e=>"phone"===e.platform?this.secondary():this.secondaryDim(),contrastCurve:e=>"phone"===e.platform?e4(6):e4(7)});return eV(super.onSecondary(),"2025",e)}secondaryContainer(){let t=eU.fromPalette({name:"secondary_container",palette:e=>e.secondaryPalette,tone:t=>"watch"===t.platform?30:t.variant===e.VIBRANT?t.isDark?e1(t.secondaryPalette,30,40):e0(t.secondaryPalette,84,90):t.variant===e.EXPRESSIVE?t.isDark?15:e0(t.secondaryPalette,90,95):t.isDark?25:90,isBackground:!0,background:e=>"phone"===e.platform?this.highestSurface(e):void 0,toneDeltaPair:e=>"watch"===e.platform?new eG(this.secondaryContainer(),this.secondaryDim(),10,"darker",!0,"farther"):void 0,contrastCurve:e=>"phone"===e.platform&&e.contrastLevel>0?e4(1.5):void 0});return eV(super.secondaryContainer(),"2025",t)}onSecondaryContainer(){let e=eU.fromPalette({name:"on_secondary_container",palette:e=>e.secondaryPalette,background:e=>this.secondaryContainer(),contrastCurve:e=>"phone"===e.platform?e4(6):e4(7)});return eV(super.onSecondaryContainer(),"2025",e)}secondaryFixed(){let e=eU.fromPalette({name:"secondary_fixed",palette:e=>e.secondaryPalette,tone:e=>{let t=Object.assign({},e,{isDark:!1,contrastLevel:0});return this.secondaryContainer().getTone(t)},isBackground:!0,background:e=>"phone"===e.platform?this.highestSurface(e):void 0,contrastCurve:e=>"phone"===e.platform&&e.contrastLevel>0?e4(1.5):void 0});return eV(super.secondaryFixed(),"2025",e)}secondaryFixedDim(){let e=eU.fromPalette({name:"secondary_fixed_dim",palette:e=>e.secondaryPalette,tone:e=>this.secondaryFixed().getTone(e),isBackground:!0,toneDeltaPair:e=>new eG(this.secondaryFixedDim(),this.secondaryFixed(),5,"darker",!0,"exact")});return eV(super.secondaryFixedDim(),"2025",e)}onSecondaryFixed(){let e=eU.fromPalette({name:"on_secondary_fixed",palette:e=>e.secondaryPalette,background:e=>this.secondaryFixedDim(),contrastCurve:e=>e4(7)});return eV(super.onSecondaryFixed(),"2025",e)}onSecondaryFixedVariant(){let e=eU.fromPalette({name:"on_secondary_fixed_variant",palette:e=>e.secondaryPalette,background:e=>this.secondaryFixedDim(),contrastCurve:e=>e4(4.5)});return eV(super.onSecondaryFixedVariant(),"2025",e)}tertiary(){let t=eU.fromPalette({name:"tertiary",palette:e=>e.tertiaryPalette,tone:t=>"watch"===t.platform?t.variant===e.TONAL_SPOT?e0(t.tertiaryPalette,0,90):e0(t.tertiaryPalette):t.variant===e.EXPRESSIVE||t.variant===e.VIBRANT?e0(t.tertiaryPalette,0,eO.isCyan(t.tertiaryPalette.hue)?88:t.isDark?98:100):t.isDark?e0(t.tertiaryPalette,0,98):e0(t.tertiaryPalette),isBackground:!0,background:e=>"phone"===e.platform?this.highestSurface(e):this.surfaceContainerHigh(),contrastCurve:e=>"phone"===e.platform?e4(4.5):e4(7),toneDeltaPair:e=>"phone"===e.platform?new eG(this.tertiaryContainer(),this.tertiary(),5,"relative_lighter",!0,"farther"):void 0});return eV(super.tertiary(),"2025",t)}tertiaryDim(){return eU.fromPalette({name:"tertiary_dim",palette:e=>e.tertiaryPalette,tone:t=>t.variant===e.TONAL_SPOT?e0(t.tertiaryPalette,0,90):e0(t.tertiaryPalette),isBackground:!0,background:e=>this.surfaceContainerHigh(),contrastCurve:e=>e4(4.5),toneDeltaPair:e=>new eG(this.tertiaryDim(),this.tertiary(),5,"darker",!0,"farther")})}onTertiary(){let e=eU.fromPalette({name:"on_tertiary",palette:e=>e.tertiaryPalette,background:e=>"phone"===e.platform?this.tertiary():this.tertiaryDim(),contrastCurve:e=>"phone"===e.platform?e4(6):e4(7)});return eV(super.onTertiary(),"2025",e)}tertiaryContainer(){let t=eU.fromPalette({name:"tertiary_container",palette:e=>e.tertiaryPalette,tone:t=>"watch"===t.platform?t.variant===e.TONAL_SPOT?e0(t.tertiaryPalette,0,90):e0(t.tertiaryPalette):t.variant===e.NEUTRAL?t.isDark?e0(t.tertiaryPalette,0,93):e0(t.tertiaryPalette,0,96):t.variant===e.TONAL_SPOT?e0(t.tertiaryPalette,0,t.isDark?93:100):t.variant===e.EXPRESSIVE?e0(t.tertiaryPalette,75,eO.isCyan(t.tertiaryPalette.hue)?88:t.isDark?93:100):t.isDark?e0(t.tertiaryPalette,0,93):e0(t.tertiaryPalette,72,100),isBackground:!0,background:e=>"phone"===e.platform?this.highestSurface(e):void 0,toneDeltaPair:e=>"watch"===e.platform?new eG(this.tertiaryContainer(),this.tertiaryDim(),10,"darker",!0,"farther"):void 0,contrastCurve:e=>"phone"===e.platform&&e.contrastLevel>0?e4(1.5):void 0});return eV(super.tertiaryContainer(),"2025",t)}onTertiaryContainer(){let e=eU.fromPalette({name:"on_tertiary_container",palette:e=>e.tertiaryPalette,background:e=>this.tertiaryContainer(),contrastCurve:e=>"phone"===e.platform?e4(6):e4(7)});return eV(super.onTertiaryContainer(),"2025",e)}tertiaryFixed(){let e=eU.fromPalette({name:"tertiary_fixed",palette:e=>e.tertiaryPalette,tone:e=>{let t=Object.assign({},e,{isDark:!1,contrastLevel:0});return this.tertiaryContainer().getTone(t)},isBackground:!0,background:e=>"phone"===e.platform?this.highestSurface(e):void 0,contrastCurve:e=>"phone"===e.platform&&e.contrastLevel>0?e4(1.5):void 0});return eV(super.tertiaryFixed(),"2025",e)}tertiaryFixedDim(){let e=eU.fromPalette({name:"tertiary_fixed_dim",palette:e=>e.tertiaryPalette,tone:e=>this.tertiaryFixed().getTone(e),isBackground:!0,toneDeltaPair:e=>new eG(this.tertiaryFixedDim(),this.tertiaryFixed(),5,"darker",!0,"exact")});return eV(super.tertiaryFixedDim(),"2025",e)}onTertiaryFixed(){let e=eU.fromPalette({name:"on_tertiary_fixed",palette:e=>e.tertiaryPalette,background:e=>this.tertiaryFixedDim(),contrastCurve:e=>e4(7)});return eV(super.onTertiaryFixed(),"2025",e)}onTertiaryFixedVariant(){let e=eU.fromPalette({name:"on_tertiary_fixed_variant",palette:e=>e.tertiaryPalette,background:e=>this.tertiaryFixedDim(),contrastCurve:e=>e4(4.5)});return eV(super.onTertiaryFixedVariant(),"2025",e)}error(){let e=eU.fromPalette({name:"error",palette:e=>e.errorPalette,tone:e=>"phone"===e.platform?e.isDark?e1(e.errorPalette,0,98):e0(e.errorPalette):e1(e.errorPalette),isBackground:!0,background:e=>"phone"===e.platform?this.highestSurface(e):this.surfaceContainerHigh(),contrastCurve:e=>"phone"===e.platform?e4(4.5):e4(7),toneDeltaPair:e=>"phone"===e.platform?new eG(this.errorContainer(),this.error(),5,"relative_lighter",!0,"farther"):void 0});return eV(super.error(),"2025",e)}errorDim(){return eU.fromPalette({name:"error_dim",palette:e=>e.errorPalette,tone:e=>e1(e.errorPalette),isBackground:!0,background:e=>this.surfaceContainerHigh(),contrastCurve:e=>e4(4.5),toneDeltaPair:e=>new eG(this.errorDim(),this.error(),5,"darker",!0,"farther")})}onError(){let e=eU.fromPalette({name:"on_error",palette:e=>e.errorPalette,background:e=>"phone"===e.platform?this.error():this.errorDim(),contrastCurve:e=>"phone"===e.platform?e4(6):e4(7)});return eV(super.onError(),"2025",e)}errorContainer(){let e=eU.fromPalette({name:"error_container",palette:e=>e.errorPalette,tone:e=>"watch"===e.platform?30:e.isDark?e1(e.errorPalette,30,93):e0(e.errorPalette,0,90),isBackground:!0,background:e=>"phone"===e.platform?this.highestSurface(e):void 0,toneDeltaPair:e=>"watch"===e.platform?new eG(this.errorContainer(),this.errorDim(),10,"darker",!0,"farther"):void 0,contrastCurve:e=>"phone"===e.platform&&e.contrastLevel>0?e4(1.5):void 0});return eV(super.errorContainer(),"2025",e)}onErrorContainer(){let e=eU.fromPalette({name:"on_error_container",palette:e=>e.errorPalette,background:e=>this.errorContainer(),contrastCurve:e=>"phone"===e.platform?e4(4.5):e4(7)});return eV(super.onErrorContainer(),"2025",e)}surfaceVariant(){let e=Object.assign(this.surfaceContainerHighest().clone(),{name:"surface_variant"});return eV(super.surfaceVariant(),"2025",e)}surfaceTint(){let e=Object.assign(this.primary().clone(),{name:"surface_tint"});return eV(super.surfaceTint(),"2025",e)}background(){let e=Object.assign(this.surface().clone(),{name:"background"});return eV(super.background(),"2025",e)}onBackground(){let e=Object.assign(this.onSurface().clone(),{name:"on_background"});return eV(super.onBackground(),"2025",e)}},e5.primaryPaletteKeyColor=e5.colorSpec.primaryPaletteKeyColor(),e5.secondaryPaletteKeyColor=e5.colorSpec.secondaryPaletteKeyColor(),e5.tertiaryPaletteKeyColor=e5.colorSpec.tertiaryPaletteKeyColor(),e5.neutralPaletteKeyColor=e5.colorSpec.neutralPaletteKeyColor(),e5.neutralVariantPaletteKeyColor=e5.colorSpec.neutralVariantPaletteKeyColor(),e5.background=e5.colorSpec.background(),e5.onBackground=e5.colorSpec.onBackground(),e5.surface=e5.colorSpec.surface(),e5.surfaceDim=e5.colorSpec.surfaceDim(),e5.surfaceBright=e5.colorSpec.surfaceBright(),e5.surfaceContainerLowest=e5.colorSpec.surfaceContainerLowest(),e5.surfaceContainerLow=e5.colorSpec.surfaceContainerLow(),e5.surfaceContainer=e5.colorSpec.surfaceContainer(),e5.surfaceContainerHigh=e5.colorSpec.surfaceContainerHigh(),e5.surfaceContainerHighest=e5.colorSpec.surfaceContainerHighest(),e5.onSurface=e5.colorSpec.onSurface(),e5.surfaceVariant=e5.colorSpec.surfaceVariant(),e5.onSurfaceVariant=e5.colorSpec.onSurfaceVariant(),e5.inverseSurface=e5.colorSpec.inverseSurface(),e5.inverseOnSurface=e5.colorSpec.inverseOnSurface(),e5.outline=e5.colorSpec.outline(),e5.outlineVariant=e5.colorSpec.outlineVariant(),e5.shadow=e5.colorSpec.shadow(),e5.scrim=e5.colorSpec.scrim(),e5.surfaceTint=e5.colorSpec.surfaceTint(),e5.primary=e5.colorSpec.primary(),e5.onPrimary=e5.colorSpec.onPrimary(),e5.primaryContainer=e5.colorSpec.primaryContainer(),e5.onPrimaryContainer=e5.colorSpec.onPrimaryContainer(),e5.inversePrimary=e5.colorSpec.inversePrimary(),e5.secondary=e5.colorSpec.secondary(),e5.onSecondary=e5.colorSpec.onSecondary(),e5.secondaryContainer=e5.colorSpec.secondaryContainer(),e5.onSecondaryContainer=e5.colorSpec.onSecondaryContainer(),e5.tertiary=e5.colorSpec.tertiary(),e5.onTertiary=e5.colorSpec.onTertiary(),e5.tertiaryContainer=e5.colorSpec.tertiaryContainer(),e5.onTertiaryContainer=e5.colorSpec.onTertiaryContainer(),e5.error=e5.colorSpec.error(),e5.onError=e5.colorSpec.onError(),e5.errorContainer=e5.colorSpec.errorContainer(),e5.onErrorContainer=e5.colorSpec.onErrorContainer(),e5.primaryFixed=e5.colorSpec.primaryFixed(),e5.primaryFixedDim=e5.colorSpec.primaryFixedDim(),e5.onPrimaryFixed=e5.colorSpec.onPrimaryFixed(),e5.onPrimaryFixedVariant=e5.colorSpec.onPrimaryFixedVariant(),e5.secondaryFixed=e5.colorSpec.secondaryFixed(),e5.secondaryFixedDim=e5.colorSpec.secondaryFixedDim(),e5.onSecondaryFixed=e5.colorSpec.onSecondaryFixed(),e5.onSecondaryFixedVariant=e5.colorSpec.onSecondaryFixedVariant(),e5.tertiaryFixed=e5.colorSpec.tertiaryFixed(),e5.tertiaryFixedDim=e5.colorSpec.tertiaryFixedDim(),e5.onTertiaryFixed=e5.colorSpec.onTertiaryFixed(),e5.onTertiaryFixedVariant=e5.colorSpec.onTertiaryFixedVariant();class e3{constructor(e){this.sourceColorArgb=e.sourceColorHct.toInt(),this.variant=e.variant,this.contrastLevel=e.contrastLevel,this.isDark=e.isDark,this.platform=e.platform??"phone",this.specVersion=e.specVersion??"2021",this.sourceColorHct=e.sourceColorHct,this.primaryPalette=e.primaryPalette??te(this.specVersion).getPrimaryPalette(this.variant,e.sourceColorHct,this.isDark,this.platform,this.contrastLevel),this.secondaryPalette=e.secondaryPalette??te(this.specVersion).getSecondaryPalette(this.variant,e.sourceColorHct,this.isDark,this.platform,this.contrastLevel),this.tertiaryPalette=e.tertiaryPalette??te(this.specVersion).getTertiaryPalette(this.variant,e.sourceColorHct,this.isDark,this.platform,this.contrastLevel),this.neutralPalette=e.neutralPalette??te(this.specVersion).getNeutralPalette(this.variant,e.sourceColorHct,this.isDark,this.platform,this.contrastLevel),this.neutralVariantPalette=e.neutralVariantPalette??te(this.specVersion).getNeutralVariantPalette(this.variant,e.sourceColorHct,this.isDark,this.platform,this.contrastLevel),this.errorPalette=e.errorPalette??te(this.specVersion).getErrorPalette(this.variant,e.sourceColorHct,this.isDark,this.platform,this.contrastLevel)??eq.fromHueAndChroma(25,84),this.colors=new e5}toString(){return`Scheme: variant=${e[this.variant]}, mode=${this.isDark?"dark":"light"}, platform=${this.platform}, contrastLevel=${this.contrastLevel.toFixed(1)}, seed=${this.sourceColorHct.toString()}, specVersion=${this.specVersion}`}static getPiecewiseHue(e,t,r){let a=Math.min(t.length-1,r.length),i=e.hue;for(let e=0;e<a;e++)if(i>=t[e]&&i<t[e+1])return ef(r[e]);return i}static getRotatedHue(e,t,r){let a=e3.getPiecewiseHue(e,t,r);return 0>=Math.min(t.length-1,r.length)&&(a=0),ef(e.hue+a)}getArgb(e){return e.getArgb(this)}getHct(e){return e.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(){let e=this.colors.primaryDim();if(void 0===e)throw Error("`primaryDim` color is undefined prior to 2025 spec.");return this.getArgb(e)}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(){let e=this.colors.secondaryDim();if(void 0===e)throw Error("`secondaryDim` color is undefined prior to 2025 spec.");return this.getArgb(e)}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(){let e=this.colors.tertiaryDim();if(void 0===e)throw Error("`tertiaryDim` color is undefined prior to 2025 spec.");return this.getArgb(e)}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(){let e=this.colors.errorDim();if(void 0===e)throw Error("`errorDim` color is undefined prior to 2025 spec.");return this.getArgb(e)}get onError(){return this.getArgb(this.colors.onError())}get errorContainer(){return this.getArgb(this.colors.errorContainer())}get onErrorContainer(){return this.getArgb(this.colors.onErrorContainer())}}e3.DEFAULT_SPEC_VERSION="2021",e3.DEFAULT_PLATFORM="phone";class e6{getPrimaryPalette(t,r,a,i,n){switch(t){case e.CONTENT:case e.FIDELITY:return eq.fromHueAndChroma(r.hue,r.chroma);case e.FRUIT_SALAD:return eq.fromHueAndChroma(ef(r.hue-50),48);case e.MONOCHROME:return eq.fromHueAndChroma(r.hue,0);case e.NEUTRAL:return eq.fromHueAndChroma(r.hue,12);case e.RAINBOW:return eq.fromHueAndChroma(r.hue,48);case e.TONAL_SPOT:return eq.fromHueAndChroma(r.hue,36);case e.EXPRESSIVE:return eq.fromHueAndChroma(ef(r.hue+240),40);case e.VIBRANT:return eq.fromHueAndChroma(r.hue,200);default:throw Error(`Unsupported variant: ${t}`)}}getSecondaryPalette(t,r,a,i,n){switch(t){case e.CONTENT:case e.FIDELITY:return eq.fromHueAndChroma(r.hue,Math.max(r.chroma-32,.5*r.chroma));case e.FRUIT_SALAD:return eq.fromHueAndChroma(ef(r.hue-50),36);case e.MONOCHROME:return eq.fromHueAndChroma(r.hue,0);case e.NEUTRAL:return eq.fromHueAndChroma(r.hue,8);case e.RAINBOW:case e.TONAL_SPOT:return eq.fromHueAndChroma(r.hue,16);case e.EXPRESSIVE:return eq.fromHueAndChroma(e3.getRotatedHue(r,[0,21,51,121,151,191,271,321,360],[45,95,45,20,45,90,45,45,45]),24);case e.VIBRANT:return eq.fromHueAndChroma(e3.getRotatedHue(r,[0,41,61,101,131,181,251,301,360],[18,15,10,12,15,18,15,12,12]),24);default:throw Error(`Unsupported variant: ${t}`)}}getTertiaryPalette(t,r,a,i,n){switch(t){case e.CONTENT:return eq.fromHct(eH.fixIfDisliked(new eY(r).analogous(3,6)[2]));case e.FIDELITY:return eq.fromHct(eH.fixIfDisliked(new eY(r).complement));case e.FRUIT_SALAD:return eq.fromHueAndChroma(r.hue,36);case e.MONOCHROME:return eq.fromHueAndChroma(r.hue,0);case e.NEUTRAL:return eq.fromHueAndChroma(r.hue,16);case e.RAINBOW:case e.TONAL_SPOT:return eq.fromHueAndChroma(ef(r.hue+60),24);case e.EXPRESSIVE:return eq.fromHueAndChroma(e3.getRotatedHue(r,[0,21,51,121,151,191,271,321,360],[120,120,20,45,20,15,20,120,120]),32);case e.VIBRANT:return eq.fromHueAndChroma(e3.getRotatedHue(r,[0,41,61,101,131,181,251,301,360],[35,30,20,25,30,35,30,25,25]),32);default:throw Error(`Unsupported variant: ${t}`)}}getNeutralPalette(t,r,a,i,n){switch(t){case e.CONTENT:case e.FIDELITY:return eq.fromHueAndChroma(r.hue,r.chroma/8);case e.FRUIT_SALAD:return eq.fromHueAndChroma(r.hue,10);case e.MONOCHROME:return eq.fromHueAndChroma(r.hue,0);case e.NEUTRAL:return eq.fromHueAndChroma(r.hue,2);case e.RAINBOW:return eq.fromHueAndChroma(r.hue,0);case e.TONAL_SPOT:return eq.fromHueAndChroma(r.hue,6);case e.EXPRESSIVE:return eq.fromHueAndChroma(ef(r.hue+15),8);case e.VIBRANT:return eq.fromHueAndChroma(r.hue,10);default:throw Error(`Unsupported variant: ${t}`)}}getNeutralVariantPalette(t,r,a,i,n){switch(t){case e.CONTENT:case e.FIDELITY:return eq.fromHueAndChroma(r.hue,r.chroma/8+4);case e.FRUIT_SALAD:return eq.fromHueAndChroma(r.hue,16);case e.MONOCHROME:return eq.fromHueAndChroma(r.hue,0);case e.NEUTRAL:return eq.fromHueAndChroma(r.hue,2);case e.RAINBOW:return eq.fromHueAndChroma(r.hue,0);case e.TONAL_SPOT:return eq.fromHueAndChroma(r.hue,8);case e.EXPRESSIVE:return eq.fromHueAndChroma(ef(r.hue+15),12);case e.VIBRANT:return eq.fromHueAndChroma(r.hue,12);default:throw Error(`Unsupported variant: ${t}`)}}getErrorPalette(e,t,r,a,i){}}class e8 extends e6{getPrimaryPalette(t,r,a,i,n){switch(t){case e.NEUTRAL:return eq.fromHueAndChroma(r.hue,"phone"===i?eO.isBlue(r.hue)?12:8:eO.isBlue(r.hue)?16:12);case e.TONAL_SPOT:return eq.fromHueAndChroma(r.hue,"phone"===i&&a?26:32);case e.EXPRESSIVE:return eq.fromHueAndChroma(r.hue,"phone"===i?a?36:48:40);case e.VIBRANT:return eq.fromHueAndChroma(r.hue,"phone"===i?74:56);default:return super.getPrimaryPalette(t,r,a,i,n)}}getSecondaryPalette(t,r,a,i,n){switch(t){case e.NEUTRAL:return eq.fromHueAndChroma(r.hue,"phone"===i?eO.isBlue(r.hue)?6:4:eO.isBlue(r.hue)?10:6);case e.TONAL_SPOT:return eq.fromHueAndChroma(r.hue,16);case e.EXPRESSIVE:return eq.fromHueAndChroma(e3.getRotatedHue(r,[0,105,140,204,253,278,300,333,360],[-160,155,-100,96,-96,-156,-165,-160]),"phone"===i&&a?16:24);case e.VIBRANT:return eq.fromHueAndChroma(e3.getRotatedHue(r,[0,38,105,140,333,360],[-14,10,-14,10,-14]),"phone"===i?56:36);default:return super.getSecondaryPalette(t,r,a,i,n)}}getTertiaryPalette(t,r,a,i,n){switch(t){case e.NEUTRAL:return eq.fromHueAndChroma(e3.getRotatedHue(r,[0,38,105,161,204,278,333,360],[-32,26,10,-39,24,-15,-32]),"phone"===i?20:36);case e.TONAL_SPOT:return eq.fromHueAndChroma(e3.getRotatedHue(r,[0,20,71,161,333,360],[-40,48,-32,40,-32]),"phone"===i?28:32);case e.EXPRESSIVE:return eq.fromHueAndChroma(e3.getRotatedHue(r,[0,105,140,204,253,278,300,333,360],[-165,160,-105,101,-101,-160,-170,-165]),48);case e.VIBRANT:return eq.fromHueAndChroma(e3.getRotatedHue(r,[0,38,71,105,140,161,253,333,360],[-72,35,24,-24,62,50,62,-72]),56);default:return super.getTertiaryPalette(t,r,a,i,n)}}static getExpressiveNeutralHue(e){return e3.getRotatedHue(e,[0,71,124,253,278,300,360],[10,0,10,0,10,0])}static getExpressiveNeutralChroma(e,t,r){let a=e8.getExpressiveNeutralHue(e);return"phone"===r?t?eO.isYellow(a)?6:14:18:12}static getVibrantNeutralHue(e){return e3.getRotatedHue(e,[0,38,105,140,333,360],[-14,10,-14,10,-14])}static getVibrantNeutralChroma(e,t){let r=e8.getVibrantNeutralHue(e);return"phone"===t||eO.isBlue(r)?28:20}getNeutralPalette(t,r,a,i,n){switch(t){case e.NEUTRAL:return eq.fromHueAndChroma(r.hue,"phone"===i?1.4:6);case e.TONAL_SPOT:return eq.fromHueAndChroma(r.hue,"phone"===i?5:10);case e.EXPRESSIVE:return eq.fromHueAndChroma(e8.getExpressiveNeutralHue(r),e8.getExpressiveNeutralChroma(r,a,i));case e.VIBRANT:return eq.fromHueAndChroma(e8.getVibrantNeutralHue(r),e8.getVibrantNeutralChroma(r,i));default:return super.getNeutralPalette(t,r,a,i,n)}}getNeutralVariantPalette(t,r,a,i,n){switch(t){case e.NEUTRAL:return eq.fromHueAndChroma(r.hue,("phone"===i?1.4:6)*2.2);case e.TONAL_SPOT:return eq.fromHueAndChroma(r.hue,("phone"===i?5:10)*1.7);case e.EXPRESSIVE:let o=e8.getExpressiveNeutralHue(r),s=e8.getExpressiveNeutralChroma(r,a,i);return eq.fromHueAndChroma(o,s*(o>=105&&o<125?1.6:2.3));case e.VIBRANT:let l=e8.getVibrantNeutralHue(r),c=e8.getVibrantNeutralChroma(r,i);return eq.fromHueAndChroma(l,1.29*c);default:return super.getNeutralVariantPalette(t,r,a,i,n)}}getErrorPalette(t,r,a,i,n){let o=e3.getPiecewiseHue(r,[0,3,13,23,33,43,153,273,360],[12,22,32,12,22,32,22,12]);switch(t){case e.NEUTRAL:return eq.fromHueAndChroma(o,"phone"===i?50:40);case e.TONAL_SPOT:return eq.fromHueAndChroma(o,"phone"===i?60:48);case e.EXPRESSIVE:return eq.fromHueAndChroma(o,"phone"===i?64:48);case e.VIBRANT:return eq.fromHueAndChroma(o,"phone"===i?80:60);default:return super.getErrorPalette(t,r,a,i,n)}}}let e9=new e6,e7=new e8;function te(e){return"2025"===e?e7:e9}class tt{fromInt(e){return eS(e)}toInt(e){return function(e,t,r){let a=(e+16)/116,i=eI(t/500+a),n=eI(a),o=eI(a-r/200),s=i*ew[0];return e_(s,n*ew[1],o*ew[2])}(e[0],e[1],e[2])}distance(e,t){let r=e[0]-t[0],a=e[1]-t[1],i=e[2]-t[2];return r*r+a*a+i*i}}class tr{static quantize(e,t,r){let a=new Map,i=[],n=[],o=new tt,s=0;for(let t=0;t<e.length;t++){let r=e[t],l=a.get(r);void 0===l?(s++,i.push(o.fromInt(r)),n.push(r),a.set(r,1)):a.set(r,l+1)}let l=[];for(let e=0;e<s;e++){let t=n[e],r=a.get(t);void 0!==r&&(l[e]=r)}let c=Math.min(r,s);t.length>0&&(c=Math.min(c,t.length));let h=[];for(let e=0;e<t.length;e++)h.push(o.fromInt(t[e]));let d=c-h.length;if(0===t.length&&d>0)for(let e=0;e<d;e++){let e=100*Math.random(),t=201*Math.random()+-100,r=201*Math.random()+-100;h.push([e,t,r])}let u=[];for(let e=0;e<s;e++)u.push(Math.floor(Math.random()*c));let m=[];for(let e=0;e<c;e++){m.push([]);for(let t=0;t<c;t++)m[e].push(0)}let p=[];for(let e=0;e<c;e++){p.push([]);for(let t=0;t<c;t++)p[e].push(new ta)}let f=[];for(let e=0;e<c;e++)f.push(0);for(let e=0;e<10;e++){for(let e=0;e<c;e++){for(let t=e+1;t<c;t++){let r=o.distance(h[e],h[t]);p[t][e].distance=r,p[t][e].index=e,p[e][t].distance=r,p[e][t].index=t}p[e].sort();for(let t=0;t<c;t++)m[e][t]=p[e][t].index}let t=0;for(let e=0;e<s;e++){let r=i[e],a=u[e],n=h[a],s=o.distance(r,n),l=s,d=-1;for(let e=0;e<c;e++){if(p[a][e].distance>=4*s)continue;let t=o.distance(r,h[e]);t<l&&(l=t,d=e)}-1!==d&&Math.abs(Math.sqrt(l)-Math.sqrt(s))>3&&(t++,u[e]=d)}if(0===t&&0!==e)break;let r=Array(c).fill(0),a=Array(c).fill(0),n=Array(c).fill(0);for(let e=0;e<c;e++)f[e]=0;for(let e=0;e<s;e++){let t=u[e],o=i[e],s=l[e];f[t]+=s,r[t]+=o[0]*s,a[t]+=o[1]*s,n[t]+=o[2]*s}for(let e=0;e<c;e++){let t=f[e];if(0===t){h[e]=[0,0,0];continue}let i=r[e]/t,o=a[e]/t,s=n[e]/t;h[e]=[i,o,s]}}let g=new Map;for(let e=0;e<c;e++){let t=f[e];if(0===t)continue;let r=o.toInt(h[e]);g.has(r)||g.set(r,t)}return g}}class ta{constructor(){this.distance=-1,this.index=-1}}class ti{static quantize(e){let t=new Map;for(let r=0;r<e.length;r++){let a=e[r];(a>>24&255)<255||t.set(a,(t.get(a)??0)+1)}return t}}let tn={RED:"red",GREEN:"green",BLUE:"blue"};class to{constructor(e=[],t=[],r=[],a=[],i=[],n=[]){this.weights=e,this.momentsR=t,this.momentsG=r,this.momentsB=a,this.moments=i,this.cubes=n}quantize(e,t){this.constructHistogram(e),this.computeMoments();let r=this.createBoxes(t);return this.createResult(r.resultCount)}constructHistogram(e){for(let[t,r]of(this.weights=Array.from({length:35937}).fill(0),this.momentsR=Array.from({length:35937}).fill(0),this.momentsG=Array.from({length:35937}).fill(0),this.momentsB=Array.from({length:35937}).fill(0),this.moments=Array.from({length:35937}).fill(0),ti.quantize(e).entries())){let e=eC(t),a=eP(t),i=255&t,n=(e>>3)+1,o=(a>>3)+1,s=(i>>3)+1,l=this.getIndex(n,o,s);this.weights[l]=(this.weights[l]??0)+r,this.momentsR[l]+=r*e,this.momentsG[l]+=r*a,this.momentsB[l]+=r*i,this.moments[l]+=r*(e*e+a*a+i*i)}}computeMoments(){for(let e=1;e<33;e++){let t=Array.from({length:33}).fill(0),r=Array.from({length:33}).fill(0),a=Array.from({length:33}).fill(0),i=Array.from({length:33}).fill(0),n=Array.from({length:33}).fill(0);for(let o=1;o<33;o++){let s=0,l=0,c=0,h=0,d=0;for(let u=1;u<33;u++){let m=this.getIndex(e,o,u);s+=this.weights[m],l+=this.momentsR[m],c+=this.momentsG[m],h+=this.momentsB[m],d+=this.moments[m],t[u]+=s,r[u]+=l,a[u]+=c,i[u]+=h,n[u]+=d;let p=this.getIndex(e-1,o,u);this.weights[m]=this.weights[p]+t[u],this.momentsR[m]=this.momentsR[p]+r[u],this.momentsG[m]=this.momentsG[p]+a[u],this.momentsB[m]=this.momentsB[p]+i[u],this.moments[m]=this.moments[p]+n[u]}}}}createBoxes(e){this.cubes=Array.from({length:e}).fill(0).map(()=>new ts);let t=Array.from({length:e}).fill(0);this.cubes[0].r0=0,this.cubes[0].g0=0,this.cubes[0].b0=0,this.cubes[0].r1=32,this.cubes[0].g1=32,this.cubes[0].b1=32;let r=e,a=0;for(let i=1;i<e;i++){this.cut(this.cubes[a],this.cubes[i])?(t[a]=this.cubes[a].vol>1?this.variance(this.cubes[a]):0,t[i]=this.cubes[i].vol>1?this.variance(this.cubes[i]):0):(t[a]=0,i--),a=0;let e=t[0];for(let r=1;r<=i;r++)t[r]>e&&(e=t[r],a=r);if(e<=0){r=i+1;break}}return new tl(e,r)}createResult(e){let t=[];for(let r=0;r<e;++r){let e=this.cubes[r],a=this.volume(e,this.weights);if(a>0){let r=Math.round(this.volume(e,this.momentsR)/a),i=-0x1000000|(255&r)<<16|(255&Math.round(this.volume(e,this.momentsG)/a))<<8|255&Math.round(this.volume(e,this.momentsB)/a);t.push(i)}}return t}variance(e){let t=this.volume(e,this.momentsR),r=this.volume(e,this.momentsG),a=this.volume(e,this.momentsB);return this.moments[this.getIndex(e.r1,e.g1,e.b1)]-this.moments[this.getIndex(e.r1,e.g1,e.b0)]-this.moments[this.getIndex(e.r1,e.g0,e.b1)]+this.moments[this.getIndex(e.r1,e.g0,e.b0)]-this.moments[this.getIndex(e.r0,e.g1,e.b1)]+this.moments[this.getIndex(e.r0,e.g1,e.b0)]+this.moments[this.getIndex(e.r0,e.g0,e.b1)]-this.moments[this.getIndex(e.r0,e.g0,e.b0)]-(t*t+r*r+a*a)/this.volume(e,this.weights)}cut(e,t){let r,a=this.volume(e,this.momentsR),i=this.volume(e,this.momentsG),n=this.volume(e,this.momentsB),o=this.volume(e,this.weights),s=this.maximize(e,tn.RED,e.r0+1,e.r1,a,i,n,o),l=this.maximize(e,tn.GREEN,e.g0+1,e.g1,a,i,n,o),c=this.maximize(e,tn.BLUE,e.b0+1,e.b1,a,i,n,o),h=s.maximum,d=l.maximum,u=c.maximum;if(h>=d&&h>=u){if(s.cutLocation<0)return!1;r=tn.RED}else r=d>=h&&d>=u?tn.GREEN:tn.BLUE;switch(t.r1=e.r1,t.g1=e.g1,t.b1=e.b1,r){case tn.RED:e.r1=s.cutLocation,t.r0=e.r1,t.g0=e.g0,t.b0=e.b0;break;case tn.GREEN:e.g1=l.cutLocation,t.r0=e.r0,t.g0=e.g1,t.b0=e.b0;break;case tn.BLUE:e.b1=c.cutLocation,t.r0=e.r0,t.g0=e.g0,t.b0=e.b1;break;default:throw Error("unexpected direction "+r)}return e.vol=(e.r1-e.r0)*(e.g1-e.g0)*(e.b1-e.b0),t.vol=(t.r1-t.r0)*(t.g1-t.g0)*(t.b1-t.b0),!0}maximize(e,t,r,a,i,n,o,s){let l=this.bottom(e,t,this.momentsR),c=this.bottom(e,t,this.momentsG),h=this.bottom(e,t,this.momentsB),d=this.bottom(e,t,this.weights),u=0,m=-1,p=0,f=0,g=0,y=0;for(let b=r;b<a;b++){if(p=l+this.top(e,t,b,this.momentsR),f=c+this.top(e,t,b,this.momentsG),g=h+this.top(e,t,b,this.momentsB),0===(y=d+this.top(e,t,b,this.weights)))continue;let r=(p*p+f*f+g*g)*1,a=+y,v=r/a;p=i-p,f=n-f,g=o-g,0!=(y=s-y)&&(v+=(r=(p*p+f*f+g*g)*1)/(a=+y))>u&&(u=v,m=b)}return new tc(m,u)}volume(e,t){return t[this.getIndex(e.r1,e.g1,e.b1)]-t[this.getIndex(e.r1,e.g1,e.b0)]-t[this.getIndex(e.r1,e.g0,e.b1)]+t[this.getIndex(e.r1,e.g0,e.b0)]-t[this.getIndex(e.r0,e.g1,e.b1)]+t[this.getIndex(e.r0,e.g1,e.b0)]+t[this.getIndex(e.r0,e.g0,e.b1)]-t[this.getIndex(e.r0,e.g0,e.b0)]}bottom(e,t,r){switch(t){case tn.RED:return-r[this.getIndex(e.r0,e.g1,e.b1)]+r[this.getIndex(e.r0,e.g1,e.b0)]+r[this.getIndex(e.r0,e.g0,e.b1)]-r[this.getIndex(e.r0,e.g0,e.b0)];case tn.GREEN:return-r[this.getIndex(e.r1,e.g0,e.b1)]+r[this.getIndex(e.r1,e.g0,e.b0)]+r[this.getIndex(e.r0,e.g0,e.b1)]-r[this.getIndex(e.r0,e.g0,e.b0)];case tn.BLUE:return-r[this.getIndex(e.r1,e.g1,e.b0)]+r[this.getIndex(e.r1,e.g0,e.b0)]+r[this.getIndex(e.r0,e.g1,e.b0)]-r[this.getIndex(e.r0,e.g0,e.b0)];default:throw Error("unexpected direction $direction")}}top(e,t,r,a){switch(t){case tn.RED:return a[this.getIndex(r,e.g1,e.b1)]-a[this.getIndex(r,e.g1,e.b0)]-a[this.getIndex(r,e.g0,e.b1)]+a[this.getIndex(r,e.g0,e.b0)];case tn.GREEN:return a[this.getIndex(e.r1,r,e.b1)]-a[this.getIndex(e.r1,r,e.b0)]-a[this.getIndex(e.r0,r,e.b1)]+a[this.getIndex(e.r0,r,e.b0)];case tn.BLUE:return a[this.getIndex(e.r1,e.g1,r)]-a[this.getIndex(e.r1,e.g0,r)]-a[this.getIndex(e.r0,e.g1,r)]+a[this.getIndex(e.r0,e.g0,r)];default:throw Error("unexpected direction $direction")}}getIndex(e,t,r){return(e<<10)+(e<<6)+e+(t<<5)+t+r}}class ts{constructor(e=0,t=0,r=0,a=0,i=0,n=0,o=0){this.r0=e,this.r1=t,this.g0=r,this.g1=a,this.b0=i,this.b1=n,this.vol=o}}class tl{constructor(e,t){this.requestedCount=e,this.resultCount=t}}class tc{constructor(e,t){this.cutLocation=e,this.maximum=t}}class th{static quantize(e,t){let r=new to().quantize(e,t);return tr.quantize(e,r,t)}}let td={desired:4,fallbackColorARGB:0xff4285f4,filter:!0};function tu(e,t){return e.score>t.score?-1:+(e.score<t.score)}class tm{constructor(){}static score(e,t){let{desired:r,fallbackColorARGB:a,filter:i}={...td,...t},n=[],o=Array(360).fill(0),s=0;for(let[t,r]of e.entries()){let e=eO.fromInt(t);n.push(e);let a=Math.floor(e.hue);o[a]+=r,s+=r}let l=Array(360).fill(0);for(let e=0;e<360;e++){let t=o[e]/s;for(let r=e-14;r<e+16;r++){let e=ep(r);l[e]+=t}}let c=[];for(let e of n){let t=l[ep(Math.round(e.hue))];if(i&&(e.chroma<tm.CUTOFF_CHROMA||t<=tm.CUTOFF_EXCITED_PROPORTION))continue;let r=100*t*tm.WEIGHT_PROPORTION,a=e.chroma<tm.TARGET_CHROMA?tm.WEIGHT_CHROMA_BELOW:tm.WEIGHT_CHROMA_ABOVE,n=r+(e.chroma-tm.TARGET_CHROMA)*a;c.push({hct:e,score:n})}c.sort(tu);let h=[];for(let e=90;e>=15;e--){for(let{hct:t}of(h.length=0,c))if(h.find(r=>eg(t.hue,r.hue)<e)||h.push(t),h.length>=r)break;if(h.length>=r)break}let d=[];for(let e of(0===h.length&&d.push(a),h))d.push(e.toInt());return d}}function tp(e){let t=eC(e),r=eP(e),a=255&e,i=[t.toString(16),r.toString(16),a.toString(16)];for(let[e,t]of i.entries())1===t.length&&(i[e]="0"+t);return"#"+i.join("")}function tf(e){let t=3===(e=e.replace("#","")).length,r=6===e.length,a=8===e.length;if(!t&&!r&&!a)throw Error("unexpected hex "+e);let i=0,n=0,o=0;return t?(i=tg(e.slice(0,1).repeat(2)),n=tg(e.slice(1,2).repeat(2)),o=tg(e.slice(2,3).repeat(2))):r?(i=tg(e.slice(0,2)),n=tg(e.slice(2,4)),o=tg(e.slice(4,6))):a&&(i=tg(e.slice(2,4)),n=tg(e.slice(4,6)),o=tg(e.slice(6,8))),(-0x1000000|(255&i)<<16|(255&n)<<8|255&o)>>>0}function tg(e){return parseInt(e,16)}tm.TARGET_CHROMA=48,tm.WEIGHT_PROPORTION=.7,tm.WEIGHT_CHROMA_ABOVE=.3,tm.WEIGHT_CHROMA_BELOW=.1,tm.CUTOFF_CHROMA=5,tm.CUTOFF_EXCITED_PROPORTION=.01;let ty="Material You",tb=ty.toLowerCase().replace(/ /g,"_"),tv=tb.replace(/_/g,"-");async function tw(e,t,r=6e4){return new Promise((a,i)=>{let n=e.querySelector(t);n&&a(n);let o=setTimeout(()=>i(`Timeout waiting for ${t} in ${e} after ${r}ms.`),r),s=new MutationObserver(()=>{let r=e.querySelector(t);r&&(clearTimeout(o),s.disconnect(),a(r))});s.observe(e,{childList:!0,subtree:!0})})}async function tx(e,t,r=6e4){let a=1;setTimeout(()=>a=10,100),setTimeout(()=>a=100,1e3),setTimeout(()=>a=1e3,5e3);let i=!1;for(setTimeout(()=>i=!0,r);!(t in e)||null==e[t];){if(i){console.error(`Timeout waiting for ${t} in ${e} after ${r}ms.`);break}await new Promise(e=>setTimeout(e,a))}return e[t]}async function tk(){let e=await tw(await tx(await tw(document,"home-assistant"),"shadowRoot"),"home-assistant-main");return await tx(e,"shadowRoot"),e}function tC(e,t){return`${rG[e].domain}.${tb}_${e}${t?`_${t}`:""}`.toLowerCase().replace(/ |-/g,"_")}function tP(e,t){let r=document.querySelector("home-assistant").hass,a=[t,window.browser_mod?.browserID?.replace(/-/g,"_"),r.user?.id,""],i={entityId:"",value:""};for(let t of a){if(void 0==t)continue;let a=tC(e,t),n=r.states[a]?.state?.trim();if(void 0!=n&&"unknown"!=n){i.entityId=a,i.value=n;break}}return i}function t_(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}async function tS(){let e=[await tw(document,"html")],t=await tk(),r=t.shadowRoot?.querySelector("iframe")?.contentWindow?.document?.querySelector("body");return r&&e.push(r),e}function tA(e,t){let r=t.getPropertyValue(e).trim();if(r.startsWith("#"))return tf(r);if(r.startsWith("rgb")){let[e,t,a]=r.replace("rgb(","").replace("rgba(","").replace(")","").replace(/ /g,",").split(",").map(e=>parseInt(e));return ex(e,t,a)}return tf(rG.base_color.default)}function tT(e,t,r=!1){let a=getComputedStyle(e=e instanceof ShadowRoot?e.host:e),i=a?.getPropertyValue("--md-sys-color-primary-light")||"#4c5c92",n=a?.getPropertyValue("--md-sys-color-on-primary-light")||"#ffffff";console.info(`%c ${t} `,`color: ${n}; background: ${i}; font-weight: bold; border-radius: 32px; padding: 0 8px;`),r&&t$(t)}function tE(e,t){let r=new Event("hass-notification",{bubbles:!0,composed:!0});r.detail={message:t},e.dispatchEvent(r)}async function t$(e){let t=document.querySelector("home-assistant"),r=t.hass;r.states[`input_boolean.${tb}_debug_toast`]?.state=="on"&&tE(t,e)}async function tM(e){let t=document.querySelector("home-assistant").hass;try{if((t?.themes?.theme??"").includes(ty)){let n=tP("image_url",e.id),o=n.value;if(!o)return;let s=new Image(128,128);if(s.crossOrigin="anonymous",o.includes("://"))s.src=o;else{let e=await t.fetchWithAuth(o,{mode:"cors"});if(!e.ok)throw Error(await e.text());let r=await e.blob();s.src=URL.createObjectURL(r),o=e.url}await new Promise(e=>{s.onload=e});let l=document.createElement("canvas");l.height=128,l.width=128;let c=l.getContext("2d");c?.drawImage(s,0,0,128,128);let h=c?.getImageData(0,0,l.width,l.height),d=h?.data??[];URL.revokeObjectURL(s.src);let u=[];for(let e=0;e<d.length-3;e+=4){var r,a,i;u.push((r=d[e],a=d[e+1],i=d[e+2],(d[e+3]<<24|(255&r)<<16|(255&a)<<8|255&i)>>>0))}let m=th.quantize(u,128),p=tm.score(m),f=0,g=new URL(o).searchParams;if(g.has("i")){if(f=parseInt(g.get("i")),isNaN(f))return;f=Math.max(Math.min(f,p.length-1),0)}let y=tp(p[f]),b=n.entityId.replace("image_url","base_color");t.callService("input_text","set_value",{entity_id:b,value:y})}}catch(e){console.error(e),t$(String(e))}}var tD=r(530),tI=r(934),tR=r(332),tB=r(168),tF=r(591),tO=r(854),tL=r(207),tH=r(350),tN=r(902),tV=r(279),tU=r(241),tz=r(857),tZ=r(931),tj=r(312),tq=r(650),tW=r(891),tY=r(896),tK=r(523),tG=r(974),tX=r(151),tJ=r(644),tQ=r(917),t0=r(921),t1=r(463),t2=r(547),t4=r(538),t5=r(406),t3=r(121),t6=r(337),t8=r(160),t9=r(936),t7=r(365),re=r(362),rt=r(324),rr=r(980),ra=r(614),ri=r(576),rn=r(366),ro=r(992),rs=r(334),rl=r(903),rc=r(689);let rh={"ha-assist-chip":tD.Z,"ha-button":tI.Z,"ha-card":tL.Z,"ha-config-info":tH.Z,"ha-dialog":tV.Z,"ha-md-dialog":tK.Z,"ha-entity-toggle":tz.Z,"ha-fab":tZ.Z,"ha-grid-layout-slider":tj.Z,"ha-input-chip":tq.Z,"ha-list-item":tW.Z,"mwc-list-item":tW.Z,"ha-markdown":tY.Z,"ha-md-list-item":tG.Z,"ha-md-menu-item":tX.Z,"ha-menu-button":tJ.Z,"ha-more-info-info":tQ.Z,"ha-drawer":tU.Z,"ha-select":t1.Z,"ha-select-box":t0.Z,"ha-settings-row":t2.Z,"ha-sidebar":t4.Z,"ha-slider":t5.Z,"md-slider":t5.Z,"ha-switch":t3.Z,"ha-top-app-bar-fixed":t9.Z,"ha-textfield":t6.Z,"ha-toast":t8.Z,"ha-user-badge":t7.Z,"ha-config-section-updates":tN.Z,"hui-entities-card":ri.Z,"hui-entities-card-editor":ra.Z,"hui-grid-section":rn.Z,"hui-root":rs.Z,"hui-view-header":rl.Z,"hui-view-visibility-editor":rc.Z,"hue-like-light-card":rr.Z,"home-assistant":rt.Z,"home-assistant-main":re.Z},rd={elevated:tR.Z,filled:tB.Z,outlined:tF.Z,transparent:tO.Z},ru=ro.Z,rm="",rp=!0,rf=["home-assistant","home-assistant-main","ha-drawer"];function rg(){if(!rm){let e=document.querySelector("home-assistant");(rm=e?.hass?.themes?.theme)&&(rp=rm.includes(ty)&&"on"==(tP("styles").value||"on"))}}function ry(e){return e.shadowRoot?.getElementById(tv)}function rb(e){let t=e.toString().replace(/ !important/g,"").replace(/;/g," !important;");if(t.includes("@keyframes"))for(let e of t.match(/@keyframes .*?\s{(.|\s)*?}\s}/g)??[])t=t.replace(e,e.replace(/ !important/g,""));return t}function rv(e){return`:host,html,body,ha-card{${rb(Object.entries(e).map(([e,t])=>`${e}: ${t};`).join("\n"))}}`}function rw(e){rg();let t=e.shadowRoot;rp&&t&&!ry(e)&&rx(t,tv,rb(rh[e.nodeName.toLowerCase()]))}function rx(e,t,r){let a=(e=e.shadowRoot||e).querySelector(`#${t}`);a||((a=document.createElement("style")).id=t,e.appendChild(a)),a.textContent=r}let rk={childList:!0,subtree:!0,characterData:!0,attributes:!0};async function rC(e=10){if(!(e>2e4)){if(rg(),!rm)return void setTimeout(()=>rC(2*e),e);if(rp){let e=await tk(),t=await tw(document,"home-assistant"),r=await tw(e.shadowRoot,"ha-drawer");rw(t),rw(e),rw(r)}}}async function rP(e){let t=e.CustomElementRegistry.prototype.define;e.CustomElementRegistry.prototype.define=function(e,r,a){return rh[e]&&!rf.includes(e)&&(r=class extends r{constructor(...e){super(...e);var t=this;let r=new MutationObserver(()=>{ry(t)?r.disconnect():t.shadowRoot&&(t.shadowRoot.children.length?(rw(t),r.disconnect()):r.observe(t.shadowRoot,rk))});r.observe(t,rk),function e(t,r=10){if(!(r>2e4)){if(!t.shadowRoot?.children.length)return void setTimeout(()=>e(t,2*r),r);rw(t)}}(this)}}),t.call(this,e,r,a)},rC()}let r_=`${tv}-navbar`;async function rS(e){let t=document.querySelector("home-assistant").hass;try{if((t?.themes?.theme??"").includes(ty)){let t=tP("navbar",e.id).value||"on";if("on"==t)return void rA();let r=document.querySelector("html");rx(r,r_,rb(ru)),tT(r,"Navigation bar hidden.",!0)}else rA()}catch(e){console.error(e),t$(String(e)),rA()}}async function rA(){let e=document.querySelector("html"),t=e?.querySelector(`#${r_}`);t&&(e?.removeChild(t),tT(e,"Navigation bar unhidden.",!0))}let rT=["primary","onPrimary","primaryContainer","onPrimaryContainer","primaryPaletteKeyColor","inversePrimary","primaryFixed","primaryFixedDim","onPrimaryFixed","onPrimaryFixedVariant","secondary","onSecondary","secondaryContainer","onSecondaryContainer","secondaryPaletteKeyColor","secondaryFixed","secondaryFixedDim","onSecondaryFixed","onSecondaryFixedVariant","tertiary","onTertiary","tertiaryContainer","onTertiaryContainer","tertiaryPaletteKeyColor","tertiaryFixed","tertiaryFixedDim","onTertiaryFixed","onTertiaryFixedVariant","neutralPaletteKeyColor","neutralVariantPaletteKeyColor","error","onError","errorContainer","onErrorContainer","surface","onSurface","surfaceVariant","onSurfaceVariant","surfaceDim","surfaceBright","surfaceContainerLowest","surfaceContainerLow","surfaceContainer","surfaceContainerHigh","surfaceContainerHighest","inverseSurface","inverseOnSurface","surfaceTint","outline","outlineVariant","shadow","scrim"],rE={warning:"#ffa600",success:"#43a047",info:"#039be5",energyGridConsumption:"#488fc2",energyGridReturn:"#8353d1",energySolar:"#ff9800",energyNonFossil:"#0f9d58",energyBatteryOut:"#4db6ac",energyBatteryIn:"#f06292",energyGas:"#8e021b",energyWater:"#00bcd4",red:"#f44336",pink:"#e91e63",purple:"#926bc7",deepPurple:"#6e41ab",indigo:"#3f51b5",blue:"#2196f3",lightBlue:"#03a9f4",cyan:"#00bcd4",teal:"#009688",green:"#4caf50",lightGreen:"#8bc34a",lime:"#cddc39",yellow:"#ffeb3b",amber:"#ffc107",orange:"#ff9800",deepOrange:"#ff6f22",brown:"#795548",lightGrey:"#bdbdbd",grey:"#9e9e9e",darkGrey:"#606060",blueGrey:"#607d8b"},r$=["primary","orange","red","green"],rM=[{value:"tonalspot",label:"Tonal Spot",class:class extends e3{constructor(t,r,a,i=e3.DEFAULT_SPEC_VERSION,n=e3.DEFAULT_PLATFORM){super({sourceColorHct:t,variant:e.TONAL_SPOT,contrastLevel:a,isDark:r,platform:n,specVersion:i})}}},{value:"content",label:"Content",class:class extends e3{constructor(t,r,a,i=e3.DEFAULT_SPEC_VERSION,n=e3.DEFAULT_PLATFORM){super({sourceColorHct:t,variant:e.CONTENT,contrastLevel:a,isDark:r,platform:n,specVersion:i})}}},{value:"fidelity",label:"Fidelity",class:class extends e3{constructor(t,r,a,i=e3.DEFAULT_SPEC_VERSION,n=e3.DEFAULT_PLATFORM){super({sourceColorHct:t,variant:e.FIDELITY,contrastLevel:a,isDark:r,platform:n,specVersion:i})}}},{value:"expressive",label:"Expressive",class:class extends e3{constructor(t,r,a,i=e3.DEFAULT_SPEC_VERSION,n=e3.DEFAULT_PLATFORM){super({sourceColorHct:t,variant:e.EXPRESSIVE,contrastLevel:a,isDark:r,platform:n,specVersion:i})}}},{value:"fruitsalad",label:"Fruit Salad",class:class extends e3{constructor(t,r,a,i=e3.DEFAULT_SPEC_VERSION,n=e3.DEFAULT_PLATFORM){super({sourceColorHct:t,variant:e.FRUIT_SALAD,contrastLevel:a,isDark:r,platform:n,specVersion:i})}}},{value:"rainbow",label:"Rainbow",class:class extends e3{constructor(t,r,a,i=e3.DEFAULT_SPEC_VERSION,n=e3.DEFAULT_PLATFORM){super({sourceColorHct:t,variant:e.RAINBOW,contrastLevel:a,isDark:r,platform:n,specVersion:i})}}},{value:"vibrant",label:"Vibrant",class:class extends e3{constructor(t,r,a,i=e3.DEFAULT_SPEC_VERSION,n=e3.DEFAULT_PLATFORM){super({sourceColorHct:t,variant:e.VIBRANT,contrastLevel:a,isDark:r,platform:n,specVersion:i})}}},{value:"neutral",label:"Neutral",class:class extends e3{constructor(t,r,a,i=e3.DEFAULT_SPEC_VERSION,n=e3.DEFAULT_PLATFORM){super({sourceColorHct:t,variant:e.NEUTRAL,contrastLevel:a,isDark:r,platform:n,specVersion:i})}}},{value:"monochrome",label:"Monochrome",class:class extends e3{constructor(t,r,a,i=e3.DEFAULT_SPEC_VERSION,n=e3.DEFAULT_PLATFORM){super({sourceColorHct:t,variant:e.MONOCHROME,contrastLevel:a,isDark:r,platform:n,specVersion:i})}}}],rD=[5,10,20,30,40,50,60,70,80,90,95],rI=`${tv}-palettes`;async function rR(e,t){let r=e.targets??await tS();try{let e=getComputedStyle(r[0]),a={};for(let r of t){let t=`--${t_(r)}-color`,i=tA(t,e),n=eq.fromInt(i);for(let e of(t=`--md-sys-color-${t_(r)}`,rD)){let r=`${t}-${e.toString().padStart(2,"0")}`,i=tp(n.tone(e));a[r]=i}}for(let e of r)rx(e,rI,rv(a))}catch(r){console.error(r),t$(String(r)),await rB(e,1!=t.length||"primary"!=t[0])}}async function rB(e,t=!0){await rU(e,rI),t&&await rR(e,["primary"])}let rF=`${tv}-harmonized-colors`;async function rO(e){let t=document.querySelector("home-assistant").hass,r=e.targets??await tS();try{if((t?.themes?.theme??"").includes(ty)){let t=tP("harmonize",e.id).value||"off";if("on"!=t)return void rL(e);let a=tA("--primary-color",getComputedStyle(r[0])),i={};for(let e in rE){let t=tp(eL.harmonize(tf(rE[e]),a)),r=t_(e);i[`--md-sys-color-${r}`]=t}for(let e of r)rx(e,rF,rv(i));await rR(e,r$),tT(r[0],"Semantic colors harmonized.",!0)}else await rL(e)}catch(t){console.error(t),t$(String(t)),rL(e)}}async function rL(e){await rU(e,rF,"Harmonized colors removed."),await rB(e)}let rH=`${tv}-theme`;async function rN(e){let t=document.querySelector("home-assistant").hass,r=e.targets??await tS();try{let a=await tw(document,"html");if((t?.themes?.theme??"").includes(ty)){a?.style.setProperty("background-color","var(--md-sys-color-surface)");let t=["base_color","scheme","contrast","spec","platform"],i={};for(let r of t)i[r]=tP(r,e.id).value;if(t.some(e=>""!=i[e])){for(let e in i)i[e]||=rG[e].default;let t=rM.find(e=>e.value==i.scheme)||rM.find(e=>e.value==rG.scheme.default),a={};for(let e of["light","dark"]){let n=new t.class(eO.fromInt(tf(i.base_color)),"dark"==e,parseFloat(i.contrast),i.spec,i.platform);for(let t of rT){let r=tp(e5[t].getArgb(n)),i=t_(t);a[`--md-sys-color-${i}-${e}`]=r}for(let e of r)rx(e,rH,rv(a))}await rR(e,["primary"]),await rO(e),tT(r[0],`Material design system colors updated.
Base Color - ${i.base_color} | Scheme - ${t.label} | Contrast Level - ${i.contrast} | Specification Version - ${i.spec} | Platform - ${i.platform[0].toUpperCase()}${i.platform.slice(1)}`,!0)}else await rV(e)}}catch(t){console.error(t),t$(String(t)),await rV(e)}let a={type:"theme-update"};window.externalApp?window.externalApp.externalBus(JSON.stringify(a)):window.webkit&&window.webkit.messageHandlers.externalBus.postMessage(a)}async function rV(e){await rU(e,rH,"Material design system colors removed."),await rB(e)}async function rU(e,t,r){let a=e.targets??await tS(),i=!1;for(let e of a){let r=e.shadowRoot||e,a=r.querySelector(`#${t}`);a&&(i=!0,r.removeChild(a))}i&&r&&tT(a[0],r,!0)}let rz=`${tv}-card-type`;async function rZ(e){let t=document.querySelector("home-assistant").hass,r=e.targets??await tS();try{if((t?.themes?.theme??"").includes(ty)){let t=tP("card_type",e.id).value;if(!(t in rd))return void rj(e);for(let e of r)rx(e,rz,rb(rd[t]));tT(r[0],`Material design card type set to ${t}.`,!0)}else await rj(e)}catch(t){console.error(t),t$(String(t)),await rj(e)}}async function rj(e){await rU(e,rz,"Material design card type unset.")}let rq=`${tv}-user-styles`;async function rW(e){let t=document.querySelector("home-assistant").hass,r=e.targets??await tS();try{if((t?.themes?.theme??"").includes(ty)){let a,i=tP("css_file",e.id).value;if(!i)return void rY(e);if(!(a=i.includes("://")?await fetch(i,{mode:"cors"}):await t.fetchWithAuth(i,{mode:"cors"})).ok)throw Error(await a.text());let n=rb(await a.text());for(let e of r)rx(e,rq,n);(n.includes("--primary-color")||n.includes("--md-sys-color-primary"))&&rO(e)}else rY(e)}catch(t){console.error(t),t$(String(t)),rY(e)}}async function rY(e){await rU(e,rq,"CSS styles from file removed."),await rO(e)}let rK={input_text:"set_value",input_number:"set_value",input_select:"select_option",input_boolean:"toggle"},rG={base_color:{domain:"input_text",default:"#4C5C92",name:"Base Color",description:`The color from which the theme is derived.
It usually does not appear in the theme itself.`,init:{config:{icon:"mdi:palette",min:3,max:9}},card:{config:{},tabBarIndex:0,resetButton:!0},handler:rN},contrast:{domain:"input_number",default:0,name:"Contrast Level",description:"The contrast/brightness of the theme colors.",init:{config:{icon:"mdi:contrast-circle",min:-1,max:1,step:.1}},card:{config:{number:{min:-1,max:1,step:.1,mode:"slider",slider_ticks:!0}},tabBarIndex:0},handler:rN},scheme:{domain:"input_select",default:"tonalspot",name:"Scheme Name",description:"The color palette used to generate the theme.",init:{config:{icon:"mdi:palette-advanced",options:[...rM.map(e=>e.value)]}},card:{config:{select:{mode:"dropdown",options:rM}},tabBarIndex:0},handler:rN},spec:{domain:"input_select",default:"2021",name:"Specification Version",description:`The palette rules to use for the scheme.
2021 is the original Material You palettes.
2025 is the Material Expressive palettes.`,init:{config:{icon:"mdi:calendar-multiple",options:["2021","2025"]}},card:{config:{select:{mode:"box",options:["2021","2025"]}},tabBarIndex:0},handler:rN},platform:{domain:"input_select",default:"phone",name:"Platform",description:`The target platform for the theme.
Not available for the 2021 spec.`,init:{config:{icon:"mdi:devices",options:["phone","watch"]}},card:{config:{select:{mode:"box",options:[{value:"phone",label:"Phone"},{value:"watch",label:"Watch"}]}},tabBarIndex:0},handler:rN},styles:{domain:"input_boolean",default:"on",name:"Style Upgrades",description:"Enable global style upgrades for components to follow the Material Design 3 specifications.",init:{config:{icon:"mdi:material-design"}},card:{config:{boolean:{}},tabBarIndex:1},handler:async e=>{}},card_type:{domain:"input_select",default:"elevated",name:"Card Type",description:`Which card variant to use as the default for Home Assistant cards.
Does not apply to cards that are explicitly set to outlined like in settings.`,init:{config:{icon:"mdi:card",options:["elevated","filled","outlined","transparent"]}},card:{config:{select:{mode:"dropdown",options:[{value:"elevated",label:"Elevated"},{value:"filled",label:"Filled"},{value:"outlined",label:"Outlined"},{value:"transparent",label:"Transparent"}]}},tabBarIndex:1},handler:rZ},navbar:{domain:"input_boolean",default:"on",name:"Show Navigation Bar",description:`Show/hide the navigation bar at the bottom of views.
Does not restore the default Home Assistant navigation bar.`,init:{config:{icon:"mdi:navigation"}},card:{config:{boolean:{}},tabBarIndex:1},handler:rS},harmonize:{domain:"input_boolean",default:"off",name:"Harmonize Semantic Colors",description:"Adjust static/semantic colors to be closer in hue to the theme primary color.",init:{config:{icon:"mdi:palette-swatch"}},card:{config:{boolean:{}},tabBarIndex:2},handler:rO},image_url:{domain:"input_text",default:"",name:"Base Color Source Image Path/URL",description:`Path/URL to an image to extract the base color from.
Use a query string like ?i=1 (between 0 and 3 inclusive) to choose alternate color options.`,init:{config:{icon:"mdi:image",min:0,max:255}},card:{config:{text:{}},tabBarIndex:2},handler:tM},css_file:{domain:"input_text",default:"",name:"CSS Path/URL",description:"Path/URL to a CSS file to apply to the page and iframe roots for defining custom properties.",init:{config:{icon:"mdi:language-css3",min:0,max:255}},card:{config:{text:{}},tabBarIndex:2},handler:rW}};async function rX(e,t,r){return await e.callWS({type:`${t}/create`,...r})}async function rJ(e,t,r,a){return await e.callWS({type:`${t}/update`,[`${t}_id`]:r,...a})}async function rQ(e,t,r){await e.callWS({type:`${t}/delete`,[`${t}_id`]:r})}async function r0(e){let t=await e.sendMessagePromise({type:"config/label_registry/list"});return t.sort((e,t)=>e.name.localeCompare(t.name)),t}async function r1(e,t){await e.callWS({type:"config/label_registry/create",...t})}async function r2(e,t,r){await e.callWS({type:"config/entity_registry/update",entity_id:t,...r})}async function r4(e,t){if(!t)return!0;let r=new Event("hass-action",{bubbles:!0,composed:!0});return r.detail={action:"tap",config:{tap_action:{action:"fire-dom-event",confirmation:t}}},e.dispatchEvent(r),new Promise(e=>{let t,r=()=>{clearTimeout(t),window.removeEventListener("ll-custom",a),window.removeEventListener("dialog-closed",i)},a=()=>{r(),e(!0)};window.addEventListener("ll-custom",a);let i=()=>{t=setTimeout(()=>{r(),e(!1)},100)};window.addEventListener("dialog-closed",i)})}function r5(e,t="info"){return Z`<ha-alert .title="${e}" .alertType="${t}"></ha-alert>`}async function r3(e){return new Promise(async t=>{let r=(await tk()).hass,a=r.user?.id,i=window.browser_mod?.browserID?.replace(/-/g,"_");if(r.connection.connected&&a){let n=[];for(let e in rG){let t=n.find(t=>t.handler==rG[e].handler);t?t.inputs.push(e):(t={inputs:[e],handler:rG[e].handler},n.push(t))}let o=[];for(let t of n){let n=[];if(e.id?n=[...t.inputs.map(t=>tC(t,e.id))]:(n=[...t.inputs.map(e=>tC(e)),...t.inputs.map(e=>tC(e,a))],i&&n.push(...t.inputs.map(e=>tC(e,i)))),r.user?.is_admin)o.push(r.connection.subscribeMessage(()=>t.handler(e),{type:"subscribe_trigger",trigger:{platform:"state",entity_id:n}},{resubscribe:!0}));else for(let a of n)o.push(r.connection.subscribeMessage(r=>{"error"in r&&(console.error(r.error),t$(r.error)),t.handler(e)},{type:"render_template",template:`{{ states("${a}") }}`,entity_ids:a,report_errors:!0}))}t(Promise.all(o))}else setTimeout(()=>t(r3(e)),100)})}var r6=function(e,t,r,a){var i,n=arguments.length,o=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,a);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n<3?i(o):n>3?i(t,r,o):i(t,r))||o);return n>3&&o&&Object.defineProperty(t,r,o),o};customElements.get("disk-color-picker")||r(899);class r8 extends es{constructor(){super(...arguments),this.tabBarIndex=0,this.tabs=["theme","styles","other"],this.MODE_ID=`${tv}-mode`,this.unsubscribers=[]}async handleDeleteHelpers(e){if(!await r4(this,{text:"Are you sure you want to delete these helpers?"}))return;for(let e in rG){let t=tC(e,this.dataId);this.hass.states[t]&&await rQ(this.hass,rG[e].domain,t.split(".")[1])}let t="Global input entities cleared";if(this.dataId){let e="";e=this.dataId==this.hass.user?.id?this.hass.user?.name??"":this.hass.states[this.dataId]?.attributes.friendly_name??this.dataId,t=`Input entities cleared for ${e}`}tE(this,t)}buildDeleteHelpersButton(){return Z`<div class="delete button" @click="${this.handleDeleteHelpers}">Delete Helpers</div>`}async handleCreateHelpers(e){let t="";for(let e in this.dataId&&(t=` ${this.hass.states[this.personEntityId??""]?.attributes?.friendly_name??this.personEntityId??this.dataId}`),rG){let r=tC(e,this.dataId);if(!this.hass.states[r]){let a=r.split(".")[1];await rX(this.hass,rG[e].domain,{name:a,...rG[e].init.config}),await rJ(this.hass,rG[e].domain,a,{name:`${ty} ${rG[e].name}${t}`,...rG[e].init.config});let i=rG[e].domain,n=rK[i],o={entity_id:r};switch(i){case"input_text":case"input_number":o.value=rG[e].default;break;case"input_select":o.option=rG[e].default;break;case"input_boolean":n=`turn_${rG[e].default}`}await this.hass.callService(i,n,o),await r2(this.hass,r,{labels:[tb]})}}let r="Global input entities created";t&&(r=`Input entities created for${t}`),tE(this,r)}buildCreateHelpersButton(){return Z`<div class="create button" @click="${this.handleCreateHelpers}">Create Helpers</div>`}handleTabBar(e){let t=this.tabs.indexOf(e.detail.name);this.tabBarIndex!=t&&(this.tabBarIndex=t)}buildTabBar(e,t,r){return Z`<sl-tab-group @sl-tab-show="${t}">${r.map((t,r)=>Z`<sl-tab slot="nav" panel="${t}" .active="${r==e}">${t}</sl-tab>`)}</sl-tab-group>`}async handleSelectorChange(e){let t=e.target.getAttribute("field"),r=e.detail.value,a=rG[t].domain,i=rK[a],n={entity_id:tC(t,this.dataId)};switch(a){case"input_text":case"input_number":n.value=r||rG[t].default;break;case"input_select":n.option=r||rG[t].default}await this.hass.callService(a,i,n),this.requestUpdate()}buildSelector(e,t,r,a){let i,n=tC(t,this.dataId),o=this.hass.states[n]?.state;return i="input_boolean"===rG[t].domain?"on"==o:o??rG[t].default,Z`<ha-selector .hass="${this.hass}" .name="${e}" .selector="${r}" .value="${i??a}" .label="${e}" .placeholder="${a}" .required="${!1}" field="${t}" @value-changed="${this.handleSelectorChange}"></ha-selector>`}async handleKeyDown(e){!e.repeat&&["Enter"," "].includes(e.key)&&(e.preventDefault(),(e.target.parentElement?.className.replace("button","").trim()==="reset"?this.handleResetClick:this.handleMoreInfoClick).call(this,new window.MouseEvent("click",e),e.target))}async handleResetClick(e,t){let r=(e.target??t).getAttribute("field"),a=rG[r].domain,i=rK[a],n={entity_id:tC(r,this.dataId)};switch(a){case"input_text":case"input_number":n.value=rG[r].default;break;case"input_select":n.option=rG[r].default;break;case"input_boolean":i=`turn_${rG[r].default}`}await this.hass.callService(a,i,n),this.requestUpdate()}buildResetButton(e){return Z`<div class="reset button"><ha-icon @click="${this.handleResetClick}" @keydown="${this.handleKeyDown}" tabindex="0" field="${e}" .icon="${"mdi:restore"}"></ha-icon></div>`}handleMoreInfoClick(e,t){let r=tC((e.target||t).getAttribute("field"),this.dataId),a=new Event("hass-more-info",{bubbles:!0,cancelable:!0,composed:!0});a.detail={entityId:r},this.dispatchEvent(a)}buildMoreInfoButton(e){let t=tC(e,this.dataId),r=this.hass.states[t]?.attributes.icon;return Z`<pre class="description">${rG[e].description}</pre><div class="more-info button"><ha-icon @click="${this.handleMoreInfoClick}" @keydown="${this.handleKeyDown}" tabindex="0" field="${e}" .icon="${r}"></ha-icon></div>`}buildRow(e){let t=tC(e,this.dataId);if(!this.hass.states[t])return"";let r=this.hass.states[t]?.state;if("base_color"==e){let t,a=e=>{clearTimeout(t);let r=e.target,a=r.value;t=setTimeout(()=>{let e=new Event("value-changed");e.detail={value:a},r.dispatchEvent(e)},100)};return Z`<div class="column"><disk-color-picker field="${e}" value="${r}" @change="${a}" @keyup="${a}" @value-changed="${this.handleSelectorChange}"></disk-color-picker><div class="subrow"><div class="row">${this.buildMoreInfoButton(e)}<div class="label">${rG[e].name}</div></div><div class="row"><div class="label secondary">${r||rG[e].default}</div>${this.buildResetButton(e)}</div></div></div>`}let a="";"harmonize"==e&&(a=Z`<div class="row semantic-colors">${["pink","red","deep-orange","orange","amber","yellow","lime","light-green","green","teal","cyan","light-blue","blue","indigo","deep-purple","purple"].map(e=>Z`<div class="semantic-color" style="background:var(--${e}-color)"></div>`)}</div>`);let i=rG[e].card.config;return"input_number"==rG[e].domain?(i.min=this.hass.states[t]?.attributes?.min??-1,i.max=this.hass.states[t]?.attributes?.max??1,i.step=this.hass.states[t]?.attributes?.step??.01):"input_boolean"==rG[e].domain&&(r="on"==r),Z`${this.buildMoreInfoButton(e)} ${this.buildSelector(rG[e].name,e,i,r)}${a} ${rG[e].card.resetButton?this.buildResetButton(e):""}`}setupIds(){this.dataId&&!this.personEntityId&&(this.personEntityId=Object.keys(this.hass.states).find(e=>e.startsWith("person.")&&this.hass.states[e].attributes.user_id==this.dataId))}applyThemeMode(){if(this.darkMode!=this.hass.themes?.darkMode){this.darkMode=this.hass.themes?.darkMode;let e=this.hass.themes?.themes[ty].modes?.[this.darkMode?"dark":"light"]??{},t={};for(let[r,a]of Object.entries(e))t[`--${r}`]=a;rx(this,this.MODE_ID,rv(t))}}render(){this.setupIds();let e="Global";this.dataId&&(e=this.hass.states[this.personEntityId??""]?.attributes?.friendly_name??this.personEntityId??this.dataId);let t=Object.keys(rG).filter(e=>rG[e].card.tabBarIndex==this.tabBarIndex);this.hass.states[tC("spec",this.dataId)]?.state!="2025"&&(t=t.filter(e=>"platform"!=e));let r={};for(let e of t)r[e]=this.buildRow(e);for(let e in r)r[e]||delete r[e];return Z`<ha-card .hass="${this.hass}" .header="${e}">${this.personEntityId?Z`<div class="subtitle">ID: ${this.dataId}</div>`:""} ${this.buildTabBar(this.tabBarIndex,this.handleTabBar,this.tabs)}<div class="card-content">${Object.keys(r).length!=t.length?r5(this.hass.user?.is_admin?"Press Create Helpers to create and initialize inputs.":"Some or all input helpers not setup! Ask an Home Assistant administrator to do so.",this.hass.user?.is_admin?"info":"error"):""} ${Object.keys(r).map(e=>Z`<div class="row ${e}">${r[e]}</div>`)}</div>${this.hass.user?.is_admin?Z`<div class="card-actions">${this.buildCreateHelpersButton()}${this.buildDeleteHelpersButton()}</div>`:""}</ha-card><style id="${this.MODE_ID}"></style>`}firstUpdated(){let e=async()=>{let t=structuredClone(this.hass.themes?.themes[ty]);delete t.modes;let r=Object.entries(t);if(r.length){for(let[e,t]of r)this.style.setProperty(`--${e}`,t);return}setTimeout(()=>e(),100)};e();let t={targets:[this],id:this.dataId??""};for(let e of[tM,rN,rZ,rW])e(t)}updated(){this.applyThemeMode();let e=`${tv}-theme`,t=this.shadowRoot?.querySelector("disk-color-picker");t&&!t.shadowRoot?.getElementById(e)&&rx(t,e,`
/* Shift color picker down */
:host {
height: 248px;
translate: 0 -16px;
}
/* Scale the disk color picker relative to saturation arc */
#diskPanel {
scale: 1.3;
top: 4px;
}
/* Fix ugly square tap shadows */
#diskTarget,
#diskThumb,
#wheelThumb {
-webkit-tap-highlight-color: transparent;
}
`)}connectedCallback(){super.connectedCallback(),r3({targets:[this],id:this.dataId??""}).then(e=>{this.unsubscribers=e})}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribers.forEach(async e=>{e()})}static get styles(){return l`:host{width:var(--width);font-family:var(--font-family)}.card-content{display:flex;flex-direction:column;padding:16px;margin:0;gap:20px}.subtitle{margin-top:-24px;padding:0 16px 16px;color:var(--secondary-text-color);font-size:var(--md-sys-typescale-label-large-size,14px);font-weight:var(--md-sys-typescale-label-large-weight,500);line-height:var(
--md-sys-typescale-label-large-line-height,
20px
);letter-spacing:var(
--md-sys-typescale-label-large-tracking,
.1px
)}sl-tab-group{width:100%;margin:auto;text-transform:capitalize;position:relative;z-index:1;--sl-spacing-x-large:0}sl-tab-group::part(scroll-button){display:none}sl-tab{flex:1}sl-tab::part(base){width:100%;justify-content:center}ha-selector{width:100%}.row{display:flex;align-items:flex-end}.row:empty{display:none}.label{width:fit-content;text-align:center;align-content:center;margin:auto 0}.secondary{color:var(--secondary-text-color)}.column{display:flex;flex-direction:column;align-items:center;width:100%}.row.base_color{justify-content:center;align-items:center}.subrow{display:flex;justify-content:space-between;align-items:center;width:100%}.subrow .row{margin-bottom:0}.card-actions{display:flex;flex-direction:row;justify-content:space-between;height:36px}.button{display:flex;justify-content:center;align-items:center;color:var(--color);cursor:pointer;user-select:none;-webkit-tap-highlight-color:transparent}.button::after{content:'';position:absolute;height:var(--ha-button-height,40px);border-radius:var(--ha-button-border-radius,20px);background-color:var(--color);pointer-events:none;opacity:0;transition:var(--md-sys-motion-expressive-effects-fast,opacity 15ms linear)}@media (hover:hover){.button:hover::after{opacity:var(--mdc-ripple-hover-opacity,.04)}}.button:active::after{opacity:var(--mdc-ripple-focus-opacity,.12)}ha-icon:focus-visible{outline:0}.button:has(ha-icon:focus-visible)::after{opacity:var(--mdc-ripple-hover-opacity,.04)}.reset{height:var(--ha-button-height,40px);width:var(--ha-button-height,40px);margin:10px;--color:var(--secondary-text-color);--mdc-icon-size:20px}.more-info{height:var(--ha-button-height,40px);width:var(--ha-button-height,40px);min-width:var(--ha-button-height,40px);margin:8px 4px;--color:var(--state-icon-color);--mdc-icon-size:24px}.more-info::after,.reset::after{width:var(--ha-button-height,40px)}.create,.delete{margin:0 8px;height:var(--ha-button-height,40px);width:100px;border-radius:var(--ha-button-border-radius);transition:border-radius var(--md-sys-motion-expressive-spatial-fast) --ha-button-height,40px: 36px}.create::after,.delete::after{width:120px}.create{--color:var(--primary-color)}.delete{--color:var(--error-color)}@media (hover:hover){.create:hover,.delete:hover{--ha-button-border-radius:var(--md-sys-shape-corner-small, 8px)}}.create:active,.create:focus-visible,.delete:active,.delete:focus-visible{--ha-button-border-radius:var(--md-sys-shape-corner-small, 8px)}.description{position:absolute;translate:40px -40px;background:var(--md-sys-color-surface-container,#1e1f25);box-shadow:var(--md-sys-elevation-level2);border-radius:var(--md-sys-shape-corner-medium,12px);color:var(--md-sys-color-on-surface-variant,#c6c6d0);font-family:var(--font-family);font-size:var(--md-sys-typescale-body-medium-size,14px);font-weight:var(--md-sys-typescale-body-medium-weight,400);line-height:var(
--md-sys-typescale-body-medium-line-height,
20px
);letter-spacing:var(
--md-sys-typescale-body-medium-tracking,
.25px
);padding:12px 16px 8px;max-width:calc(var(--width) - 64px);white-space:pre-wrap;z-index:2;pointer-events:none;opacity:0;transition:opacity 150ms linear}.description:has(+ .more-info:hover){opacity:1}@media (width < 450px){.description{translate:0 -40px;max-width:calc(var(--width) - 24px)}}.semantic-colors{position:absolute;width:calc(100% - 44px);margin:0 12px;translate:0 12px;border-radius:4px;overflow:hidden}.semantic-color{flex:1;height:20px}`}}r6([eh()],r8.prototype,"hass",void 0),r6([eh()],r8.prototype,"dataId",void 0),r6([ed()],r8.prototype,"tabBarIndex",void 0);var r9=function(e,t,r,a){var i,n=arguments.length,o=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,r):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,a);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(n<3?i(o):n>3?i(t,r,o):i(t,r))||o);return n>3&&o&&Object.defineProperty(t,r,o),o};class r7 extends es{constructor(){super(...arguments),this.tabBarIndex=0,this.tabs=["you","everyone","devices"],this.darkModeIndex=0,this.darkModes=["auto","light","dark"],this.people=[],this.devices=[],this.labelSetup=!1}buildHeader(){let e=t.i8,r=this.hass.themes.themes[ty].version;return Z`<div class="header"><ha-menu-button slot="navigationIcon" .hass="${this.hass}" .narrow="${this.narrow}"></ha-menu-button><div class="versions"><span class="version">Module v${e}</span> <span class="version">Theme v${r}</span></div></div>`}handleTabBar(e){let t=this.tabs.indexOf(e.detail.name);this.tabBarIndex!=t&&(this.tabBarIndex=t)}buildTabBar(e,t,r){return Z`<sl-tab-group @sl-tab-show="${t}">${r.map((t,r)=>Z`<sl-tab slot="nav" panel="${t}" .active="${r==e}">${t}</sl-tab>`)}</sl-tab-group>`}buildSectionHeader(e,t){return Z`<div class="section-header"><div class="title">${e}</div><div class="description">${t}</div></div>`}handleThemeMode(e){this.darkModeIndex+=1,this.darkModeIndex>this.darkModes.length-1&&(this.darkModeIndex=0);let t={auto:void 0,light:!1,dark:!0}[this.darkModes[this.darkModeIndex]],r=new Event("settheme",{bubbles:!0,composed:!0});r.detail={theme:ty,dark:t},this.dispatchEvent(r)}buildThemeModeFAB(){let e={auto:"mdi:theme-light-dark",light:"mdi:white-balance-sunny",dark:"mdi:weather-night"}[this.darkModes[this.darkModeIndex]];return Z`<div class="theme-mode-fab" @click="${this.handleThemeMode}"><ha-icon .icon="${e}"></ha-icon></div>`}setupIds(){this.people.length||(this.people=Object.keys(this.hass.states).filter(e=>e.startsWith("person.")&&this.hass.states[e].attributes.user_id&&this.hass.states[e].attributes.user_id!=this.hass.user?.id)),this.devices.length||(this.devices=Object.keys(window.browser_mod?.browsers??{}).filter(e=>e!=window.browser_mod?.browserID))}async setupLabel(){!this.labelSetup&&(this.labelSetup=!0,(await r0(this.hass.connection)).some(e=>e.label_id==tb)||r1(this.hass,{name:"Material You",icon:"mdi:material-design",color:"indigo",description:`Input helpers for ${ty} Utilities.`}))}render(){let e;this.setupIds(),this.setupLabel(),this.hass.user?.is_admin||(this.tabBarIndex=0);let t=Z`${"Material Rounded"in this.hass.themes.themes?r5(`Your theme install is corrupted! The legacy Material Rounded theme was not properly removed and is possibly overwriting ${ty} Theme. Delete the config/themes/material_rounded folder from your Home Assistant server.`,"error"):""} ${!(ty in this.hass.themes.themes)?r5(`You do not have ${ty} Theme installed! This module is made to work with ${ty} Theme and will not function properly otherwise. Install it using HACS.`,"error"):!this.hass.themes.theme.includes(ty)?r5(`You are not using ${ty} Theme! Switch to it using the floating action button at the bottom of the page.`,"warning"):""}`;switch(this.tabBarIndex){case 2:e=Z`${window.browser_mod?Z`${r5("Remember to register devices with Brower Mod!")} ${this.buildSectionHeader("This Device","Your settings for this device, prioritized over all other settings.")}<material-you-config-card .hass="${this.hass}" .dataId="${window.browser_mod?.browserID}"></material-you-config-card>${this.buildSectionHeader("Other Devices","Other devices registered with Browser Mod.")} ${this.devices.map(e=>Z`<material-you-config-card .hass="${this.hass}" .dataId="${e}"></material-you-config-card>`)}`:r5("Device settings requires Browser Mod, which can be installed using HACS.","error")}`;break;case 1:e=Z`${this.buildSectionHeader("Everyone!","Default settings for all users and devices.")}<material-you-config-card .hass="${this.hass}"></material-you-config-card>${this.buildSectionHeader("Everyone Else","Other users on this Home Assistant instance.")} ${this.people.map(e=>Z`<material-you-config-card .hass="${this.hass}" .dataId="${this.hass.states[e].attributes.user_id}"></material-you-config-card>`)}`;break;default:e=Z`${this.buildSectionHeader("You!",`Your personal ${ty} settings.`)}<material-you-config-card .hass="${this.hass}" .dataId="${this.hass.user?.id}"></material-you-config-card>${window.browser_mod&&!this.hass.user?.is_admin?Z`${this.buildSectionHeader("This Device","Settings for this device.")}<material-you-config-card .hass="${this.hass}" .dataId="${window.browser_mod?.browserID}"></material-you-config-card>`:""}`}return Z`${this.buildHeader()}<div class="content">${this.hass.user?.is_admin?this.buildTabBar(this.tabBarIndex,this.handleTabBar,this.tabs):""} ${t}<div class="page-header"><div class="title">${ty} Utilities</div><div class="description">Design your own Material Design 3 dynamic color theme.</div></div>${e}</div>${this.buildThemeModeFAB()}`}firstUpdated(){this.darkModeIndex=this.darkModes.indexOf(this.hass.themes.darkMode?"dark":"light")}static get styles(){return l`:host{font-family:var(--font-family);color:var(--primary-text-color);background-color:var(
--lovelace-background,
var(--primary-background-color)
);--width:min(600px, calc(100% - 36px))}.header{display:flex;flex-direction:row;align-items:center;justify-content:space-between;padding:0 12px;height:64px;background-color:inherit}.versions{display:flex;flex-direction:column;align-items:flex-end;width:fit-content;min-width:0;color:var(--secondary-text-color);font-size:var(--md-sys-typescale-label-medium-size,12px);font-weight:var(--md-sys-typescale-label-medium-weight,500);line-height:var(
--md-sys-typescale-label-medium-line-height,
16px
);letter-spacing:var(
--md-sys-typescale-label-medium-tracking,
.5px
)}.version{width:100%;direction:rtl;overflow:hidden;text-overflow:clip;white-space:nowrap}.page-header{width:var(--width)}.page-header .title{font-size:var(--md-sys-typescale-display-small-size,36px);font-weight:var(--md-sys-typescale-display-small-weight,400);line-height:var(
--md-sys-typescale-display-small-line-height,
44px
);letter-spacing:var(
--md-sys-typescale-display-small-tracking,
0
)}.page-header .description{color:var(--secondary-text-color);font-size:var(--md-sys-typescale-title-medium-size,16px);font-weight:var(--md-sys-typescale-title-medium-weight,500);line-height:var(
--md-sys-typescale-title-medium-line-height,
24px
);letter-spacing:var(
--md-sys-typescale-title-medium-tracking,
.15px
)}.content{display:flex;flex-direction:column;align-items:center;gap:24px;padding-bottom:80px;background-color:inherit;min-height:calc(100% - 88px)}sl-tab-group{width:var(--width);text-transform:capitalize}sl-tab{flex:1}sl-tab::part(base){width:100%;justify-content:center}ha-card{width:var(--width)}.section-header{width:var(--width);padding:0 16px;margin-bottom:-12px;box-sizing:border-box}.section-header .title{line-height:var(
--md-sys-typescale-headline-large-line-height,
40px
);font-size:var(--md-sys-typescale-headline-large-size,32px);font-weight:var(--md-sys-typescale-headline-large-weight,400);letter-spacing:var(
--md-sys-typescale-headline-large-tracking,
0
)}.section-header .description{color:var(--secondary-text-color);line-height:var(
--md-sys-typescale-body-large-line-height,
24px
);font-size:var(--md-sys-typescale-body-large-size,16px);font-weight:var(--md-sys-typescale-body-large-weight,400);letter-spacing:var(
--md-sys-typescale-body-large-tracking,
.5px
)}.theme-mode-fab{position:fixed;inset-block-end:calc(env(safe-area-inset-bottom) + 16px);inset-inline-end:calc(env(safe-area-inset-right) + 16px);display:flex;justify-content:center;align-items:center;height:56px;width:56px;border-radius:var(--md-sys-shape-corner-large,16px);background:var(--md-sys-color-tertiary-container,#5b3d57);color:var(--md-sys-color-on-tertiary-container,#ffd7f6);box-shadow:var(
--md-sys-elevation-level3,
var(--mdc-fab-box-shadow)
);transition:box-shadow var(--md-sys-motion-expressive-effects-slow)}.theme-mode-fab::after{content:'';position:absolute;height:56px;width:56px;cursor:pointer;border-radius:var(--md-sys-shape-corner-large,16px);background:var(--md-sys-color-on-tertiary-container,#5b3d57);opacity:0;transition:opacity var(--md-sys-motion-expressive-effects-default)}@media (hover:hover){.theme-mode-fab:hover{box-shadow:var(
--md-sys-elevation-level4,
var(--mdc-fab-box-shadow)
)}.theme-mode-fab:hover::after{opacity:.08}}.theme-mode-fab:active::after,.theme-mode-fab:focus-visible::after{opacity:.18}`}}r9([eh()],r7.prototype,"hass",void 0),r9([eh()],r7.prototype,"narrow",void 0),r9([eh()],r7.prototype,"route",void 0),r9([eh()],r7.prototype,"panel",void 0),r9([ed()],r7.prototype,"tabBarIndex",void 0),r9([ed()],r7.prototype,"darkModeIndex",void 0),async function(){if(window.MaterialYouInit)return;window.MaterialYouInit=!0,rP(window),tT(document.querySelector("html"),`${ty} Utilities v${t.i8}`);let e=await tk();new MutationObserver(async t=>{for(let r of t)for(let t of r.addedNodes)if("IFRAME"==t.nodeName){let t=await tw(e.shadowRoot,"iframe"),r=await tx(t,"contentWindow");rP(r);let a=await tx(r,"document"),i={targets:[await tw(a,"body")]};for(let e of[rN,rZ,rW])await e(i)}}).observe(e.shadowRoot,{subtree:!0,childList:!0}),customElements.define(`${tv}-config-card`,r8),customElements.define(`${tv}-panel`,r7);let r=async(e=10)=>{if(e>2e4)return;let t=(await tk()).hass,a=t?.themes?.theme;if(!a)return void setTimeout(()=>r(2*e),e);if(a.includes(ty)){let e={targets:[await tw(document,"html")]};for(let t of[tM,rN,rZ,rW,rS])await t(e)}};r(),window.addEventListener("visibilitychange",async()=>{if(!document.hidden)for(let e of[rN,rZ,rW])await e({})}),r3({});let a=async(e=10)=>{if(e>2e4)return;let t=(await tk()).hass,r=t.user?.id;if(!t.connection.connected||!r)return void setTimeout(()=>a(2*e),e);t.connection.subscribeEvents(()=>rN({}),"themes_updated"),t.user?.is_admin&&t.connection.subscribeEvents(e=>{e?.data?.service=="set_theme"&&setTimeout(()=>rN({}),1e3)},"call_service")};a()}()})()})();