iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
25 lines • 28.6 kB
JavaScript
/*! For license information please see 52418.17822219c0432490.js.LICENSE.txt */
export const __rspack_esm_id=52418;export const __rspack_esm_ids=[52418];export const __webpack_modules__={90248(t,a,e){e.a(t,async function(t,o){try{e.r(a),e.d(a,{HaIconButtonArrowPrev:()=>p});var i=e(62826),s=e(5124),n=e(22441),r=e(63091),h=e(26300),d=t([h]);h=(d.then?(await d)():d)[0];const l="M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z",c="M4,11V13H16L10.5,18.5L11.92,19.92L19.84,12L11.92,4.08L10.5,5.5L16,11H4Z";class p extends s.WF{render(){return s.qy` <ha-icon-button .disabled="${this.disabled}" .label="${this.label||this.hass?.localize("ui.common.back")||"Back"}" .path="${this._icon}" .href="${this.href}" .target="${this.target}" .rel="${this.rel}" .download="${this.download}"></ha-icon-button> `}constructor(...t){super(...t),this.disabled=!1,this._icon="rtl"===r.G.document.dir?c:l}}(0,i.Cg)([(0,n.MZ)({attribute:!1})],p.prototype,"hass",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean})],p.prototype,"disabled",void 0),(0,i.Cg)([(0,n.MZ)()],p.prototype,"label",void 0),(0,i.Cg)([(0,n.MZ)()],p.prototype,"href",void 0),(0,i.Cg)([(0,n.MZ)()],p.prototype,"target",void 0),(0,i.Cg)([(0,n.MZ)()],p.prototype,"rel",void 0),(0,i.Cg)([(0,n.MZ)()],p.prototype,"download",void 0),(0,i.Cg)([(0,n.wk)()],p.prototype,"_icon",void 0),p=(0,i.Cg)([(0,n.EM)("ha-icon-button-arrow-prev")],p),o()}catch(t){o(t)}})},26300(t,a,e){e.a(t,async function(t,o){try{e.r(a),e.d(a,{HaIconButton:()=>l});var i=e(62826),s=e(5124),n=e(22441),r=e(63672),h=e(18350),d=(e(67094),t([h]));h=(d.then?(await d)():d)[0];class l extends s.WF{render(){return s.qy` <ha-button appearance="plain" variant="neutral" aria-label="${(0,r.J)(this.label)}" title="${(0,r.J)(this.hideTitle?void 0:this.label)}" aria-haspopup="${(0,r.J)(this.ariaHasPopup)}" .disabled="${this.disabled}" .iconTag="${this.path?"ha-svg-icon":"span"}" .href="${this.href}" .target="${this.target}" .rel="${this.rel}" .download="${this.download}"> ${this.path?s.qy`<ha-svg-icon aria-hidden="true" .path="${this.path}"></ha-svg-icon>`:s.qy`<span><slot></slot></span>`} </ha-button> `}constructor(...t){super(...t),this.disabled=!1,this.hideTitle=!1,this.selected=!1}}l.shadowRootOptions={mode:"open",delegatesFocus:!0},l.styles=s.AH`:host{display:inline-block;outline:0;--ha-button-height:var(--ha-icon-button-size, 48px)}ha-button{position:relative;isolation:isolate;--wa-form-control-padding-inline:var(
--ha-icon-button-padding-inline,
--ha-space-2
);--wa-color-on-normal:currentColor;--wa-color-fill-quiet:transparent;--ha-button-label-overflow:visible}ha-button::after{content:"";position:absolute;inset:0;z-index:-1;border-radius:50%;background-color:currentColor;opacity:0;pointer-events:none}ha-button::part(base){width:var(--wa-form-control-height);aspect-ratio:1;outline-offset:-4px}ha-button::part(label){display:flex}:host([selected]) ha-button::after{opacity:.1} (hover:hover){:host(:hover:not([disabled])) ha-button::after{opacity:.1}}`,(0,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],l.prototype,"disabled",void 0),(0,i.Cg)([(0,n.MZ)({type:String})],l.prototype,"path",void 0),(0,i.Cg)([(0,n.MZ)({type:String})],l.prototype,"label",void 0),(0,i.Cg)([(0,n.MZ)({type:String,attribute:"aria-haspopup"})],l.prototype,"ariaHasPopup",void 0),(0,i.Cg)([(0,n.MZ)({attribute:"hide-title",type:Boolean})],l.prototype,"hideTitle",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],l.prototype,"selected",void 0),(0,i.Cg)([(0,n.MZ)()],l.prototype,"href",void 0),(0,i.Cg)([(0,n.MZ)()],l.prototype,"target",void 0),(0,i.Cg)([(0,n.MZ)()],l.prototype,"rel",void 0),(0,i.Cg)([(0,n.MZ)()],l.prototype,"download",void 0),l=(0,i.Cg)([(0,n.EM)("ha-icon-button")],l),o()}catch(t){o(t)}})},2054(t,a,e){e.a(t,async function(t,a){try{var o=e(62826),i=e(5124),s=e(22441),n=e(1087),r=e(44249),h=e(26300),d=t([h]);h=(d.then?(await d)():d)[0];const l="M3,6H21V8H3V6M3,11H21V13H3V11M3,16H21V18H3V16Z";class c extends i.WF{connectedCallback(){super.connectedCallback(),this._attachNotifOnConnect&&(this._attachNotifOnConnect=!1,this._subscribeNotifications())}disconnectedCallback(){super.disconnectedCallback(),this._unsubNotifications&&(this._attachNotifOnConnect=!0,this._unsubNotifications(),this._unsubNotifications=void 0)}render(){if(!this._show)return i.s6;const t=this._hasNotifications&&(this.narrow||"always_hidden"===this.hass.dockedSidebar);return i.qy` <ha-icon-button .label="${this.hass.localize("ui.sidebar.sidebar_toggle")}" .path="${l}" ="${this._toggleMenu}"></ha-icon-button> ${t?i.qy`<div class="dot"></div>`:""} `}willUpdate(t){if(super.willUpdate(t),!t.has("narrow")&&!t.has("hass"))return;const a=t.has("hass")?t.get("hass"):this.hass,e=t.has("narrow")?t.get("narrow"):this.narrow,o=!1===a?.kioskMode&&(e||"always_hidden"===a?.dockedSidebar),i=!1===this.hass.kioskMode&&(this.narrow||"always_hidden"===this.hass.dockedSidebar);this.hasUpdated&&o===i||(this._show=i||this._alwaysVisible,i?this._subscribeNotifications():this._unsubNotifications&&(this._unsubNotifications(),this._unsubNotifications=void 0))}_subscribeNotifications(){if(this._unsubNotifications)throw new Error("Already subscribed");this._unsubNotifications=(0,r.V)(this.hass.connection,t=>{this._hasNotifications=t.length>0})}_toggleMenu(){(0,n.r)(this,"hass-toggle-menu")}constructor(...t){super(...t),this.narrow=!1,this._hasNotifications=!1,this._show=!1,this._alwaysVisible=!1,this._attachNotifOnConnect=!1}}c.styles=i.AH`:host{position:relative}.dot{pointer-events:none;position:absolute;background-color:var(--accent-color);width:12px;height:12px;top:9px;right:7px;inset-inline-end:7px;inset-inline-start:initial;border-radius:var(--ha-border-radius-circle);border:2px solid var(--app-header-background-color)}`,(0,o.Cg)([(0,s.MZ)({type:Boolean})],c.prototype,"narrow",void 0),(0,o.Cg)([(0,s.MZ)({attribute:!1})],c.prototype,"hass",void 0),(0,o.Cg)([(0,s.wk)()],c.prototype,"_hasNotifications",void 0),(0,o.Cg)([(0,s.wk)()],c.prototype,"_show",void 0),c=(0,o.Cg)([(0,s.EM)("ha-menu-button")],c),a()}catch(t){a(t)}})},67094(t,a,e){e.r(a),e.d(a,{HaSvgIcon:()=>n});var o=e(62826),i=e(5124),s=e(22441);class n extends i.WF{render(){return i.JW` <svg viewBox="${this.viewBox||"0 0 24 24"}" preserveAspectRatio="xMidYMid meet" focusable="false" role="img" aria-hidden="true"> <g> ${this.path?i.JW`<path class="primary-path" d="${this.path}"></path>`:i.s6} ${this.secondaryPath?i.JW`<path class="secondary-path" d="${this.secondaryPath}"></path>`:i.s6} </g> </svg>`}}n.styles=i.AH`:host{display:var(--ha-icon-display,inline-flex);align-items:center;justify-content:center;position:relative;vertical-align:middle;fill:var(--icon-primary-color,currentcolor);width:var(--mdc-icon-size,24px);height:var(--mdc-icon-size,24px)}svg{width:100%;height:100%;pointer-events:none;display:block}path.primary-path{opacity:var(--icon-primary-opactity, 1)}path.secondary-path{fill:var(--icon-secondary-color,currentcolor);opacity:var(--icon-secondary-opactity, .5)}`,(0,o.Cg)([(0,s.MZ)()],n.prototype,"path",void 0),(0,o.Cg)([(0,s.MZ)({attribute:!1})],n.prototype,"secondaryPath",void 0),(0,o.Cg)([(0,s.MZ)({attribute:!1})],n.prototype,"viewBox",void 0),n=(0,o.Cg)([(0,s.EM)("ha-svg-icon")],n)},22130(t,a,e){e.r(a),e.d(a,{fetchAddonInfo:()=>_,fetchHassioAddonChangelog:()=>h,fetchHassioAddonDocumentation:()=>l,fetchHassioAddonInfo:()=>r,fetchHassioAddonLogs:()=>d,fetchHassioAddonsInfo:()=>n,installHassioAddon:()=>m,rebuildLocalAddon:()=>w,reloadHassioAddons:()=>s,restartHassioAddon:()=>y,setHassioAddonOption:()=>c,setHassioAddonSecurity:()=>v,startHassioAddon:()=>g,stopHassioAddon:()=>u,uninstallHassioAddon:()=>b,updateHassioAddon:()=>f,validateHassioAddonOption:()=>p});e(18111),e(20116);var o=e(35541),i=e(47351);const s=async t=>{await t.callWS({type:"supervisor/api",endpoint:"/addons/reload",method:"post"})},n=async t=>t.callWS({type:"supervisor/api",endpoint:"/addons",method:"get"}),r=async(t,a)=>t({type:"supervisor/api",endpoint:`/addons/${a}/info`,method:"get"}),h=async(t,a)=>t.callApi("GET",`hassio/addons/${a}/changelog`),d=async(t,a)=>t.callApi("GET",`hassio/addons/${a}/logs`),l=async(t,a)=>t.callApi("GET",`hassio/addons/${a}/documentation`),c=async(t,a,e)=>{const o=await t({type:"supervisor/api",endpoint:`/addons/${a}/options`,method:"post",data:e});if("error"===o.result)throw Error((0,i.VR)(o));return o},p=async(t,a,e)=>t({type:"supervisor/api",endpoint:`/addons/${a}/options/validate`,method:"post",data:e}),g=async(t,a)=>t({type:"supervisor/api",endpoint:`/addons/${a}/start`,method:"post",timeout:null}),u=async(t,a)=>t({type:"supervisor/api",endpoint:`/addons/${a}/stop`,method:"post",timeout:null}),v=async(t,a,e)=>{await t({type:"supervisor/api",endpoint:`/addons/${a}/security`,method:"post",data:e})},m=async(t,a)=>{await t({type:"supervisor/api",endpoint:`/addons/${a}/install`,method:"post",timeout:null})},f=async(t,a,e)=>{await t.callWS({type:"hassio/update/addon",addon:a,backup:e})},y=async(t,a)=>{await t({type:"supervisor/api",endpoint:`/addons/${a}/restart`,method:"post",timeout:null})},b=async(t,a,e)=>{await t({type:"supervisor/api",endpoint:`/addons/${a}/uninstall`,method:"post",timeout:null,data:{remove_config:e}})},_=(t,a,e)=>(0,o.X)(t,a.addon?.addons.find(t=>t.slug===e)?`/addons/${e}/info`:`/store/addons/${e}`),w=async(t,a)=>t({type:"supervisor/api",endpoint:`/addons/${a}/rebuild`,method:"post",timeout:null})},47351(t,a,e){e.d(a,{PS:()=>o,Tv:()=>n,VR:()=>i,lE:()=>r});e(74423),e(17642),e(58004),e(33853),e(45876),e(32475),e(15024),e(31698);const o=t=>t.data,i=t=>"object"==typeof t?"object"==typeof t.body?t.body.message||"Unknown error, see supervisor logs":t.body||t.message||"Unknown error, see supervisor logs":t,s=new Set([502,503,504]),n=t=>!!(t&&t.status_code&&s.has(t.status_code))||!(!t||!t.message||!t.message.includes("ERR_CONNECTION_CLOSED")&&!t.message.includes("ERR_CONNECTION_RESET")),r=async(t,a)=>t({type:"supervisor/api",endpoint:`/${a}/stats`,method:"get"})},38395(t,a,e){e.d(a,{gh:()=>h,kU:()=>d,q:()=>r});var o=e(35518),i=e(62384),s=e(61557);function n(t){return document.cookie=`ingress_session=${t};path=/api/hassio_ingress/;SameSite=Strict${"https:"===location.protocol?";Secure":""}`,t}const r=async t=>{if((0,i.v)(t.config.version,2021,2,4)){return n((await t.callWS({type:"supervisor/api",endpoint:"/ingress/session",method:"post"})).session)}return n((await t.callApi("POST","hassio/ingress/session")).data.session)},h=t=>(0,o.X)(t,"_ingressPanelInfo",async t=>(await(0,s.uw)(t,{endpoint:"/ingress/panels"})).panels),d=async(t,a)=>{(0,i.v)(t.config.version,2021,2,4)?await t.callWS({type:"supervisor/api",endpoint:"/ingress/validate_session",method:"post",data:{session:a}}):await t.callApi("POST","hassio/ingress/validate_session",{session:a})}},44249(t,a,e){e.d(a,{V:()=>o});const o=(t,a)=>{const e=new i,o=t.subscribeMessage(t=>a(e.processMessage(t)),{type:"persistent_notification/subscribe"});return()=>{o.then(t=>t?.())}};class i{processMessage(t){if("removed"===t.type)for(const a of Object.keys(t.notifications))delete this.notifications[a];else this.notifications={...this.notifications,...t.notifications};return Object.values(this.notifications)}constructor(){this.notifications={}}}},35541(t,a,e){e.d(a,{X:()=>s});var o=e(62384),i=e(47351);const s=async(t,a,e)=>(0,o.v)(t.config.version,2021,2,4)?t.callWS({type:"supervisor/api",endpoint:a,method:e?.method||"get",timeout:e?.timeout??null,data:e?.data}):(0,i.PS)(await t.callApi((e.method||"get").toUpperCase(),`hassio${a}`,e?.data))},61557(t,a,e){e.d(a,{uw:()=>i});const o={type:"supervisor/api",method:"GET"},i=(t,a)=>t.sendMessagePromise({...o,...a})},23296(t,a,e){e.a(t,async function(t,o){try{e.r(a);var i=e(62826),s=e(5124),n=e(22441),r=e(91926),h=e(65829),d=e(90248),l=e(2054),c=e(14503),p=t([h,d,l]);[h,d,l]=p.then?(await p)():p;class g extends s.WF{render(){return s.qy` ${this.noToolbar?"":s.qy`<div class="toolbar"> ${this.rootnav||history.state?.root?s.qy` <ha-menu-button .hass="${this.hass}" .narrow="${this.narrow}"></ha-menu-button> `:s.qy` <ha-icon-button-arrow-prev .hass="${this.hass}" ="${this._handleBack}"></ha-icon-button-arrow-prev> `} </div>`} <div class="content"> <ha-spinner></ha-spinner> ${this.message?s.qy`<div id="loading-text">${this.message}</div>`:s.s6} </div> `}_handleBack(){(0,r.OE)()}static get styles(){return[c.RF,s.AH`:host{display:block;height:100%;background-color:var(--primary-background-color)}.toolbar{display:flex;align-items:center;font-size:var(--ha-font-size-xl);height:var(--header-height);padding:8px 12px;pointer-events:none;background-color:var(--app-header-background-color);font-weight:var(--ha-font-weight-normal);color:var(--app-header-text-color,#fff);border-bottom:var(--app-header-border-bottom,none);box-sizing:border-box} (max-width:599px){.toolbar{padding:4px}}ha-icon-button-arrow-prev,ha-menu-button{pointer-events:auto}.content{height:calc(100% - var(--header-height));display:flex;flex-direction:column;align-items:center;justify-content:center}#loading-text{max-width:350px;margin-top:16px}`]}constructor(...t){super(...t),this.noToolbar=!1,this.rootnav=!1,this.narrow=!1}}(0,i.Cg)([(0,n.MZ)({attribute:!1})],g.prototype,"hass",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,attribute:"no-toolbar"})],g.prototype,"noToolbar",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean})],g.prototype,"rootnav",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean})],g.prototype,"narrow",void 0),(0,i.Cg)([(0,n.MZ)()],g.prototype,"message",void 0),g=(0,i.Cg)([(0,n.EM)("hass-loading-screen")],g),o()}catch(t){o(t)}})},81625(t,a,e){e.a(t,async function(t,o){try{e.r(a);e(74423);var i=e(62826),s=e(5124),n=e(22441),r=e(6412),h=e(59455),d=e(22786),l=e(1087),c=e(91926),p=e(1974),g=e(12587),u=e(26300),v=e(22130),m=e(47351),f=e(38395),y=e(65063),b=e(23296),_=t([u,b]);[u,b]=_.then?(await _)():_;const w="M3,6H21V8H3V6M3,11H21V13H3V11M3,16H21V18H3V16Z",x=2e4,k=5e3;class $ extends s.WF{updated(t){super.updated(t),this._iframeSubscribeUpdates&&(t.has("narrow")||t.has("route"))&&this._sendPropertiesToIframe();const a=t.get("hass");a&&a.kioskMode!==this.hass.kioskMode&&(this._kioskMode=this.hass.kioskMode)}connectedCallback(){super.connectedCallback(),window.addEventListener("message",this._handleIframeMessage)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("message",this._handleIframeMessage),this._sessionKeepAlive&&(clearInterval(this._sessionKeepAlive),this._sessionKeepAlive=void 0),this._fetchDataTimeout&&(clearTimeout(this._fetchDataTimeout),this._fetchDataTimeout=void 0),this._enabledKioskMode&&(0,l.r)(window,"hass-kiosk-mode",{enable:!1})}render(){return this._addon?s.qy` ${this._kioskMode||!this.narrow&&"always_hidden"!==this.hass.dockedSidebar?s.s6:s.qy` <div class="header"> <ha-icon-button .label="${this.hass.localize("ui.sidebar.sidebar_toggle")}" .path="${w}" ="${this._toggleMenu}"></ha-icon-button> <div class="main-title">${this._addon.name}</div> </div> `} <iframe class="${(0,r.H)({loaded:this._iframeLoaded,"kiosk-mode":this._kioskMode})}" title="${this._addon.name}" src="${this._addon.ingress_url}" ="${this._checkLoaded}" ${(0,h.K)(this._iframeRef)}> </iframe> `:s.qy`<hass-loading-screen .message="${this._loadingMessage}"></hass-loading-screen>`}willUpdate(t){if(super.willUpdate(t),!t.has("route")&&!t.has("panel"))return;const a=this._getAddonSlug(),e=t.has("route")?t.get("route"):this.route,o=t.has("panel")?t.get("panel"):this.panel,i=this._getAddonSlugFromRoutePanel(e,o);a&&a!==i&&(this._loadingMessage=void 0,this._iframeLoaded=!1,this._enabledKioskMode&&((0,l.r)(window,"hass-kiosk-mode",{enable:!1}),this._enabledKioskMode=!1),this._iframeSubscribeUpdates=!1,this._autoRetryUntil=void 0,this._fetchData(a))}_getAddonSlug(){return this._getAddonSlugFromRoutePanel(this.route,this.panel)}_getAddonSlugFromRoutePanel(t,a){if(a?.config?.addon)return a.config.addon;if(t?.path){const a=t.path.indexOf("/",1),e=-1===a?t.path.substring(1):t.path.substring(1,a);if(e)return e}}async _showErrorAndNavigateHome(t,a){await this.updateComplete,await(0,y.showAlertDialog)(this,{title:t,text:a}),await(0,g.E)(),(0,c.oo)("/",{replace:!0})}async _fetchData(t){const a=(0,f.q)(this.hass);let e,o;try{e=await(0,v.fetchHassioAddonInfo)(this.hass.callWS,t)}catch(a){return void await this._showErrorAndNavigateHome(t,(0,m.VR)(a))}if(e.version)if(e.ingress_url){if(!e.state||!["startup","started"].includes(e.state)){await this.updateComplete;if(!await(0,y.dk)(this,{text:this.hass.localize("ui.panel.app.error_app_not_running"),title:e.name,confirmText:this.hass.localize("ui.panel.app.start_app"),dismissText:this.hass.localize("ui.common.no")}))return await(0,g.E)(),void(0,c.oo)("/",{replace:!0});try{return this._loadingMessage=this.hass.localize("ui.panel.app.app_starting"),this._autoRetryUntil=Date.now()+x,await(0,v.startHassioAddon)(this.hass.callWS,t),void this._fetchData(t)}catch(t){return void await this._showErrorAndNavigateHome(e.name,this.hass.localize("ui.panel.app.error_starting_app"))}}if("startup"===e.state)return this._loadingMessage=this.hass.localize("ui.panel.app.app_starting"),void(this._fetchDataTimeout=window.setTimeout(()=>{this._fetchData(t)},500));if("started"===e.state){this._loadingMessage=void 0,this._fetchDataTimeout&&(clearTimeout(this._fetchDataTimeout),this._fetchDataTimeout=void 0);try{o=await a}catch(t){return this._sessionKeepAlive&&clearInterval(this._sessionKeepAlive),void await this._showErrorAndNavigateHome(e.name,this.hass.localize("ui.panel.app.error_creating_session"))}this._getAddonSlug()===t&&(this._sessionKeepAlive&&clearInterval(this._sessionKeepAlive),this._sessionKeepAlive=window.setInterval(async()=>{try{await(0,f.kU)(this.hass,o)}catch(t){o=await(0,f.q)(this.hass)}},6e4),this._addon=e)}}else await this._showErrorAndNavigateHome(e.name,this.hass.localize("ui.panel.app.error_app_no_ingress"));else await this._showErrorAndNavigateHome(e.name,this.hass.localize("ui.panel.app.error_app_not_installed"))}async _checkLoaded(t){const a=t.target;this._iframeLoaded=!0,this._addon&&"502: Bad Gateway"===a.contentDocument?.body.textContent&&(this._autoRetryUntil&&Date.now()<this._autoRetryUntil?this._reloadIframe():(this._autoRetryUntil=void 0,await this.updateComplete,(0,y.dk)(this,{text:this.hass.localize("ui.panel.app.error_app_not_ready"),title:this._addon.name,confirmText:this.hass.localize("ui.panel.app.retry"),dismissText:this.hass.localize("ui.common.no"),confirm:()=>{this._autoRetryUntil=Date.now()+k,this._reloadIframe()}})))}async _reloadIframe(){const t=this._addon.slug;this._iframeLoaded=!1,this._addon=void 0,await Promise.all([this.updateComplete,new Promise(t=>{setTimeout(t,1e3)})]),this._getAddonSlug()===t&&this._fetchData(t)}_toggleMenu(){(0,l.r)(this,"hass-toggle-menu")}_sendPropertiesToIframe(){this._iframeRef.value?.contentWindow&&this._iframeRef.value.contentWindow.postMessage({type:"home-assistant/properties",narrow:this.narrow,route:this._computeRouteTail(this.route)},"*")}constructor(...t){super(...t),this.narrow=!1,this._kioskMode=!1,this._iframeLoaded=!1,this._enabledKioskMode=!1,this._iframeRef=(0,h._)(),this._iframeSubscribeUpdates=!1,this._handleIframeMessage=t=>{if(t.source!==this._iframeRef.value?.contentWindow)return;const{type:a,...e}=t.data;switch(a){case"home-assistant/navigate":(0,c.oo)(e.path,e.options);break;case"home-assistant/toggle-menu":this._toggleMenu();break;case"home-assistant/subscribe-properties":this._iframeSubscribeUpdates=!0,this._sendPropertiesToIframe(),e.kioskMode&&!this.hass.kioskMode&&(this._enabledKioskMode=!0,(0,l.r)(window,"hass-kiosk-mode",{enable:!0}));break;case"home-assistant/unsubscribe-properties":this._iframeSubscribeUpdates=!1,this._enabledKioskMode&&((0,l.r)(window,"hass-kiosk-mode",{enable:!1}),this._enabledKioskMode=!1)}},this._computeRouteTail=(0,d.A)(p.l)}}$.styles=s.AH`:host{display:block;height:100%}iframe{display:block;width:100%;height:100%;border:0;background-color:var(--primary-background-color);opacity:0;transition:opacity var(--ha-animation-duration-normal) ease}iframe.loaded{opacity:1}.header+iframe{height:calc(100% - 40px)}:host([narrow]) iframe{padding-top:var(--safe-area-inset-top);height:calc(100% - var(--safe-area-inset-top,0px))}:host([narrow]) .header+iframe{padding-top:0;height:calc(100% - 40px - var(--safe-area-inset-top,0px))}.header{display:flex;align-items:center;font-size:var(--ha-font-size-l);height:40px;padding:0 16px;pointer-events:none;background-color:var(--app-header-background-color);font-weight:var(--ha-font-weight-normal);color:var(--app-header-text-color,#fff);border-bottom:var(--app-header-border-bottom,none);box-sizing:border-box;--mdc-icon-size:20px}:host([narrow]) .header{height:calc(40px + var(--safe-area-inset-top,0px));padding-top:var(--safe-area-inset-top,0)}.main-title{margin-inline-start:var(--ha-space-6);line-height:var(--ha-line-height-condensed);flex-grow:1}.narrow .main-title{margin-inline-start:var(--ha-space-2)}ha-icon-button{pointer-events:auto}`,(0,i.Cg)([(0,n.MZ)({attribute:!1})],$.prototype,"hass",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],$.prototype,"route",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],$.prototype,"panel",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],$.prototype,"narrow",void 0),(0,i.Cg)([(0,n.wk)()],$.prototype,"_addon",void 0),(0,i.Cg)([(0,n.wk)()],$.prototype,"_loadingMessage",void 0),(0,i.Cg)([(0,n.wk)()],$.prototype,"_kioskMode",void 0),(0,i.Cg)([(0,n.wk)()],$.prototype,"_iframeLoaded",void 0),$=(0,i.Cg)([(0,n.EM)("ha-panel-app")],$),o()}catch(t){o(t)}})},14503(t,a,e){e.d(a,{RF:()=>s,dp:()=>h,kO:()=>r,nA:()=>n,og:()=>i});var o=e(5124);const i=o.AH`button.link{background:0 0;color:inherit;border:none;padding:0;font:inherit;text-align:left;text-decoration:underline;cursor:pointer;outline:0}`,s=o.AH`:host{font-family:var(--ha-font-family-body);-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);font-size:var(--ha-font-size-m);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-normal)}app-header div[sticky]{height:48px}app-toolbar [main-title]{margin-left:20px;margin-inline-start:20px;margin-inline-end:initial}.header{transition:box-shadow .2s linear,width var(--ha-animation-duration-normal) ease,padding-left var(--ha-animation-duration-normal) ease,padding-right var(--ha-animation-duration-normal) ease} (prefers-reduced-motion:reduce){.header{transition:box-shadow .2s linear}}h1{font-family:var(--ha-font-family-heading);-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);font-size:var(--ha-font-size-2xl);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-condensed)}h2{font-family:var(--ha-font-family-body);-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:var(--ha-font-size-xl);font-weight:var(--ha-font-weight-medium);line-height:var(--ha-line-height-normal)}h3{font-family:var(--ha-font-family-body);-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);font-size:var(--ha-font-size-l);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-normal)}a{color:var(--primary-color)}.secondary{color:var(--secondary-text-color)}.error{color:var(--error-color)}.warning{color:var(--error-color)}${i} .card-actions a{text-decoration:none}.card-actions .warning{--mdc-theme-primary:var(--error-color)}.layout.horizontal,.layout.vertical{display:flex}.layout.inline{display:inline-flex}.layout.horizontal{flex-direction:row}.layout.vertical{flex-direction:column}.layout.wrap{flex-wrap:wrap}.layout.no-wrap{flex-wrap:nowrap}.layout.center,.layout.center-center{align-items:center}.layout.bottom{align-items:flex-end}.layout.center-center,.layout.center-justified{justify-content:center}.flex{flex:1;flex-basis:0.000000001px}.flex-auto{flex:1 1 auto}.flex-none{flex:none}.layout.justified{justify-content:space-between}`,n=o.AH`ha-adaptive-dialog,ha-dialog{--mdc-dialog-min-width:400px;--mdc-dialog-max-width:600px;--mdc-dialog-max-width:min(600px, 95vw);--justify-action-buttons:space-between;--dialog-container-padding:var(--safe-area-inset-top, 0) var(--safe-area-inset-right, 0) var(--safe-area-inset-bottom, 0) var(--safe-area-inset-left, 0);--dialog-surface-padding:0px}ha-adaptive-dialog .form,ha-dialog .form{color:var(--primary-text-color)}a{color:var(--primary-color)} all and (max-width:450px),all and (max-height:500px){ha-adaptive-dialog,ha-dialog{--mdc-dialog-min-width:100vw;--mdc-dialog-max-width:100vw;--mdc-dialog-min-height:100vh;--mdc-dialog-min-height:100svh;--mdc-dialog-max-height:100vh;--mdc-dialog-max-height:100svh;--dialog-container-padding:0px;--dialog-surface-padding:var(--safe-area-inset-top, 0) var(--safe-area-inset-right, 0) var(--safe-area-inset-bottom, 0) var(--safe-area-inset-left, 0);--vertical-align-dialog:flex-end}ha-dialog{--ha-dialog-border-radius:var(--ha-border-radius-square)}}.error{color:var(--error-color)}`,r=o.AH`ha-adaptive-dialog,ha-dialog{--vertical-align-dialog:flex-start;--dialog-surface-margin-top:var(--ha-space-10);--mdc-dialog-max-height:calc(
100vh - var(--dialog-surface-margin-top) - var(--ha-space-2) - var(
--safe-area-inset-y,
0px
)
);--mdc-dialog-max-height:calc(
100svh - var(--dialog-surface-margin-top) - var(--ha-space-2) - var(
--safe-area-inset-y,
0px
)
);--ha-dialog-max-height:calc(
100vh - var(--dialog-surface-margin-top) - var(--ha-space-2) - var(
--safe-area-inset-y,
0px
)
);--ha-dialog-max-height:calc(
100svh - var(--dialog-surface-margin-top) - var(--ha-space-2) - var(
--safe-area-inset-y,
0px
)
)} all and (max-width:450px),all and (max-height:500px){ha-adaptive-dialog,ha-dialog{--dialog-surface-margin-top:0px;--mdc-dialog-min-height:100vh;--mdc-dialog-min-height:100svh;--mdc-dialog-max-height:100vh;--mdc-dialog-max-height:100svh;--ha-dialog-max-height:100vh;--ha-dialog-max-height:100svh}}`,h=o.AH`.ha-scrollbar::-webkit-scrollbar{width:.4rem;height:.4rem}.ha-scrollbar::-webkit-scrollbar-thumb{border-radius:var(--ha-border-radius-sm);background:var(--scrollbar-thumb-color)}.ha-scrollbar{overflow-y:auto;scrollbar-color:var(--scrollbar-thumb-color) transparent;scrollbar-width:thin}`;o.AH`body{background-color:var(--primary-background-color);color:var(--primary-text-color);height:calc(100vh - 32px);width:100vw}`},37540(t,a,e){e.d(a,{Kq:()=>c});e(17642),e(58004),e(33853),e(45876),e(32475),e(15024),e(31698);var o=e(63937),i=e(42017);const s=(t,a)=>{const e=t._$AN;if(void 0===e)return!1;for(const t of e)t._$AO?.(a,!1),s(t,a);return!0},n=t=>{let a,e;do{if(void 0===(a=t._$AM))break;e=a._$AN,e.delete(t),t=a}while(0===e?.size)},r=t=>{for(let a;a=t._$AM;t=a){let e=a._$AN;if(void 0===e)a._$AN=e=new Set;else if(e.has(t))break;e.add(t),l(a)}};function h(t){void 0!==this._$AN?(n(this),this._$AM=t,r(this)):this._$AM=t}function d(t,a=!1,e=0){const o=this._$AH,i=this._$AN;if(void 0!==i&&0!==i.size)if(a)if(Array.isArray(o))for(let t=e;t<o.length;t++)s(o[t],!1),n(o[t]);else null!=o&&(s(o,!1),n(o));else s(this,t)}const l=t=>{t.type==i.OA.CHILD&&(t._$AP??=d,t._$AQ??=h)};class c extends i.WL{_$AT(t,a,e){super._$AT(t,a,e),r(this),this.isConnected=t._$AU}_$AO(t,a=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),a&&(s(this,t),n(this))}setValue(t){if((0,o.Rt)(this._$Ct))this._$Ct._$AI(t,this);else{const a=[...this._$Ct._$AH];a[this._$Ci]=t,this._$Ct._$AI(a,this,0)}}disconnected(){}reconnected(){}constructor(){super(...arguments),this._$AN=void 0}}},59455(t,a,e){e.d(a,{_:()=>n,K:()=>d});e(88454),e(29452);var o=e(5055),i=e(37540),s=e(42017);const n=()=>new r;class r{}const h=new WeakMap,d=(0,s.u$)(class extends i.Kq{render(t){return o.s6}update(t,[a]){const e=a!==this.G;return e&&this.rt(void 0),(e||this.lt!==this.ct)&&(this.G=a,this.ht=t.options?.host,this.rt(this.ct=t.element)),o.s6}rt(t){if(void 0!==this.G)if(this.isConnected||(t=void 0),"function"==typeof this.G){const a=this.ht??globalThis;let e=h.get(a);void 0===e&&(e=new WeakMap,h.set(a,e)),void 0!==e.get(this.G)&&this.G.call(this.ht,void 0),e.set(this.G,t),void 0!==t&&this.G.call(this.ht,t)}else this.G.value=t}get lt(){return"function"==typeof this.G?h.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}})}};