UNPKG

iobroker.lovelace

Version:

With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI

16 lines 25.7 kB
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[96700],{93421:function(t,e,a){a.d(e,{IW:function(){return h},dH:function(){return d},fI:function(){return n}});a(44114),a(62953);var o=a(35211),i=a(22792),r=a(32172);const s=(t,e)=>{let a=t;for(const o of e){if(null==a)return;a=a[o]}return a},l=(t,e,a)=>{const i=(0,r.p)({transformer:function(t){return a.call(this,t)},watch:e?[e]:[]}),s=(0,o.Fg)({context:t,subscribe:!0});return(t,e)=>{i(t,e),s(t,e)}},n=t=>l(i.iN,t.entityIdPath[0],function(e){const a=s(this,t.entityIdPath);return"string"==typeof a?null==e?void 0:e[a]:void 0}),d=t=>l(i.X1,t.entityIdPath[0],function(e){const a=s(this,t.entityIdPath);return"string"==typeof a?null==e?void 0:e[a]:void 0}),h=()=>l(i.D5,void 0,({localize:t})=>t)},32172:function(t,e,a){a.d(e,{p:function(){return o}});a(16280),a(18111),a(7588),a(45367),a(92731),a(17642),a(58004),a(33853),a(45876),a(32475),a(15024),a(31698),a(62953);function o(t){return(e,a)=>{if("object"==typeof a)throw new Error("This decorator does not support this compilation type.");const o=String(a),i=e;if(i._transformers){if(!i.hasOwnProperty("_transformers")){const t=i._transformers;i._transformers=new Map,t.forEach((t,e)=>i._transformers.set(e,t))}}else{i._transformers=new Map,i._watching=new Map;const t=i.willUpdate;i.willUpdate=function(e){t.call(this,e);const a=new Set;e.forEach((t,e)=>{const o=this._watching.get(e);void 0!==o&&o.forEach(t=>a.add(t))}),a.forEach(t=>{this[t]=this[`__original_${String(t)}`]})}}i._transformers.set(a,t.transformer),t.watch&&t.watch.forEach(t=>{let e=i._watching.get(t);e||(e=new Set,i._watching.set(t,e)),e.add(a)});const r=Object.getOwnPropertyDescriptor(e,a);let s;if(void 0===r)s={get(){return this[`__transform_${o}`]},set(t){const e=this[`__transform_${o}`],a=this._transformers.get(o);this[`__transform_${o}`]=a?a.call(this,t):t,this[`__original_${o}`]=t,this.requestUpdate(o,e)},configurable:!0,enumerable:!0};else{const t=r.set;s=Object.assign(Object.assign({},r),{},{set(e){const a=this[`__transform_${o}`],i=this._transformers.get(o);this[`__transform_${o}`]=i?i.call(this,e):e,this[`__original_${o}`]=e,this.requestUpdate(o,a),null==t||t.call(this,e)}})}Object.defineProperty(e,a,s)}}},64481:function(t,e,a){a.d(e,{D:function(){return i},J:function(){return s}});a(16280),a(3362),a(55815),a(64979),a(79739);let o=!1;try{o="true"===window.localStorage.getItem("disableViewTransition")}catch(l){}const i=t=>{o=t},r=t=>{if(!(t=>(t instanceof DOMException||t instanceof Error)&&"AbortError"===t.name)(t))throw t},s=t=>{if(!document.startViewTransition||o)return t(!1),Promise.resolve();let e=!1;try{const a=document.startViewTransition(()=>{e=!0,t(!0)});return a.ready.catch(r),a.finished.catch(r)}catch(a){return console.warn("View transition failed, falling back to direct execution.",a),e?Promise.reject(a):(t(!1),Promise.resolve())}}},38962:function(t,e,a){a.a(t,async function(t,o){try{a.r(e);a(62953);var i=a(40445),r=a(5124),s=a(67576),l=a(6412),n=a(93421),d=a(1087),h=a(26300),c=(a(67094),t([h]));h=(c.then?(await c)():c)[0];let u,p,g,v,f=t=>t;const m="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",b={info:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z",warning:"M12,2L1,21H23M12,6L19.53,19H4.47M11,10V14H13V10M11,16V18H13V16",error:"M11,15H13V17H11V15M11,7H13V13H11V7M12,2C6.47,2 2,6.5 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20Z",success:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2,4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"};class w extends r.WF{render(){var t;return(0,r.qy)(u||(u=f` <div class="issue-type ${0}" role="alert"> <div class="icon ${0}"> <slot name="icon"> <ha-svg-icon .path="${0}"></ha-svg-icon> </slot> </div> <div class="${0}"> <div class="main-content"> ${0} <slot></slot> </div> <div class="action"> <slot name="action"> ${0} </slot> </div> </div> </div> `),(0,l.H)({[this.alertType]:!0}),this.title?"":"no-title",b[this.alertType],(0,l.H)({content:!0,narrow:this.narrow}),this.title?(0,r.qy)(p||(p=f`<div class="title">${0}</div>`),this.title):r.s6,this.dismissable?(0,r.qy)(g||(g=f`<ha-icon-button @click="${0}" .label="${0}" .path="${0}"></ha-icon-button>`),this._dismissClicked,null===(t=this._localize)||void 0===t?void 0:t.call(this,"ui.common.dismiss_alert"),m):r.s6)}_dismissClicked(){(0,d.r)(this,"alert-dismissed-clicked")}constructor(...t){super(...t),this.title="",this.alertType="info",this.dismissable=!1,this.narrow=!1}}w.styles=(0,r.AH)(v||(v=f`.issue-type{position:relative;padding:8px;display:flex}.icon{height:var(--ha-alert-icon-size,24px);width:var(--ha-alert-icon-size,24px)}.issue-type::after{position:absolute;top:0;right:0;bottom:0;left:0;opacity:.12;pointer-events:none;content:"";border-radius:var(--ha-border-radius-sm)}.icon.no-title{align-self:center}.content{display:flex;justify-content:space-between;align-items:center;width:100%;text-align:var(--float-start)}.content.narrow{flex-direction:column;align-items:flex-end}.action{z-index:1;width:min-content;--mdc-theme-primary:var(--primary-text-color)}.main-content{overflow-wrap:anywhere;word-break:break-word;line-height:normal;margin-left:8px;margin-right:0;margin-inline-start:8px;margin-inline-end:8px}.title{margin-top:2px;font-weight:var(--ha-font-weight-bold)}.action ha-icon-button{--mdc-theme-primary:var(--primary-text-color);--ha-icon-button-size:36px}.issue-type.info>.icon{color:var(--info-color)}.issue-type.info::after{background-color:var(--info-color)}.issue-type.warning>.icon{color:var(--warning-color)}.issue-type.warning::after{background-color:var(--warning-color)}.issue-type.error>.icon{color:var(--error-color)}.issue-type.error::after{background-color:var(--error-color)}.issue-type.success>.icon{color:var(--success-color)}.issue-type.success::after{background-color:var(--success-color)}:host ::slotted(ul){margin:0;padding-inline-start:20px}`)),(0,i.Cg)([(0,s.MZ)()],w.prototype,"title",void 0),(0,i.Cg)([(0,s.MZ)({attribute:"alert-type"})],w.prototype,"alertType",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean})],w.prototype,"dismissable",void 0),(0,i.Cg)([(0,s.wk)(),(0,n.IW)()],w.prototype,"_localize",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean})],w.prototype,"narrow",void 0),w=(0,i.Cg)([(0,s.EM)("ha-alert")],w),o()}catch(u){o(u)}})},93444:function(t,e,a){var o=a(40445),i=a(5124),r=a(67576);let s,l,n=t=>t;class d extends i.WF{render(){return(0,i.qy)(s||(s=n` <footer> <slot name="secondaryAction"></slot> <slot name="primaryAction"></slot> </footer> `))}static get styles(){return[(0,i.AH)(l||(l=n`footer{display:flex;gap:var(--ha-space-3);justify-content:flex-end;align-items:center;width:100%}`))]}}d=(0,o.Cg)([(0,r.EM)("ha-dialog-footer")],d)},76538:function(t,e,a){a(62953);var o=a(40445),i=a(5124),r=a(67576);let s,l,n,d,h,c,u=t=>t;class p extends i.WF{render(){const t=(0,i.qy)(s||(s=u`<div class="header-title"> <slot name="title"></slot> </div>`)),e=(0,i.qy)(l||(l=u`<div class="header-subtitle"> <slot name="subtitle"></slot> </div>`));return(0,i.qy)(n||(n=u` <header class="header"> <div class="header-bar"> <section class="header-navigation-icon"> <slot name="navigationIcon"></slot> </section> <section class="header-content"> ${0} </section> <section class="header-action-items"> <slot name="actionItems"></slot> </section> </div> <slot></slot> </header> `),"above"===this.subtitlePosition?(0,i.qy)(d||(d=u`${0}${0}`),e,t):(0,i.qy)(h||(h=u`${0}${0}`),t,e))}static get styles(){return[(0,i.AH)(c||(c=u`:host{display:block}:host([show-border]){border-bottom:1px solid var(--mdc-dialog-scroll-divider-color,rgba(0,0,0,.12))}.header-bar{display:flex;flex-direction:row;align-items:center;padding:0 var(--ha-space-1);box-sizing:border-box}.header-content{flex:1;padding:10px var(--ha-space-1);display:flex;flex-direction:column;justify-content:center;min-height:var(--ha-space-12);min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.header-title{height:var(--ha-dialog-header-title-height,calc(var(--ha-font-size-xl) + var(--ha-space-1)));font-size:var(--ha-font-size-xl);line-height:var(--ha-line-height-condensed);font-weight:var(--ha-font-weight-medium);color:var(--ha-dialog-header-title-color,var(--primary-text-color))}.header-subtitle{font-size:var(--ha-font-size-m);line-height:var(--ha-line-height-normal);color:var(--ha-dialog-header-subtitle-color,var(--secondary-text-color))}@media all and (min-width:450px) and (min-height:500px){.header-bar{padding:0 var(--ha-space-2)}}.header-navigation-icon{flex:none;min-width:var(--ha-space-2);height:100%;display:flex;flex-direction:row}.header-action-items{flex:none;min-width:var(--ha-space-2);height:100%;display:flex;flex-direction:row}`))]}constructor(...t){super(...t),this.subtitlePosition="below",this.showBorder=!1}}(0,o.Cg)([(0,r.MZ)({type:String,attribute:"subtitle-position"})],p.prototype,"subtitlePosition",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean,reflect:!0,attribute:"show-border"})],p.prototype,"showBorder",void 0),p=(0,o.Cg)([(0,r.EM)("ha-dialog-header")],p)},72554:function(t,e,a){a.a(t,async function(t,e){try{a(3362),a(62953),a(49255);var o=a(40445),i=a(93900),r=a(35211),s=a(5124),l=a(67576),n=a(63672),d=a(1087),h=a(64481),c=a(22792),u=a(59992),p=a(14503),g=a(22348),v=(a(76538),a(26300)),f=t([i,v,u]);[i,v,u]=f.then?(await f)():f;let m,b,w,y,_,x,C,S=t=>t;const $="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z";class k extends((0,u.V)(s.WF)){connectedCallback(){super.connectedCallback(),this.addEventListener("dialog-set-fullscreen",this._handleFullscreenChanged)}get scrollableElement(){return this.bodyContainer}updated(t){super.updated(t),t.has("open")&&(this._open=this.open)}render(){var t,e,a;return(0,s.qy)(m||(m=S` <wa-dialog .open="${0}" .lightDismiss="${0}" without-header aria-labelledby="${0}" aria-describedby="${0}" @keydown="${0}" @wa-hide="${0}" @wa-show="${0}" @wa-after-show="${0}" @wa-after-hide="${0}"> ${0} <div class="content-wrapper"> <div class="body ha-scrollbar" @scroll="${0}"> <slot></slot> </div> ${0} </div> <slot name="footer" slot="footer"></slot> </wa-dialog> `),this._open,!this.preventScrimClose,(0,n.J)(this.ariaLabelledBy||(void 0!==this.headerTitle?"ha-dialog-title":void 0)),(0,n.J)(this.ariaDescribedBy),this._handleKeyDown,this._handleHide,this._handleShow,this._handleAfterShow,this._handleAfterHide,this.withoutHeader?s.s6:(0,s.qy)(b||(b=S`<slot name="header"> <ha-dialog-header .subtitlePosition="${0}" .showBorder="${0}"> <slot name="headerNavigationIcon" slot="navigationIcon"> <ha-icon-button data-dialog="close" .label="${0}" .path="${0}"></ha-icon-button> </slot> ${0} ${0} <slot name="headerActionItems" slot="actionItems"></slot> </ha-dialog-header> </slot>`),this.headerSubtitlePosition,this._bodyScrolled,null!==(t=null===(e=this._i18n)||void 0===e||null===(a=e.localize)||void 0===a?void 0:a.call(e,"ui.common.close"))&&void 0!==t?t:"Close",$,void 0!==this.headerTitle?(0,s.qy)(w||(w=S`<span slot="title" class="title" id="ha-dialog-title"> ${0} </span>`),this.headerTitle):(0,s.qy)(y||(y=S`<slot name="headerTitle" slot="title"></slot>`)),void 0!==this.headerSubtitle?(0,s.qy)(_||(_=S`<span slot="subtitle">${0}</span>`),this.headerSubtitle):(0,s.qy)(x||(x=S`<slot name="headerSubtitle" slot="subtitle"></slot>`))),this._handleBodyScroll,this.renderScrollableFades())}disconnectedCallback(){this.removeEventListener("dialog-set-fullscreen",this._handleFullscreenChanged),this._setFullscreen(!1),super.disconnectedCallback(),this._open=!1}_handleFullscreenChanged(t){this._open?(0,h.J)(()=>{this._setFullscreen(t.detail)}):this._setFullscreen(t.detail)}_setFullscreen(t){this.toggleAttribute("fullscreen",t)}_handleBodyScroll(t){this._bodyScrolled=t.target.scrollTop>0}_handleKeyDown(t){"Escape"===t.key&&(this._escapePressed=!0,this.preventScrimClose&&t.preventDefault(),t.stopPropagation(),t.currentTarget.open=!1)}_handleHide(t){var e;const a=(null===(e=t.detail)||void 0===e?void 0:e.source)===t.target.dialog;this.preventScrimClose&&this._escapePressed&&a&&t.preventDefault(),this._escapePressed=!1}static get styles(){return[...super.styles,p.dp,(0,s.AH)(C||(C=S`wa-dialog{--full-width:var( --ha-dialog-width-full, min(95vw, var(--safe-width)) );--width:min(var(--ha-dialog-width-md, 580px), var(--full-width));--spacing:var(--dialog-content-padding, var(--ha-space-6));--show-duration:var(--ha-dialog-show-duration, 200ms);--hide-duration:var(--ha-dialog-hide-duration, 200ms);--wa-color-surface-raised:var( --ha-dialog-surface-background, var(--card-background-color, var(--ha-color-surface-default)) );--wa-panel-border-radius:var( --ha-dialog-border-radius, var(--ha-border-radius-3xl) );max-width:var(--ha-dialog-max-width,var(--safe-width))}@media (prefers-reduced-motion:reduce){wa-dialog{--show-duration:0ms;--hide-duration:0ms}}:host([width=small]) wa-dialog{--width:min(var(--ha-dialog-width-sm, 320px), var(--full-width))}:host([width=large]) wa-dialog{--width:min(var(--ha-dialog-width-lg, 1024px), var(--full-width))}:host([fullscreen]) wa-dialog,:host([width=full]) wa-dialog{--width:var(--full-width)}:host([fullscreen]) wa-dialog::part(dialog){min-height:var(--safe-height);max-height:var(--safe-height);margin-top:0;transform:none}:host([fullscreen]) .content-wrapper{overflow:hidden}:host([fullscreen]) .body{overflow:hidden;padding:0}wa-dialog::part(dialog){-webkit-backdrop-filter:var(--ha-dialog-surface-backdrop-filter,none);backdrop-filter:var(--ha-dialog-surface-backdrop-filter,none);box-shadow:var(--dialog-box-shadow,var(--wa-shadow-l));color:var(--primary-text-color);min-width:var(--width,var(--full-width));max-width:var(--width,var(--full-width));max-height:var(--ha-dialog-max-height,calc(var(--safe-height) - var(--ha-space-20)));min-height:var(--ha-dialog-min-height);margin-top:var(--dialog-surface-margin-top,auto);transform:translate(calc(var(--safe-area-offset-left,0px) - var(--safe-area-offset-right,0px)),calc(var(--safe-area-offset-top,0px) - var(--safe-area-offset-bottom,0px)));display:flex;flex-direction:column;overflow:hidden}wa-dialog::part(dialog)::backdrop{-webkit-backdrop-filter:var(--ha-dialog-scrim-backdrop-filter,var(--dialog-backdrop-filter,none));backdrop-filter:var(--ha-dialog-scrim-backdrop-filter,var(--dialog-backdrop-filter,none));background-color:var(--mdc-dialog-scrim-color,none)}@media all and (max-width:450px),all and (max-height:500px){:host([type=standard]){--ha-dialog-border-radius:0}:host([type=standard]) wa-dialog{--full-width:var(--ha-dialog-width-full, 100vw);--width:var(--full-width)}:host([type=standard]) wa-dialog::part(dialog){min-height:var(--ha-dialog-min-height,100vh);min-height:var(--ha-dialog-min-height,100dvh);max-height:var(--ha-dialog-max-height,100vh);max-height:var(--ha-dialog-max-height,100dvh);margin-top:0;margin-bottom:0;padding-top:var(--safe-area-inset-top);padding-bottom:var(--safe-area-inset-bottom);padding-left:var(--safe-area-inset-left);padding-right:var(--safe-area-inset-right);transform:none}}.header-title-container{display:flex;align-items:center}.header-title{margin:0;margin-bottom:0;color:var(--ha-dialog-header-title-color,var(--primary-text-color));font-size:var( --ha-dialog-header-title-font-size, var(--ha-font-size-2xl) );line-height:var( --ha-dialog-header-title-line-height, var(--ha-line-height-condensed) );font-weight:var(--ha-dialog-header-title-font-weight,var(--ha-font-weight-normal));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin-right:var(--ha-space-3)}wa-dialog::part(body){padding:0;display:flex;flex-direction:column;max-width:100%;overflow:hidden}.content-wrapper{position:relative;flex:1;display:flex;flex-direction:column;min-height:0}.body{position:var(--dialog-content-position,relative);padding:var(--dialog-content-padding,0 var(--ha-space-6) var(--ha-space-6) var(--ha-space-6));overflow:auto;flex-grow:1}:host([flexcontent]) .body{max-width:100%;flex:1;display:flex;flex-direction:column}wa-dialog::part(footer){padding:0}::slotted([slot=footer]){display:flex;padding:var(--ha-space-3) var(--ha-space-4) var(--ha-space-4) var(--ha-space-4);gap:var(--ha-space-3);justify-content:flex-end;align-items:center;width:100%}`))]}constructor(...t){super(...t),this.open=!1,this.type="standard",this.width="medium",this.preventScrimClose=!1,this.headerSubtitlePosition="below",this.flexContent=!1,this.withoutHeader=!1,this._open=!1,this._bodyScrolled=!1,this._escapePressed=!1,this._handleShow=async t=>{t.eventPhase===Event.AT_TARGET&&(this._open=!0,(0,d.r)(this,"opened"),await this.updateComplete,requestAnimationFrame(()=>{var t,e;if(null!==(t=this._hassConfig)&&void 0!==t&&t.auth.external&&(0,g.V)(this._hassConfig.auth.external)){const t=this.querySelector("[autofocus]");return void(null!==t&&(t.id||(t.id="ha-dialog-autofocus"),this._hassConfig.auth.external.fireMessage({type:"focus_element",payload:{element_id:t.id}})))}null===(e=this.querySelector("[autofocus]"))||void 0===e||e.focus()}))},this._handleAfterShow=t=>{t.eventPhase===Event.AT_TARGET&&(0,d.r)(this,"after-show")},this._handleAfterHide=t=>{t.eventPhase===Event.AT_TARGET&&(this._open=!1,this._setFullscreen(!1),(0,d.r)(this,"closed"))}}}(0,o.Cg)([(0,l.MZ)({attribute:"aria-labelledby"})],k.prototype,"ariaLabelledBy",void 0),(0,o.Cg)([(0,l.MZ)({attribute:"aria-describedby"})],k.prototype,"ariaDescribedBy",void 0),(0,o.Cg)([(0,l.MZ)({type:Boolean,reflect:!0})],k.prototype,"open",void 0),(0,o.Cg)([(0,l.MZ)({reflect:!0})],k.prototype,"type",void 0),(0,o.Cg)([(0,l.MZ)({type:String,reflect:!0,attribute:"width"})],k.prototype,"width",void 0),(0,o.Cg)([(0,l.MZ)({type:Boolean,reflect:!0,attribute:"prevent-scrim-close"})],k.prototype,"preventScrimClose",void 0),(0,o.Cg)([(0,l.MZ)({attribute:"header-title"})],k.prototype,"headerTitle",void 0),(0,o.Cg)([(0,l.MZ)({attribute:"header-subtitle"})],k.prototype,"headerSubtitle",void 0),(0,o.Cg)([(0,l.MZ)({type:String,attribute:"header-subtitle-position"})],k.prototype,"headerSubtitlePosition",void 0),(0,o.Cg)([(0,l.MZ)({type:Boolean,reflect:!0,attribute:"flexcontent"})],k.prototype,"flexContent",void 0),(0,o.Cg)([(0,l.MZ)({type:Boolean,attribute:"without-header"})],k.prototype,"withoutHeader",void 0),(0,o.Cg)([(0,l.wk)()],k.prototype,"_open",void 0),(0,o.Cg)([(0,l.P)(".body")],k.prototype,"bodyContainer",void 0),(0,o.Cg)([(0,l.wk)(),(0,r.Fg)({context:c.D5,subscribe:!0})],k.prototype,"_i18n",void 0),(0,o.Cg)([(0,l.wk)(),(0,r.Fg)({context:c.WF,subscribe:!0})],k.prototype,"_hassConfig",void 0),(0,o.Cg)([(0,l.wk)()],k.prototype,"_bodyScrolled",void 0),(0,o.Cg)([(0,l.Ls)({passive:!0})],k.prototype,"_handleBodyScroll",null),k=(0,o.Cg)([(0,l.EM)("ha-dialog")],k),e()}catch(m){e(m)}})},59992:function(t,e,a){a.a(t,async function(t,o){try{a.d(e,{V:function(){return g}});a(62953);var i=a(40445),r=a(88696),s=a(5124),l=a(6412),n=a(67576),d=t([r]);r=(d.then?(await d)():d)[0];let h,c,u=t=>t;const p=t=>void 0===t?[]:Array.isArray(t)?t:[t],g=t=>{class e extends t{get scrollableElement(){return e.DEFAULT_SCROLLABLE_ELEMENT}firstUpdated(t){var e;null===(e=super.firstUpdated)||void 0===e||e.call(this,t),this.scrollableElement&&this._updateScrollableState(this.scrollableElement),this._attachScrollableElement()}updated(t){var e;null===(e=super.updated)||void 0===e||e.call(this,t),this._attachScrollableElement()}disconnectedCallback(){this._detachScrollableElement(),this._contentScrolled=!1,this._contentScrollable=!1,super.disconnectedCallback()}renderScrollableFades(t=!1){return(0,s.qy)(h||(h=u` <div class="${0}"></div> <div class="${0}"></div> `),(0,l.H)({"fade-top":!0,rounded:t,visible:this._contentScrolled}),(0,l.H)({"fade-bottom":!0,rounded:t,visible:this._contentScrollable}))}static get styles(){var t;const e=Object.getPrototypeOf(this);return[...p(null!==(t=null==e?void 0:e.styles)&&void 0!==t?t:[]),(0,s.AH)(c||(c=u`.fade-bottom,.fade-top{position:absolute;left:0;right:0;height:var(--ha-space-2);pointer-events:none;transition:opacity 180ms ease-in-out;border-radius:var(--ha-border-radius-square);opacity:0;background:linear-gradient(to bottom,var(--ha-color-shadow-scrollable-fade),transparent)}.fade-top{top:0}.fade-bottom{bottom:0;transform:rotate(180deg)}.fade-bottom.visible,.fade-top.visible{opacity:1}.fade-bottom.rounded,.fade-top.rounded{border-radius:var(--ha-card-border-radius,var(--ha-border-radius-lg));border-bottom-left-radius:var(--ha-border-radius-square);border-bottom-right-radius:var(--ha-border-radius-square)}.fade-top.rounded{border-top-left-radius:var(--ha-border-radius-square);border-top-right-radius:var(--ha-border-radius-square)}.fade-bottom.rounded{border-bottom-left-radius:var(--ha-border-radius-square);border-bottom-right-radius:var(--ha-border-radius-square)}`))]}_attachScrollableElement(){const t=this.scrollableElement;t!==this._scrollTarget&&(this._detachScrollableElement(),t&&(this._scrollTarget=t,t.addEventListener("scroll",this._onScroll,{passive:!0}),this._resize.observe(t),this._updateScrollableState(t)))}_detachScrollableElement(){var t,e;this._scrollTarget&&(this._scrollTarget.removeEventListener("scroll",this._onScroll),null===(t=(e=this._resize).unobserve)||void 0===t||t.call(e,this._scrollTarget),this._scrollTarget=void 0)}_updateScrollableState(t){const e=parseFloat(getComputedStyle(t).getPropertyValue("--safe-area-inset-bottom"))||0,{scrollHeight:a=0,clientHeight:o=0,scrollTop:i=0}=t;this._contentScrollable=a-o>i+e+this.scrollFadeSafeAreaPadding}constructor(...t){super(...t),this._contentScrolled=!1,this._contentScrollable=!1,this._onScroll=t=>{var e;const a=t.currentTarget;this._contentScrolled=(null!==(e=a.scrollTop)&&void 0!==e?e:0)>this.scrollFadeThreshold,this._updateScrollableState(a)},this._resize=new r.P(this,{target:null,callback:t=>{var e;const a=null===(e=t[0])||void 0===e?void 0:e.target;a&&this._updateScrollableState(a)}}),this.scrollFadeSafeAreaPadding=4,this.scrollFadeThreshold=4}}return e.DEFAULT_SCROLLABLE_ELEMENT=null,(0,i.Cg)([(0,n.wk)()],e.prototype,"_contentScrolled",void 0),(0,i.Cg)([(0,n.wk)()],e.prototype,"_contentScrollable",void 0),e};o()}catch(h){o(h)}})},24367:function(t,e,a){a.d(e,{L:function(){return i},z:function(){return r}});var o=a(23832);const i=["input_boolean","input_button","input_text","input_number","input_datetime","input_select","counter","timer","schedule"],r=(0,o.g)(i)},21296:function(t,e,a){a.a(t,async function(t,o){try{a.r(e);a(3362),a(62953);var i=a(40445),r=a(5124),s=a(67576),l=a(22786),n=a(1087),d=(a(93444),a(72554)),h=a(52763),c=a(18350),u=a(14503),p=t([d,h,c]);[d,h,c]=p.then?(await p)():p;let g,v=t=>t;const f=[{name:"location",required:!0,selector:{location:{radius:!0}}}];class m extends r.WF{showDialog(t){this._params=t,this._error=void 0,this._data={name:this.hass.config.location_name,latitude:this.hass.config.latitude,longitude:this.hass.config.longitude,radius:this.hass.config.radius},this._open=!0}closeDialog(){this._open=!1}_dialogClosed(){this._params=void 0,this._data=void 0,(0,n.r)(this,"dialog-closed",{dialog:this.localName})}render(){if(!this._params||!this._data)return r.s6;const t=""===String(this._data.latitude),e=""===String(this._data.longitude),a=!t&&!e;return(0,r.qy)(g||(g=v` <ha-dialog .open="${0}" header-title="${0}" prevent-scrim-close @closed="${0}"> <ha-form autofocus .hass="${0}" .schema="${0}" .data="${0}" .error="${0}" .computeLabel="${0}" @value-changed="${0}"></ha-form> <ha-dialog-footer slot="footer"> <ha-button slot="secondaryAction" appearance="plain" @click="${0}"> ${0} </ha-button> <ha-button slot="primaryAction" @click="${0}" .disabled="${0}"> ${0} </ha-button> </ha-dialog-footer> </ha-dialog> `),this._open,this.hass.localize("ui.common.edit_item",{name:this._data.name}),this._dialogClosed,this.hass,f,this._formData(this._data),this._error,this._computeLabel,this._valueChanged,this.closeDialog,this.hass.localize("ui.common.cancel"),this._updateEntry,!a||this._submitting,this.hass.localize("ui.common.save"))}_valueChanged(t){this._error=void 0;const e=Object.assign({},t.detail.value);e.latitude=e.location.latitude,e.longitude=e.location.longitude,e.radius=e.location.radius,delete e.location,this._data=e}async _updateEntry(){this._submitting=!0;try{await this._params.updateEntry(this._data),this.closeDialog()}catch(t){this._error={base:t?t.message:"Unknown error"}}finally{this._submitting=!1}}static get styles(){return[u.nA]}constructor(...t){super(...t),this._open=!1,this._submitting=!1,this._formData=(0,l.A)(t=>Object.assign(Object.assign({},t),{},{location:{latitude:t.latitude,longitude:t.longitude,radius:t.radius||100}})),this._computeLabel=()=>""}}(0,i.Cg)([(0,s.MZ)({attribute:!1})],m.prototype,"hass",void 0),(0,i.Cg)([(0,s.wk)()],m.prototype,"_error",void 0),(0,i.Cg)([(0,s.wk)()],m.prototype,"_data",void 0),(0,i.Cg)([(0,s.wk)()],m.prototype,"_params",void 0),(0,i.Cg)([(0,s.wk)()],m.prototype,"_open",void 0),(0,i.Cg)([(0,s.wk)()],m.prototype,"_submitting",void 0),m=(0,i.Cg)([(0,s.EM)("dialog-home-zone-detail")],m),o()}catch(g){o(g)}})},22348:function(t,e,a){a.d(e,{V:function(){return i}});var o=a(37177);const i=t=>!!t&&o.n},37177:function(t,e,a){a.d(e,{n:function(){return o}});a(27495);const o=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}}]);