iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
8 lines • 31.2 kB
JavaScript
(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["5318"],{64214:function(e,t,n){"use strict";n.a(e,(async function(e,i){try{n.d(t,{DG:()=>p,E8:()=>g,Fu:()=>f,NR:()=>b,o0:()=>u,yD:()=>v});var a=n(16485),r=n(27486),o=n(46467),s=n(33570),l=n(11104),d=n(16922),c=e([a,l,o,s]);[a,l,o,s]=c.then?(await c)():c;const u=(e,t,n)=>h(t,n.time_zone).format(e),h=(0,r.Z)(((e,t)=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"long",day:"numeric",hour:(0,d.y)(e)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,d.y)(e)?"h12":"h23",timeZone:(0,l.f)(e.time_zone,t)}))),p=((0,r.Z)((()=>new Intl.DateTimeFormat(void 0,{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"}))),(e,t,n)=>m(t,n.time_zone).format(e)),m=(0,r.Z)(((e,t)=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"short",day:"numeric",hour:(0,d.y)(e)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,d.y)(e)?"h12":"h23",timeZone:(0,l.f)(e.time_zone,t)}))),v=(e,t,n)=>y(t,n.time_zone).format(e),y=(0,r.Z)(((e,t)=>new Intl.DateTimeFormat(e.language,{month:"short",day:"numeric",hour:(0,d.y)(e)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,d.y)(e)?"h12":"h23",timeZone:(0,l.f)(e.time_zone,t)}))),f=(e,t,n)=>(new Date).getFullYear()===e.getFullYear()?v(e,t,n):p(e,t,n),g=(e,t,n)=>k(t,n.time_zone).format(e),k=(0,r.Z)(((e,t)=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"long",day:"numeric",hour:(0,d.y)(e)?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hourCycle:(0,d.y)(e)?"h12":"h23",timeZone:(0,l.f)(e.time_zone,t)}))),b=(e,t,n)=>`${(0,o.WB)(e,t,n)}, ${(0,s.mr)(e,t,n)}`;i()}catch(u){i(u)}}))},94947:function(e,t,n){"use strict";n.a(e,(async function(e,i){try{n.d(t,{G:()=>d});var a=n(16485),r=n(27486),o=n(27046),s=e([a,o]);[a,o]=s.then?(await s)():s;const l=(0,r.Z)((e=>new Intl.RelativeTimeFormat(e.language,{numeric:"auto"}))),d=(e,t,n,i=!0)=>{const a=(0,o.W)(e,n,t);return i?l(t).format(a.value,a.unit):Intl.NumberFormat(t.language,{style:"unit",unit:a.unit,unitDisplay:"long"}).format(Math.abs(a.value))};i()}catch(l){i(l)}}))},11104:function(e,t,n){"use strict";n.a(e,(async function(e,i){try{n.d(t,{f:()=>h});var a,r,o,s=n(16485),l=n(20382),d=e([s]);s=(d.then?(await d)():d)[0];const c=null===(a=Intl.DateTimeFormat)||void 0===a||null===(r=(o=a.call(Intl)).resolvedOptions)||void 0===r?void 0:r.call(o).timeZone,u=null!=c?c:"UTC",h=(e,t)=>e===l.c_.local&&c?u:t;i()}catch(c){i(c)}}))},35830:function(e,t,n){"use strict";n.d(t,{q:()=>i});const i=e=>{const t=window.location.pathname;return e?t+"?"+e:t}},27046:function(e,t,n){"use strict";n.a(e,(async function(e,i){try{n.d(t,{W:()=>p});n(19423);var a=n(13809),r=n(29558),o=n(94763),s=n(19631),l=e([s]);s=(l.then?(await l)():l)[0];const c=1e3,u=60,h=60*u;function p(e,t=Date.now(),n,i={}){const l=Object.assign(Object.assign({},m),i||{}),d=(+e-+t)/c;if(Math.abs(d)<l.second)return{value:Math.round(d),unit:"second"};const p=d/u;if(Math.abs(p)<l.minute)return{value:Math.round(p),unit:"minute"};const v=d/h;if(Math.abs(v)<l.hour)return{value:Math.round(v),unit:"hour"};const y=new Date(e),f=new Date(t);y.setHours(0,0,0,0),f.setHours(0,0,0,0);const g=(0,a.j)(y,f);if(0===g)return{value:Math.round(v),unit:"hour"};if(Math.abs(g)<l.day)return{value:g,unit:"day"};const k=(0,s.Bt)(n),b=(0,r.z)(y,{weekStartsOn:k}),w=(0,r.z)(f,{weekStartsOn:k}),_=(0,o.p)(b,w);if(0===_)return{value:g,unit:"day"};if(Math.abs(_)<l.week)return{value:_,unit:"week"};const x=y.getFullYear()-f.getFullYear(),C=12*x+y.getMonth()-f.getMonth();return 0===C?{value:_,unit:"week"}:Math.abs(C)<l.month||0===x?{value:C,unit:"month"}:{value:Math.round(x),unit:"year"}}const m={second:45,minute:45,hour:22,day:5,week:4,month:11};i()}catch(d){i(d)}}))},93262:function(e,t,n){"use strict";var i=n(61701),a=n(72621),r=(n(71695),n(61893),n(9359),n(56475),n(70104),n(19423),n(47021),n(87319),n(57243)),o=n(50778),s=n(27486),l=n(36522),d=n(49976),c=n(1416),u=n(58839);n(92824);let h,p,m,v=e=>e;(0,i.Z)([(0,o.Mo)("ha-blueprint-picker")],(function(e,t){class n extends t{constructor(...t){super(...t),e(this)}}return{F:n,d:[{kind:"field",key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,o.Cb)()],key:"value",value(){return""}},{kind:"field",decorators:[(0,o.Cb)()],key:"domain",value(){return"automation"}},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"blueprints",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"disabled",value(){return!1}},{kind:"method",key:"open",value:function(){var e;const t=null===(e=this.shadowRoot)||void 0===e?void 0:e.querySelector("ha-select");t&&(t.menuOpen=!0)}},{kind:"field",key:"_processedBlueprints",value(){return(0,s.Z)((e=>{if(!e)return[];return Object.entries(e).filter((e=>!("error"in e[1]))).map((([e,t])=>Object.assign(Object.assign({},t.metadata),{},{path:e}))).sort(((e,t)=>(0,c.$K)(e.name,t.name,this.hass.locale.language)))}))}},{kind:"method",key:"render",value:function(){return this.hass?(0,r.dy)(h||(h=v` <ha-select .label="${0}" fixedMenuPosition naturalMenuWidth .value="${0}" .disabled="${0}" ="${0}" ="${0}"> ${0} </ha-select> `),this.label||this.hass.localize("ui.components.blueprint-picker.select_blueprint"),this.value,this.disabled,this._blueprintChanged,d.U,this._processedBlueprints(this.blueprints).map((e=>(0,r.dy)(p||(p=v` <mwc-list-item .value="${0}"> ${0} </mwc-list-item> `),e.path,e.name)))):r.Ld}},{kind:"method",key:"firstUpdated",value:function(e){(0,a.Z)(n,"firstUpdated",this,3)([e]),void 0===this.blueprints&&(0,u.wc)(this.hass,this.domain).then((e=>{this.blueprints=e}))}},{kind:"method",key:"_blueprintChanged",value:function(e){const t=e.target.value;t!==this.value&&(this.value=t,setTimeout((()=>{(0,l.B)(this,"value-changed",{value:t}),(0,l.B)(this,"change")}),0))}},{kind:"field",static:!0,key:"styles",value(){return(0,r.iv)(m||(m=v`:host{display:inline-block}ha-select{width:100%;min-width:200px;display:block}`))}}]}}),r.oi)},75788:function(e,t,n){"use strict";var i=n(61701),a=n(72621),r=(n(19083),n(71695),n(92745),n(9359),n(31526),n(70104),n(40251),n(92519),n(42179),n(89256),n(24931),n(88463),n(57449),n(19814),n(61006),n(47021),n(2060),n(81843),n(57243)),o=n(50778),s=n(36522),l=n(58839),d=n(2357),c=n(28008);n(41307),n(23334),n(48103);let u,h,p,m,v,y=e=>e;(0,i.Z)([(0,o.Mo)("ha-filter-blueprints")],(function(e,t){class n extends t{constructor(...t){super(...t),e(this)}}return{F:n,d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"value",value:void 0},{kind:"field",decorators:[(0,o.Cb)()],key:"type",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"narrow",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({type:Boolean,reflect:!0})],key:"expanded",value(){return!1}},{kind:"field",decorators:[(0,o.SB)()],key:"_shouldRender",value(){return!1}},{kind:"field",decorators:[(0,o.SB)()],key:"_blueprints",value:void 0},{kind:"method",key:"willUpdate",value:function(e){var t;((0,a.Z)(n,"willUpdate",this,3)([e]),this.hasUpdated)||null!==(t=this.value)&&void 0!==t&&t.length&&this._findRelated()}},{kind:"method",key:"render",value:function(){var e,t;return(0,r.dy)(u||(u=y` <ha-expansion-panel left-chevron .expanded="${0}" -will-change="${0}" -changed="${0}"> <div slot="header" class="header"> ${0} ${0} </div> ${0} </ha-expansion-panel> `),this.expanded,this._expandedWillChange,this._expandedChanged,this.hass.localize("ui.panel.config.blueprint.caption"),null!==(e=this.value)&&void 0!==e&&e.length?(0,r.dy)(h||(h=y`<div class="badge">${0}</div> <ha-icon-button .path="${0}" ="${0}"></ha-icon-button>`),null===(t=this.value)||void 0===t?void 0:t.length,"M21 8H3V6H21V8M13.81 16H10V18H13.09C13.21 17.28 13.46 16.61 13.81 16M18 11H6V13H18V11M21.12 15.46L19 17.59L16.88 15.46L15.47 16.88L17.59 19L15.47 21.12L16.88 22.54L19 20.41L21.12 22.54L22.54 21.12L20.41 19L22.54 16.88L21.12 15.46Z",this._clearFilter):r.Ld,this._blueprints&&this._shouldRender?(0,r.dy)(p||(p=y` <mwc-list ="${0}" multi class="ha-scrollbar"> ${0} </mwc-list> `),this._blueprintsSelected,Object.entries(this._blueprints).map((([e,t])=>"error"in t?r.Ld:(0,r.dy)(m||(m=y`<ha-check-list-item .value="${0}" .selected="${0}"> ${0} </ha-check-list-item>`),e,(this.value||[]).includes(e),t.metadata.name||e)))):r.Ld)}},{kind:"method",key:"firstUpdated",value:async function(){this.type&&(this._blueprints=await(0,l.wc)(this.hass,this.type))}},{kind:"method",key:"updated",value:function(e){e.has("expanded")&&this.expanded&&setTimeout((()=>{!this.narrow&&this.expanded&&(this.renderRoot.querySelector("mwc-list").style.height=this.clientHeight-49+"px")}),300)}},{kind:"method",key:"_expandedWillChange",value:function(e){this._shouldRender=e.detail.expanded}},{kind:"method",key:"_expandedChanged",value:function(e){this.expanded=e.detail.expanded}},{kind:"method",key:"_blueprintsSelected",value:async function(e){const t=this._blueprints;if(!e.detail.index.size)return(0,s.B)(this,"data-table-filter-changed",{value:[],items:void 0}),void(this.value=[]);const n=[];for(const i of e.detail.index){const e=Object.keys(t)[i];n.push(e)}this.value=n,this._findRelated()}},{kind:"method",key:"_findRelated",value:async function(){var e;if(null===(e=this.value)||void 0===e||!e.length)return(0,s.B)(this,"data-table-filter-changed",{value:[],items:void 0}),void(this.value=[]);const t=[];for(const a of this.value)this.type&&t.push((0,d.K)(this.hass,`${this.type}_blueprint`,a));const n=await Promise.all(t),i=new Set;for(const a of n)a[this.type]&&a[this.type].forEach((e=>i.add(e)));(0,s.B)(this,"data-table-filter-changed",{value:this.value,items:this.type?i:void 0})}},{kind:"method",key:"_clearFilter",value:function(e){e.preventDefault(),this.value=void 0,(0,s.B)(this,"data-table-filter-changed",{value:void 0,items:void 0})}},{kind:"get",static:!0,key:"styles",value:function(){return[c.$c,(0,r.iv)(v||(v=y`:host{border-bottom:1px solid var(--divider-color)}:host([expanded]){flex:1;height:0}ha-expansion-panel{--ha-card-border-radius:0;--expansion-panel-content-padding:0}.header{display:flex;align-items:center}.header ha-icon-button{margin-inline-start:auto;margin-inline-end:8px}.badge{display:inline-block;margin-left:8px;margin-inline-start:8px;margin-inline-end:0;min-width:16px;box-sizing:border-box;border-radius:50%;font-weight:400;font-size:11px;background-color:var(--primary-color);line-height:16px;text-align:center;padding:0px 2px;color:var(--text-primary-color)}`))]}}]}}),r.oi)},53013:function(e,t,n){"use strict";var i=n(61701),a=n(72621),r=n(91179),o=(n(19083),n(71695),n(52805),n(9359),n(56475),n(70104),n(48136),n(40251),n(19134),n(61006),n(47021),n(57243)),s=n(50778),l=n(94886),d=n.n(l),c=n(36522),u=(n(72700),n(8038),n(71513),n(75656),n(50100),n(18084),n(75351));let h;const p=new(n(80262).L)(1e3),m={reType:(0,r.Z)(/((\[!(caution|important|note|tip|warning)\])(?:\s|\\n)?)/i,{input:1,type:3}),typeToHaAlert:{caution:"error",important:"info",note:"info",tip:"success",warning:"warning"}};(0,i.Z)([(0,s.Mo)("ha-markdown-element")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,s.Cb)()],key:"content",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:"allow-svg",type:Boolean})],key:"allowSvg",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"breaks",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)({type:Boolean,attribute:"lazy-images"})],key:"lazyImages",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"cache",value(){return!1}},{kind:"method",key:"disconnectedCallback",value:function(){if((0,a.Z)(i,"disconnectedCallback",this,3)([]),this.cache){const e=this._computeCacheKey();p.set(e,this.innerHTML)}}},{kind:"method",key:"createRenderRoot",value:function(){return this}},{kind:"method",key:"update",value:function(e){(0,a.Z)(i,"update",this,3)([e]),void 0!==this.content&&this._render()}},{kind:"method",key:"willUpdate",value:function(e){if(!this.innerHTML&&this.cache){const e=this._computeCacheKey();p.has(e)&&(this.innerHTML=p.get(e),this._resize())}}},{kind:"method",key:"_computeCacheKey",value:function(){return d()({content:this.content,allowSvg:this.allowSvg,breaks:this.breaks})}},{kind:"method",key:"_render",value:async function(){this.innerHTML=await(async(e,t,i)=>(h||(h=(0,u.Ud)(new Worker(new URL(n.p+n.u("45845"),n.b)))),h.renderMarkdown(e,t,i)))(String(this.content),{breaks:this.breaks,gfm:!0},{allowSvg:this.allowSvg}),this._resize();const e=document.createTreeWalker(this,NodeFilter.SHOW_ELEMENT,null);for(;e.nextNode();){const i=e.currentNode;if(i instanceof HTMLAnchorElement&&i.host!==document.location.host)i.target="_blank",i.rel="noreferrer noopener";else if(i instanceof HTMLImageElement)this.lazyImages&&(i.loading="lazy"),i.addEventListener("load",this._resize);else if(i instanceof HTMLQuoteElement){var t;const n=(null===(t=i.firstElementChild)||void 0===t||null===(t=t.firstChild)||void 0===t?void 0:t.textContent)&&m.reType.exec(i.firstElementChild.firstChild.textContent);if(n){const{type:t}=n.groups,a=document.createElement("ha-alert");a.alertType=m.typeToHaAlert[t.toLowerCase()],a.append(...Array.from(i.childNodes).map((e=>{const t=Array.from(e.childNodes);if(!this.breaks&&t.length){var i;const e=t[0];e.nodeType===Node.TEXT_NODE&&e.textContent===n.input&&null!==(i=e.textContent)&&void 0!==i&&i.includes("\n")&&(e.textContent=e.textContent.split("\n").slice(1).join("\n"))}return t})).reduce(((e,t)=>e.concat(t)),[]).filter((e=>e.textContent&&e.textContent!==n.input))),e.parentNode().replaceChild(a,i)}}else i instanceof HTMLElement&&["ha-alert","ha-qr-code","ha-icon","ha-svg-icon"].includes(i.localName)&&n(23265)(`./${i.localName}`)}}},{kind:"field",key:"_resize",value(){return()=>(0,c.B)(this,"content-resize")}}]}}),o.fl)},99254:function(e,t,n){"use strict";var i=n(61701),a=(n(71695),n(47021),n(57243)),r=n(50778);n(53013);let o,s,l=e=>e;(0,i.Z)([(0,r.Mo)("ha-markdown")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,r.Cb)()],key:"content",value:void 0},{kind:"field",decorators:[(0,r.Cb)({attribute:"allow-svg",type:Boolean})],key:"allowSvg",value(){return!1}},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"breaks",value(){return!1}},{kind:"field",decorators:[(0,r.Cb)({type:Boolean,attribute:"lazy-images"})],key:"lazyImages",value(){return!1}},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"cache",value(){return!1}},{kind:"method",key:"render",value:function(){return this.content?(0,a.dy)(o||(o=l`<ha-markdown-element .content="${0}" .allowSvg="${0}" .breaks="${0}" .lazyImages="${0}" .cache="${0}"></ha-markdown-element>`),this.content,this.allowSvg,this.breaks,this.lazyImages,this.cache):a.Ld}},{kind:"field",static:!0,key:"styles",value(){return(0,a.iv)(s||(s=l`:host{display:block}ha-markdown-element{-ms-user-select:text;-webkit-user-select:text;-moz-user-select:text}ha-markdown-element>:first-child{margin-top:0}ha-markdown-element>:last-child{margin-bottom:0}ha-alert{display:block;margin:4px 0}a{color:var(--primary-color)}img{max-width:100%}code,pre{background-color:var(--markdown-code-background-color,none);border-radius:3px}svg{background-color:var(--markdown-svg-background-color,none);color:var(--markdown-svg-color,none)}code{font-size:85%;padding:.2em .4em}pre code{padding:0}pre{padding:16px;overflow:auto;line-height:1.45;font-family:var(--code-font-family, monospace)}h1,h2,h3,h4,h5,h6{line-height:initial}h2{font-size:1.5em;font-weight:700}hr{border-color:var(--divider-color);border-bottom:none;margin:16px 0}`))}}]}}),a.oi)},17170:function(e,t,n){"use strict";n.a(e,(async function(e,i){try{n.r(t),n.d(t,{HaSpinner:()=>p});var a=n(61701),r=n(72621),o=(n(71695),n(47021),n(97677)),s=n(43580),l=n(57243),d=n(50778),c=e([o]);o=(c.then?(await c)():c)[0];let u,h=e=>e,p=(0,a.Z)([(0,d.Mo)("ha-spinner")],(function(e,t){class n extends t{constructor(...t){super(...t),e(this)}}return{F:n,d:[{kind:"field",decorators:[(0,d.Cb)()],key:"size",value:void 0},{kind:"method",key:"updated",value:function(e){if((0,r.Z)(n,"updated",this,3)([e]),e.has("size"))switch(this.size){case"tiny":this.style.setProperty("--ha-spinner-size","16px");break;case"small":this.style.setProperty("--ha-spinner-size","28px");break;case"medium":this.style.setProperty("--ha-spinner-size","48px");break;case"large":this.style.setProperty("--ha-spinner-size","68px");break;case void 0:this.style.removeProperty("--ha-progress-ring-size")}}},{kind:"field",static:!0,key:"styles",value(){return[s.Z,(0,l.iv)(u||(u=h`:host{--indicator-color:var(
--ha-spinner-indicator-color,
var(--primary-color)
);--track-color:var(--ha-spinner-divider-color, var(--divider-color));--track-width:4px;--speed:3.5s;font-size:var(--ha-spinner-size, 48px)}`))]}}]}}),o.Z);i()}catch(u){i(u)}}))},4573:function(e,t,n){"use strict";var i=n(61701),a=n(72621),r=(n(71695),n(40251),n(47021),n(92264)),o=n(57243),s=n(50778);let l,d=e=>e;(0,i.Z)([(0,s.Mo)("ha-sub-menu")],(function(e,t){class n extends t{constructor(...t){super(...t),e(this)}}return{F:n,d:[{kind:"method",key:"show",value:async function(){(0,a.Z)(n,"show",this,3)([]),this.menu.hasOverflow=!1}},{kind:"field",static:!0,key:"styles",value(){return[...(0,a.Z)(n,"styles",this),(0,o.iv)(l||(l=d`:host{--ha-icon-display:block;--md-sys-color-primary:var(--primary-text-color);--md-sys-color-on-primary:var(--primary-text-color);--md-sys-color-secondary:var(--secondary-text-color);--md-sys-color-surface:var(--card-background-color);--md-sys-color-on-surface:var(--primary-text-color);--md-sys-color-on-surface-variant:var(--secondary-text-color);--md-sys-color-secondary-container:rgba(
var(--rgb-primary-color),
0.15
);--md-sys-color-on-secondary-container:var(--text-primary-color);--mdc-icon-size:16px;--md-sys-color-on-primary-container:var(--primary-text-color);--md-sys-color-on-secondary-container:var(--primary-text-color)}`))]}}]}}),r.f)},58839:function(e,t,n){"use strict";n.d(t,{Bp:()=>r,E2:()=>s,Uk:()=>l,Zt:()=>o,fQ:()=>a,wc:()=>i});n(19083),n(61006);const i=(e,t)=>e.callWS({type:"blueprint/list",domain:t}),a=(e,t)=>e.callWS({type:"blueprint/import",url:t}),r=(e,t,n,i,a,r)=>e.callWS({type:"blueprint/save",domain:t,path:n,yaml:i,source_url:a,allow_override:r}),o=(e,t,n)=>e.callWS({type:"blueprint/delete",domain:t,path:n}),s=e=>{const t=e.metadata.source_url;return t?t.includes("github.com/home-assistant")?"homeassistant":"community":"local"},l=(e,t,n,i)=>e.callWS({type:"blueprint/substitute",domain:t,path:n,input:i})},12068:function(e,t,n){"use strict";n.d(t,{B:()=>i,l:()=>a});n(71695),n(9359),n(31526),n(92519),n(42179),n(89256),n(24931),n(88463),n(57449),n(19814),n(47021);const i=e=>{const t={};return Object.entries(e).forEach((([e,n])=>{t[e]={value:n.value,items:n.items instanceof Set?Array.from(n.items):n.items}})),t},a=e=>{const t={};return Object.entries(e).forEach((([e,n])=>{t[e]={value:n.value,items:Array.isArray(n.items)?new Set(n.items):n.items}})),t}},40027:function(e,t,n){"use strict";n.d(t,{C:()=>a});n(71695),n(40251),n(47021);var i=n(22337);const a=e=>class extends e{constructor(...e){super(...e),this._handleClick=async e=>{const t=e.composedPath()[0];if(!(0,i.J)(e))return;if(await this.promptDiscardChanges()&&(this._removeListeners(),t)){const n=new MouseEvent(e.type,e);t.dispatchEvent(n)}},this._handleUnload=e=>e.preventDefault()}_removeListeners(){window.removeEventListener("click",this._handleClick,!0),window.removeEventListener("beforeunload",this._handleUnload)}willUpdate(e){super.willUpdate(e),this.isDirty?(window.addEventListener("click",this._handleClick,!0),window.addEventListener("beforeunload",this._handleUnload)):this._removeListeners()}disconnectedCallback(){super.disconnectedCallback(),this._removeListeners()}get isDirty(){return!1}async promptDiscardChanges(){return!0}}},61107:function(e,t,n){"use strict";n.d(t,{E:()=>r,O:()=>a});n(71695),n(40251),n(47021);var i=n(36522);const a=()=>Promise.all([n.e("46379"),n.e("66031"),n.e("72206"),n.e("97983"),n.e("24199"),n.e("78943"),n.e("42950"),n.e("65505"),n.e("58640"),n.e("42311"),n.e("17283"),n.e("18865"),n.e("27090"),n.e("44959"),n.e("3049"),n.e("72308"),n.e("84958"),n.e("38311"),n.e("17674")]).then(n.bind(n,2711)),r=(e,t)=>{(0,i.B)(e,"show-dialog",{dialogTag:"dialog-area-registry-detail",dialogImport:a,dialogParams:t})}},61751:function(e,t,n){"use strict";n.d(t,{q:()=>r});n(71695),n(40251),n(47021);var i=n(36522);const a=()=>Promise.all([n.e("7010"),n.e("40728"),n.e("9387")]).then(n.bind(n,19456)),r=(e,t)=>{(0,i.B)(e,"show-dialog",{dialogTag:"ha-dialog-automation-mode",dialogImport:a,dialogParams:t})}},11432:function(e,t,n){"use strict";n.d(t,{h:()=>r});n(71695),n(40251),n(47021);var i=n(36522);const a=()=>Promise.all([n.e("84958"),n.e("92212")]).then(n.bind(n,61179)),r=(e,t)=>{(0,i.B)(e,"show-dialog",{dialogTag:"ha-dialog-automation-save",dialogImport:a,dialogParams:t})}},31694:function(e,t,n){"use strict";n.d(t,{X:()=>r});n(71695),n(40251),n(47021);var i=n(36522);const a=()=>n.e("87395").then(n.bind(n,21940)),r=(e,t)=>{(0,i.B)(e,"show-dialog",{dialogTag:"ha-dialog-new-automation",dialogImport:a,dialogParams:t})}},33831:function(e,t,n){"use strict";n.a(e,(async function(e,i){try{n.d(t,{k:()=>z});var a=n(61701),r=n(72621),o=(n(63721),n(71695),n(9359),n(70104),n(52924),n(19423),n(47021),n(31622),n(57243)),s=n(50778),l=n(36522),d=(n(93262),n(54977),n(17170)),c=(n(99254),n(66671),n(30509),n(28008)),u=e([d]);d=(u.then?(await u)():u)[0];let h,p,m,v,y,f,g,k,b,w,_,x,C,$=e=>e,z=(0,a.Z)([(0,s.Mo)("blueprint-generic-editor")],(function(e,t){class n extends t{constructor(...t){super(...t),e(this)}}return{F:n,d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:"is-wide",type:Boolean})],key:"isWide",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"disabled",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)({type:Boolean,reflect:!0})],key:"narrow",value(){return!1}},{kind:"field",decorators:[(0,s.SB)()],key:"_blueprints",value:void 0},{kind:"method",key:"firstUpdated",value:function(e){(0,r.Z)(n,"firstUpdated",this,3)([e]),this._getBlueprints()}},{kind:"get",key:"_blueprint",value:function(){if(this._blueprints)return this._blueprints[this._config.use_blueprint.path]}},{kind:"method",key:"renderCard",value:function(){var e;const t=this._blueprint;let n=!0;return(0,o.dy)(h||(h=$` <ha-card outlined class="blueprint" .header="${0}"> <div class="blueprint-picker-container"> ${0} </div> ${0} </ha-card> `),this.hass.localize("ui.panel.config.automation.editor.blueprint.header"),this._blueprints?Object.keys(this._blueprints).length?(0,o.dy)(p||(p=$` <ha-blueprint-picker .hass="${0}" .label="${0}" .blueprints="${0}" .value="${0}" .disabled="${0}" -changed="${0}"></ha-blueprint-picker> `),this.hass,this.hass.localize("ui.panel.config.automation.editor.blueprint.blueprint_to_use"),this._blueprints,this._config.use_blueprint.path,this.disabled,this._blueprintChanged):this.hass.localize("ui.panel.config.automation.editor.blueprint.no_blueprints"):(0,o.dy)(m||(m=$`<ha-spinner></ha-spinner>`)),this._config.use_blueprint.path?t&&"error"in t?(0,o.dy)(v||(v=$`<p class="warning padding"> There is an error in this Blueprint: ${0} </p>`),t.error):(0,o.dy)(y||(y=$`${0} ${0}`),null!=t&&t.metadata.description?(0,o.dy)(f||(f=$`<ha-markdown class="card-content" breaks .content="${0}"></ha-markdown>`),t.metadata.description):"",null!=t&&null!==(e=t.metadata)&&void 0!==e&&e.input&&Object.keys(t.metadata.input).length?Object.entries(t.metadata.input).map((([e,t])=>{if(t&&"input"in t){const i=this._renderSection(e,t);return n=!1,i}const i=this._renderSettingRow(e,t,n);return n=!0,i})):(0,o.dy)(g||(g=$`<p class="padding"> ${0} </p>`),this.hass.localize("ui.panel.config.automation.editor.blueprint.no_inputs"))):"")}},{kind:"method",key:"_renderSection",value:function(e,t){const n=(null==t?void 0:t.name)||e,i=t.input&&Object.values(t.input).some((e=>null===e||void 0===e.default)),a=!t.collapsed||i;return(0,o.dy)(k||(k=$`<ha-expansion-panel outlined .expanded="${0}" .noCollapse="${0}"> ${0} <div slot="header" role="heading" aria-level="3" class="section-header"> <ha-markdown .content="${0}"></ha-markdown> </div> <div class="content"> ${0} ${0} </div> </ha-expansion-panel>`),a,i,null!=t&&t.icon?(0,o.dy)(b||(b=$` <ha-icon slot="leading-icon" class="section-header" .icon="${0}"></ha-icon> `),t.icon):o.Ld,n,null!=t&&t.description?(0,o.dy)(w||(w=$`<ha-markdown .content="${0}"></ha-markdown>`),t.description):o.Ld,t.input?Object.entries(t.input).map((([e,t])=>this._renderSettingRow(e,t,!0))):o.Ld)}},{kind:"method",key:"_renderSettingRow",value:function(e,t,n){var i;const a=null!==(i=null==t?void 0:t.selector)&&void 0!==i?i:{text:void 0};return(0,o.dy)(_||(_=$`<ha-settings-row .narrow="${0}" class="${0}"> <span slot="heading">${0}</span> <ha-markdown slot="description" class="card-content" breaks .content="${0}"></ha-markdown> ${0} </ha-settings-row>`),this.narrow,n?"border":"",(null==t?void 0:t.name)||e,null==t?void 0:t.description,(0,o.dy)(x||(x=$`<ha-selector .hass="${0}" .selector="${0}" .key="${0}" .disabled="${0}" .required="${0}" .placeholder="${0}" .value="${0}" -changed="${0}"></ha-selector>`),this.hass,a,e,this.disabled,void 0===(null==t?void 0:t.default),null==t?void 0:t.default,this._config.use_blueprint.input&&e in this._config.use_blueprint.input?this._config.use_blueprint.input[e]:null==t?void 0:t.default,this._inputChanged))}},{kind:"method",key:"_blueprintChanged",value:function(e){e.stopPropagation(),this._config.use_blueprint.path!==e.detail.value&&(0,l.B)(this,"value-changed",{value:Object.assign(Object.assign({},this._config),{},{use_blueprint:{path:e.detail.value}})})}},{kind:"method",key:"_inputChanged",value:function(e){e.stopPropagation();const t=e.target,n=t.key,i=e.detail?e.detail.value:t.value;if(this._config.use_blueprint.input&&this._config.use_blueprint.input[n]===i||!this._config.use_blueprint.input&&""===i)return;const a=Object.assign(Object.assign({},this._config.use_blueprint.input),{},{[n]:i});(0,l.B)(this,"value-changed",{value:Object.assign(Object.assign({},this._config),{},{use_blueprint:Object.assign(Object.assign({},this._config.use_blueprint),{},{input:a})})})}},{kind:"get",static:!0,key:"styles",value:function(){return[c.Qx,(0,o.iv)(C||(C=$`:host{display:block}ha-card.blueprint{margin:0 auto;margin-bottom:64px}.padding{padding:16px}.link-button-row{padding:14px}.blueprint-picker-container{padding:0 16px 16px}ha-blueprint-picker,ha-textfield{display:block}h3{margin:16px}.introduction{margin-top:0;margin-bottom:12px}.introduction a{color:var(--primary-color)}p{margin-bottom:0}.description{margin-bottom:16px}ha-settings-row{--paper-time-input-justify-content:flex-end;--settings-row-content-width:100%;--settings-row-prefix-display:contents}ha-settings-row.border{border-top:1px solid var(--divider-color)}ha-expansion-panel{margin:8px;margin-left:8px;margin-right:8px}div.section-header{display:flex;vertical-align:middle}ha-icon.section-header{padding-right:10px}ha-alert{display:block;margin-bottom:16px}`))]}}]}}),o.oi);i()}catch(h){i(h)}}))},80262:function(e,t,n){"use strict";n.d(t,{L:()=>i});n(71695),n(47021);class i{constructor(e){this._expiration=void 0,this._cache=new Map,this._expiration=e}get(e){return this._cache.get(e)}set(e,t){this._cache.set(e,t),this._expiration&&window.setTimeout((()=>this._cache.delete(e)),this._expiration)}has(e){return this._cache.has(e)}}},23265:function(e,t,n){var i={"./ha-icon":["65981","97406"],"./ha-icon-button-toggle":["79505","80175"],"./ha-svg-icon":["37583"],"./ha-icon-button-group":["45747","97792"],"./ha-svg-icon.ts":["37583"],"./ha-icon.ts":["65981","97406"],"./ha-icon-overflow-menu":["59959","91552","78456","56898","99287","14932"],"./ha-icon-next":["13928","99172"],"./ha-icon-picker":["21393","46379","66031","24199","78943","45760"],"./ha-qr-code.ts":["50634","53750","70472"],"./ha-icon-button-arrow-prev.ts":["54202","41069"],"./ha-icon-button-arrow-prev":["54202","41069"],"./ha-icon-overflow-menu.ts":["59959","91552","78456","56898","99287","14932"],"./ha-alert":["99426","4809"],"./ha-icon-button-next":["4635","51577"],"./ha-icon-button":["23334"],"./ha-icon-button-next.ts":["4635","51577"],"./ha-icon-picker.ts":["21393","46379","66031","24199","78943","45760"],"./ha-icon-button-group.ts":["45747","97792"],"./ha-icon-button-toggle.ts":["79505","80175"],"./ha-icon-button-arrow-next.ts":["54237","21559"],"./ha-icon-button-prev.ts":["5828","43537"],"./ha-icon-prev":["95499","87557"],"./ha-icon-prev.ts":["95499","87557"],"./ha-icon-button.ts":["23334"],"./ha-alert.ts":["99426","4809"],"./ha-icon-button-prev":["5828","43537"],"./ha-qr-code":["50634","53750","70472"],"./ha-icon-next.ts":["13928","99172"],"./ha-icon-button-arrow-next":["54237","21559"]};function a(e){if(!n.o(i,e))return Promise.resolve().then((function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=i[e],a=t[0];return Promise.all(t.slice(1).map(n.e)).then((function(){return n(a)}))}a.keys=()=>Object.keys(i),a.id=23265,e.exports=a},68783:function(e,t,n){"use strict";n.a(e,(async function(e,i){try{n.d(t,{A:()=>c});n(71695),n(47021);var a=n(64699),r=n(15073),o=n(81048),s=n(31027),l=n(57243),d=e([r]);r=(d.then?(await d)():d)[0];let u,h=e=>e;var c=class extends s.P{constructor(){super(...arguments),this.localize=new r.V(this)}render(){return(0,l.dy)(u||(u=h` <svg part="base" class="spinner" role="progressbar" aria-label="${0}"> <circle class="spinner__track"></circle> <circle class="spinner__indicator"></circle> </svg> `),this.localize.term("loading"))}};c.styles=[o.N,a.D],i()}catch(u){i(u)}}))},64699:function(e,t,n){"use strict";n.d(t,{D:()=>a});let i;var a=(0,n(57243).iv)(i||(i=(e=>e)`:host{--track-width:2px;--track-color:rgb(128 128 128 / 25%);--indicator-color:var(--sl-color-primary-600);--speed:2s;display:inline-flex;width:1em;height:1em;flex:none}.spinner{flex:1 1 auto;height:100%;width:100%}.spinner__indicator,.spinner__track{fill:none;stroke-width:var(--track-width);r:calc(0.5em - var(--track-width)/ 2);cx:0.5em;cy:0.5em;transform-origin:50% 50%}.spinner__track{stroke:var(--track-color);transform-origin:0% 0%}.spinner__indicator{stroke:var(--indicator-color);stroke-linecap:round;stroke-dasharray:150% 75%;animation:spin var(--speed) linear infinite} spin{0%{transform:rotate(0deg);stroke-dasharray:0.05em,3em}50%{transform:rotate(450deg);stroke-dasharray:1.375em,1.375em}100%{transform:rotate(1080deg);stroke-dasharray:0.05em,3em}}`))},97677:function(e,t,n){"use strict";n.a(e,(async function(e,i){try{n.d(t,{Z:()=>a.A});var a=n(68783),r=(n(64699),n(15073)),o=n(21262),s=(n(81048),n(31027),n(52812),e([r,o,a]));[r,o,a]=s.then?(await s)():s,i()}catch(l){i(l)}}))},43580:function(e,t,n){"use strict";n.d(t,{Z:()=>i.D});var i=n(64699);n(52812)}}]);
//# sourceMappingURL=5318.dc684313867d3c03.js.map