iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
31 lines • 144 kB
JavaScript
export const __rspack_esm_id=44642;export const __rspack_esm_ids=[44642];export const __webpack_modules__={69558(e,t,i){i.d(t,{_:()=>s});i(18111),i(7588);var a=i(5124),o=i(42017);const s=(0,o.u$)(class extends o.WL{update(e,[t,i]){return this._element&&this._element.localName===t?(i&&Object.entries(i).forEach(([e,t])=>{this._element[e]=t}),a.c0):this.render(t,i)}render(e,t){return this._element=document.createElement(e),t&&Object.entries(t).forEach(([e,t])=>{this._element[e]=t}),this._element}constructor(e){if(super(e),e.type!==o.OA.CHILD)throw new Error("dynamicElementDirective can only be used in content bindings")}})},65522(e,t,i){i.d(t,{A:()=>a});const a=e=>e.name?.trim()},55931(e,t,i){i.d(t,{X:()=>a});const a=e=>e.name?.trim()},69093(e,t,i){i.d(t,{t:()=>o});var a=i(71727);const o=e=>(0,a.m)(e.entity_id)},66033(e,t,i){i.d(t,{L:()=>a});const a=(e,t)=>{const i=e.floor_id;return{area:e,floor:(i?t[i]:void 0)||null}}},82286(e,t,i){i.d(t,{$:()=>a});const a=(e,t)=>o(e.attributes,t),o=(e,t)=>0!==(e.supported_features&t)},67258(e,t,i){i.d(t,{d:()=>a});const a=e=>{switch(e.language){case"cs":case"de":case"fi":case"fr":case"sk":case"sv":return" ";default:return""}}},60353(e,t,i){i.d(t,{u:()=>a});class a{start(e){const t=Date.now();this._startY=e,this._startTime=t,this._lastY=e,this._lastTime=t,this._delta=0}move(e){const t=Date.now();return this._delta=this._startY-e,this._lastY=e,this._lastTime=t,this._delta}end(){const e=this.getVelocity(),t=Math.abs(e)>this._velocityThreshold;return{velocity:e,delta:this._delta,isSwipe:t,isDownwardSwipe:e>0}}getDelta(){return this._delta}getVelocity(){if(Date.now()-this._lastTime>=this._movementTimeThreshold)return 0;const e=this._lastTime-this._startTime;return e>0?(this._lastY-this._startY)/e:0}reset(){this._startY=0,this._delta=0,this._startTime=0,this._lastY=0,this._lastTime=0}constructor(e={}){this._startY=0,this._delta=0,this._startTime=0,this._lastY=0,this._lastTime=0,this._velocityThreshold=e.velocitySwipeThreshold??.5,this._movementTimeThreshold=e.movementTimeThreshold??100}}},5745(e,t,i){var a=i(62826),o=i(99731),s=i(22441);class r extends o.Y{}r=(0,a.Cg)([(0,s.EM)("ha-chip-set")],r)},38962(e,t,i){i.a(e,async function(e,a){try{i.r(t);var o=i(62826),s=i(5124),r=i(22441),n=i(6412),l=i(93421),d=i(1087),c=i(26300),h=(i(67094),e([c]));c=(h.then?(await h)():h)[0];const p="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",m={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 u extends s.WF{render(){return s.qy` <div class="issue-type ${(0,n.H)({[this.alertType]:!0})}" role="alert"> <div class="icon ${this.title?"":"no-title"}"> <slot name="icon"> <ha-svg-icon .path="${m[this.alertType]}"></ha-svg-icon> </slot> </div> <div class="${(0,n.H)({content:!0,narrow:this.narrow})}"> <div class="main-content"> ${this.title?s.qy`<div class="title">${this.title}</div>`:s.s6} <slot></slot> </div> <div class="action"> <slot name="action"> ${this.dismissable?s.qy`<ha-icon-button @click="${this._dismissClicked}" .label="${this._localize?.("ui.common.dismiss_alert")}" .path="${p}"></ha-icon-button>`:s.s6} </slot> </div> </div> </div> `}_dismissClicked(){(0,d.r)(this,"alert-dismissed-clicked")}constructor(...e){super(...e),this.title="",this.alertType="info",this.dismissable=!1,this.narrow=!1}}u.styles=s.AH`.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,o.Cg)([(0,r.MZ)()],u.prototype,"title",void 0),(0,o.Cg)([(0,r.MZ)({attribute:"alert-type"})],u.prototype,"alertType",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean})],u.prototype,"dismissable",void 0),(0,o.Cg)([(0,r.wk)(),(0,l.IW)()],u.prototype,"_localize",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean})],u.prototype,"narrow",void 0),u=(0,o.Cg)([(0,r.EM)("ha-alert")],u),a()}catch(e){a(e)}})},66086(e,t,i){i.a(e,async function(e,t){try{i(74423),i(18111),i(22489),i(61701);var a=i(62826),o=i(5124),s=i(22441),r=i(22786),n=i(1087),l=i(65522),d=i(55931),c=i(66033),h=i(49852),p=i(2514),m=i(65063),u=i(34023),g=(i(75064),i(38508)),f=i(26300),_=(i(67094),e([g,f]));[g,f]=_.then?(await _)():_;const v="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z",b="M20 2H4C2.9 2 2 2.9 2 4V20C2 21.11 2.9 22 4 22H20C21.11 22 22 21.11 22 20V4C22 2.9 21.11 2 20 2M4 6L6 4H10.9L4 10.9V6M4 13.7L13.7 4H18.6L4 18.6V13.7M20 18L18 20H13.1L20 13.1V18M20 10.3L10.3 20H5.4L20 5.4V10.3Z",y="___ADD_NEW___";class w extends o.WF{willUpdate(e){this._pendingAreaId&&e.has("hass")&&this.hass.areas!==e.get("hass")?.areas&&this.hass.areas[this._pendingAreaId]&&(this._setValue(this._pendingAreaId),this._pendingAreaId=void 0)}async open(){await this.updateComplete,await(this._picker?.open())}render(){const e=this.label??this.hass.localize("ui.components.area-picker.area"),t=this._computeValueRenderer(this.hass.areas);let i=e;if(this.value&&e){const e=this.hass.areas[this.value];if(e){const{floor:t}=(0,c.L)(e,this.hass.floors);t&&(i=void 0)}}return o.qy` <ha-generic-picker .hass="${this.hass}" .autofocus="${this.autofocus}" .label="${i}" .helper="${this.helper}" .notFoundLabel="${this._notFoundLabel}" .emptyLabel="${this.hass.localize("ui.components.area-picker.no_areas")}" .disabled="${this.disabled}" .required="${this.required}" .value="${this.value}" .getItems="${this._getItems}" .getAdditionalItems="${this._getAdditionalItems}" .valueRenderer="${t}" .addButtonLabel="${this.addButtonLabel}" .searchKeys="${h.P}" .unknownItemText="${this.hass.localize("ui.components.area-picker.unknown")}" @value-changed="${this._valueChanged}"> </ha-generic-picker> `}_valueChanged(e){e.stopPropagation();const t=e.detail.value;if(t){if(t.startsWith(y)){this.hass.loadFragmentTranslation("config");const e=t.substring(y.length);return void(0,u.J)(this,{suggestedName:e,createEntry:async e=>{try{const t=await(0,p.L3)(this.hass,e);this.hass.areas[t.area_id]?this._setValue(t.area_id):this._pendingAreaId=t.area_id}catch(e){(0,m.showAlertDialog)(this,{title:this.hass.localize("ui.components.area-picker.failed_create_area"),text:e.message})}}})}this._setValue(t)}else this._setValue(void 0)}_setValue(e){this.value=e,(0,n.r)(this,"value-changed",{value:e}),(0,n.r)(this,"change")}constructor(...e){super(...e),this.noAdd=!1,this.disabled=!1,this.required=!1,this._getAreasMemoized=(0,r.A)(h.j),this._computeValueRenderer=(0,r.A)(e=>e=>{const t=this.hass.areas[e];if(!t)return o.qy` <ha-svg-icon slot="start" .path="${b}"></ha-svg-icon> <span slot="headline">${t}</span> `;const{floor:i}=(0,c.L)(t,this.hass.floors),a=t?(0,l.A)(t):void 0,s=i?(0,d.X)(i):void 0,r=t.icon;return o.qy` ${r?o.qy`<ha-icon slot="start" .icon="${r}"></ha-icon>`:o.qy`<ha-svg-icon slot="start" .path="${b}"></ha-svg-icon>`} <span slot="headline">${a}</span> ${s?o.qy`<span slot="supporting-text">${s}</span>`:o.s6} `}),this._getItems=()=>this._getAreasMemoized(this.hass.areas,this.hass.floors,this.hass.devices,this.hass.entities,this.hass.states,this.includeDomains,this.excludeDomains,this.includeDeviceClasses,this.deviceFilter,this.entityFilter,this.excludeAreas),this._allAreaNames=(0,r.A)(e=>Object.values(e).map(e=>(0,l.A)(e)?.toLowerCase()).filter(Boolean)),this._getAdditionalItems=e=>{if(this.noAdd)return[];const t=this._allAreaNames(this.hass.areas);return e&&!t.includes(e.toLowerCase())?[{id:y+e,primary:this.hass.localize("ui.components.area-picker.add_new_suggestion",{name:e}),icon_path:v}]:[{id:y,primary:this.hass.localize("ui.components.area-picker.add_new"),icon_path:v}]},this._notFoundLabel=e=>this.hass.localize("ui.components.area-picker.no_match",{term:o.qy`<b>‘${e}’</b>`})}}(0,a.Cg)([(0,s.MZ)({attribute:!1})],w.prototype,"hass",void 0),(0,a.Cg)([(0,s.MZ)()],w.prototype,"label",void 0),(0,a.Cg)([(0,s.MZ)()],w.prototype,"value",void 0),(0,a.Cg)([(0,s.MZ)()],w.prototype,"helper",void 0),(0,a.Cg)([(0,s.MZ)()],w.prototype,"placeholder",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean,attribute:"no-add"})],w.prototype,"noAdd",void 0),(0,a.Cg)([(0,s.MZ)({type:Array,attribute:"include-domains"})],w.prototype,"includeDomains",void 0),(0,a.Cg)([(0,s.MZ)({type:Array,attribute:"exclude-domains"})],w.prototype,"excludeDomains",void 0),(0,a.Cg)([(0,s.MZ)({type:Array,attribute:"include-device-classes"})],w.prototype,"includeDeviceClasses",void 0),(0,a.Cg)([(0,s.MZ)({type:Array,attribute:"exclude-areas"})],w.prototype,"excludeAreas",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],w.prototype,"deviceFilter",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],w.prototype,"entityFilter",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean})],w.prototype,"disabled",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean})],w.prototype,"required",void 0),(0,a.Cg)([(0,s.MZ)({attribute:"add-button-label"})],w.prototype,"addButtonLabel",void 0),(0,a.Cg)([(0,s.P)("ha-generic-picker")],w.prototype,"_picker",void 0),(0,a.Cg)([(0,s.wk)()],w.prototype,"_pendingAreaId",void 0),w=(0,a.Cg)([(0,s.EM)("ha-area-picker")],w),t()}catch(e){t(e)}})},99611(e,t,i){i.a(e,async function(e,t){try{i(18111),i(13579),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698);var a=i(62826),o=i(1126),s=i(35211),r=i(5124),n=i(22441),l=i(1087),d=i(60353),c=i(22792),h=i(59992),p=i(14503),m=i(22348),u=e([o]);o=(u.then?(await u)():u)[0];const g=300,f=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"]),_=new Set(["volume-slider-container","forecast"]);class v extends((0,h.V)(r.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 r.qy` <wa-drawer id="drawer" placement="bottom" .open="${this._drawerOpen}" .lightDismiss="${!this.preventScrimClose}" .ariaLabelledby="${this.ariaLabelledBy}" .ariaDescribedby="${this.ariaDescribedBy}" @keydown="${this._handleKeyDown}" @wa-show="${this._handleShow}" @wa-after-show="${this._handleAfterShow}" @wa-hide="${this._handleHide}" @wa-after-hide="${this._handleAfterHide}" @click="${this._handleCloseAction}" without-header @touchstart="${this._handleTouchStart}"> <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> ${this.renderScrollableFades()} </div> <slot name="footer"></slot> </wa-drawer> `}_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 ${g}ms ease-out`),this.style.removeProperty("--dialog-transform"),setTimeout(()=>{this.style.removeProperty("--dialog-transition")},g)}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,p.dp,r.AH`wa-drawer{--wa-color-surface-raised:transparent;--spacing:0;--size:var(--ha-bottom-sheet-height, auto);--show-duration:${g}ms;--hide-duration:${g}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}`]}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(()=>{const e=this._autofocusElement;this._hassConfig?.auth.external&&(0,m.V)(this._hassConfig.auth.external)?e&&(e.id||(e.id="ha-bottom-sheet-autofocus"),this._hassConfig.auth.external.fireMessage({type:"focus_element",payload:{element_id:e.id}})):e?.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 e of t){if(e===this._drawer)break;if(e instanceof HTMLElement&&(e.scrollTop>0||f.has(e.localName)||Array.from(e.classList).some(e=>_.has(e))))return}e.stopPropagation(),this._startResizing(e.touches[0].clientY)},this._handleTouchMove=e=>{const t=e.touches[0].clientY,i=this._gestureRecognizer.move(t);i<0&&(e.preventDefault(),this._isDragging=!0,requestAnimationFrame(()=>{this._isDragging&&this.style.setProperty("--dialog-transform",`translateY(${-1*i}px)`)}))},this._handleTouchEnd=()=>{this._unregisterResizeHandlers(),this._isDragging=!1;const e=this._gestureRecognizer.end();if(e.isSwipe)return void(e.isDownwardSwipe?this._drawerOpen=!1:this._animateSnapBack());const t=this._drawer.shadowRoot?.querySelector('[part="body"]'),i=t?.offsetHeight||0;i>0&&e.delta<0&&Math.abs(e.delta)>.5*i?this._drawerOpen=!1:this._animateSnapBack()},this._unregisterResizeHandlers=()=>{document.removeEventListener("touchmove",this._handleTouchMove),document.removeEventListener("touchend",this._handleTouchEnd),document.removeEventListener("touchcancel",this._handleTouchEnd)}}}(0,a.Cg)([(0,n.MZ)({attribute:"aria-labelledby"})],v.prototype,"ariaLabelledBy",void 0),(0,a.Cg)([(0,n.MZ)({attribute:"aria-describedby"})],v.prototype,"ariaDescribedBy",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean})],v.prototype,"open",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean,reflect:!0,attribute:"flexcontent"})],v.prototype,"flexContent",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean,reflect:!0,attribute:"prevent-scrim-close"})],v.prototype,"preventScrimClose",void 0),(0,a.Cg)([(0,n.wk)()],v.prototype,"_drawerOpen",void 0),(0,a.Cg)([(0,n.wk)()],v.prototype,"_sliderInteractionActive",void 0),(0,a.Cg)([(0,n.wk)(),(0,s.Fg)({context:c.WF,subscribe:!0})],v.prototype,"_hassConfig",void 0),(0,a.Cg)([(0,n.P)("#drawer")],v.prototype,"_drawer",void 0),(0,a.Cg)([(0,n.P)("#body")],v.prototype,"_bodyElement",void 0),(0,a.Cg)([(0,n.P)("[autofocus]")],v.prototype,"_autofocusElement",void 0),v=(0,a.Cg)([(0,n.EM)("ha-bottom-sheet")],v),t()}catch(e){t(e)}})},93444(e,t,i){var a=i(62826),o=i(5124),s=i(22441);class r extends o.WF{render(){return o.qy` <footer> <slot name="secondaryAction"></slot> <slot name="primaryAction"></slot> </footer> `}static get styles(){return[o.AH`footer{display:flex;gap:var(--ha-space-3);justify-content:flex-end;align-items:center;width:100%}`]}}r=(0,a.Cg)([(0,s.EM)("ha-dialog-footer")],r)},76538(e,t,i){var a=i(62826),o=i(5124),s=i(22441);class r extends o.WF{render(){const e=o.qy`<div class="header-title"> <slot name="title"></slot> </div>`,t=o.qy`<div class="header-subtitle"> <slot name="subtitle"></slot> </div>`;return o.qy` <header class="header"> <div class="header-bar"> <section class="header-navigation-icon"> <slot name="navigationIcon"></slot> </section> <section class="header-content"> ${"above"===this.subtitlePosition?o.qy`${t}${e}`:o.qy`${e}${t}`} </section> <section class="header-action-items"> <slot name="actionItems"></slot> </section> </div> <slot></slot> </header> `}static get styles(){return[o.AH`: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(...e){super(...e),this.subtitlePosition="below",this.showBorder=!1}}(0,a.Cg)([(0,s.MZ)({type:String,attribute:"subtitle-position"})],r.prototype,"subtitlePosition",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean,reflect:!0,attribute:"show-border"})],r.prototype,"showBorder",void 0),r=(0,a.Cg)([(0,s.EM)("ha-dialog-header")],r)},72554(e,t,i){i.a(e,async function(e,t){try{var a=i(62826),o=i(93900),s=i(35211),r=i(5124),n=i(22441),l=i(63672),d=i(1087),c=i(64481),h=i(22792),p=i(59992),m=i(14503),u=i(22348),g=(i(76538),i(26300)),f=e([o,g]);[o,g]=f.then?(await f)():f;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 v extends((0,p.V)(r.WF)){connectedCallback(){super.connectedCallback(),this.addEventListener("dialog-set-fullscreen",this._handleFullscreenChanged)}get scrollableElement(){return this.bodyContainer}updated(e){super.updated(e),e.has("open")&&(this._open=this.open)}render(){return r.qy` <wa-dialog .open="${this._open}" .lightDismiss="${!this.preventScrimClose}" without-header aria-labelledby="${(0,l.J)(this.ariaLabelledBy||(void 0!==this.headerTitle?"ha-dialog-title":void 0))}" aria-describedby="${(0,l.J)(this.ariaDescribedBy)}" @keydown="${this._handleKeyDown}" @wa-hide="${this._handleHide}" @wa-show="${this._handleShow}" @wa-after-show="${this._handleAfterShow}" @wa-after-hide="${this._handleAfterHide}"> ${this.withoutHeader?r.s6:r.qy`<slot name="header"> <ha-dialog-header .subtitlePosition="${this.headerSubtitlePosition}" .showBorder="${this._bodyScrolled}"> <slot name="headerNavigationIcon" slot="navigationIcon"> <ha-icon-button data-dialog="close" .label="${this._i18n?.localize?.("ui.common.close")??"Close"}" .path="${_}"></ha-icon-button> </slot> ${void 0!==this.headerTitle?r.qy`<span slot="title" class="title" id="ha-dialog-title"> ${this.headerTitle} </span>`:r.qy`<slot name="headerTitle" slot="title"></slot>`} ${void 0!==this.headerSubtitle?r.qy`<span slot="subtitle">${this.headerSubtitle}</span>`:r.qy`<slot name="headerSubtitle" slot="subtitle"></slot>`} <slot name="headerActionItems" slot="actionItems"></slot> </ha-dialog-header> </slot>`} <div class="content-wrapper"> <div class="body ha-scrollbar" @scroll="${this._handleBodyScroll}"> <slot></slot> </div> ${this.renderScrollableFades()} </div> <slot name="footer" slot="footer"></slot> </wa-dialog> `}disconnectedCallback(){this.removeEventListener("dialog-set-fullscreen",this._handleFullscreenChanged),this._setFullscreen(!1),super.disconnectedCallback(),this._open=!1}_handleFullscreenChanged(e){this._open?(0,c.J)(()=>{this._setFullscreen(e.detail)}):this._setFullscreen(e.detail)}_setFullscreen(e){this.toggleAttribute("fullscreen",e)}_handleBodyScroll(e){this._bodyScrolled=e.target.scrollTop>0}_handleKeyDown(e){"Escape"===e.key&&(this._escapePressed=!0,this.preventScrimClose&&e.preventDefault(),e.stopPropagation(),e.currentTarget.open=!1)}_handleHide(e){const t=e.detail?.source===e.target.dialog;this.preventScrimClose&&this._escapePressed&&t&&e.preventDefault(),this._escapePressed=!1}static get styles(){return[...super.styles,m.dp,r.AH`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(...e){super(...e),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 e=>{e.eventPhase===Event.AT_TARGET&&(this._open=!0,(0,d.r)(this,"opened"),await this.updateComplete,requestAnimationFrame(()=>{if(this._hassConfig?.auth.external&&(0,u.V)(this._hassConfig.auth.external)){const e=this.querySelector("[autofocus]");return void(null!==e&&(e.id||(e.id="ha-dialog-autofocus"),this._hassConfig.auth.external.fireMessage({type:"focus_element",payload:{element_id:e.id}})))}this.querySelector("[autofocus]")?.focus()}))},this._handleAfterShow=e=>{e.eventPhase===Event.AT_TARGET&&(0,d.r)(this,"after-show")},this._handleAfterHide=e=>{e.eventPhase===Event.AT_TARGET&&(this._open=!1,this._setFullscreen(!1),(0,d.r)(this,"closed"))}}}(0,a.Cg)([(0,n.MZ)({attribute:"aria-labelledby"})],v.prototype,"ariaLabelledBy",void 0),(0,a.Cg)([(0,n.MZ)({attribute:"aria-describedby"})],v.prototype,"ariaDescribedBy",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],v.prototype,"open",void 0),(0,a.Cg)([(0,n.MZ)({reflect:!0})],v.prototype,"type",void 0),(0,a.Cg)([(0,n.MZ)({type:String,reflect:!0,attribute:"width"})],v.prototype,"width",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean,reflect:!0,attribute:"prevent-scrim-close"})],v.prototype,"preventScrimClose",void 0),(0,a.Cg)([(0,n.MZ)({attribute:"header-title"})],v.prototype,"headerTitle",void 0),(0,a.Cg)([(0,n.MZ)({attribute:"header-subtitle"})],v.prototype,"headerSubtitle",void 0),(0,a.Cg)([(0,n.MZ)({type:String,attribute:"header-subtitle-position"})],v.prototype,"headerSubtitlePosition",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean,reflect:!0,attribute:"flexcontent"})],v.prototype,"flexContent",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean,attribute:"without-header"})],v.prototype,"withoutHeader",void 0),(0,a.Cg)([(0,n.wk)()],v.prototype,"_open",void 0),(0,a.Cg)([(0,n.P)(".body")],v.prototype,"bodyContainer",void 0),(0,a.Cg)([(0,n.wk)(),(0,s.Fg)({context:h.D5,subscribe:!0})],v.prototype,"_i18n",void 0),(0,a.Cg)([(0,n.wk)(),(0,s.Fg)({context:h.WF,subscribe:!0})],v.prototype,"_hassConfig",void 0),(0,a.Cg)([(0,n.wk)()],v.prototype,"_bodyScrolled",void 0),(0,a.Cg)([(0,n.Ls)({passive:!0})],v.prototype,"_handleBodyScroll",null),v=(0,a.Cg)([(0,n.EM)("ha-dialog")],v),t()}catch(e){t(e)}})},50043(e,t,i){i.d(t,{$:()=>o});i(18111),i(7588);const a=(e,t)=>{if("selector"in e&&"choose"in e.selector){const i=Object.keys(e.selector.choose.choices)[0];if(i)return{active_choice:i,[i]:t}}return t},o=e=>{const t={};return e.forEach(e=>{if(void 0!==e.description?.suggested_value&&null!==e.description?.suggested_value)t[e.name]=a(e,e.description.suggested_value);else if("default"in e)t[e.name]=a(e,e.default);else if("expandable"===e.type){const i=o(e.schema);(e.required||Object.keys(i).length)&&(t[e.name]=i)}else if(e.required){if("boolean"===e.type)t[e.name]=!1;else if("string"===e.type)t[e.name]="";else if("integer"===e.type)t[e.name]="valueMin"in e?e.valueMin:0;else if("constant"===e.type)t[e.name]=e.value;else if("float"===e.type)t[e.name]=0;else if("select"===e.type){if(e.options.length){const i=e.options[0];t[e.name]=Array.isArray(i)?i[0]:i}}else if("positive_time_period_dict"===e.type)t[e.name]={hours:0,minutes:0,seconds:0};else if("selector"in e){const i=e.selector;if("device"in i)t[e.name]=i.device?.multiple?[]:"";else if("entity"in i)t[e.name]=i.entity?.multiple?[]:"";else if("area"in i)t[e.name]=i.area?.multiple?[]:"";else if("label"in i)t[e.name]=i.label?.multiple?[]:"";else if("boolean"in i)t[e.name]=!1;else if("addon"in i||"attribute"in i||"file"in i||"icon"in i||"serial_port"in i||"template"in i||"text"in i||"theme"in i||"object"in i)t[e.name]="";else if("number"in i)t[e.name]=i.number?.min??0;else if("select"in i){if(i.select?.options.length){const a=i.select.options[0],o="string"==typeof a?a:a.value;t[e.name]=i.select.multiple?[o]:o}}else if("country"in i)i.country?.countries?.length&&(t[e.name]=i.country.countries[0]);else if("language"in i)i.language?.languages?.length&&(t[e.name]=i.language.languages[0]);else if("duration"in i)t[e.name]={hours:0,minutes:0,seconds:0};else if("time"in i)t[e.name]="00:00:00";else if("date"in i||"datetime"in i){const i=(new Date).toISOString().slice(0,10);t[e.name]=`${i}T00:00:00`}else if("color_rgb"in i)t[e.name]=[0,0,0];else if("color_temp"in i)t[e.name]=i.color_temp?.min_mireds??153;else if("action"in i||"trigger"in i||"condition"in i)t[e.name]=[];else if("media"in i||"target"in i)t[e.name]={};else if("state"in i)t[e.name]=i.state?.multiple?[]:"";else if("choose"in i){const a=Object.keys(i.choose.choices)[0];t[e.name]=a?{active_choice:a,[a]:o([{name:a,selector:i.choose.choices[a].selector}])[a]}:{}}else{if(!("numeric_threshold"in i))throw new Error(`Selector ${Object.keys(i)[0]} not supported in initial form data`);{const a="changed"===(i.numeric_threshold?.mode??"crossed")?"any":"above";t[e.name]="any"===a?{type:a}:{type:a,value:{number:i.numeric_threshold?.number?.min??0,active_choice:"number"}}}}}}else;}),t}},52763(e,t,i){i.a(e,async function(e,a){try{i.d(t,{U:()=>g});i(74423),i(18111),i(7588),i(61701);var o=i(62826),s=i(5124),r=i(22441),n=i(69558),l=i(1087),d=i(38962),c=(i(11399),e([d]));d=(c.then?(await c)():c)[0];const h={boolean:()=>i.e(81347).then(i.bind(i,46990)),constant:()=>i.e(65733).then(i.bind(i,90820)),float:()=>Promise.all([i.e(4801),i.e(39763),i.e(32450),i.e(51868),i.e(27585)]).then(i.bind(i,20676)),grid:()=>i.e(60761).then(i.bind(i,70208)),expandable:()=>i.e(45001).then(i.bind(i,40003)),integer:()=>Promise.all([i.e(4801),i.e(39763),i.e(32450),i.e(21543),i.e(86712),i.e(49985)]).then(i.bind(i,20036)),multi_select:()=>Promise.all([i.e(4801),i.e(39763),i.e(46095),i.e(34995),i.e(80131),i.e(58303),i.e(71739),i.e(24407)]).then(i.bind(i,36182)),positive_time_period_dict:()=>Promise.all([i.e(4801),i.e(39763),i.e(32450),i.e(46095),i.e(34995),i.e(67943),i.e(16508),i.e(85462)]).then(i.bind(i,89422)),select:()=>Promise.all([i.e(4801),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(34995),i.e(3283),i.e(81034),i.e(99463),i.e(26092),i.e(4809)]).then(i.bind(i,63804)),string:()=>Promise.all([i.e(4801),i.e(39763),i.e(32450),i.e(84725),i.e(95926)]).then(i.bind(i,54753)),optional_actions:()=>Promise.all([i.e(4801),i.e(39763),i.e(34995),i.e(85351)]).then(i.bind(i,8456))},p=(e,t)=>e?!t.name||t.flatten?e:e[t.name]:void 0,m=(e,t)=>e&&t.name?e[t.name]:null,u=(e,t)=>e&&t.name?e[t.name]:null;class g extends s.WF{getFormProperties(){return{}}reportValidity(){const e=this._root;if(!e)return!0;const t=[...e.children].filter(e=>"ha-alert"!==e.localName);let i,a=!0;return this.schema.forEach((e,o)=>{const s=t[o];if(!s)return;let r=!0;if("reportValidity"in s&&"function"==typeof s.reportValidity)r=s.reportValidity();else if(e.required&&(!("type"in e)||!["boolean","constant"].includes(e.type??""))&&(!("selector"in e)||!("boolean"in e.selector)&&!("constant"in e.selector))){const t=p(this.data,e);r=null!=t&&""!==t}r||(a=!1,i||(i=s))}),i&&i.focus?.(),a}willUpdate(e){e.has("schema")&&this.schema&&this.schema.forEach(e=>{"selector"in e||h[e.type]?.()})}render(){return s.qy` <div class="root" part="root"> ${this.error&&this.error.base?s.qy` <ha-alert alert-type="error"> ${this._computeError(this.error.base,this.schema)} </ha-alert> `:""} ${this.schema.map(e=>{const t=m(this.error,e),i=u(this.warning,e);return s.qy` ${t?s.qy` <ha-alert own-margin alert-type="error"> ${this._computeError(t,e)} </ha-alert> `:i?s.qy` <ha-alert own-margin alert-type="warning"> ${this._computeWarning(i,e)} </ha-alert> `:""} ${"selector"in e?s.qy`<ha-selector .schema="${e}" .hass="${this.hass}" .narrow="${this.narrow}" .name="${e.name}" .selector="${e.selector}" .value="${p(this.data,e)}" .label="${this._computeLabel(e,this.data)}" .disabled="${e.disabled||this.disabled||!1}" .placeholder="${e.required?void 0:e.default}" .helper="${this._computeHelper(e)}" .localizeValue="${this.localizeValue}" .required="${e.required||!1}" .context="${this._generateContext(e)}"></ha-selector>`:(0,n._)(this.fieldElementName(e.type),{schema:e,data:p(this.data,e),label:this._computeLabel(e,this.data),helper:this._computeHelper(e),disabled:this.disabled||e.disabled||!1,hass:this.hass,localize:this.hass?.localize,computeLabel:this.computeLabel,computeHelper:this.computeHelper,localizeValue:this.localizeValue,context:this._generateContext(e),...this.getFormProperties()})} `})} </div> `}fieldElementName(e){return`ha-form-${e}`}_generateContext(e){if(!e.context&&!this.context)return;const t={...this.context};if(e.context)for(const[i,a]of Object.entries(e.context))t[i]=this.data[a];return t}createRenderRoot(){const e=super.createRenderRoot();return this.addValueChangedListener(e),e}addValueChangedListener(e){e.addEventListener("value-changed",e=>{e.stopPropagation();const t=e.target.schema;if(e.target===this)return;const i=!t.name||"flatten"in t&&t.flatten?e.detail.value:{[t.name]:e.detail.value};this.data={...this.data,...i},(0,l.r)(this,"value-changed",{value:this.data})})}_computeLabel(e,t){return this.computeLabel?this.computeLabel(e,t):e?e.name:""}_computeHelper(e){return this.computeHelper?this.computeHelper(e):""}_computeError(e,t){return Array.isArray(e)?s.qy`<ul> ${e.map(e=>s.qy`<li> ${this.computeError?this.computeError(e,t):e} </li>`)} </ul>`:this.computeError?this.computeError(e,t):e}_computeWarning(e,t){return this.computeWarning?this.computeWarning(e,t):e}constructor(...e){super(...e),this.narrow=!1,this.disabled=!1}}g.shadowRootOptions={mode:"open",delegatesFocus:!0},g.styles=s.AH`.root>*{display:block}.root>:not([own-margin]):not(:last-child){margin-bottom:24px}ha-alert[own-margin]{margin-bottom:4px}`,(0,o.Cg)([(0,r.MZ)({attribute:!1})],g.prototype,"hass",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean})],g.prototype,"narrow",void 0),(0,o.Cg)([(0,r.MZ)({attribute:!1})],g.prototype,"data",void 0),(0,o.Cg)([(0,r.MZ)({attribute:!1})],g.prototype,"schema",void 0),(0,o.Cg)([(0,r.MZ)({attribute:!1})],g.prototype,"error",void 0),(0,o.Cg)([(0,r.MZ)({attribute:!1})],g.prototype,"warning",void 0),(0,o.Cg)([(0,r.MZ)({type:Boolean})],g.prototype,"disabled",void 0),(0,o.Cg)([(0,r.MZ)({attribute:!1})],g.prototype,"computeError",void 0),(0,o.Cg)([(0,r.MZ)({attribute:!1})],g.prototype,"computeWarning",void 0),(0,o.Cg)([(0,r.MZ)({attribute:!1})],g.prototype,"computeLabel",void 0),(0,o.Cg)([(0,r.MZ)({attribute:!1})],g.prototype,"computeHelper",void 0),(0,o.Cg)([(0,r.MZ)({attribute:!1})],g.prototype,"localizeValue",void 0),(0,o.Cg)([(0,r.MZ)({attribute:!1})],g.prototype,"context",void 0),(0,o.Cg)([(0,r.P)(".root")],g.prototype,"_root",void 0),g=(0,o.Cg)([(0,r.EM)("ha-form")],g),a()}catch(e){a(e)}})},38508(e,t,i){i.a(e,async function(e,t){try{i(18111),i(13579);var a=i(62826),o=i(61366),s=i(35211),r=i(5124),n=i(22441),l=i(63672),d=i(91335),c=i(1087),h=i(22792),p=i(17894),m=i(22348),u=i(99611),g=i(18350),f=(i(75064),i(3449),i(49639)),_=i(88285),v=(i(67094),e([o,u,g,f,_]));[o,u,g,f,_]=v.then?(await v)():v;const b="M3 16H10V14H3M18 14V10H16V14H12V16H16V20H18V16H22V14M14 6H3V8H14M14 10H3V12H14V10Z";class y extends((0,p.c)(r.WF)){willUpdate(e){e.has("value")&&this._setUnknownValue()}setFieldValue(e){this._comboBox?this._comboBox.setFieldValue(e):this._initialFieldValue=e}render(){const e=this.useTopLabel&&this.value?void 0:this.label;return r.qy`<div class="container"> ${this.useTopLabel&&this.label?r.qy`<label ?disabled="${this.disabled}">${this.label}</label>`:r.s6} <div id="picker"> <slot name="field"> ${this.addButtonLabel&&!this.value?r.qy`<ha-button size="small" appearance="filled" @click="${this.open}" .disabled="${this.disabled}"> <ha-svg-icon .path="${b}" slot="start"></ha-svg-icon> ${this.addButtonLabel} </ha-button>`:r.qy`<ha-picker-field type="button" class="${this._opened?"opened":""}" compact="compact" .unknown="${this._unknownValue}" .unknownItemText="${this.unknownItemText}" aria-label="${(0,l.J)(this.label)}" @click="${this.open}" @clear="${this._clear}" .icon="${this.icon}" .image="${this.image}" .label="${e}" .placeholder="${this.placeholder}" .value="${this.value}" .valueRenderer="${this.valueRenderer}" .required="${this.required}" .disabled="${this.disabled}" .invalid="${this.invalid}" .hideClearIcon="${this.hideClearIcon}"> <slot name="start"></slot> </ha-picker-field>`} </slot> </div> ${this._pickerWrapperOpen||this._opened?this._openedNarrow?r.qy` <ha-bottom-sheet flexcontent .open="${this._pickerWrapperOpen}" @wa-after-show="${this._dialogOpened}" @closed="${this._hidePicker}" role="dialog" aria-modal="true" aria-label="${this.label||"Select option"}"> ${this._renderComboBox(!0)} </ha-bottom-sheet> `:r.qy` <wa-popover .open="${this._pickerWrapperOpen}" style="--body-width:${this._popoverWidth}px" without-arrow distance="-4" .placement="${this.popoverPlacement}" .for="${this.popoverAnchor?null:"picker"}" .anchor="${this.popoverAnchor??null}" auto-size="vertical" auto-size-padding="16" @wa-after-show="${this._dialogOpened}" @wa-after-hide="${this._hidePicker}" trap-focus role="dialog" aria-modal="true" aria-label="${this.label||"Select option"}"> ${this._renderComboBox()} </wa-popover> `:r.s6} </div> ${this._renderHelper()}`}_renderComboBox(e=!1){return this._opened?r.qy` <ha-picker-combo-box id="combo-box" .allowCustomValue="${this.allowCustomValue}" .label="${this.searchLabel}" .value="${this._selectedValue??this.value}" @value-changed="${this._valueChanged}" .rowRenderer="${this.rowRenderer}" .notFoundLabel="${this.notFoundLabel}" .emptyLabel="${this.emptyLabel}" .getItems="${this.getItems}" .getAdditionalItems="${this.getAdditionalItems}" .searchFn="${this.searchFn}" .mode="${e?"dialog":"popover"}" .sections="${this.sections}" .sectionTitleFunction="${this.sectionTitleFunction}" .selectedSection="${this.selectedSection}" .searchKeys="${this.searchKeys}" .customValueLabel="${this.customValueLabel}" .noSort="${this.noSort}"></ha-picker-combo-box> `:r.s6}_renderHelper(){const e=this.invalid&&this.errorMessage,t=!e&&this.helper;return e||t?r.qy`<ha-input-helper-text .disabled="${this.disabled}"> ${e?this.errorMessage:this.helper} </ha-input-helper-text>`:r.s6}refreshItems(){this._comboBox?.refreshItems()}_hidePicker(e){e.stopPropagation(),this._newValue&&((0,c.r)(this,"value-changed",{value:this._newValue}),this._newValue=void 0),this._opened=!1,this._pickerWrapperOpen=!1,this._selectedValue=void 0,this._unsubscribeTinyKeys?.(),(0,c.r)(this,"picker-closed")}_valueChanged(e){e.stopPropagation();const t=e.detail.value;t&&(this._pickerWrapperOpen=!1,this._newValue=t)}_clear(e){e.stopPropagation(),this._setValue(void 0)}_setValue(e){this.value=e,(0,c.r)(this,"value-changed",{value:e})}async open(e,t){e?.stopPropagation(),this.disabled||(this._selectedValue=t?.selectedValue,this._openedNarrow=this._narrow,this._popoverWidth=this._containerElement?.offsetWidth||250,this._pickerWrapperOpen=!0,this._unsubscribeTinyKeys=(0,d.Tc)(this,{Escape:this._handleEscClose}))}connectedCallback(){super.connectedCallback(),this._handleResize(),window.addEventListener("resize",this._handleResize)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("resize",this._handleResize),this._unsubscribeTinyKeys?.()}static get styles(){return[r.AH`.container{position:relative;display:block;max-width:100%}label[disabled]{color:var(--mdc-text-field-disabled-ink-color,rgba(0,0,0,.6))}label{display:block;margin:0 0 8px}ha-input-helper-text{display:block;margin:var(--ha-space-2) 0 0}:host([invalid]) ha-input-helper-text{color:var(--mdc-theme-error,var(--error-color,#b00020))}wa-popover{--wa-space-l:0}wa-popover::part(dialog)::backdrop{background:0 0}wa-popover::part(body){width:var(--ha-generic-picker-width,max(var(--body-width),250px));max-width:var(--ha-generic-picker-max-width,var(--ha-generic-picker-width,max(var(--body-width),250px)));max-height:500px;height:70vh;overflow:hidden}@media (max-height:1000px){wa-popover::part(body){max-height:400px}}ha-bottom-sheet{--ha-bottom-sheet-height:90vh;--ha-bottom-sheet-height:calc(100dvh - var(--ha-space-12));--ha-bottom-sheet-max-height:var(--ha-bottom-sheet-height);--ha-bottom-sheet-max-width:600px;--ha-bottom-sheet-padding:0;--ha-bottom-sheet-surface-background:var(--card-background-color);--ha-bottom-sheet-border-radius:var(--ha-border-radius-2xl);--ha-bottom-sheet-content-padding:0 var(--safe-area-inset-right) var(--safe-area-inset-bottom) var(--safe-area-inset-left)}ha-picker-field.opened{--mdc-text-field-idle-line-color:var(--primary-color)}`]}constructor(...e){super(...e),this.popoverPlacement="bottom",this.useTopLabel=!1,this.noSort=!1,this._opened=!1,this._pickerWrapperOpen=!1,this._popoverWidth=0,this._openedNarrow=!1,this._unknownValue=!1,this._narrow=!1,this.invalid=!1,this._setUnknownValue=()=>{const e=this.getItems();!this.allowCustomValue&&void 0!==this.value&&null!==this.value&&""!==this.value&&e?this._unknownValue=!e.some(e=>"string"!=typeof e&&e.id===this.value):this._unknownValue=!1},this._dialogOpened=()=>{this._opened=!0,(0,c.r)(this,"picker-opened"),requestAnimationFrame(()=>{this._initialFieldValue&&(this._comboBox?.setFieldValue(this._initialFieldValue),this._initialFieldValue=void 0),this._hassConfig?.auth.external&&(0,m.V)(this._hassConfig.auth.external)?this._hassConfig.auth.external.fireMessage({type:"focus_element",payload:{element_id:"combo-box"}}):this._comboBox?.focus()})},this._handleResize=()=>{this._narrow=window.matchMedia("(max-width: 870px)").matches||window.matchMedia("(max-height: 500px)").matches,!this._openedNarrow&&this._pickerWrapperOpen&&(this._popoverWidth=this._containerElement?.offsetWidth||250)},this._handleEscClose=e=>{e.stopPropagation()}}}y.shadowRootOptions={...r.WF.shadowRootOptions,delegatesFocus:!0},(0,a.Cg)([(0,n.MZ)({type:Boolean,attribute:"allow-custom-value"})],y.prototype,"allowCustomValue",void 0),(0,a.Cg)([(0,n.MZ)({type:String,attribute:"search-label"})],y.prototype,"searchLabel",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],y.prototype,"getItems",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],y.prototype,"getAdditionalItems",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],y.prototype,"rowRenderer",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],y.prototype,"searchFn",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],y.prototype,"searchKeys",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],y.prototype,"notFoundLabel",void 0),(0,a.Cg)([(0,n.MZ)({attribute:"empty-label"})],y.prototype,"emptyLabel",void 0),(0,a.Cg)([(0,n.MZ)({attribute:"popover-placement"})],y.prototype,"popoverPlacement",void 0),(0,a.Cg)([(0,n.MZ)({attribute:"add-button-label"})],y.prototype,"addButtonLabel",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],y.prototype,"sections",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],y.prototype,"sectionTitleFunction",void 0),(0,a.Cg)([(0,n.MZ)({attribute:"selected-section"})],y.prototype,"selectedSection",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],y.prototype,"popoverAnchor",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean,attribute:"use-top-label"})],y.prototype,"useTopLabel",void 0),(0,a.Cg)([(0,n.MZ)({attribute:"custom-value-label"})],y.prototype,"customValueLabel",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean,attribute:"no-sort"})],y.prototype,"noSort",void 0),(0,a.Cg)([(0,n.P)(".container")],y.prototype,"_containerElement",void 0),(0,a.Cg)([(0,n.P)("ha-picker-combo-box")],y.prototype,"_comboBox",void 0),(0,a.Cg)([(0,n.wk)(),(0,s.Fg)({context:h.WF,subscribe:!0})],y.prototype,"_hassConfig",void 0),(0,a.Cg)([(0,n.wk)()],y.prototype,"_opened",void 0),(0,a.Cg)([(0,n.wk)()],y.prototype,"_pickerWrapperOpen",void 0),(0,a.Cg)([(0,n.wk)()],y.prototype,"_popoverWidth",void 0),(0,a.Cg)([(0,n.wk)()],y.prototype,"_openedNarrow",void 0),(0,a.Cg)([(0,n.wk)()],y.prototype,"_unknownValue",void 0),(0,a.Cg)([(0,n.wk)()],y.prototype,"_selectedValue",void 0),(0,a.Cg)([(0,n.MZ)({attribute:"error-message"})],y.prototype,"errorMessage",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],y.prototype,"invalid",void 0),y=(0,a.Cg)([(0,n.EM)("ha-generic-picker")],y),t()}catch(e){t(e)}})},43661(e,t,i){i.r(t),i.d(t,{HaIconNext:()=>n});var a=i(62826),o=i(22441),s=i(63091),r=i(67094);class n extends r.HaSvgIcon{constructor(...e){super(...e),this.path="rtl"===s.G.document.dir?"M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z":"M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z"}}(0,a.Cg)([(0,o.MZ)()],n.prototype,"path",void 0),n=(0,a.Cg)([(0,o.EM)("ha-icon-next")],n)},47680(e,t,i){i.r(t),i.d(t,{HaIcon:()=>$});i(74423);var a=i(62826),o=i(5124),s=i(22441),r=i(1087),n=i(9899),l=i(700),d=(i(44114),i(18111),i(7588),i(95192)),c=i(7553);const h=JSON.parse('{"version":"7.4.47","parts":[{"file":"7a7139d465f1f41cb26ab851a17caa21a9331234"},{"start":"account-supervisor-circle-","file":"9561286c4c1021d46b9006596812178190a7cc1c"},{"start":"alpha-r-c","file":"eb466b7087fb2b4d23376ea9bc86693c45c500fa"},{"start":"arrow-decision-o","file":"4b3c01b7e0723b702940c5ac46fb9e555646972b"},{"start":"baby-f","file":"2611401d85450b95ab448ad1d02c1a432b409ed2"},{"start":"battery-hi","file":"89bcd31855b34cd9d31ac693fb073277e74f1f6a"},{"start":"blur-r","file":"373709cd5d7e688c2addc9a6c5d26c2d57c02c48"},{"start":"briefcase-account-","file":"a75956cf812ee90ee4f656274426aafac81e1053"},{"start":"calendar-question-","file":"3253f2529b5ebdd110b411917bacfacb5b7063e6"},{"start":"car-lig","file":"74566af3501ad6ae58ad13a8b6921b3cc2ef879d"},{"start":"cellphone-co","file":"7677f1cfb2dd4f5562a2aa6d3ae43a2e6997b21a"},{"start":"circle-slice-2","file":"70d08c50ec4522dd75d11338db57846588263ee2"},{"start":"cloud-co","file":"141d2bfa55ca4c83f4bae2812a5da59a84fec4ff"},{"start":"cog-s","file":"5a640365f8e47c609005d5e098e0e8104286d120"},{"start":"cookie-l","file":"dd85b8eb8581b176d3acf75d1bd82e61ca1ba2fc"},{"start":"currency-eur-","file":"15362279f4ebfc3620ae55f79d2830ad86d5213e"},{"start":"delete-o","file":"239434ab8df61237277d7599ebe066c55806c274"},{"start":"draw-","file":"5605918a592070803ba2ad05a5aba06263da0d70"},{"start":"emoticon-po","file":"a838cfcec34323946237a9f18e66945f55260f78"},{"start":"fan","file":"effd56103b37a8c7f332e22de8e4d67a69b70db7"},{"start":"file-question-","file":"b2424b50bd465ae192593f1c3d086c5eec893af8"},{"start":"flask-off-","file":"3b76295cde006a18f0301dd98eed8c57e1d5a425"},{"start":"food-s","file":"1c6941474cbeb1755faaaf5771440577f4f1f9c6"},{"start":"gamepad-u","file":"c6efe18db6bc9654ae3540c7dee83218a5450263"},{"start":"google-f","file":"df341afe6ad4437457cf188499cb8d2df8ac7b9e"},{"start":"head-c","file":"282121c9e45ed67f033edcc1eafd279334c00f46"},{"start":"home-pl","file":"27e8e38fc7adcacf2a210802f27d841b49c8c508"},{"start":"inbox-","file":"0f0316ec7b1b7f7ce3eaabce26c9ef619b5a1694"},{"start":"key-v","file":"ea33462be7b953ff1eafc5dac2d166b210685a60"},{"start":"leaf-circle-","file":"33db9bbd66ce48a2db3e987fdbd37fb0482145a4"},{"start":"lock-p","file":"b89e27ed39e9d10c44259362a4b57f3c579d3ec8"},{"start":"message-s","file":"7b5ab5a5cadbe06e3113ec148f044aa701eac53a"},{"start":"moti","file":"01024d78c248d36805b565e343dd98033cc3bcaf"},{"start":"newspaper-variant-o","file":"22a6ec4a4fdd0a7c0acaf805f6127b38723c9189"},{"start":"on","file":"c73d55b412f394e64632e2011a59aa05e5a1f50d"},{"start":"paw-ou","file":"3f669bf26d16752dc4a9ea349492df93a13dcfbf"},{"start":"pigg","file":"0c24edb27eb1c90b6e33fc05f34ef3118fa94256"},{"start":"printer-pos-sy","file":"41a55cda866f90b99a64395c3bb18c14983dcf0a"},{"start":"read","file":"c7ed91552a3a64c9be88c85e807404cf705b7edf"},{"start":"robot-vacuum-variant-o","file":"917d2a35d7268c0ea9ad9ecab2778060e19d90e0"},{"start":"sees","file":"6e82d9861d8fac30102bafa212021b819f303bdb"},{"start":"shoe-f","file":"e2fe7ce02b5472301418cc90a0e631f187b9f238"},{"start":"snowflake-m","file":"a28ba9f5309090c8b49a27ca20ff582a944f6e71"},{"start":"st","file":"7e92d03f095ec27e137b708b879dfd273bd735ab"},{"start":"su","file":"61c74913720f9de59a379bdca37f1d2f0dc1f9db"},{"start":"tag-plus-","file":"8f3184156a4f38549cf4c4fffba73a6a941166ae"},{"start":"timer-a","file":"baab470d11cfb3a3cd3b063ee6503a77d12a80d0"},{"start":"transit-d","file":"8561c0d9b1ac03fab360fd8fe9729c96e8693239"},{"start":"vector-arrange-b","file":"c9a3439257d4bab33d3355f1f2e11842e8171141"},{"start":"water-ou","file":"02dbccfb8ca35f39b99f5a085b095fc1275005a0"},{"start":"webc","file":"57bafd4b97341f4f2ac20a609d023719f23a619c"},{"start":"zip","file":"65ae094e8263236fa50486584a08c03497a38d93"}]}');let p;const m=()=>(p||(p=u().catch(e=>{throw p=void 0,e})),p),u=async()=>{const e=(0,d.y$)("hass-icon-db","mdi-icon-store"),t=await(0,d.Jt)("_version",e);return t?t!==h.version&&(await(0,d.IU)(e),(0,d.hZ)("_version",h.version,e)):(0,d.hZ)("_version",h.version,e),e},g=["mdi","hass","hassio","hademo"];let f=[];i(67094);const _={},v={},b=(0,n.s)(()=>(async e=>{const t=Object.keys(e),i=await Promise.allSettled(Object.values(e));(await m())("readwrite",a=>{i.forEach((i,o)=>{"fulfilled"===i.status&&Object.entries(i.value).forEach(([e,t])=>{a.put(t,e)}),delete e[t[o]]})})})(v),2e3),y={},w={"home-assistant":()=>i.e(58781).then(i.bind(i,53580)).then(e=>e.mdiHomeAssistant),"music-assistant":()=>i.e(56009).then(i.bind(i,10576)).then(e=>e.mdiMusicAssistant),esphome:()=>i.e(88800).then(i.bind(i,45091)).then(e=>e.mdiEsphomeLogo)};class $ extends o.WF{willUpdate(e){super.willUpdate(e),e.has("icon")&&(this._path=void 0,this._secondaryPath=void 0,this._viewBox=void 0,this._loadIcon())}render(){return this.icon?this._legacy?o.qy` <iron-icon .icon="${this.icon}"></iron-icon>`:o.qy`<ha-svg-icon .path="${this._path}" .secondaryPath="${this._secondaryPath}" .viewBox="${this._viewBox}"></ha-svg-icon>`:o.s6}async _loadIcon(){if(!this.icon)return;const e=this.icon,[t,i]=this.icon.split(":",2);let a,o=i;if(!t||!o)return;if(!g.includes(t)){const i=l.y[t];return i?void(i&&"function"==typeof i.getIcon&&this._setCustomPath(i.getIcon(o),e)):void(this._legacy=!0)}if(this._legacy=!1,o in _){const e=_[o];let i;e.newName?(i=`Icon ${t}:${o} was renamed to ${t}:${e.newName}, please change your config, it will be removed in version ${e.removeIn}.`,o=e.newName):i=`Icon ${t}:${o} was removed from MDI, please replace this icon with an other icon in your config, it will be removed in version ${e.removeIn}.`,console.warn(i),(0,r.r)(this,"write_log",{level:"warning",message:i})}if(o in y)return void(this._path=y[o]);if(o in w){const t=await w[o]();return this.icon===e&&(this._path=t),void(y[o]=t)}try{a=await(e=>new Promise((t,i)=>{if(f.push([e,t,i]),f.length>1)return;const a=m();(0,c.h)(1e3,(async()=>{(await a)("readonly",e=>{for(const[t,i,a]of f)(0,d.Yd)(e.get(t)).then(e=>i(e)).catch(e=>a(e));f=[]})})()).catch(e=>{for(const[,,t]of f)t(e);f=[]})}))(o)}catch(e){a=void 0}if(a)return this.icon===e&&(this._path=a),void(y[o]=a);const s=(e=>{let t;for(const i of h.parts){if(void 0!==i.start&&e<i.start)break;t=i}return t.file})(o);if(s in v)return void this._setPath(v[s],o,e);const n=fetch(`/static/mdi/${s}.json`).then(e=>e.json());v[s]=n,this._setPath(n,o,e),n.catch(()=>{delete v[s]}),b()}async _setCustomPath(e,t){const i=await e;this.icon===t&&(this._path=i.path,this._secondaryPath=i.secondaryPath,this._viewBox=i.viewBox)}async _setPath(e,t,i){try{const a=await e;this.icon===i&&(this._path=a[t]),y[t]=a[t]}catch(e){}}constructor(...e){super(...e),this._legacy=!1}}$.styles=o.AH`:host{fill:currentcolor}`,(0,a.Cg)([(0,s.MZ)()],$.prototype,"icon",void 0),(0,a.Cg)([(0,s.wk)()],$.prototype,"_path",void 0),(0,a.Cg)([(0,s.wk)()],$.prototype,"_secondaryPath",void 0),(0,a.Cg)([(0,s.wk)()],$.prototype,"_viewBox",void 0),(0,a.Cg)([(0,s.wk)()],$.prototype,"_legacy",void 0),$=(0,a.Cg)([(0,s.EM)("ha-icon")],$)},3449(e,t,i){var a=i(62826),o=i(5124),s=i(22441);class r extends o.WF{render(){return o.qy`<slot></slot>`}constructor(...e){super(...e),this.disabled=!1}}r.styles=o.AH`:host{display:block;color:var(--mdc-text-field-label-ink-color,rgba(0,0,0,.6));font-size:var(--ha-font-size-s);padding-left:16px;padding-right:16px;padding-inline-start:16px;padding-inline-end:16px;letter-spacing:var(
--mdc-typography-caption-letter-spacing,
.0333333333em
);line-height:normal}:host([disabled]){color:var(--mdc-text-field-disabled-ink-color,rgba(0,0,0,.6))}`,(0,a.Cg)([(0,s.MZ)({type:Boolean,reflect:!0})],r.prototype,"disabled",void 0),r=(0,a.Cg)([(0,s.EM)("ha-input-helper-text")],r)},28732(e,t,i){var a=i(62826),o=i(27686),s=i(7731),r=i(5124),n=i(22441);class l extends o.J{renderRipple(){return this.noninteractive?"":super.renderRipple()}static get styles(){return[s.R,r.AH`:host{padding-left:var(--mdc-list-side-padding-left,var(--mdc-list-side-padding,20px));padding-inline-start:var(--mdc-list-side-padding-left,var(--mdc-list-side-padding,20px));padding-right:var(--mdc-list-side-padding-right,var(--mdc-list-side-padding,20px));padding-inline-end:var(--mdc-list-side-padding-right,var(--mdc-list-side-padding,20px))}:host([graphic=avatar]:not([twoLine])),:host([graphic=icon]:not([twoLine])){height:48px}span.material-icons:first-of-type{margin-inline-start:0px!important;margin-inline-end:var(--mdc-list-item-graphic-margin,16px)!important;direction:var(--direction)!important}span.material-icons:last-of-type{margin-inline-start:auto!important;margin-inline-end:0px!important;direction:var(--direction)!important}.mdc-deprecated-list-item__meta{display:var(--mdc-list-item-meta-display);align-items:center;flex-shrink:0}:host([graphic=icon]:not([twoline])) .mdc-deprecated-list-item__graphic{margin-inline-end:var(--mdc-list-item-graphic-margin,20px)!important}:host([multiline-secondary]){height:auto}:host([multiline-secondary]) .mdc-deprecated-list-item__text{padding:8px 0}:host([multiline-secondary]) .mdc-deprecated-list-item__secondary-text{text-overflow:initial;white-space:normal;overflow:auto;display:inline-block;margin-top:10px}:host([multiline-secondary]) .mdc-deprecated-list-item__primary-text{margin-top:10px}:host([multiline-secondary]) .mdc-deprecated-list-item__secondary-text::before{display:none}:host([multiline-secondary]) .mdc-deprecated-list-item__primary-text::before{display:none}:host([disabled]){color:var(--disabled-text-color)}:host([noninteractive]){pointer-events:unset}`,"rtl"===document.dir?r.AH`span.material-icons:first-of-type,span.material-icons:last-of-type{direction:rtl!important;--direction:rtl}`:r.AH``]}}l=(0,a.Cg)([(0,n.EM)("ha-list-item")],l)},38377(e,t,i){i(74423),i(18111),i(22489),i(61701),i(18237);var a=i(62826),o=i(5124),s=i(22441),r=i(20889),n=i(30015),l=i.n(n),d=i(1087),c=(i(14603),i(47566),i(98721),i(2209));let h;var p=i(996);const m=e=>o.qy`${e}`,u=new p.G(1e3),g={reType:/(?<input>(\[!(?<type>caution|important|note|tip|warning)\])(?:\s|\\n)?)/i,typeToHaAlert:{caution:"error",important:"info",note:"info",tip:"success",warning:"warning"}};class f extends o.mN{disconnectedCallback(){if(super.disconnectedCallback(),this.cache){const e=this._computeCacheKey();u.set(e,this.innerHTML)}}createRenderRoot(){return this}update(e){super.update(e),void 0!==this.content&&(this._renderPromise=this._render())}async getUpdateComplete(){return await super.getUpdateComplete(),await this._renderPromise,!0}willUpdate(e){if(!this.innerHTML&&this.cache){const e=this._computeCacheKey();u.has(e)&&((0,o.XX)(m((0,r._)(u.get(e))),this.renderRoot),this._resize())}}_computeCacheKey(){return l()({content:this.content,allowSvg:this.allowSvg,allowDataUrl:this.allowDataUrl,breaks:this.breaks})}async _render(){const e=await(async(e,t,a)=>(h||(h=(0,c.LV)(new Worker(new URL(i.p+i.u(55640),i.b)))),h.renderMarkdown(e,t,a)))(String(this.content),{breaks:this.breaks,gfm:!0},{allowSvg:this.allowSvg,allowDataUrl:this.allowDataUrl});(0,o.XX)(m((0,r._)(e.join(""))),this.renderRoot),this._resize();const t=document.createTreeWalker(this,NodeFilter.SHOW_ELEMENT,null);for(;t.nextNode();){const e=t.currentNode;if(e instanceof HTMLAnchorElement&&e.host!==document.location.host)e.target="_blank",e.rel="noreferrer noopener";else if(e instanceof HTMLImageElement)this.lazyImages&&(e.loading="lazy"),e.addEventListener("load",this._resize);else if(e instanceof HTMLQuoteElement){const i=e.firstElementChild?.firstChild?.textContent&&g.reType.exec(e.firstElementChild.firstChild.textContent);if(i){const{type:a}=i.groups,o=document.createElement("ha-alert");o.alertType=g.typeToHaAlert[a.toLowerCase()],o.append(...Array.from(e.childNodes).map(e=>{const t=Array.from(e.childNodes);if(!this.breaks&&t.length){const e=t[0];e.nodeType===Node.TEXT_NODE&&e.textContent===i.input&&e.textContent?.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!==i.input)),t.parentNode().replaceChild(o,e)}}else e instanceof HTMLElement&&["ha-alert","ha-qr-code","ha-icon","ha-svg-icon"].includes(e.localName)&&i(62003)(`./${e.localName}`)}}constructor(...e){super(...e),this.allowSvg=!1,this.allowDataUrl=!1,this.breaks=!1,this.lazyImages=!1,this.cache=!1,this._renderPromise=Promise.resolve(),this._resize=()=>(0,d.r)(this,"content-resize")}}(0,a.Cg)([(0,s.MZ)()],f.prototype,"content",void 0),(0,a.Cg)([(0,s.MZ)({attribute:"allow-svg",type:Boolean})],f.prototype,"allowSvg",void 0),(0,a.Cg)([(0,s.MZ)({attribute:"allow-data-url",type:Boolean})],f.prototype,"allowDataUrl",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean})],f.prototype,"breaks",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean,attribute:"lazy-images"})],f.prototype,"lazyImages",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean})],f.prototype,"cache",void 0),f=(0,a.Cg)([(0,s.EM)("ha-markdown-element")],f)},3587(e,t,i){var a=i(62826),o=i(5124),s=i(22441);i(38377);class r extends o.WF{async getUpdateComplete(){const e=await super.getUpdateComplete();return await(this._markdownElement?.updateComplete),e}render(){return this.content?o.qy`<ha-markdown-element .content="${this.content}" .allowSvg="${this.allowSvg}" .allowDataUrl="${this.allowDataUrl}" .breaks="${this.breaks}" .lazyImages="${this.lazyImages}" .cache="${this.cache}"></ha-markdown-element>`:o.s6}constructor(...e){super(...e),this.allowSvg=!1,this.allowDataUrl=!1,this.breaks=!1,this.lazyImages=!1,this.cache=!1}}r.styles=o.AH`: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:var(--ha-space-1) 0}a{color:var(--markdown-link-color,var(--primary-color))}img{background-color:var(--markdown-image-background-color);border-radius:var(--markdown-image-border-radius);max-width:100%}p:first-child>img:first-child{vertical-align:top}p:first-child>img:last-child{vertical-align:top}ha-markdown-element>:is(ol,ul){padding-inline-start:var(--markdown-list-indent,revert)}li:has(input[type=checkbox]){list-style:none}li:has(input[type=checkbox])>input[type=checkbox]{margin-left:0}svg{background-color:var(--markdown-svg-background-color,none);color:var(--markdown-svg-color,none)}code,pre{background-color:var(--markdown-code-background-color,none);border-radius:var(--ha-border-radius-sm);color:var(--markdown-code-text-color,inherit)}code{font-size:var(--ha-font-size-s);padding:.2em .4em}pre code{padding:0}pre{padding:var(--ha-space-4);overflow:auto;line-height:var(--ha-line-height-condensed);font-family:var(--ha-font-family-code)}h1,h2,h3,h4,h5,h6{line-height:initial}h2{font-size:var(--ha-font-size-xl);font-weight:var(--ha-font-weight-bold)}hr{border-color:var(--divider-color);border-bottom:none;margin:var(--ha-space-4) 0}table[role=presentation]{--markdown-table-border-collapse:separate;--markdown-table-border-width:0;--markdown-table-padding-inline:0;--markdown-table-padding-block:0}table[role=presentation] td,table[role=presentation] th{vertical-align:middle}table[role=presentation] td[valign=top],table[role=presentation] th[valign=top]{vertical-align:top}table[role=presentation] td[valign=middle],table[role=presentation] th[valign=middle]{vertical-align:middle}table[role=presentation] td[valign=bottom],table[role=presentation] th[valign=bottom]{vertical-align:bottom}table[role=presentation] td[valign=baseline],table[role=presentation] th[valign=baseline]{vertical-align:baseline}@supports (border-width:attr(border px,0)){table[role=presentation]{--markdown-table-border-width:attr(border px, 0)}table[role=presentation] td,table[role=presentation] th{vertical-align:attr(valign,middle)}}table[role=presentation][border="0"]{--markdown-table-border-width:0}table[role=presentation][border="1"]{--markdown-table-border-width:1px}table[role=presentation][border="2"]{--markdown-table-border-width:2px}table[role=presentation][border="3"]{--markdown-table-border-width:3px}table{border-collapse:var(--markdown-table-border-collapse,collapse)}div:has(> table){overflow:auto}th{text-align:var(--markdown-table-text-align,start)}td,th{border-width:var(--markdown-table-border-width,1px);border-style:var(--markdown-table-border-style,solid);border-color:var(--markdown-table-border-color,var(--divider-color));padding-inline:var(--markdown-table-padding-inline,0.5em);padding-block:var(--markdown-table-padding-block,0.25em)}blockquote{border-left:4px solid var(--divider-color);margin-inline:0;padding-inline:1em}`,(0,a.Cg)([(0,s.MZ)()],r.prototype,"content",void 0),(0,a.Cg)([(0,s.MZ)({attribute:"allow-svg",type:Boolean})],r.prototype,"allowSvg",void 0),(0,a.Cg)([(0,s.MZ)({attribute:"allow-data-url",type:Boolean})],r.prototype,"allowDataUrl",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean})],r.prototype,"breaks",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean,attribute:"lazy-images"})],r.prototype,"lazyImages",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean})],r.prototype,"cache",void 0),(0,a.Cg)([(0,s.P)("ha-markdown-element")],r.prototype,"_markdownElement",void 0),r=(0,a.Cg)([(0,s.EM)("ha-markdown")],r)},88285(e,t,i){i.a(e,async function(e,t){try{var a=i(62826),o=i(35211),s=i(5124),r=i(22441),n=i(63672),l=i(1087),d=i(22792),c=i(17894),h=(i(75064),i(47680),i(26300)),p=e([h]);h=(p.then?(await p)():p)[0];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",u="M7,10L12,15L17,10H7Z";class g extends((0,c.c)(s.WF)){async focus(){await this.updateComplete,await(this.item?.focus())}render(){const e=!!this.value,t=!(!this.value||this.required||this.disabled||this.hideClearIcon),i=this.placeholder??this.label,a=this.label&&e?s.qy`<span slot="overline">${this.label}${this.required?" *":""}</span>`:s.s6,o=e?this.valueRenderer?this.valueRenderer(this.value??""):s.qy`<span slot="headline">${this.value}</span>`:i?s.qy`<span slot="headline" class="placeholder"> ${i}${this.required?" *":""} </span>`:s.s6;return s.qy` <ha-combo-box-item aria-label="${(0,n.J)(this.label||this.placeholder)}" .disabled="${this.disabled}" type="button" compact="compact"> ${this.image?s.qy`<img alt="${this.label??""}" slot="start" .src="${this.image}" crossorigin="anonymous" referrerpolicy="no-referrer">`:this.icon?s.qy`<ha-icon slot="start" .icon="${this.icon}"></ha-icon>`:s.qy`<slot name="start"></slot>`} ${a}${o} ${this.unknown?s.qy`<div slot="supporting-text" class="unknown"> ${this.unknownItemText||this._i18n?.localize("ui.components.combo-box.unknown_item")} </div>`:s.s6} ${t?s.qy` <ha-icon-button class="clear" slot="end" @click="${this._clear}" .path="${m}"></ha-icon-button> `:s.s6} <ha-svg-icon class="arrow" slot="end" .path="${u}"></ha-svg-icon> </ha-combo-box-item> `}_clear(e){e.stopPropagation(),(0,l.r)(this,"clear")}static get styles(){return[s.AH`ha-combo-box-item[disabled]{background-color:var(--ha-color-form-background-disabled);--md-list-item-disabled-opacity:0.5;opacity:.5;cursor:not-allowed}ha-combo-box-item{position:relative;background-color:var(--ha-color-form-background);border-radius:var(--ha-border-radius-sm);border-end-end-radius:0;border-end-start-radius:0;--md-list-item-one-line-container-height:56px;--md-list-item-two-line-container-height:56px;--md-list-item-top-space:0px;--md-list-item-bottom-space:0px;--md-list-item-leading-space:var(--ha-space-4);--md-list-item-trailing-space:var(--ha-space-2);--ha-md-list-item-gap:var(--ha-space-2);--md-focus-ring-width:0px;--md-focus-ring-duration:0s}ha-combo-box-item:after{display:block;content:"";position:absolute;pointer-events:none;bottom:0;left:0;right:0;height:1px;width:100%;background-color:var(--ha-color-border-neutral-loud);transform:height 180ms ease-in-out,background-color 180ms ease-in-out}ha-combo-box-item:focus:after{height:2px;background-color:var(--mdc-theme-primary)}:host([unknown]) ha-combo-box-item{background-color:var(--ha-color-fill-warning-quiet-resting)}:host([invalid]) ha-combo-box-item:after{height:2px;background-color:var(--mdc-theme-error,var(--error-color,#b00020))}.clear{margin:0 -8px;--ha-icon-button-size:32px;--ha-icon-button-padding-inline:var(--ha-space-1)}.arrow{--mdc-icon-size:20px;width:32px}.placeholder{color:var(--secondary-text-color)}:host([invalid]) .placeholder{color:var(--mdc-theme-error,var(--error-color,#b00020))}.unknown{color:var(--ha-color-on-warning-normal)}`]}constructor(...e){super(...e),this.invalid=!1}}(0,a.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],g.prototype,"invalid",void 0),(0,a.Cg)([(0,r.P)("ha-combo-box-item",!0)],g.prototype,"item",void 0),(0,a.Cg)([(0,r.wk)(),(0,o.Fg)({context:d.D5,subscribe:!0})],g.prototype,"_i18n",void 0),g=(0,a.Cg)([(0,r.EM)("ha-picker-field")],g),t()}catch(e){t(e)}})},11399(e,t,i){i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698);var a=i(62826),o=i(5124),s=i(22441),r=i(22786),n=i(69558),l=i(95311);const d={action:()=>Promise.all([i.e(4801),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(34995),i.e(3283),i.e(80131),i.e(72130),i.e(85010),i.e(67218),i.e(58416),i.e(58303),i.e(81034),i.e(16787),i.e(54066),i.e(25950),i.e(14421),i.e(86475),i.e(26092),i.e(8851),i.e(34310),i.e(90790),i.e(12009),i.e(20282),i.e(90577),i.e(16508),i.e(48531),i.e(91123),i.e(31863),i.e(283),i.e(30513),i.e(86618)]).then(i.bind(i,6274)),addon:()=>Promise.all([i.e(4801),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(26787),i.e(26092),i.e(45386),i.e(43305)]).then(i.bind(i,36784)),automation_behavior:()=>Promise.all([i.e(4801),i.e(81034),i.e(82416)]).then(i.bind(i,66034)),app:()=>Promise.all([i.e(4801),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(26787),i.e(26092),i.e(45386)]).then(i.bind(i,48585)),area:()=>Promise.all([i.e(4801),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(83523),i.e(26092),i.e(40404)]).then(i.bind(i,81857)),areas_display:()=>Promise.all([i.e(46095),i.e(64657),i.e(68273),i.e(64280),i.e(32838)]).then(i.bind(i,38235)),attribute:()=>Promise.all([i.e(4801),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(49168),i.e(26092),i.e(67471)]).then(i.bind(i,71498)),assist_pipeline:()=>Promise.all([i.e(4801),i.e(39763),i.e(46095),i.e(34995),i.e(43048),i.e(30195)]).then(i.bind(i,83642)),boolean:()=>Promise.all([i.e(93282),i.e(19623)]).then(i.bind(i,30714)),choose:()=>i.e(93934).then(i.bind(i,58141)),color_rgb:()=>Promise.all([i.e(4801),i.e(39763),i.e(32450),i.e(7106),i.e(31524)]).then(i.bind(i,34931)),condition:()=>Promise.all([i.e(4801),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(34995),i.e(3283),i.e(72130),i.e(85010),i.e(67218),i.e(16787),i.e(54066),i.e(25950),i.e(91095),i.e(26092),i.e(8851),i.e(34310),i.e(12009),i.e(20282),i.e(90577),i.e(48531),i.e(91123),i.e(283),i.e(60066)]).then(i.bind(i,81539)),config_entry:()=>Promise.all([i.e(4801),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(8706),i.e(26092),i.e(8851),i.e(36830)]).then(i.bind(i,49347)),conversation_agent:()=>Promise.all([i.e(4801),i.e(39763),i.e(46095),i.e(34995),i.e(20667),i.e(66896)]).then(i.bind(i,94215)),constant:()=>i.e(77057).then(i.bind(i,39032)),country:()=>Promise.all([i.e(4801),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(84887),i.e(65799),i.e(26092),i.e(40489),i.e(45262)]).then(i.bind(i,94164)),date:()=>Promise.all([i.e(4801),i.e(39763),i.e(32450),i.e(81484),i.e(93993)]).then(i.bind(i,94351)),datetime:()=>Promise.all([i.e(4801),i.e(39763),i.e(32450),i.e(46095),i.e(34995),i.e(95366),i.e(78229)]).then(i.bind(i,39045)),device:()=>Promise.all([i.e(4801),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(16787),i.e(93162),i.e(26092),i.e(90577),i.e(90606)]).then(i.bind(i,2270)),duration:()=>Promise.all([i.e(4801),i.e(39763),i.e(32450),i.e(46095),i.e(34995),i.e(90324),i.e(16508),i.e(21082)]).then(i.bind(i,79488)),entity:()=>Promise.all([i.e(4801),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(69923),i.e(26092),i.e(8851),i.e(1535),i.e(34682)]).then(i.bind(i,73863)),entity_name:()=>Promise.all([i.e(4801),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(80607),i.e(26092),i.e(85852)]).then(i.bind(i,7563)),statistic:()=>Promise.all([i.e(4801),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(7390),i.e(26092),i.e(8851),i.e(54884),i.e(98206)]).then(i.bind(i,28072)),file:()=>Promise.all([i.e(4801),i.e(80764)]).then(i.bind(i,25078)),floor:()=>Promise.all([i.e(4801),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(89100),i.e(54192),i.e(26092),i.e(93e3),i.e(55619)]).then(i.bind(i,9040)),label:()=>Promise.all([i.e(4801),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(79808),i.e(26092),i.e(66201),i.e(58397)]).then(i.bind(i,99560)),language:()=>Promise.all([i.e(4801),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(82025),i.e(26092),i.e(60293)]).then(i.bind(i,15430)),navigation:()=>Promise.all([i.e(4801),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(34995),i.e(3283),i.e(83113),i.e(99788),i.e(66716),i.e(54066),i.e(68077),i.e(26092),i.e(8851),i.e(19112),i.e(30002),i.e(59704),i.e(25322),i.e(89747),i.e(59532),i.e(52487),i.e(12009),i.e(20282),i.e(48531),i.e(79767),i.e(74942)]).then(i.bind(i,58350)),number:()=>Promise.all([i.e(4801),i.e(39763),i.e(32450),i.e(21543),i.e(4162)]).then(i.bind(i,31157)),numeric_threshold:()=>Promise.all([i.e(4801),i.e(39763),i.e(46095),i.e(34995),i.e(88992),i.e(50616)]).then(i.bind(i,18719)),object:()=>Promise.all([i.e(4801),i.e(39763),i.e(46095),i.e(72130),i.e(85010),i.e(42981),i.e(34310),i.e(46660)]).then(i.bind(i,97951)),period:()=>i.e(54234).then(i.bind(i,40929)),qr_code:()=>Promise.all([i.e(4801),i.e(51343),i.e(15251)]).then(i.bind(i,35313)),select:()=>Promise.all([i.e(4801),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(34995),i.e(3283),i.e(81034),i.e(26092),i.e(56629)]).then(i.bind(i,856)),selector:()=>i.e(77810).then(i.bind(i,13897)),serial_port:()=>Promise.all([i.e(4801),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(68432),i.e(26092),i.e(90587)]).then(i.bind(i,82178)),state:()=>Promise.all([i.e(4801),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(38809),i.e(26092),i.e(42684)]).then(i.bind(i,12995)),backup_location:()=>Promise.all([i.e(4801),i.e(39763),i.e(46095),i.e(34995),i.e(80131),i.e(83241),i.e(61757)]).then(i.bind(i,16360)),stt:()=>Promise.all([i.e(4801),i.e(39763),i.e(46095),i.e(34995),i.e(98286),i.e(15424)]).then(i.bind(i,42999)),target:()=>Promise.all([i.e(4801),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(35040),i.e(26092),i.e(8851),i.e(33758),i.e(8697),i.e(8955),i.e(17509)]).then(i.bind(i,84909)),template:()=>Promise.all([i.e(4801),i.e(39763),i.e(72130),i.e(33387),i.e(34310),i.e(82770)]).then(i.bind(i,62166)),text:()=>Promise.all([i.e(4801),i.e(39763),i.e(32450),i.e(37694),i.e(67988)]).then(i.bind(i,47971)),time:()=>Promise.all([i.e(4801),i.e(39763),i.e(32450),i.e(46095),i.e(34995),i.e(92351),i.e(67766)]).then(i.bind(i,42945)),icon:()=>Promise.all([i.e(4801),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(86325),i.e(26092),i.e(8851),i.e(79768)]).then(i.bind(i,14885)),media:()=>Promise.all([i.e(4801),i.e(26295),i.e(91845),i.e(32376)]).then(i.bind(i,59422)),theme:()=>Promise.all([i.e(4801),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(4406),i.e(26092),i.e(76696)]).then(i.bind(i,77655)),timezone:()=>Promise.all([i.e(4801),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(56253),i.e(12727),i.e(26092),i.e(49386)]).then(i.bind(i,6719)),button_toggle:()=>i.e(7774).then(i.bind(i,79949)),trigger:()=>Promise.all([i.e(4801),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(34995),i.e(3283),i.e(80131),i.e(72130),i.e(85010),i.e(67218),i.e(58303),i.e(81034),i.e(16787),i.e(54066),i.e(25950),i.e(24906),i.e(26092),i.e(8851),i.e(34310),i.e(12009),i.e(20282),i.e(90577),i.e(48531),i.e(91123),i.e(31863),i.e(60597)]).then(i.bind(i,45078)),tts:()=>Promise.all([i.e(4801),i.e(39763),i.e(46095),i.e(34995),i.e(75905),i.e(85344)]).then(i.bind(i,59447)),tts_voice:()=>Promise.all([i.e(4801),i.e(39763),i.e(46095),i.e(34995),i.e(53524),i.e(98913)]).then(i.bind(i,41188)),location:()=>Promise.all([i.e(4801),i.e(87451),i.e(46146),i.e(8851),i.e(12122),i.e(78146),i.e(8740)]).then(i.bind(i,21160)),color_temp:()=>Promise.all([i.e(4801),i.e(39763),i.e(99788),i.e(21543),i.e(29628),i.e(59704),i.e(20282),i.e(42655)]).then(i.bind(i,90780)),ui_action:()=>Promise.all([i.e(4801),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(34995),i.e(3283),i.e(72130),i.e(85010),i.e(83113),i.e(58416),i.e(99788),i.e(66716),i.e(54066),i.e(25950),i.e(96529),i.e(26092),i.e(8851),i.e(19112),i.e(34310),i.e(30002),i.e(59704),i.e(25322),i.e(90790),i.e(89747),i.e(59532),i.e(52487),i.e(36332),i.e(12009),i.e(20282),i.e(48531),i.e(79767),i.e(80014)]).then(i.bind(i,38389)),ui_color:()=>Promise.all([i.e(4801),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(46051),i.e(26092),i.e(78043)]).then(i.bind(i,52744)),ui_state_content:()=>Promise.all([i.e(4801),i.e(39763),i.e(32450),i.e(46095),i.e(7305),i.e(92769),i.e(3283),i.e(8282),i.e(26092),i.e(52481)]).then(i.bind(i,96074))},c=new Set(["ui-action","ui-color"]);class h extends o.WF{reportValidity(){return this._selectorElement&&"reportValidity"in this._selectorElement&&"function"==typeof this._selectorElement.reportValidity?this._selectorElement?.reportValidity()??!0:!this.required||void 0!==this.value&&null!==this.value&&""!==this.value}async focus(){await this.updateComplete,this._selectorElement?.focus()}get _type(){const e=Object.keys(this.selector)[0];return c.has(e)?e.replace("-","_"):e}willUpdate(e){e.has("selector")&&this.selector&&d[this._type]?.()}render(){return o.qy` ${(0,n._)(`ha-selector-${this._type}`,{hass:this.hass,narrow:this.narrow,name:this.name,selector:this._handleLegacySelector(this.selector),value:this.value,label:this.label,placeholder:this.placeholder,disabled:this.disabled,required:this.required,helper:this.helper,context:this.context,localizeValue:this.localizeValue,id:"selector"})} `}constructor(...e){super(...e),this.narrow=!1,this.disabled=!1,this.required=!0,this._handleLegacySelector=(0,r.A)(e=>{if("entity"in e)return(0,l.UU)(e);if("device"in e)return(0,l.tD)(e);const t=Object.keys(this.selector)[0];return c.has(t)?{[t.replace("-","_")]:e[t]}:e})}}(0,a.Cg)([(0,s.MZ)({attribute:!1})],h.prototype,"hass",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean})],h.prototype,"narrow",void 0),(0,a.Cg)([(0,s.MZ)()],h.prototype,"name",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],h.prototype,"selector",void 0),(0,a.Cg)([(0,s.MZ)()],h.prototype,"value",void 0),(0,a.Cg)([(0,s.MZ)()],h.prototype,"label",void 0),(0,a.Cg)([(0,s.MZ)()],h.prototype,"helper",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],h.prototype,"localizeValue",void 0),(0,a.Cg)([(0,s.MZ)()],h.prototype,"placeholder",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean})],h.prototype,"disabled",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean})],h.prototype,"required",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],h.prototype,"context",void 0),(0,a.Cg)([(0,s.P)("#selector",!0)],h.prototype,"_selectorElement",void 0),h=(0,a.Cg)([(0,s.EM)("ha-selector")],h)},65829(e,t,i){i.a(e,async function(e,a){try{i.r(t),i.d(t,{HaSpinner:()=>d});var o=i(62826),s=i(55262),r=i(5124),n=i(22441),l=e([s]);s=(l.then?(await l)():l)[0];class d extends s.A{updated(e){if(super.updated(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")}}static get styles(){return[s.A.styles,r.AH`: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)}`]}}(0,o.Cg)([(0,n.MZ)()],d.prototype,"size",void 0),d=(0,o.Cg)([(0,n.EM)("ha-spinner")],d),a()}catch(e){a(e)}})},16386(e,t,i){i.a(e,async function(e,t){try{var a=i(62826),o=i(65686),s=i(5124),r=i(22441),n=e([o]);o=(n.then?(await n)():n)[0];class l extends o.A{updated(e){if(super.updated(e),e.has("size"))switch(this.size){case"tiny":this.style.setProperty("--ha-progress-ring-size","16px");break;case"small":this.style.setProperty("--ha-progress-ring-size","28px");break;case"medium":this.style.setProperty("--ha-progress-ring-size","48px");break;case"large":this.style.setProperty("--ha-progress-ring-size","68px");break;case void 0:this.style.removeProperty("--ha-progress-ring-size")}}static get styles(){return[o.A.styles,s.AH`:host{--indicator-color:var(
--ha-progress-ring-indicator-color,
var(--primary-color)
);--track-color:var(
--ha-progress-ring-divider-color,
var(--divider-color)
);--track-width:4px;--speed:3.5s;--size:var(--ha-progress-ring-size, 48px)}`]}}(0,a.Cg)([(0,r.MZ)()],l.prototype,"size",void 0),l=(0,a.Cg)([(0,r.EM)("ha-progress-ring")],l),t()}catch(e){t(e)}})},49852(e,t,i){i.d(t,{P:()=>d,j:()=>l});i(74423),i(18111),i(81148),i(22489),i(61701),i(13579);var a=i(65522),o=i(71727),s=i(55931),r=i(66033),n=i(58594);const l=(e,t,i,l,d,c,h,p,m,u,g,f="")=>{let _,v,b={};const y=Object.values(e),w=Object.values(i),$=Object.values(l);(c||h||p||m||u)&&(b=(0,n.g2)($),_=w,v=$.filter(e=>e.area_id),c&&(_=_.filter(e=>{const t=b[e.id];return!(!t||!t.length)&&b[e.id].some(e=>c.includes((0,o.m)(e.entity_id)))}),v=v.filter(e=>c.includes((0,o.m)(e.entity_id)))),h&&(_=_.filter(e=>{const t=b[e.id];return!t||!t.length||$.every(e=>!h.includes((0,o.m)(e.entity_id)))}),v=v.filter(e=>!h.includes((0,o.m)(e.entity_id)))),p&&(_=_.filter(e=>{const t=b[e.id];return!(!t||!t.length)&&b[e.id].some(e=>{const t=d[e.entity_id];return!!t&&(t.attributes.device_class&&p.includes(t.attributes.device_class))})}),v=v.filter(e=>{const t=d[e.entity_id];return t.attributes.device_class&&p.includes(t.attributes.device_class)})),m&&(_=_.filter(e=>m(e))),u&&(_=_.filter(e=>{const t=b[e.id];return!(!t||!t.length)&&b[e.id].some(e=>{const t=d[e.entity_id];return!!t&&u(t)})}),v=v.filter(e=>{const t=d[e.entity_id];return!!t&&u(t)})));let C,x=y;_&&(C=_.filter(e=>e.area_id).map(e=>e.area_id)),v&&(C=(C??[]).concat(v.filter(e=>e.area_id).map(e=>e.area_id))),C&&(x=x.filter(e=>C.includes(e.area_id))),g&&(x=x.filter(e=>!g.includes(e.area_id)));return x.map(e=>{const{floor:i}=(0,r.L)(e,t),o=i?(0,s.X)(i):void 0,n=(0,a.A)(e);return{id:`${f}${e.area_id}`,primary:n||e.area_id,secondary:o,icon:e.icon||void 0,icon_path:e.icon?void 0:"M20 2H4C2.9 2 2 2.9 2 4V20C2 21.11 2.9 22 4 22H20C21.11 22 22 21.11 22 20V4C22 2.9 21.11 2 20 2M4 6L6 4H10.9L4 10.9V6M4 13.7L13.7 4H18.6L4 18.6V13.7M20 18L18 20H13.1L20 13.1V18M20 10.3L10.3 20H5.4L20 5.4V10.3Z",search_labels:{areaId:e.area_id,aliases:e.aliases.join(" ")}}})},d=[{name:"primary",weight:10},{name:"search_labels.aliases",weight:8},{name:"secondary",weight:6},{name:"search_labels.domain",weight:4},{name:"search_labels.areaId",weight:2}]},2514(e,t,i){i.d(t,{L3:()=>l,uG:()=>c,QI:()=>m,bQ:()=>p,WT:()=>h,ft:()=>n,gs:()=>d});i(44114);var a=i(35518),o=i(9899);const s=e=>e.sendMessagePromise({type:"config/area_registry/list"}),r=(e,t)=>e.subscribeEvents((0,o.s)(()=>s(e).then(e=>t.setState(e,!0)),500,!0),"area_registry_updated"),n=(e,t)=>(0,a.N)("_areaRegistry",s,r,e,t),l=(e,t)=>e.callWS({type:"config/area_registry/create",...t}),d=(e,t,i)=>e.callWS({type:"config/area_registry/update",area_id:t,...i}),c=(e,t)=>e.callWS({type:"config/area_registry/delete",area_id:t}),h=(e,t)=>e.callWS({type:"config/area_registry/reorder",area_ids:t}),p=e=>{const t={};for(const i of e)i.area_id&&(i.area_id in t||(t[i.area_id]=[]),t[i.area_id].push(i));return t},m=e=>{const t={};for(const i of e)i.area_id&&(i.area_id in t||(t[i.area_id]=[]),t[i.area_id].push(i));return t}},62351(e,t,i){i.d(t,{KC:()=>c,Vy:()=>l,ds:()=>s,ew:()=>n,g5:()=>d,tl:()=>r});var a=i(82286),o=i(22675);const s=(e,t,i)=>e.connection.subscribeMessage(i,{type:"assist_satellite/intercept_wake_word",entity_id:t}),r=(e,t)=>e.callWS({type:"assist_satellite/test_connection",entity_id:t}),n=(e,t,i)=>e.callService("assist_satellite","announce",i,{entity_id:t}),l=(e,t)=>e.callWS({type:"assist_satellite/get_configuration",entity_id:t}),d=(e,t,i)=>e.callWS({type:"assist_satellite/set_wake_words",entity_id:t,wake_word_ids:i}),c=e=>e&&e.state!==o.Hh&&(0,a.$)(e,1)},82e3(e,t,i){i.d(t,{D5:()=>a,Fy:()=>h,Gk:()=>u,Hg:()=>o,TJ:()=>r,UQ:()=>c,Y_:()=>g,ds:()=>m,e0:()=>s,ec:()=>p,go:()=>l,n2:()=>d,sq:()=>n});i(74423),i(18111),i(61701),i(33110);const a=14881==i.j?`${location.protocol}//${location.host}`:null,o=e=>e.map(e=>{if("string"!==e.type)return e;switch(e.name){case"username":return{...e,autocomplete:"username",autofocus:!0};case"password":return{...e,autocomplete:"current-password"};case"code":return{...e,autocomplete:"one-time-code",autofocus:!0};default:return e}}),s=(e,t)=>e.callWS({type:"auth/sign_path",path:t}),r=()=>fetch("/auth/providers",{credentials:"same-origin"}),n=(e,t,i)=>fetch("/auth/login_flow",{method:"POST",credentials:"same-origin",body:JSON.stringify({client_id:e,handler:i,redirect_uri:t})}),l=(e,t)=>fetch(`/auth/login_flow/${e}`,{method:"POST",credentials:"same-origin",body:JSON.stringify(t)}),d=e=>fetch(`/auth/login_flow/${e}`,{method:"DELETE",credentials:"same-origin"}),c=(e,t,i,a)=>{e.includes("?")?e.endsWith("&")||(e+="&"):e+="?",e+=`code=${encodeURIComponent(t)}`,i&&(e+=`&state=${encodeURIComponent(i)}`),a&&(e+="&storeToken=true"),document.location.assign(e)},h=async(e,t,i,a)=>e.callWS({type:"config/auth_provider/homeassistant/create",user_id:t,username:i,password:a}),p=(e,t,i)=>e.callWS({type:"config/auth_provider/homeassistant/change_password",current_password:t,new_password:i}),m=(e,t,i)=>e.callWS({type:"config/auth_provider/homeassistant/admin_change_password",user_id:t,password:i}),u=(e,t,i)=>e.callWS({type:"config/auth_provider/homeassistant/admin_change_username",user_id:t,username:i}),g=(e,t,i)=>e.callWS({type:"auth/delete_all_refresh_tokens",token_type:t,delete_current_token:i})},26571(e,t,i){i.d(t,{Al:()=>s,KY:()=>o,PN:()=>l,dG:()=>c,jm:()=>d,m7:()=>g,sR:()=>h,t1:()=>n,t2:()=>m,x:()=>u,yu:()=>p});var a=i(95350);const o=["bluetooth","dhcp","discovery","esphome","hardware","hassio","homekit","integration_discovery","mqtt","ssdp","unignore","usb","zeroconf"],s=66649!=i.j?["reauth"]:null,r={"HA-Frontend-Base":`${location.protocol}//${location.host}`},n=(e,t,i)=>e.callApi("POST","config/config_entries/flow",{handler:t,entry_id:i},r),l=(e,t)=>e.callApi("GET",`config/config_entries/flow/${t}`,void 0,r),d=(e,t,i)=>e.callApi("POST",`config/config_entries/flow/${t}`,i,r),c=(e,t,i)=>e.callWS({type:"config_entries/ignore_flow",flow_id:t,title:i}),h=(e,t)=>e.callApi("DELETE",`config/config_entries/flow/${t}`),p=(e,t)=>e.callApi("GET","config/config_entries/flow_handlers"+(t?`?type=${t}`:"")),m=e=>e.sendMessagePromise({type:"config_entries/flow/progress"}),u=(e,t)=>e.connection.subscribeMessage(e=>t(e),{type:"config_entries/flow/subscribe"}),g=(e,t)=>t.context.title_placeholders&&0!==Object.keys(t.context.title_placeholders).length?e(`component.${t.handler}.config.flow_title`,t.context.title_placeholders)||("name"in t.context.title_placeholders?t.context.title_placeholders.name:(0,a.p$)(e,t.handler)):(0,a.p$)(e,t.handler)},700(e,t,i){i.d(t,{y:()=>r});const a=window;"customIconsets"in a||(a.customIconsets={});const o=a.customIconsets,s=window;"customIcons"in s||(s.customIcons={});const r=new Proxy(s.customIcons,{get:(e,t)=>e[t]??(o[t]?{getIcon:o[t]}:void 0)})},90944(e,t,i){i.d(t,{K:()=>o,P:()=>a});const a=(e,t)=>e.subscribeEvents(t,"data_entry_flow_progressed"),o=(e,t)=>e.subscribeEvents(t,"data_entry_flow_progress_update")},22675(e,t,i){i.d(t,{HV:()=>s,Hh:()=>o});var a=i(23832);const o="unavailable",s="unknown",r=[o,s,"off"];(0,a.g)(r)},7749(e,t,i){i.d(t,{HH:()=>a,TY:()=>o,lu:()=>s,mu:()=>r});const a=(e,t)=>e.callApi("POST","config/config_entries/options/flow",{handler:t}),o=(e,t)=>e.callApi("GET",`config/config_entries/options/flow/${t}`),s=(e,t,i)=>e.callApi("POST",`config/config_entries/options/flow/${t}`,i),r=(e,t)=>e.callApi("DELETE",`config/config_entries/options/flow/${t}`)},51840(e,t,i){i.d(t,{F:()=>s,Q:()=>o});i(74423);const a=["generic_camera","template"],o=(e,t,i,a,o,s)=>e.connection.subscribeMessage(s,{type:`${t}/start_preview`,flow_id:i,flow_type:a,user_input:o}),s=e=>a.includes(e)?e:"generic"},95311(e,t,i){i.d(t,{DF:()=>m,Lo:()=>b,MH:()=>d,MM:()=>u,Qz:()=>p,Ru:()=>f,UU:()=>_,_7:()=>h,bZ:()=>c,m0:()=>l,tD:()=>v,vX:()=>g,wY:()=>y});i(74423),i(44114),i(18111),i(22489),i(30531),i(7588),i(13579),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698);var a=i(44537),o=i(69093),s=i(82286),r=i(24367),n=i(58594);const l=(e,t,i,a,o,s,r)=>{const n=[],l=[],d=[];return Object.values(i).forEach(i=>{i.labels.includes(t)&&p(e,o,a,i.area_id,s,r)&&d.push(i.area_id)}),Object.values(a).forEach(i=>{i.labels.includes(t)&&m(e.states,Object.values(o),i,s,r)&&l.push(i.id)}),Object.values(o).forEach(i=>{i.labels.includes(t)&&u(e.states[i.entity_id],s,r)&&n.push(i.entity_id)}),{areas:d,devices:l,entities:n}},d=(e,t,i,a,o)=>{const s=[];return Object.values(i).forEach(i=>{i.floor_id===t&&p(e,e.entities,e.devices,i.area_id,a,o)&&s.push(i.area_id)}),{areas:s}},c=(e,t,i,a,o,s)=>{const r=[],n=[];return Object.values(i).forEach(i=>{i.area_id===t&&m(e.states,Object.values(a),i,o,s)&&n.push(i.id)}),Object.values(a).forEach(i=>{i.area_id===t&&u(e.states[i.entity_id],o,s)&&r.push(i.entity_id)}),{devices:n,entities:r}},h=(e,t,i,a,o)=>{const s=[];return Object.values(i).forEach(i=>{i.device_id===t&&u(e.states[i.entity_id],a,o)&&s.push(i.entity_id)}),{entities:s}},p=(e,t,i,a,o,s)=>!!Object.values(i).some(i=>!(i.area_id!==a||!m(e.states,Object.values(t),i,o,s)))||Object.values(t).some(t=>!(t.area_id!==a||!u(e.states[t.entity_id],o,s))),m=(e,t,i,o,s)=>{const r=s?(0,n.fk)(s,t):void 0;if(o.target?.device&&!(0,a.e)(o.target.device).some(e=>g(e,i,r)))return!1;if(o.target?.entity){return t.filter(e=>e.device_id===i.id).some(t=>{const i=e[t.entity_id];return u(i,o,s)})}return!0},u=(e,t,i)=>!!e&&(!t.target?.entity||(0,a.e)(t.target.entity).some(t=>f(t,e,i))),g=(e,t,i)=>{const{manufacturer:a,model:o,model_id:s,integration:r}=e;return(!a||t.manufacturer===a)&&((!o||t.model===o)&&((!s||t.model_id===s)&&!(r&&i&&!i?.[t.id]?.has(r))))},f=(e,t,i)=>{const{domain:r,device_class:n,supported_features:l,unit_of_measurement:d,integration:c}=e;if(r){const e=(0,o.t)(t);if(Array.isArray(r)?!r.includes(e):e!==r)return!1}if(n){const e=t.attributes.device_class;if(e&&Array.isArray(n)?!n.includes(e):e!==n)return!1}if(l&&!(0,a.e)(l).some(e=>(0,s.$)(t,e)))return!1;if(d){const e=t.attributes.unit_of_measurement;if(!e||(Array.isArray(d)?!d.includes(e):e!==d))return!1}return!c||i?.[t.entity_id]?.domain===c},_=e=>{if(!e.entity)return{entity:null};if("filter"in e.entity)return e;const{domain:t,integration:i,device_class:a,...o}=e.entity;return t||i||a?{entity:{...o,filter:{domain:t,integration:i,device_class:a}}}:{entity:o}},v=e=>{if(!e.device)return{device:null};if("filter"in e.device)return e;const{integration:t,manufacturer:i,model:a,...o}=e.device;return t||i||a?{device:{...o,filter:{integration:t,manufacturer:i,model:a}}}:{device:o}},b=e=>{let t;if("target"in e)t=(0,a.e)(e.target?.entity);else if("entity"in e){if(e.entity?.include_entities)return;t=(0,a.e)(e.entity?.filter)}if(!t)return;const i=t.flatMap(e=>e.integration||e.device_class||e.supported_features||!e.domain?[]:(0,a.e)(e.domain).filter(e=>(0,r.z)(e)));return[...new Set(i)]},y=(e,t,i,o,s,r={target:{}})=>{if(!t)return[];const n=new Set((0,a.e)(t.entity_id)),p=new Set((0,a.e)(t.device_id)),m=new Set((0,a.e)(t.area_id)),u=new Set((0,a.e)(t.floor_id));return new Set((0,a.e)(t.label_id)).forEach(t=>{const a=l(e,t,s,o,i,r);a.devices.forEach(e=>p.add(e)),a.entities.forEach(e=>n.add(e)),a.areas.forEach(e=>m.add(e))}),u.forEach(t=>{d(e,t,s,r).areas.forEach(e=>m.add(e))}),m.forEach(t=>{const a=c(e,t,o,i,r);a.devices.forEach(e=>p.add(e)),a.entities.forEach(e=>n.add(e))}),p.forEach(t=>{h(e,t,i,r).entities.forEach(e=>n.add(e))}),Array.from(n)}},78314(e,t,i){i.a(e,async function(e,a){try{i.r(t);i(74423),i(18111),i(22489),i(61701),i(13579),i(33110);var o=i(62826),s=i(5124),r=i(22441),n=i(59455),l=i(22786),d=i(1087),c=i(18350),h=i(72554),p=(i(93444),i(26300)),m=i(90944),u=i(14503),g=i(36918),f=i(65063),_=i(77763),v=i(70241),b=i(26401),y=(i(34753),i(45634)),w=(i(52140),i(57473)),$=i(38387),C=(i(11584),i(39619)),x=e([c,h,p,y,w,$,C]);[c,h,p,y,w,$,C]=x.then?(await x)():x;const k="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",M="M11,18H13V16H11V18M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,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,6A4,4 0 0,0 8,10H10A2,2 0 0,1 12,8A2,2 0 0,1 14,10C14,12 11,11.75 11,15H13C13,12.75 16,12.5 16,10A4,4 0 0,0 12,6Z";let S=0;class z extends s.WF{async showDialog(e){this._params=e,this._instance=S++,this._open=!0;const t=this._instance;let i;if(e.startFlowHandler){this._loading="loading_flow",this._handler=e.startFlowHandler;try{i=await this._params.flowConfig.createFlow(this.hass,e.startFlowHandler)}catch(e){this.closeDialog();let t=e.message||e.body||"Unknown error";return"string"!=typeof t&&(t=JSON.stringify(t)),void(0,f.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.integrations.config_flow.error"),text:`${this.hass.localize("ui.panel.config.integrations.config_flow.could_not_load")}: ${t}`})}if(t!==this._instance)return}else{if(!e.continueFlowId)return;this._loading="loading_flow";try{i=await e.flowConfig.fetchFlow(this.hass,e.continueFlowId)}catch(e){this.closeDialog();let t=e.message||e.body||"Unknown error";return"string"!=typeof t&&(t=JSON.stringify(t)),void(0,f.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.integrations.config_flow.error"),text:`${this.hass.localize("ui.panel.config.integrations.config_flow.could_not_load")}: ${t}`})}}t===this._instance&&(this._processStep(i),this._loading=void 0)}closeDialog(){this._params&&(this._open?this._open=!1:this._dialogClosed())}_dialogClosed(){if(!this._params)return;const e=Boolean(this._step&&["create_entry","abort"].includes(this._step.type));!this._step||e||this._params.continueFlowId||this._params.flowConfig.deleteFlow(this.hass,this._step.flow_id),this._step&&this._params.dialogClosedCallback&&this._params.dialogClosedCallback({flowFinished:e,entryId:"result"in this._step?this._step.result?.entry_id:void 0}),this._loading=void 0,this._step=void 0,this._params=void 0,this._handler=void 0,this._unsubDataEntryFlowProgress&&(this._unsubDataEntryFlowProgress(),this._unsubDataEntryFlowProgress=void 0),this._open=!1,(0,d.r)(this,"dialog-closed",{dialog:this.localName})}_getDialogTitle(){if(this._loading||!this._step||!this._params)return"";switch(this._step.type){case"form":return this._params.flowConfig.renderShowFormStepHeader(this.hass,this._step);case"abort":return this._params.flowConfig.renderAbortHeader?this._params.flowConfig.renderAbortHeader(this.hass,this._step):this.hass.localize(`component.${this._params.domain??this._step.handler}.title`);case"progress":return this._params.flowConfig.renderShowFormProgressHeader(this.hass,this._step);case"menu":return this._params.flowConfig.renderMenuHeader(this.hass,this._step);case"create_entry":{const e=this._devices(this._params.flowConfig.showDevices,Object.values(this.hass.devices),this._step.result?.entry_id,this._params.carryOverDevices).length;return this.hass.localize("ui.panel.config.integrations.config_flow."+(e?"device_created":"success"))}default:return""}}_getDialogSubtitle(){if(this._loading||!this._step||!this._params)return"";switch(this._step.type){case"form":return this._params.flowConfig.renderShowFormStepSubheader?.(this.hass,this._step);case"abort":return this._params.flowConfig.renderAbortSubheader?.(this.hass,this._step);case"progress":return this._params.flowConfig.renderShowFormProgressSubheader?.(this.hass,this._step);case"menu":return this._params.flowConfig.renderMenuSubheader?.(this.hass,this._step);default:return""}}render(){if(!this._params)return s.s6;const e=["form","menu","external","progress","data_entry_flow_progressed"].includes(this._step?.type)&&this._params.manifest?.is_built_in||!!this._params.manifest?.documentation,t=this._getDialogTitle(),i=this._getDialogSubtitle();return s.qy` <ha-dialog .open="${this._open}" prevent-scrim-close @after-show="${this._focusFormStep}" @closed="${this._dialogClosed}"> <ha-icon-button slot="headerNavigationIcon" .label="${this.hass.localize("ui.common.close")}" .path="${k}" data-dialog="close"></ha-icon-button> <div slot="headerTitle" class="dialog-title${"form"===this._step?.type?" form":""}" title="${t}"> ${t} </div> ${i?s.qy` <div slot="headerSubtitle">${i}</div>`:s.s6} ${e&&!this._loading&&this._step?s.qy` <a slot="headerActionItems" class="help" href="${this._params.manifest.is_built_in?(0,g.o)(this.hass,`/integrations/${this._params.manifest.domain}`):this._params.manifest.documentation}" target="_blank" rel="noreferrer noopener"> <ha-icon-button .label="${this.hass.localize("ui.common.help")}" .path="${M}"> </ha-icon-button></a> `:s.s6} <div> ${this._loading||null===this._step?s.qy` <step-flow-loading .flowConfig="${this._params.flowConfig}" .hass="${this.hass}" .loadingReason="${this._loading}" .handler="${this._handler}" .step="${this._step}"></step-flow-loading> `:void 0===this._step?s.s6:s.qy` ${"form"===this._step.type?s.qy` <step-flow-form ${(0,n.K)(this._formStepRef)} autofocus narrow .flowConfig="${this._params.flowConfig}" .step="${this._step}" .hass="${this.hass}" @flow-step-footer-state-changed="${this._handleFooterStateChanged}"></step-flow-form> `:"external"===this._step.type?s.qy` <step-flow-external .flowConfig="${this._params.flowConfig}" .step="${this._step}" .hass="${this.hass}"></step-flow-external> `:"abort"===this._step.type?s.qy` <step-flow-abort ${(0,n.K)(this._abortStepRef)} .params="${this._params}" .step="${this._step}" .hass="${this.hass}" .handler="${this._step.handler}" .domain="${this._params.domain??this._step.handler}"></step-flow-abort> `:"progress"===this._step.type?s.qy` <step-flow-progress .flowConfig="${this._params.flowConfig}" .step="${this._step}" .hass="${this.hass}" .progress="${this._progress}"></step-flow-progress> `:"menu"===this._step.type?s.qy` <step-flow-menu .flowConfig="${this._params.flowConfig}" .step="${this._step}" .hass="${this.hass}"></step-flow-menu> `:s.qy` <step-flow-create-entry ${(0,n.K)(this._createEntryStepRef)} .flowConfig="${this._params.flowConfig}" .step="${this._step}" .hass="${this.hass}" .navigateToResult="${this._params.navigateToResult??!1}" @flow-step-footer-state-changed="${this._handleFooterStateChanged}" .devices="${this._devices(this._params.flowConfig.showDevices,Object.values(this.hass.devices),this._step.result?.entry_id,this._params.carryOverDevices)}"></step-flow-create-entry> `} `} </div> ${this._renderFooter()} </ha-dialog> `}_renderFooter(){if(!this._step||this._loading)return s.s6;switch(this._step.type){case"form":return s.qy` <ha-dialog-footer slot="footer"> <ha-button slot="primaryAction" .loading="${this._formStepLoading}" @click="${this._submitFormStep}"> ${this._params.flowConfig.renderShowFormStepSubmitButton(this.hass,this._step)} </ha-button> </ha-dialog-footer> `;case"abort":return"missing_credentials"===this._step.reason?s.s6:s.qy` <ha-dialog-footer slot="footer"> <ha-button slot="secondaryAction" appearance="plain" @click="${this._closeAbortStep}"> ${this.hass.localize("ui.panel.config.integrations.config_flow.close")} </ha-button> </ha-dialog-footer> `;case"external":return s.qy` <ha-dialog-footer slot="footer"> <ha-button slot="primaryAction" href="${this._step.url}" target="_blank" rel="noreferrer"> ${this.hass.localize("ui.panel.config.integrations.config_flow.external_step.open_site")} </ha-button> </ha-dialog-footer> `;case"create_entry":{const e=this._devices(this._params.flowConfig.showDevices,Object.values(this.hass.devices),this._step.result?.entry_id,this._params.carryOverDevices);return s.qy` <ha-dialog-footer slot="footer"> <ha-button slot="primaryAction" @click="${this._finishCreateEntryStep}"> ${this.hass.localize("ui.panel.config.integrations.config_flow."+(!e.length||this._createEntryHasPendingUpdates||e.some(e=>e.area_id)?"finish":"finish_skip"))} </ha-button> </ha-dialog-footer> `}default:return s.s6}}firstUpdated(e){super.firstUpdated(e),this.addEventListener("flow-update",e=>{const{step:t,stepPromise:i}=e.detail;this._processStep(t||i)})}willUpdate(e){super.willUpdate(e),e.has("_step")&&this._step&&["external","progress"].includes(this._step.type)&&this._subscribeDataEntryFlowProgressed()}async _processStep(e){if(void 0===e)return void this.closeDialog();const t=setTimeout(()=>{this._loading="loading_step"},250);let i;try{i=await e}catch(e){return this.closeDialog(),void(0,f.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.integrations.config_flow.error"),text:e?.body?.message})}finally{clearTimeout(t),this._loading=void 0}this._step=void 0,this._formStepLoading=!1,this._createEntryHasPendingUpdates=!1,await this.updateComplete,this._step=i,"create_entry"!==i.type&&"abort"!==i.type||!i.next_flow||(this._step=void 0,this._handler=void 0,this._unsubDataEntryFlowProgress&&(this._unsubDataEntryFlowProgress(),this._unsubDataEntryFlowProgress=void 0),"config_flow"===i.next_flow[0]?(0,_.W)(this,{continueFlowId:i.next_flow[1],carryOverDevices:this._devices(this._params.flowConfig.showDevices,Object.values(this.hass.devices),"create_entry"===i.type?i.result?.entry_id:void 0,this._params.carryOverDevices).map(e=>e.id),dialogClosedCallback:this._params.dialogClosedCallback}):"options_flow"===i.next_flow[0]?"create_entry"===i.type&&(0,v.Q)(this,i.result,{continueFlowId:i.next_flow[1],navigateToResult:this._params.navigateToResult,dialogClosedCallback:this._params.dialogClosedCallback}):"config_subentries_flow"===i.next_flow[0]?"create_entry"===i.type&&(0,b.a)(this,i.result,"",{continueFlowId:i.next_flow[1],navigateToResult:this._params.navigateToResult,dialogClosedCallback:this._params.dialogClosedCallback}):(this.closeDialog(),(0,f.showAlertDialog)(this,{text:this.hass.localize("ui.panel.config.integrations.config_flow.error",{error:`Unsupported next flow type: ${i.next_flow[0]}`})})))}async _subscribeDataEntryFlowProgressed(){if(this._unsubDataEntryFlowProgress)return;this._progress=void 0;const e=[(0,m.P)(this.hass.connection,e=>{e.data.flow_id===this._step?.flow_id&&(this._processStep(this._params.flowConfig.fetchFlow(this.hass,this._step.flow_id)),this._progress=void 0)}),(0,m.K)(this.hass.connection,e=>{this._progress=Math.ceil(100*e.data.progress)})];this._unsubDataEntryFlowProgress=async()=>{(await Promise.all(e)).map(e=>e())}}static get styles(){return[u.nA,s.AH`.dialog-title{overflow:hidden;text-overflow:ellipsis}.dialog-title.form{white-space:normal}.help{color:var(--secondary-text-color)}`]}constructor(...e){super(...e),this._instance=S,this._open=!1,this._formStepLoading=!1,this._createEntryHasPendingUpdates=!1,this._formStepRef=(0,n._)(),this._abortStepRef=(0,n._)(),this._createEntryStepRef=(0,n._)(),this._devices=(0,l.A)((e,t,i,a)=>e&&i?t.filter(e=>e.config_entries.includes(i)||a?.includes(e.id)):[]),this._focusFormStep=async()=>{"form"===this._step?.type&&this._open&&(await this.updateComplete,this._formStepRef.value?.focus())},this._handleFooterStateChanged=e=>{void 0!==e.detail.loading&&(this._formStepLoading=e.detail.loading),void 0!==e.detail.hasPendingUpdates&&(this._createEntryHasPendingUpdates=e.detail.hasPendingUpdates)},this._submitFormStep=()=>{this._formStepRef.value?.submit()},this._closeAbortStep=()=>{this._abortStepRef.value?.close()},this._finishCreateEntryStep=()=>{this._createEntryStepRef.value?.finish()}}}(0,o.Cg)([(0,r.MZ)({attribute:!1})],z.prototype,"hass",void 0),(0,o.Cg)([(0,r.wk)()],z.prototype,"_params",void 0),(0,o.Cg)([(0,r.wk)()],z.prototype,"_loading",void 0),(0,o.Cg)([(0,r.wk)()],z.prototype,"_progress",void 0),(0,o.Cg)([(0,r.wk)()],z.prototype,"_open",void 0),(0,o.Cg)([(0,r.wk)()],z.prototype,"_step",void 0),(0,o.Cg)([(0,r.wk)()],z.prototype,"_handler",void 0),(0,o.Cg)([(0,r.wk)()],z.prototype,"_formStepLoading",void 0),(0,o.Cg)([(0,r.wk)()],z.prototype,"_createEntryHasPendingUpdates",void 0),z=(0,o.Cg)([(0,r.EM)("dialog-data-entry-flow")],z),a()}catch(e){a(e)}})},77763(e,t,i){i.d(t,{W:()=>n});var a=i(5124),o=i(26571),s=i(95350),r=i(29094);const n=(e,t)=>(0,r.g)(e,t,{flowType:"config_flow",showDevices:!0,createFlow:async(e,i)=>{const[a]=await Promise.all([(0,o.t1)(e,i,t.entryId),e.loadFragmentTranslation("config"),e.loadBackendTranslation("config",i),e.loadBackendTranslation("selector",i),e.loadBackendTranslation("title",i)]);return a},fetchFlow:async(e,t)=>{const[i]=await Promise.all([(0,o.PN)(e,t),e.loadFragmentTranslation("config")]);return await Promise.all([e.loadBackendTranslation("config",i.handler),e.loadBackendTranslation("selector",i.handler),e.loadBackendTranslation("title",i.handler)]),i},handleFlowStep:o.jm,deleteFlow:o.sR,renderAbortDescription(e,t){const i=e.localize(`component.${t.translation_domain||t.handler}.config.abort.${t.reason}`,t.description_placeholders);return i?a.qy` <ha-markdown allow-svg breaks .content="${i}"></ha-markdown> `:t.reason},renderShowFormStepHeader:(e,t)=>e.localize(`component.${t.translation_domain||t.handler}.config.step.${t.step_id}.title`,t.description_placeholders)||e.localize(`component.${t.handler}.title`),renderShowFormStepDescription(e,t){const i=e.localize(`component.${t.translation_domain||t.handler}.config.step.${t.step_id}.description`,t.description_placeholders);return i?a.qy` <ha-markdown .allowDataUrl="${"zwave_js"===t.handler}" allow-svg breaks .content="${i}"></ha-markdown> `:""},renderShowFormStepFieldLabel(e,t,i,a){if("expandable"===i.type)return e.localize(`component.${t.handler}.config.step.${t.step_id}.sections.${i.name}.name`,t.description_placeholders)||i.name;const o=a?.path?.[0]?`sections.${a.path[0]}.`:"";return e.localize(`component.${t.handler}.config.step.${t.step_id}.${o}data.${i.name}`,t.description_placeholders)||i.name},renderShowFormStepFieldHelper(e,t,i,o){if("expandable"===i.type)return e.localize(`component.${t.translation_domain||t.handler}.config.step.${t.step_id}.sections.${i.name}.description`,t.description_placeholders);const s=o?.path?.[0]?`sections.${o.path[0]}.`:"",r=e.localize(`component.${t.translation_domain||t.handler}.config.step.${t.step_id}.${s}data_description.${i.name}`,t.description_placeholders);return r?a.qy`<ha-markdown breaks .content="${r}"></ha-markdown>`:""},renderShowFormStepFieldError:(e,t,i)=>e.localize(`component.${t.translation_domain||t.translation_domain||t.handler}.config.error.${i}`,t.description_placeholders)||i,renderShowFormStepFieldLocalizeValue:(e,t,i)=>e.localize(`component.${t.handler}.selector.${i}`),renderShowFormStepSubmitButton:(e,t)=>e.localize(`component.${t.handler}.config.step.${t.step_id}.submit`)||e.localize("ui.panel.config.integrations.config_flow."+(!1===t.last_step?"next":"submit")),renderExternalStepHeader:(e,t)=>e.localize(`component.${t.handler}.config.step.${t.step_id}.title`)||e.localize("ui.panel.config.integrations.config_flow.external_step.open_site"),renderExternalStepDescription(e,t){const i=e.localize(`component.${t.translation_domain||t.handler}.config.${t.step_id}.description`,t.description_placeholders);return a.qy` <p> ${e.localize("ui.panel.config.integrations.config_flow.external_step.description")} </p> ${i?a.qy` <ha-markdown allow-svg breaks .content="${i}"></ha-markdown> `:""} `},renderCreateEntryDescription(e,t){const i=e.localize(`component.${t.translation_domain||t.handler}.config.create_entry.${t.description||"default"}`,t.description_placeholders);return a.qy` ${i?a.qy` <ha-markdown allow-svg breaks .content="${i}"></ha-markdown> `:a.s6} `},renderShowFormProgressHeader:(e,t)=>e.localize(`component.${t.handler}.config.step.${t.step_id}.title`)||e.localize(`component.${t.handler}.title`),renderShowFormProgressDescription(e,t){const i=e.localize(`component.${t.translation_domain||t.handler}.config.progress.${t.progress_action}`,t.description_placeholders);return i?a.qy` <ha-markdown allow-svg breaks .content="${i}"></ha-markdown> `:""},renderMenuHeader:(e,t)=>e.localize(`component.${t.handler}.config.step.${t.step_id}.title`)||e.localize(`component.${t.handler}.title`),renderMenuDescription(e,t){const i=e.localize(`component.${t.translation_domain||t.handler}.config.step.${t.step_id}.description`,t.description_placeholders);return i?a.qy` <ha-markdown allow-svg breaks .content="${i}"></ha-markdown> `:""},renderMenuOption:(e,t,i)=>e.localize(`component.${t.translation_domain||t.handler}.config.step.${t.step_id}.menu_options.${i}`,t.description_placeholders),renderMenuOptionDescription:(e,t,i)=>e.localize(`component.${t.translation_domain||t.handler}.config.step.${t.step_id}.menu_option_descriptions.${i}`,t.description_placeholders),renderLoadingDescription(e,t,i,a){if("loading_flow"!==t&&"loading_step"!==t)return"";const o=a?.handler||i;return e.localize(`ui.panel.config.integrations.config_flow.loading.${t}`,{integration:o?(0,s.p$)(e.localize,o):e.localize("ui.panel.config.integrations.config_flow.loading.fallback_title")})}})},70241(e,t,i){i.d(t,{Q:()=>n});var a=i(5124),o=i(95350),s=i(7749),r=i(29094);const n=(e,t,i)=>(0,r.g)(e,{startFlowHandler:t.entry_id,domain:t.domain,...i},{flowType:"options_flow",showDevices:!1,createFlow:async(e,i)=>{const[a]=await Promise.all([(0,s.HH)(e,i),e.loadFragmentTranslation("config"),e.loadBackendTranslation("options",t.domain),e.loadBackendTranslation("selector",t.domain)]);return a},fetchFlow:async(e,i)=>{const[a]=await Promise.all([(0,s.TY)(e,i),e.loadFragmentTranslation("config"),e.loadBackendTranslation("options",t.domain),e.loadBackendTranslation("selector",t.domain)]);return a},handleFlowStep:s.lu,deleteFlow:s.mu,renderAbortDescription(e,i){const o=e.localize(`component.${i.translation_domain||t.domain}.options.abort.${i.reason}`,i.description_placeholders);return o?a.qy` <ha-markdown breaks allow-svg .content="${o}"></ha-markdown> `:i.reason},renderShowFormStepHeader:(e,i)=>e.localize(`component.${i.translation_domain||t.domain}.options.step.${i.step_id}.title`,i.description_placeholders)||e.localize("ui.dialogs.options_flow.form.header"),renderShowFormStepDescription(e,i){const o=e.localize(`component.${i.translation_domain||t.domain}.options.step.${i.step_id}.description`,i.description_placeholders);return o?a.qy` <ha-markdown allow-svg breaks .content="${o}"></ha-markdown> `:""},renderShowFormStepFieldLabel(e,i,a,o){if("expandable"===a.type)return e.localize(`component.${t.domain}.options.step.${i.step_id}.sections.${a.name}.name`,i.description_placeholders)||a.name;const s=o?.path?.[0]?`sections.${o.path[0]}.`:"";return e.localize(`component.${t.domain}.options.step.${i.step_id}.${s}data.${a.name}`,i.description_placeholders)||a.name},renderShowFormStepFieldHelper(e,i,o,s){if("expandable"===o.type)return e.localize(`component.${i.translation_domain||t.domain}.options.step.${i.step_id}.sections.${o.name}.description`,i.description_placeholders);const r=s?.path?.[0]?`sections.${s.path[0]}.`:"",n=e.localize(`component.${i.translation_domain||t.domain}.options.step.${i.step_id}.${r}data_description.${o.name}`,i.description_placeholders);return n?a.qy`<ha-markdown breaks .content="${n}"></ha-markdown>`:""},renderShowFormStepFieldError:(e,i,a)=>e.localize(`component.${i.translation_domain||t.domain}.options.error.${a}`,i.description_placeholders)||a,renderShowFormStepFieldLocalizeValue:(e,i,a)=>e.localize(`component.${t.domain}.selector.${a}`),renderShowFormStepSubmitButton:(e,i)=>e.localize(`component.${t.domain}.options.step.${i.step_id}.submit`)||e.localize("ui.panel.config.integrations.config_flow."+(!1===i.last_step?"next":"submit")),renderExternalStepHeader:(e,t)=>"",renderExternalStepDescription:(e,t)=>"",renderCreateEntryDescription:(e,t)=>a.qy` <p>${e.localize("ui.dialogs.options_flow.success.description")}</p> `,renderShowFormProgressHeader:(e,i)=>e.localize(`component.${t.domain}.options.step.${i.step_id}.title`)||e.localize(`component.${t.domain}.title`),renderShowFormProgressDescription(e,i){const o=e.localize(`component.${i.translation_domain||t.domain}.options.progress.${i.progress_action}`,i.description_placeholders);return o?a.qy` <ha-markdown allow-svg breaks .content="${o}"></ha-markdown> `:""},renderMenuHeader:(e,i)=>e.localize(`component.${t.domain}.options.step.${i.step_id}.title`)||e.localize(`component.${t.domain}.title`),renderMenuDescription(e,i){const o=e.localize(`component.${i.translation_domain||t.domain}.options.step.${i.step_id}.description`,i.description_placeholders);return o?a.qy` <ha-markdown allow-svg breaks .content="${o}"></ha-markdown> `:""},renderMenuOption:(e,i,a)=>e.localize(`component.${i.translation_domain||t.domain}.options.step.${i.step_id}.menu_options.${a}`,i.description_placeholders),renderMenuOptionDescription:(e,i,a)=>e.localize(`component.${i.translation_domain||t.domain}.options.step.${i.step_id}.menu_option_descriptions.${a}`,i.description_placeholders),renderLoadingDescription:(e,i)=>e.localize(`component.${t.domain}.options.loading`)||("loading_flow"===i||"loading_step"===i?e.localize(`ui.dialogs.options_flow.loading.${i}`,{integration:(0,o.p$)(e.localize,t.domain)}):"")})},26401(e,t,i){i.d(t,{a:()=>c});var a=i(5124),o=i(95350);const s={"HA-Frontend-Base":`${location.protocol}//${location.host}`},r=(e,t,i,a)=>e.callApi("POST","config/config_entries/subentries/flow",{handler:[t,i],subentry_id:a},s),n=(e,t,i)=>e.callApi("POST",`config/config_entries/subentries/flow/${t}`,i,s),l=(e,t)=>e.callApi("DELETE",`config/config_entries/subentries/flow/${t}`);var d=i(29094);const c=(e,t,i,c)=>(0,d.g)(e,c,{flowType:"config_subentries_flow",showDevices:!0,createFlow:async(e,a)=>{const[o]=await Promise.all([r(e,a,i,c.subEntryId),e.loadFragmentTranslation("config"),e.loadBackendTranslation("config_subentries",t.domain),e.loadBackendTranslation("selector",t.domain),e.loadBackendTranslation("title",t.domain)]);return o},fetchFlow:async(e,a)=>{const o=await((e,t)=>e.callApi("GET",`config/config_entries/subentries/flow/${t}`,void 0,s))(e,a);return i=o.handler[1],await e.loadFragmentTranslation("config"),await e.loadBackendTranslation("config_subentries",t.domain),await e.loadBackendTranslation("selector",t.domain),o},handleFlowStep:n,deleteFlow:l,renderAbortDescription(e,o){const s=e.localize(`component.${o.translation_domain||t.domain}.config_subentries.${i}.abort.${o.reason}`,o.description_placeholders);return s?a.qy` <ha-markdown allowsvg breaks .content="${s}"></ha-markdown> `:o.reason},renderShowFormStepHeader:(e,a)=>e.localize(`component.${a.translation_domain||t.domain}.config_subentries.${i}.step.${a.step_id}.title`,a.description_placeholders)||e.localize(`component.${t.domain}.title`),renderShowFormStepDescription(e,o){const s=e.localize(`component.${o.translation_domain||t.domain}.config_subentries.${i}.step.${o.step_id}.description`,o.description_placeholders);return s?a.qy` <ha-markdown allowsvg breaks .content="${s}"></ha-markdown> `:""},renderShowFormStepFieldLabel(e,a,o,s){if("expandable"===o.type)return e.localize(`component.${t.domain}.config_subentries.${i}.step.${a.step_id}.sections.${o.name}.name`,a.description_placeholders)||o.name;const r=s?.path?.[0]?`sections.${s.path[0]}.`:"";return e.localize(`component.${t.domain}.config_subentries.${i}.step.${a.step_id}.${r}data.${o.name}`,a.description_placeholders)||o.name},renderShowFormStepFieldHelper(e,o,s,r){if("expandable"===s.type)return e.localize(`component.${o.translation_domain||t.domain}.config_subentries.${i}.step.${o.step_id}.sections.${s.name}.description`,o.description_placeholders);const n=r?.path?.[0]?`sections.${r.path[0]}.`:"",l=e.localize(`component.${o.translation_domain||t.domain}.config_subentries.${i}.step.${o.step_id}.${n}data_description.${s.name}`,o.description_placeholders);return l?a.qy`<ha-markdown breaks .content="${l}"></ha-markdown>`:""},renderShowFormStepFieldError:(e,a,o)=>e.localize(`component.${a.translation_domain||a.translation_domain||t.domain}.config_subentries.${i}.error.${o}`,a.description_placeholders)||o,renderShowFormStepFieldLocalizeValue:(e,i,a)=>e.localize(`component.${t.domain}.selector.${a}`),renderShowFormStepSubmitButton:(e,a)=>e.localize(`component.${t.domain}.config_subentries.${i}.step.${a.step_id}.submit`)||e.localize("ui.panel.config.integrations.config_flow."+(!1===a.last_step?"next":"submit")),renderExternalStepHeader:(e,a)=>e.localize(`component.${t.domain}.config_subentries.${i}.step.${a.step_id}.title`)||e.localize("ui.panel.config.integrations.config_flow.external_step.open_site"),renderExternalStepDescription(e,o){const s=e.localize(`component.${o.translation_domain||t.domain}.config_subentries.${i}.step.${o.step_id}.description`,o.description_placeholders);return a.qy` <p> ${e.localize("ui.panel.config.integrations.config_flow.external_step.description")} </p> ${s?a.qy` <ha-markdown allowsvg breaks .content="${s}"></ha-markdown> `:""} `},renderCreateEntryDescription(e,o){const s=e.localize(`component.${o.translation_domain||t.domain}.config_subentries.${i}.create_entry.${o.description||"default"}`,o.description_placeholders);return a.qy` ${s?a.qy` <ha-markdown allowsvg breaks .content="${s}"></ha-markdown> `:a.s6} `},renderShowFormProgressHeader:(e,a)=>e.localize(`component.${t.domain}.config_subentries.${i}.step.${a.step_id}.title`)||e.localize(`component.${t.domain}.title`),renderShowFormProgressDescription(e,o){const s=e.localize(`component.${o.translation_domain||t.domain}.config_subentries.${i}.progress.${o.progress_action}`,o.description_placeholders);return s?a.qy` <ha-markdown allowsvg breaks .content="${s}"></ha-markdown> `:""},renderMenuHeader:(e,a)=>e.localize(`component.${t.domain}.config_subentries.${i}.step.${a.step_id}.title`,a.description_placeholders)||e.localize(`component.${t.domain}.title`),renderMenuDescription(e,o){const s=e.localize(`component.${o.translation_domain||t.domain}.config_subentries.${i}.step.${o.step_id}.description`,o.description_placeholders);return s?a.qy` <ha-markdown allowsvg breaks .content="${s}"></ha-markdown> `:""},renderMenuOption:(e,a,o)=>e.localize(`component.${a.translation_domain||t.domain}.config_subentries.${i}.step.${a.step_id}.menu_options.${o}`,a.description_placeholders),renderMenuOptionDescription:(e,a,o)=>e.localize(`component.${a.translation_domain||t.domain}.config_subentries.${i}.step.${a.step_id}.menu_option_descriptions.${o}`,a.description_placeholders),renderLoadingDescription(e,t,i,a){if("loading_flow"!==t&&"loading_step"!==t)return"";const s=a?.handler||i;return e.localize(`ui.panel.config.integrations.config_flow.loading.${t}`,{integration:s?(0,o.p$)(e.localize,s):e.localize("ui.panel.config.integrations.config_flow.loading.fallback_title")})}})},34753(e,t,i){var a=i(62826),o=i(5124),s=i(22441),r=i(1087),n=i(41617),l=i(77763),d=i(83358);class c extends o.WF{firstUpdated(e){super.firstUpdated(e),"missing_credentials"===this.step.reason&&this._handleMissingCreds()}render(){return"missing_credentials"===this.step.reason?o.s6:o.qy` <div class="content"> ${this.params.flowConfig.renderAbortDescription(this.hass,this.step)} </div> `}async _handleMissingCreds(){(0,n.a)(this.params.dialogParentElement,{selectedDomain:this.domain,manifest:this.params.manifest,applicationCredentialAddedCallback:()=>{(0,l.W)(this.params.dialogParentElement,{dialogClosedCallback:this.params.dialogClosedCallback,startFlowHandler:this.handler,navigateToResult:this.params.navigateToResult})}}),this._flowDone()}_flowDone(){(0,r.r)(this,"flow-update",{step:void 0})}close(){this._flowDone()}static get styles(){return d.G}}(0,a.Cg)([(0,s.MZ)({attribute:!1})],c.prototype,"params",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],c.prototype,"hass",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],c.prototype,"step",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],c.prototype,"domain",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],c.prototype,"handler",void 0),c=(0,a.Cg)([(0,s.EM)("step-flow-abort")],c)},45634(e,t,i){i.a(e,async function(e,t){try{i(74423),i(44114),i(18111),i(22489),i(7588),i(61701),i(13579);var a=i(62826),o=i(5124),s=i(22441),r=i(22786),n=i(1087),l=i(37981),d=i(71727),c=i(91926),h=i(66086),p=i(91485),m=i(62351),u=i(77423),g=i(58594),f=i(59241),_=i(95350),v=i(44144),b=i(65063),y=i(81023),w=i(83358),$=e([h,p]);[h,p]=$.then?(await $)():$;class C extends o.WF{firstUpdated(e){super.firstUpdated(e),this._loadDomains()}willUpdate(e){if(!e.has("devices")&&!e.has("hass"))return;if(1!==this.devices.length||this.devices[0].primary_config_entry!==this.step.result?.entry_id||"voip"===this.step.result.domain)return;const t=this._deviceEntities(this.devices[0].id,Object.values(this.hass.entities),"assist_satellite");t.length&&t.some(e=>(0,m.KC)(this.hass.states[e.entity_id]))&&(this.navigateToResult=!1,this._flowDone(),(0,y.L)(this,{deviceId:this.devices[0].id}))}render(){const e=this.hass.localize,t=this.step.result?{...this._domains,[this.step.result.entry_id]:this.step.result.domain}:this._domains;return o.qy` <div class="content"> ${this.flowConfig.renderCreateEntryDescription(this.hass,this.step)} ${"not_loaded"===this.step.result?.state?o.qy`<span class="error">${e("ui.panel.config.integrations.config_flow.not_loaded")}</span>`:o.s6} ${0===this.devices.length&&["options_flow","repair_flow"].includes(this.flowConfig.flowType)?o.s6:0===this.devices.length?o.qy`<p> ${e("ui.panel.config.integrations.config_flow.created_config",{name:this.step.title})} </p>`:o.qy` <div class="devices"> ${this.devices.map(i=>o.qy` <div class="device"> <div class="device-info"> ${i.primary_config_entry&&t[i.primary_config_entry]?o.qy`<img slot="graphic" alt="${(0,_.p$)(this.hass.localize,t[i.primary_config_entry])}" src="${(0,v.MR)({domain:t[i.primary_config_entry],type:"icon",darkOptimized:this.hass.themes?.darkMode},this.hass.auth.data.hassUrl)}" crossorigin="anonymous" referrerpolicy="no-referrer">`:o.s6} <div class="device-info-details"> <span>${i.model||i.manufacturer}</span> ${i.model?o.qy`<span class="secondary"> ${i.manufacturer} </span>`:o.s6} </div> </div> <ha-input .label="${e("ui.panel.config.integrations.config_flow.device_name")}" .placeholder="${(0,l.T)(i,this.hass.localize,this.hass.states)}" .value="${this._deviceUpdate[i.id]?.name??(0,l.xn)(i)}" @change="${this._deviceNameChanged}" .device="${i.id}"></ha-input> <ha-area-picker .hass="${this.hass}" .device="${i.id}" .value="${this._deviceUpdate[i.id]?.area??i.area_id??void 0}" @value-changed="${this._areaPicked}"></ha-area-picker> </div> `)} </div> `} </div> `}updated(e){super.updated(e),e.has("_deviceUpdate")&&(0,n.r)(this,"flow-step-footer-state-changed",{hasPendingUpdates:Object.keys(this._deviceUpdate).length>0})}async _loadDomains(){const e=await(0,u.VN)(this.hass);this._domains=Object.fromEntries(e.map(e=>[e.entry_id,e.domain]))}async _flowDone(){if(Object.keys(this._deviceUpdate).length){const e=[],t=Object.entries(this._deviceUpdate).map(([t,i])=>(i.name&&e.push(t),(0,g.FB)(this.hass,t,{name_by_user:i.name,area_id:i.area}).catch(e=>{const t=e instanceof Error?e.message:"Unknown error";(0,b.showAlertDialog)(this,{text:this.hass.localize("ui.panel.config.integrations.config_flow.error_saving_device",{error:t})})})));await Promise.allSettled(t);const i=[],a=[];e.forEach(e=>{const t=this._deviceEntities(e,Object.values(this.hass.entities));a.push(...t.map(e=>e.entity_id))});const o=await(0,f.BM)(this.hass,a);Object.entries(o).forEach(([e,t])=>{t&&i.push((0,f.G_)(this.hass,e,{new_entity_id:t}).catch(e=>(0,b.showAlertDialog)(this,{text:this.hass.localize("ui.panel.config.integrations.config_flow.error_saving_entity",{error:e.message})})))}),await Promise.allSettled(i)}(0,n.r)(this,"flow-update",{step:void 0}),this.step.result&&this.navigateToResult&&(1===this.devices.length?(0,c.oo)(`/config/devices/device/${this.devices[0].id}`):(0,c.oo)(`/config/integrations/integration/${this.step.result.domain}#config_entry=${this.step.result.entry_id}`))}finish(){return this._flowDone()}async _areaPicked(e){const t=e.currentTarget;if(!t)return;const i=t.device,a=e.detail.value;i in this._deviceUpdate||(this._deviceUpdate[i]={}),this._deviceUpdate[i].area=a,this.requestUpdate("_deviceUpdate")}_deviceNameChanged(e){const t=e.currentTarget;if(!t)return;const i=t.device,a=t.value;i in this._deviceUpdate||(this._deviceUpdate[i]={}),this._deviceUpdate[i].name=a,this.requestUpdate("_deviceUpdate")}static get styles(){return[w.G,o.AH`.devices{display:flex;gap:var(--ha-space-2);flex-direction:column}.device{border:1px solid var(--divider-color);padding:6px;border-radius:var(--ha-border-radius-sm);display:inline-block}.device-info{display:flex;align-items:center;gap:var(--ha-space-2)}.device-info img{width:40px;height:40px}.device-info-details{display:flex;flex-direction:column;justify-content:center}.secondary{color:var(--secondary-text-color)}ha-area-picker{display:block}ha-input{margin:var(--ha-space-2) 0}.error{color:var(--error-color)}`]}constructor(...e){super(...e),this._domains={},this.navigateToResult=!1,this._deviceUpdate={},this._deviceEntities=(0,r.A)((e,t,i)=>t.filter(t=>t.device_id===e&&(!i||(0,d.m)(t.entity_id)===i)))}}(0,a.Cg)([(0,s.MZ)({attribute:!1})],C.prototype,"flowConfig",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],C.prototype,"hass",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],C.prototype,"step",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],C.prototype,"devices",void 0),(0,a.Cg)([(0,s.wk)()],C.prototype,"_deviceUpdate",void 0),C=(0,a.Cg)([(0,s.EM)("step-flow-create-entry")],C),t()}catch(e){t(e)}})},52140(e,t,i){var a=i(62826),o=i(5124),s=i(22441),r=i(83358);class n extends o.WF{render(){return o.qy` <div class="content"> ${this.flowConfig.renderExternalStepDescription(this.hass,this.step)} </div> `}firstUpdated(e){super.firstUpdated(e),window.open(this.step.url)}static get styles(){return[r.G]}}(0,a.Cg)([(0,s.MZ)({attribute:!1})],n.prototype,"flowConfig",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],n.prototype,"hass",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],n.prototype,"step",void 0),n=(0,a.Cg)([(0,s.EM)("step-flow-external")],n)},57473(e,t,i){i.a(e,async function(e,t){try{i(74423),i(18111),i(81148),i(20116),i(7588),i(61701);var a=i(62826),o=i(5124),s=i(22441),r=i(59455),n=i(22786),l=i(69558),d=i(1087),c=i(76830),h=i(38962),p=i(50043),m=i(52763),u=(i(3587),i(65829)),g=i(82e3),f=i(51840),_=i(14503),v=i(83358),b=e([h,m,u]);[h,m,u]=b.then?(await b)():b;class y extends o.WF{disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",this._handleKeyDown)}render(){const e=this.step,t=this._stepDataProcessed;return o.qy` <div class="content" @click="${this._clickHandler}"> ${this.flowConfig.renderShowFormStepDescription(this.hass,this.step)} ${this._errorMsg?o.qy`<ha-alert alert-type="error">${this._errorMsg}</ha-alert>`:o.s6} ${e.data_schema.length?o.qy`<ha-form ${(0,r.K)(this._formRef)} ?autofocus="${this.autoFocus}" .hass="${this.hass}" .narrow="${this.narrow}" .data="${t}" .disabled="${this._loading}" @value-changed="${this._stepDataChanged}" .schema="${(0,g.Hg)(this.handleReadOnlyFields(e.data_schema))}" .error="${this._errors}" .computeLabel="${this._labelCallback}" .computeHelper="${this._helperCallback}" .computeError="${this._errorCallback}" .localizeValue="${this._localizeValueCallback}" .context="${{handler:e.handler}}"></ha-form>`:o.s6} </div> ${e.preview?o.qy`<div class="preview" @set-flow-errors="${this._setError}"> <h3> ${this.hass.localize("ui.panel.config.integrations.config_flow.preview")}: </h3> ${(0,l._)(`flow-preview-${(0,f.F)(e.preview)}`,{hass:this.hass,domain:e.preview,flowType:this.flowConfig.flowType,handler:e.handler,stepId:e.step_id,flowId:e.flow_id,stepData:t})} </div>`:o.s6} `}_setError(e){this._previewErrors=e.detail}firstUpdated(e){super.firstUpdated(e),this.addEventListener("keydown",this._handleKeyDown)}updated(e){super.updated(e),e.has("_loading")&&(0,d.r)(this,"flow-step-footer-state-changed",{loading:this._loading})}focus(e){this._formRef.value?.focus()}willUpdate(e){super.willUpdate(e),e.has("step")&&this.step?.preview&&i(86174)(`./flow-preview-${(0,f.F)(this.step.preview)}`),(e.has("step")||e.has("_previewErrors")||e.has("_submitErrors"))&&(this._errors=this.step.errors||this._previewErrors||this._submitErrors?{...this.step.errors,...this._previewErrors,...this._submitErrors}:void 0)}_clickHandler(e){(0,c.d)(e,!1)&&(0,d.r)(this,"flow-update",{step:void 0})}get _stepDataProcessed(){return void 0!==this._stepData||(this._stepData=(0,p.$)(this.step.data_schema)),this._stepData}async _submitStep(){const e=this._stepData||{},t=(e,i)=>e.every(e=>(!e.required||!["",void 0].includes(i[e.name]))&&("expandable"!==e.type||!e.required&&void 0===i[e.name]||t(e.schema,i[e.name])));if(!(void 0===e?void 0===this.step.data_schema.find(e=>e.required):t(this.step.data_schema,e)))return void(this._errorMsg=this.hass.localize("ui.panel.config.integrations.config_flow.not_all_required_fields"));this._loading=!0,this._errorMsg=void 0,this._submitErrors=void 0;const i=this.step.flow_id,a={};Object.keys(e).forEach(t=>{const i=e[t],o=[void 0,""].includes(i),s=this.step.data_schema?.find(e=>e.name===t),r=s?.selector??{},n=Object.values(r)[0]?.read_only;o||n||(a[t]=i)});try{const e=await this.flowConfig.handleFlowStep(this.hass,this.step.flow_id,a);if(!this.step||i!==this.step.flow_id)return;this._previewErrors=void 0,(0,d.r)(this,"flow-update",{step:e})}catch(e){e&&e.body?(e.body.message&&(this._errorMsg=e.body.message),e.body.errors&&(this._submitErrors=e.body.errors),e.body.message||e.body.errors||(this._errorMsg="Unknown error occurred")):this._errorMsg="Unknown error occurred"}finally{this._loading=!1}}submit(){return this._submitStep()}_stepDataChanged(e){this._stepData=e.detail.value}static get styles(){return[_.RF,v.G,o.AH`.error{color:red}ha-alert,ha-form{margin-top:var(--ha-space-6);display:block}`]}constructor(...e){super(...e),this.narrow=!1,this.autoFocus=!1,this._loading=!1,this._formRef=(0,r._)(),this.handleReadOnlyFields=(0,n.A)(e=>{function t(e){return{...e,...Object.values(e?.selector??{})[0]?.read_only?{disabled:!0}:{}}}return e?.map(e=>"expandable"===e.type&&e.schema?{...e,schema:e.schema.map(e=>t(e))}:t(e))}),this._handleKeyDown=e=>{"Enter"===e.key&&this._submitStep()},this._labelCallback=(e,t,i)=>this.flowConfig.renderShowFormStepFieldLabel(this.hass,this.step,e,i),this._helperCallback=(e,t)=>this.flowConfig.renderShowFormStepFieldHelper(this.hass,this.step,e,t),this._errorCallback=e=>this.flowConfig.renderShowFormStepFieldError(this.hass,this.step,e),this._localizeValueCallback=e=>this.flowConfig.renderShowFormStepFieldLocalizeValue(this.hass,this.step,e)}}y.shadowRootOptions={...o.WF.shadowRootOptions,delegatesFocus:!0},(0,a.Cg)([(0,s.MZ)({attribute:!1})],y.prototype,"flowConfig",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean})],y.prototype,"narrow",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean,attribute:"autofocus"})],y.prototype,"autoFocus",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],y.prototype,"step",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],y.prototype,"hass",void 0),(0,a.Cg)([(0,s.wk)()],y.prototype,"_loading",void 0),(0,a.Cg)([(0,s.wk)()],y.prototype,"_stepData",void 0),(0,a.Cg)([(0,s.wk)()],y.prototype,"_previewErrors",void 0),(0,a.Cg)([(0,s.wk)()],y.prototype,"_submitErrors",void 0),(0,a.Cg)([(0,s.wk)()],y.prototype,"_errorMsg",void 0),y=(0,a.Cg)([(0,s.EM)("step-flow-form")],y),t()}catch(e){t(e)}})},38387(e,t,i){i.a(e,async function(e,t){try{var a=i(62826),o=i(5124),s=i(22441),r=i(65829),n=e([r]);r=(n.then?(await n)():n)[0];class l extends o.WF{render(){const e=this.flowConfig.renderLoadingDescription(this.hass,this.loadingReason,this.handler,this.step);return o.qy` <div class="content"> <ha-spinner size="large"></ha-spinner> ${e?o.qy`<div>${e}</div>`:o.s6} </div> `}}l.styles=o.AH`.content{margin-top:0;padding:50px 100px;text-align:center}ha-spinner{margin-bottom:var(--ha-space-4)}`,(0,a.Cg)([(0,s.MZ)({attribute:!1})],l.prototype,"flowConfig",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],l.prototype,"hass",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],l.prototype,"loadingReason",void 0),(0,a.Cg)([(0,s.MZ)()],l.prototype,"handler",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],l.prototype,"step",void 0),l=(0,a.Cg)([(0,s.EM)("step-flow-loading")],l),t()}catch(e){t(e)}})},11584(e,t,i){i(18111),i(61701);var a=i(62826),o=i(5124),s=i(22441),r=i(1087),n=(i(43661),i(28732),i(83358)),l=i(52220);class d extends o.WF{shouldUpdate(e){return e.size>1||!e.has("hass")||this.hass.localize!==e.get("hass")?.localize}render(){let e,t,i={};if(Array.isArray(this.step.menu_options)){e=this.step.menu_options,t={};for(const a of e)t[a]=this.flowConfig.renderMenuOption(this.hass,this.step,a),i[a]=this.flowConfig.renderMenuOptionDescription(this.hass,this.step,a)}else e=Object.keys(this.step.menu_options),t=this.step.menu_options,i=Object.fromEntries(e.map(e=>[e,this.flowConfig.renderMenuOptionDescription(this.hass,this.step,e)]));this.step.sort&&(e=e.sort((e,i)=>(0,l.xL)(t[e],t[i],this.hass.locale.language)));const a=this.flowConfig.renderMenuDescription(this.hass,this.step);return o.qy` ${a?o.qy`<div class="content">${a}</div>`:o.s6} <div class="options"> ${e.map(e=>o.qy` <ha-list-item hasMeta .step="${e}" @click="${this._handleStep}" ?twoline="${i[e]}" ?multiline-secondary="${i[e]}"> <span>${t[e]}</span> ${i[e]?o.qy`<span slot="secondary"> ${i[e]} </span>`:o.s6} <ha-icon-next slot="meta"></ha-icon-next> </ha-list-item> `)} </div> `}_handleStep(e){(0,r.r)(this,"flow-update",{stepPromise:this.flowConfig.handleFlowStep(this.hass,this.step.flow_id,{next_step_id:e.currentTarget.step})})}}d.styles=[n.G,o.AH`.options{margin-top:var(--ha-space-5);margin-bottom:var(--ha-space-4)}.content{padding-bottom:var(--ha-space-4)}.content+.options{margin-top:var(--ha-space-2)}ha-list-item{--mdc-list-side-padding:var(--ha-space-6)}`],(0,a.Cg)([(0,s.MZ)({attribute:!1})],d.prototype,"flowConfig",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],d.prototype,"hass",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],d.prototype,"step",void 0),d=(0,a.Cg)([(0,s.EM)("step-flow-menu")],d)},39619(e,t,i){i.a(e,async function(e,t){try{var a=i(62826),o=i(5124),s=i(22441),r=i(67258),n=i(65829),l=i(16386),d=i(83358),c=e([n,l]);[n,l]=c.then?(await c)():c;class h extends o.WF{render(){return o.qy` <div class="content"> ${this.progress?o.qy` <ha-progress-ring .value="${this.progress}" size="large">${this.progress}${(0,r.d)(this.hass.locale)}%</ha-progress-ring> `:o.qy`<ha-spinner size="large"></ha-spinner>`} ${this.flowConfig.renderShowFormProgressDescription(this.hass,this.step)} </div> `}static get styles(){return[d.G,o.AH`.content{margin-top:0;padding:50px 100px;text-align:center}ha-spinner{margin-bottom:var(--ha-space-4)}`]}}(0,a.Cg)([(0,s.MZ)({attribute:!1})],h.prototype,"flowConfig",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],h.prototype,"hass",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],h.prototype,"step",void 0),(0,a.Cg)([(0,s.MZ)({type:Number})],h.prototype,"progress",void 0),h=(0,a.Cg)([(0,s.EM)("step-flow-progress")],h),t()}catch(e){t(e)}})},83358(e,t,i){i.d(t,{G:()=>a});const a=i(5124).AH`h2{margin:var(--ha-space-6) var(--ha-space-10) 0 0;margin-inline-start:0px;margin-inline-end:var(--ha-space-10);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);-webkit-font-smoothing:var(--ha-font-smoothing);font-family:var(
--mdc-typography-headline6-font-family,
var(--mdc-typography-font-family, var(--ha-font-family-body))
);font-size:var(--mdc-typography-headline6-font-size, var(--ha-font-size-l));line-height:var(--mdc-typography-headline6-line-height, 2rem);font-weight:var(--mdc-typography-headline6-font-weight,var(--ha-font-weight-medium));letter-spacing:var(--mdc-typography-headline6-letter-spacing, .0125em);text-decoration:var(--mdc-typography-headline6-text-decoration,inherit);text-transform:var(--mdc-typography-headline6-text-transform,inherit);box-sizing:border-box}.content,.preview{margin-top:var(--ha-space-5)}ha-markdown{overflow-wrap:break-word}ha-markdown a{color:var(--primary-color)}ha-markdown img:first-child:last-child{display:block;margin:0 auto}`},81023(e,t,i){i.d(t,{L:()=>s});var a=i(1087);const o=()=>Promise.all([i.e(92769),i.e(34995),i.e(3283),i.e(81034),i.e(27964),i.e(51455),i.e(26737),i.e(26092),i.e(8851),i.e(55076),i.e(92363),i.e(72091)]).then(i.bind(i,85027)),s=(e,t)=>{(0,a.r)(e,"show-dialog",{dialogTag:"ha-voice-assistant-setup-dialog",dialogImport:o,dialogParams:t})}},17894(e,t,i){i.d(t,{c:()=>s});var a=i(62826),o=i(22441);const s=e=>{class t extends e{constructor(...e){super(...e),this.disabled=!1,this.required=!1,this.unknown=!1,this.hideClearIcon=!1}}return(0,a.Cg)([(0,o.MZ)({type:Boolean})],t.prototype,"disabled",void 0),(0,a.Cg)([(0,o.MZ)({type:Boolean})],t.prototype,"required",void 0),(0,a.Cg)([(0,o.MZ)()],t.prototype,"icon",void 0),(0,a.Cg)([(0,o.MZ)()],t.prototype,"image",void 0),(0,a.Cg)([(0,o.MZ)()],t.prototype,"label",void 0),(0,a.Cg)([(0,o.MZ)()],t.prototype,"placeholder",void 0),(0,a.Cg)([(0,o.MZ)()],t.prototype,"helper",void 0),(0,a.Cg)([(0,o.MZ)()],t.prototype,"value",void 0),(0,a.Cg)([(0,o.MZ)({type:Boolean,reflect:!0})],t.prototype,"unknown",void 0),(0,a.Cg)([(0,o.MZ)({attribute:"unknown-item-text"})],t.prototype,"unknownItemText",void 0),(0,a.Cg)([(0,o.MZ)({attribute:"hide-clear-icon",type:Boolean})],t.prototype,"hideClearIcon",void 0),(0,a.Cg)([(0,o.MZ)({attribute:!1})],t.prototype,"valueRenderer",void 0),t}},34023(e,t,i){i.d(t,{E:()=>o,J:()=>s});var a=i(1087);const o=()=>Promise.all([i.e(32450),i.e(7305),i.e(92769),i.e(3283),i.e(85010),i.e(89100),i.e(42209),i.e(26092),i.e(8851),i.e(66201),i.e(26295),i.e(52808),i.e(93e3),i.e(61023)]).then(i.bind(i,39803)),s=(e,t)=>{(0,a.r)(e,"show-dialog",{dialogTag:"dialog-area-registry-detail",dialogImport:o,dialogParams:t})}},24367(e,t,i){i.d(t,{L:()=>o,z:()=>s});var a=i(23832);const o=["input_boolean","input_button","input_text","input_number","input_datetime","input_select","counter","timer","schedule"],s=(0,a.g)(o)},996(e,t,i){i.d(t,{G:()=>a});i(45367),i(92731);class a{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)}constructor(e){this._cache=new Map,this._expiration=e}}},36918(e,t,i){i.d(t,{o:()=>a});const a=(e,t)=>`https://www.iobroker.net/#${e.language&&e.language.split("-")[0]||"en"}/adapters/adapterref/iobroker.lovelace/README.md#`},88438(e,t,i){i.d(t,{C:()=>a});const a="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0},46571(e){function t(e){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}t.keys=()=>[],t.resolve=t,t.id=46571,e.exports=t},62003(e,t,i){var a={"./ha-icon-prev":["89133",[61982]],"./ha-icon-button-toolbar":["9882",[39763,76775]],"./ha-alert":["38962",[19695]],"./ha-icon-button-toggle":["62501",[77254]],"./ha-svg-icon.ts":["67094",[]],"./ha-alert.ts":["38962",[19695]],"./ha-icon":["47680",[44889]],"./ha-icon-next.ts":["43661",[63902]],"./ha-qr-code.ts":["60543",[51343,62740]],"./ha-icon-overflow-menu.ts":["75248",[39763,34995,85545]],"./ha-icon-button-toggle.ts":["62501",[77254]],"./ha-icon-button-group":["39826",[13647]],"./ha-svg-icon":["67094",[]],"./ha-icon-button-prev":["45100",[99197]],"./ha-icon-button.ts":["26300",[]],"./ha-icon-overflow-menu":["75248",[39763,34995,85545]],"./ha-icon-button-arrow-next":["99028",[54101]],"./ha-icon-button-prev.ts":["45100",[99197]],"./ha-icon-picker":["64138",[39763,32450,46095,7305,92769,3283,26092,71749]],"./ha-icon-button-toolbar.ts":["9882",[39763,76775]],"./ha-icon-button-arrow-prev.ts":["90248",[17041]],"./ha-icon-button-next":["25440",[81049]],"./ha-icon-next":["43661",[63902]],"./ha-icon-picker.ts":["64138",[39763,32450,46095,7305,92769,3283,26092,71749]],"./ha-icon-prev.ts":["89133",[61982]],"./ha-icon-button-arrow-prev":["90248",[17041]],"./ha-icon-button-next.ts":["25440",[81049]],"./ha-icon.ts":["47680",[44889]],"./ha-qr-code":["60543",[51343,62740]],"./ha-icon-button":["26300",[]],"./ha-icon-button-group.ts":["39826",[13647]],"./ha-icon-button-arrow-next.ts":["99028",[54101]]};function o(e){if(!i.o(a,e))return Promise.resolve().then(()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t});var t=a[e],o=t[0];return Promise.all(t[1].map(i.e)).then(()=>i(o))}o.keys=()=>Object.keys(a),o.id=62003,e.exports=o},86174(e,t,i){var a={"./flow-preview-generic.ts":["72828",[34995,21543,99194,54018,8851,90283,84813]],"./flow-preview-template":["36315",[34995,21543,99194,54018,8851,90283,29160]],"./flow-preview-generic_camera":["25380",[34995,21543,99194,54018,8851,90283,46405]],"./flow-preview-generic_camera.ts":["25380",[34995,21543,99194,54018,8851,90283,46405]],"./flow-preview-generic":["72828",[34995,21543,99194,54018,8851,90283,84813]],"./flow-preview-template.ts":["36315",[34995,21543,99194,54018,8851,90283,29160]]};function o(e){if(!i.o(a,e))return Promise.resolve().then(()=>{var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t});var t=a[e],o=t[0];return Promise.all(t[1].map(i.e)).then(()=>i(o))}o.keys=()=>Object.keys(a),o.id=86174,e.exports=o}};