-
Notifications
You must be signed in to change notification settings - Fork 37
/
room-card.js
2 lines (2 loc) · 64.1 KB
/
room-card.js
1
2
/*! For license information please see room-card.js.LICENSE.txt */
(()=>{"use strict";var t={313:(t,e,i)=>{i.r(e),i.d(e,{DEFAULT_DOMAIN_ICON:()=>Q,DEFAULT_PANEL:()=>X,DEFAULT_VIEW_ENTITY_ID:()=>st,DOMAINS_HIDE_MORE_INFO:()=>et,DOMAINS_MORE_INFO_NO_HISTORY:()=>it,DOMAINS_TOGGLE:()=>rt,DOMAINS_WITH_CARD:()=>Z,DOMAINS_WITH_MORE_INFO:()=>tt,NumberFormat:()=>n,STATES_OFF:()=>nt,TimeFormat:()=>r,UNIT_C:()=>ot,UNIT_F:()=>at,applyThemesOnElement:()=>F,computeCardSize:()=>R,computeDomain:()=>H,computeEntity:()=>L,computeRTL:()=>V,computeRTLDirection:()=>z,computeStateDisplay:()=>J,computeStateDomain:()=>q,createThing:()=>dt,debounce:()=>mt,domainIcon:()=>pt,evaluateFilter:()=>ft,fireEvent:()=>ct,fixedIcons:()=>ht,formatDate:()=>u,formatDateMonth:()=>v,formatDateMonthYear:()=>g,formatDateNumeric:()=>m,formatDateShort:()=>p,formatDateTime:()=>A,formatDateTimeNumeric:()=>O,formatDateTimeWithSeconds:()=>S,formatDateWeekday:()=>c,formatDateYear:()=>b,formatNumber:()=>K,formatTime:()=>k,formatTimeWeekday:()=>j,formatTimeWithSeconds:()=>N,forwardHaptic:()=>gt,getLovelace:()=>Ot,handleAction:()=>wt,handleActionConfig:()=>bt,handleClick:()=>$t,hasAction:()=>At,hasConfigOrEntityChanged:()=>Et,hasDoubleClick:()=>St,isNumericState:()=>B,navigate:()=>yt,numberFormatToLocale:()=>W,relativeTime:()=>I,round:()=>Y,stateIcon:()=>Dt,timerTimeRemaining:()=>P,toggleEntity:()=>_t,turnOnOffEntities:()=>Tt,turnOnOffEntity:()=>vt});var n,r,o,a=function(){return a=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},a.apply(this,arguments)},s={second:45,minute:45,hour:22,day:5},c=function(t,e){return l(e).format(t)},l=function(t){return new Intl.DateTimeFormat(t.language,{weekday:"long",month:"long",day:"numeric"})},u=function(t,e){return d(e).format(t)},d=function(t){return new Intl.DateTimeFormat(t.language,{year:"numeric",month:"long",day:"numeric"})},m=function(t,e){return h(e).format(t)},h=function(t){return new Intl.DateTimeFormat(t.language,{year:"numeric",month:"numeric",day:"numeric"})},p=function(t,e){return f(e).format(t)},f=function(t){return new Intl.DateTimeFormat(t.language,{day:"numeric",month:"short"})},g=function(t,e){return y(e).format(t)},y=function(t){return new Intl.DateTimeFormat(t.language,{month:"long",year:"numeric"})},v=function(t,e){return _(e).format(t)},_=function(t){return new Intl.DateTimeFormat(t.language,{month:"long"})},b=function(t,e){return w(e).format(t)},w=function(t){return new Intl.DateTimeFormat(t.language,{year:"numeric"})};(o=n||(n={})).language="language",o.system="system",o.comma_decimal="comma_decimal",o.decimal_comma="decimal_comma",o.space_comma="space_comma",o.none="none",function(t){t.language="language",t.system="system",t.am_pm="12",t.twenty_four="24"}(r||(r={}));var $=function(t){if(t.time_format===r.language||t.time_format===r.system){var e=t.time_format===r.language?t.language:void 0,i=(new Date).toLocaleString(e);return i.includes("AM")||i.includes("PM")}return t.time_format===r.am_pm},A=function(t,e){return E(e).format(t)},E=function(t){return new Intl.DateTimeFormat(t.language,{year:"numeric",month:"long",day:"numeric",hour:$(t)?"numeric":"2-digit",minute:"2-digit",hour12:$(t)})},S=function(t,e){return T(e).format(t)},T=function(t){return new Intl.DateTimeFormat(t.language,{year:"numeric",month:"long",day:"numeric",hour:$(t)?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hour12:$(t)})},O=function(t,e){return C(e).format(t)},C=function(t){return new Intl.DateTimeFormat(t.language,{year:"numeric",month:"numeric",day:"numeric",hour:"numeric",minute:"2-digit",hour12:$(t)})},k=function(t,e){return D(e).format(t)},D=function(t){return new Intl.DateTimeFormat(t.language,{hour:"numeric",minute:"2-digit",hour12:$(t)})},N=function(t,e){return x(e).format(t)},x=function(t){return new Intl.DateTimeFormat(t.language,{hour:$(t)?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hour12:$(t)})},j=function(t,e){return M(e).format(t)},M=function(t){return new Intl.DateTimeFormat(t.language,{hour:$(t)?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hour12:$(t)})},I=function(t,e,i,n){void 0===n&&(n=!0);var r=function(t,e,i){void 0===e&&(e=Date.now()),void 0===i&&(i={});var n=a(a({},s),i||{}),r=(+t-+e)/1e3;if(Math.abs(r)<n.second)return{value:Math.round(r),unit:"second"};var o=r/60;if(Math.abs(o)<n.minute)return{value:Math.round(o),unit:"minute"};var c=r/3600;if(Math.abs(c)<n.hour)return{value:Math.round(c),unit:"hour"};var l=r/86400;if(Math.abs(l)<n.day)return{value:Math.round(l),unit:"day"};var u=new Date(t),d=new Date(e),m=u.getFullYear()-d.getFullYear();if(Math.round(Math.abs(m))>0)return{value:Math.round(m),unit:"year"};var h=12*m+u.getMonth()-d.getMonth();if(Math.round(Math.abs(h))>0)return{value:Math.round(h),unit:"month"};var p=r/604800;return{value:Math.round(p),unit:"week"}}(t,i);return n?function(t){return new Intl.RelativeTimeFormat(t.language,{numeric:"auto"})}(e).format(r.value,r.unit):Intl.NumberFormat(e.language,{style:"unit",unit:r.unit,unitDisplay:"long"}).format(Math.abs(r.value))};function P(t){var e,i=3600*(e=t.attributes.remaining.split(":").map(Number))[0]+60*e[1]+e[2];if("active"===t.state){var n=(new Date).getTime(),r=new Date(t.last_changed).getTime();i=Math.max(i-(n-r)/1e3,0)}return i}function U(){return(U=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t}).apply(this,arguments)}var F=function(t,e,i,n){void 0===n&&(n=!1),t._themes||(t._themes={});var r=e.default_theme;("default"===i||i&&e.themes[i])&&(r=i);var o=U({},t._themes);if("default"!==r){var a=e.themes[r];Object.keys(a).forEach((function(e){var i="--"+e;t._themes[i]="",o[i]=a[e]}))}if(t.updateStyles?t.updateStyles(o):window.ShadyCSS&&window.ShadyCSS.styleSubtree(t,o),n){var s=document.querySelector("meta[name=theme-color]");if(s){s.hasAttribute("default-content")||s.setAttribute("default-content",s.getAttribute("content"));var c=o["--primary-color"]||s.getAttribute("default-content");s.setAttribute("content",c)}}},R=function(t){return"function"==typeof t.getCardSize?t.getCardSize():4};function H(t){return t.substr(0,t.indexOf("."))}function L(t){return t.substr(t.indexOf(".")+1)}function V(t){var e,i=(null==t||null==(e=t.locale)?void 0:e.language)||"en";return t.translationMetadata.translations[i]&&t.translationMetadata.translations[i].isRTL||!1}function z(t){return V(t)?"rtl":"ltr"}function q(t){return H(t.entity_id)}var B=function(t){return!!t.attributes.unit_of_measurement||!!t.attributes.state_class},W=function(t){switch(t.number_format){case n.comma_decimal:return["en-US","en"];case n.decimal_comma:return["de","es","it"];case n.space_comma:return["fr","sv","cs"];case n.system:return;default:return t.language}},Y=function(t,e){return void 0===e&&(e=2),Math.round(t*Math.pow(10,e))/Math.pow(10,e)},K=function(t,e,i){var r=e?W(e):void 0;if(Number.isNaN=Number.isNaN||function t(e){return"number"==typeof e&&t(e)},(null==e?void 0:e.number_format)!==n.none&&!Number.isNaN(Number(t))&&Intl)try{return new Intl.NumberFormat(r,G(t,i)).format(Number(t))}catch(e){return console.error(e),new Intl.NumberFormat(void 0,G(t,i)).format(Number(t))}return"string"==typeof t?t:Y(t,null==i?void 0:i.maximumFractionDigits).toString()+("currency"===(null==i?void 0:i.style)?" "+i.currency:"")},G=function(t,e){var i=U({maximumFractionDigits:2},e);if("string"!=typeof t)return i;if(!e||!e.minimumFractionDigits&&!e.maximumFractionDigits){var n=t.indexOf(".")>-1?t.split(".")[1].length:0;i.minimumFractionDigits=n,i.maximumFractionDigits=n}return i},J=function(t,e,i,n){var r=void 0!==n?n:e.state;if("unknown"===r||"unavailable"===r)return t("state.default."+r);if(B(e)){if("monetary"===e.attributes.device_class)try{return K(r,i,{style:"currency",currency:e.attributes.unit_of_measurement})}catch(t){}return K(r,i)+(e.attributes.unit_of_measurement?" "+e.attributes.unit_of_measurement:"")}var o=q(e);if("input_datetime"===o){var a;if(void 0===n)return e.attributes.has_date&&e.attributes.has_time?(a=new Date(e.attributes.year,e.attributes.month-1,e.attributes.day,e.attributes.hour,e.attributes.minute),A(a,i)):e.attributes.has_date?(a=new Date(e.attributes.year,e.attributes.month-1,e.attributes.day),u(a,i)):e.attributes.has_time?((a=new Date).setHours(e.attributes.hour,e.attributes.minute),k(a,i)):e.state;try{var s=n.split(" ");if(2===s.length)return A(new Date(s.join("T")),i);if(1===s.length){if(n.includes("-"))return u(new Date(n+"T00:00"),i);if(n.includes(":")){var c=new Date;return k(new Date(c.toISOString().split("T")[0]+"T"+n),i)}}return n}catch(t){return n}}return"humidifier"===o&&"on"===r&&e.attributes.humidity?e.attributes.humidity+" %":"counter"===o||"number"===o||"input_number"===o?K(r,i):e.attributes.device_class&&t("component."+o+".state."+e.attributes.device_class+"."+r)||t("component."+o+".state._."+r)||r},Q="mdi:bookmark",X="lovelace",Z=["climate","cover","configurator","input_select","input_number","input_text","lock","media_player","scene","script","timer","vacuum","water_heater","weblink"],tt=["alarm_control_panel","automation","camera","climate","configurator","cover","fan","group","history_graph","input_datetime","light","lock","media_player","script","sun","updater","vacuum","water_heater","weather"],et=["input_number","input_select","input_text","scene","weblink"],it=["camera","configurator","history_graph","scene"],nt=["closed","locked","off"],rt=new Set(["fan","input_boolean","light","switch","group","automation"]),ot="°C",at="°F",st="group.default_view",ct=function(t,e,i,n){n=n||{},i=null==i?{}:i;var r=new Event(e,{bubbles:void 0===n.bubbles||n.bubbles,cancelable:Boolean(n.cancelable),composed:void 0===n.composed||n.composed});return r.detail=i,t.dispatchEvent(r),r},lt=new Set(["call-service","divider","section","weblink","cast","select"]),ut={alert:"toggle",automation:"toggle",climate:"climate",cover:"cover",fan:"toggle",group:"group",input_boolean:"toggle",input_number:"input-number",input_select:"input-select",input_text:"input-text",light:"toggle",lock:"lock",media_player:"media-player",remote:"toggle",scene:"scene",script:"script",sensor:"sensor",timer:"timer",switch:"toggle",vacuum:"toggle",water_heater:"climate",input_datetime:"input-datetime"},dt=function(t,e){void 0===e&&(e=!1);var i=function(t,e){return n("hui-error-card",{type:"error",error:t,config:e})},n=function(t,e){var n=window.document.createElement(t);try{if(!n.setConfig)return;n.setConfig(e)}catch(n){return console.error(t,n),i(n.message,e)}return n};if(!t||"object"!=typeof t||!e&&!t.type)return i("No type defined",t);var r=t.type;if(r&&r.startsWith("custom:"))r=r.substr(7);else if(e)if(lt.has(r))r="hui-"+r+"-row";else{if(!t.entity)return i("Invalid config given.",t);var o=t.entity.split(".",1)[0];r="hui-"+(ut[o]||"text")+"-entity-row"}else r="hui-"+r+"-card";if(customElements.get(r))return n(r,t);var a=i("Custom element doesn't exist: "+t.type+".",t);a.style.display="None";var s=setTimeout((function(){a.style.display=""}),2e3);return customElements.whenDefined(t.type).then((function(){clearTimeout(s),ct(a,"ll-rebuild",{},a)})),a},mt=function(t,e,i){var n;return void 0===i&&(i=!1),function(){var r=[].slice.call(arguments),o=this,a=i&&!n;clearTimeout(n),n=setTimeout((function(){n=null,i||t.apply(o,r)}),e),a&&t.apply(o,r)}},ht={alert:"mdi:alert",automation:"mdi:playlist-play",calendar:"mdi:calendar",camera:"mdi:video",climate:"mdi:thermostat",configurator:"mdi:settings",conversation:"mdi:text-to-speech",device_tracker:"mdi:account",fan:"mdi:fan",group:"mdi:google-circles-communities",history_graph:"mdi:chart-line",homeassistant:"mdi:home-assistant",homekit:"mdi:home-automation",image_processing:"mdi:image-filter-frames",input_boolean:"mdi:drawing",input_datetime:"mdi:calendar-clock",input_number:"mdi:ray-vertex",input_select:"mdi:format-list-bulleted",input_text:"mdi:textbox",light:"mdi:lightbulb",mailbox:"mdi:mailbox",notify:"mdi:comment-alert",person:"mdi:account",plant:"mdi:flower",proximity:"mdi:apple-safari",remote:"mdi:remote",scene:"mdi:google-pages",script:"mdi:file-document",sensor:"mdi:eye",simple_alarm:"mdi:bell",sun:"mdi:white-balance-sunny",switch:"mdi:flash",timer:"mdi:timer",updater:"mdi:cloud-upload",vacuum:"mdi:robot-vacuum",water_heater:"mdi:thermometer",weblink:"mdi:open-in-new"};function pt(t,e){if(t in ht)return ht[t];switch(t){case"alarm_control_panel":switch(e){case"armed_home":return"mdi:bell-plus";case"armed_night":return"mdi:bell-sleep";case"disarmed":return"mdi:bell-outline";case"triggered":return"mdi:bell-ring";default:return"mdi:bell"}case"binary_sensor":return e&&"off"===e?"mdi:radiobox-blank":"mdi:checkbox-marked-circle";case"cover":return"closed"===e?"mdi:window-closed":"mdi:window-open";case"lock":return e&&"unlocked"===e?"mdi:lock-open":"mdi:lock";case"media_player":return e&&"off"!==e&&"idle"!==e?"mdi:cast-connected":"mdi:cast";case"zwave":switch(e){case"dead":return"mdi:emoticon-dead";case"sleeping":return"mdi:sleep";case"initializing":return"mdi:timer-sand";default:return"mdi:z-wave"}default:return console.warn("Unable to find icon for domain "+t+" ("+e+")"),"mdi:bookmark"}}var ft=function(t,e){var i=e.value||e,n=e.attribute?t.attributes[e.attribute]:t.state;switch(e.operator||"=="){case"==":return n===i;case"<=":return n<=i;case"<":return n<i;case">=":return n>=i;case">":return n>i;case"!=":return n!==i;case"regex":return n.match(i);default:return!1}},gt=function(t){ct(window,"haptic",t)},yt=function(t,e,i){void 0===i&&(i=!1),i?history.replaceState(null,"",e):history.pushState(null,"",e),ct(window,"location-changed",{replace:i})},vt=function(t,e,i){void 0===i&&(i=!0);var n,r=H(e),o="group"===r?"homeassistant":r;switch(r){case"lock":n=i?"unlock":"lock";break;case"cover":n=i?"open_cover":"close_cover";break;default:n=i?"turn_on":"turn_off"}return t.callService(o,n,{entity_id:e})},_t=function(t,e){var i=nt.includes(t.states[e].state);return vt(t,e,i)},bt=function(t,e,i,n){if(n||(n={action:"more-info"}),!n.confirmation||n.confirmation.exemptions&&n.confirmation.exemptions.some((function(t){return t.user===e.user.id}))||(gt("warning"),confirm(n.confirmation.text||"Are you sure you want to "+n.action+"?")))switch(n.action){case"more-info":(i.entity||i.camera_image)&&ct(t,"hass-more-info",{entityId:i.entity?i.entity:i.camera_image});break;case"navigate":n.navigation_path&&yt(0,n.navigation_path);break;case"url":n.url_path&&window.open(n.url_path);break;case"toggle":i.entity&&(_t(e,i.entity),gt("success"));break;case"call-service":if(!n.service)return void gt("failure");var r=n.service.split(".",2);e.callService(r[0],r[1],n.service_data,n.target),gt("success");break;case"fire-dom-event":ct(t,"ll-custom",n)}},wt=function(t,e,i,n){var r;"double_tap"===n&&i.double_tap_action?r=i.double_tap_action:"hold"===n&&i.hold_action?r=i.hold_action:"tap"===n&&i.tap_action&&(r=i.tap_action),bt(t,e,i,r)},$t=function(t,e,i,n,r){var o;if(r&&i.double_tap_action?o=i.double_tap_action:n&&i.hold_action?o=i.hold_action:!n&&i.tap_action&&(o=i.tap_action),o||(o={action:"more-info"}),!o.confirmation||o.confirmation.exemptions&&o.confirmation.exemptions.some((function(t){return t.user===e.user.id}))||confirm(o.confirmation.text||"Are you sure you want to "+o.action+"?"))switch(o.action){case"more-info":(o.entity||i.entity||i.camera_image)&&(ct(t,"hass-more-info",{entityId:o.entity?o.entity:i.entity?i.entity:i.camera_image}),o.haptic&>(o.haptic));break;case"navigate":o.navigation_path&&(yt(0,o.navigation_path),o.haptic&>(o.haptic));break;case"url":o.url_path&&window.open(o.url_path),o.haptic&>(o.haptic);break;case"toggle":i.entity&&(_t(e,i.entity),o.haptic&>(o.haptic));break;case"call-service":if(!o.service)return;var a=o.service.split(".",2),s=a[0],c=a[1],l=U({},o.service_data);"entity"===l.entity_id&&(l.entity_id=i.entity),e.callService(s,c,l,o.target),o.haptic&>(o.haptic);break;case"fire-dom-event":ct(t,"ll-custom",o),o.haptic&>(o.haptic)}};function At(t){return void 0!==t&&"none"!==t.action}function Et(t,e,i){if(e.has("config")||i)return!0;if(t.config.entity){var n=e.get("hass");return!n||n.states[t.config.entity]!==t.hass.states[t.config.entity]}return!1}function St(t){return void 0!==t&&"none"!==t.action}var Tt=function(t,e,i){void 0===i&&(i=!0);var n={};e.forEach((function(e){if(nt.includes(t.states[e].state)===i){var r=H(e),o=["cover","lock"].includes(r)?r:"homeassistant";o in n||(n[o]=[]),n[o].push(e)}})),Object.keys(n).forEach((function(e){var r;switch(e){case"lock":r=i?"unlock":"lock";break;case"cover":r=i?"open_cover":"close_cover";break;default:r=i?"turn_on":"turn_off"}t.callService(e,r,{entity_id:n[e]})}))},Ot=function(){var t=document.querySelector("home-assistant");if(t=(t=(t=(t=(t=(t=(t=(t=t&&t.shadowRoot)&&t.querySelector("home-assistant-main"))&&t.shadowRoot)&&t.querySelector("app-drawer-layout partial-panel-resolver"))&&t.shadowRoot||t)&&t.querySelector("ha-panel-lovelace"))&&t.shadowRoot)&&t.querySelector("hui-root")){var e=t.lovelace;return e.current_view=t.___curView,e}return null},Ct={humidity:"mdi:water-percent",illuminance:"mdi:brightness-5",temperature:"mdi:thermometer",pressure:"mdi:gauge",power:"mdi:flash",signal_strength:"mdi:wifi"},kt={binary_sensor:function(t,e){var i="off"===t;switch(null==e?void 0:e.attributes.device_class){case"battery":return i?"mdi:battery":"mdi:battery-outline";case"battery_charging":return i?"mdi:battery":"mdi:battery-charging";case"cold":return i?"mdi:thermometer":"mdi:snowflake";case"connectivity":return i?"mdi:server-network-off":"mdi:server-network";case"door":return i?"mdi:door-closed":"mdi:door-open";case"garage_door":return i?"mdi:garage":"mdi:garage-open";case"power":case"plug":return i?"mdi:power-plug-off":"mdi:power-plug";case"gas":case"problem":case"safety":case"tamper":return i?"mdi:check-circle":"mdi:alert-circle";case"smoke":return i?"mdi:check-circle":"mdi:smoke";case"heat":return i?"mdi:thermometer":"mdi:fire";case"light":return i?"mdi:brightness-5":"mdi:brightness-7";case"lock":return i?"mdi:lock":"mdi:lock-open";case"moisture":return i?"mdi:water-off":"mdi:water";case"motion":return i?"mdi:walk":"mdi:run";case"occupancy":case"presence":return i?"mdi:home-outline":"mdi:home";case"opening":return i?"mdi:square":"mdi:square-outline";case"running":return i?"mdi:stop":"mdi:play";case"sound":return i?"mdi:music-note-off":"mdi:music-note";case"update":return i?"mdi:package":"mdi:package-up";case"vibration":return i?"mdi:crop-portrait":"mdi:vibrate";case"window":return i?"mdi:window-closed":"mdi:window-open";default:return i?"mdi:radiobox-blank":"mdi:checkbox-marked-circle"}},cover:function(t){var e="closed"!==t.state;switch(t.attributes.device_class){case"garage":return e?"mdi:garage-open":"mdi:garage";case"door":return e?"mdi:door-open":"mdi:door-closed";case"shutter":return e?"mdi:window-shutter-open":"mdi:window-shutter";case"blind":return e?"mdi:blinds-open":"mdi:blinds";case"window":return e?"mdi:window-open":"mdi:window-closed";default:return pt("cover",t.state)}},sensor:function(t){var e=t.attributes.device_class;if(e&&e in Ct)return Ct[e];if("battery"===e){var i=Number(t.state);if(isNaN(i))return"mdi:battery-unknown";var n=10*Math.round(i/10);return n>=100?"mdi:battery":n<=0?"mdi:battery-alert":"hass:battery-"+n}var r=t.attributes.unit_of_measurement;return"°C"===r||"°F"===r?"mdi:thermometer":pt("sensor")},input_datetime:function(t){return t.attributes.has_date?t.attributes.has_time?pt("input_datetime"):"mdi:calendar":"mdi:clock"}},Dt=function(t){if(!t)return"mdi:bookmark";if(t.attributes.icon)return t.attributes.icon;var e=H(t.entity_id);return e in kt?kt[e](t):pt(e,t.state)}},22:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.actionHandler=e.actionHandlerBind=void 0;const n=i(3),r=i(41),o=i(313),a="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.maxTouchPoints>0;class s extends HTMLElement{constructor(){super(),this.holdTime=500,this.held=!1,this.ripple=document.createElement("mwc-ripple")}connectedCallback(){Object.assign(this.style,{position:"absolute",width:a?"100px":"50px",height:a?"100px":"50px",transform:"translate(-50%, -50%)",pointerEvents:"none",zIndex:"999"}),this.appendChild(this.ripple),this.ripple.primary=!0,["touchcancel","mouseout","mouseup","touchmove","mousewheel","wheel","scroll"].forEach((t=>{document.addEventListener(t,(()=>{clearTimeout(this.timer),this.stopAnimation(),this.timer=void 0}),{passive:!0})}))}bind(t,e){if(t.actionHandler)return;t.actionHandler=!0,t.addEventListener("contextmenu",(t=>{const e=t||window.event;return e.preventDefault&&e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0,e.returnValue=!1,!1}));const i=t=>{let e,i;this.held=!1,t.touches?(e=t.touches[0].pageX,i=t.touches[0].pageY):(e=t.pageX,i=t.pageY),this.timer=window.setTimeout((()=>{this.startAnimation(e,i),this.held=!0}),this.holdTime)},n=i=>{i.preventDefault(),["touchend","touchcancel"].includes(i.type)&&void 0===this.timer||(clearTimeout(this.timer),this.stopAnimation(),this.timer=void 0,this.held?(0,o.fireEvent)(t,"action",{action:"hold"}):e.hasDoubleClick?"click"===i.type&&i.detail<2||!this.dblClickTimeout?this.dblClickTimeout=window.setTimeout((()=>{this.dblClickTimeout=void 0,(0,o.fireEvent)(t,"action",{action:"tap"})}),250):(clearTimeout(this.dblClickTimeout),this.dblClickTimeout=void 0,(0,o.fireEvent)(t,"action",{action:"double_tap"})):(0,o.fireEvent)(t,"action",{action:"tap"}))};t.addEventListener("touchstart",i,{passive:!0}),t.addEventListener("touchend",n),t.addEventListener("touchcancel",n),t.addEventListener("mousedown",i,{passive:!0}),t.addEventListener("click",n),t.addEventListener("keyup",(t=>{13===t.keyCode&&n(t)}))}startAnimation(t,e){Object.assign(this.style,{left:`${t}px`,top:`${e}px`,display:null}),this.ripple.disabled=!1,this.ripple.active=!0,this.ripple.unbounded=!0}stopAnimation(){this.ripple.active=!1,this.ripple.disabled=!0,this.style.display="none"}}customElements.define("action-handler-roomcard",s),e.actionHandlerBind=(t,e)=>{const i=(()=>{const t=document.body;if(t.querySelector("action-handler-roomcard"))return t.querySelector("action-handler-roomcard");const e=document.createElement("action-handler-roomcard");return t.appendChild(e),e})();i&&i.bind(t,e)},e.actionHandler=(0,r.directive)(class extends r.Directive{update(t,[i]){return(0,e.actionHandlerBind)(t.element,i),n.noChange}render(t){}})},184:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.extractValue=e.renderRows=e.renderEntity=e.renderEntitiesRow=e.renderInfoEntity=e.renderTitle=e.clickHandler=e.renderMainEntity=e.renderValue=e.renderIcon=e.entityStyles=e.entityStateDisplay=e.renderCustomStateIcon=e.renderConditionIcons=e.entityIcon=e.entityName=e.computeEntity=e.checkConfig=void 0;const n=i(671),r=i(621),o=i(249),a=i(693),s=i(313),c=i(3),l=i(198),u=i(870),d=i(883),m=i(22);e.checkConfig=t=>{if(null==t.entities&&null==t.entity&&void 0===t.info_entities&&void 0===t.rows&&void 0===t.cards)throw new Error("Please define entities.")},e.computeEntity=t=>t.substr(t.indexOf(".")+1),e.entityName=(t,i)=>(0,u.getTemplateOrAttribute)(t.name,i,t.stateObj)||(t.entity?t.stateObj.attributes.friendly_name||(0,e.computeEntity)(t.stateObj.entity_id):null)||null,e.entityIcon=(t,i,n)=>{var r;if("icon"in i&&(void 0===i.show_icon||!1===i.show_icon))throw new Error(`Entity: ${i.entity} => Icon defined but show_icon is set to false or not defined. Please set show_icon to true`);return"icon"in i?"string"==typeof i.icon?i.icon:i.icon.state_on?(0,e.renderCustomStateIcon)(t,i.icon):i.icon.conditions?(0,e.renderConditionIcons)(t,i,n):(null===(r=i.icon.template)||void 0===r?void 0:r.icon)?(0,a.evalTemplate)(n,t,i.icon.template.icon):void 0:t.attributes.icon||null},e.renderConditionIcons=(t,e,i)=>{const n=t.state;return e.icon.conditions.filter((e=>{let r=n;if(e.entity){const t=i.states[e.entity];r=e.attribute?t.attributes[e.attribute]:t.state}return e.attribute&&!e.entity&&(r=t.attributes[e.attribute]),(0,a.checkConditionalValue)(e,r)})).pop()},e.renderCustomStateIcon=(t,e)=>{switch((0,o.computeStateDomain)(t)){case"light":case"switch":case"binary_sensor":case"input_boolean":return"on"===t.state?e.state_on:e.state_off}},e.entityStateDisplay=(t,i)=>{if((0,a.isUnavailable)(i.stateObj))return t.localize(`state.default.${i.stateObj.state}`);let n=(0,a.getValue)(i),s=void 0!==i.attribute?i.unit:i.unit||i.stateObj.attributes.unit_of_measurement;if(i.format)return({value:n,unit:s}=(0,e.extractValue)(i,n,t,s)),`${n}${s?` ${s}`:""}`;if(i.attribute)return`${isNaN(n)?n:(0,r.formatNumber)(n,t.locale)}${s?` ${s}`:""}`;const c=Object.assign(Object.assign({},i.stateObj),{attributes:Object.assign(Object.assign({},i.stateObj.attributes),{unit_of_measurement:s})});return(0,o.computeStateDisplay)(t.localize,c,t.locale)},e.entityStyles=(t,e,i)=>{if(!t)return"";if("template"in t){const n=t;return(0,a.evalTemplate)(i,e,n.template)}const n=t;return Object.keys(n).map((t=>`${t}: ${n[t]};`)).join("")},e.renderIcon=(t,i,n,r)=>{if(void 0!==i.show_icon&&!1===i.show_icon)return null;const o=(0,e.entityIcon)(t,i,n),s=(0,u.templateStyling)(t,i,n);return c.html`<state-badge class="icon-small ${r}" .hass="${n}" .stateObj="${t}" .overrideIcon="${(0,a.isObject)(o)?o.icon:o}" .stateColor="${i.state_color}" style="${null!=s?s:(0,e.entityStyles)((0,a.isObject)(o)?o.styles:null,n.states[i.entity],n)}"></state-badge>`},e.renderValue=(t,i)=>{if(!0===t.toggle)return c.html`<ha-entity-toggle .stateObj="${t.stateObj}" .hass="${i}"></ha-entity-toggle>`;if(!0===t.show_icon)return(0,e.renderIcon)(t.stateObj,t,i);if(t.attribute&&[l.LAST_CHANGED,l.LAST_UPDATED].includes(t.attribute))return c.html`<ha-relative-time .hass="${i}" .datetime="${t.attribute===l.LAST_CHANGED?t.stateObj.last_changed:t.stateObj.last_updated}" capitalize></ha-relative-time>`;if(t.format&&l.TIMESTAMP_FORMATS.includes(t.format)){const e=(0,a.getValue)(t),n=new Date(e);return n instanceof Date&&!isNaN(n.getTime())?c.html`<hui-timestamp-display .hass="${i}" .ts="${n}" .format="${t.format}" capitalize></hui-timestamp-display>`:e}return(0,e.entityStateDisplay)(i,t)},e.renderMainEntity=(t,i,n)=>{var r;if(void 0===t)return null;const o=n.states[t.entity];return c.html`<div class="main-state entity" style="${(0,e.entityStyles)(t.styles,o,n)}">${0===(null===(r=i.entities)||void 0===r?void 0:r.length)||i.icon?(0,e.renderIcon)(t.stateObj,i,n,"main-icon"):void 0!==t.show_state&&!1===t.show_state?"":(0,e.renderValue)(t,n)}</div>`},e.clickHandler=(t,e,i,n)=>{(0,s.handleAction)(t,e,i,n.detail.action)},e.renderTitle=(t,i,n,r)=>{if(!0===t.hide_title)return null;const o=void 0!==t.tap_action||void 0!==t.double_tap_action,a=(0,u.getTemplateOrAttribute)(t.title,i,null==r?void 0:r.stateObj);return c.html`<div class="title${o?" clickable":null}" @action="${o=>{i&&o.detail.action&&(0,e.clickHandler)(n,i,null!=r?r:{tap_action:t.tap_action,double_tap_action:t.double_tap_action,hold_action:t.hold_action},o)}}" .actionHandler="${(0,m.actionHandler)({hasHold:(0,s.hasAction)(null==r?void 0:r.hold_action),hasDoubleClick:(0,s.hasAction)(null==r?void 0:r.double_tap_action)})}">${(0,e.renderMainEntity)(r,t,i)} ${a}</div>`},e.renderInfoEntity=(t,i,n)=>void 0===t||!t.stateObj||(0,d.hideIfEntity)(t,i)?null:c.html`<div class="state entity ${!0===t.show_icon?"icon-entity":""}" style="${(0,e.entityStyles)(t.styles,t.stateObj,i)}" @action="${r=>{i&&t&&r.detail.action&&(0,e.clickHandler)(n,i,t,r)}}" .actionHandler="${(0,m.actionHandler)({hasHold:(0,s.hasAction)(t.hold_action),hasDoubleClick:(0,s.hasAction)(t.double_tap_action)})}">${(0,e.renderValue)(t,i)}</div>`,e.renderEntitiesRow=(t,i,n,r,o)=>void 0===i?null:c.html`<div class="${(0,a.renderClasses)(t,o)}">${i.map((t=>(0,e.renderEntity)(t,n,r)))}</div>`,e.renderEntity=(t,i,n)=>null==t.stateObj||(0,d.hideIfEntity)(t,i)?null:c.html`<div class="entity" style="${(0,e.entityStyles)(t.styles,i.states[t.entity],i)}" @action="${r=>{i&&t&&r.detail.action&&(0,e.clickHandler)(n,i,t,r)}}" .actionHandler="${(0,m.actionHandler)({hasHold:(0,s.hasAction)(t.hold_action),hasDoubleClick:(0,s.hasAction)(t.double_tap_action)})}">${void 0===t.show_name||t.show_name?c.html`<span>${(0,e.entityName)(t,i)}</span>`:""}<div>${(0,e.renderIcon)(t.stateObj,t,i)}</div>${t.show_state?c.html`<span>${(0,e.entityStateDisplay)(i,t)}</span>`:""}</div>`,e.renderRows=(t,i,n)=>{const r=t.filter((t=>!(0,d.hideIfRow)(t,i)));return c.html`${r.map((t=>(0,e.renderEntitiesRow)(t,t.entities,i,n)))}`},e.extractValue=(t,e,i,o)=>{if(t.format.startsWith("precision")){const n=parseInt(t.format.slice(-1),10);e=(0,r.formatNumber)(e,i.locale,{minimumFractionDigits:n,maximumFractionDigits:n})}else isNaN(parseFloat(e))||!isFinite(e)||("brightness"===t.format?(e=Math.round(e/255*100),o="%"):t.format.startsWith("duration")?(e=(0,n.secondsToDuration)("duration-m"===t.format?e/1e3:e),o=void 0):"kilo"===t.format?e=(0,r.formatNumber)(e/1e3,i.locale,{maximumFractionDigits:2}):"invert"===t.format?e=(0,r.formatNumber)(e-2*e,i.locale):"position"===t.format&&(e=(0,r.formatNumber)(100-e,i.locale)));return{value:e,unit:o}}},883:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.hideIfEntity=e.hideIfRow=e.hideIfCard=e.hideUnavailable=void 0;const n=i(693);e.hideUnavailable=t=>t.hide_unavailable&&(0,n.isUnavailable)(t.stateObj),e.hideIfCard=(t,e)=>{var i,r;if(void 0===t.hide_if)return!1;if(t.hide_if){const o=null===(i=e.states[t.entity])||void 0===i?void 0:i.state,a=null===(r=t.hide_if.conditions)||void 0===r?void 0:r.filter((i=>{let r=o;if(i.entity){const t=e.states[i.entity];r=i.attribute?t.attributes[i.attribute]:t.state}return i.attribute&&!i.entity&&(r=e.states[t.entity].attributes[i.attribute]),(0,n.checkConditionalValue)(i,r)}));return(null==a?void 0:a.length)>0}},e.hideIfRow=(t,e)=>{var i;if(void 0===t.hide_if)return!1;if(t.hide_if){const r=null===(i=t.hide_if.conditions)||void 0===i?void 0:i.filter((t=>{if(t.entity){const i=e.states[t.entity];return(0,n.checkConditionalValue)(t,t.attribute?i.attributes[t.attribute]:i.state)}}));return(null==r?void 0:r.length)>0}},e.hideIfEntity=(t,i)=>{var r;if((0,e.hideUnavailable)(t))return!0;if(void 0===t.hide_if)return!1;if(t.hide_if){const e=t.stateObj.state,o=null===(r=t.hide_if.conditions)||void 0===r?void 0:r.filter((r=>{let o=e;if(r.entity){const t=i.states[r.entity];o=r.attribute?t.attributes[r.attribute]:t.state}return r.attribute&&!r.entity&&(o=t.stateObj.attributes[r.attribute]),(0,n.checkConditionalValue)(r,o)}));return(null==o?void 0:o.length)>0}}},148:function(t,e,i){var n=this&&this.__decorate||function(t,e,i,n){var r,o=arguments.length,a=o<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,n);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(a=(o<3?r(a):o>3?r(e,i,a):r(e,i))||a);return o>3&&a&&Object.defineProperty(e,i,a),a},r=this&&this.__awaiter||function(t,e,i,n){return new(i||(i=Promise))((function(r,o){function a(t){try{c(n.next(t))}catch(t){o(t)}}function s(t){try{c(n.throw(t))}catch(t){o(t)}}function c(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,s)}c((n=n.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const o=i(3),a=i(515),s=i(313),c=i(184),l=i(693),u=i(883),d=i(278),m=i(147);console.info(`%c ROOM-CARD %c ${m.version}`,"color: cyan; background: black; font-weight: bold;","color: darkblue; background: white; font-weight: bold;"),window.customCards=window.customCards||[],window.customCards.push({type:"room-card",name:"Room card",preview:!1,description:"Show multiple entity states, attributes and icons in a single card in Home Assistant's Lovelace UI"});let h=class extends o.LitElement{constructor(){super(...arguments),this.monitoredStates={}}getChildCustomCardTypes(t,e){if(t)for(const i of t)0===i.type.indexOf("custom:")&&e.add(i.type.substring(7,i.type.length)),this.getChildCustomCardTypes(i.cards,e)}waitForDependentComponents(t){return r(this,void 0,void 0,(function*(){const e=new Set;this.getChildCustomCardTypes(t.cards,e),yield Promise.all(Array.from(e).map((t=>customElements.whenDefined(t))))}))}shouldUpdate(t){return void 0!==this.monitoredStates&&void 0!==this.config&&t.size>0&&void 0!==this._helpers&&void 0!==this._helpers.createCardElement}updateMonitoredStates(t){const e=Object.assign({},this.monitoredStates);let i=!1;for(const n of this.config.entityIds)if(n in t.states){const r=this.monitoredStates&&this.monitoredStates[n];(!this.monitoredStates||(null==r?void 0:r.last_updated)<t.states[n].last_updated||(null==r?void 0:r.last_changed)<t.states[n].last_changed)&&(i=t.states[n]!==e[n],e[n]=t.states[n])}else this.monitoredStates&&n in this.monitoredStates&&(i=!0,delete e[n]);i&&(this.monitoredStates=e)}setConfig(t){return r(this,void 0,void 0,(function*(){(0,c.checkConfig)(t),this.config=Object.assign(Object.assign({},t),{entityIds:(0,l.getEntityIds)(t)}),yield this.waitForDependentComponents(t),window.loadCardHelpers&&(this._helpers=yield window.loadCardHelpers())}))}set hass(t){this._hass=t,t&&this.config&&(this.updateMonitoredStates(t),this.config.hass=t)}static get styles(){return d.style}render(){var t;if(!this._hass||!this.config)return o.html``;const{entity:e,info_entities:i,entities:n,rows:r,stateObj:a}=(0,l.parseConfig)(this.config,this._hass);try{return o.html`<ha-card elevation="2" style="${(0,c.entityStyles)(this.config.card_styles,a,this._hass)}"><div class="card-header">${(0,c.renderTitle)(this.config,this._hass,this,e)}<div class="entities-info-row">${i.map((t=>(0,c.renderInfoEntity)(t,this._hass,this)))}</div></div>${void 0!==r&&r.length>0?(0,c.renderRows)(r,this._hass,this):(0,c.renderEntitiesRow)(this.config,n,this._hass,this)} ${null===(t=this.config.cards)||void 0===t?void 0:t.map((t=>this.createCardElement(t,this._hass)))}</ha-card>`}catch(t){return o.html`<hui-warning>${t.toString()}</hui-warning>`}}getCardSize(){const t=this.config.cards?this.config.cards.length:0,e=this.config.rows?this.config.rows.length:0,i=!this.config.info_entities&&this.config.hide_title?1:2;return t+e+(this.config.entities&&this.config.entities.length>0?1:0)+i}createCardElement(t,e){if((0,u.hideIfCard)(t,e)||t.show_states&&!t.show_states.includes(e.states[t.entity].state))return null;let i;return i=this._helpers?this._helpers.createCardElement(t):(0,s.createThing)(t),i.hass=e,i.style.boxShadow="none",i.style.borderRadius="0",i}};n([(0,a.property)()],h.prototype,"monitoredStates",void 0),n([(0,a.property)()],h.prototype,"_helpers",void 0),n([(0,a.property)()],h.prototype,"_hass",void 0),n([(0,a.property)()],h.prototype,"config",void 0),h=n([(0,a.customElement)("room-card")],h),e.default=h},249:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.computeStateDisplay=e.computeStateDomain=void 0;const n=i(198),r=i(300),o=i(141),a=i(599),s=i(621);e.computeStateDomain=t=>t.entity_id.substr(0,t.entity_id.indexOf(".")),e.computeStateDisplay=(t,i,c,l)=>{const u=void 0!==l?l:i.state;if(u===n.UNKNOWN||u===n.UNAVAILABLE)return t(`state.default.${u}`);if((0,s.isNumericState)(i)){if("monetary"===i.attributes.device_class)try{return(0,s.formatNumber)(u,c,{style:"currency",currency:i.attributes.unit_of_measurement})}catch(t){}return`${(0,s.formatNumber)(u,c)}${i.attributes.unit_of_measurement?" "+i.attributes.unit_of_measurement:""}`}const d=(0,e.computeStateDomain)(i);if("input_datetime"===d){if(void 0===l){let t;return i.attributes.has_date&&i.attributes.has_time?(t=new Date(i.attributes.year,i.attributes.month-1,i.attributes.day,i.attributes.hour,i.attributes.minute),(0,o.formatDateTime)(t,c)):i.attributes.has_date?(t=new Date(i.attributes.year,i.attributes.month-1,i.attributes.day),(0,r.formatDate)(t,c)):i.attributes.has_time?(t=new Date,t.setHours(i.attributes.hour,i.attributes.minute),(0,a.formatTime)(t,c)):i.state}try{const t=l.split(" ");if(2===t.length)return(0,o.formatDateTime)(new Date(t.join("T")),c);if(1===t.length){if(l.includes("-"))return(0,r.formatDate)(new Date(`${l}T00:00`),c);if(l.includes(":")){const t=new Date;return(0,a.formatTime)(new Date(`${t.toISOString().split("T")[0]}T${l}`),c)}}return l}catch(t){return l}}return"humidifier"===d&&"on"===u&&i.attributes.humidity?`${i.attributes.humidity} %`:"counter"===d||"number"===d||"input_number"===d?(0,s.formatNumber)(u,c):"button"===d||"sensor"===d&&"timestamp"===i.attributes.device_class?(0,o.formatDateTime)(new Date(u),c):i.attributes.device_class&&t(`component.${d}.state.${i.attributes.device_class}.${u}`)||t(`component.${d}.state._.${u}`)||u}},198:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.TimeFormat=e.NumberFormat=e.SECONDARY_INFO_VALUES=e.TIMESTAMP_FORMATS=e.LAST_UPDATED=e.LAST_CHANGED=e.UNAVAILABLE_STATES=e.UNKNOWN=e.UNAVAILABLE=void 0,e.UNAVAILABLE="unavailable",e.UNKNOWN="unknown",e.UNAVAILABLE_STATES=[e.UNAVAILABLE,e.UNKNOWN],e.LAST_CHANGED="last-changed",e.LAST_UPDATED="last-updated",e.TIMESTAMP_FORMATS=["relative","total","date","time","datetime"],e.SECONDARY_INFO_VALUES=["entity-id","last-changed","last-updated","last-triggered","position","tilt-position","brightness"],e.NumberFormat={language:"language",system:"system",comma_decimal:"comma_decimal",decimal_comma:"decimal_comma",space_comma:"space_comma",none:"none"},e.TimeFormat={language:"language",system:"system",am_pm:"12",twenty_four:"24"}},300:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatDate=void 0,e.formatDate=(t,e)=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"long",day:"numeric"}).format(t)},141:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatDateTime=void 0;const n=i(975);e.formatDateTime=(t,e)=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"long",day:"numeric",hour:(0,n.useAmPm)(e)?"numeric":"2-digit",minute:"2-digit",hour12:(0,n.useAmPm)(e)}).format(t)},621:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatNumber=e.numberFormatToLocale=e.isNumericState=e.round=void 0;const n=i(198);e.round=(t,e=2)=>Math.round(t*Math.pow(10,e))/Math.pow(10,e),e.isNumericState=t=>!!t.attributes.unit_of_measurement||!!t.attributes.state_class,e.numberFormatToLocale=t=>{switch(t.number_format){case n.NumberFormat.comma_decimal:return["en-US","en"];case n.NumberFormat.decimal_comma:return["de","es","it"];case n.NumberFormat.space_comma:return["fr","sv","cs"];case n.NumberFormat.system:return;default:return t.language}},e.formatNumber=(t,i,o)=>{const a=i?(0,e.numberFormatToLocale)(i):void 0;if((null==i?void 0:i.number_format)!==n.NumberFormat.none&&!Number.isNaN(Number(t))&&Intl)try{return new Intl.NumberFormat(a,r(t,o)).format(Number(t))}catch(e){return console.error(e),new Intl.NumberFormat(void 0,r(t,o)).format(Number(t))}return"string"==typeof t?t:`${(0,e.round)(t,null==o?void 0:o.maximumFractionDigits).toString()}${"currency"===(null==o?void 0:o.style)?` ${o.currency}`:""}`};const r=(t,e)=>Object.assign({maximumFractionDigits:2},e)},599:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatTime=void 0;const n=i(975);e.formatTime=(t,e)=>new Intl.DateTimeFormat(e.language,{hour:"numeric",minute:"2-digit",hour12:(0,n.useAmPm)(e)}).format(t)},671:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.secondsToDuration=void 0;const i=t=>t<10?`0${t}`:t;e.secondsToDuration=function(t){const e=Math.floor(t/3600),n=Math.floor(t%3600/60),r=Math.floor(t%3600%60);return e>0?`${e}:${i(n)}:${i(r)}`:n>0?`${n}:${i(r)}`:r>0?""+r:null}},975:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.useAmPm=void 0;const n=i(198);e.useAmPm=t=>{if(t.time_format===n.TimeFormat.language||t.time_format===n.TimeFormat.system){const e=t.time_format===n.TimeFormat.language?t.language:void 0,i=(new Date).toLocaleString(e);return i.includes("AM")||i.includes("PM")}return t.time_format===n.TimeFormat.am_pm}},278:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.style=void 0;const n=i(3);e.style=n.css`ha-card{display:flex;flex-direction:column}ha-card .card-header{padding-bottom:0}.icon-small{display:inline-block}.entity{text-align:center;cursor:pointer}.entity span{font-size:10px}.entities-row{flex-direction:row;flex-wrap:wrap;display:inline-flex;align-items:center;padding:0 20px 10px 20px}.entities-row .entity{margin-right:16px}.entities-info-row .entity:last-of-type,.entities-row .entity:last-of-type{margin-right:0}.entities-column{flex-direction:column;display:flex;align-items:flex-end;justify-content:space-evenly}.entities-column .entity div{display:inline-block;vertical-align:middle}.entities-info-row{flex-direction:row;flex-wrap:wrap;display:inline-flex;justify-content:center;align-items:center;padding:0 20px 10px 20px;font-size:12px;position:absolute;right:20px;top:15px}.entities-info-row .entity{margin-right:16px}.entities-info-row .entity.icon-entity{margin-right:0}.main-state{float:left;margin-right:10px}.main-state>ha-state-icon>ha-svg-icon{vertical-align:baseline}.main-icon{vertical-align:baseline;font-size:30px}.title{min-height:48px}.clickable{cursor:pointer}.content-left{justify-content:left}.content-center{justify-content:center}.content-right{justify-content:right}`},870:(t,e,i)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getTemplateOrAttribute=e.mapTemplate=e.templateStyling=void 0;const n=i(693);e.templateStyling=(t,e,i)=>{var r;const o=e.icon;return void 0!==(null===(r=null==o?void 0:o.template)||void 0===r?void 0:r.styles)?(0,n.evalTemplate)(i,t,o.template.styles):null},e.mapTemplate=(t,e)=>{if(void 0!==t&&t.template){const i=e.templates.filter((e=>e.name===t.template));if(i.length>0){const e=i[0];return Object.assign(Object.assign({stateObj:t.stateObj},t),e.template)}}return t},e.getTemplateOrAttribute=(t,e,i)=>t&&"object"==typeof t&&"template"in t?(0,n.evalTemplate)(e,i,t.template):t},693:function(t,e,i){Object.defineProperty(e,"__esModule",{value:!0}),e.parseConfig=e.renderClasses=e.evalTemplate=e.mapStateObject=e.checkConditionalValue=e.hasConfigOrEntitiesChanged=e.getCardEntities=e.getConditionEntitiesFromConfig=e.getConditionEntities=e.getEntity=e.getEntityIds=e.getValue=e.isUnavailable=e.isObject=void 0;const n=i(3),r=i(198),o=i(870);e.isObject=t=>"object"==typeof t&&!Array.isArray(t)&&!!t,e.isUnavailable=t=>!t||r.UNAVAILABLE_STATES.includes(t.state),e.getValue=t=>{if(t.attribute&&void 0===t.stateObj.attributes[t.attribute])throw new Error(`Entity: '${t.entity}' has no attribute named '${t.attribute}'`);return t.attribute?t.stateObj.attributes[t.attribute]:t.stateObj.state},e.getEntityIds=t=>{var i,n,r,o;return[t.entity].concat(null===(i=t.entities)||void 0===i?void 0:i.map((t=>(0,e.getEntity)(t)))).concat(null===(n=t.info_entities)||void 0===n?void 0:n.map((t=>(0,e.getEntity)(t)))).concat(null===(r=t.rows)||void 0===r?void 0:r.flatMap((t=>t.entities)).map((t=>(0,e.getEntity)(t)))).concat(null===(o=t.cards)||void 0===o?void 0:o.flatMap((t=>(0,e.getCardEntities)(t)))).concat((0,e.getConditionEntitiesFromConfig)(t)).filter((t=>t))},e.getEntity=t=>void 0===t?null:"string"==typeof t?t:t.entity,e.getConditionEntities=t=>{let e=[];return null==t||t.forEach((t=>{var i,n,r,o;const a=null===(n=null===(i=null==t?void 0:t.icon)||void 0===i?void 0:i.conditions)||void 0===n?void 0:n.filter((t=>void 0!==t.entity));a&&(e=e.concat(a));const s=null===(o=null===(r=null==t?void 0:t.hide_if)||void 0===r?void 0:r.conditions)||void 0===o?void 0:o.filter((t=>void 0!==t.entity));s&&(e=e.concat(s))})),e},e.getConditionEntitiesFromConfig=t=>{var i;const n=[t.entities,t.info_entities,null===(i=t.rows)||void 0===i?void 0:i.flatMap((t=>t.entities))];return(0,e.getConditionEntities)(n.flatMap((t=>t))).filter((t=>t.entity)).map((t=>t.entity))},e.getCardEntities=t=>{var i,n;return[(0,e.getEntity)(t.entity)].concat(null===(i=t.cards)||void 0===i?void 0:i.flatMap((t=>(0,e.getCardEntities)(t)))).concat(null===(n=t.entities)||void 0===n?void 0:n.flatMap((t=>(0,e.getEntity)(t)))).filter((t=>t))},e.hasConfigOrEntitiesChanged=(t,e)=>{if(e.has("config"))return!0;const i=e.get("_hass");return!!i&&t.entityIds.some((e=>i.states[e]!==t.hass.states[e]))},e.checkConditionalValue=(t,e)=>{const i="boolean"==typeof t.value?String(t.value):t.value;return"equals"==t.condition&&e==i||"not_equals"==t.condition&&e!=i||"above"==t.condition&&e>i||"below"==t.condition&&e<i||void 0},e.mapStateObject=(t,e,i)=>{let n="string"==typeof t?{entity:t}:t;return n=(0,o.mapTemplate)(n,i),Object.assign(Object.assign({},n),{stateObj:e.states[n.entity]})},e.evalTemplate=(t,e,i)=>{try{return new Function("states","entity","user","hass","html",`'use strict'; ${i}`).call(this,null==t?void 0:t.states,e,null==t?void 0:t.user,t,n.html)}catch(t){const e=i.length<=100?i.trim():`${i.trim().substring(0,98)}...`;throw t.message=`${t.name}: ${t.message} in '${e}'`,t.name="RoomCardJSTemplateError",t}},e.renderClasses=(t,e)=>`entities-row ${t.content_alignment?`content-${t.content_alignment}`:"content-left"}${void 0!==e?` ${e}`:""}`,e.parseConfig=(t,i)=>{var n,r,o,a,s,c;const l={info_entities:[],entities:[]};return i&&t?(l.stateObj=void 0!==t.entity?i.states[t.entity]:void 0,l.entity=void 0!==t.entity?Object.assign(Object.assign({},t),{stateObj:l.stateObj}):void 0,l.info_entities=null!==(r=null===(n=t.info_entities)||void 0===n?void 0:n.map((n=>(0,e.mapStateObject)(n,i,t))))&&void 0!==r?r:[],l.entities=null!==(a=null===(o=t.entities)||void 0===o?void 0:o.map((n=>(0,e.mapStateObject)(n,i,t))))&&void 0!==a?a:[],l.rows=null!==(c=null===(s=t.rows)||void 0===s?void 0:s.map((n=>{var r;return{entities:null===(r=n.entities)||void 0===r?void 0:r.map((n=>(0,e.mapStateObject)(n,i,t))),hide_if:n.hide_if,content_alignment:n.content_alignment}})))&&void 0!==c?c:[],t.hass=i,l):l}},805:(t,e,i)=>{i.d(e,{c3:()=>s,fl:()=>T,ec:()=>u,iv:()=>l,Ts:()=>A,i1:()=>d,Qu:()=>E,FV:()=>r,$m:()=>c});const n=globalThis,r=n.ShadowRoot&&(void 0===n.ShadyCSS||n.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,o=Symbol(),a=new WeakMap;class s{constructor(t,e,i){if(this._$cssResult$=!0,i!==o)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(r&&void 0===t){const i=void 0!==e&&1===e.length;i&&(t=a.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&a.set(e,t))}return t}toString(){return this.cssText}}const c=t=>new s("string"==typeof t?t:t+"",void 0,o),l=(t,...e)=>{const i=1===t.length?t[0]:e.reduce(((e,i,n)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+t[n+1]),t[0]);return new s(i,t,o)},u=(t,e)=>{if(r)t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const i of e){const e=document.createElement("style"),r=n.litNonce;void 0!==r&&e.setAttribute("nonce",r),e.textContent=i.cssText,t.appendChild(e)}},d=r?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return c(e)})(t):t,{is:m,defineProperty:h,getOwnPropertyDescriptor:p,getOwnPropertyNames:f,getOwnPropertySymbols:g,getPrototypeOf:y}=Object,v=globalThis,_=v.trustedTypes,b=_?_.emptyScript:"",w=v.reactiveElementPolyfillSupport,$=(t,e)=>t,A={toAttribute(t,e){switch(e){case Boolean:t=t?b:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},E=(t,e)=>!m(t,e),S={attribute:!0,type:String,converter:A,reflect:!1,hasChanged:E};Symbol.metadata??=Symbol("metadata"),v.litPropertyMetadata??=new WeakMap;class T extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=S){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),n=this.getPropertyDescriptor(t,i,e);void 0!==n&&h(this.prototype,t,n)}}static getPropertyDescriptor(t,e,i){const{get:n,set:r}=p(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get(){return n?.call(this)},set(e){const o=n?.call(this);r.call(this,e),this.requestUpdate(t,o,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??S}static _$Ei(){if(this.hasOwnProperty($("elementProperties")))return;const t=y(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty($("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty($("properties"))){const t=this.properties,e=[...f(t),...g(t)];for(const i of e)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,i]of e)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const i=this._$Eu(t,e);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(d(t))}else void 0!==t&&e.push(d(t));return e}static _$Eu(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$Eg=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$ES(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$E_??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$E_?.delete(t)}_$ES(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return u(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$E_?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$E_?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$EO(t,e){const i=this.constructor.elementProperties.get(t),n=this.constructor._$Eu(t,i);if(void 0!==n&&!0===i.reflect){const r=(void 0!==i.converter?.toAttribute?i.converter:A).toAttribute(e,i.type);this._$Em=t,null==r?this.removeAttribute(n):this.setAttribute(n,r),this._$Em=null}}_$AK(t,e){const i=this.constructor,n=i._$Eh.get(t);if(void 0!==n&&this._$Em!==n){const t=i.getPropertyOptions(n),r="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:A;this._$Em=n,this[n]=r.fromAttribute(e,t.type),this._$Em=null}}requestUpdate(t,e,i,n=!1,r){if(void 0!==t){if(i??=this.constructor.getPropertyOptions(t),!(i.hasChanged??E)(n?r:this[t],e))return;this.C(t,e,i)}!1===this.isUpdatePending&&(this._$Eg=this._$EP())}C(t,e,i){this._$AL.has(t)||this._$AL.set(t,e),!0===i.reflect&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$EP(){this.isUpdatePending=!0;try{await this._$Eg}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,i]of t)!0!==i.wrapped||this._$AL.has(e)||void 0===this[e]||this.C(e,this[e],i)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$E_?.forEach((t=>t.hostUpdate?.())),this.update(e)):this._$ET()}catch(e){throw t=!1,this._$ET(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$E_?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$ET(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Eg}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach((t=>this._$EO(t,this[t]))),this._$ET()}updated(t){}firstUpdated(t){}}T.elementStyles=[],T.shadowRootOptions={mode:"open"},T[$("elementProperties")]=new Map,T[$("finalized")]=new Map,w?.({ReactiveElement:T}),(v.reactiveElementVersions??=[]).push("2.0.2")},515:(t,e,i)=>{i.r(e),i.d(e,{customElement:()=>n,eventOptions:()=>l,property:()=>s,query:()=>d,queryAll:()=>h,queryAssignedElements:()=>f,queryAssignedNodes:()=>g,queryAsync:()=>p,standardProperty:()=>a,state:()=>c});const n=t=>(e,i)=>{void 0!==i?i.addInitializer((()=>{customElements.define(t,e)})):customElements.define(t,e)};var r=i(805);const o={attribute:!0,type:String,converter:r.Ts,reflect:!1,hasChanged:r.Qu},a=(t=o,e,i)=>{const{kind:n,metadata:r}=i;let a=globalThis.litPropertyMetadata.get(r);if(void 0===a&&globalThis.litPropertyMetadata.set(r,a=new Map),a.set(i.name,t),"accessor"===n){const{name:n}=i;return{set(i){const r=e.get.call(this);e.set.call(this,i),this.requestUpdate(n,r,t)},init(e){return void 0!==e&&this.C(n,void 0,t),e}}}if("setter"===n){const{name:n}=i;return function(i){const r=this[n];e.call(this,i),this.requestUpdate(n,r,t)}}throw Error("Unsupported decorator location: "+n)};function s(t){return(e,i)=>"object"==typeof i?a(t,e,i):((t,e,i)=>{const n=e.hasOwnProperty(i);return e.constructor.createProperty(i,n?{...t,wrapped:!0}:t),n?Object.getOwnPropertyDescriptor(e,i):void 0})(t,e,i)}function c(t){return s({...t,state:!0,attribute:!1})}function l(t){return(e,i)=>{const n="function"==typeof e?e:e[i];Object.assign(n,t)}}const u=(t,e,i)=>(i.configurable=!0,i.enumerable=!0,Reflect.decorate&&"object"!=typeof e&&Object.defineProperty(t,e,i),i);function d(t,e){return(i,n,r)=>{const o=e=>e.renderRoot?.querySelector(t)??null;if(e){const{get:t,set:e}="object"==typeof n?i:r??(()=>{const t=Symbol();return{get(){return this[t]},set(e){this[t]=e}}})();return u(i,n,{get(){let i=t.call(this);return void 0===i&&(i=o(this),(null!==i||this.hasUpdated)&&e.call(this,i)),i}})}return u(i,n,{get(){return o(this)}})}}let m;function h(t){return(e,i)=>u(e,i,{get(){return(this.renderRoot??(m??=document.createDocumentFragment())).querySelectorAll(t)}})}function p(t){return(e,i)=>u(e,i,{async get(){return await this.updateComplete,this.renderRoot?.querySelector(t)??null}})}function f(t){return(e,i)=>{const{slot:n,selector:r}=t??{},o="slot"+(n?`[name=${n}]`:":not([name])");return u(e,i,{get(){const e=this.renderRoot?.querySelector(o),i=e?.assignedElements(t)??[];return void 0===r?i:i.filter((t=>t.matches(r)))}})}}function g(t){return(e,i)=>{const{slot:n}=t??{},r="slot"+(n?`[name=${n}]`:":not([name])");return u(e,i,{get(){const e=this.renderRoot?.querySelector(r);return e?.assignedNodes(t)??[]}})}}},41:(t,e,i)=>{i.r(e),i.d(e,{Directive:()=>o,PartType:()=>n,directive:()=>r});const n={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},r=t=>(...e)=>({_$litDirective$:t,values:e});class o{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}},3:(t,e,i)=>{i.r(e),i.d(e,{CSSResult:()=>n.c3,LitElement:()=>B,ReactiveElement:()=>n.fl,_$LE:()=>Y,_$LH:()=>V,adoptStyles:()=>n.ec,css:()=>n.iv,defaultConverter:()=>n.Ts,getCompatibleStyle:()=>n.i1,html:()=>S,isServer:()=>K,noChange:()=>O,notEqual:()=>n.Qu,nothing:()=>C,render:()=>q,supportsAdoptingStyleSheets:()=>n.FV,svg:()=>T,unsafeCSS:()=>n.$m});var n=i(805);const r=globalThis,o=r.trustedTypes,a=o?o.createPolicy("lit-html",{createHTML:t=>t}):void 0,s="$lit$",c=`lit$${(Math.random()+"").slice(9)}$`,l="?"+c,u=`<${l}>`,d=document,m=()=>d.createComment(""),h=t=>null===t||"object"!=typeof t&&"function"!=typeof t,p=Array.isArray,f=t=>p(t)||"function"==typeof t?.[Symbol.iterator],g="[ \t\n\f\r]",y=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,v=/-->/g,_=/>/g,b=RegExp(`>|${g}(?:([^\\s"'>=/]+)(${g}*=${g}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),w=/'/g,$=/"/g,A=/^(?:script|style|textarea|title)$/i,E=t=>(e,...i)=>({_$litType$:t,strings:e,values:i}),S=E(1),T=E(2),O=Symbol.for("lit-noChange"),C=Symbol.for("lit-nothing"),k=new WeakMap,D=d.createTreeWalker(d,129);function N(t,e){if(!Array.isArray(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==a?a.createHTML(e):e}const x=(t,e)=>{const i=t.length-1,n=[];let r,o=2===e?"<svg>":"",a=y;for(let e=0;e<i;e++){const i=t[e];let l,d,m=-1,h=0;for(;h<i.length&&(a.lastIndex=h,d=a.exec(i),null!==d);)h=a.lastIndex,a===y?"!--"===d[1]?a=v:void 0!==d[1]?a=_:void 0!==d[2]?(A.test(d[2])&&(r=RegExp("</"+d[2],"g")),a=b):void 0!==d[3]&&(a=b):a===b?">"===d[0]?(a=r??y,m=-1):void 0===d[1]?m=-2:(m=a.lastIndex-d[2].length,l=d[1],a=void 0===d[3]?b:'"'===d[3]?$:w):a===$||a===w?a=b:a===v||a===_?a=y:(a=b,r=void 0);const p=a===b&&t[e+1].startsWith("/>")?" ":"";o+=a===y?i+u:m>=0?(n.push(l),i.slice(0,m)+s+i.slice(m)+c+p):i+c+(-2===m?e:p)}return[N(t,o+(t[i]||"<?>")+(2===e?"</svg>":"")),n]};class j{constructor({strings:t,_$litType$:e},i){let n;this.parts=[];let r=0,a=0;const u=t.length-1,d=this.parts,[h,p]=x(t,e);if(this.el=j.createElement(h,i),D.currentNode=this.el.content,2===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(n=D.nextNode())&&d.length<u;){if(1===n.nodeType){if(n.hasAttributes())for(const t of n.getAttributeNames())if(t.endsWith(s)){const e=p[a++],i=n.getAttribute(t).split(c),o=/([.?@])?(.*)/.exec(e);d.push({type:1,index:r,name:o[2],strings:i,ctor:"."===o[1]?F:"?"===o[1]?R:"@"===o[1]?H:U}),n.removeAttribute(t)}else t.startsWith(c)&&(d.push({type:6,index:r}),n.removeAttribute(t));if(A.test(n.tagName)){const t=n.textContent.split(c),e=t.length-1;if(e>0){n.textContent=o?o.emptyScript:"";for(let i=0;i<e;i++)n.append(t[i],m()),D.nextNode(),d.push({type:2,index:++r});n.append(t[e],m())}}}else if(8===n.nodeType)if(n.data===l)d.push({type:2,index:r});else{let t=-1;for(;-1!==(t=n.data.indexOf(c,t+1));)d.push({type:7,index:r}),t+=c.length-1}r++}}static createElement(t,e){const i=d.createElement("template");return i.innerHTML=t,i}}function M(t,e,i=t,n){if(e===O)return e;let r=void 0!==n?i._$Co?.[n]:i._$Cl;const o=h(e)?void 0:e._$litDirective$;return r?.constructor!==o&&(r?._$AO?.(!1),void 0===o?r=void 0:(r=new o(t),r._$AT(t,i,n)),void 0!==n?(i._$Co??=[])[n]=r:i._$Cl=r),void 0!==r&&(e=M(t,r._$AS(t,e.values),r,n)),e}class I{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:i}=this._$AD,n=(t?.creationScope??d).importNode(e,!0);D.currentNode=n;let r=D.nextNode(),o=0,a=0,s=i[0];for(;void 0!==s;){if(o===s.index){let e;2===s.type?e=new P(r,r.nextSibling,this,t):1===s.type?e=new s.ctor(r,s.name,s.strings,this,t):6===s.type&&(e=new L(r,this,t)),this._$AV.push(e),s=i[++a]}o!==s?.index&&(r=D.nextNode(),o++)}return D.currentNode=d,n}p(t){let e=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class P{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,i,n){this.type=2,this._$AH=C,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=n,this._$Cv=n?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=M(this,t,e),h(t)?t===C||null==t||""===t?(this._$AH!==C&&this._$AR(),this._$AH=C):t!==this._$AH&&t!==O&&this._(t):void 0!==t._$litType$?this.g(t):void 0!==t.nodeType?this.$(t):f(t)?this.T(t):this._(t)}k(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}$(t){this._$AH!==t&&(this._$AR(),this._$AH=this.k(t))}_(t){this._$AH!==C&&h(this._$AH)?this._$AA.nextSibling.data=t:this.$(d.createTextNode(t)),this._$AH=t}g(t){const{values:e,_$litType$:i}=t,n="number"==typeof i?this._$AC(t):(void 0===i.el&&(i.el=j.createElement(N(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===n)this._$AH.p(e);else{const t=new I(n,this),i=t.u(this.options);t.p(e),this.$(i),this._$AH=t}}_$AC(t){let e=k.get(t.strings);return void 0===e&&k.set(t.strings,e=new j(t)),e}T(t){p(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,n=0;for(const r of t)n===e.length?e.push(i=new P(this.k(m()),this.k(m()),this,this.options)):i=e[n],i._$AI(r),n++;n<e.length&&(this._$AR(i&&i._$AB.nextSibling,n),e.length=n)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class U{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,n,r){this.type=1,this._$AH=C,this._$AN=void 0,this.element=t,this.name=e,this._$AM=n,this.options=r,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=C}_$AI(t,e=this,i,n){const r=this.strings;let o=!1;if(void 0===r)t=M(this,t,e,0),o=!h(t)||t!==this._$AH&&t!==O,o&&(this._$AH=t);else{const n=t;let a,s;for(t=r[0],a=0;a<r.length-1;a++)s=M(this,n[i+a],e,a),s===O&&(s=this._$AH[a]),o||=!h(s)||s!==this._$AH[a],s===C?t=C:t!==C&&(t+=(s??"")+r[a+1]),this._$AH[a]=s}o&&!n&&this.O(t)}O(t){t===C?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class F extends U{constructor(){super(...arguments),this.type=3}O(t){this.element[this.name]=t===C?void 0:t}}class R extends U{constructor(){super(...arguments),this.type=4}O(t){this.element.toggleAttribute(this.name,!!t&&t!==C)}}class H extends U{constructor(t,e,i,n,r){super(t,e,i,n,r),this.type=5}_$AI(t,e=this){if((t=M(this,t,e,0)??C)===O)return;const i=this._$AH,n=t===C&&i!==C||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,r=t!==C&&(i===C||n);n&&this.element.removeEventListener(this.name,this,i),r&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class L{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){M(this,t)}}const V={j:s,P:c,A:l,C:1,M:x,L:I,R:f,V:M,D:P,I:U,H:R,N:H,U:F,B:L},z=r.litHtmlPolyfillSupport;z?.(j,P),(r.litHtmlVersions??=[]).push("3.1.0");const q=(t,e,i)=>{const n=i?.renderBefore??e;let r=n._$litPart$;if(void 0===r){const t=i?.renderBefore??null;n._$litPart$=r=new P(e.insertBefore(m(),t),t,void 0,i??{})}return r._$AI(t),r};class B extends n.fl{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=q(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return O}}B._$litElement$=!0,B.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:B});const W=globalThis.litElementPolyfillSupport;W?.({LitElement:B});const Y={_$AK:(t,e,i)=>{t._$AK(e,i)},_$AL:t=>t._$AL};(globalThis.litElementVersions??=[]).push("4.0.2");const K=!1},147:t=>{t.exports=JSON.parse('{"name":"room-card","version":"1.08.03","description":"Show entities in Home Assistant\'s Lovelace UI","keywords":["home-assistant","homeassistant","lovelace","custom-cards","multiple","entity","row"],"module":"room-card.js","license":"MIT","dependencies":{"babel-jest":"^29.6.4","custom-card-helpers":"^1.8.0","jest-environment-jsdom":"^29.5.0","jest-ts-auto-mock":"^2.1.0","lit":"^3.1.0","minify-html-literals-loader":"^1.1.1","ts-auto-mock":"3.5.0","ttypescript":"^1.5.13","yarn":"^1.22.18"},"devDependencies":{"@babel/core":"^7.23.5","@babel/plugin-transform-runtime":"^7.23.7","@babel/preset-env":"^7.23.7","@types/jest":"^29.5.10","@typescript-eslint/eslint-plugin":"^5.60.1","@typescript-eslint/parser":"^5.59.1","babel-loader":"^9.1.3","codecov":"^3.8.3","compression-webpack-plugin":"^10.0.0","eslint":"^8.56.0","eslint-config-prettier":"^9.0.0","eslint-plugin-prettier":"^4.0.0","jest":"^29.6.2","prettier":"^3.1.1","ts-jest":"^29.1.1","ts-loader":"^9.4.4","typescript":"^4.9.5","webpack":"^5.88.2","webpack-cli":"^5.0.2"},"scripts":{"lint":"eslint src/**/*.ts","dev":"webpack -c webpack.config.js","build":"yarn lint && webpack -c webpack.config.js","test":"jest","coverage":"jest --coverage","workflow":"jest --coverage --json --outputFile=/home/runner/work/room-card/room-card/jest.results.json","prebuild":"copy git-hooks\\\\pre-commit .git\\\\hooks\\\\ && echo \'hook copied\'"}}')}},e={};function i(n){var r=e[n];if(void 0!==r)return r.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,i),o.exports}i.d=(t,e)=>{for(var n in e)i.o(e,n)&&!i.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i(148)})();