UNPKG

iobroker.lovelace

Version:

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

4 lines 23.4 kB
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[4091],{72487:function(e,t,a){a.a(e,async function(e,r){try{a.d(t,{CA:function(){return k},Mi:function(){return T},Pm:function(){return x},Wq:function(){return b},Yq:function(){return d},bl:function(){return I},c2:function(){return _},fr:function(){return f},gu:function(){return A},kz:function(){return h},m9:function(){return E},sl:function(){return g},ur:function(){return D},zB:function(){return p}});a(18111),a(20116);var i=a(74487),o=a(22786),n=a(46927),s=a(8480),l=e([i,s]);[i,s]=l.then?(await l)():l;(0,o.A)((e,t)=>new Intl.DateTimeFormat(e.language,{weekday:"long",month:"long",day:"numeric",timeZone:(0,s.wj)(e.time_zone,t)}));const d=(e,t,a)=>c(t,a.time_zone).format(e),c=(0,o.A)((e,t)=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"long",day:"numeric",timeZone:(0,s.wj)(e.time_zone,t)})),h=(e,t,a)=>u(t,a.time_zone).format(e),u=(0,o.A)((e,t)=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"short",day:"numeric",timeZone:(0,s.wj)(e.time_zone,t)})),p=(e,t,a)=>{var r,i,o,s;const l=m(t,a.time_zone);if(t.date_format===n.ow.language||t.date_format===n.ow.system)return l.format(e);const d=l.formatToParts(e),c=null===(r=d.find(e=>"literal"===e.type))||void 0===r?void 0:r.value,h=null===(i=d.find(e=>"day"===e.type))||void 0===i?void 0:i.value,u=null===(o=d.find(e=>"month"===e.type))||void 0===o?void 0:o.value,p=null===(s=d.find(e=>"year"===e.type))||void 0===s?void 0:s.value,g=d[d.length-1];let v="literal"===(null==g?void 0:g.type)?null==g?void 0:g.value:"";"bg"===t.language&&t.date_format===n.ow.YMD&&(v="");return{[n.ow.DMY]:`${h}${c}${u}${c}${p}${v}`,[n.ow.MDY]:`${u}${c}${h}${c}${p}${v}`,[n.ow.YMD]:`${p}${c}${u}${c}${h}${v}`}[t.date_format]},m=(0,o.A)((e,t)=>{const a=e.date_format===n.ow.system?void 0:e.language;return e.date_format===n.ow.language||(e.date_format,n.ow.system),new Intl.DateTimeFormat(a,{year:"numeric",month:"numeric",day:"numeric",timeZone:(0,s.wj)(e.time_zone,t)})}),g=(e,t,a)=>v(t,a.time_zone).format(e),v=(0,o.A)((e,t)=>new Intl.DateTimeFormat(e.language,{day:"numeric",month:"short",timeZone:(0,s.wj)(e.time_zone,t)})),f=(e,t,a)=>y(t,a.time_zone).format(e),y=(0,o.A)((e,t)=>new Intl.DateTimeFormat(e.language,{month:"long",year:"numeric",timeZone:(0,s.wj)(e.time_zone,t)})),b=(e,t,a)=>w(t,a.time_zone).format(e),w=(0,o.A)((e,t)=>new Intl.DateTimeFormat(e.language,{month:"long",timeZone:(0,s.wj)(e.time_zone,t)})),_=(e,t,a)=>$(t,a.time_zone).format(e),$=(0,o.A)((e,t)=>new Intl.DateTimeFormat(e.language,{month:"short",timeZone:(0,s.wj)(e.time_zone,t)})),x=(e,t,a)=>C(t,a.time_zone).format(e),C=(0,o.A)((e,t)=>new Intl.DateTimeFormat(e.language,{year:"numeric",timeZone:(0,s.wj)(e.time_zone,t)})),k=(e,t,a)=>z(t,a.time_zone).format(e),z=(0,o.A)((e,t)=>new Intl.DateTimeFormat(e.language,{weekday:"long",timeZone:(0,s.wj)(e.time_zone,t)})),A=(e,t,a)=>S(t,a.time_zone).format(e),S=(0,o.A)((e,t)=>new Intl.DateTimeFormat(e.language,{weekday:"short",timeZone:(0,s.wj)(e.time_zone,t)})),T=(e,t,a)=>Z(t,a.time_zone).format(e),Z=(0,o.A)((e,t)=>new Intl.DateTimeFormat(e.language,{weekday:"short",month:"short",day:"numeric",timeZone:(0,s.wj)(e.time_zone,t)})),D=(e,t,a)=>M(t,a.time_zone).format(e),M=(0,o.A)((e,t)=>new Intl.DateTimeFormat(e.language,{weekday:"short",month:"short",day:"numeric",year:"numeric",timeZone:(0,s.wj)(e.time_zone,t)})),I=(e,t,a)=>{const r=(0,s.wj)(t.time_zone,a.time_zone);return new Intl.DateTimeFormat("en-CA",{year:"numeric",month:"2-digit",day:"2-digit",timeZone:r}).format(e)},E=(e,t,a,r)=>`${I(e,a,r)}/${I(t,a,r)}`;r()}catch(d){r(d)}})},30162:function(e,t,a){a.a(e,async function(e,r){try{a.d(t,{LW:function(){return g},Xs:function(){return p},fU:function(){return d},ie:function(){return h}});var i=a(74487),o=a(22786),n=a(8480),s=a(69543),l=e([i,n]);[i,n]=l.then?(await l)():l;const d=(e,t,a)=>c(t,a.time_zone).format(e),c=(0,o.A)((e,t)=>new Intl.DateTimeFormat(e.language,{hour:"numeric",minute:"2-digit",hourCycle:(0,s.J)(e)?"h12":"h23",timeZone:(0,n.wj)(e.time_zone,t)})),h=(e,t,a)=>u(t,a.time_zone).format(e),u=(0,o.A)((e,t)=>new Intl.DateTimeFormat(e.language,{hour:(0,s.J)(e)?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hourCycle:(0,s.J)(e)?"h12":"h23",timeZone:(0,n.wj)(e.time_zone,t)})),p=(e,t,a)=>m(t,a.time_zone).format(e),m=(0,o.A)((e,t)=>new Intl.DateTimeFormat(e.language,{weekday:"long",hour:(0,s.J)(e)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,s.J)(e)?"h12":"h23",timeZone:(0,n.wj)(e.time_zone,t)})),g=(e,t,a)=>v(t,a.time_zone).format(e),v=(0,o.A)((e,t)=>new Intl.DateTimeFormat("en-GB",{hour:"numeric",minute:"2-digit",hour12:!1,timeZone:(0,n.wj)(e.time_zone,t)}));r()}catch(d){r(d)}})},26218:function(e,t,a){a.d(t,{a:function(){return i}});a(16280);const r=(0,a(77796).n)(e=>{history.replaceState({scrollPosition:e},"")},300);function i(e){return(t,a)=>{if("object"==typeof a)throw new Error("This decorator does not support this compilation type.");const i=t.connectedCallback;t.connectedCallback=function(){i.call(this);const t=this[a];t&&this.updateComplete.then(()=>{const a=this.renderRoot.querySelector(e);a&&setTimeout(()=>{a.scrollTop=t},0)})};const o=Object.getOwnPropertyDescriptor(t,a);let n;if(void 0===o)n={get(){var e;return this[`__${String(a)}`]||(null===(e=history.state)||void 0===e?void 0:e.scrollPosition)},set(e){r(e),this[`__${String(a)}`]=e},configurable:!0,enumerable:!0};else{const e=o.set;n=Object.assign(Object.assign({},o),{},{set(t){r(t),this[`__${String(a)}`]=t,null==e||e.call(this,t)}})}Object.defineProperty(t,a,n)}}},34296:function(e,t,a){a(62953);var r=a(40445),i=a(96229),o=a(26069),n=a(91735),s=a(42034),l=a(5124),d=a(67576);let c,h,u,p,m=e=>e;class g extends i.k{renderOutline(){return this.filled?(0,l.qy)(c||(c=m`<span class="filled"></span>`)):super.renderOutline()}getContainerClasses(){return Object.assign(Object.assign({},super.getContainerClasses()),{},{active:this.active})}renderPrimaryContent(){return(0,l.qy)(h||(h=m` <span class="leading icon" aria-hidden="true"> ${0} </span> <span class="label">${0}</span> <span class="touch"></span> <span class="trailing leading icon" aria-hidden="true"> ${0} </span> `),this.renderLeadingIcon(),this.label,this.renderTrailingIcon())}renderTrailingIcon(){return(0,l.qy)(u||(u=m`<slot name="trailing-icon"></slot>`))}constructor(...e){super(...e),this.filled=!1,this.active=!1}}g.styles=[n.R,s.R,o.R,(0,l.AH)(p||(p=m`:host{--md-sys-color-primary:var(--primary-text-color);--md-sys-color-on-surface:var(--primary-text-color);--md-assist-chip-container-shape:var( --ha-assist-chip-container-shape, 16px );--md-assist-chip-outline-color:var(--outline-color);--md-assist-chip-label-text-weight:400}.filled{display:flex;pointer-events:none;border-radius:inherit;inset:0;position:absolute;background-color:var(--ha-assist-chip-filled-container-color)}::slotted([slot=icon]),::slotted([slot=trailing-icon]){display:flex;--mdc-icon-size:var(--md-input-chip-icon-size, 18px);font-size:var(--_label-text-size)!important}.trailing.icon ::slotted(*),.trailing.icon svg{margin-inline-end:unset;margin-inline-start:var(--_icon-label-space)}::before{background:var(--ha-assist-chip-container-color,transparent);opacity:var(--ha-assist-chip-container-opacity, 1)}:where(.active)::before{background:var(--ha-assist-chip-active-container-color);opacity:var(--ha-assist-chip-active-container-opacity)}.label{font-family:var(--ha-font-family-body)}`))],(0,r.Cg)([(0,d.MZ)({type:Boolean,reflect:!0})],g.prototype,"filled",void 0),(0,r.Cg)([(0,d.MZ)({type:Boolean})],g.prototype,"active",void 0),g=(0,r.Cg)([(0,d.EM)("ha-assist-chip")],g)},99611:function(e,t,a){a.a(e,async function(e,t){try{a(18111),a(13579),a(3362),a(17642),a(58004),a(33853),a(45876),a(32475),a(15024),a(31698),a(62953);var r=a(40445),i=a(1126),o=a(35211),n=a(5124),s=a(67576),l=a(1087),d=a(60353),c=a(22792),h=a(59992),u=a(14503),p=a(22348),m=e([i,h]);[i,h]=m.then?(await m)():m;let g,v,f=e=>e;const y=300,b=new Set(["ha-control-slider","ha-slider","ha-control-switch","ha-control-circular-slider","ha-hs-color-picker","ha-map","ha-more-info-control-select-container","ha-filter-chip"]),w=new Set(["volume-slider-container","forecast"]);class _ extends((0,h.V)(n.WF)){get scrollableElement(){return this._bodyElement}connectedCallback(){super.connectedCallback(),this.addEventListener("slider-interaction-start",this._handleSliderInteractionStart,{capture:!0}),this.addEventListener("slider-interaction-stop",this._handleSliderInteractionStop,{capture:!0})}updated(e){super.updated(e),e.has("open")&&(this._drawerOpen=this.open)}render(){return(0,n.qy)(g||(g=f` <wa-drawer id="drawer" placement="bottom" .open="${0}" .lightDismiss="${0}" .ariaLabelledby="${0}" .ariaDescribedby="${0}" @keydown="${0}" @wa-show="${0}" @wa-after-show="${0}" @wa-hide="${0}" @wa-after-hide="${0}" @click="${0}" without-header @touchstart="${0}"> <div class="handle-wrapper" aria-hidden="true"> <div class="handle"></div> </div> <slot name="header"></slot> <div class="content-wrapper"> <div id="body" class="body ha-scrollbar"> <slot></slot> </div> ${0} </div> <slot name="footer"></slot> </wa-drawer> `),this._drawerOpen,!this.preventScrimClose,this.ariaLabelledBy,this.ariaDescribedBy,this._handleKeyDown,this._handleShow,this._handleAfterShow,this._handleHide,this._handleAfterHide,this._handleCloseAction,this._handleTouchStart,this.renderScrollableFades())}_startResizing(e){document.addEventListener("touchmove",this._handleTouchMove,{passive:!1}),document.addEventListener("touchend",this._handleTouchEnd),document.addEventListener("touchcancel",this._handleTouchEnd),this._gestureRecognizer.start(e)}_animateSnapBack(){this.style.setProperty("--dialog-transition",`transform ${y}ms ease-out`),this.style.removeProperty("--dialog-transform"),setTimeout(()=>{this.style.removeProperty("--dialog-transition")},y)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("slider-interaction-start",this._handleSliderInteractionStart,{capture:!0}),this.removeEventListener("slider-interaction-stop",this._handleSliderInteractionStop,{capture:!0}),this._unregisterResizeHandlers(),this._isDragging=!1}static get styles(){return[...super.styles,u.dp,(0,n.AH)(v||(v=f`wa-drawer{--wa-color-surface-raised:transparent;--spacing:0;--size:var(--ha-bottom-sheet-height, auto);--show-duration:${0}ms;--hide-duration:${0}ms}wa-drawer::part(dialog){max-height:min(var(--ha-bottom-sheet-max-height,90vh),calc(100vh - max(var(--safe-area-inset-top),48px)));max-height:min(var(--ha-bottom-sheet-max-height,90dvh),calc(100dvh - max(var(--safe-area-inset-top),48px)));align-items:center;transform:var(--dialog-transform);transition:var(--dialog-transition)}@media (prefers-reduced-motion:reduce){wa-drawer{--wa-color-surface-raised:transparent;--spacing:0;--size:var(--ha-bottom-sheet-height, auto);--show-duration:1ms;--hide-duration:1ms}wa-drawer::part(dialog){transition:1ms}}wa-drawer::part(dialog)::backdrop{-webkit-backdrop-filter:var(--ha-bottom-sheet-scrim-backdrop-filter,var(--ha-dialog-scrim-backdrop-filter,var(--dialog-backdrop-filter,none)));backdrop-filter:var(--ha-bottom-sheet-scrim-backdrop-filter,var(--ha-dialog-scrim-backdrop-filter,var(--dialog-backdrop-filter,none)));background-color:var(--ha-bottom-sheet-scrim-color,var(--mdc-dialog-scrim-color,none))}wa-drawer::part(body){max-width:var(--ha-bottom-sheet-max-width);width:100%;position:relative;border-top-left-radius:var(--ha-bottom-sheet-border-radius,var(--ha-dialog-border-radius,var(--ha-border-radius-2xl)));border-top-right-radius:var(--ha-bottom-sheet-border-radius,var(--ha-dialog-border-radius,var(--ha-border-radius-2xl)));background-color:var(--ha-bottom-sheet-surface-background,var(--ha-dialog-surface-background,var(--card-background-color,var(--ha-color-surface-default))));-webkit-backdrop-filter:var(--ha-bottom-sheet-surface-backdrop-filter,var(--ha-dialog-surface-backdrop-filter,none));backdrop-filter:var(--ha-bottom-sheet-surface-backdrop-filter,var(--ha-dialog-surface-backdrop-filter,none));padding:var(--ha-bottom-sheet-padding,0 var(--safe-area-inset-right) var(--safe-area-inset-bottom) var(--safe-area-inset-left))}:host([flexcontent]) wa-drawer::part(body){display:flex;flex-direction:column}:host([prevent-scrim-close]) .handle-wrapper{display:none}.handle-wrapper{position:absolute;top:0;inset-inline-start:0;width:100%;padding-bottom:2px;display:flex;justify-content:center;align-items:center;pointer-events:none;z-index:1}.handle-wrapper .handle{height:16px;width:200px;display:flex;justify-content:center;align-items:center}.handle-wrapper .handle::after{content:"";border-radius:var(--ha-border-radius-md);height:4px;background:var(--ha-bottom-sheet-handle-color,var(--divider-color));width:40px}.content-wrapper{position:relative;flex:1;display:flex;flex-direction:column;min-height:0}.body{padding:var(--ha-bottom-sheet-content-padding,0);box-sizing:border-box}:host([flexcontent]) .body{flex:1;max-width:100%;display:flex;flex-direction:column;padding:var(--ha-bottom-sheet-content-padding,var(--ha-bottom-sheet-padding,0 var(--safe-area-inset-right) var(--safe-area-inset-bottom) var(--safe-area-inset-left)));box-sizing:border-box}slot[name=footer]{display:block;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%;box-sizing:border-box}:host([flexcontent]) slot[name=footer]{flex-shrink:0}`),y,y)]}constructor(...e){super(...e),this.open=!1,this.flexContent=!1,this.preventScrimClose=!1,this._drawerOpen=!1,this._sliderInteractionActive=!1,this._gestureRecognizer=new d.u,this._isDragging=!1,this._escapePressed=!1,this._handleShow=async()=>{this._drawerOpen=!0,this.open=!0,(0,l.r)(this,"opened"),await this.updateComplete,requestAnimationFrame(()=>{var e;const t=this._autofocusElement;null!==(e=this._hassConfig)&&void 0!==e&&e.auth.external&&(0,p.V)(this._hassConfig.auth.external)?t&&(t.id||(t.id="ha-bottom-sheet-autofocus"),this._hassConfig.auth.external.fireMessage({type:"focus_element",payload:{element_id:t.id}})):null==t||t.focus()})},this._handleAfterShow=()=>{(0,l.r)(this,"after-show")},this._handleSliderInteractionStart=()=>{this._sliderInteractionActive=!0},this._handleSliderInteractionStop=()=>{this._sliderInteractionActive=!1},this._handleAfterHide=e=>{if(this._sliderInteractionActive)return this._drawerOpen=!0,void(this.open=!0);e.eventPhase===Event.AT_TARGET&&(this.open=!1,this._drawerOpen=!1,(0,l.r)(this,"closed"))},this._handleHide=e=>{if(e.eventPhase!==Event.AT_TARGET)return;const t=e.detail.source===e.target.drawer;if(this._sliderInteractionActive)return e.preventDefault(),this._drawerOpen=!0,this.open=!0,void(this._escapePressed=!1);this.preventScrimClose&&this._escapePressed&&t&&e.preventDefault(),this._escapePressed=!1},this._handleKeyDown=e=>{"Escape"===e.key&&(this._escapePressed=!0,this.preventScrimClose&&e.preventDefault(),e.stopPropagation(),e.currentTarget.open=!1)},this._handleCloseAction=e=>{e.composedPath().some(e=>e instanceof HTMLElement&&("close"===e.getAttribute("data-dialog")||"close"===e.getAttribute("data-drawer")))&&(this._drawerOpen=!1)},this._handleTouchStart=e=>{if(this.preventScrimClose)return;const t=e.composedPath();for(const a of t){if(a===this._drawer)break;if(a instanceof HTMLElement&&(a.scrollTop>0||b.has(a.localName)||Array.from(a.classList).some(e=>w.has(e))))return}e.stopPropagation(),this._startResizing(e.touches[0].clientY)},this._handleTouchMove=e=>{const t=e.touches[0].clientY,a=this._gestureRecognizer.move(t);a<0&&(e.preventDefault(),this._isDragging=!0,requestAnimationFrame(()=>{this._isDragging&&this.style.setProperty("--dialog-transform",`translateY(${-1*a}px)`)}))},this._handleTouchEnd=()=>{var e;this._unregisterResizeHandlers(),this._isDragging=!1;const t=this._gestureRecognizer.end();if(t.isSwipe)return void(t.isDownwardSwipe?this._drawerOpen=!1:this._animateSnapBack());const a=null===(e=this._drawer.shadowRoot)||void 0===e?void 0:e.querySelector('[part="body"]'),r=(null==a?void 0:a.offsetHeight)||0;r>0&&t.delta<0&&Math.abs(t.delta)>.5*r?this._drawerOpen=!1:this._animateSnapBack()},this._unregisterResizeHandlers=()=>{document.removeEventListener("touchmove",this._handleTouchMove),document.removeEventListener("touchend",this._handleTouchEnd),document.removeEventListener("touchcancel",this._handleTouchEnd)}}}(0,r.Cg)([(0,s.MZ)({attribute:"aria-labelledby"})],_.prototype,"ariaLabelledBy",void 0),(0,r.Cg)([(0,s.MZ)({attribute:"aria-describedby"})],_.prototype,"ariaDescribedBy",void 0),(0,r.Cg)([(0,s.MZ)({type:Boolean})],_.prototype,"open",void 0),(0,r.Cg)([(0,s.MZ)({type:Boolean,reflect:!0,attribute:"flexcontent"})],_.prototype,"flexContent",void 0),(0,r.Cg)([(0,s.MZ)({type:Boolean,reflect:!0,attribute:"prevent-scrim-close"})],_.prototype,"preventScrimClose",void 0),(0,r.Cg)([(0,s.wk)()],_.prototype,"_drawerOpen",void 0),(0,r.Cg)([(0,s.wk)()],_.prototype,"_sliderInteractionActive",void 0),(0,r.Cg)([(0,s.wk)(),(0,o.Fg)({context:c.WF,subscribe:!0})],_.prototype,"_hassConfig",void 0),(0,r.Cg)([(0,s.P)("#drawer")],_.prototype,"_drawer",void 0),(0,r.Cg)([(0,s.P)("#body")],_.prototype,"_bodyElement",void 0),(0,r.Cg)([(0,s.P)("[autofocus]")],_.prototype,"_autofocusElement",void 0),_=(0,r.Cg)([(0,s.EM)("ha-bottom-sheet")],_),t()}catch(g){t(g)}})},90248:function(e,t,a){a.a(e,async function(e,r){try{a.r(t),a.d(t,{HaIconButtonArrowPrev:function(){return m}});a(62953);var i=a(40445),o=a(5124),n=a(67576),s=a(63091),l=a(26300),d=e([l]);l=(d.then?(await d)():d)[0];let c,h=e=>e;const u="M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z",p="M4,11V13H16L10.5,18.5L11.92,19.92L19.84,12L11.92,4.08L10.5,5.5L16,11H4Z";class m extends o.WF{render(){var e;return(0,o.qy)(c||(c=h` <ha-icon-button .disabled="${0}" .label="${0}" .path="${0}" .href="${0}" .target="${0}" .rel="${0}" .download="${0}"></ha-icon-button> `),this.disabled,this.label||(null===(e=this.hass)||void 0===e?void 0:e.localize("ui.common.back"))||"Back",this._icon,this.href,this.target,this.rel,this.download)}constructor(...e){super(...e),this.disabled=!1,this._icon="rtl"===s.G.document.dir?p:u}}(0,i.Cg)([(0,n.MZ)({attribute:!1})],m.prototype,"hass",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean})],m.prototype,"disabled",void 0),(0,i.Cg)([(0,n.MZ)()],m.prototype,"label",void 0),(0,i.Cg)([(0,n.MZ)()],m.prototype,"href",void 0),(0,i.Cg)([(0,n.MZ)()],m.prototype,"target",void 0),(0,i.Cg)([(0,n.MZ)()],m.prototype,"rel",void 0),(0,i.Cg)([(0,n.MZ)()],m.prototype,"download",void 0),(0,i.Cg)([(0,n.wk)()],m.prototype,"_icon",void 0),m=(0,i.Cg)([(0,n.EM)("ha-icon-button-arrow-prev")],m),r()}catch(c){r(c)}})},606:function(e,t,a){a.a(e,async function(e,t){try{a(74423),a(18111),a(61701),a(62953);var r=a(40445),i=a(5124),o=a(67576),n=a(63672),s=a(22786),l=a(1087),d=a(29823),c=(a(70947),a(3449),a(88285)),h=(a(67094),e([d,c]));[d,c]=h.then?(await h)():h;let u,p,m,g,v,f,y,b,w,_=e=>e;class $ extends i.WF{render(){return this.disabled?(0,i.qy)(u||(u=_`${0}${0}`),this._renderField(),this._renderHelper()):(0,i.qy)(p||(p=_` <ha-dropdown placement="bottom" @wa-select="${0}" @wa-show="${0}" @wa-hide="${0}"> ${0} ${0} </ha-dropdown> ${0} `),this._handleSelect,this._handleShow,this._handleHide,this._renderField(),this.options?this.options.map(e=>{var t;const a=["string","number"].includes(typeof e);return(0,i.qy)(m||(m=_` <ha-dropdown-item .value="${0}" .disabled="${0}" .selected="${0}"> ${0} <div class="content"> ${0} ${0} </div> </ha-dropdown-item> `),a?e:e.value,!a&&(null!==(t=e.disabled)&&void 0!==t&&t),this.value===(a?e:e.value),e.iconPath?(0,i.qy)(g||(g=_`<ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon>`),e.iconPath):i.s6,a?e:e.label||e.value,e.secondary?(0,i.qy)(v||(v=_`<div class="secondary">${0}</div>`),e.secondary):i.s6)}):(0,i.qy)(f||(f=_`<slot></slot>`)),this._renderHelper())}_renderField(){const e=this._getValueLabel(this.options,this.value);return(0,i.qy)(y||(y=_` <ha-picker-field slot="trigger" type="button" class="${0}" compact="compact" aria-label="${0}" @clear="${0}" .label="${0}" .value="${0}" .required="${0}" .disabled="${0}" .hideClearIcon="${0}"> </ha-picker-field> `),this._opened?"opened":"",(0,n.J)(this.label),this._clearValue,this.label,e,this.required,this.disabled,!this.clearable||this.required||this.disabled||!String(this.value))}_renderHelper(){return this.helper?(0,i.qy)(b||(b=_`<ha-input-helper-text .disabled="${0}">${0}</ha-input-helper-text>`),this.disabled,this.helper):i.s6}_handleSelect(e){e.stopPropagation();const t=e.detail.item.value;t!==this.value&&(0,l.r)(this,"selected",{value:t})}_clearValue(){!this.disabled&&this.value&&(0,l.r)(this,"selected",{value:void 0})}_handleShow(){this.style.setProperty("--select-menu-width",`${this._triggerField.offsetWidth}px`),this._opened=!0}_handleHide(){this._opened=!1}constructor(...e){super(...e),this.clearable=!1,this.required=!1,this.disabled=!1,this._opened=!1,this._getValueLabel=(0,s.A)((e,t)=>{const a=void 0!==t?String(t):void 0;if(!e||!a)return a;for(const r of e){const e=["string","number"].includes(typeof r);if(e&&r===a||!e&&String(r.value)===a)return e?r:r.label||r.value}return a})}}$.styles=(0,i.AH)(w||(w=_`:host{position:relative}ha-picker-field.opened{--mdc-text-field-idle-line-color:var(--primary-color)}ha-dropdown-item .content{display:flex;gap:var(--ha-space-1);flex-direction:column}ha-dropdown-item .secondary{font-size:var(--ha-font-size-s);color:var(--ha-color-text-secondary)}ha-dropdown::part(menu){min-width:var(--select-menu-width)}ha-input-helper-text{display:block;margin:var(--ha-space-2) 0 0}`)),(0,r.Cg)([(0,o.MZ)({type:Boolean})],$.prototype,"clearable",void 0),(0,r.Cg)([(0,o.MZ)({attribute:!1})],$.prototype,"options",void 0),(0,r.Cg)([(0,o.MZ)()],$.prototype,"label",void 0),(0,r.Cg)([(0,o.MZ)()],$.prototype,"helper",void 0),(0,r.Cg)([(0,o.MZ)()],$.prototype,"value",void 0),(0,r.Cg)([(0,o.MZ)({type:Boolean})],$.prototype,"required",void 0),(0,r.Cg)([(0,o.MZ)({type:Boolean})],$.prototype,"disabled",void 0),(0,r.Cg)([(0,o.wk)()],$.prototype,"_opened",void 0),(0,r.Cg)([(0,o.P)("ha-picker-field")],$.prototype,"_triggerField",void 0),$=(0,r.Cg)([(0,o.EM)("ha-select")],$),t()}catch(u){t(u)}})},16869:function(e,t,a){a.d(t,{B:function(){return o},g:function(){return i}});var r;a(74423),a(27495);const i=window.externalAppV2||window.externalApp||(null===(r=window.webkit)||void 0===r||null===(r=r.messageHandlers)||void 0===r?void 0:r.getExternalAuth)||location.search.includes("external_auth=1"),o=window.externalApp||window.externalAppV2},35952:function(e,t,a){function r(e){return"strategy"in e}a.d(t,{Dz:function(){return i},Wu:function(){return r},ql:function(){return o}});const i=(e,t,a)=>e.sendMessagePromise({type:"lovelace/config",url_path:t,force:a}),o=(e,t,a)=>e.callWS({type:"lovelace/config/save",url_path:t,config:a})},71730:function(e,t,a){a.d(t,{A_:function(){return n},SJ:function(){return r},mQ:function(){return o},n6:function(){return i}});const r=e=>e.callWS({type:"lovelace/dashboards/list"}),i=(e,t)=>e.callWS(Object.assign({type:"lovelace/dashboards/create"},t)),o=(e,t,a)=>e.callWS(Object.assign({type:"lovelace/dashboards/update",dashboard_id:t},a)),n=(e,t)=>e.callWS({type:"lovelace/dashboards/delete",dashboard_id:t})}}]);