From daeba14294dbd4b6cbfaada2cace93955c5b5ca2 Mon Sep 17 00:00:00 2001 From: Jean-Marc Collin Date: Sat, 11 Nov 2023 13:07:08 +0100 Subject: [PATCH] Window state position overlap --- dist/versatile-thermostat-ui-card.js | 65 ++++++++++++------------- src/versatile-thermostat-ui.ts | 71 ++++++++++++++++------------ 2 files changed, 71 insertions(+), 65 deletions(-) diff --git a/dist/versatile-thermostat-ui-card.js b/dist/versatile-thermostat-ui-card.js index 4f2daf5..ba3fba2 100644 --- a/dist/versatile-thermostat-ui-card.js +++ b/dist/versatile-thermostat-ui-card.js @@ -57,7 +57,7 @@ const ct=t=>(e,i)=>{void 0!==i?i.addInitializer((()=>{customElements.define(t,e) * @license * Copyright 2018 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const gt=(t=>(...e)=>({_$litDirective$:t,values:e}))(class extends ft{constructor(t){if(super(t),t.type!==_t||"class"!==t.name||t.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((e=>t[e])).join(" ")+" "}update(t,[e]){if(void 0===this.it){this.it=new Set,void 0!==t.strings&&(this.st=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in e)e[t]&&!this.st?.has(t)&&this.it.add(t);return this.render(e)}const i=t.element.classList;for(const t of this.it)t in e||(i.remove(t),this.it.delete(t));for(const t in e){const n=!!e[t];n===this.it.has(t)||this.st?.has(t)||(n?(i.add(t),this.it.add(t)):(i.remove(t),this.it.delete(t)))}return Z}});var yt="M5,2V13H8V22L15,10H11L15,2M17,15H19V17H17V15M17,7H19V13H17V7Z",bt="M8.5 4.5L5.4 9.5L8.5 14.7L5.2 20.5L3.4 19.6L6.1 14.7L3 9.5L6.7 3.6L8.5 4.5M14.7 4.4L11.6 9.5L14.7 14.5L11.4 20.3L9.6 19.4L12.3 14.5L9.2 9.5L12.9 3.5L14.7 4.4M21 4.4L17.9 9.5L21 14.5L17.7 20.3L15.9 19.4L18.6 14.5L15.5 9.5L19.2 3.5L21 4.4",wt="M12,3L2,12H5V20H19V12H22L12,3M12,8.75A2.25,2.25 0 0,1 14.25,11A2.25,2.25 0 0,1 12,13.25A2.25,2.25 0 0,1 9.75,11A2.25,2.25 0 0,1 12,8.75M12,15C13.5,15 16.5,15.75 16.5,17.25V18H7.5V17.25C7.5,15.75 10.5,15 12,15Z",$t="M12 2C7.04 2 3 6.04 3 11C3 14.91 5.5 18.24 9 19.47V22H11V19.94C11.33 20 11.66 20 12 20S12.67 20 13 19.94V22H15V19.47C18.5 18.23 21 14.9 21 11C21 6.04 16.96 2 12 2M14.25 14L11.25 17L9.75 15.5L11 14.25L9.75 13L12.75 10L14.25 11.5L13 12.75L14.25 14M16 9H8V7H16V9Z",xt="M10,0.2C9,0.2 8.2,1 8.2,2C8.2,3 9,3.8 10,3.8C11,3.8 11.8,3 11.8,2C11.8,1 11,0.2 10,0.2M15.67,1A7.33,7.33 0 0,0 23,8.33V7A6,6 0 0,1 17,1H15.67M18.33,1C18.33,3.58 20.42,5.67 23,5.67V4.33C21.16,4.33 19.67,2.84 19.67,1H18.33M21,1A2,2 0 0,0 23,3V1H21M7.92,4.03C7.75,4.03 7.58,4.06 7.42,4.11L2,5.8V11H3.8V7.33L5.91,6.67L2,22H3.8L6.67,13.89L9,17V22H10.8V15.59L8.31,11.05L9.04,8.18L10.12,10H15V8.2H11.38L9.38,4.87C9.08,4.37 8.54,4.03 7.92,4.03Z",At="M17 13V7H19V13H17M17 17V15H19V17H17M13 13V5C13 3.3 11.7 2 10 2S7 3.3 7 5V13C4.8 14.7 4.3 17.8 6 20S10.8 22.7 13 21 15.7 16.2 14 14C13.7 13.6 13.4 13.3 13 13M10 4C10.6 4 11 4.4 11 5V8H9V5C9 4.4 9.4 4 10 4Z",Ct="M12,3.25C12,3.25 6,10 6,14C6,17.32 8.69,20 12,20A6,6 0 0,0 18,14C18,10 12,3.25 12,3.25M14.47,9.97L15.53,11.03L9.53,17.03L8.47,15.97M9.75,10A1.25,1.25 0 0,1 11,11.25A1.25,1.25 0 0,1 9.75,12.5A1.25,1.25 0 0,1 8.5,11.25A1.25,1.25 0 0,1 9.75,10M14.25,14.5A1.25,1.25 0 0,1 15.5,15.75A1.25,1.25 0 0,1 14.25,17A1.25,1.25 0 0,1 13,15.75A1.25,1.25 0 0,1 14.25,14.5Z",kt="M4,10A1,1 0 0,1 3,9A1,1 0 0,1 4,8H12A2,2 0 0,0 14,6A2,2 0 0,0 12,4C11.45,4 10.95,4.22 10.59,4.59C10.2,5 9.56,5 9.17,4.59C8.78,4.2 8.78,3.56 9.17,3.17C9.9,2.45 10.9,2 12,2A4,4 0 0,1 16,6A4,4 0 0,1 12,10H4M19,12A1,1 0 0,0 20,11A1,1 0 0,0 19,10C18.72,10 18.47,10.11 18.29,10.29C17.9,10.68 17.27,10.68 16.88,10.29C16.5,9.9 16.5,9.27 16.88,8.88C17.42,8.34 18.17,8 19,8A3,3 0 0,1 22,11A3,3 0 0,1 19,14H5A1,1 0 0,1 4,13A1,1 0 0,1 5,12H19M18,18H4A1,1 0 0,1 3,17A1,1 0 0,1 4,16H18A3,3 0 0,1 21,19A3,3 0 0,1 18,22C17.17,22 16.42,21.66 15.88,21.12C15.5,20.73 15.5,20.1 15.88,19.71C16.27,19.32 16.9,19.32 17.29,19.71C17.47,19.89 17.72,20 18,20A1,1 0 0,0 19,19A1,1 0 0,0 18,18Z",Lt="M21 20V2H3V20H1V23H23V20M19 4V11H17V4M5 4H7V11H5M5 20V13H7V20M9 20V4H15V20M17 20V13H19V20Z",Et="M20 14H18L14.8 23H16.7L17.4 21H20.6L21.3 23H23.2L20 14M17.8 19.7L19 16L20.2 19.7H17.8M7 9H15V11H7V9M7 12H15V14H7V12M7 15H15V16.5L14.8 17H7V15M13.7 20H7V18H14.5L13.7 20M16 8H6V20H4V8H2V4H20V8H18V12H16.6L16.1 13.3L16 13.7V8Z";var St={version:"version",current:"current"},Vt={card:{climate:{disable_window:"Disable window",disable_overpowering:"Disable overpowering",disable_eco:"Disable eco",disable_heat:"Disable heat",disable_off:"Disable off",disable_menu:"Disable menu",set_current_as_main:"Exchange target temperature and room temperature",disable_security_warning:"Disable battery warning",disable_buttons:"Disable plus/minus buttons",disable_power_infos:"Disable power infos",disable_name:"Disable name"}}},Tt={window_open:"Window open",night_mode:"Night mode",eco:"Eco",overpowering:"Overpowering",none:"Manual",comfort:"Comfort",boost:"Boost",power:"Overpowering",activity:"Activity",auto_regulation_light:"Light",auto_regulation_medium:"Medium",auto_regulation_strong:"Strong",auto_regulation_slow:"Slow"},Mt={common:St,editor:Vt,extra_states:Tt},Ht=Object.freeze({__proto__:null,common:St,default:Mt,editor:Vt,extra_states:Tt}),Pt={version:"Version",current:"Aktuell"},Ot={card:{climate:{disable_window:"Fenster-offen-Anzeige deaktivieren",disable_overpowering:"Sommer-Anzeige deaktivieren",disable_eco:"Eco-Anzeige deaktivieren",disable_heat:"Heiz-Anzeige deaktivieren",disable_off:"Aus-Anzeige deaktivieren",disable_menu:"Menü deaktivieren",disable_security_warning:"Batterie-Warnung deaktivieren",disable_buttons:"Plus/Minus Buttons deaktivieren",eco_temperature:"Eco Temperatur",set_current_as_main:"Zieltemperatur mit aktueller Temperatur tauschen"}}},Dt={window_open:"Fenster offen",night_mode:"Nachtmodus",eco:"Eco",overpowering:"Sommer"},zt={common:Pt,editor:Ot,extra_states:Dt},Nt=Object.freeze({__proto__:null,common:Pt,default:zt,editor:Ot,extra_states:Dt}),jt={version:"version",current:"Actuelle"},It={card:{climate:{disable_window:"Désactiver fenêtre status",disable_overpowering:"Désactiver sur-puissance status",disable_cool:"Désactiver mode clim",disable_heat:"Désactiver mode chauffe",disable_off:"Désactiver arret",set_current_as_main:"Echanger temperature cible avec temperature locale",disable_security_warning:"Désactiver sécurité messages",disable_buttons:"Désactiver les boutons +/-",disable_power_infos:"Désactiver les infos de puissance",disable_name:"Désactiver le nom"}}},Rt={window_open:"Fenêtre ouverte",eco:"Eco",overpowering:"Sur-puissance",none:"Manuel",comfort:"Confort",boost:"Boost",power:"Délestage",activity:"Activité",auto_regulation_light:"Légère",auto_regulation_medium:"Moyenne",auto_regulation_strong:"Forte",auto_regulation_slow:"Lente"},Ft={common:jt,editor:It,extra_states:Rt},Ut=Object.freeze({__proto__:null,common:jt,default:Ft,editor:It,extra_states:Rt}),Bt={version:"версия",current:"текущий"},Zt={window_open:"Окно открыто",night_mode:"Ночной режим",eco:"Эко",overpowering:"Лето"},Wt={common:Bt,extra_states:Zt},qt=Object.freeze({__proto__:null,common:Bt,default:Wt,extra_states:Zt}),Yt={version:"wersja",current:"aktualna"},Xt={window_open:"otwarte okno",night_mode:"tryb nocny",eco:"tryb ekonomiczny",overpowering:"lato"},Kt={common:Yt,extra_states:Xt},Jt=Object.freeze({__proto__:null,common:Yt,default:Kt,extra_states:Xt}),Gt={version:"verzia",current:"aktuálny"},Qt={card:{climate:{disable_window:"Zakázať okno",disable_overpowering:"Zakázať leto",disable_eco:"Zakázať eco",disable_heat:"Zakázať kúrenie",disable_off:"Vypnúť",disable_menu:"Zakázať menu",disable_security_warning:"Zakázať upozornenie na batériu",disable_buttons:"Zakázať plus/mínus tlačidlá",eco_temperature:"Eco teplota",set_current_as_main:"Vymeňte cieľ za miesta s aktuálnou teplotou"}}},te={window_open:"Okno otvorené",night_mode:"Nočný mód",eco:"Eco",overpowering:"Leto"},ee={common:Gt,editor:Qt,extra_states:te},ie={version:"Verzió",current:"Aktuális"},ne={card:{climate:{disable_window:"Ablak kikapcsolás",disable_overpowering:"Nyár kikapcsolás",disable_eco:"Eco kikapcsolás",disable_heat:"Fűtés kikacsolás",disable_off:"Kikapcsolás inaktiválás",eco_temperature:"Eco hőmérséklet",set_current_as_main:"Aktuális hőmérséklet használata"}}},oe={window_open:"Ablak nyitva",night_mode:"Éjszakai mód",eco:"Eco",overpowering:"Nyár"},se={common:ie,editor:ne,extra_states:oe},re={version:"version",current:"nuværende"},ae={window_open:"Vindue åben",night_mode:"Nattilstand",eco:"Eco",overpowering:"Overpowering"},le={common:re,extra_states:ae},ce={version:"version",current:"Actual"},he={window_open:"Ventana abierta",night_mode:"Modo noche",eco:"Eco",overpowering:"Verano"},ue={common:ce,extra_states:he},de={version:"versiyon",current:"şimdiki"},pe={window_open:"Pencere açık",night_mode:"Gece modu",eco:"Eco",overpowering:"Yaz"},me={common:de,extra_states:pe},ve={version:"versione",current:"Corrente"},_e={card:{climate:{disable_window:"Disabilita indicatore Finestra",disable_overpowering:"Disabilita indicatore Estate",disable_eco:"Disabilita tasto eco",disable_heat:"Disabilita tasto heat",disable_off:"Disabililita tasto off",eco_temperature:"Temperatura target",set_current_as_main:"Imposta la temperatura attuale come target"}}},fe={window_open:"Finestra aperta",night_mode:"Modalità notturna",eco:"Eco",overpowering:"Estate"},ge={common:ve,editor:_e,extra_states:fe},ye={version:"versão",current:"actual"},be={card:{climate:{disable_window:"Desactivar Janela",disable_overpowering:"Desactivar Verão",disable_eco:"Desactivar Eco",disable_heat:"Desactivar Aquecimento",disable_off:"Desactivar Off",eco_temperature:"Modo Eco",set_current_as_main:"Mudar para a temperatura local actual"}}},we={window_open:"Janela Aberta",night_mode:"Modo Noturno",eco:"Eco",overpowering:"Verão"},$e={common:ye,editor:be,extra_states:we},xe={version:"版本",current:"当前"},Ae={window_open:"窗户打开",night_mode:"夜间模式",eco:"节能",overpowering:"夏季"},Ce={common:xe,extra_states:Ae},ke={version:"версія",current:"поточний"},Le={window_open:"Вікно відчинено",night_mode:"Нічний режим",eco:"Економія",overpowering:"Літо"},Ee={common:ke,extra_states:Le},Se={version:"έκδοση",current:"τρέχουσα"},Ve={window_open:"Παράθυρο ανοικτό",night_mode:"Λειτουργία νυκτός",eco:"Εξοικονόμηση",overpowering:"Καλοκαίρι"},Te={common:Se,extra_states:Ve},Me={version:"versie",current:"huidig"},He={window_open:"Raam open",night_mode:"Nacht modus",eco:"Eco",overpowering:"Zomer"},Pe={common:Me,extra_states:He},Oe={version:"versjon",current:"nåværende"},De={window_open:"Vindu åpent",night_mode:"Nattmodus",eco:"Eco",overpowering:"Sommer"},ze={common:Oe,extra_states:De},Ne={version:"verze",current:"aktuální"},je={card:{climate:{disable_window:"Zakázat okno",disable_overpowering:"Zakázat léto",disable_eco:"Zakázat eco",disable_heat:"Zakázat topení",disable_off:"Zakázat vypnuto",disable_menu:"Zakázat menu",disable_security_warning:"Zakázat upozornění baterie",disable_buttons:"Zakázat tlačítka plus/minus",eco_temperature:"Eco teplota",set_current_as_main:"Prohodit místa cílovoé a aktáalní teploty"}}},Ie={window_open:"okno otevřeno",night_mode:"Noční režim",eco:"Eco",overpowering:"Léto"},Re={common:Ne,editor:je,extra_states:Ie},Fe={version:"različica",current:"trenutno"},Ue={window_open:"Okno odprto",night_mode:"Nočni način",eco:"Eko",overpowering:"Poletje"},Be={common:Fe,extra_states:Ue},Ze={version:"version",current:"Nuvarande"},We={window_open:"Fönster öppet",night_mode:"Nattläge",eco:"Eco",overpowering:"Sommar"},qe={common:Ze,extra_states:We},Ye={version:"версия",currrent:"текущий"},Xe={window_open:"Отворен прозорец",night_mode:"Нощен режим",eco:"Екологичен режим",overpowering:"Лято"},Ke={common:Ye,extra_states:Xe},Je={version:"version",current:"Nykyinen"},Ge={window_open:"Ikkuna auki",night_mode:"Yötila",eco:"Eco",overpowering:"Kesä"},Qe={common:Je,extra_states:Ge},ti={version:"versiune",current:"curent"},ei={window_open:"Fereastră deschisă",night_mode:"Mod noapte",eco:"Eco",overpowering:"Vară"},ii={common:ti,extra_states:ei},ni={version:"versió",current:"Actual"},oi={window_open:"Finestra oberta",night_mode:"Mode nocturn",eco:"Eco",overpowering:"Estiu"},si={common:ni,extra_states:oi};const ri={en:Ht,de:Nt,fr:Ut,ru:qt,sk:Object.freeze({__proto__:null,common:Gt,default:ee,editor:Qt,extra_states:te}),hu:Object.freeze({__proto__:null,common:ie,default:se,editor:ne,extra_states:oe}),pl:Jt,da:Object.freeze({__proto__:null,common:re,default:le,extra_states:ae}),es:Object.freeze({__proto__:null,common:ce,default:ue,extra_states:he}),tr:Object.freeze({__proto__:null,common:de,default:me,extra_states:pe}),it:Object.freeze({__proto__:null,common:ve,default:ge,editor:_e,extra_states:fe}),pt:Object.freeze({__proto__:null,common:ye,default:$e,editor:be,extra_states:we}),cn:Object.freeze({__proto__:null,common:xe,default:Ce,extra_states:Ae}),uk:Object.freeze({__proto__:null,common:ke,default:Ee,extra_states:Le}),el:Object.freeze({__proto__:null,common:Se,default:Te,extra_states:Ve}),nl:Object.freeze({__proto__:null,common:Me,default:Pe,extra_states:He}),no:Object.freeze({__proto__:null,common:Oe,default:ze,extra_states:De}),cs:Object.freeze({__proto__:null,common:Ne,default:Re,editor:je,extra_states:Ie}),sl:Object.freeze({__proto__:null,common:Fe,default:Be,extra_states:Ue}),sv:Object.freeze({__proto__:null,common:Ze,default:qe,extra_states:We}),bg:Object.freeze({__proto__:null,common:Ye,default:Ke,extra_states:Xe}),fi:Object.freeze({__proto__:null,common:Je,default:Qe,extra_states:Ge}),ro:Object.freeze({__proto__:null,common:ti,default:ii,extra_states:ei}),ca:Object.freeze({__proto__:null,common:ni,default:si,extra_states:oi})},ai="en";function li({hass:t,string:e,search:i="",replace:n=""}){var o;const s=null!==(o=null==t?void 0:t.locale.language)&&void 0!==o?o:ai;let r;try{r=e.split(".").reduce(((t,e)=>t[e]),ri[s])}catch(t){r=e.split(".").reduce(((t,e)=>t[e]),ri.en)}return void 0===r&&(r=e.split(".").reduce(((t,e)=>t[e]),ri.en)),""!==i&&""!==n&&(r=r.replace(i,n)),r}function ci(t,e){try{return t.split(".").reduce(((t,e)=>t[e]),ri[e])}catch(t){return}}var hi,ui,di=Number.isNaN||function(t){return"number"==typeof t&&t!=t};function pi(t,e){if(t.length!==e.length)return!1;for(var i=0;inew Intl.DateTimeFormat(t.language,{weekday:"long",month:"long",day:"numeric"}))),mi((t=>new Intl.DateTimeFormat(t.language,{year:"numeric",month:"long",day:"numeric"}))),mi((t=>new Intl.DateTimeFormat(t.language,{year:"numeric",month:"numeric",day:"numeric"}))),mi((t=>new Intl.DateTimeFormat(t.language,{day:"numeric",month:"short"}))),mi((t=>new Intl.DateTimeFormat(t.language,{month:"long",year:"numeric"}))),mi((t=>new Intl.DateTimeFormat(t.language,{month:"long"}))),mi((t=>new Intl.DateTimeFormat(t.language,{year:"numeric"}))),function(t){t.language="language",t.system="system",t.comma_decimal="comma_decimal",t.decimal_comma="decimal_comma",t.space_comma="space_comma",t.none="none"}(hi||(hi={})),function(t){t.language="language",t.system="system",t.am_pm="12",t.twenty_four="24"}(ui||(ui={}));const vi=mi((t=>{if(t.time_format===ui.language||t.time_format===ui.system){const e=t.time_format===ui.language?t.language:void 0,i=(new Date).toLocaleString(e);return i.includes("AM")||i.includes("PM")}return t.time_format===ui.am_pm}));mi((t=>new Intl.DateTimeFormat("en"!==t.language||vi(t)?t.language:"en-u-hc-h23",{year:"numeric",month:"long",day:"numeric",hour:vi(t)?"numeric":"2-digit",minute:"2-digit",hour12:vi(t)}))),mi((t=>new Intl.DateTimeFormat("en"!==t.language||vi(t)?t.language:"en-u-hc-h23",{year:"numeric",month:"long",day:"numeric",hour:vi(t)?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hour12:vi(t)}))),mi((t=>new Intl.DateTimeFormat("en"!==t.language||vi(t)?t.language:"en-u-hc-h23",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"2-digit",hour12:vi(t)}))),mi((t=>new Intl.DateTimeFormat("en"!==t.language||vi(t)?t.language:"en-u-hc-h23",{hour:"numeric",minute:"2-digit",hour12:vi(t)}))),mi((t=>new Intl.DateTimeFormat("en"!==t.language||vi(t)?t.language:"en-u-hc-h23",{hour:vi(t)?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hour12:vi(t)}))),mi((t=>new Intl.DateTimeFormat("en"!==t.language||vi(t)?t.language:"en-u-hc-h23",{weekday:"long",hour:vi(t)?"numeric":"2-digit",minute:"2-digit",hour12:vi(t)})));const _i=(t,e,i,n)=>{n=n||{},i=null==i?{}:i;const o=new Event(e,{bubbles:void 0===n.bubbles||n.bubbles,cancelable:Boolean(n.cancelable),composed:void 0===n.composed||n.composed});return o.detail=i,t.dispatchEvent(o),o},fi=(t,e,i)=>Math.min(Math.max(t,e),i),gi=(t,e,i)=>{const n=e?(t=>{switch(t.number_format){case hi.comma_decimal:return["en-US","en"];case hi.decimal_comma:return["de","es","it"];case hi.space_comma:return["fr","sv","cs"];case hi.system:return;default:return t.language}})(e):void 0;if(Number.isNaN=Number.isNaN||function t(e){return"number"==typeof e&&t(e)},(null==e?void 0:e.number_format)!==hi.none&&!Number.isNaN(Number(t))&&Intl)try{return new Intl.NumberFormat(n,yi(t,i)).format(Number(t))}catch(e){return console.error(e),new Intl.NumberFormat(void 0,yi(t,i)).format(Number(t))}return"string"==typeof t?t:`${((t,e=2)=>Math.round(t*10**e)/10**e)(t,null==i?void 0:i.maximumFractionDigits).toString()}${"currency"===(null==i?void 0:i.style)?` ${i.currency}`:""}`},yi=(t,e)=>{const i=Object.assign({maximumFractionDigits:2},e);if("string"!=typeof t)return i;if(!e||!e.minimumFractionDigits&&!e.maximumFractionDigits){const e=t.indexOf(".")>-1?t.split(".")[1].length:0;i.minimumFractionDigits=e,i.maximumFractionDigits=e}return i};class bi extends TypeError{constructor(t,e){let i;const{message:n,explanation:o,...s}=t,{path:r}=t,a=0===r.length?n:`At path: ${r.join(".")} -- ${n}`;super(o??a),null!=o&&(this.cause=a),Object.assign(this,s),this.name=this.constructor.name,this.failures=()=>i??(i=[t,...e()])}}function wi(t){return"object"==typeof t&&null!=t}function $i(t){return"symbol"==typeof t?t.toString():"string"==typeof t?JSON.stringify(t):`${t}`}function xi(t,e,i,n){if(!0===t)return;!1===t?t={}:"string"==typeof t&&(t={message:t});const{path:o,branch:s}=e,{type:r}=i,{refinement:a,message:l=`Expected a value of type \`${r}\`${a?` with refinement \`${a}\``:""}, but received: \`${$i(n)}\``}=t;return{value:n,type:r,refinement:a,key:o[o.length-1],path:o,branch:s,...t,message:l}}function*Ai(t,e,i,n){(function(t){return wi(t)&&"function"==typeof t[Symbol.iterator]})(t)||(t=[t]);for(const o of t){const t=xi(o,e,i,n);t&&(yield t)}}function*Ci(t,e,i={}){const{path:n=[],branch:o=[t],coerce:s=!1,mask:r=!1}=i,a={path:n,branch:o};if(s&&(t=e.coercer(t,a),r&&"type"!==e.type&&wi(e.schema)&&wi(t)&&!Array.isArray(t)))for(const i in t)void 0===e.schema[i]&&delete t[i];let l="valid";for(const n of e.validator(t,a))n.explanation=i.message,l="not_valid",yield[n,void 0];for(let[c,h,u]of e.entries(t,a)){const e=Ci(h,u,{path:void 0===c?n:[...n,c],branch:void 0===c?o:[...o,h],coerce:s,mask:r,message:i.message});for(const i of e)i[0]?(l=null!=i[0].refinement?"not_refined":"not_valid",yield[i[0],void 0]):s&&(h=i[1],void 0===c?t=h:t instanceof Map?t.set(c,h):t instanceof Set?t.add(h):wi(t)&&(void 0!==h||c in t)&&(t[c]=h))}if("not_valid"!==l)for(const n of e.refiner(t,a))n.explanation=i.message,l="not_refined",yield[n,void 0];"valid"===l&&(yield[void 0,t])}class ki{constructor(t){const{type:e,schema:i,validator:n,refiner:o,coercer:s=(t=>t),entries:r=function*(){}}=t;this.type=e,this.schema=i,this.entries=r,this.coercer=s,this.validator=n?(t,e)=>Ai(n(t,e),e,this,t):()=>[],this.refiner=o?(t,e)=>Ai(o(t,e),e,this,t):()=>[]}assert(t,e){return Li(t,this,e)}create(t,e){return function(t,e,i){const n=Ei(t,e,{coerce:!0,message:i});if(n[0])throw n[0];return n[1]}(t,this,e)}is(t){return function(t,e){const i=Ei(t,e);return!i[0]}(t,this)}mask(t,e){return function(t,e,i){const n=Ei(t,e,{coerce:!0,mask:!0,message:i});if(n[0])throw n[0];return n[1]}(t,this,e)}validate(t,e={}){return Ei(t,this,e)}}function Li(t,e,i){const n=Ei(t,e,{message:i});if(n[0])throw n[0]}function Ei(t,e,i={}){const n=Ci(t,e,i),o=function(t){const{done:e,value:i}=t.next();return e?void 0:i}(n);if(o[0]){const t=new bi(o[0],(function*(){for(const t of n)t[0]&&(yield t[0])}));return[t,void 0]}return[void 0,o[1]]}function Si(t,e){return new ki({type:t,schema:null,validator:e})}function Vi(t){return new ki({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(const[i,n]of e.entries())yield[i,n,t]},coercer:t=>Array.isArray(t)?t.slice():t,validator:t=>Array.isArray(t)||`Expected an array value, but received: ${$i(t)}`})}function Ti(){return Si("boolean",(t=>"boolean"==typeof t))}function Mi(t){const e=$i(t),i=typeof t;return new ki({type:"literal",schema:"string"===i||"number"===i||"boolean"===i?t:null,validator:i=>i===t||`Expected the literal \`${e}\`, but received: ${$i(i)}`})}function Hi(){return Si("number",(t=>"number"==typeof t&&!isNaN(t)||`Expected a number, but received: ${$i(t)}`))}function Pi(t){const e=t?Object.keys(t):[],i=Si("never",(()=>!1));return new ki({type:"object",schema:t||null,*entries(n){if(t&&wi(n)){const o=new Set(Object.keys(n));for(const i of e)o.delete(i),yield[i,n[i],t[i]];for(const t of o)yield[t,n[t],i]}},validator:t=>wi(t)||`Expected an object, but received: ${$i(t)}`,coercer:t=>wi(t)?{...t}:t})}function Oi(t){return new ki({...t,validator:(e,i)=>void 0===e||t.validator(e,i),refiner:(e,i)=>void 0===e||t.refiner(e,i)})}function Di(){return Si("string",(t=>"string"==typeof t||`Expected a string, but received: ${$i(t)}`))}function zi(t){const e=Object.keys(t);return new ki({type:"type",schema:t,*entries(i){if(wi(i))for(const n of e)yield[n,i[n],t[n]]},validator:t=>wi(t)||`Expected an object, but received: ${$i(t)}`,coercer:t=>wi(t)?{...t}:t})}function Ni(t){const e=t.map((t=>t.type)).join(" | ");return new ki({type:"union",schema:null,coercer(e){for(const i of t){const[t,n]=i.validate(e,{coerce:!0});if(!t)return n}return e},validator(i,n){const o=[];for(const e of t){const[...t]=Ci(i,e,n),[s]=t;if(!s[0])return[];for(const[e]of t)e&&o.push(e)}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${$i(i)}`,...o]}})}const ji=Pi({user:Di()}),Ii=Ni([Ti(),Pi({text:Oi(Di()),excemptions:Oi(Vi(ji))})]),Ri=Pi({action:Mi("url"),url_path:Di(),confirmation:Oi(Ii)}),Fi=Pi({action:Mi("call-service"),service:Di(),service_data:Oi(Pi()),data:Oi(Pi()),target:Oi(Pi({entity_id:Oi(Ni([Di(),Vi(Di())])),device_id:Oi(Ni([Di(),Vi(Di())])),area_id:Oi(Ni([Di(),Vi(Di())]))})),confirmation:Oi(Ii)}),Ui=Pi({action:Mi("navigate"),navigation_path:Di(),confirmation:Oi(Ii)}),Bi=zi({action:Mi("fire-dom-event")}),Zi=Pi({action:function(t){const e={},i=t.map((t=>$i(t))).join();for(const i of t)e[i]=i;return new ki({type:"enums",schema:e,validator:e=>t.includes(e)||`Expected one of \`${i}\`, but received: ${$i(e)}`})}(["none","toggle","more-info","call-service","url","navigate"]),confirmation:Oi(Ii)});var Wi;Wi=t=>{if(t&&"object"==typeof t&&"action"in t)switch(t.action){case"call-service":return Fi;case"fire-dom-event":return Bi;case"navigate":return Ui;case"url":return Ri}return Zi},new ki({type:"dynamic",schema:null,*entries(t,e){const i=Wi(t,e);yield*i.entries(t,e)},validator:(t,e)=>Wi(t,e).validator(t,e),coercer:(t,e)=>Wi(t,e).coercer(t,e),refiner:(t,e)=>Wi(t,e).refiner(t,e)}),r` + */const gt=(t=>(...e)=>({_$litDirective$:t,values:e}))(class extends ft{constructor(t){if(super(t),t.type!==_t||"class"!==t.name||t.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return" "+Object.keys(t).filter((e=>t[e])).join(" ")+" "}update(t,[e]){if(void 0===this.it){this.it=new Set,void 0!==t.strings&&(this.st=new Set(t.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in e)e[t]&&!this.st?.has(t)&&this.it.add(t);return this.render(e)}const i=t.element.classList;for(const t of this.it)t in e||(i.remove(t),this.it.delete(t));for(const t in e){const n=!!e[t];n===this.it.has(t)||this.st?.has(t)||(n?(i.add(t),this.it.add(t)):(i.remove(t),this.it.delete(t)))}return Z}});var yt="M6.59,0.66C8.93,-1.15 11.47,1.06 12.04,4.5C12.47,4.5 12.89,4.62 13.27,4.84C13.79,4.24 14.25,3.42 14.07,2.5C13.65,0.35 16.06,-1.39 18.35,1.58C20.16,3.92 17.95,6.46 14.5,7.03C14.5,7.46 14.39,7.89 14.16,8.27C14.76,8.78 15.58,9.24 16.5,9.06C18.63,8.64 20.38,11.04 17.41,13.34C15.07,15.15 12.53,12.94 11.96,9.5C11.53,9.5 11.11,9.37 10.74,9.15C10.22,9.75 9.75,10.58 9.93,11.5C10.35,13.64 7.94,15.39 5.65,12.42C3.83,10.07 6.05,7.53 9.5,6.97C9.5,6.54 9.63,6.12 9.85,5.74C9.25,5.23 8.43,4.76 7.5,4.94C5.37,5.36 3.62,2.96 6.59,0.66M5,16H7A2,2 0 0,1 9,18V24H7V22H5V24H3V18A2,2 0 0,1 5,16M5,18V20H7V18H5M12.93,16H15L12.07,24H10L12.93,16M18,16H21V18H18V22H21V24H18A2,2 0 0,1 16,22V18A2,2 0 0,1 18,16Z",bt="M5,2V13H8V22L15,10H11L15,2M17,15H19V17H17V15M17,7H19V13H17V7Z",wt="M12,3L2,12H5V20H19V12H22L12,3M12,8.75A2.25,2.25 0 0,1 14.25,11A2.25,2.25 0 0,1 12,13.25A2.25,2.25 0 0,1 9.75,11A2.25,2.25 0 0,1 12,8.75M12,15C13.5,15 16.5,15.75 16.5,17.25V18H7.5V17.25C7.5,15.75 10.5,15 12,15Z",$t="M12 2C7.04 2 3 6.04 3 11C3 14.91 5.5 18.24 9 19.47V22H11V19.94C11.33 20 11.66 20 12 20S12.67 20 13 19.94V22H15V19.47C18.5 18.23 21 14.9 21 11C21 6.04 16.96 2 12 2M14.25 14L11.25 17L9.75 15.5L11 14.25L9.75 13L12.75 10L14.25 11.5L13 12.75L14.25 14M16 9H8V7H16V9Z",xt="M10,0.2C9,0.2 8.2,1 8.2,2C8.2,3 9,3.8 10,3.8C11,3.8 11.8,3 11.8,2C11.8,1 11,0.2 10,0.2M15.67,1A7.33,7.33 0 0,0 23,8.33V7A6,6 0 0,1 17,1H15.67M18.33,1C18.33,3.58 20.42,5.67 23,5.67V4.33C21.16,4.33 19.67,2.84 19.67,1H18.33M21,1A2,2 0 0,0 23,3V1H21M7.92,4.03C7.75,4.03 7.58,4.06 7.42,4.11L2,5.8V11H3.8V7.33L5.91,6.67L2,22H3.8L6.67,13.89L9,17V22H10.8V15.59L8.31,11.05L9.04,8.18L10.12,10H15V8.2H11.38L9.38,4.87C9.08,4.37 8.54,4.03 7.92,4.03Z",At="M17 13V7H19V13H17M17 17V15H19V17H17M13 13V5C13 3.3 11.7 2 10 2S7 3.3 7 5V13C4.8 14.7 4.3 17.8 6 20S10.8 22.7 13 21 15.7 16.2 14 14C13.7 13.6 13.4 13.3 13 13M10 4C10.6 4 11 4.4 11 5V8H9V5C9 4.4 9.4 4 10 4Z",Ct="M12,3.25C12,3.25 6,10 6,14C6,17.32 8.69,20 12,20A6,6 0 0,0 18,14C18,10 12,3.25 12,3.25M14.47,9.97L15.53,11.03L9.53,17.03L8.47,15.97M9.75,10A1.25,1.25 0 0,1 11,11.25A1.25,1.25 0 0,1 9.75,12.5A1.25,1.25 0 0,1 8.5,11.25A1.25,1.25 0 0,1 9.75,10M14.25,14.5A1.25,1.25 0 0,1 15.5,15.75A1.25,1.25 0 0,1 14.25,17A1.25,1.25 0 0,1 13,15.75A1.25,1.25 0 0,1 14.25,14.5Z",kt="M21 20V2H3V20H1V23H23V20M19 4V11H17V4M5 4H7V11H5M5 20V13H7V20M9 20V4H15V20M17 20V13H19V20Z",Lt="M20 14H18L14.8 23H16.7L17.4 21H20.6L21.3 23H23.2L20 14M17.8 19.7L19 16L20.2 19.7H17.8M7 9H15V11H7V9M7 12H15V14H7V12M7 15H15V16.5L14.8 17H7V15M13.7 20H7V18H14.5L13.7 20M16 8H6V20H4V8H2V4H20V8H18V12H16.6L16.1 13.3L16 13.7V8Z";var Et={version:"version",current:"current"},St={card:{climate:{disable_window:"Disable window",disable_overpowering:"Disable overpowering",disable_eco:"Disable eco",disable_heat:"Disable heat",disable_off:"Disable off",disable_menu:"Disable menu",set_current_as_main:"Exchange target temperature and room temperature",disable_security_warning:"Disable battery warning",disable_buttons:"Disable plus/minus buttons",disable_power_infos:"Disable power infos",disable_name:"Disable name"}}},Vt={window_open:"Window open",night_mode:"Night mode",eco:"Eco",overpowering:"Overpowering",none:"Manual",comfort:"Comfort",boost:"Boost",power:"Overpowering",activity:"Activity",auto_regulation_light:"Light",auto_regulation_medium:"Medium",auto_regulation_strong:"Strong",auto_regulation_slow:"Slow"},Tt={common:Et,editor:St,extra_states:Vt},Mt=Object.freeze({__proto__:null,common:Et,default:Tt,editor:St,extra_states:Vt}),Ht={version:"Version",current:"Aktuell"},Pt={card:{climate:{disable_window:"Fenster-offen-Anzeige deaktivieren",disable_overpowering:"Sommer-Anzeige deaktivieren",disable_eco:"Eco-Anzeige deaktivieren",disable_heat:"Heiz-Anzeige deaktivieren",disable_off:"Aus-Anzeige deaktivieren",disable_menu:"Menü deaktivieren",disable_security_warning:"Batterie-Warnung deaktivieren",disable_buttons:"Plus/Minus Buttons deaktivieren",eco_temperature:"Eco Temperatur",set_current_as_main:"Zieltemperatur mit aktueller Temperatur tauschen"}}},Ot={window_open:"Fenster offen",night_mode:"Nachtmodus",eco:"Eco",overpowering:"Sommer"},Dt={common:Ht,editor:Pt,extra_states:Ot},zt=Object.freeze({__proto__:null,common:Ht,default:Dt,editor:Pt,extra_states:Ot}),Nt={version:"version",current:"Actuelle"},jt={card:{climate:{disable_window:"Désactiver fenêtre status",disable_overpowering:"Désactiver sur-puissance status",disable_cool:"Désactiver mode clim",disable_heat:"Désactiver mode chauffe",disable_off:"Désactiver arret",set_current_as_main:"Echanger temperature cible avec temperature locale",disable_security_warning:"Désactiver sécurité messages",disable_buttons:"Désactiver les boutons +/-",disable_power_infos:"Désactiver les infos de puissance",disable_name:"Désactiver le nom"}}},It={window_open:"Fenêtre ouverte",eco:"Eco",overpowering:"Sur-puissance",none:"Manuel",comfort:"Confort",boost:"Boost",power:"Délestage",activity:"Activité",auto_regulation_light:"Légère",auto_regulation_medium:"Moyenne",auto_regulation_strong:"Forte",auto_regulation_slow:"Lente"},Rt={common:Nt,editor:jt,extra_states:It},Ft=Object.freeze({__proto__:null,common:Nt,default:Rt,editor:jt,extra_states:It}),Ut={version:"версия",current:"текущий"},Bt={window_open:"Окно открыто",night_mode:"Ночной режим",eco:"Эко",overpowering:"Лето"},Zt={common:Ut,extra_states:Bt},Wt=Object.freeze({__proto__:null,common:Ut,default:Zt,extra_states:Bt}),qt={version:"wersja",current:"aktualna"},Yt={window_open:"otwarte okno",night_mode:"tryb nocny",eco:"tryb ekonomiczny",overpowering:"lato"},Xt={common:qt,extra_states:Yt},Kt=Object.freeze({__proto__:null,common:qt,default:Xt,extra_states:Yt}),Jt={version:"verzia",current:"aktuálny"},Gt={card:{climate:{disable_window:"Zakázať okno",disable_overpowering:"Zakázať leto",disable_eco:"Zakázať eco",disable_heat:"Zakázať kúrenie",disable_off:"Vypnúť",disable_menu:"Zakázať menu",disable_security_warning:"Zakázať upozornenie na batériu",disable_buttons:"Zakázať plus/mínus tlačidlá",eco_temperature:"Eco teplota",set_current_as_main:"Vymeňte cieľ za miesta s aktuálnou teplotou"}}},Qt={window_open:"Okno otvorené",night_mode:"Nočný mód",eco:"Eco",overpowering:"Leto"},te={common:Jt,editor:Gt,extra_states:Qt},ee={version:"Verzió",current:"Aktuális"},ie={card:{climate:{disable_window:"Ablak kikapcsolás",disable_overpowering:"Nyár kikapcsolás",disable_eco:"Eco kikapcsolás",disable_heat:"Fűtés kikacsolás",disable_off:"Kikapcsolás inaktiválás",eco_temperature:"Eco hőmérséklet",set_current_as_main:"Aktuális hőmérséklet használata"}}},ne={window_open:"Ablak nyitva",night_mode:"Éjszakai mód",eco:"Eco",overpowering:"Nyár"},oe={common:ee,editor:ie,extra_states:ne},se={version:"version",current:"nuværende"},re={window_open:"Vindue åben",night_mode:"Nattilstand",eco:"Eco",overpowering:"Overpowering"},ae={common:se,extra_states:re},le={version:"version",current:"Actual"},ce={window_open:"Ventana abierta",night_mode:"Modo noche",eco:"Eco",overpowering:"Verano"},he={common:le,extra_states:ce},ue={version:"versiyon",current:"şimdiki"},de={window_open:"Pencere açık",night_mode:"Gece modu",eco:"Eco",overpowering:"Yaz"},pe={common:ue,extra_states:de},me={version:"versione",current:"Corrente"},ve={card:{climate:{disable_window:"Disabilita indicatore Finestra",disable_overpowering:"Disabilita indicatore Estate",disable_eco:"Disabilita tasto eco",disable_heat:"Disabilita tasto heat",disable_off:"Disabililita tasto off",eco_temperature:"Temperatura target",set_current_as_main:"Imposta la temperatura attuale come target"}}},_e={window_open:"Finestra aperta",night_mode:"Modalità notturna",eco:"Eco",overpowering:"Estate"},fe={common:me,editor:ve,extra_states:_e},ge={version:"versão",current:"actual"},ye={card:{climate:{disable_window:"Desactivar Janela",disable_overpowering:"Desactivar Verão",disable_eco:"Desactivar Eco",disable_heat:"Desactivar Aquecimento",disable_off:"Desactivar Off",eco_temperature:"Modo Eco",set_current_as_main:"Mudar para a temperatura local actual"}}},be={window_open:"Janela Aberta",night_mode:"Modo Noturno",eco:"Eco",overpowering:"Verão"},we={common:ge,editor:ye,extra_states:be},$e={version:"版本",current:"当前"},xe={window_open:"窗户打开",night_mode:"夜间模式",eco:"节能",overpowering:"夏季"},Ae={common:$e,extra_states:xe},Ce={version:"версія",current:"поточний"},ke={window_open:"Вікно відчинено",night_mode:"Нічний режим",eco:"Економія",overpowering:"Літо"},Le={common:Ce,extra_states:ke},Ee={version:"έκδοση",current:"τρέχουσα"},Se={window_open:"Παράθυρο ανοικτό",night_mode:"Λειτουργία νυκτός",eco:"Εξοικονόμηση",overpowering:"Καλοκαίρι"},Ve={common:Ee,extra_states:Se},Te={version:"versie",current:"huidig"},Me={window_open:"Raam open",night_mode:"Nacht modus",eco:"Eco",overpowering:"Zomer"},He={common:Te,extra_states:Me},Pe={version:"versjon",current:"nåværende"},Oe={window_open:"Vindu åpent",night_mode:"Nattmodus",eco:"Eco",overpowering:"Sommer"},De={common:Pe,extra_states:Oe},ze={version:"verze",current:"aktuální"},Ne={card:{climate:{disable_window:"Zakázat okno",disable_overpowering:"Zakázat léto",disable_eco:"Zakázat eco",disable_heat:"Zakázat topení",disable_off:"Zakázat vypnuto",disable_menu:"Zakázat menu",disable_security_warning:"Zakázat upozornění baterie",disable_buttons:"Zakázat tlačítka plus/minus",eco_temperature:"Eco teplota",set_current_as_main:"Prohodit místa cílovoé a aktáalní teploty"}}},je={window_open:"okno otevřeno",night_mode:"Noční režim",eco:"Eco",overpowering:"Léto"},Ie={common:ze,editor:Ne,extra_states:je},Re={version:"različica",current:"trenutno"},Fe={window_open:"Okno odprto",night_mode:"Nočni način",eco:"Eko",overpowering:"Poletje"},Ue={common:Re,extra_states:Fe},Be={version:"version",current:"Nuvarande"},Ze={window_open:"Fönster öppet",night_mode:"Nattläge",eco:"Eco",overpowering:"Sommar"},We={common:Be,extra_states:Ze},qe={version:"версия",currrent:"текущий"},Ye={window_open:"Отворен прозорец",night_mode:"Нощен режим",eco:"Екологичен режим",overpowering:"Лято"},Xe={common:qe,extra_states:Ye},Ke={version:"version",current:"Nykyinen"},Je={window_open:"Ikkuna auki",night_mode:"Yötila",eco:"Eco",overpowering:"Kesä"},Ge={common:Ke,extra_states:Je},Qe={version:"versiune",current:"curent"},ti={window_open:"Fereastră deschisă",night_mode:"Mod noapte",eco:"Eco",overpowering:"Vară"},ei={common:Qe,extra_states:ti},ii={version:"versió",current:"Actual"},ni={window_open:"Finestra oberta",night_mode:"Mode nocturn",eco:"Eco",overpowering:"Estiu"},oi={common:ii,extra_states:ni};const si={en:Mt,de:zt,fr:Ft,ru:Wt,sk:Object.freeze({__proto__:null,common:Jt,default:te,editor:Gt,extra_states:Qt}),hu:Object.freeze({__proto__:null,common:ee,default:oe,editor:ie,extra_states:ne}),pl:Kt,da:Object.freeze({__proto__:null,common:se,default:ae,extra_states:re}),es:Object.freeze({__proto__:null,common:le,default:he,extra_states:ce}),tr:Object.freeze({__proto__:null,common:ue,default:pe,extra_states:de}),it:Object.freeze({__proto__:null,common:me,default:fe,editor:ve,extra_states:_e}),pt:Object.freeze({__proto__:null,common:ge,default:we,editor:ye,extra_states:be}),cn:Object.freeze({__proto__:null,common:$e,default:Ae,extra_states:xe}),uk:Object.freeze({__proto__:null,common:Ce,default:Le,extra_states:ke}),el:Object.freeze({__proto__:null,common:Ee,default:Ve,extra_states:Se}),nl:Object.freeze({__proto__:null,common:Te,default:He,extra_states:Me}),no:Object.freeze({__proto__:null,common:Pe,default:De,extra_states:Oe}),cs:Object.freeze({__proto__:null,common:ze,default:Ie,editor:Ne,extra_states:je}),sl:Object.freeze({__proto__:null,common:Re,default:Ue,extra_states:Fe}),sv:Object.freeze({__proto__:null,common:Be,default:We,extra_states:Ze}),bg:Object.freeze({__proto__:null,common:qe,default:Xe,extra_states:Ye}),fi:Object.freeze({__proto__:null,common:Ke,default:Ge,extra_states:Je}),ro:Object.freeze({__proto__:null,common:Qe,default:ei,extra_states:ti}),ca:Object.freeze({__proto__:null,common:ii,default:oi,extra_states:ni})},ri="en";function ai({hass:t,string:e,search:i="",replace:n=""}){var o;const s=null!==(o=null==t?void 0:t.locale.language)&&void 0!==o?o:ri;let r;try{r=e.split(".").reduce(((t,e)=>t[e]),si[s])}catch(t){r=e.split(".").reduce(((t,e)=>t[e]),si.en)}return void 0===r&&(r=e.split(".").reduce(((t,e)=>t[e]),si.en)),""!==i&&""!==n&&(r=r.replace(i,n)),r}function li(t,e){try{return t.split(".").reduce(((t,e)=>t[e]),si[e])}catch(t){return}}var ci,hi,ui=Number.isNaN||function(t){return"number"==typeof t&&t!=t};function di(t,e){if(t.length!==e.length)return!1;for(var i=0;inew Intl.DateTimeFormat(t.language,{weekday:"long",month:"long",day:"numeric"}))),pi((t=>new Intl.DateTimeFormat(t.language,{year:"numeric",month:"long",day:"numeric"}))),pi((t=>new Intl.DateTimeFormat(t.language,{year:"numeric",month:"numeric",day:"numeric"}))),pi((t=>new Intl.DateTimeFormat(t.language,{day:"numeric",month:"short"}))),pi((t=>new Intl.DateTimeFormat(t.language,{month:"long",year:"numeric"}))),pi((t=>new Intl.DateTimeFormat(t.language,{month:"long"}))),pi((t=>new Intl.DateTimeFormat(t.language,{year:"numeric"}))),function(t){t.language="language",t.system="system",t.comma_decimal="comma_decimal",t.decimal_comma="decimal_comma",t.space_comma="space_comma",t.none="none"}(ci||(ci={})),function(t){t.language="language",t.system="system",t.am_pm="12",t.twenty_four="24"}(hi||(hi={}));const mi=pi((t=>{if(t.time_format===hi.language||t.time_format===hi.system){const e=t.time_format===hi.language?t.language:void 0,i=(new Date).toLocaleString(e);return i.includes("AM")||i.includes("PM")}return t.time_format===hi.am_pm}));pi((t=>new Intl.DateTimeFormat("en"!==t.language||mi(t)?t.language:"en-u-hc-h23",{year:"numeric",month:"long",day:"numeric",hour:mi(t)?"numeric":"2-digit",minute:"2-digit",hour12:mi(t)}))),pi((t=>new Intl.DateTimeFormat("en"!==t.language||mi(t)?t.language:"en-u-hc-h23",{year:"numeric",month:"long",day:"numeric",hour:mi(t)?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hour12:mi(t)}))),pi((t=>new Intl.DateTimeFormat("en"!==t.language||mi(t)?t.language:"en-u-hc-h23",{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"2-digit",hour12:mi(t)}))),pi((t=>new Intl.DateTimeFormat("en"!==t.language||mi(t)?t.language:"en-u-hc-h23",{hour:"numeric",minute:"2-digit",hour12:mi(t)}))),pi((t=>new Intl.DateTimeFormat("en"!==t.language||mi(t)?t.language:"en-u-hc-h23",{hour:mi(t)?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hour12:mi(t)}))),pi((t=>new Intl.DateTimeFormat("en"!==t.language||mi(t)?t.language:"en-u-hc-h23",{weekday:"long",hour:mi(t)?"numeric":"2-digit",minute:"2-digit",hour12:mi(t)})));const vi=(t,e,i,n)=>{n=n||{},i=null==i?{}:i;const o=new Event(e,{bubbles:void 0===n.bubbles||n.bubbles,cancelable:Boolean(n.cancelable),composed:void 0===n.composed||n.composed});return o.detail=i,t.dispatchEvent(o),o},_i=(t,e,i)=>Math.min(Math.max(t,e),i),fi=(t,e,i)=>{const n=e?(t=>{switch(t.number_format){case ci.comma_decimal:return["en-US","en"];case ci.decimal_comma:return["de","es","it"];case ci.space_comma:return["fr","sv","cs"];case ci.system:return;default:return t.language}})(e):void 0;if(Number.isNaN=Number.isNaN||function t(e){return"number"==typeof e&&t(e)},(null==e?void 0:e.number_format)!==ci.none&&!Number.isNaN(Number(t))&&Intl)try{return new Intl.NumberFormat(n,gi(t,i)).format(Number(t))}catch(e){return console.error(e),new Intl.NumberFormat(void 0,gi(t,i)).format(Number(t))}return"string"==typeof t?t:`${((t,e=2)=>Math.round(t*10**e)/10**e)(t,null==i?void 0:i.maximumFractionDigits).toString()}${"currency"===(null==i?void 0:i.style)?` ${i.currency}`:""}`},gi=(t,e)=>{const i=Object.assign({maximumFractionDigits:2},e);if("string"!=typeof t)return i;if(!e||!e.minimumFractionDigits&&!e.maximumFractionDigits){const e=t.indexOf(".")>-1?t.split(".")[1].length:0;i.minimumFractionDigits=e,i.maximumFractionDigits=e}return i};class yi extends TypeError{constructor(t,e){let i;const{message:n,explanation:o,...s}=t,{path:r}=t,a=0===r.length?n:`At path: ${r.join(".")} -- ${n}`;super(o??a),null!=o&&(this.cause=a),Object.assign(this,s),this.name=this.constructor.name,this.failures=()=>i??(i=[t,...e()])}}function bi(t){return"object"==typeof t&&null!=t}function wi(t){return"symbol"==typeof t?t.toString():"string"==typeof t?JSON.stringify(t):`${t}`}function $i(t,e,i,n){if(!0===t)return;!1===t?t={}:"string"==typeof t&&(t={message:t});const{path:o,branch:s}=e,{type:r}=i,{refinement:a,message:l=`Expected a value of type \`${r}\`${a?` with refinement \`${a}\``:""}, but received: \`${wi(n)}\``}=t;return{value:n,type:r,refinement:a,key:o[o.length-1],path:o,branch:s,...t,message:l}}function*xi(t,e,i,n){(function(t){return bi(t)&&"function"==typeof t[Symbol.iterator]})(t)||(t=[t]);for(const o of t){const t=$i(o,e,i,n);t&&(yield t)}}function*Ai(t,e,i={}){const{path:n=[],branch:o=[t],coerce:s=!1,mask:r=!1}=i,a={path:n,branch:o};if(s&&(t=e.coercer(t,a),r&&"type"!==e.type&&bi(e.schema)&&bi(t)&&!Array.isArray(t)))for(const i in t)void 0===e.schema[i]&&delete t[i];let l="valid";for(const n of e.validator(t,a))n.explanation=i.message,l="not_valid",yield[n,void 0];for(let[c,h,u]of e.entries(t,a)){const e=Ai(h,u,{path:void 0===c?n:[...n,c],branch:void 0===c?o:[...o,h],coerce:s,mask:r,message:i.message});for(const i of e)i[0]?(l=null!=i[0].refinement?"not_refined":"not_valid",yield[i[0],void 0]):s&&(h=i[1],void 0===c?t=h:t instanceof Map?t.set(c,h):t instanceof Set?t.add(h):bi(t)&&(void 0!==h||c in t)&&(t[c]=h))}if("not_valid"!==l)for(const n of e.refiner(t,a))n.explanation=i.message,l="not_refined",yield[n,void 0];"valid"===l&&(yield[void 0,t])}class Ci{constructor(t){const{type:e,schema:i,validator:n,refiner:o,coercer:s=(t=>t),entries:r=function*(){}}=t;this.type=e,this.schema=i,this.entries=r,this.coercer=s,this.validator=n?(t,e)=>xi(n(t,e),e,this,t):()=>[],this.refiner=o?(t,e)=>xi(o(t,e),e,this,t):()=>[]}assert(t,e){return ki(t,this,e)}create(t,e){return function(t,e,i){const n=Li(t,e,{coerce:!0,message:i});if(n[0])throw n[0];return n[1]}(t,this,e)}is(t){return function(t,e){const i=Li(t,e);return!i[0]}(t,this)}mask(t,e){return function(t,e,i){const n=Li(t,e,{coerce:!0,mask:!0,message:i});if(n[0])throw n[0];return n[1]}(t,this,e)}validate(t,e={}){return Li(t,this,e)}}function ki(t,e,i){const n=Li(t,e,{message:i});if(n[0])throw n[0]}function Li(t,e,i={}){const n=Ai(t,e,i),o=function(t){const{done:e,value:i}=t.next();return e?void 0:i}(n);if(o[0]){const t=new yi(o[0],(function*(){for(const t of n)t[0]&&(yield t[0])}));return[t,void 0]}return[void 0,o[1]]}function Ei(t,e){return new Ci({type:t,schema:null,validator:e})}function Si(t){return new Ci({type:"array",schema:t,*entries(e){if(t&&Array.isArray(e))for(const[i,n]of e.entries())yield[i,n,t]},coercer:t=>Array.isArray(t)?t.slice():t,validator:t=>Array.isArray(t)||`Expected an array value, but received: ${wi(t)}`})}function Vi(){return Ei("boolean",(t=>"boolean"==typeof t))}function Ti(t){const e=wi(t),i=typeof t;return new Ci({type:"literal",schema:"string"===i||"number"===i||"boolean"===i?t:null,validator:i=>i===t||`Expected the literal \`${e}\`, but received: ${wi(i)}`})}function Mi(){return Ei("number",(t=>"number"==typeof t&&!isNaN(t)||`Expected a number, but received: ${wi(t)}`))}function Hi(t){const e=t?Object.keys(t):[],i=Ei("never",(()=>!1));return new Ci({type:"object",schema:t||null,*entries(n){if(t&&bi(n)){const o=new Set(Object.keys(n));for(const i of e)o.delete(i),yield[i,n[i],t[i]];for(const t of o)yield[t,n[t],i]}},validator:t=>bi(t)||`Expected an object, but received: ${wi(t)}`,coercer:t=>bi(t)?{...t}:t})}function Pi(t){return new Ci({...t,validator:(e,i)=>void 0===e||t.validator(e,i),refiner:(e,i)=>void 0===e||t.refiner(e,i)})}function Oi(){return Ei("string",(t=>"string"==typeof t||`Expected a string, but received: ${wi(t)}`))}function Di(t){const e=Object.keys(t);return new Ci({type:"type",schema:t,*entries(i){if(bi(i))for(const n of e)yield[n,i[n],t[n]]},validator:t=>bi(t)||`Expected an object, but received: ${wi(t)}`,coercer:t=>bi(t)?{...t}:t})}function zi(t){const e=t.map((t=>t.type)).join(" | ");return new Ci({type:"union",schema:null,coercer(e){for(const i of t){const[t,n]=i.validate(e,{coerce:!0});if(!t)return n}return e},validator(i,n){const o=[];for(const e of t){const[...t]=Ai(i,e,n),[s]=t;if(!s[0])return[];for(const[e]of t)e&&o.push(e)}return[`Expected the value to satisfy a union of \`${e}\`, but received: ${wi(i)}`,...o]}})}const Ni=Hi({user:Oi()}),ji=zi([Vi(),Hi({text:Pi(Oi()),excemptions:Pi(Si(Ni))})]),Ii=Hi({action:Ti("url"),url_path:Oi(),confirmation:Pi(ji)}),Ri=Hi({action:Ti("call-service"),service:Oi(),service_data:Pi(Hi()),data:Pi(Hi()),target:Pi(Hi({entity_id:Pi(zi([Oi(),Si(Oi())])),device_id:Pi(zi([Oi(),Si(Oi())])),area_id:Pi(zi([Oi(),Si(Oi())]))})),confirmation:Pi(ji)}),Fi=Hi({action:Ti("navigate"),navigation_path:Oi(),confirmation:Pi(ji)}),Ui=Di({action:Ti("fire-dom-event")}),Bi=Hi({action:function(t){const e={},i=t.map((t=>wi(t))).join();for(const i of t)e[i]=i;return new Ci({type:"enums",schema:e,validator:e=>t.includes(e)||`Expected one of \`${i}\`, but received: ${wi(e)}`})}(["none","toggle","more-info","call-service","url","navigate"]),confirmation:Pi(ji)});var Zi;Zi=t=>{if(t&&"object"==typeof t&&"action"in t)switch(t.action){case"call-service":return Ri;case"fire-dom-event":return Ui;case"navigate":return Fi;case"url":return Ii}return Bi},new Ci({type:"dynamic",schema:null,*entries(t,e){const i=Zi(t,e);yield*i.entries(t,e)},validator:(t,e)=>Zi(t,e).validator(t,e),coercer:(t,e)=>Zi(t,e).coercer(t,e),refiner:(t,e)=>Zi(t,e).refiner(t,e)}),r` #sortable a:nth-of-type(2n) paper-icon-item { animation-name: keyframes1; animation-iteration-count: infinite; @@ -163,13 +163,13 @@ const ct=t=>(e,i)=>{void 0!==i?i.addInitializer((()=>{customElements.define(t,e) color: var(--secondary-text-color); cursor: pointer; } -`;const qi=([[t,e],[i,n]],[o,s])=>[t*o+e*s,i*o+n*s],Yi=([t,e],[i,n])=>[t+i,e+n],Xi=t=>t/180*Math.PI,Ki=t=>{const{x:e,y:i,r:n,start:o,end:s,rotate:r=0}=t,a=e,l=i,c=n,h=n,u=Xi(o),d=(Xi(s)-u)%(2*Math.PI),p=Xi(r),m=(t=>[[Math.cos(t),-Math.sin(t)],[Math.sin(t),Math.cos(t)]])(p),[v,_]=Yi(qi(m,[c*Math.cos(u),h*Math.sin(u)]),[a,l]),[f,g]=Yi(qi(m,[c*Math.cos(u+d),h*Math.sin(u+d)]),[a,l]),y=d>Math.PI?1:0,b=d>0?1:0;return["M",v,_,"A",c,h,p/(2*Math.PI)*360,y,b,f,g].join(" ")};function Ji(){return Ji=Object.assign||function(t){for(var e=1;e-1}var In=function(){function t(t,e){this.manager=t,this.set(e)}var e=t.prototype;return e.set=function(t){t===un&&(t=this.compute()),hn&&this.manager.element.style&&fn[t]&&(this.manager.element.style[cn]=t),this.actions=t.toLowerCase().trim()},e.update=function(){this.set(this.manager.options.touchAction)},e.compute=function(){var t=[];return zn(this.manager.recognizers,(function(e){Nn(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))})),function(t){if(jn(t,mn))return mn;var e=jn(t,vn),i=jn(t,_n);return e&&i?mn:e||i?e?vn:_n:jn(t,pn)?pn:dn}(t.join(" "))},e.preventDefaults=function(t){var e=t.srcEvent,i=t.offsetDirection;if(this.manager.session.prevented)e.preventDefault();else{var n=this.actions,o=jn(n,mn)&&!fn[mn],s=jn(n,_n)&&!fn[_n],r=jn(n,vn)&&!fn[vn];if(o){var a=1===t.pointers.length,l=t.distance<2,c=t.deltaTime<250;if(a&&l&&c)return}if(!r||!s)return o||s&&i&Mn||r&&i&Hn?this.preventSrc(e):void 0}},e.preventSrc=function(t){this.manager.session.prevented=!0,t.preventDefault()},t}();function Rn(t,e){for(;t;){if(t===e)return!0;t=t.parentNode}return!1}function Fn(t){var e=t.length;if(1===e)return{x:sn(t[0].clientX),y:sn(t[0].clientY)};for(var i=0,n=0,o=0;o=rn(e)?t<0?En:Sn:e<0?Vn:Tn}function qn(t,e,i){return{x:e/t||0,y:i/t||0}}function Yn(t,e){var i=t.session,n=e.pointers,o=n.length;i.firstInput||(i.firstInput=Un(e)),o>1&&!i.firstMultiple?i.firstMultiple=Un(e):1===o&&(i.firstMultiple=!1);var s=i.firstInput,r=i.firstMultiple,a=r?r.center:s.center,l=e.center=Fn(n);e.timeStamp=an(),e.deltaTime=e.timeStamp-s.timeStamp,e.angle=Zn(a,l),e.distance=Bn(a,l),function(t,e){var i=e.center,n=t.offsetDelta||{},o=t.prevDelta||{},s=t.prevInput||{};e.eventType!==An&&s.eventType!==Cn||(o=t.prevDelta={x:s.deltaX||0,y:s.deltaY||0},n=t.offsetDelta={x:i.x,y:i.y}),e.deltaX=o.x+(i.x-n.x),e.deltaY=o.y+(i.y-n.y)}(i,e),e.offsetDirection=Wn(e.deltaX,e.deltaY);var c,h,u=qn(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=u.x,e.overallVelocityY=u.y,e.overallVelocity=rn(u.x)>rn(u.y)?u.x:u.y,e.scale=r?(c=r.pointers,Bn((h=n)[0],h[1],Dn)/Bn(c[0],c[1],Dn)):1,e.rotation=r?function(t,e){return Zn(e[1],e[0],Dn)+Zn(t[1],t[0],Dn)}(r.pointers,n):0,e.maxPointers=i.prevInput?e.pointers.length>i.prevInput.maxPointers?e.pointers.length:i.prevInput.maxPointers:e.pointers.length,function(t,e){var i,n,o,s,r=t.lastInterval||e,a=e.timeStamp-r.timeStamp;if(e.eventType!==kn&&(a>xn||void 0===r.velocity)){var l=e.deltaX-r.deltaX,c=e.deltaY-r.deltaY,h=qn(a,l,c);n=h.x,o=h.y,i=rn(h.x)>rn(h.y)?h.x:h.y,s=Wn(l,c),t.lastInterval=e}else i=r.velocity,n=r.velocityX,o=r.velocityY,s=r.direction;e.velocity=i,e.velocityX=n,e.velocityY=o,e.direction=s}(i,e);var d,p=t.element,m=e.srcEvent;Rn(d=m.composedPath?m.composedPath()[0]:m.path?m.path[0]:m.target,p)&&(p=d),e.target=p}function Xn(t,e,i){var n=i.pointers.length,o=i.changedPointers.length,s=e&An&&n-o==0,r=e&(Cn|kn)&&n-o==0;i.isFirst=!!s,i.isFinal=!!r,s&&(t.session={}),i.eventType=e,Yn(t,i),t.emit("hammer.input",i),t.recognize(i),t.session.prevInput=i}function Kn(t){return t.trim().split(/\s+/g)}function Jn(t,e,i){zn(Kn(e),(function(e){t.addEventListener(e,i,!1)}))}function Gn(t,e,i){zn(Kn(e),(function(e){t.removeEventListener(e,i,!1)}))}function Qn(t){var e=t.ownerDocument||t;return e.defaultView||e.parentWindow||window}var to=function(){function t(t,e){var i=this;this.manager=t,this.callback=e,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(e){Nn(t.options.enable,[t])&&i.handler(e)},this.init()}var e=t.prototype;return e.handler=function(){},e.init=function(){this.evEl&&Jn(this.element,this.evEl,this.domHandler),this.evTarget&&Jn(this.target,this.evTarget,this.domHandler),this.evWin&&Jn(Qn(this.element),this.evWin,this.domHandler)},e.destroy=function(){this.evEl&&Gn(this.element,this.evEl,this.domHandler),this.evTarget&&Gn(this.target,this.evTarget,this.domHandler),this.evWin&&Gn(Qn(this.element),this.evWin,this.domHandler)},t}();function eo(t,e,i){if(t.indexOf&&!i)return t.indexOf(e);for(var n=0;ni[e]})):n.sort()),n}var co={touchstart:An,touchmove:2,touchend:Cn,touchcancel:kn},ho=function(t){function e(){var i;return e.prototype.evTarget="touchstart touchmove touchend touchcancel",(i=t.apply(this,arguments)||this).targetIds={},i}return Gi(e,t),e.prototype.handler=function(t){var e=co[t.type],i=uo.call(this,t,e);i&&this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:wn,srcEvent:t})},e}(to);function uo(t,e){var i,n,o=ao(t.touches),s=this.targetIds;if(e&(2|An)&&1===o.length)return s[o[0].identifier]=!0,[o,o];var r=ao(t.changedTouches),a=[],l=this.target;if(n=o.filter((function(t){return Rn(t.target,l)})),e===An)for(i=0;i-1&&n.splice(t,1)}),vo)}}function fo(t,e){t&An?(this.primaryTouch=e.changedPointers[0].identifier,_o.call(this,e)):t&(Cn|kn)&&_o.call(this,e)}function go(t){for(var e=t.srcEvent.clientX,i=t.srcEvent.clientY,n=0;n-1&&this.requireFail.splice(e,1),this},e.hasRequireFailures=function(){return this.requireFail.length>0},e.canRecognizeWith=function(t){return!!this.simultaneous[t.id]},e.emit=function(t){var e=this,i=this.state;function n(i){e.manager.emit(i,t)}i<8&&n(e.options.event+Ao(i)),n(e.options.event),t.additionalEvent&&n(t.additionalEvent),i>=8&&n(e.options.event+Ao(i))},e.tryEmit=function(t){if(this.canEmit())return this.emit(t);this.state=wo},e.canEmit=function(){for(var t=0;te.threshold&&o&e.direction},i.attrTest=function(t){return Lo.prototype.attrTest.call(this,t)&&(2&this.state||!(2&this.state)&&this.directionTest(t))},i.emit=function(e){this.pX=e.deltaX,this.pY=e.deltaY;var i=Eo(e.direction);i&&(e.additionalEvent=this.options.event+i),t.prototype.emit.call(this,e)},e}(Lo),Vo=function(t){function e(e){return void 0===e&&(e={}),t.call(this,Ji({event:"swipe",threshold:10,velocity:.3,direction:Mn|Hn,pointers:1},e))||this}Gi(e,t);var i=e.prototype;return i.getTouchAction=function(){return So.prototype.getTouchAction.call(this)},i.attrTest=function(e){var i,n=this.options.direction;return n&(Mn|Hn)?i=e.overallVelocity:n&Mn?i=e.overallVelocityX:n&Hn&&(i=e.overallVelocityY),t.prototype.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers===this.options.pointers&&rn(i)>this.options.velocity&&e.eventType&Cn},i.emit=function(t){var e=Eo(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)},e}(Lo),To=function(t){function e(e){return void 0===e&&(e={}),t.call(this,Ji({event:"pinch",threshold:0,pointers:2},e))||this}Gi(e,t);var i=e.prototype;return i.getTouchAction=function(){return[mn]},i.attrTest=function(e){return t.prototype.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},i.emit=function(e){if(1!==e.scale){var i=e.scale<1?"in":"out";e.additionalEvent=this.options.event+i}t.prototype.emit.call(this,e)},e}(Lo),Mo=function(t){function e(e){return void 0===e&&(e={}),t.call(this,Ji({event:"rotate",threshold:0,pointers:2},e))||this}Gi(e,t);var i=e.prototype;return i.getTouchAction=function(){return[mn]},i.attrTest=function(e){return t.prototype.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)},e}(Lo),Ho=function(t){function e(e){var i;return void 0===e&&(e={}),(i=t.call(this,Ji({event:"press",pointers:1,time:251,threshold:9},e))||this)._timer=null,i._input=null,i}Gi(e,t);var i=e.prototype;return i.getTouchAction=function(){return[dn]},i.process=function(t){var e=this,i=this.options,n=t.pointers.length===i.pointers,o=t.distancei.time;if(this._input=t,!o||!n||t.eventType&(Cn|kn)&&!s)this.reset();else if(t.eventType&An)this.reset(),this._timer=setTimeout((function(){e.state=8,e.tryEmit()}),i.time);else if(t.eventType&Cn)return 8;return wo},i.reset=function(){clearTimeout(this._timer)},i.emit=function(t){8===this.state&&(t&&t.eventType&Cn?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=an(),this.manager.emit(this.options.event,this._input)))},e}(Co),Po={domEvents:!1,touchAction:un,enable:!0,inputTarget:null,inputClass:null,cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},Oo=[[Mo,{enable:!1}],[To,{enable:!1},["rotate"]],[Vo,{direction:Mn}],[So,{direction:Mn},["swipe"]],[ko],[ko,{event:"doubletap",taps:2},["tap"]],[Ho]];function Do(t,e){var i,n=t.element;n.style&&(zn(t.options.cssProps,(function(o,s){i=ln(n.style,s),e?(t.oldCssProps[i]=n.style[i],n.style[i]=o):n.style[i]=t.oldCssProps[i]||""})),e||(t.oldCssProps={}))}var zo=function(){function t(t,e){var i,n=this;this.options=en({},Po,e||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=new((i=this).options.inputClass||(yn?ro:bn?ho:gn?yo:mo))(i,Xn),this.touchAction=new In(this,this.options.touchAction),Do(this,!0),zn(this.options.recognizers,(function(t){var e=n.add(new t[0](t[1]));t[2]&&e.recognizeWith(t[2]),t[3]&&e.requireFailure(t[3])}),this)}var e=t.prototype;return e.set=function(t){return en(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},e.stop=function(t){this.session.stopped=t?2:1},e.recognize=function(t){var e=this.session;if(!e.stopped){var i;this.touchAction.preventDefaults(t);var n=this.recognizers,o=e.curRecognizer;(!o||o&&8&o.state)&&(e.curRecognizer=null,o=null);for(var s=0;s\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=window.console&&(window.console.warn||window.console.log);return o&&o.call(window.console,n,i),t.apply(this,arguments)}}var Fo=Ro((function(t,e,i){for(var n=Object.keys(e),o=0;o[t*o+e*s,i*o+n*s],qi=([t,e],[i,n])=>[t+i,e+n],Yi=t=>t/180*Math.PI,Xi=t=>{const{x:e,y:i,r:n,start:o,end:s,rotate:r=0}=t,a=e,l=i,c=n,h=n,u=Yi(o),d=(Yi(s)-u)%(2*Math.PI),p=Yi(r),m=(t=>[[Math.cos(t),-Math.sin(t)],[Math.sin(t),Math.cos(t)]])(p),[v,_]=qi(Wi(m,[c*Math.cos(u),h*Math.sin(u)]),[a,l]),[f,g]=qi(Wi(m,[c*Math.cos(u+d),h*Math.sin(u+d)]),[a,l]),y=d>Math.PI?1:0,b=d>0?1:0;return["M",v,_,"A",c,h,p/(2*Math.PI)*360,y,b,f,g].join(" ")};function Ki(){return Ki=Object.assign||function(t){for(var e=1;e-1}var jn=function(){function t(t,e){this.manager=t,this.set(e)}var e=t.prototype;return e.set=function(t){t===hn&&(t=this.compute()),cn&&this.manager.element.style&&_n[t]&&(this.manager.element.style[ln]=t),this.actions=t.toLowerCase().trim()},e.update=function(){this.set(this.manager.options.touchAction)},e.compute=function(){var t=[];return Dn(this.manager.recognizers,(function(e){zn(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))})),function(t){if(Nn(t,pn))return pn;var e=Nn(t,mn),i=Nn(t,vn);return e&&i?pn:e||i?e?mn:vn:Nn(t,dn)?dn:un}(t.join(" "))},e.preventDefaults=function(t){var e=t.srcEvent,i=t.offsetDirection;if(this.manager.session.prevented)e.preventDefault();else{var n=this.actions,o=Nn(n,pn)&&!_n[pn],s=Nn(n,vn)&&!_n[vn],r=Nn(n,mn)&&!_n[mn];if(o){var a=1===t.pointers.length,l=t.distance<2,c=t.deltaTime<250;if(a&&l&&c)return}if(!r||!s)return o||s&&i&Tn||r&&i&Mn?this.preventSrc(e):void 0}},e.preventSrc=function(t){this.manager.session.prevented=!0,t.preventDefault()},t}();function In(t,e){for(;t;){if(t===e)return!0;t=t.parentNode}return!1}function Rn(t){var e=t.length;if(1===e)return{x:on(t[0].clientX),y:on(t[0].clientY)};for(var i=0,n=0,o=0;o=sn(e)?t<0?Ln:En:e<0?Sn:Vn}function Wn(t,e,i){return{x:e/t||0,y:i/t||0}}function qn(t,e){var i=t.session,n=e.pointers,o=n.length;i.firstInput||(i.firstInput=Fn(e)),o>1&&!i.firstMultiple?i.firstMultiple=Fn(e):1===o&&(i.firstMultiple=!1);var s=i.firstInput,r=i.firstMultiple,a=r?r.center:s.center,l=e.center=Rn(n);e.timeStamp=rn(),e.deltaTime=e.timeStamp-s.timeStamp,e.angle=Bn(a,l),e.distance=Un(a,l),function(t,e){var i=e.center,n=t.offsetDelta||{},o=t.prevDelta||{},s=t.prevInput||{};e.eventType!==xn&&s.eventType!==An||(o=t.prevDelta={x:s.deltaX||0,y:s.deltaY||0},n=t.offsetDelta={x:i.x,y:i.y}),e.deltaX=o.x+(i.x-n.x),e.deltaY=o.y+(i.y-n.y)}(i,e),e.offsetDirection=Zn(e.deltaX,e.deltaY);var c,h,u=Wn(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=u.x,e.overallVelocityY=u.y,e.overallVelocity=sn(u.x)>sn(u.y)?u.x:u.y,e.scale=r?(c=r.pointers,Un((h=n)[0],h[1],On)/Un(c[0],c[1],On)):1,e.rotation=r?function(t,e){return Bn(e[1],e[0],On)+Bn(t[1],t[0],On)}(r.pointers,n):0,e.maxPointers=i.prevInput?e.pointers.length>i.prevInput.maxPointers?e.pointers.length:i.prevInput.maxPointers:e.pointers.length,function(t,e){var i,n,o,s,r=t.lastInterval||e,a=e.timeStamp-r.timeStamp;if(e.eventType!==Cn&&(a>$n||void 0===r.velocity)){var l=e.deltaX-r.deltaX,c=e.deltaY-r.deltaY,h=Wn(a,l,c);n=h.x,o=h.y,i=sn(h.x)>sn(h.y)?h.x:h.y,s=Zn(l,c),t.lastInterval=e}else i=r.velocity,n=r.velocityX,o=r.velocityY,s=r.direction;e.velocity=i,e.velocityX=n,e.velocityY=o,e.direction=s}(i,e);var d,p=t.element,m=e.srcEvent;In(d=m.composedPath?m.composedPath()[0]:m.path?m.path[0]:m.target,p)&&(p=d),e.target=p}function Yn(t,e,i){var n=i.pointers.length,o=i.changedPointers.length,s=e&xn&&n-o==0,r=e&(An|Cn)&&n-o==0;i.isFirst=!!s,i.isFinal=!!r,s&&(t.session={}),i.eventType=e,qn(t,i),t.emit("hammer.input",i),t.recognize(i),t.session.prevInput=i}function Xn(t){return t.trim().split(/\s+/g)}function Kn(t,e,i){Dn(Xn(e),(function(e){t.addEventListener(e,i,!1)}))}function Jn(t,e,i){Dn(Xn(e),(function(e){t.removeEventListener(e,i,!1)}))}function Gn(t){var e=t.ownerDocument||t;return e.defaultView||e.parentWindow||window}var Qn=function(){function t(t,e){var i=this;this.manager=t,this.callback=e,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(e){zn(t.options.enable,[t])&&i.handler(e)},this.init()}var e=t.prototype;return e.handler=function(){},e.init=function(){this.evEl&&Kn(this.element,this.evEl,this.domHandler),this.evTarget&&Kn(this.target,this.evTarget,this.domHandler),this.evWin&&Kn(Gn(this.element),this.evWin,this.domHandler)},e.destroy=function(){this.evEl&&Jn(this.element,this.evEl,this.domHandler),this.evTarget&&Jn(this.target,this.evTarget,this.domHandler),this.evWin&&Jn(Gn(this.element),this.evWin,this.domHandler)},t}();function to(t,e,i){if(t.indexOf&&!i)return t.indexOf(e);for(var n=0;ni[e]})):n.sort()),n}var lo={touchstart:xn,touchmove:2,touchend:An,touchcancel:Cn},co=function(t){function e(){var i;return e.prototype.evTarget="touchstart touchmove touchend touchcancel",(i=t.apply(this,arguments)||this).targetIds={},i}return Ji(e,t),e.prototype.handler=function(t){var e=lo[t.type],i=ho.call(this,t,e);i&&this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:bn,srcEvent:t})},e}(Qn);function ho(t,e){var i,n,o=ro(t.touches),s=this.targetIds;if(e&(2|xn)&&1===o.length)return s[o[0].identifier]=!0,[o,o];var r=ro(t.changedTouches),a=[],l=this.target;if(n=o.filter((function(t){return In(t.target,l)})),e===xn)for(i=0;i-1&&n.splice(t,1)}),mo)}}function _o(t,e){t&xn?(this.primaryTouch=e.changedPointers[0].identifier,vo.call(this,e)):t&(An|Cn)&&vo.call(this,e)}function fo(t){for(var e=t.srcEvent.clientX,i=t.srcEvent.clientY,n=0;n-1&&this.requireFail.splice(e,1),this},e.hasRequireFailures=function(){return this.requireFail.length>0},e.canRecognizeWith=function(t){return!!this.simultaneous[t.id]},e.emit=function(t){var e=this,i=this.state;function n(i){e.manager.emit(i,t)}i<8&&n(e.options.event+xo(i)),n(e.options.event),t.additionalEvent&&n(t.additionalEvent),i>=8&&n(e.options.event+xo(i))},e.tryEmit=function(t){if(this.canEmit())return this.emit(t);this.state=bo},e.canEmit=function(){for(var t=0;te.threshold&&o&e.direction},i.attrTest=function(t){return ko.prototype.attrTest.call(this,t)&&(2&this.state||!(2&this.state)&&this.directionTest(t))},i.emit=function(e){this.pX=e.deltaX,this.pY=e.deltaY;var i=Lo(e.direction);i&&(e.additionalEvent=this.options.event+i),t.prototype.emit.call(this,e)},e}(ko),So=function(t){function e(e){return void 0===e&&(e={}),t.call(this,Ki({event:"swipe",threshold:10,velocity:.3,direction:Tn|Mn,pointers:1},e))||this}Ji(e,t);var i=e.prototype;return i.getTouchAction=function(){return Eo.prototype.getTouchAction.call(this)},i.attrTest=function(e){var i,n=this.options.direction;return n&(Tn|Mn)?i=e.overallVelocity:n&Tn?i=e.overallVelocityX:n&Mn&&(i=e.overallVelocityY),t.prototype.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers===this.options.pointers&&sn(i)>this.options.velocity&&e.eventType&An},i.emit=function(t){var e=Lo(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)},e}(ko),Vo=function(t){function e(e){return void 0===e&&(e={}),t.call(this,Ki({event:"pinch",threshold:0,pointers:2},e))||this}Ji(e,t);var i=e.prototype;return i.getTouchAction=function(){return[pn]},i.attrTest=function(e){return t.prototype.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},i.emit=function(e){if(1!==e.scale){var i=e.scale<1?"in":"out";e.additionalEvent=this.options.event+i}t.prototype.emit.call(this,e)},e}(ko),To=function(t){function e(e){return void 0===e&&(e={}),t.call(this,Ki({event:"rotate",threshold:0,pointers:2},e))||this}Ji(e,t);var i=e.prototype;return i.getTouchAction=function(){return[pn]},i.attrTest=function(e){return t.prototype.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)},e}(ko),Mo=function(t){function e(e){var i;return void 0===e&&(e={}),(i=t.call(this,Ki({event:"press",pointers:1,time:251,threshold:9},e))||this)._timer=null,i._input=null,i}Ji(e,t);var i=e.prototype;return i.getTouchAction=function(){return[un]},i.process=function(t){var e=this,i=this.options,n=t.pointers.length===i.pointers,o=t.distancei.time;if(this._input=t,!o||!n||t.eventType&(An|Cn)&&!s)this.reset();else if(t.eventType&xn)this.reset(),this._timer=setTimeout((function(){e.state=8,e.tryEmit()}),i.time);else if(t.eventType&An)return 8;return bo},i.reset=function(){clearTimeout(this._timer)},i.emit=function(t){8===this.state&&(t&&t.eventType&An?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=rn(),this.manager.emit(this.options.event,this._input)))},e}(Ao),Ho={domEvents:!1,touchAction:hn,enable:!0,inputTarget:null,inputClass:null,cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},Po=[[To,{enable:!1}],[Vo,{enable:!1},["rotate"]],[So,{direction:Tn}],[Eo,{direction:Tn},["swipe"]],[Co],[Co,{event:"doubletap",taps:2},["tap"]],[Mo]];function Oo(t,e){var i,n=t.element;n.style&&(Dn(t.options.cssProps,(function(o,s){i=an(n.style,s),e?(t.oldCssProps[i]=n.style[i],n.style[i]=o):n.style[i]=t.oldCssProps[i]||""})),e||(t.oldCssProps={}))}var Do=function(){function t(t,e){var i,n=this;this.options=tn({},Ho,e||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=new((i=this).options.inputClass||(gn?so:yn?co:fn?go:po))(i,Yn),this.touchAction=new jn(this,this.options.touchAction),Oo(this,!0),Dn(this.options.recognizers,(function(t){var e=n.add(new t[0](t[1]));t[2]&&e.recognizeWith(t[2]),t[3]&&e.requireFailure(t[3])}),this)}var e=t.prototype;return e.set=function(t){return tn(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},e.stop=function(t){this.session.stopped=t?2:1},e.recognize=function(t){var e=this.session;if(!e.stopped){var i;this.touchAction.preventDefaults(t);var n=this.recognizers,o=e.curRecognizer;(!o||o&&8&o.state)&&(e.curRecognizer=null,o=null);for(var s=0;s\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=window.console&&(window.console.warn||window.console.log);return o&&o.call(window.console,n,i),t.apply(this,arguments)}}var Ro=Io((function(t,e,i){for(var n=Object.keys(e),o=0;o{const e=this._slider.getBoundingClientRect(),i=2*(t.center.x-e.left-e.width/2)/e.width,n=2*(t.center.y-e.top-e.height/2)/e.height,[,o]=function(t,e){return[Math.sqrt(t*t+e*e),Math.atan2(e,t)]}(i,n),s=(o/(2*Math.PI)*360+45-135+360)%360-45;return Math.max(Math.min(s/Wo,1),0)}}_valueToPercentage(t){return(fi(t,this.min,this.max)-this.min)/(this.max-this.min)}_percentageToValue(t){return(this.max-this.min)*t+this.min}_steppedValue(t){return Math.round(t/this.step)*this.step}_boundedValue(t){var e,i;const n="high"===this._activeSlider?Math.min(null!==(e=this._localLow)&&void 0!==e?e:this.max):this.min,o="low"===this._activeSlider?Math.max(null!==(i=this._localHigh)&&void 0!==i?i:this.min):this.max;return Math.min(Math.max(t,n),o)}firstUpdated(t){super.firstUpdated(t),this._setupListeners()}updated(t){super.updated(t),this._activeSlider||(t.has("value")&&(this._localValue=this.value),t.has("low")&&(this._localLow=this.low),t.has("high")&&(this._localHigh=this.high))}connectedCallback(){super.connectedCallback(),this._setupListeners()}disconnectedCallback(){super.disconnectedCallback()}_findActiveSlider(t){var e,i;if(!this.dual)return"value";const n=Math.max(null!==(e=this._localLow)&&void 0!==e?e:this.min,this.min),o=Math.min(null!==(i=this._localHigh)&&void 0!==i?i:this.max,this.max);if(n>=t)return"low";if(o<=t)return"high";return Math.abs(t-n)<=Math.abs(t-o)?"low":"high"}_setActiveValue(t){switch(this._activeSlider){case"high":this._localHigh=t;break;case"low":this._localLow=t;break;case"value":this._localValue=t}}_getActiveValue(){switch(this._activeSlider){case"high":return this._localHigh;case"low":return this._localLow;case"value":return this._localValue}}_setupListeners(){this._interaction&&!this._mc&&(this._mc=new zo(this._interaction,{inputClass:yo}),this._mc.add(new So({direction:Pn,enable:!0,threshold:0})),this._mc.add(new ko({event:"singletap"})),this._mc.on("pan",(t=>{t.srcEvent.stopPropagation(),t.srcEvent.preventDefault()})),this._mc.on("panstart",(t=>{var e,i;if(this.disabled)return;const n=this._getPercentageFromEvent(t),o=this._percentageToValue(n);this._activeSlider=this._findActiveSlider(o),this._lastSlider=this._activeSlider,null===(i=null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById("#slider"))||void 0===i||i.focus()})),this._mc.on("pancancel",(()=>{this.disabled||(this._activeSlider=void 0)})),this._mc.on("panmove",(t=>{if(this.disabled)return;const e=this._getPercentageFromEvent(t),i=this._percentageToValue(e),n=this._boundedValue(i);this._setActiveValue(n);const o=this._steppedValue(n);this._activeSlider&&_i(this,`${this._activeSlider}-changing`,{value:o})})),this._mc.on("panend",(t=>{if(this.disabled)return;const e=this._getPercentageFromEvent(t),i=this._percentageToValue(e),n=this._boundedValue(i),o=this._steppedValue(n);this._setActiveValue(o),this._activeSlider&&(_i(this,`${this._activeSlider}-changing`,{value:void 0}),_i(this,`${this._activeSlider}-changed`,{value:o})),this._activeSlider=void 0})),this._mc.on("singletap",(t=>{var e,i;if(this.disabled)return;const n=this._getPercentageFromEvent(t),o=this._percentageToValue(n);this._activeSlider=this._findActiveSlider(o);const s=this._boundedValue(o),r=this._steppedValue(s);this._setActiveValue(r),this._activeSlider&&(_i(this,`${this._activeSlider}-changing`,{value:void 0}),_i(this,`${this._activeSlider}-changed`,{value:r})),this._lastSlider=this._activeSlider,null===(i=null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById("#slider"))||void 0===i||i.focus(),this._activeSlider=void 0})))}get _tenPercentStep(){return Math.max(this.step,(this.max-this.min)/10)}_handleKeyDown(t){var e,i,n;if(!qo.has(t.code))return;t.preventDefault(),this._lastSlider&&(null===(i=null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById(this._lastSlider))||void 0===i||i.focus()),this._activeSlider=null!==(n=this._lastSlider)&&void 0!==n?n:t.currentTarget.id,this._lastSlider=void 0;const o=this._getActiveValue();switch(t.code){case"ArrowRight":case"ArrowUp":this._setActiveValue(this._boundedValue((null!=o?o:this.min)+this.step));break;case"ArrowLeft":case"ArrowDown":this._setActiveValue(this._boundedValue((null!=o?o:this.min)-this.step));break;case"PageUp":this._setActiveValue(this._steppedValue(this._boundedValue((null!=o?o:this.min)+this._tenPercentStep)));break;case"PageDown":this._setActiveValue(this._steppedValue(this._boundedValue((null!=o?o:this.min)-this._tenPercentStep)));break;case"Home":this._setActiveValue(this._boundedValue(this.min));break;case"End":this._setActiveValue(this._boundedValue(this.max))}_i(this,`${this._activeSlider}-changing`,{value:this._getActiveValue()}),this._activeSlider=void 0}_handleKeyUp(t){qo.has(t.code)&&(this._activeSlider=t.currentTarget.id,t.preventDefault(),_i(this,`${this._activeSlider}-changing`,{value:void 0}),_i(this,`${this._activeSlider}-changed`,{value:this._getActiveValue()}),this._activeSlider=void 0)}destroyListeners(){this._mc&&(this._mc.destroy(),this._mc=void 0)}_strokeCircleDashArc(t){return this._strokeDashArc(t,t)}_strokeDashArc(t,e){const i=this._valueToPercentage(t),n=this._valueToPercentage(e),o=290*Math.PI*Wo/360,s=Math.max((n-i)*o,0);return[`${s} ${o-s}`,`-${i*o-.5}`]}renderArc(t,e,i){var n,o;if(this.disabled)return W;const s=Ki({x:0,y:0,start:0,end:Wo,r:145}),r="end"===i?this.max:this.min,a=null!==(n=this.current)&&void 0!==n?n:r,l=null!=e?e:r,c="end"===i?l<=a:"start"===i&&a<=l,h=c?"end"===i?this._strokeDashArc(l,a):this._strokeDashArc(a,l):this._strokeCircleDashArc(l),u="full"===i?this._strokeDashArc(this.min,this.max):"end"===i?this._strokeDashArc(l,r):this._strokeDashArc(r,l),d=this._strokeCircleDashArc(l),p=null!=this.current&&this.current<=this.max&&this.current>=this.min&&(c||"full"===this.mode)?this._strokeCircleDashArc(this.current):void 0;return B` +const Zo=270;const Wo=new Set(["ArrowRight","ArrowUp","ArrowLeft","ArrowDown","PageUp","PageDown","Home","End"]);let qo=class extends at{constructor(){super(...arguments),this.disabled=!1,this.step=1,this.min=0,this.max=100,this._localValue=this.value,this._localLow=this.low,this._localHigh=this.high,this._getPercentageFromEvent=t=>{const e=this._slider.getBoundingClientRect(),i=2*(t.center.x-e.left-e.width/2)/e.width,n=2*(t.center.y-e.top-e.height/2)/e.height,[,o]=function(t,e){return[Math.sqrt(t*t+e*e),Math.atan2(e,t)]}(i,n),s=(o/(2*Math.PI)*360+45-135+360)%360-45;return Math.max(Math.min(s/Zo,1),0)}}_valueToPercentage(t){return(_i(t,this.min,this.max)-this.min)/(this.max-this.min)}_percentageToValue(t){return(this.max-this.min)*t+this.min}_steppedValue(t){return Math.round(t/this.step)*this.step}_boundedValue(t){var e,i;const n="high"===this._activeSlider?Math.min(null!==(e=this._localLow)&&void 0!==e?e:this.max):this.min,o="low"===this._activeSlider?Math.max(null!==(i=this._localHigh)&&void 0!==i?i:this.min):this.max;return Math.min(Math.max(t,n),o)}firstUpdated(t){super.firstUpdated(t),this._setupListeners()}updated(t){super.updated(t),this._activeSlider||(t.has("value")&&(this._localValue=this.value),t.has("low")&&(this._localLow=this.low),t.has("high")&&(this._localHigh=this.high))}connectedCallback(){super.connectedCallback(),this._setupListeners()}disconnectedCallback(){super.disconnectedCallback()}_findActiveSlider(t){var e,i;if(!this.dual)return"value";const n=Math.max(null!==(e=this._localLow)&&void 0!==e?e:this.min,this.min),o=Math.min(null!==(i=this._localHigh)&&void 0!==i?i:this.max,this.max);if(n>=t)return"low";if(o<=t)return"high";return Math.abs(t-n)<=Math.abs(t-o)?"low":"high"}_setActiveValue(t){switch(this._activeSlider){case"high":this._localHigh=t;break;case"low":this._localLow=t;break;case"value":this._localValue=t}}_getActiveValue(){switch(this._activeSlider){case"high":return this._localHigh;case"low":return this._localLow;case"value":return this._localValue}}_setupListeners(){this._interaction&&!this._mc&&(this._mc=new Do(this._interaction,{inputClass:go}),this._mc.add(new Eo({direction:Hn,enable:!0,threshold:0})),this._mc.add(new Co({event:"singletap"})),this._mc.on("pan",(t=>{t.srcEvent.stopPropagation(),t.srcEvent.preventDefault()})),this._mc.on("panstart",(t=>{var e,i;if(this.disabled)return;const n=this._getPercentageFromEvent(t),o=this._percentageToValue(n);this._activeSlider=this._findActiveSlider(o),this._lastSlider=this._activeSlider,null===(i=null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById("#slider"))||void 0===i||i.focus()})),this._mc.on("pancancel",(()=>{this.disabled||(this._activeSlider=void 0)})),this._mc.on("panmove",(t=>{if(this.disabled)return;const e=this._getPercentageFromEvent(t),i=this._percentageToValue(e),n=this._boundedValue(i);this._setActiveValue(n);const o=this._steppedValue(n);this._activeSlider&&vi(this,`${this._activeSlider}-changing`,{value:o})})),this._mc.on("panend",(t=>{if(this.disabled)return;const e=this._getPercentageFromEvent(t),i=this._percentageToValue(e),n=this._boundedValue(i),o=this._steppedValue(n);this._setActiveValue(o),this._activeSlider&&(vi(this,`${this._activeSlider}-changing`,{value:void 0}),vi(this,`${this._activeSlider}-changed`,{value:o})),this._activeSlider=void 0})),this._mc.on("singletap",(t=>{var e,i;if(this.disabled)return;const n=this._getPercentageFromEvent(t),o=this._percentageToValue(n);this._activeSlider=this._findActiveSlider(o);const s=this._boundedValue(o),r=this._steppedValue(s);this._setActiveValue(r),this._activeSlider&&(vi(this,`${this._activeSlider}-changing`,{value:void 0}),vi(this,`${this._activeSlider}-changed`,{value:r})),this._lastSlider=this._activeSlider,null===(i=null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById("#slider"))||void 0===i||i.focus(),this._activeSlider=void 0})))}get _tenPercentStep(){return Math.max(this.step,(this.max-this.min)/10)}_handleKeyDown(t){var e,i,n;if(!Wo.has(t.code))return;t.preventDefault(),this._lastSlider&&(null===(i=null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById(this._lastSlider))||void 0===i||i.focus()),this._activeSlider=null!==(n=this._lastSlider)&&void 0!==n?n:t.currentTarget.id,this._lastSlider=void 0;const o=this._getActiveValue();switch(t.code){case"ArrowRight":case"ArrowUp":this._setActiveValue(this._boundedValue((null!=o?o:this.min)+this.step));break;case"ArrowLeft":case"ArrowDown":this._setActiveValue(this._boundedValue((null!=o?o:this.min)-this.step));break;case"PageUp":this._setActiveValue(this._steppedValue(this._boundedValue((null!=o?o:this.min)+this._tenPercentStep)));break;case"PageDown":this._setActiveValue(this._steppedValue(this._boundedValue((null!=o?o:this.min)-this._tenPercentStep)));break;case"Home":this._setActiveValue(this._boundedValue(this.min));break;case"End":this._setActiveValue(this._boundedValue(this.max))}vi(this,`${this._activeSlider}-changing`,{value:this._getActiveValue()}),this._activeSlider=void 0}_handleKeyUp(t){Wo.has(t.code)&&(this._activeSlider=t.currentTarget.id,t.preventDefault(),vi(this,`${this._activeSlider}-changing`,{value:void 0}),vi(this,`${this._activeSlider}-changed`,{value:this._getActiveValue()}),this._activeSlider=void 0)}destroyListeners(){this._mc&&(this._mc.destroy(),this._mc=void 0)}_strokeCircleDashArc(t){return this._strokeDashArc(t,t)}_strokeDashArc(t,e){const i=this._valueToPercentage(t),n=this._valueToPercentage(e),o=290*Math.PI*Zo/360,s=Math.max((n-i)*o,0);return[`${s} ${o-s}`,`-${i*o-.5}`]}renderArc(t,e,i){var n,o;if(this.disabled)return W;const s=Xi({x:0,y:0,start:0,end:Zo,r:145}),r="end"===i?this.max:this.min,a=null!==(n=this.current)&&void 0!==n?n:r,l=null!=e?e:r,c="end"===i?l<=a:"start"===i&&a<=l,h=c?"end"===i?this._strokeDashArc(l,a):this._strokeDashArc(a,l):this._strokeCircleDashArc(l),u="full"===i?this._strokeDashArc(this.min,this.max):"end"===i?this._strokeDashArc(l,r):this._strokeDashArc(r,l),d=this._strokeCircleDashArc(l),p=null!=this.current&&this.current<=this.max&&this.current>=this.min&&(c||"full"===this.mode)?this._strokeCircleDashArc(this.current):void 0;return B` - `}render(){const t=Ki({x:0,y:0,start:0,end:Wo,r:145}),e=this.dual?this._localLow:this._localValue,i=this._localHigh,n=this.current,o=n?this._strokeCircleDashArc(n):void 0;return U` + `}render(){const t=Xi({x:0,y:0,start:0,end:Zo,r:145}),e=this.dual?this._localLow:this._localValue,i=this._localHigh,n=this.current,o=n?this._strokeCircleDashArc(n):void 0;return U` {let n;const o=(...o)=>{const s=i&&!n;clearTimeout(n),n=window.setTimeout((()=>{n=void 0,i||t(...o)}),e),s&&t(...o)};return o.cancel=()=>{clearTimeout(n)},o})((t=>this._callService(t)),1e3),this._init=!0,this._firstRender=!0,this._ignore=!1,this._hasWindow=!1,this._hasWindowByPass=!1,this._hasPresence=!1,this._hasMotion=!1,this._hasOverpowering=!1,this._oldValueMin=0,this._oldValueMax=0,this._display_bottom=0,this._display_top=0,this.modes=[],this.presets=[],this.security_state={},this.power_infos={},this.error=[],this.render=()=>{var t,e,i,n,o,s,r,a,l,c,h,u,d,p,m,v,_,f,g,y;return U` + `}};t([dt({type:Boolean,reflect:!0})],qo.prototype,"disabled",void 0),t([dt({type:Boolean})],qo.prototype,"dual",void 0),t([dt({type:String})],qo.prototype,"mode",void 0),t([dt({type:Boolean})],qo.prototype,"inactive",void 0),t([dt({type:String})],qo.prototype,"label",void 0),t([dt({type:String,attribute:"low-label"})],qo.prototype,"lowLabel",void 0),t([dt({type:String,attribute:"high-label"})],qo.prototype,"highLabel",void 0),t([dt({type:Number})],qo.prototype,"value",void 0),t([dt({type:Number})],qo.prototype,"low",void 0),t([dt({type:Number})],qo.prototype,"high",void 0),t([dt({type:Number})],qo.prototype,"current",void 0),t([dt({type:Number})],qo.prototype,"step",void 0),t([dt({type:Number})],qo.prototype,"min",void 0),t([dt({type:Number})],qo.prototype,"max",void 0),t([pt()],qo.prototype,"_localValue",void 0),t([pt()],qo.prototype,"_localLow",void 0),t([pt()],qo.prototype,"_localHigh",void 0),t([pt()],qo.prototype,"_activeSlider",void 0),t([pt()],qo.prototype,"_lastSlider",void 0),t([vt("#slider")],qo.prototype,"_slider",void 0),t([vt("#interaction")],qo.prototype,"_interaction",void 0),qo=t([ct("vt-ha-control-circular-slider")],qo);const Yo="unavailable",Xo={auto:"M18,11V12.5C21.19,12.5 23.09,16.05 21.33,18.71L20.24,17.62C21.06,15.96 19.85,14 18,14V15.5L15.75,13.25L18,11M18,22V20.5C14.81,20.5 12.91,16.95 14.67,14.29L15.76,15.38C14.94,17.04 16.15,19 18,19V17.5L20.25,19.75L18,22M19,3H18V1H16V3H8V1H6V3H5A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H14C13.36,20.45 12.86,19.77 12.5,19H5V8H19V10.59C19.71,10.7 20.39,10.94 21,11.31V5A2,2 0 0,0 19,3Z",heat_cool:"M12,6V9L16,5L12,1V4A8,8 0 0,0 4,12C4,13.57 4.46,15.03 5.24,16.26L6.7,14.8C6.25,13.97 6,13 6,12A6,6 0 0,1 12,6M18.76,7.74L17.3,9.2C17.74,10.04 18,11 18,12A6,6 0 0,1 12,18V15L8,19L12,23V20A8,8 0 0,0 20,12C20,10.43 19.54,8.97 18.76,7.74Z",heat:"M17.66 11.2C17.43 10.9 17.15 10.64 16.89 10.38C16.22 9.78 15.46 9.35 14.82 8.72C13.33 7.26 13 4.85 13.95 3C13 3.23 12.17 3.75 11.46 4.32C8.87 6.4 7.85 10.07 9.07 13.22C9.11 13.32 9.15 13.42 9.15 13.55C9.15 13.77 9 13.97 8.8 14.05C8.57 14.15 8.33 14.09 8.14 13.93C8.08 13.88 8.04 13.83 8 13.76C6.87 12.33 6.69 10.28 7.45 8.64C5.78 10 4.87 12.3 5 14.47C5.06 14.97 5.12 15.47 5.29 15.97C5.43 16.57 5.7 17.17 6 17.7C7.08 19.43 8.95 20.67 10.96 20.92C13.1 21.19 15.39 20.8 17.03 19.32C18.86 17.66 19.5 15 18.56 12.72L18.43 12.46C18.22 12 17.66 11.2 17.66 11.2M14.5 17.5C14.22 17.74 13.76 18 13.4 18.1C12.28 18.5 11.16 17.94 10.5 17.28C11.69 17 12.4 16.12 12.61 15.23C12.78 14.43 12.46 13.77 12.33 13C12.21 12.26 12.23 11.63 12.5 10.94C12.69 11.32 12.89 11.7 13.13 12C13.9 13 15.11 13.44 15.37 14.8C15.41 14.94 15.43 15.08 15.43 15.23C15.46 16.05 15.1 16.95 14.5 17.5H14.5Z",cool:"M20.79,13.95L18.46,14.57L16.46,13.44V10.56L18.46,9.43L20.79,10.05L21.31,8.12L19.54,7.65L20,5.88L18.07,5.36L17.45,7.69L15.45,8.82L13,7.38V5.12L14.71,3.41L13.29,2L12,3.29L10.71,2L9.29,3.41L11,5.12V7.38L8.5,8.82L6.5,7.69L5.92,5.36L4,5.88L4.47,7.65L2.7,8.12L3.22,10.05L5.55,9.43L7.55,10.56V13.45L5.55,14.58L3.22,13.96L2.7,15.89L4.47,16.36L4,18.12L5.93,18.64L6.55,16.31L8.55,15.18L11,16.62V18.88L9.29,20.59L10.71,22L12,20.71L13.29,22L14.7,20.59L13,18.88V16.62L15.5,15.17L17.5,16.3L18.12,18.63L20,18.12L19.53,16.35L21.3,15.88L20.79,13.95M9.5,10.56L12,9.11L14.5,10.56V13.44L12,14.89L9.5,13.44V10.56Z",off:"M16.56,5.44L15.11,6.89C16.84,7.94 18,9.83 18,12A6,6 0 0,1 12,18A6,6 0 0,1 6,12C6,9.83 7.16,7.94 8.88,6.88L7.44,5.44C5.36,6.88 4,9.28 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12C20,9.28 18.64,6.88 16.56,5.44M13,3H11V13H13",fan_only:"M12,11A1,1 0 0,0 11,12A1,1 0 0,0 12,13A1,1 0 0,0 13,12A1,1 0 0,0 12,11M12.5,2C17,2 17.11,5.57 14.75,6.75C13.76,7.24 13.32,8.29 13.13,9.22C13.61,9.42 14.03,9.73 14.35,10.13C18.05,8.13 22.03,8.92 22.03,12.5C22.03,17 18.46,17.1 17.28,14.73C16.78,13.74 15.72,13.3 14.79,13.11C14.59,13.59 14.28,14 13.88,14.34C15.87,18.03 15.08,22 11.5,22C7,22 6.91,18.42 9.27,17.24C10.25,16.75 10.69,15.71 10.89,14.79C10.4,14.59 9.97,14.27 9.65,13.87C5.96,15.85 2,15.07 2,11.5C2,7 5.56,6.89 6.74,9.26C7.24,10.25 8.29,10.68 9.22,10.87C9.41,10.39 9.73,9.97 10.14,9.65C8.15,5.96 8.94,2 12.5,2Z",dry:Ct,window_open:kt,windowBypass:Lt,presence:wt,motion:xt,eco:"M17,8C8,10 5.9,16.17 3.82,21.34L5.71,22L6.66,19.7C7.14,19.87 7.64,20 8,20C19,20 22,3 22,3C21,5 14,5.25 9,6.25C4,7.25 2,11.5 2,13.5C2,15.5 3.75,17.25 3.75,17.25C7,8 17,8 17,8Z",comfort:"M12.5 7C12.5 5.89 13.39 5 14.5 5H18C19.1 5 20 5.9 20 7V9.16C18.84 9.57 18 10.67 18 11.97V14H12.5V7M6 11.96V14H11.5V7C11.5 5.89 10.61 5 9.5 5H6C4.9 5 4 5.9 4 7V9.15C5.16 9.56 6 10.67 6 11.96M20.66 10.03C19.68 10.19 19 11.12 19 12.12V15H5V12C5 10.9 4.11 10 3 10S1 10.9 1 12V17C1 18.1 1.9 19 3 19V21H5V19H19V21H21V19C22.1 19 23 18.1 23 17V12C23 10.79 21.91 9.82 20.66 10.03Z",boost:"M13.13 22.19L11.5 18.36C13.07 17.78 14.54 17 15.9 16.09L13.13 22.19M5.64 12.5L1.81 10.87L7.91 8.1C7 9.46 6.22 10.93 5.64 12.5M21.61 2.39C21.61 2.39 16.66 .269 11 5.93C8.81 8.12 7.5 10.53 6.65 12.64C6.37 13.39 6.56 14.21 7.11 14.77L9.24 16.89C9.79 17.45 10.61 17.63 11.36 17.35C13.5 16.53 15.88 15.19 18.07 13C23.73 7.34 21.61 2.39 21.61 2.39M14.54 9.46C13.76 8.68 13.76 7.41 14.54 6.63S16.59 5.85 17.37 6.63C18.14 7.41 18.15 8.68 17.37 9.46C16.59 10.24 15.32 10.24 14.54 9.46M8.88 16.53L7.47 15.12L8.88 16.53M6.24 22L9.88 18.36C9.54 18.27 9.21 18.12 8.91 17.91L4.83 22H6.24M2 22H3.41L8.18 17.24L6.76 15.83L2 20.59V22M2 19.17L6.09 15.09C5.88 14.79 5.73 14.47 5.64 14.12L2 17.76V19.17Z",activity:xt,power:"M12 3L2 12H5V20H19V12H22L12 3M11.5 18V14H9L12.5 7V11H15L11.5 18Z",flashAlert:bt,temperature:"M15 13V5A3 3 0 0 0 9 5V13A5 5 0 1 0 15 13M12 4A1 1 0 0 1 13 5V8H11V5A1 1 0 0 1 12 4Z",humidity:Ct,ok:yt,thermometerAlert:At,none:"M23 17C23 20.31 20.31 23 17 23V21.5C19.5 21.5 21.5 19.5 21.5 17H23M1 7C1 3.69 3.69 1 7 1V2.5C4.5 2.5 2.5 4.5 2.5 7H1M8 4.32L3.41 8.92C.19 12.14 .19 17.37 3.41 20.59S11.86 23.81 15.08 20.59L22.15 13.5C22.64 13.03 22.64 12.24 22.15 11.75C21.66 11.26 20.87 11.26 20.38 11.75L15.96 16.17L15.25 15.46L21.79 8.92C22.28 8.43 22.28 7.64 21.79 7.15S20.5 6.66 20 7.15L14.19 13L13.5 12.27L20.37 5.38C20.86 4.89 20.86 4.1 20.37 3.61S19.09 3.12 18.6 3.61L11.71 10.5L11 9.8L16.5 4.32C17 3.83 17 3.04 16.5 2.55S15.22 2.06 14.73 2.55L7.11 10.17C8.33 11.74 8.22 14 6.78 15.45L6.07 14.74C7.24 13.57 7.24 11.67 6.07 10.5L5.72 10.15L9.79 6.08C10.28 5.59 10.28 4.8 9.79 4.31C9.29 3.83 8.5 3.83 8 4.32Z",auto_regulation_mode:$t,power_percent:$t,mean_power_cycle:"M7,2V13H10V22L17,10H13L17,2H7Z",valve_open_percent:"M22 13V21H20V19H16.58C15.81 20.76 14.05 22 12 22S8.19 20.76 7.42 19H4V21H2V13H4V15H7.43C7.93 13.85 8.85 12.93 10 12.42V11H8V9H16V11H14V12.42C15.15 12.93 16.07 13.85 16.57 15H20V13H22M17 2H7C6.45 2 6 2.45 6 3S6.45 4 7 4H10V5H11V8H13V5H14V4H17C17.55 4 18 3.55 18 3S17.55 2 17 2Z",regulated_target_temperature:"M12 14C11.7 13.6 11.4 13.3 11 13V5C11 3.3 9.7 2 8 2S5 3.3 5 5V13C2.8 14.7 2.3 17.8 4 20S8.8 22.7 11 21 13.7 16.2 12 14M9 8H7V5C7 4.5 7.5 4 8 4S9 4.5 9 5V8M18 3H16L12.8 12H14.7L15.4 10H18.6L19.3 12H21.2L18 3M15.8 8.7L17 5L18.2 8.7H15.8Z"};function Ko(t){const e=window;e.customCards=e.customCards||[],e.customCards.push(Object.assign(Object.assign({},t),{preview:!0}))}function Jo(t){const e=(new Date).getTime()-t.getTime();return Math.floor(e/6e4)}console.info("%c VersatileThermostatUI-CARD \n%c version: 0.3.0 ","color: orange; font-weight: bold; background: black","color: white; font-weight: bold; background: dimgray"),Ko({type:"versatile-thermostat-ui-card",name:"Versatile Thermostat Climate Card",description:"Card for climate entity"});let Go=class extends at{constructor(){super(),this.value={},this._selectTargetTemperature="low",this.current=0,this.humidity=0,this.min=0,this.max=35,this.step=1,this.window=!1,this.windowByPass=!1,this.presence=!1,this.motion=!1,this.overpowering=!1,this.is_device_active=!1,this.status="loading",this.mode="off",this.preset="manual",this.dragging=!1,this.name="",this.target="value",this._debouncedCallService=((t,e,i=!1)=>{let n;const o=(...o)=>{const s=i&&!n;clearTimeout(n),n=window.setTimeout((()=>{n=void 0,i||t(...o)}),e),s&&t(...o)};return o.cancel=()=>{clearTimeout(n)},o})((t=>this._callService(t)),1e3),this._init=!0,this._firstRender=!0,this._ignore=!1,this._hasWindow=!1,this._hasWindowByPass=!1,this._hasPresence=!1,this._hasMotion=!1,this._hasOverpowering=!1,this._oldValueMin=0,this._oldValueMax=0,this._display_bottom=0,this._display_top=0,this.modes=[],this.presets=[],this.security_state={},this.power_infos={},this.error=[],this.render=()=>{var t,e,i,n,o,s,r,a,l,c,h,u,d,p,m,v,_,f,g,y;return U` ${(null===(t=this._config)||void 0===t?void 0:t.disable_menu)?"":U` @@ -438,7 +438,7 @@ const Wo=270;const qo=new Set(["ArrowRight","ArrowUp","ArrowLeft","ArrowDown","P `:""} - ${null!=this.value.low&&null!=this.value.high&&this.stateObj.state!==Xo?U` + ${null!=this.value.low&&null!=this.value.high&&this.stateObj.state!==Yo?U` 0?"security_msg":""} ${this.window?"window_open":""} ${this.overpowering?"overpowering":""} ${this.presence?"presence":""} ${this.motion?"motion":""} ${this.windowByPass?"windowByPass":""} " .inactive=${this.window} @@ -472,16 +472,16 @@ const Wo=270;const qo=new Set(["ArrowRight","ArrowUp","ArrowLeft","ArrowDown","P ${this._hasWindow&&!(null===(p=this._config)||void 0===p?void 0:p.disable_window)?B` - + `:""} ${this._hasOverpowering&&!(null===(v=this._config)||void 0===v?void 0:v.disable_overpowering)?B` - + `:""} ${this._hasPresence?B` `:""} ${this._hasWindowByPass?B` - + `:""} ${this._hasMotion?B` @@ -489,21 +489,21 @@ const Wo=270;const qo=new Set(["ArrowRight","ArrowUp","ArrowLeft","ArrowDown","P - ${B`${gi(this._display_top,this.hass.locale,{minimumFractionDigits:1,maximumFractionDigits:1})}`} + ${B`${fi(this._display_top,this.hass.locale,{minimumFractionDigits:1,maximumFractionDigits:1})}`} ${B` ${this.hass.config.unit_system.temperature} `} - ${(null===(f=null==this?void 0:this.stateObj)||void 0===f?void 0:f.state)===Xo||"unknown"===(null===(g=null==this?void 0:this.stateObj)||void 0===g?void 0:g.state)?B` + ${(null===(f=null==this?void 0:this.stateObj)||void 0===f?void 0:f.state)===Yo||"unknown"===(null===(g=null==this?void 0:this.stateObj)||void 0===g?void 0:g.state)?B` ${this.hass.localize("state.default.unavailable")} `:""} ${0===this.humidity?B` - ${B`${gi(this._display_bottom,this.hass.locale,{minimumFractionDigits:1,maximumFractionDigits:1})}`} + ${B`${fi(this._display_bottom,this.hass.locale,{minimumFractionDigits:1,maximumFractionDigits:1})}`} ${B` ${this.hass.config.unit_system.temperature} @@ -513,7 +513,7 @@ const Wo=270;const qo=new Set(["ArrowRight","ArrowUp","ArrowLeft","ArrowDown","P ${this._renderHVACAction()} `:B` - ${B`${gi(this._display_bottom,this.hass.locale,{minimumFractionDigits:1,maximumFractionDigits:1})}`} + ${B`${fi(this._display_bottom,this.hass.locale,{minimumFractionDigits:1,maximumFractionDigits:1})}`} ${B` ${this.hass.config.unit_system.temperature} @@ -521,12 +521,12 @@ const Wo=270;const qo=new Set(["ArrowRight","ArrowUp","ArrowLeft","ArrowDown","P - ${B`${gi(this.humidity,this.hass.locale,{minimumFractionDigits:1,maximumFractionDigits:1})}`} + ${B`${fi(this.humidity,this.hass.locale,{minimumFractionDigits:1,maximumFractionDigits:1})}`} % - ${this._renderHVACAction(!0)} + ${this._renderHVACAction()} `} @@ -574,18 +574,18 @@ const Wo=270;const qo=new Set(["ArrowRight","ArrowUp","ArrowLeft","ArrowDown","P - `}}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback()}static async getConfigElement(){return await Promise.resolve().then((function(){return rs})),document.createElement("versatile-thermostat-ui-card-editor")}static async getStubConfig(t){const e=Object.keys(t.states).filter((t=>["climate"].includes(t.split(".")[0]))),i=e.filter((e=>{var i;return null===(i=t.states[e].attributes)||void 0===i?void 0:i.call_for_heat}));return{type:"custom:versatile-thermostat-ui-card",entity:i[0]||e[0]}}_highChanged(t){const e=t.detail.value;if(isNaN(e))return;const i=t.type.replace("-changed","");this.value=Object.assign(Object.assign({},this.value),{[i]:e}),this._selectTargetTemperature=i,this._callService(i)}_highChanging(t){const e=t.detail.value;if(isNaN(e))return;const i=t.type.replace("-changing","");this.value=Object.assign(Object.assign({},this.value),{[i]:e}),this._selectTargetTemperature=i,this._updateDisplay(),this._vibrate(20)}_callService(t){"high"!==t&&"low"!==t?this.hass.callService("climate","set_temperature",{entity_id:this.stateObj.entity_id,temperature:this.value.value}):this.hass.callService("climate","set_temperature",{entity_id:this.stateObj.entity_id,target_temp_low:this.value.low,target_temp_high:this.value.high})}_handleButton(t){var e;const i=t.currentTarget.target,n=t.currentTarget.step,o="high"===i?this.max:this.min;let s=null!==(e=this.value[i])&&void 0!==e?e:o;s+=n,s=fi(s,this.min,this.max),"high"===i&&null!=this.value.low&&(s=fi(s,this.value.low,this.max)),"low"===i&&null!=this.value.high&&(s=fi(s,this.min,this.value.high)),this.value=Object.assign(Object.assign({},this.value),{[i]:s}),this._updateDisplay(),this._vibrate(40),this._debouncedCallService(i)}_handleSelectTemp(t){const e=t.currentTarget.target;this._selectTargetTemperature=e,this._updateDisplay(),this._vibrate(40)}setConfig(t){this._config=Object.assign({tap_action:{action:"toggle"},hold_action:{action:"more-info"}},t)}getCardSize(){return 1}_vibrate(t){try{navigator.vibrate(t)}catch(t){}}firstUpdated(t){this._init=!1}shouldUpdate(t){return void 0!==t.has("_config")&&void 0!==t.get("_config")&&(this._hasOverpowering=!1,this._hasWindow=!1,this._hasWindowByPass=!1,this._hasMotion=!1,this._hasPresence=!1,this.humidity=0),void 0!==t.get("hass")&&(this._init=!1),!0}updated(t){var e,i;super.updated(t),this._firstRender=!1,null===(i=null===(e=null==this?void 0:this.shadowRoot)||void 0===e?void 0:e.querySelector(".security"))||void 0===i||i.addEventListener("click",(()=>{var t,e,i,n;null===(e=null===(t=null==this?void 0:this.shadowRoot)||void 0===t?void 0:t.querySelector(".security"))||void 0===e||e.remove(),null===(n=null===(i=null==this?void 0:this.shadowRoot)||void 0===i?void 0:i.querySelector(".content"))||void 0===n||n.classList.remove("security_msg"),this._vibrate(2)}))}willUpdate(t){var e,i;if(!this.hass||!this._config||!t.has("hass")&&!t.has("_config"))return;const n=this._config.entity,o=this.hass.states[n];if(!o)return;const s=t.get("hass");if(!s||s.states[n]!==o){if(!this._config||!this.hass||!this._config.entity)return;this.stateObj=o;const t=this.stateObj.attributes,n=this.stateObj.state;if(this.name="",this._config.disable_name||(this.name=this._config.name?this._config.name:t.friendly_name),this.mode=n||"off",t.hvac_modes&&(this.modes=Object.values(t.hvac_modes)),t.preset_modes&&(this.presets=Object.values(t.preset_modes.filter((t=>"none"!=t)))),this.preset=t.preset_mode,this.value={value:(null==t?void 0:t.temperature)||0,low:(null==t?void 0:t.target_temp_low)||null,high:(null==t?void 0:t.target_temp_high)||null},t.target_temp_step&&(this.step=t.target_temp_step),t.min_temp&&(this.min=t.min_temp),t.max_temp&&(this.max=t.max_temp),t.current_temperature&&(this.current=t.current_temperature),void 0!==(null==t?void 0:t.humidity)&&(this.humidity=parseFloat(t.humidity)),"on"===(null==t?void 0:t.window_state)||!0===(null==t?void 0:t.window_auto_state)?(this._hasWindow=!0,this.window=!0):(this._hasWindow=!1,this.window=!1),(null==t?void 0:t.overpowering_state)?(this._hasOverpowering=!0,this.overpowering=t.overpowering_state):(this._hasOverpowering=!1,this.overpowering=!1),"on"===(null==t?void 0:t.presence_state)?(this._hasPresence=!0,this.presence=t.presence_state):(this._hasPresence=!1,this.presence=!1),"on"===(null==t?void 0:t.motion_state)?(this._hasMotion=!0,this.motion=t.motion_state):(this._hasMotion=!1,this.motion=!1),(null==t?void 0:t.window_bypass_state)?(this._hasWindowByPass=!0,this.windowByPass=t.window_bypass_state):(this._hasWindowByPass=!1,this.windowByPass=!1),(null==t?void 0:t.security_state)&&!(null===(e=null==this?void 0:this._config)||void 0===e?void 0:e.disable_security_warning)){if(this.security_state=[],t.last_temperature_datetime){let e=Go(new Date(t.last_temperature_datetime));e>0&&this.security_state.push({name:"Internal temp.",security_msg:e+" min"})}if(t.last_ext_emperature_datetime){let e=Go(new Date(t.last_ext_temperature_datetime));e>0&&this.security_state.push({name:"External temp.",security_msg:e+" min"})}}else this.security_state=null;if(void 0!==(null==t?void 0:t.errors)){const e=JSON.parse(t.errors);e.length>0?this.error=e[0]:this.error=[]}else this.error=[];this.power_infos=[],!(null===(i=null==this?void 0:this._config)||void 0===i?void 0:i.disable_power_infos)&&(null==t?void 0:t.is_on)&&((null==t?void 0:t.is_over_switch)&&((null==t?void 0:t.mean_cycle_power)&&this.power_infos.push({name:"mean_power_cycle",value:null==t?void 0:t.mean_cycle_power,unit:(null==t?void 0:t.mean_cycle_power)<20?"kW":"W",class:"vt-power-color"}),this.power_infos.push({name:"power_percent",value:null==t?void 0:t.power_percent,unit:"%",class:"vt-power-color"})),(null==t?void 0:t.is_over_valve)&&this.power_infos.push({name:"valve_open_percent",value:null==t?void 0:t.valve_open_percent,unit:"%",class:"vt-power-color"}),(null==t?void 0:t.is_over_climate)&&((null==t?void 0:t.device_power)&&this.power_infos.push({name:"mean_power_cycle",value:null==t?void 0:t.device_power,unit:(null==t?void 0:t.device_power)<20?"kW":"W",class:"vt-power-color"}),(null==t?void 0:t.is_regulated)&&(this.power_infos.push({name:"regulated_target_temperature",value:null==t?void 0:t.regulated_target_temperature,unit:null==t?void 0:t.temperature_unit,class:"vt-temp-color"}),this.power_infos.push({name:"auto_regulation_mode",value:li({hass:this.hass,string:`extra_states.${null==t?void 0:t.auto_regulation_mode}`}),unit:"",class:"vt-label-color"})))),this._updateDisplay()}}_updateDisplay(){var t;(null===(t=null==this?void 0:this._config)||void 0===t?void 0:t.set_current_as_main)?(this._display_bottom=this._getCurrentSetpoint(),this._display_top=this.current):(this._display_bottom=this.current,this._display_top=this._getCurrentSetpoint())}_handleAction(t){this.hass.callService("climate","set_hvac_mode",{entity_id:this._config.entity,hvac_mode:t.currentTarget.mode})}_handlePreset(t){this.hass.callService("climate","set_preset_mode",{entity_id:this._config.entity,preset_mode:t.currentTarget.preset})}_handleClickInfo(t){this.hass.callService("versatile_thermostat","set_device_power",{entity_id:this._config.entity,preset_mode:t.currentTarget.preset})}_setTemperature(){this.hass.callService("climate","set_temperature",{entity_id:this._config.entity,temperature:this.value})}_getCurrentSetpoint(){var t,e,i,n,o,s,r,a;return null!==(null===(t=null==this?void 0:this.value)||void 0===t?void 0:t.high)&&null!==(null===(e=null==this?void 0:this.value)||void 0===e?void 0:e.low)?((null===(i=null==this?void 0:this.value)||void 0===i?void 0:i.low)||0)>=this.current?(null===(n=null==this?void 0:this.value)||void 0===n?void 0:n.low)||0:((null===(o=null==this?void 0:this.value)||void 0===o?void 0:o.high)||0)<=this.current?(null===(s=null==this?void 0:this.value)||void 0===s?void 0:s.high)||0:(null===(r=null==this?void 0:this.value)||void 0===r?void 0:r.low)||0:(null===(a=null==this?void 0:this.value)||void 0===a?void 0:a.value)||0}_renderHVACAction(t=!1){var e,i,n,o,s,r,a,l;return t?null===(null===(e=null==this?void 0:this.value)||void 0===e?void 0:e.low)&&null===(null===(i=null==this?void 0:this.value)||void 0===i?void 0:i.high)||((null===(n=null==this?void 0:this.value)||void 0===n?void 0:n.low)||0)>=this.current?B``:((null===(o=null==this?void 0:this.value)||void 0===o?void 0:o.high)||0)<=this.current?B``:B``:null===(null===(s=null==this?void 0:this.value)||void 0===s?void 0:s.low)&&null===(null===(r=null==this?void 0:this.value)||void 0===r?void 0:r.high)||((null===(a=null==this?void 0:this.value)||void 0===a?void 0:a.low)||0)>=this.current?B``:((null===(l=null==this?void 0:this.value)||void 0===l?void 0:l.high)||0)<=this.current?B``:B``}_renderIcon(t,e){if(!Ko[t])return U``;const i=this.hass.localize(`component.climate.state._.${t}`)||li({hass:this.hass,string:`extra_states.${t}`});return U` + `}}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback()}static async getConfigElement(){return await Promise.resolve().then((function(){return ss})),document.createElement("versatile-thermostat-ui-card-editor")}static async getStubConfig(t){const e=Object.keys(t.states).filter((t=>["climate"].includes(t.split(".")[0]))),i=e.filter((e=>{var i;return null===(i=t.states[e].attributes)||void 0===i?void 0:i.call_for_heat}));return{type:"custom:versatile-thermostat-ui-card",entity:i[0]||e[0]}}_highChanged(t){const e=t.detail.value;if(isNaN(e))return;const i=t.type.replace("-changed","");this.value=Object.assign(Object.assign({},this.value),{[i]:e}),this._selectTargetTemperature=i,this._callService(i)}_highChanging(t){const e=t.detail.value;if(isNaN(e))return;const i=t.type.replace("-changing","");this.value=Object.assign(Object.assign({},this.value),{[i]:e}),this._selectTargetTemperature=i,this._updateDisplay(),this._vibrate(20)}_callService(t){"high"!==t&&"low"!==t?this.hass.callService("climate","set_temperature",{entity_id:this.stateObj.entity_id,temperature:this.value.value}):this.hass.callService("climate","set_temperature",{entity_id:this.stateObj.entity_id,target_temp_low:this.value.low,target_temp_high:this.value.high})}_handleButton(t){var e;const i=t.currentTarget.target,n=t.currentTarget.step,o="high"===i?this.max:this.min;let s=null!==(e=this.value[i])&&void 0!==e?e:o;s+=n,s=_i(s,this.min,this.max),"high"===i&&null!=this.value.low&&(s=_i(s,this.value.low,this.max)),"low"===i&&null!=this.value.high&&(s=_i(s,this.min,this.value.high)),this.value=Object.assign(Object.assign({},this.value),{[i]:s}),this._updateDisplay(),this._vibrate(40),this._debouncedCallService(i)}_handleSelectTemp(t){const e=t.currentTarget.target;this._selectTargetTemperature=e,this._updateDisplay(),this._vibrate(40)}setConfig(t){this._config=Object.assign({tap_action:{action:"toggle"},hold_action:{action:"more-info"}},t)}getCardSize(){return 1}_vibrate(t){try{navigator.vibrate(t)}catch(t){}}firstUpdated(t){this._init=!1}shouldUpdate(t){return void 0!==t.has("_config")&&void 0!==t.get("_config")&&(this._hasOverpowering=!1,this._hasWindow=!1,this._hasWindowByPass=!1,this._hasMotion=!1,this._hasPresence=!1,this.humidity=0),void 0!==t.get("hass")&&(this._init=!1),!0}updated(t){var e,i;super.updated(t),this._firstRender=!1,null===(i=null===(e=null==this?void 0:this.shadowRoot)||void 0===e?void 0:e.querySelector(".security"))||void 0===i||i.addEventListener("click",(()=>{var t,e,i,n;null===(e=null===(t=null==this?void 0:this.shadowRoot)||void 0===t?void 0:t.querySelector(".security"))||void 0===e||e.remove(),null===(n=null===(i=null==this?void 0:this.shadowRoot)||void 0===i?void 0:i.querySelector(".content"))||void 0===n||n.classList.remove("security_msg"),this._vibrate(2)}))}willUpdate(t){var e,i;if(!this.hass||!this._config||!t.has("hass")&&!t.has("_config"))return;const n=this._config.entity,o=this.hass.states[n];if(!o)return;const s=t.get("hass");if(!s||s.states[n]!==o){if(!this._config||!this.hass||!this._config.entity)return;this.stateObj=o;const t=this.stateObj.attributes,n=this.stateObj.state;if(this.name="",this._config.disable_name||(this.name=this._config.name?this._config.name:t.friendly_name),this.mode=n||"off",t.hvac_modes&&(this.modes=Object.values(t.hvac_modes)),t.preset_modes&&(this.presets=Object.values(t.preset_modes.filter((t=>"none"!=t)))),this.preset=t.preset_mode,this.value={value:(null==t?void 0:t.temperature)||0,low:(null==t?void 0:t.target_temp_low)||null,high:(null==t?void 0:t.target_temp_high)||null},t.target_temp_step&&(this.step=t.target_temp_step),t.min_temp&&(this.min=t.min_temp),t.max_temp&&(this.max=t.max_temp),t.current_temperature&&(this.current=t.current_temperature),void 0!==(null==t?void 0:t.humidity)&&(this.humidity=parseFloat(t.humidity)),"on"===(null==t?void 0:t.window_state)||"on"===(null==t?void 0:t.window_auto_state)?(this._hasWindow=!0,this.window=!0):(this._hasWindow=!1,this.window=!1),(null==t?void 0:t.overpowering_state)?(this._hasOverpowering=!0,this.overpowering=t.overpowering_state):(this._hasOverpowering=!1,this.overpowering=!1),"on"===(null==t?void 0:t.presence_state)?(this._hasPresence=!0,this.presence=t.presence_state):(this._hasPresence=!1,this.presence=!1),"on"===(null==t?void 0:t.motion_state)?(this._hasMotion=!0,this.motion=t.motion_state):(this._hasMotion=!1,this.motion=!1),(null==t?void 0:t.window_bypass_state)?(this._hasWindowByPass=!0,this.windowByPass=t.window_bypass_state):(this._hasWindowByPass=!1,this.windowByPass=!1),(null==t?void 0:t.security_state)&&!(null===(e=null==this?void 0:this._config)||void 0===e?void 0:e.disable_security_warning)){if(this.security_state=[],t.last_temperature_datetime){let e=Jo(new Date(t.last_temperature_datetime));e>0&&this.security_state.push({name:"Internal temp.",security_msg:e+" min"})}if(t.last_ext_emperature_datetime){let e=Jo(new Date(t.last_ext_temperature_datetime));e>0&&this.security_state.push({name:"External temp.",security_msg:e+" min"})}}else this.security_state=null;if(this.is_device_active=!0===(null==t?void 0:t.is_device_active),void 0!==(null==t?void 0:t.errors)){const e=JSON.parse(t.errors);e.length>0?this.error=e[0]:this.error=[]}else this.error=[];this.power_infos=[],!(null===(i=null==this?void 0:this._config)||void 0===i?void 0:i.disable_power_infos)&&(null==t?void 0:t.is_on)&&((null==t?void 0:t.is_over_switch)&&((null==t?void 0:t.mean_cycle_power)&&this.power_infos.push({name:"mean_power_cycle",value:null==t?void 0:t.mean_cycle_power,unit:(null==t?void 0:t.mean_cycle_power)<20?"kW":"W",class:"vt-power-color"}),this.power_infos.push({name:"power_percent",value:null==t?void 0:t.power_percent,unit:"%",class:"vt-power-color"})),(null==t?void 0:t.is_over_valve)&&this.power_infos.push({name:"valve_open_percent",value:null==t?void 0:t.valve_open_percent,unit:"%",class:"vt-power-color"}),(null==t?void 0:t.is_over_climate)&&((null==t?void 0:t.device_power)&&this.power_infos.push({name:"mean_power_cycle",value:null==t?void 0:t.device_power,unit:(null==t?void 0:t.device_power)<20?"kW":"W",class:"vt-power-color"}),(null==t?void 0:t.is_regulated)&&(this.power_infos.push({name:"regulated_target_temperature",value:null==t?void 0:t.regulated_target_temperature,unit:null==t?void 0:t.temperature_unit,class:"vt-temp-color"}),this.power_infos.push({name:"auto_regulation_mode",value:ai({hass:this.hass,string:`extra_states.${null==t?void 0:t.auto_regulation_mode}`}),unit:"",class:"vt-label-color"})))),this._updateDisplay()}}_updateDisplay(){var t;(null===(t=null==this?void 0:this._config)||void 0===t?void 0:t.set_current_as_main)?(this._display_bottom=this._getCurrentSetpoint(),this._display_top=this.current):(this._display_bottom=this.current,this._display_top=this._getCurrentSetpoint())}_handleAction(t){this.hass.callService("climate","set_hvac_mode",{entity_id:this._config.entity,hvac_mode:t.currentTarget.mode})}_handlePreset(t){this.hass.callService("climate","set_preset_mode",{entity_id:this._config.entity,preset_mode:t.currentTarget.preset})}_handleClickInfo(t){this.hass.callService("versatile_thermostat","set_device_power",{entity_id:this._config.entity,preset_mode:t.currentTarget.preset})}_setTemperature(){this.hass.callService("climate","set_temperature",{entity_id:this._config.entity,temperature:this.value})}_getCurrentSetpoint(){var t,e,i,n,o,s,r,a;return null!==(null===(t=null==this?void 0:this.value)||void 0===t?void 0:t.high)&&null!==(null===(e=null==this?void 0:this.value)||void 0===e?void 0:e.low)?((null===(i=null==this?void 0:this.value)||void 0===i?void 0:i.low)||0)>=this.current?(null===(n=null==this?void 0:this.value)||void 0===n?void 0:n.low)||0:((null===(o=null==this?void 0:this.value)||void 0===o?void 0:o.high)||0)<=this.current?(null===(s=null==this?void 0:this.value)||void 0===s?void 0:s.high)||0:(null===(r=null==this?void 0:this.value)||void 0===r?void 0:r.low)||0:(null===(a=null==this?void 0:this.value)||void 0===a?void 0:a.value)||0}_renderHVACAction(){return"heating"===this.stateObj.attributes.hvac_action||"heat"==this.stateObj.attributes.hvac_mode||"heat_cool"==this.stateObj.attributes.hvac_mode?B``:"cooling"===this.stateObj.attributes.hvac_action||"cool"==this.stateObj.attributes.hvac_mode?B``:B``}_renderIcon(t,e){if(!Xo[t])return U``;const i=this.hass.localize(`component.climate.state._.${t}`)||ai({hass:this.hass,string:`extra_states.${t}`});return U` - `}_renderPreset(t,e){const i=this.hass.localize(`component.climate.state._.${t}`)||li({hass:this.hass,string:`extra_states.${t}`});return U` + `}_renderPreset(t,e){const i=this.hass.localize(`component.climate.state._.${t}`)||ai({hass:this.hass,string:`extra_states.${t}`});return U`
- `}_renderPowerInfo(t){const e=this.hass.localize(`component.climate.state._.${t.name}`)||li({hass:this.hass,string:`extra_states.${t.name}`});return U` + `}_renderPowerInfo(t){const e=this.hass.localize(`component.climate.state._.${t.name}`)||ai({hass:this.hass,string:`extra_states.${t.name}`});return U`
${t.value} ${t.unit}
- `}_handleMoreInfo(){_i(this,"hass-more-info",{entityId:this._config.entity})}};Qo.styles=r` + `}_handleMoreInfo(){vi(this,"hass-more-info",{entityId:this._config.entity})}};Go.styles=r` :host { display: block; box-sizing: border-box; @@ -968,35 +968,30 @@ const Wo=270;const qo=new Set(["ArrowRight","ArrowUp","ArrowLeft","ArrowDown","P } .window { transition: fill 0.3s ease; - fill: var(--disabled-text-color); + fill: var(--warning-color); } .overpowering { transition: fill 0.3s ease; - fill: var(--label-badge-red); + fill: var(--error-color); } .presence { transition: fill 0.3s ease; - fill: var(--label-badge-green); + fill: var(--success-color); } .motion { transition: fill 0.3s ease; - fill: var(--label-badge-blue); + fill: var(--info-color); } .windowByPass { transition: fill 0.3s ease; - fill: var(--label-badge-yellow); + fill: var(--accent-color); } line { stroke: var(--disabled-text-color); } - .overpowering.active { - fill: var(--label-badge-red); - } - .window.active { - fill: #80a7c4; - } + ha-icon-button[title="eco"] { --mode-color: var(--energy-non-fossil-color) !important; } @@ -1016,7 +1011,7 @@ const Wo=270;const qo=new Set(["ArrowRight","ArrowUp","ArrowLeft","ArrowDown","P padding-top: 2em; } } - `,t([dt({attribute:!1})],Qo.prototype,"hass",void 0),t([dt({type:Number})],Qo.prototype,"value",void 0),t([pt()],Qo.prototype,"_selectTargetTemperature",void 0),t([dt({type:Number})],Qo.prototype,"current",void 0),t([dt({type:Number})],Qo.prototype,"humidity",void 0),t([dt({type:Number})],Qo.prototype,"min",void 0),t([dt({type:Number})],Qo.prototype,"max",void 0),t([dt({type:Number})],Qo.prototype,"step",void 0),t([dt({type:Boolean})],Qo.prototype,"window",void 0),t([dt({type:Boolean})],Qo.prototype,"windowByPass",void 0),t([dt({type:Boolean})],Qo.prototype,"presence",void 0),t([dt({type:Boolean})],Qo.prototype,"motion",void 0),t([dt({type:Boolean})],Qo.prototype,"overpowering",void 0),t([dt({type:String})],Qo.prototype,"status",void 0),t([dt({type:String})],Qo.prototype,"mode",void 0),t([dt({type:String})],Qo.prototype,"preset",void 0),t([dt({type:Boolean,reflect:!0})],Qo.prototype,"dragging",void 0),t([dt({type:String})],Qo.prototype,"name",void 0),t([pt()],Qo.prototype,"changingHigh",void 0),t([pt()],Qo.prototype,"_config",void 0),Qo=t([ct("versatile-thermostat-ui-card")],Qo);const ts=function(...t){const e="type"===t[0].type,i=t.map((t=>t.schema)),n=Object.assign({},...i);return e?zi(n):Pi(n)}(Pi({index:Oi(Hi()),view_index:Oi(Hi()),view_layout:Si("any",(()=>!0)),type:Di()}),Pi({entity:Oi(Di()),name:Oi(Di()),icon:Oi(Di())}),Pi({disable_name:Oi(Ti()),disable_window:Oi(Ti()),disable_overpowering:Oi(Ti()),disable_eco:Oi(Ti()),disable_heat:Oi(Ti()),disable_cool:Oi(Ti()),disable_off:Oi(Ti()),disable_security_warning:Oi(Ti()),disable_power_infos:Oi(Ti()),set_current_as_main:Oi(Ti()),eco_temperature:Oi(Hi()),disable_menu:Oi(Ti()),disable_buttons:Oi(Ti())})),es=["icon_color","layout","fill_container","primary_info","secondary_info","icon_type","content_info","use_entity_picture","collapsible_controls","icon_animation"],is=t=>{var e,i;customElements.get("ha-form")&&(customElements.get("hui-action-editor")||((t,e,i,n)=>{const[o,s,r]=t.split(".",3);return Number(o)>e||Number(o)===e&&(void 0===n?Number(s)>=i:Number(s)>i)||void 0!==n&&Number(o)===e&&Number(s)===i&&Number(r)>=n})(t,2022,11))||null===(e=customElements.get("hui-button-card"))||void 0===e||e.getConfigElement(),customElements.get("ha-entity-picker")||null===(i=customElements.get("hui-entities-card"))||void 0===i||i.getConfigElement()},ns=["disable_name","disable_window","disable_overpowering","disable_heat","disable_cool","disable_off","disable_menu","disable_security_warning","disable_buttons","set_current_as_main","disable_power_infos"],os=mi((()=>[{name:"entity",selector:{entity:{domain:["climate"]}}},{name:"name",selector:{text:{}}},{type:"grid",name:"",schema:[{name:"disable_name",selector:{boolean:{}}},{name:"disable_window",selector:{boolean:{}}},{name:"disable_overpowering",selector:{boolean:{}}},{name:"disable_heat",selector:{boolean:{}}},{name:"disable_cool",selector:{boolean:{}}},{name:"disable_off",selector:{boolean:{}}},{name:"disable_menu",selector:{boolean:{}}},{name:"disable_security_warning",selector:{boolean:{}}},{name:"disable_buttons",selector:{boolean:{}}},{name:"set_current_as_main",selector:{boolean:{}}},{name:"disable_power_infos",selector:{Boolean:{}}}]}]));let ss=class extends at{constructor(){super(...arguments),this._computeLabel=t=>{const e=(i=this.hass,function(t){var e;let n=ci(t,null!==(e=null==i?void 0:i.locale.language)&&void 0!==e?e:ai);return n||(n=ci(t,ai)),null!=n?n:t});var i;return es.includes(t.name)?e(`editor.card.generic.${t.name}`):ns.includes(t.name)?e(`editor.card.climate.${t.name}`):this.hass.localize(`ui.panel.lovelace.editor.card.generic.${t.name}`)}}connectedCallback(){super.connectedCallback(),is(this.hass.connection.haVersion)}setConfig(t){Li(t,ts),this._config=t}render(){if(!this.hass||!this._config)return U``;const t=os();return U` + `,t([dt({attribute:!1})],Go.prototype,"hass",void 0),t([dt({type:Number})],Go.prototype,"value",void 0),t([pt()],Go.prototype,"_selectTargetTemperature",void 0),t([dt({type:Number})],Go.prototype,"current",void 0),t([dt({type:Number})],Go.prototype,"humidity",void 0),t([dt({type:Number})],Go.prototype,"min",void 0),t([dt({type:Number})],Go.prototype,"max",void 0),t([dt({type:Number})],Go.prototype,"step",void 0),t([dt({type:Boolean})],Go.prototype,"window",void 0),t([dt({type:Boolean})],Go.prototype,"windowByPass",void 0),t([dt({type:Boolean})],Go.prototype,"presence",void 0),t([dt({type:Boolean})],Go.prototype,"motion",void 0),t([dt({type:Boolean})],Go.prototype,"overpowering",void 0),t([dt({type:Boolean})],Go.prototype,"is_device_active",void 0),t([dt({type:String})],Go.prototype,"status",void 0),t([dt({type:String})],Go.prototype,"mode",void 0),t([dt({type:String})],Go.prototype,"preset",void 0),t([dt({type:Boolean,reflect:!0})],Go.prototype,"dragging",void 0),t([dt({type:String})],Go.prototype,"name",void 0),t([pt()],Go.prototype,"changingHigh",void 0),t([pt()],Go.prototype,"_config",void 0),Go=t([ct("versatile-thermostat-ui-card")],Go);const Qo=function(...t){const e="type"===t[0].type,i=t.map((t=>t.schema)),n=Object.assign({},...i);return e?Di(n):Hi(n)}(Hi({index:Pi(Mi()),view_index:Pi(Mi()),view_layout:Ei("any",(()=>!0)),type:Oi()}),Hi({entity:Pi(Oi()),name:Pi(Oi()),icon:Pi(Oi())}),Hi({disable_name:Pi(Vi()),disable_window:Pi(Vi()),disable_overpowering:Pi(Vi()),disable_eco:Pi(Vi()),disable_heat:Pi(Vi()),disable_cool:Pi(Vi()),disable_off:Pi(Vi()),disable_security_warning:Pi(Vi()),disable_power_infos:Pi(Vi()),set_current_as_main:Pi(Vi()),eco_temperature:Pi(Mi()),disable_menu:Pi(Vi()),disable_buttons:Pi(Vi())})),ts=["icon_color","layout","fill_container","primary_info","secondary_info","icon_type","content_info","use_entity_picture","collapsible_controls","icon_animation"],es=t=>{var e,i;customElements.get("ha-form")&&(customElements.get("hui-action-editor")||((t,e,i,n)=>{const[o,s,r]=t.split(".",3);return Number(o)>e||Number(o)===e&&(void 0===n?Number(s)>=i:Number(s)>i)||void 0!==n&&Number(o)===e&&Number(s)===i&&Number(r)>=n})(t,2022,11))||null===(e=customElements.get("hui-button-card"))||void 0===e||e.getConfigElement(),customElements.get("ha-entity-picker")||null===(i=customElements.get("hui-entities-card"))||void 0===i||i.getConfigElement()},is=["disable_name","disable_window","disable_overpowering","disable_heat","disable_cool","disable_off","disable_menu","disable_security_warning","disable_buttons","set_current_as_main","disable_power_infos"],ns=pi((()=>[{name:"entity",selector:{entity:{domain:["climate"]}}},{name:"name",selector:{text:{}}},{type:"grid",name:"",schema:[{name:"disable_name",selector:{boolean:{}}},{name:"disable_window",selector:{boolean:{}}},{name:"disable_overpowering",selector:{boolean:{}}},{name:"disable_heat",selector:{boolean:{}}},{name:"disable_cool",selector:{boolean:{}}},{name:"disable_off",selector:{boolean:{}}},{name:"disable_menu",selector:{boolean:{}}},{name:"disable_security_warning",selector:{boolean:{}}},{name:"disable_buttons",selector:{boolean:{}}},{name:"set_current_as_main",selector:{boolean:{}}},{name:"disable_power_infos",selector:{Boolean:{}}}]}]));let os=class extends at{constructor(){super(...arguments),this._computeLabel=t=>{const e=(i=this.hass,function(t){var e;let n=li(t,null!==(e=null==i?void 0:i.locale.language)&&void 0!==e?e:ri);return n||(n=li(t,ri)),null!=n?n:t});var i;return ts.includes(t.name)?e(`editor.card.generic.${t.name}`):is.includes(t.name)?e(`editor.card.climate.${t.name}`):this.hass.localize(`ui.panel.lovelace.editor.card.generic.${t.name}`)}}connectedCallback(){super.connectedCallback(),es(this.hass.connection.haVersion)}setConfig(t){ki(t,Qo),this._config=t}render(){if(!this.hass||!this._config)return U``;const t=ns();return U` - `}_valueChanged(t){_i(this,"config-changed",{config:t.detail.value}),_i(this,"hass",{config:t.detail.value})}};t([pt()],ss.prototype,"_config",void 0),t([dt({attribute:!1})],ss.prototype,"hass",void 0),ss=t([ct("versatile-thermostat-ui-card-editor")],ss);var rs=Object.freeze({__proto__:null,get ClimateCardEditor(){return ss}});export{Qo as VersatileThermostatUi,Jo as registerCustomCard}; + `}_valueChanged(t){vi(this,"config-changed",{config:t.detail.value}),vi(this,"hass",{config:t.detail.value})}};t([pt()],os.prototype,"_config",void 0),t([dt({attribute:!1})],os.prototype,"hass",void 0),os=t([ct("versatile-thermostat-ui-card-editor")],os);var ss=Object.freeze({__proto__:null,get ClimateCardEditor(){return os}});export{Go as VersatileThermostatUi,Ko as registerCustomCard}; diff --git a/src/versatile-thermostat-ui.ts b/src/versatile-thermostat-ui.ts index 2ec7740..3b6bd52 100644 --- a/src/versatile-thermostat-ui.ts +++ b/src/versatile-thermostat-ui.ts @@ -46,7 +46,8 @@ import { mdiFlash, mdiMeterElectric, mdiThermometerAuto, - mdiPipeValve + mdiPipeValve, + mdiClose } from "@mdi/js"; import { @@ -184,6 +185,7 @@ export class VersatileThermostatUi extends LitElement implements LovelaceCard { @property({ type: Boolean }) public presence: boolean = false; @property({ type: Boolean }) public motion: boolean = false; @property({ type: Boolean }) public overpowering: boolean = false; + @property({ type: Boolean }) public is_device_active: boolean = false; @property({ type: String }) public status: string = "loading"; @property({ type: String }) public mode: string = "off"; @property({ type: String }) public preset: string = "manual"; @@ -664,35 +666,30 @@ export class VersatileThermostatUi extends LitElement implements LovelaceCard { } .window { transition: fill 0.3s ease; - fill: var(--disabled-text-color); + fill: var(--warning-color); } .overpowering { transition: fill 0.3s ease; - fill: var(--label-badge-red); + fill: var(--error-color); } .presence { transition: fill 0.3s ease; - fill: var(--label-badge-green); + fill: var(--success-color); } .motion { transition: fill 0.3s ease; - fill: var(--label-badge-blue); + fill: var(--info-color); } .windowByPass { transition: fill 0.3s ease; - fill: var(--label-badge-yellow); + fill: var(--accent-color); } line { stroke: var(--disabled-text-color); } - .overpowering.active { - fill: var(--label-badge-red); - } - .window.active { - fill: #80a7c4; - } + ha-icon-button[title="eco"] { --mode-color: var(--energy-non-fossil-color) !important; } @@ -810,7 +807,7 @@ export class VersatileThermostatUi extends LitElement implements LovelaceCard { if (attributes?.humidity !== undefined) { this.humidity = parseFloat(attributes.humidity); } - if (attributes?.window_state === 'on' || attributes?.window_auto_state === true) { + if (attributes?.window_state === 'on' || attributes?.window_auto_state === 'on') { this._hasWindow = true; this.window = true; } @@ -881,6 +878,9 @@ export class VersatileThermostatUi extends LitElement implements LovelaceCard { this.security_state = null; } + // handle is_device_active + this.is_device_active = (attributes?.is_device_active === true) + // Build Errors if (attributes?.errors !== undefined) { const errors = JSON.parse(attributes.errors); @@ -1000,22 +1000,33 @@ export class VersatileThermostatUi extends LitElement implements LovelaceCard { return this?.value?.value || 0; } - private _renderHVACAction(full = false): TemplateResult { - if (full) { - if (this?.value?.low === null && this?.value?.high === null) { - return svg``; - } - if ((this?.value?.low || 0) >= this.current) return svg``; - else if ((this?.value?.high || 0) <= this.current) return svg``; - else return svg``; - } else { - if (this?.value?.low === null && this?.value?.high === null) { - return svg``; - } - if ((this?.value?.low || 0) >= this.current) return svg``; - else if ((this?.value?.high || 0) <= this.current) return svg``; - else return svg``; + private _renderHVACAction(): TemplateResult { + if (this.stateObj.attributes.hvac_action === 'heating' || + this.stateObj.attributes.hvac_mode == "heat" || + this.stateObj.attributes.hvac_mode == "heat_cool") { + return svg``; } + else if (this.stateObj.attributes.hvac_action === 'cooling' || + this.stateObj.attributes.hvac_mode == "cool") { + return svg``; + } + else return svg``; + + // if (full) { + // if (this?.value?.low === null && this?.value?.high === null) { + // return svg``; + // } + // if ((this?.value?.low || 0) >= this.current) return svg``; + // else if ((this?.value?.high || 0) <= this.current) return svg``; + // else return svg``; + // } else { + // if (this?.value?.low === null && this?.value?.high === null) { + // return svg``; + // } + // if ((this?.value?.low || 0) >= this.current) return svg``; + // else if ((this?.value?.high || 0) <= this.current) return svg``; + // else return svg``; + // } } private _renderIcon(mode: string, currentMode: string): TemplateResult { @@ -1161,7 +1172,7 @@ export class VersatileThermostatUi extends LitElement implements LovelaceCard { ${(this._hasWindow && !this._config?.disable_window) ? svg` - + `: ``} ${(this._hasOverpowering && !this._config?.disable_overpowering) ? svg` @@ -1233,7 +1244,7 @@ export class VersatileThermostatUi extends LitElement implements LovelaceCard { % - ${this._renderHVACAction(true)} + ${this._renderHVACAction()} `}