(window.webpackJsonp=window.webpackJsonp||[]).push([[28],{144:function(e,t,n){"use strict";function s(e,t){"setProperties"in e?e.setProperties(t):Object.keys(t).forEach(n=>{e[n]=t[n]})}n.d(t,"a",function(){return s})},145:function(e,t,n){"use strict";function s(e){const t="html_url"in e?`ha-panel-${e.name}`:e.name;return document.createElement(t)}n.d(t,"a",function(){return s})},146:function(e,t,n){"use strict";n.d(t,"a",function(){return o});var s=n(83);const r={};function o(e){if(e.html_url){const t=[n.e(42).then(n.bind(null,139))];return e.embed_iframe||t.push(Promise.all([n.e(9),n.e(41)]).then(n.bind(null,140))),Promise.all(t).then(([{importHrefPromise:t}])=>t(e.html_url))}return e.js_url?(e.js_url in r||(r[e.js_url]=Object(s.b)(e.js_url)),r[e.js_url]):e.module_url?Object(s.c)(e.module_url):Promise.reject("No valid url found in panel config.")}},629:function(e,t,n){"use strict";n.r(t);var s=n(4),r=n(14),o=n(82),i=n(146),a=n(145),c=n(144);customElements.define("ha-panel-custom",class extends(Object(o.a)(Object(r.a)(s.a))){static get properties(){return{hass:Object,narrow:Boolean,showMenu:Boolean,route:Object,panel:{type:Object,observer:"_panelChanged"}}}static get observers(){return["_dataChanged(hass, narrow, showMenu, route)"]}constructor(){super(),this._setProperties=null}_panelChanged(e){for(delete window.customPanel,this._setProperties=null;this.lastChild;)this.remove(this.lastChild);const t=e.config._panel_custom,n=document.createElement("a");if(n.href=t.html_url||t.js_url||t.module_url,!t.trust_external&&!["localhost","127.0.0.1",location.hostname].includes(n.hostname)&&!confirm(`Do you trust the external panel "${t.name}" at "${n.href}"?\n\nIt will have access to all data in Home Assistant.\n\n(Check docs for the panel_custom component to hide this message)`))return;if(!t.embed_iframe)return void Object(i.a)(t).then(()=>{const n=Object(a.a)(t);this._setProperties=(e=>Object(c.a)(n,e)),Object(c.a)(n,{panel:e,hass:this.hass,narrow:this.narrow,showMenu:this.showMenu,route:this.route}),this.appendChild(n)},()=>{alert(`Unable to load custom panel from ${n.href}`)});window.customPanel=this,this.innerHTML="\n    <style>\n      iframe {\n        border: 0;\n        width: 100%;\n        height: 100%;\n        display: block;\n      }\n    </style>\n    <iframe></iframe>\n    ";const s=this.querySelector("iframe").contentWindow.document;s.open(),s.write(`<script src='${window.customPanelJS}'><\/script>`),s.close()}disconnectedCallback(){super.disconnectedCallback(),delete window.customPanel}_dataChanged(e,t,n,s){this._setProperties&&this._setProperties({hass:e,narrow:t,showMenu:n,route:s})}registerIframe(e,t){e(this.panel,{hass:this.hass,narrow:this.narrow,showMenu:this.showMenu,route:this.route}),this._setProperties=t}})},83:function(e,t,n){"use strict";function s(e,t,n){return new Promise(function(s,r){const o=document.createElement(e);let i="src",a="body";switch(o.onload=(()=>s(t)),o.onerror=(()=>r(t)),e){case"script":o.async=!0,n&&(o.type=n);break;case"link":o.type="text/css",o.rel="stylesheet",i="href",a="head"}o[i]=t,document[a].appendChild(o)})}n.d(t,"a",function(){return r}),n.d(t,"b",function(){return o}),n.d(t,"c",function(){return i});const r=e=>s("link",e),o=e=>s("script",e),i=e=>s("script",e,"module")}}]);
//# sourceMappingURL=cf075a996a55e2949cfc.chunk.js.map