!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=Le(e,o,i),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=new Map(Object.entries(ue(ue({},this._variables),t))),o=e.trim().replace(this._clientSideEntitiesRegExp,"$1clientSide.$2$3"),r=o.includes("return")||!this._autoReturn?o:"return ".concat(o);return(new(Function.bind.apply(Function,Ee(Ee([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"],Array.from(n.keys()),!1),["".concat('"use strict";'," ").concat(r)],!1)))).apply(void 0,Ee([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))],Array.from(n.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}),e}(),me=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 ve(e,t)}))}return e.prototype.getRenderer=function(){return this._renderer},e}(),Ge="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_ACCOUNT="hide_account",e.HIDE_NOTIFICATIONS="hide_notifications",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_ATTRIBUTES="hide_dialog_attributes",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"}(Se||(Se={})),function(e){e.IGNORE_MOBILE_SETTINGS="ignore_mobile_settings",e.IGNORE_DISABLE_KM="ignore_disable_km"}(Re||(Re={})),function(e){e.DEBUG="debug",e.DEBUG_TEMPLATE="debug_template"}(He||(He={})),function(e){e.CACHE="cache",e.CLEAR_CACHE="clear_km_cache",e.DISABLE_KIOSK_MODE="disable_km"}(Ne||(Ne={}));var ye,Ce="ui",ge="".concat(Ce,".common"),Me="".concat(Ce,".panel"),be="".concat(Me,".lovelace"),we="".concat(be,".menu"),Ue="".concat(be,".editor"),Be="".concat(Ue,".menu"),Pe="".concat(Ce,".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"}(ye||(ye={}));var Fe,xe=Object.freeze(((pe={})[ye.ADD]="".concat(we,".add"),pe[ye.OVERFLOW]="".concat(Be,".open"),pe[ye.SEARCH]="".concat(we,".search_entities"),pe[ye.ASSIST]="".concat(we,".assist_tooltip"),pe[ye.REFRESH]="".concat(ge,".refresh"),pe[ye.UNUSED_ENTITIES]="".concat(be,".unused_entities.title"),pe[ye.RELOAD_RESOURCES]="".concat(we,".reload_resources"),pe[ye.EDIT_DASHBOARD]="".concat(we,".configure_ui"),pe[ye.DIALOG_HISTORY]="".concat(Pe,".history"),pe[ye.DIALOG_SETTINGS]="".concat(Pe,".settings"),pe[ye.DIALOG_DISMISS]="".concat(ge,".close"),pe));!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.BUTTON_MENU="ha-button-menu",e.OVERLAY_MENU_ITEM="ha-list-item",e.TOOLBAR=".toolbar",e.ACTION_ITEMS=".action-items",e.HA_MORE_INFO_DIALOG="ha-more-info-dialog",e.HA_DIALOG="ha-dialog",e.HA_DIALOG_HEADER="ha-dialog-header",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",e.HA_DIALOG_ATTRIBUTES="ha-attributes"}(Fe||(Fe={}));var Ve,je=/^(.*?)( \([A-Z]\))?$/,ke="true",We=/^\s*\[\[\[([\s\S]+)\]\]\]\s*$/,Ke=/\{\{[\s\S]*\}\}|\{%[\s\S]*%\}/,Ye="hass-toggle-menu",qe="MDCDrawer:closed",$e="resize",ze=function(e){var t=e.replace(/(?:^|_)([a-z])/g,(function(e,t){return t.toUpperCase()}));return"km".concat(t)},Je=function(){for(var e=[],t=0;t ha-sidebar":!1,".header":{width:"100% !important"}},ASIDE:Ze(".mdc-drawer"),OVERFLOW_MENU:Ze("".concat(Fe.TOOLBAR," > ").concat(Fe.ACTION_ITEMS," > ").concat(Fe.BUTTON_MENU," > ").concat(Fe.MENU_ITEM,'[data-selector="').concat(ye.OVERFLOW,'"]')),BLOCK_OVERFLOW:(Ve={},Ve["".concat(Fe.TOOLBAR," > ").concat(Fe.ACTION_ITEMS," > ").concat(Fe.BUTTON_MENU)]={"pointer-events":"none !important"},Ve),ADD_TO_HOME_ASSISTANT:Ze("".concat(Fe.TOOLBAR," > ").concat(Fe.ACTION_ITEMS," > ").concat(Fe.BUTTON_MENU," > ").concat(Fe.MENU_ITEM,'[data-selector="').concat(ye.ADD,'"]'),"".concat(Fe.TOOLBAR," > ").concat(Fe.ACTION_ITEMS," > ").concat(Fe.BUTTON_MENU," > ").concat(Fe.OVERLAY_MENU_ITEM,'[data-selector="').concat(ye.ADD,'"]')),SEARCH:Ze("".concat(Fe.TOOLBAR," > ").concat(Fe.ACTION_ITEMS," > ").concat(Fe.MENU_ITEM,'[data-selector="').concat(ye.SEARCH,'"]'),"".concat(Fe.TOOLBAR," > ").concat(Fe.ACTION_ITEMS," > ").concat(Fe.BUTTON_MENU," > ").concat(Fe.OVERLAY_MENU_ITEM,'[data-selector="').concat(ye.SEARCH,'"]')),ASSISTANT:Ze("".concat(Fe.TOOLBAR," > ").concat(Fe.ACTION_ITEMS," > ").concat(Fe.MENU_ITEM,'[data-selector="').concat(ye.ASSIST,'"]'),"".concat(Fe.TOOLBAR," > ").concat(Fe.ACTION_ITEMS," > ").concat(Fe.BUTTON_MENU," > ").concat(Fe.OVERLAY_MENU_ITEM,'[data-selector="').concat(ye.ASSIST,'"]')),REFRESH:Ze("".concat(Fe.TOOLBAR," > ").concat(Fe.ACTION_ITEMS," > ").concat(Fe.BUTTON_MENU," > ").concat(Fe.OVERLAY_MENU_ITEM,'[data-selector="').concat(ye.REFRESH,'"]')),UNUSED_ENTITIES:Ze("".concat(Fe.TOOLBAR," > ").concat(Fe.ACTION_ITEMS," > ").concat(Fe.BUTTON_MENU," > ").concat(Fe.OVERLAY_MENU_ITEM,'[data-selector="').concat(ye.UNUSED_ENTITIES,'"]')),RELOAD_RESOURCES:Ze("".concat(Fe.TOOLBAR," > ").concat(Fe.ACTION_ITEMS," > ").concat(Fe.BUTTON_MENU," > ").concat(Fe.OVERLAY_MENU_ITEM,'[data-selector="').concat(ye.RELOAD_RESOURCES,'"]')),EDIT_DASHBOARD:Ze("".concat(Fe.TOOLBAR," > ").concat(Fe.ACTION_ITEMS," > ").concat(Fe.MENU_ITEM,'[data-selector="').concat(ye.EDIT_DASHBOARD,'"]'),"".concat(Fe.TOOLBAR," > ").concat(Fe.ACTION_ITEMS," > ").concat(Fe.BUTTON_MENU," > ").concat(Fe.OVERLAY_MENU_ITEM,'[data-selector="').concat(ye.EDIT_DASHBOARD,'"]')),DIALOG_HEADER_BREADCRUMB_NAVIGATION:Ze("".concat(Fe.HA_DIALOG_HEADER," > .title > .breadcrumb")),DIALOG_HEADER_HISTORY:Ze("".concat(Fe.HA_DIALOG_HEADER," > ").concat(Fe.MENU_ITEM,'[data-selector="').concat(ye.DIALOG_HISTORY,'"]')),DIALOG_HEADER_SETTINGS:Ze("".concat(Fe.HA_DIALOG_HEADER," > ").concat(Fe.MENU_ITEM,'[data-selector="').concat(ye.DIALOG_SETTINGS,'"]')),DIALOG_HEADER_OVERFLOW:Ze("".concat(Fe.HA_DIALOG_HEADER," > ").concat(Fe.BUTTON_MENU)),DIALOG_HISTORY:Ze(Fe.HA_DIALOG_HISTORY),DIALOG_LOGBOOK:Ze(Fe.HA_DIALOG_LOGBOOK),DIALOG_ATTRIBUTES:Ze(Fe.HA_DIALOG_ATTRIBUTES),DIALOG_MEDIA_ACTIONS:Ze(".bottom-controls > :is(.main-controls, .controls-row)"),DIALOG_TIMER_ACTIONS:Ze(".actions"),DIALOG_UPDATE_ACTIONS:Ze(".actions","ha-md-list:has(+ .actions)","hr:has(+ .actions)"),DIALOG_CAMERA_ACTIONS:Ze(".actions"),DIALOG_CLIMATE_CONTROL_SELECT:Ze(Fe.HA_DIALOG_CLIMATE_CONTROL_SELECT),DIALOG_CLIMATE_TEMPERATURE_BUTTONS:Ze(Fe.HA_DIALOG_CLIMATE_TEMPERATURE_BUTTONS),DIALOG_CLIMATE_CIRCULAR_SLIDER_INTERACTION:Ze(Fe.HA_DIALOG_CLIMATE_CIRCULAR_SLIDER_INTERACTION,Fe.HA_DIALOG_CLIMATE_CIRCULAR_SLIDER_INTERACTION_SLIDER,Fe.HA_DIALOG_CLIMATE_CIRCULAR_SLIDER_INTERACTION_TARGET_BORDER,Fe.HA_DIALOG_CLIMATE_CIRCULAR_SLIDER_INTERACTION_TARGET),DIALOG_LIGHT_CONTROL_ACTIONS:Ze(".controls > ".concat(Fe.HA_DIALOG_LIGHT_BRIGHTNESS," + ").concat(Fe.HA_DIALOG_LIGHT_CONTROLS)),DIALOG_LIGHT_COLOR_ACTIONS:Ze(".controls > ".concat(Fe.HA_DIALOG_LIGHT_COLORS)),DIALOG_LIGHT_SETTINGS_ACTIONS:Ze(".controls:has(> ".concat(Fe.HA_DIALOG_LIGHT_BRIGHTNESS,") + div > ").concat(Fe.HA_DIALOG_LIGHT_SETTINGS)),DIALOG_SHOW_MORE:Ze(".header a")},nt=[{content:"%c≡ kiosk-mode",color:"white",background:"#03a9f4"},{content:"%cversion ".concat("9.0.2")}],ot="font-weight: normal; color: inherit;",rt="font-weight: bold; color: blue;",it="font-weight: bold; color: red;",at="font-weight: bold; color: green;",st="color: #666",_t="text-decoration: underline",ct=Object.values(Re),lt=function(){function t(){}return t.logInfo=function(){var t=[],n=[],o=nt.length-1,r={"border-color":"#424242","border-style":"solid",display:"inline-block","font-family":"monospace","font-size":"12px"};nt.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 me(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===(D=null===(T=this.ha.hass)||void 0===T?void 0:T.config)||void 0===D?void 0:D.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&&(!Je(Ne.DISABLE_KIOSK_MODE)||e[Re.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(Fe.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(Ge,": 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(Fe.HA_MORE_INFO_DIALOG),o=null==n?void 0:n.shadowRoot.querySelector(Fe.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(E){return this._isDebug(r.debug)&<.debugRawConfig(r,this._getPanelUrl()),i={},a={},Object.values(Se).forEach((function(e){i[e]=!1,a[e]=!1})),Object.values(Re).forEach((function(e){i[e]=!1,a[e]=!1})),Object.values(He).forEach((function(e){i[e]=!1,a[e]=!1})),function(e,r){return t(void 0,void 0,void 0,(function(){var t,i,a,s;return n(this,(function(n){switch(n.label){case 0:return t=Object.entries(xe),i=r[0]<2025||2025===r[0]&&r[1]<9,a=i?t.filter((function(e){var t=e[1];return xe[ye.ADD]!==t})):t,[4,o((function(){return a.map((function(t){var n=t[0],o=t[1];return[e.hass.localize(o),n]}))}),(function(e){return!e.find((function(e){return!e[0]}))}),{retries:500,delay:50})];case 1:return s=n.sent(),[2,Object.fromEntries(s)]}}))}))}(this.ha,this.version).then((function(e){u.menuTranslations=e,u.updateMenuItemsLabels()})).catch((function(){console.warn("".concat(Ge,": ").concat("[ Non critial warning ]"," Cannot get resources translations"))})),Xe.apply(void 0,Object.values(Se))||Je.apply(void 0,Object.values(Se))?Object.values(Se).forEach((function(e){i[e]=Xe(e)||Je(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[Re.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(Fe.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(Fe.MENU_ITEM_ICON);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(Fe.HA_DIALOG_MORE_INFO,", ").concat(Fe.HA_DIALOG_MORE_INFO_HISTORY_AND_LOGBOOK)).$).element];case 2:return i=n.sent(),e[Se.HIDE_DIALOG_HEADER_BREADCRUMB_NAVIGATION]||e[Se.HIDE_DIALOG_HEADER_ACTION_ITEMS]||e[Se.HIDE_DIALOG_HEADER_HISTORY]||e[Se.HIDE_DIALOG_HEADER_SETTINGS]||e[Se.HIDE_DIALOG_HEADER_OVERFLOW]?(c=[e[Se.HIDE_DIALOG_HEADER_BREADCRUMB_NAVIGATION]&&tt.DIALOG_HEADER_BREADCRUMB_NAVIGATION,(e[Se.HIDE_DIALOG_HEADER_ACTION_ITEMS]||e[Se.HIDE_DIALOG_HEADER_HISTORY])&&tt.DIALOG_HEADER_HISTORY,(e[Se.HIDE_DIALOG_HEADER_ACTION_ITEMS]||e[Se.HIDE_DIALOG_HEADER_SETTINGS])&&tt.DIALOG_HEADER_SETTINGS,(e[Se.HIDE_DIALOG_HEADER_ACTION_ITEMS]||e[Se.HIDE_DIALOG_HEADER_OVERFLOW])&&tt.DIALOG_HEADER_OVERFLOW],this.styleManager.addStyle(c,t),Je(Ne.CACHE)&&(e[Se.HIDE_DIALOG_HEADER_BREADCRUMB_NAVIGATION]&&Qe(ke,Se.HIDE_DIALOG_HEADER_BREADCRUMB_NAVIGATION),e[Se.HIDE_DIALOG_HEADER_ACTION_ITEMS]&&Qe(ke,Se.HIDE_DIALOG_HEADER_ACTION_ITEMS),e[Se.HIDE_DIALOG_HEADER_HISTORY]&&Qe(ke,Se.HIDE_DIALOG_HEADER_HISTORY),e[Se.HIDE_DIALOG_HEADER_SETTINGS]&&Qe(ke,Se.HIDE_DIALOG_HEADER_SETTINGS),e[Se.HIDE_DIALOG_HEADER_OVERFLOW]&&Qe(ke,Se.HIDE_DIALOG_HEADER_OVERFLOW))):this.styleManager.removeStyle(t),a=r.query(Fe.HA_DIALOG_MORE_INFO_CONTENT).$.query(Fe.HA_DIALOG_CLIMATE).$,s=a.query(Fe.HA_STATE_CONTROL_CLIMATE_TEMPERATURE).$,_=s.query(Fe.HA_DIALOG_CLIMATE_CIRCULAR_SLIDER).$,a.element.then((function(t){e[Se.HIDE_DIALOG_CLIMATE_ACTIONS]||e[Se.HIDE_DIALOG_CLIMATE_SETTINGS_ACTIONS]?(l.styleManager.addStyle(tt.DIALOG_CLIMATE_CONTROL_SELECT,t),Je(Ne.CACHE)&&(e[Se.HIDE_DIALOG_CLIMATE_ACTIONS]&&Qe(ke,Se.HIDE_DIALOG_CLIMATE_ACTIONS),e[Se.HIDE_DIALOG_CLIMATE_SETTINGS_ACTIONS]&&Qe(ke,Se.HIDE_DIALOG_CLIMATE_SETTINGS_ACTIONS))):l.styleManager.removeStyle(t)})),s.element.then((function(t){e[Se.HIDE_DIALOG_CLIMATE_ACTIONS]||e[Se.HIDE_DIALOG_CLIMATE_TEMPERATURE_ACTIONS]?(l.styleManager.addStyle(tt.DIALOG_CLIMATE_TEMPERATURE_BUTTONS,t),Je(Ne.CACHE)&&e[Se.HIDE_DIALOG_CLIMATE_TEMPERATURE_ACTIONS]&&Qe(ke,Se.HIDE_DIALOG_CLIMATE_TEMPERATURE_ACTIONS)):l.styleManager.removeStyle(t)})),_.element.then((function(t){e[Se.HIDE_DIALOG_CLIMATE_ACTIONS]||e[Se.HIDE_DIALOG_CLIMATE_TEMPERATURE_ACTIONS]?l.styleManager.addStyle(tt.DIALOG_CLIMATE_CIRCULAR_SLIDER_INTERACTION,t):l.styleManager.removeStyle(t)})),r.query(Fe.HA_DIALOG_MORE_INFO_CONTENT).$.query([Fe.HA_DIALOG_DEFAULT,Fe.HA_DIALOG_LIGHT,Fe.HA_DIALOG_LOCK,Fe.HA_DIALOG_MEDIA_PLAYER,Fe.HA_DIALOG_PERSON,Fe.HA_DIALOG_SIREN,Fe.HA_DIALOG_TIMER,Fe.HA_DIALOG_UPDATE,Fe.HA_DIALOG_VACUUM,Fe.HA_DIALOG_CAMERA].join(",")).$.element.then((function(t){if(e[Se.HIDE_DIALOG_ATTRIBUTES]||e[Se.HIDE_DIALOG_TIMER_ACTIONS]||e[Se.HIDE_DIALOG_MEDIA_ACTIONS]||e[Se.HIDE_DIALOG_UPDATE_ACTIONS]||e[Se.HIDE_DIALOG_CAMERA_ACTIONS]||e[Se.HIDE_DIALOG_LIGHT_ACTIONS]||e[Se.HIDE_DIALOG_LIGHT_CONTROL_ACTIONS]||e[Se.HIDE_DIALOG_LIGHT_COLOR_ACTIONS]||e[Se.HIDE_DIALOG_LIGHT_SETTINGS_ACTIONS]){var n=[e[Se.HIDE_DIALOG_ATTRIBUTES]&&tt.DIALOG_ATTRIBUTES,e[Se.HIDE_DIALOG_TIMER_ACTIONS]&&t.host.localName===Fe.HA_DIALOG_TIMER&&tt.DIALOG_TIMER_ACTIONS,e[Se.HIDE_DIALOG_MEDIA_ACTIONS]&&t.host.localName===Fe.HA_DIALOG_MEDIA_PLAYER&&tt.DIALOG_MEDIA_ACTIONS,e[Se.HIDE_DIALOG_UPDATE_ACTIONS]&&t.host.localName===Fe.HA_DIALOG_UPDATE&&tt.DIALOG_UPDATE_ACTIONS,t.host.localName===Fe.HA_DIALOG_CAMERA&&tt.DIALOG_CAMERA_ACTIONS,(e[Se.HIDE_DIALOG_LIGHT_ACTIONS]||e[Se.HIDE_DIALOG_LIGHT_CONTROL_ACTIONS])&&tt.DIALOG_LIGHT_CONTROL_ACTIONS,(e[Se.HIDE_DIALOG_LIGHT_ACTIONS]||e[Se.HIDE_DIALOG_LIGHT_COLOR_ACTIONS])&&tt.DIALOG_LIGHT_COLOR_ACTIONS,(e[Se.HIDE_DIALOG_LIGHT_ACTIONS]||e[Se.HIDE_DIALOG_LIGHT_SETTINGS_ACTIONS])&&tt.DIALOG_LIGHT_SETTINGS_ACTIONS];l.styleManager.addStyle(n,t),Je(Ne.CACHE)&&(e[Se.HIDE_DIALOG_ATTRIBUTES]&&Qe(ke,Se.HIDE_DIALOG_ATTRIBUTES),e[Se.HIDE_DIALOG_TIMER_ACTIONS]&&Qe(ke,Se.HIDE_DIALOG_TIMER_ACTIONS),e[Se.HIDE_DIALOG_MEDIA_ACTIONS]&&Qe(ke,Se.HIDE_DIALOG_MEDIA_ACTIONS),e[Se.HIDE_DIALOG_UPDATE_ACTIONS]&&Qe(ke,Se.HIDE_DIALOG_UPDATE_ACTIONS),e[Se.HIDE_DIALOG_CAMERA_ACTIONS]&&Qe(ke,Se.HIDE_DIALOG_CAMERA_ACTIONS),e[Se.HIDE_DIALOG_LIGHT_ACTIONS]&&Qe(ke,Se.HIDE_DIALOG_LIGHT_ACTIONS),e[Se.HIDE_DIALOG_LIGHT_CONTROL_ACTIONS]&&Qe(ke,Se.HIDE_DIALOG_LIGHT_CONTROL_ACTIONS),e[Se.HIDE_DIALOG_LIGHT_COLOR_ACTIONS]&&Qe(ke,Se.HIDE_DIALOG_LIGHT_COLOR_ACTIONS),e[Se.HIDE_DIALOG_LIGHT_SETTINGS_ACTIONS]&&Qe(ke,Se.HIDE_DIALOG_LIGHT_SETTINGS_ACTIONS))}else l.styleManager.removeStyle(t)})),e[Se.HIDE_DIALOG_HISTORY]||e[Se.HIDE_DIALOG_LOGBOOK]?(c=[e[Se.HIDE_DIALOG_HISTORY]&&tt.DIALOG_HISTORY,e[Se.HIDE_DIALOG_LOGBOOK]&&tt.DIALOG_LOGBOOK],this.styleManager.addStyle(c,i),Je(Ne.CACHE)&&(e[Se.HIDE_DIALOG_HISTORY]&&Qe(ke,Se.HIDE_DIALOG_HISTORY),e[Se.HIDE_DIALOG_LOGBOOK]&&Qe(ke,Se.HIDE_DIALOG_LOGBOOK))):this.styleManager.removeStyle(i),r.query(Fe.HA_DIALOG_HISTORY).$.element.then((function(t){e[Se.HIDE_DIALOG_HISTORY_SHOW_MORE]?(l.styleManager.addStyle(tt.DIALOG_SHOW_MORE,t),Je(Ne.CACHE)&&Qe(ke,Se.HIDE_DIALOG_HISTORY_SHOW_MORE)):l.styleManager.removeStyle(t)})),r.query(Fe.HA_DIALOG_LOGBOOK).$.element.then((function(t){e[Se.HIDE_DIALOG_LOGBOOK_SHOW_MORE]?(l.styleManager.addStyle(tt.DIALOG_SHOW_MORE,t),Je(Ne.CACHE)&&Qe(ke,Se.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(Fe.TOOLBAR," > ").concat(Fe.ACTION_ITEMS," > ").concat(Fe.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=et(o.textContent);e.dataset.selector=t[r]}}))}(t,e.menuTranslations)})),this.HAElements.HEADER.selector.query("".concat(Fe.TOOLBAR," > ").concat(Fe.ACTION_ITEMS," > ").concat(Fe.BUTTON_MENU)).all.then((function(t){!function(e,t){e.forEach((function(e){var n=e.querySelector(Fe.MENU_ITEM);if(n&&n.dataset&&!n.dataset.selector){var o=n.getAttribute("aria-labelledby");if(o){var r=e.parentElement.querySelector("#".concat(o.trim()));if(!r)return;var i=et(r.textContent);n.dataset.selector=t[i]}else{var a=n.shadowRoot.querySelector(Fe.MENU_ITEM_ICON);if(a.title)n.dataset.selector=t[a.title.trim()];else{var s=a.shadowRoot.querySelector("button");n.dataset.selector=t[s.getAttribute("aria-label").trim()]}}}}))}(t,e.menuTranslations)})),this.HAElements.HEADER.selector.query("".concat(Fe.TOOLBAR," ").concat(Fe.OVERLAY_MENU_ITEM)).all.then((function(t){!function(e,t){e.forEach((function(e){if(e&&e.dataset&&!e.dataset.selector){var n=et(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({},He),Se)).forEach((function(e){e in n&&o.setOptionsOrSubscribeToSetOptions(t,n,e)})),Re.IGNORE_DISABLE_KM in n&&this.setOptionsOrSubscribeToSetOptions(t,n,Re.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===He.DEBUG_TEMPLATE?lt.debugTemplate(t,i):(o._isDebug(e.debug)&<.debug(n,t,i),o.runThrottle()))};if("boolean"==typeof i)e[n]=i;else if(We.test(i)){this._renderer.trackTemplate(i.replace(We,"$1"),(function(t){e[n]="boolean"==typeof t&&t,a(i,t)}))}else{if(!Ke.test(i))throw SyntaxError("".concat(Ge,': 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}();lt.logInfo(),Promise.resolve(customElements.whenDefined(Fe.HUI_VIEW)).then((function(){window.KioskMode=new ut}))}();