!function(){"use strict";var e=function(){return e=Object.assign||function(e){for(var t,n=1,o=arguments.length;n0&&r[r.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]0&&r[r.length-1])||6!==s[0]&&2!==s[0])){i=0;continue}if(3===s[0]&&(!r||s[1]>r[0]&&s[1]<,])(".concat(Object.values(Ae).join("|"),")($|[ \\?)+:\\}\\]><.,])"),"gm"),this._scopped=Ne(e,o,i),this.refs=c,this._watchForPanelUrlChange(),this._watchForEntitiesChange(),this._watchForLanguageChange()}return e.prototype._executeRenderingFunctions=function(e){var t=this;this._subscriptions.get(e).forEach((function(e,n){e.forEach((function(e,o){t.trackTemplate(n,o,e)}))}))},e.prototype._watchForPanelUrlChange=function(){var e=this;window.addEventListener(de.LOCATION_CHANGED,(function(){e._panelUrlWatchCallback()})),window.addEventListener(de.POPSTATE,(function(){e._panelUrlWatchCallback()}))},e.prototype._panelUrlWatchCallback=function(){this._subscriptions.has(Ae.PANEL_URL)&&this._executeRenderingFunctions(Ae.PANEL_URL)},e.prototype._watchForEntitiesChange=function(){var e=this;window.hassConnection.then((function(t){t.conn.subscribeMessage((function(t){return e._entityWatchCallback(t)}),{type:de.SUBSCRIBE_EVENTS,event_type:de.STATE_CHANGE_EVENT})}))},e.prototype._watchForLanguageChange=function(){var e=this;window.addEventListener(de.TRANSLATIONS_UPDATED,(function(){e._subscriptions.has(Ae.LANG)&&e._executeRenderingFunctions(Ae.LANG)}))},e.prototype._entityWatchCallback=function(e){if(this._subscriptions.size){var t=e.data.entity_id;this._subscriptions.has(t)&&this._executeRenderingFunctions(t)}},e.prototype._storeTracked=function(e,t,n){var o=this;this._scopped.tracked.forEach((function(r){var i=[t,n];if(o._subscriptions.has(r)){var a=o._subscriptions.get(r);if(a.has(e)){var s=a.get(e);s.has(t)||s.set.apply(s,i)}else a.set(e,new Map([i]))}else o._subscriptions.set(r,new Map([[e,new Map([i])]]))}))},e.prototype._untrackTemplate=function(e,t){var n=this;this._subscriptions.forEach((function(o,r){if(o.has(e)){var i=o.get(e);i.delete(t),0===i.size&&(o.delete(e),0===o.size&&n._subscriptions.delete(r))}}))},e.prototype.renderTemplate=function(e,t){void 0===t&&(t={});try{var n=t.variables,o=void 0===n?{}:n,r=t.refs,i=void 0===r?{}:r,a=new Map(Object.entries(ue(ue({},this._variables),o))),s=e.trim().replace(this._clientSideEntitiesRegExp,"$1clientSide.$2$3"),_=s.includes("return")||!this._autoReturn?s:"return ".concat(s);return(new(Function.bind.apply(Function,Oe(Oe([void 0,"hass","states","state_translated","is_state","state_attr","is_state_attr","has_value","entities","entity_prop","is_entity_prop","devices","device_attr","is_device_attr","device_id","device_name","areas","area_id","area_name","area_entities","area_devices","user_name","user_is_admin","user_is_owner","user_agent","clientSide","ref","unref",this._refsVariableName],Array.from(a.keys()),!1),["".concat('"use strict";'," ").concat(_)],!1)))).apply(void 0,Oe([this._scopped.hass,this._scopped.states,this._scopped.state_translated.bind(this._scopped),this._scopped.is_state.bind(this._scopped),this._scopped.state_attr.bind(this._scopped),this._scopped.is_state_attr.bind(this._scopped),this._scopped.has_value.bind(this._scopped),this._scopped.entities,this._scopped.entity_prop,this._scopped.is_entity_prop.bind(this._scopped),this._scopped.devices,this._scopped.device_attr.bind(this._scopped),this._scopped.is_device_attr.bind(this._scopped),this._scopped.device_id.bind(this._scopped),this._scopped.device_name.bind(this._scopped),this._scopped.areas.bind(this._scopped),this._scopped.area_id.bind(this._scopped),this._scopped.area_name.bind(this._scopped),this._scopped.area_entities.bind(this._scopped),this._scopped.area_devices.bind(this._scopped),this._scopped.user_name,this._scopped.user_is_admin,this._scopped.user_is_owner,this._scopped.user_agent,this._scopped.clientSideProxy,this._scopped.ref.bind(this._scopped,this._entityWatchCallback.bind(this)),this._scopped.unref.bind(this._scopped,this.cleanTracked.bind(this)),this._scopped.refs(this._entityWatchCallback.bind(this),this.cleanTracked.bind(this),i)],Array.from(a.values()),!1))}catch(e){if(this._throwErrors)throw e;return void(this._throwWarnings&&console.warn(e))}},e.prototype.trackTemplate=function(e,t,n){var o=this;void 0===n&&(n={}),this._scopped.cleanTracked();var r=this.renderTemplate(e,n);return this._storeTracked(e,t,n),t(r),function(){return o._untrackTemplate(e,t)}},e.prototype.cleanTracked=function(e){e?this._subscriptions.has(e)&&this._subscriptions.delete(e):this._subscriptions.clear()},Object.defineProperty(e.prototype,"variables",{get:function(){return this._variables},set:function(e){this._variables=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"refs",{get:function(){return this._scopped.refs(this._entityWatchCallback.bind(this),this.cleanTracked.bind(this))},set:function(e){this._scopped.cleanRefs(this.cleanTracked.bind(this)),this._scopped.refs(this._entityWatchCallback.bind(this),this.cleanTracked.bind(this),e)},enumerable:!1,configurable:!0}),e}(),Ce=function(){function e(e,t){void 0===t&&(t={}),this._renderer=o((function(){return e.hass}),(function(e){return!!(e&&e.areas&&e.devices&&e.entities&&e.states&&e.user)}),{retries:100,delay:50,rejectMessage:"The provided element doesn't contain a proper or initialised hass object"}).then((function(){return new ge(e,t)}))}return e.prototype.getRenderer=function(){return this._renderer},e}(),be="kiosk-mode";!function(e){e.KIOSK="kiosk",e.HIDE_SIDEBAR="hide_sidebar",e.HIDE_HEADER="hide_header",e.HIDE_ADD_TO_HOME_ASSISTANT="hide_add_to_home_assistant",e.HIDE_OVERFLOW="hide_overflow",e.HIDE_MENU_BUTTON="hide_menubutton",e.HIDE_SETTINGS="hide_settings",e.HIDE_NOTIFICATIONS="hide_notifications",e.HIDE_ACCOUNT="hide_account",e.HIDE_SEARCH="hide_search",e.HIDE_ASSISTANT="hide_assistant",e.HIDE_REFRESH="hide_refresh",e.HIDE_UNUSED_ENTITIES="hide_unused_entities",e.HIDE_RELOAD_RESOURCES="hide_reload_resources",e.HIDE_EDIT_DASHBOARD="hide_edit_dashboard",e.HIDE_DIALOG_HEADER_BREADCRUMB_NAVIGATION="hide_dialog_header_breadcrumb_navigation",e.HIDE_DIALOG_HEADER_ACTION_ITEMS="hide_dialog_header_action_items",e.HIDE_DIALOG_HEADER_HISTORY="hide_dialog_header_history",e.HIDE_DIALOG_HEADER_SETTINGS="hide_dialog_header_settings",e.HIDE_DIALOG_HEADER_OVERFLOW="hide_dialog_header_overflow",e.HIDE_DIALOG_HISTORY="hide_dialog_history",e.HIDE_DIALOG_LOGBOOK="hide_dialog_logbook",e.HIDE_DIALOG_MEDIA_ACTIONS="hide_dialog_media_actions",e.HIDE_DIALOG_UPDATE_ACTIONS="hide_dialog_update_actions",e.HIDE_DIALOG_CAMERA_ACTIONS="hide_dialog_camera_actions",e.HIDE_DIALOG_CLIMATE_ACTIONS="hide_dialog_climate_actions",e.HIDE_DIALOG_CLIMATE_TEMPERATURE_ACTIONS="hide_dialog_climate_temperature_actions",e.HIDE_DIALOG_CLIMATE_SETTINGS_ACTIONS="hide_dialog_climate_settings_actions",e.HIDE_DIALOG_TIMER_ACTIONS="hide_dialog_timer_actions",e.HIDE_DIALOG_LIGHT_ACTIONS="hide_dialog_light_actions",e.HIDE_DIALOG_LIGHT_CONTROL_ACTIONS="hide_dialog_light_control_actions",e.HIDE_DIALOG_LIGHT_COLOR_ACTIONS="hide_dialog_light_color_actions",e.HIDE_DIALOG_LIGHT_SETTINGS_ACTIONS="hide_dialog_light_settings_actions",e.HIDE_DIALOG_HISTORY_SHOW_MORE="hide_dialog_history_show_more",e.HIDE_DIALOG_LOGBOOK_SHOW_MORE="hide_dialog_logbook_show_more",e.BLOCK_OVERFLOW="block_overflow",e.BLOCK_MOUSE="block_mouse",e.BLOCK_CONTEXT_MENU="block_context_menu"}(He||(He={})),function(e){e.IGNORE_MOBILE_SETTINGS="ignore_mobile_settings",e.IGNORE_DISABLE_KM="ignore_disable_km"}(me||(me={})),function(e){e.DEBUG="debug",e.DEBUG_TEMPLATE="debug_template"}(ye||(ye={})),function(e){e.CACHE="cache",e.CLEAR_CACHE="clear_km_cache",e.DISABLE_KIOSK_MODE="disable_km"}(Ge||(Ge={}));var Me,we="ui",Ue="".concat(we,".common"),Pe="".concat(we,".panel"),Be="".concat(Pe,".lovelace"),Fe="".concat(Be,".menu"),We="".concat(Be,".editor"),xe="".concat(We,".menu"),ke="".concat(we,".dialogs.more_info_control");!function(e){e.ADD="ADD",e.OVERFLOW="OVERFLOW",e.SEARCH="SEARCH",e.ASSIST="ASSIST",e.REFRESH="REFRESH",e.UNUSED_ENTITIES="UNUSED_ENTITIES",e.RELOAD_RESOURCES="RELOAD_RESOURCES",e.EDIT_DASHBOARD="EDIT_DASHBOARD",e.DIALOG_DISMISS="DIALOG_DISMISS",e.DIALOG_HISTORY="DIALOG_HISTORY",e.DIALOG_SETTINGS="DIALOG_SETTINGS"}(Me||(Me={}));var je,Ve=Object.freeze(((ve={})[Me.ADD]="".concat(Fe,".add"),ve[Me.OVERFLOW]="".concat(xe,".open"),ve[Me.SEARCH]="".concat(Fe,".search_home_assistant"),ve[Me.ASSIST]="".concat(Fe,".assist_tooltip"),ve[Me.REFRESH]="".concat(Ue,".refresh"),ve[Me.UNUSED_ENTITIES]="".concat(Be,".unused_entities.title"),ve[Me.RELOAD_RESOURCES]="".concat(Fe,".reload_resources"),ve[Me.EDIT_DASHBOARD]="".concat(Fe,".configure_ui"),ve[Me.DIALOG_HISTORY]="".concat(ke,".history"),ve[Me.DIALOG_SETTINGS]="".concat(ke,".settings"),ve[Me.DIALOG_DISMISS]="".concat(Ue,".close"),ve));!function(e){e.HOME_ASSISTANT="home-assistant",e.HA_PANEL_LOVELACE="ha-panel-lovelace",e.HUI_VIEW="hui-view",e.MENU_ITEM="ha-icon-button",e.MENU_ITEM_ICON="mwc-icon-button",e.HA_BUTTON="ha-button",e.DROPDOWN="ha-dropdown",e.DROPDOWN_MENU_ITEM="ha-dropdown-item",e.TOOLBAR=".toolbar",e.ACTION_ITEMS=".action-items",e.HA_MORE_INFO_DIALOG="ha-more-info-dialog",e.HA_DIALOG="ha-adaptive-dialog",e.HA_DIALOG_MORE_INFO="ha-more-info-info",e.HA_DIALOG_HISTORY="ha-more-info-history",e.HA_DIALOG_LOGBOOK="ha-more-info-logbook",e.HA_DIALOG_MORE_INFO_CONTENT="more-info-content",e.HA_DIALOG_MORE_INFO_HISTORY_AND_LOGBOOK="ha-more-info-history-and-logbook",e.HA_DIALOG_DEFAULT="more-info-default",e.HA_DIALOG_TIMER="more-info-timer",e.HA_DIALOG_VACUUM="more-info-vacuum",e.HA_DIALOG_CAMERA="more-info-camera",e.HA_DIALOG_SIREN="more-info-siren",e.HA_DIALOG_PERSON="more-info-person",e.HA_DIALOG_MEDIA_PLAYER="more-info-media_player",e.HA_DIALOG_LIGHT="more-info-light",e.HA_DIALOG_UPDATE="more-info-update",e.HA_DIALOG_LOCK="more-info-lock",e.HA_DIALOG_CLIMATE="more-info-climate",e.HA_DIALOG_CLIMATE_CONTROL_SELECT="ha-more-info-control-select-container",e.HA_STATE_CONTROL_CLIMATE_TEMPERATURE="ha-state-control-climate-temperature",e.HA_DIALOG_CLIMATE_TEMPERATURE_BUTTONS=".buttons",e.HA_DIALOG_CLIMATE_CIRCULAR_SLIDER="ha-control-circular-slider",e.HA_DIALOG_CLIMATE_CIRCULAR_SLIDER_INTERACTION="#interaction",e.HA_DIALOG_CLIMATE_CIRCULAR_SLIDER_INTERACTION_SLIDER='path[role="slider"]',e.HA_DIALOG_CLIMATE_CIRCULAR_SLIDER_INTERACTION_TARGET=".target",e.HA_DIALOG_CLIMATE_CIRCULAR_SLIDER_INTERACTION_TARGET_BORDER=".target-border",e.HA_DIALOG_LIGHT_BRIGHTNESS="ha-state-control-light-brightness",e.HA_DIALOG_LIGHT_CONTROLS="ha-icon-button-group",e.HA_DIALOG_LIGHT_COLORS="ha-more-info-light-favorite-colors",e.HA_DIALOG_LIGHT_SETTINGS="ha-more-info-control-select-container"}(je||(je={}));var Ke,Ye=/^(.*?)( \([A-Z]\))?$/,qe="true",$e=/^\s*\[\[\[([\s\S]+)\]\]\]\s*$/,ze=/\{\{[\s\S]*\}\}|\{%[\s\S]*%\}/,Je="hass-toggle-menu",Qe="MDCDrawer:closed",Xe="resize",Ze=function(e){var t=e.replace(/(?:^|_)([a-z])/g,(function(e,t){return t.toUpperCase()}));return"km".concat(t)},et=function(){for(var e=[],t=0;t ha-sidebar":!1,".header":{width:"100% !important"}},ASIDE:ot(".mdc-drawer"),OVERFLOW_MENU:ot("".concat(je.TOOLBAR," > ").concat(je.ACTION_ITEMS," > ").concat(je.DROPDOWN," > ").concat(je.MENU_ITEM,'[data-selector="').concat(Me.OVERFLOW,'"]')),BLOCK_OVERFLOW:(Ke={},Ke["".concat(je.TOOLBAR," > ").concat(je.ACTION_ITEMS," > ").concat(je.DROPDOWN," > ").concat(je.MENU_ITEM,'[data-selector="').concat(Me.OVERFLOW,'"]')]={"pointer-events":"none !important"},Ke),ADD_TO_HOME_ASSISTANT:ot("".concat(je.TOOLBAR," > ").concat(je.ACTION_ITEMS," > ").concat(je.DROPDOWN," > ").concat(je.MENU_ITEM,'[data-selector="').concat(Me.ADD,'"]'),"".concat(je.TOOLBAR," > ").concat(je.ACTION_ITEMS," > ").concat(je.DROPDOWN," > ").concat(je.DROPDOWN_MENU_ITEM,'[data-selector="').concat(Me.ADD,'"]')),SEARCH:ot("".concat(je.TOOLBAR," > ").concat(je.ACTION_ITEMS," > ").concat(je.MENU_ITEM,'[data-selector="').concat(Me.SEARCH,'"]'),"".concat(je.TOOLBAR," > ").concat(je.ACTION_ITEMS," > ").concat(je.DROPDOWN," > ").concat(je.DROPDOWN_MENU_ITEM,'[data-selector="').concat(Me.SEARCH,'"]')),ASSISTANT:ot("".concat(je.TOOLBAR," > ").concat(je.ACTION_ITEMS," > ").concat(je.MENU_ITEM,'[data-selector="').concat(Me.ASSIST,'"]'),"".concat(je.TOOLBAR," > ").concat(je.ACTION_ITEMS," > ").concat(je.DROPDOWN," > ").concat(je.DROPDOWN_MENU_ITEM,'[data-selector="').concat(Me.ASSIST,'"]')),REFRESH:ot("".concat(je.TOOLBAR," > ").concat(je.ACTION_ITEMS," > ").concat(je.DROPDOWN," > ").concat(je.DROPDOWN_MENU_ITEM,'[data-selector="').concat(Me.REFRESH,'"]')),UNUSED_ENTITIES:ot("".concat(je.TOOLBAR," > ").concat(je.ACTION_ITEMS," > ").concat(je.DROPDOWN," > ").concat(je.DROPDOWN_MENU_ITEM,'[data-selector="').concat(Me.UNUSED_ENTITIES,'"]')),RELOAD_RESOURCES:ot("".concat(je.TOOLBAR," > ").concat(je.ACTION_ITEMS," > ").concat(je.DROPDOWN," > ").concat(je.DROPDOWN_MENU_ITEM,'[data-selector="').concat(Me.RELOAD_RESOURCES,'"]')),EDIT_DASHBOARD:ot("".concat(je.TOOLBAR," > ").concat(je.ACTION_ITEMS," > ").concat(je.MENU_ITEM,'[data-selector="').concat(Me.EDIT_DASHBOARD,'"]'),"".concat(je.TOOLBAR," > ").concat(je.ACTION_ITEMS," > ").concat(je.DROPDOWN," > ").concat(je.DROPDOWN_MENU_ITEM,'[data-selector="').concat(Me.EDIT_DASHBOARD,'"]')),DIALOG_HEADER_BREADCRUMB_NAVIGATION:ot(".title > .breadcrumb"),DIALOG_HEADER_HISTORY:ot("".concat(je.MENU_ITEM,'[data-selector="').concat(Me.DIALOG_HISTORY,'"]')),DIALOG_HEADER_SETTINGS:ot("".concat(je.MENU_ITEM,'[data-selector="').concat(Me.DIALOG_SETTINGS,'"]')),DIALOG_HEADER_OVERFLOW:ot("".concat(je.DROPDOWN)),DIALOG_HISTORY:ot(je.HA_DIALOG_HISTORY),DIALOG_LOGBOOK:ot(je.HA_DIALOG_LOGBOOK),DIALOG_MEDIA_ACTIONS:ot(".bottom-controls > :is(.main-controls, .controls-row)"),DIALOG_TIMER_ACTIONS:ot(".actions"),DIALOG_UPDATE_ACTIONS:ot(".actions","ha-md-list:has(+ .actions)","hr:has(+ .actions)"),DIALOG_CAMERA_ACTIONS:ot(".actions"),DIALOG_CLIMATE_CONTROL_SELECT:ot(je.HA_DIALOG_CLIMATE_CONTROL_SELECT),DIALOG_CLIMATE_TEMPERATURE_BUTTONS:ot(je.HA_DIALOG_CLIMATE_TEMPERATURE_BUTTONS),DIALOG_CLIMATE_CIRCULAR_SLIDER_INTERACTION:ot(je.HA_DIALOG_CLIMATE_CIRCULAR_SLIDER_INTERACTION,je.HA_DIALOG_CLIMATE_CIRCULAR_SLIDER_INTERACTION_SLIDER,je.HA_DIALOG_CLIMATE_CIRCULAR_SLIDER_INTERACTION_TARGET_BORDER,je.HA_DIALOG_CLIMATE_CIRCULAR_SLIDER_INTERACTION_TARGET),DIALOG_LIGHT_CONTROL_ACTIONS:ot(".controls > ".concat(je.HA_DIALOG_LIGHT_BRIGHTNESS," + ").concat(je.HA_DIALOG_LIGHT_CONTROLS)),DIALOG_LIGHT_COLOR_ACTIONS:ot(".controls > ".concat(je.HA_DIALOG_LIGHT_COLORS)),DIALOG_LIGHT_SETTINGS_ACTIONS:ot(".controls:has(> ".concat(je.HA_DIALOG_LIGHT_BRIGHTNESS,") + div > ").concat(je.HA_DIALOG_LIGHT_SETTINGS)),DIALOG_SHOW_MORE:ot(".header a")},at=[{content:"%c≡ kiosk-mode",color:"white",background:"#03a9f4"},{content:"%cversion ".concat("11.0.0")}],st="font-weight: normal; color: inherit;",_t="font-weight: bold; color: blue;",ct="font-weight: bold; color: red;",lt="font-weight: bold; color: green;",ut="color: #666",Ot="text-decoration: underline",Et=Object.values(me),It=function(){function t(){}return t.logInfo=function(){var t=[],n=[],o=at.length-1,r={"border-color":"#424242","border-style":"solid",display:"inline-block","font-family":"monospace","font-size":"12px"};at.forEach((function(i,a){t.push(i.content.padEnd(27)),t.push("%c⋮"),a!==o&&t.push("%c\n");var s="0 0 0 1px",_="0 1px 0 1px";0===a?(s="1px 0 0 1px",_="1px 1px 0 0"):a===o&&(s="0 0 1px 1px",_="0 1px 1px 0"),n.push(ie(e(e({},r),{background:i.background||"white",color:i.color||"#424242",padding:0===a?"1px 0px 1px 5px":"1px 0px 1px 10px","border-width":s}))),n.push(ie(e(e({},r),{background:i.background||"white",color:i.color||"white",padding:0===a?"1px 5px":"1px 5px 1px 0px","border-width":_}))),a!==o&&n.push("")})),console.info.apply(console,function(e,t,n){if(n||2===arguments.length)for(var o,r=0,i=t.length;r hass > user after {{ retries }} attempts. Giving up!")})];case 7:return d.user=n.sent(),h=this,[4,new Ce(this.ha).getRenderer()];case 8:return h._renderer=n.sent(),this.version=function(e){var t=e?e.match(/^(\d+)\.(\d+)\.(\w+)(?:\.(\w+))?$/):null;return t?[+t[1],+t[2],t[3]]:null}(null===(f=null===(D=this.ha.hass)||void 0===D?void 0:D.config)||void 0===f?void 0:f.version),this.run(),[2]}}))}))})),r.addEventListener(w.ON_MORE_INFO_DIALOG_OPEN,(function(t){e.HAMoreInfoDialogElements=t.detail,e.insertMoreInfoDialogStyles()})),r.addEventListener(w.ON_HISTORY_AND_LOGBOOK_DIALOG_OPEN,(function(t){e.HAMoreInfoDialogElements=t.detail,e.insertMoreInfoDialogStyles()})),r.listen(),this.resizeWindowBinded=this.resizeWindow.bind(this)}return r.prototype._getPanelUrl=function(){return this.ha.hass.panelUrl},r.prototype._hasStoredOptions=function(){var e=this._getPanelUrl();return this.panelOptions.has(e)},r.prototype._getOptions=function(){var e=this._getPanelUrl();return this.panelOptions.get(e)},r.prototype._storeOptions=function(e){var t=this._getPanelUrl();this.panelOptions.set(t,e)},r.prototype._isDebug=function(e){return"boolean"==typeof e&&e},r.prototype._isKioskModeDisabled=function(e){return!(e&&(!et(Ge.DISABLE_KIOSK_MODE)||e[me.IGNORE_DISABLE_KM]))},r.prototype.runThrottle=function(){var e=this;window.clearTimeout(this._runTimeout),this._runTimeout=window.setTimeout((function(){e.run(),e.runDialogs()}),50)},r.prototype.run=function(){return t(this,void 0,void 0,(function(){var e,t=this;return n(this,(function(n){return(e=this.main.querySelector(je.HA_PANEL_LOVELACE))?this._hasStoredOptions()?(this.insertStyles(),[2]):[2,o((function(){var t;return null===(t=null==e?void 0:e.lovelace)||void 0===t?void 0:t.config}),(function(e){return!!e}),{retries:500,delay:50,rejectMessage:"".concat(be,": Cannot select Lovelace config after {{ retries }} attempts. Giving up!")}).then((function(e){return t.processConfig(e.kiosk_mode||{})}))]:[2]}))}))},r.prototype.runDialogs=function(){var e,t,n=null===(t=null===(e=this.ha)||void 0===e?void 0:e.shadowRoot)||void 0===t?void 0:t.querySelector(je.HA_MORE_INFO_DIALOG),o=null==n?void 0:n.shadowRoot.querySelector(je.HA_DIALOG);o&&o.open&&this.insertMoreInfoDialogStyles()},r.prototype.processConfig=function(r){return t(this,void 0,void 0,(function(){var i,a,s,_,c,l,u=this;return n(this,(function(O){var E;return this._isDebug(r.debug)&&It.debugRawConfig(r,this._getPanelUrl()),i={},a={},Object.values(He).forEach((function(e){i[e]=!1,a[e]=!1})),Object.values(me).forEach((function(e){i[e]=!1,a[e]=!1})),Object.values(ye).forEach((function(e){i[e]=!1,a[e]=!1})),(E=this.ha,t(void 0,void 0,void 0,(function(){var e,t;return n(this,(function(n){switch(n.label){case 0:return e=Object.entries(Ve),[4,o((function(){return e.map((function(e){var t=e[0],n=e[1];return[E.hass.localize(n),t]}))}),(function(e){return!e.find((function(e){return!e[0]}))}),{retries:500,delay:50})];case 1:return t=n.sent(),[2,Object.fromEntries(t)]}}))}))).then((function(e){u.menuTranslations=e,u.updateMenuItemsLabels()})).catch((function(){console.warn("".concat(be,": ").concat("[ Non critial warning ]"," Cannot get resources translations"))})),nt.apply(void 0,Object.values(He))||et.apply(void 0,Object.values(He))?Object.values(He).forEach((function(e){i[e]=nt(e)||et(e)})):i=e(e({},i),r),(s=this.user.is_admin?r.admin_settings:r.non_admin_settings)&&(i=e(e({},i),s)),r.user_settings&&r.user_settings.forEach((function(t){t.users.some((function(e){return e.toLowerCase()===u.user.name.toLowerCase()}))&&(i=e(e({},i),t))})),(_=i[me.IGNORE_MOBILE_SETTINGS]?null:r.mobile_settings)&&(c=_.custom_width?_.custom_width:812,window.innerWidth<=c&&(i=e(e({},i),_))),this._isDebug(i.debug)&&(i.admin_settings,i.non_admin_settings,i.user_settings,i.mobile_settings,l=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r ".concat(je.MENU_ITEM)).all.then((function(e){!function(e,t){e.forEach((function(e){if(e&&e.dataset&&!e.dataset.selector){var n=e.shadowRoot.querySelector(je.HA_BUTTON);e.dataset.selector=t[n.title.trim()]}}))}(e,l.menuTranslations)})),[4,this.HAMoreInfoDialogElements.HA_DIALOG.element]);case 1:return t=n.sent(),o=this.HAMoreInfoDialogElements.HA_DIALOG_CONTENT,[4,(r=o.selector.query("".concat(je.HA_DIALOG_MORE_INFO,", ").concat(je.HA_DIALOG_MORE_INFO_HISTORY_AND_LOGBOOK)).$).element];case 2:return i=n.sent(),e[He.HIDE_DIALOG_HEADER_BREADCRUMB_NAVIGATION]||e[He.HIDE_DIALOG_HEADER_ACTION_ITEMS]||e[He.HIDE_DIALOG_HEADER_HISTORY]||e[He.HIDE_DIALOG_HEADER_SETTINGS]||e[He.HIDE_DIALOG_HEADER_OVERFLOW]?(c=[e[He.HIDE_DIALOG_HEADER_BREADCRUMB_NAVIGATION]&&it.DIALOG_HEADER_BREADCRUMB_NAVIGATION,(e[He.HIDE_DIALOG_HEADER_ACTION_ITEMS]||e[He.HIDE_DIALOG_HEADER_HISTORY])&&it.DIALOG_HEADER_HISTORY,(e[He.HIDE_DIALOG_HEADER_ACTION_ITEMS]||e[He.HIDE_DIALOG_HEADER_SETTINGS])&&it.DIALOG_HEADER_SETTINGS,(e[He.HIDE_DIALOG_HEADER_ACTION_ITEMS]||e[He.HIDE_DIALOG_HEADER_OVERFLOW])&&it.DIALOG_HEADER_OVERFLOW],this.styleManager.addStyle(c,t),et(Ge.CACHE)&&(e[He.HIDE_DIALOG_HEADER_BREADCRUMB_NAVIGATION]&&tt(qe,He.HIDE_DIALOG_HEADER_BREADCRUMB_NAVIGATION),e[He.HIDE_DIALOG_HEADER_ACTION_ITEMS]&&tt(qe,He.HIDE_DIALOG_HEADER_ACTION_ITEMS),e[He.HIDE_DIALOG_HEADER_HISTORY]&&tt(qe,He.HIDE_DIALOG_HEADER_HISTORY),e[He.HIDE_DIALOG_HEADER_SETTINGS]&&tt(qe,He.HIDE_DIALOG_HEADER_SETTINGS),e[He.HIDE_DIALOG_HEADER_OVERFLOW]&&tt(qe,He.HIDE_DIALOG_HEADER_OVERFLOW))):this.styleManager.removeStyle(t),a=r.query(je.HA_DIALOG_MORE_INFO_CONTENT).$.query(je.HA_DIALOG_CLIMATE).$,s=a.query(je.HA_STATE_CONTROL_CLIMATE_TEMPERATURE).$,_=s.query(je.HA_DIALOG_CLIMATE_CIRCULAR_SLIDER).$,a.element.then((function(t){e[He.HIDE_DIALOG_CLIMATE_ACTIONS]||e[He.HIDE_DIALOG_CLIMATE_SETTINGS_ACTIONS]?(l.styleManager.addStyle(it.DIALOG_CLIMATE_CONTROL_SELECT,t),et(Ge.CACHE)&&(e[He.HIDE_DIALOG_CLIMATE_ACTIONS]&&tt(qe,He.HIDE_DIALOG_CLIMATE_ACTIONS),e[He.HIDE_DIALOG_CLIMATE_SETTINGS_ACTIONS]&&tt(qe,He.HIDE_DIALOG_CLIMATE_SETTINGS_ACTIONS))):l.styleManager.removeStyle(t)})),s.element.then((function(t){e[He.HIDE_DIALOG_CLIMATE_ACTIONS]||e[He.HIDE_DIALOG_CLIMATE_TEMPERATURE_ACTIONS]?(l.styleManager.addStyle(it.DIALOG_CLIMATE_TEMPERATURE_BUTTONS,t),et(Ge.CACHE)&&e[He.HIDE_DIALOG_CLIMATE_TEMPERATURE_ACTIONS]&&tt(qe,He.HIDE_DIALOG_CLIMATE_TEMPERATURE_ACTIONS)):l.styleManager.removeStyle(t)})),_.element.then((function(t){e[He.HIDE_DIALOG_CLIMATE_ACTIONS]||e[He.HIDE_DIALOG_CLIMATE_TEMPERATURE_ACTIONS]?l.styleManager.addStyle(it.DIALOG_CLIMATE_CIRCULAR_SLIDER_INTERACTION,t):l.styleManager.removeStyle(t)})),r.query(je.HA_DIALOG_MORE_INFO_CONTENT).$.query([je.HA_DIALOG_DEFAULT,je.HA_DIALOG_LIGHT,je.HA_DIALOG_LOCK,je.HA_DIALOG_MEDIA_PLAYER,je.HA_DIALOG_PERSON,je.HA_DIALOG_SIREN,je.HA_DIALOG_TIMER,je.HA_DIALOG_UPDATE,je.HA_DIALOG_VACUUM,je.HA_DIALOG_CAMERA].join(",")).$.element.then((function(t){if(e[He.HIDE_DIALOG_TIMER_ACTIONS]||e[He.HIDE_DIALOG_MEDIA_ACTIONS]||e[He.HIDE_DIALOG_UPDATE_ACTIONS]||e[He.HIDE_DIALOG_CAMERA_ACTIONS]||e[He.HIDE_DIALOG_LIGHT_ACTIONS]||e[He.HIDE_DIALOG_LIGHT_CONTROL_ACTIONS]||e[He.HIDE_DIALOG_LIGHT_COLOR_ACTIONS]||e[He.HIDE_DIALOG_LIGHT_SETTINGS_ACTIONS]){var n=[e[He.HIDE_DIALOG_TIMER_ACTIONS]&&t.host.localName===je.HA_DIALOG_TIMER&&it.DIALOG_TIMER_ACTIONS,e[He.HIDE_DIALOG_MEDIA_ACTIONS]&&t.host.localName===je.HA_DIALOG_MEDIA_PLAYER&&it.DIALOG_MEDIA_ACTIONS,e[He.HIDE_DIALOG_UPDATE_ACTIONS]&&t.host.localName===je.HA_DIALOG_UPDATE&&it.DIALOG_UPDATE_ACTIONS,t.host.localName===je.HA_DIALOG_CAMERA&&it.DIALOG_CAMERA_ACTIONS,(e[He.HIDE_DIALOG_LIGHT_ACTIONS]||e[He.HIDE_DIALOG_LIGHT_CONTROL_ACTIONS])&&it.DIALOG_LIGHT_CONTROL_ACTIONS,(e[He.HIDE_DIALOG_LIGHT_ACTIONS]||e[He.HIDE_DIALOG_LIGHT_COLOR_ACTIONS])&&it.DIALOG_LIGHT_COLOR_ACTIONS,(e[He.HIDE_DIALOG_LIGHT_ACTIONS]||e[He.HIDE_DIALOG_LIGHT_SETTINGS_ACTIONS])&&it.DIALOG_LIGHT_SETTINGS_ACTIONS];l.styleManager.addStyle(n,t),et(Ge.CACHE)&&(e[He.HIDE_DIALOG_TIMER_ACTIONS]&&tt(qe,He.HIDE_DIALOG_TIMER_ACTIONS),e[He.HIDE_DIALOG_MEDIA_ACTIONS]&&tt(qe,He.HIDE_DIALOG_MEDIA_ACTIONS),e[He.HIDE_DIALOG_UPDATE_ACTIONS]&&tt(qe,He.HIDE_DIALOG_UPDATE_ACTIONS),e[He.HIDE_DIALOG_CAMERA_ACTIONS]&&tt(qe,He.HIDE_DIALOG_CAMERA_ACTIONS),e[He.HIDE_DIALOG_LIGHT_ACTIONS]&&tt(qe,He.HIDE_DIALOG_LIGHT_ACTIONS),e[He.HIDE_DIALOG_LIGHT_CONTROL_ACTIONS]&&tt(qe,He.HIDE_DIALOG_LIGHT_CONTROL_ACTIONS),e[He.HIDE_DIALOG_LIGHT_COLOR_ACTIONS]&&tt(qe,He.HIDE_DIALOG_LIGHT_COLOR_ACTIONS),e[He.HIDE_DIALOG_LIGHT_SETTINGS_ACTIONS]&&tt(qe,He.HIDE_DIALOG_LIGHT_SETTINGS_ACTIONS))}else l.styleManager.removeStyle(t)})),e[He.HIDE_DIALOG_HISTORY]||e[He.HIDE_DIALOG_LOGBOOK]?(c=[e[He.HIDE_DIALOG_HISTORY]&&it.DIALOG_HISTORY,e[He.HIDE_DIALOG_LOGBOOK]&&it.DIALOG_LOGBOOK],this.styleManager.addStyle(c,i),et(Ge.CACHE)&&(e[He.HIDE_DIALOG_HISTORY]&&tt(qe,He.HIDE_DIALOG_HISTORY),e[He.HIDE_DIALOG_LOGBOOK]&&tt(qe,He.HIDE_DIALOG_LOGBOOK))):this.styleManager.removeStyle(i),r.query(je.HA_DIALOG_HISTORY).$.element.then((function(t){e[He.HIDE_DIALOG_HISTORY_SHOW_MORE]?(l.styleManager.addStyle(it.DIALOG_SHOW_MORE,t),et(Ge.CACHE)&&tt(qe,He.HIDE_DIALOG_HISTORY_SHOW_MORE)):l.styleManager.removeStyle(t)})),r.query(je.HA_DIALOG_LOGBOOK).$.element.then((function(t){e[He.HIDE_DIALOG_LOGBOOK_SHOW_MORE]?(l.styleManager.addStyle(it.DIALOG_SHOW_MORE,t),et(Ge.CACHE)&&tt(qe,He.HIDE_DIALOG_LOGBOOK_SHOW_MORE)):l.styleManager.removeStyle(t)})),[2]}}))}))},r.prototype.resizeWindow=function(){var e=this;window.clearTimeout(this.resizeDelay),this.resizeDelay=window.setTimeout((function(){e.updateMenuItemsLabels()}),250)},r.prototype.updateMenuItemsLabels=function(){var e=this;this.menuTranslations&&(this.HAElements.HEADER.selector.query("".concat(je.TOOLBAR," > ").concat(je.ACTION_ITEMS," > ").concat(je.MENU_ITEM)).all.then((function(t){!function(e,t){e.forEach((function(e){if(e&&e.dataset&&!e.dataset.selector){var n=e.getAttribute("aria-labelledby");if(!n)return;var o=e.parentElement.querySelector("#".concat(n.trim()));if(!o)return;var r=rt(o.textContent);e.dataset.selector=t[r]}}))}(t,e.menuTranslations)})),this.HAElements.HEADER.selector.query("".concat(je.TOOLBAR," > ").concat(je.ACTION_ITEMS," > ").concat(je.DROPDOWN)).all.then((function(t){!function(e,t){e.forEach((function(e){var n=e.querySelector(je.MENU_ITEM);if(n&&n.dataset&&!n.dataset.selector){var o=n.shadowRoot.querySelector(je.HA_BUTTON);n.dataset.selector=t[o.getAttribute("aria-label").trim()]}}))}(t,e.menuTranslations)})),this.HAElements.HEADER.selector.query("".concat(je.TOOLBAR," ").concat(je.DROPDOWN_MENU_ITEM)).all.then((function(t){!function(e,t){e.forEach((function(e){if(e&&e.dataset&&!e.dataset.selector){var n=rt(e.textContent);e.dataset.selector=t[n]}}))}(t,e.menuTranslations)})))},r.prototype.blockEventHandler=function(e){e.preventDefault(),e.stopImmediatePropagation()},r.prototype.setOptions=function(t,n){var o=this;Object.values(e(e({},ye),He)).forEach((function(e){e in n&&o.setOptionsOrSubscribeToSetOptions(t,n,e)})),me.IGNORE_DISABLE_KM in n&&this.setOptionsOrSubscribeToSetOptions(t,n,me.IGNORE_DISABLE_KM)},r.prototype.setOptionsOrSubscribeToSetOptions=function(e,t,n){var o=this,r=this._getPanelUrl(),i=t[n],a=function(t,i){o._getPanelUrl()===r&&(n===ye.DEBUG_TEMPLATE?It.debugTemplate(t,i):(o._isDebug(e.debug)&&It.debug(n,t,i),o.runThrottle()))};if("boolean"==typeof i)e[n]=i;else if($e.test(i)){this._renderer.trackTemplate(i.replace($e,"$1"),(function(t){e[n]="boolean"==typeof t&&t,a(i,t)}))}else{if(!ze.test(i))throw SyntaxError("".concat(be,': the value "').concat(i,'" of the option "').concat(n,'" is not a well formed JavaScript or Jinja template'));window.hassConnection.then((function(t){t.conn.subscribeMessage((function(t){var o=t.result;e[n]="boolean"==typeof o&&o,a(i,o)}),{type:"render_template",template:i,variables:{user_name:o.ha.hass.user.name,user_is_admin:o.ha.hass.user.is_admin,user_is_owner:o.ha.hass.user.is_owner,user_agent:window.navigator.userAgent}})}))}},r}();It.logInfo(),Promise.resolve(customElements.whenDefined(je.HUI_VIEW)).then((function(){window.KioskMode=new At}))}();