UNPKG

iobroker.lovelace

Version:

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

6 lines 47.1 kB
export const __webpack_ids__=["62073"];export const __webpack_modules__={31146:function(e,t,a){a.d(t,{i:()=>i});const o=(0,a(93826).P)((e=>{history.replaceState({scrollPosition:e},"")}),300),i=e=>t=>({kind:"method",placement:"prototype",key:t.key,descriptor:{set(e){o(e),this[`__${String(t.key)}`]=e},get(){return this[`__${String(t.key)}`]||history.state?.scrollPosition},enumerable:!0,configurable:!0},finisher(a){const o=a.prototype.connectedCallback;a.prototype.connectedCallback=function(){o.call(this);const a=this[t.key];a&&this.updateComplete.then((()=>{const t=this.renderRoot.querySelector(e);t&&setTimeout((()=>{t.scrollTop=a}),0)}))}}})},93826:function(e,t,a){a.d(t,{P:()=>o});const o=(e,t,a=!0,o=!0)=>{let i,n=0;const r=(...r)=>{const s=()=>{n=!1===a?0:Date.now(),i=void 0,e(...r)},d=Date.now();n||!1!==a||(n=d);const l=t-(d-n);l<=0||l>t?(i&&(clearTimeout(i),i=void 0),n=d,e(...r)):i||!1===o||(i=window.setTimeout(s,l))};return r.cancel=()=>{clearTimeout(i),i=void 0,n=0},r}},34273:function(e,t,a){var o=a(44249),i=a(72621),n=(a(9359),a(31526),a(22997),a(57243)),r=a(15093),s=a(5111),d=a(76525);(0,o.Z)([(0,r.Mo)("ha-button-menu")],(function(e,t){class a extends t{constructor(...t){super(...t),e(this)}}return{F:a,d:[{kind:"field",key:d.gA,value:void 0},{kind:"field",decorators:[(0,r.Cb)()],key:"corner",value:()=>"BOTTOM_START"},{kind:"field",decorators:[(0,r.Cb)({attribute:"menu-corner"})],key:"menuCorner",value:()=>"START"},{kind:"field",decorators:[(0,r.Cb)({type:Number})],key:"x",value:()=>null},{kind:"field",decorators:[(0,r.Cb)({type:Number})],key:"y",value:()=>null},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"multi",value:()=>!1},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"activatable",value:()=>!1},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"fixed",value:()=>!1},{kind:"field",decorators:[(0,r.Cb)({type:Boolean,attribute:"no-anchor"})],key:"noAnchor",value:()=>!1},{kind:"field",decorators:[(0,r.IO)("mwc-menu",!0)],key:"_menu",value:void 0},{kind:"get",key:"items",value:function(){return this._menu?.items}},{kind:"get",key:"selected",value:function(){return this._menu?.selected}},{kind:"method",key:"focus",value:function(){this._menu?.open?this._menu.focusItemAtIndex(0):this._triggerButton?.focus()}},{kind:"method",key:"render",value:function(){return n.dy` <div @click="${this._handleClick}"> <slot name="trigger" @slotchange="${this._setTriggerAria}"></slot> </div> <mwc-menu .corner="${this.corner}" .menuCorner="${this.menuCorner}" .fixed="${this.fixed}" .multi="${this.multi}" .activatable="${this.activatable}" .y="${this.y}" .x="${this.x}"> <slot></slot> </mwc-menu> `}},{kind:"method",key:"firstUpdated",value:function(e){(0,i.Z)(a,"firstUpdated",this,3)([e]),"rtl"===s.E.document.dir&&this.updateComplete.then((()=>{this.querySelectorAll("mwc-list-item").forEach((e=>{const t=document.createElement("style");t.innerHTML="span.material-icons:first-of-type { margin-left: var(--mdc-list-item-graphic-margin, 32px) !important; margin-right: 0px !important;}",e.shadowRoot.appendChild(t)}))}))}},{kind:"method",key:"_handleClick",value:function(){this.disabled||(this._menu.anchor=this.noAnchor?null:this,this._menu.show())}},{kind:"get",key:"_triggerButton",value:function(){return this.querySelector('ha-icon-button[slot="trigger"], mwc-button[slot="trigger"]')}},{kind:"method",key:"_setTriggerAria",value:function(){this._triggerButton&&(this._triggerButton.ariaHasPopup="menu")}},{kind:"field",static:!0,key:"styles",value:()=>n.iv`:host{display:inline-block;position:relative}::slotted([disabled]){color:var(--disabled-text-color)}`}]}}),n.oi)},54977:function(e,t,a){var o=a(44249),i=a(57243),n=a(15093);(0,o.Z)([(0,n.Mo)("ha-card")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)()],key:"header",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,reflect:!0})],key:"raised",value:()=>!1},{kind:"field",static:!0,key:"styles",value:()=>i.iv`:host{background:var(--ha-card-background,var(--card-background-color,#fff));-webkit-backdrop-filter:var(--ha-card-backdrop-filter,none);backdrop-filter:var(--ha-card-backdrop-filter,none);box-shadow:var(--ha-card-box-shadow,none);box-sizing:border-box;border-radius:var(--ha-card-border-radius,12px);border-width:var(--ha-card-border-width,1px);border-style:solid;border-color:var(--ha-card-border-color,var(--divider-color,#e0e0e0));color:var(--primary-text-color);display:block;transition:all .3s ease-out;position:relative}:host([raised]){border:none;box-shadow:var(--ha-card-box-shadow,0px 2px 1px -1px rgba(0,0,0,.2),0px 1px 1px 0px rgba(0,0,0,.14),0px 1px 3px 0px rgba(0,0,0,.12))}.card-header,:host ::slotted(.card-header){color:var(--ha-card-header-color,var(--primary-text-color));font-family:var(--ha-card-header-font-family, inherit);font-size:var(--ha-card-header-font-size, 24px);letter-spacing:-.012em;line-height:48px;padding:12px 16px 16px;display:block;margin-block-start:0px;margin-block-end:0px;font-weight:400}:host ::slotted(.card-content:not(:first-child)),slot:not(:first-child)::slotted(.card-content){padding-top:0px;margin-top:-8px}:host ::slotted(.card-content){padding:16px}:host ::slotted(.card-actions){border-top:1px solid var(--divider-color,#e8e8e8);padding:5px 16px}`},{kind:"method",key:"render",value:function(){return i.dy` ${this.header?i.dy`<h1 class="card-header">${this.header}</h1>`:i.Ld} <slot></slot> `}}]}}),i.oi)},54202:function(e,t,a){a.r(t),a.d(t,{HaIconButtonArrowPrev:()=>s});var o=a(44249),i=a(57243),n=a(15093),r=a(5111);a(23334);let s=(0,o.Z)([(0,n.Mo)("ha-icon-button-arrow-prev")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,n.SB)()],key:"_icon",value:()=>"rtl"===r.E.document.dir?"M4,11V13H16L10.5,18.5L11.92,19.92L19.84,12L11.92,4.08L10.5,5.5L16,11H4Z":"M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z"},{kind:"method",key:"render",value:function(){return i.dy` <ha-icon-button .disabled="${this.disabled}" .label="${this.label||this.hass?.localize("ui.common.back")||"Back"}" .path="${this._icon}"></ha-icon-button> `}}]}}),i.oi)},23334:function(e,t,a){a.r(t),a.d(t,{HaIconButton:()=>s});var o=a(44249),i=(a(74269),a(57243)),n=a(15093),r=a(20552);a(37583);let s=(0,o.Z)([(0,n.Mo)("ha-icon-button")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)({type:Boolean,reflect:!0})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:String})],key:"path",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:String})],key:"label",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:String,attribute:"aria-haspopup"})],key:"ariaHasPopup",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:"hide-title",type:Boolean})],key:"hideTitle",value:()=>!1},{kind:"field",decorators:[(0,n.IO)("mwc-icon-button",!0)],key:"_button",value:void 0},{kind:"method",key:"focus",value:function(){this._button?.focus()}},{kind:"field",static:!0,key:"shadowRootOptions",value:()=>({mode:"open",delegatesFocus:!0})},{kind:"method",key:"render",value:function(){return i.dy` <mwc-icon-button aria-label="${(0,r.o)(this.label)}" title="${(0,r.o)(this.hideTitle?void 0:this.label)}" aria-haspopup="${(0,r.o)(this.ariaHasPopup)}" .disabled="${this.disabled}"> ${this.path?i.dy`<ha-svg-icon .path="${this.path}"></ha-svg-icon>`:i.dy`<slot></slot>`} </mwc-icon-button> `}},{kind:"field",static:!0,key:"styles",value:()=>i.iv`:host{display:inline-block;outline:0}:host([disabled]){pointer-events:none}mwc-icon-button{--mdc-theme-on-primary:currentColor;--mdc-theme-text-disabled-on-light:var(--disabled-text-color)}`}]}}),i.oi)},7285:function(e,t,a){a.d(t,{M:()=>l});var o=a(44249),i=a(72621),n=a(65703),r=a(46289),s=a(57243),d=a(15093);let l=(0,o.Z)([(0,d.Mo)("ha-list-item")],(function(e,t){class a extends t{constructor(...t){super(...t),e(this)}}return{F:a,d:[{kind:"method",key:"renderRipple",value:function(){return this.noninteractive?"":(0,i.Z)(a,"renderRipple",this,3)([])}},{kind:"get",static:!0,key:"styles",value:function(){return[r.W,s.iv`: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?s.iv`span.material-icons:first-of-type,span.material-icons:last-of-type{direction:rtl!important;--direction:rtl}`:s.iv``]}}]}}),n.K)},43344:function(e,t,a){var o=a(44249),i=a(72621),n=a(57243),r=a(15093),s=a(36522),d=a(83716);a(23334);(0,o.Z)([(0,r.Mo)("ha-menu-button")],(function(e,t){class a extends t{constructor(...t){super(...t),e(this)}}return{F:a,d:[{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"hassio",value:()=>!1},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"narrow",value:()=>!1},{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_hasNotifications",value:()=>!1},{kind:"field",decorators:[(0,r.SB)()],key:"_show",value:()=>!1},{kind:"field",key:"_alwaysVisible",value:()=>!1},{kind:"field",key:"_attachNotifOnConnect",value:()=>!1},{kind:"field",key:"_unsubNotifications",value:void 0},{kind:"method",key:"connectedCallback",value:function(){(0,i.Z)(a,"connectedCallback",this,3)([]),this._attachNotifOnConnect&&(this._attachNotifOnConnect=!1,this._subscribeNotifications())}},{kind:"method",key:"disconnectedCallback",value:function(){(0,i.Z)(a,"disconnectedCallback",this,3)([]),this._unsubNotifications&&(this._attachNotifOnConnect=!0,this._unsubNotifications(),this._unsubNotifications=void 0)}},{kind:"method",key:"render",value:function(){if(!this._show)return n.Ld;const e=this._hasNotifications&&(this.narrow||"always_hidden"===this.hass.dockedSidebar);return n.dy` <ha-icon-button .label="${this.hass.localize("ui.sidebar.sidebar_toggle")}" .path="${"M3,6H21V8H3V6M3,11H21V13H3V11M3,16H21V18H3V16Z"}" @click="${this._toggleMenu}"></ha-icon-button> ${e?n.dy`<div class="dot"></div>`:""} `}},{kind:"method",key:"firstUpdated",value:function(e){(0,i.Z)(a,"firstUpdated",this,3)([e]),this.hassio&&(this._alwaysVisible=(Number(window.parent.frontendVersion)||0)<20190710)}},{kind:"method",key:"willUpdate",value:function(e){if((0,i.Z)(a,"willUpdate",this,3)([e]),!e.has("narrow")&&!e.has("hass"))return;const t=e.has("hass")?e.get("hass"):this.hass,o=(e.has("narrow")?e.get("narrow"):this.narrow)||"always_hidden"===t?.dockedSidebar,n=this.narrow||"always_hidden"===this.hass.dockedSidebar;this.hasUpdated&&o===n||(this._show=n||this._alwaysVisible,n?this._subscribeNotifications():this._unsubNotifications&&(this._unsubNotifications(),this._unsubNotifications=void 0))}},{kind:"method",key:"_subscribeNotifications",value:function(){if(this._unsubNotifications)throw new Error("Already subscribed");this._unsubNotifications=(0,d.r)(this.hass.connection,(e=>{this._hasNotifications=e.length>0}))}},{kind:"method",key:"_toggleMenu",value:function(){(0,s.B)(this,"hass-toggle-menu")}},{kind:"field",static:!0,key:"styles",value:()=>n.iv`:host{position:relative}.dot{pointer-events:none;position:absolute;background-color:var(--accent-color);width:12px;height:12px;top:9px;right:7px;inset-inline-end:7px;inset-inline-start:initial;border-radius:50%;border:2px solid var(--app-header-background-color)}`}]}}),n.oi)},37583:function(e,t,a){a.r(t),a.d(t,{HaSvgIcon:()=>r});var o=a(44249),i=a(57243),n=a(15093);let r=(0,o.Z)([(0,n.Mo)("ha-svg-icon")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)()],key:"path",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"secondaryPath",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"viewBox",value:void 0},{kind:"method",key:"render",value:function(){return i.YP` <svg viewBox="${this.viewBox||"0 0 24 24"}" preserveAspectRatio="xMidYMid meet" focusable="false" role="img" aria-hidden="true"> <g> ${this.path?i.YP`<path class="primary-path" d="${this.path}"></path>`:i.Ld} ${this.secondaryPath?i.YP`<path class="secondary-path" d="${this.secondaryPath}"></path>`:i.Ld} </g> </svg>`}},{kind:"field",static:!0,key:"styles",value:()=>i.iv`:host{display:var(--ha-icon-display,inline-flex);align-items:center;justify-content:center;position:relative;vertical-align:middle;fill:var(--icon-primary-color,currentcolor);width:var(--mdc-icon-size,24px);height:var(--mdc-icon-size,24px)}svg{width:100%;height:100%;pointer-events:none;display:block}path.primary-path{opacity:var(--icon-primary-opactity, 1)}path.secondary-path{fill:var(--icon-secondary-color,currentcolor);opacity:var(--icon-secondary-opactity, .5)}`}]}}),i.oi)},43546:function(e,t,a){a.d(t,{Cp:()=>r,TZ:()=>s,W2:()=>n,YY:()=>l,iI:()=>i,j2:()=>d,oT:()=>o});a(9359),a(70104);const 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}})),i=(e,t)=>e.callWS({type:"auth/sign_path",path:t}),n=async(e,t,a,o)=>e.callWS({type:"config/auth_provider/homeassistant/create",user_id:t,username:a,password:o}),r=(e,t,a)=>e.callWS({type:"config/auth_provider/homeassistant/change_password",current_password:t,new_password:a}),s=(e,t,a)=>e.callWS({type:"config/auth_provider/homeassistant/admin_change_password",user_id:t,password:a}),d=(e,t,a)=>e.callWS({type:"config/auth_provider/homeassistant/admin_change_username",user_id:t,username:a}),l=(e,t,a)=>e.callWS({type:"auth/delete_all_refresh_tokens",token_type:t,delete_current_token:a})},15681:function(e,t,a){a.d(t,{D4:()=>c,D7:()=>m,Ky:()=>l,P3:()=>s,V3:()=>v,WW:()=>b,XO:()=>h,ZJ:()=>_,d4:()=>f,oi:()=>u,pV:()=>r,zO:()=>p});var o=a(62212),i=a(22381),n=a(57816);const r=["bluetooth","dhcp","discovery","hardware","hassio","homekit","integration_discovery","mqtt","ssdp","unignore","usb","zeroconf"],s=["reauth"],d={"HA-Frontend-Base":`${location.protocol}//${location.host}`},l=(e,t,a)=>e.callApi("POST","config/config_entries/flow",{handler:t,show_advanced_options:Boolean(e.userData?.showAdvanced),entry_id:a},d),c=(e,t)=>e.callApi("GET",`config/config_entries/flow/${t}`,void 0,d),h=(e,t,a)=>e.callApi("POST",`config/config_entries/flow/${t}`,a,d),p=(e,t,a)=>e.callWS({type:"config_entries/ignore_flow",flow_id:t,title:a}),u=(e,t)=>e.callApi("DELETE",`config/config_entries/flow/${t}`),f=(e,t)=>e.callApi("GET","config/config_entries/flow_handlers"+(t?`?type=${t}`:"")),m=e=>e.sendMessagePromise({type:"config_entries/flow/progress"}),g=(e,t)=>e.subscribeEvents((0,i.D)((()=>m(e).then((e=>t.setState(e,!0)))),500,!0),"config_entry_discovered"),_=e=>(0,o._)(e,"_configFlowProgress",m,g),v=(e,t)=>_(e.connection).subscribe(t),b=(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,n.Lh)(e,t.handler)):(0,n.Lh)(e,t.handler)},6823:function(e,t,a){a.d(t,{ZK:()=>r,iP:()=>n,lf:()=>i,pD:()=>o});const o=e=>e.callWS({type:"diagnostics/list"}),i=(e,t)=>e.callWS({type:"diagnostics/get",domain:t}),n=e=>`/api/diagnostics/config_entry/${e}`,r=(e,t)=>`/api/diagnostics/config_entry/${e}/device/${t}`},83716:function(e,t,a){a.d(t,{r:()=>o});const o=(e,t)=>{const a=new i,o=e.subscribeMessage((e=>t(a.processMessage(e))),{type:"persistent_notification/subscribe"});return()=>{o.then((e=>e?.()))}};class i{constructor(){this.notifications=void 0,this.notifications={}}processMessage(e){if("removed"===e.type)for(const t of Object.keys(e.notifications))delete this.notifications[t];else this.notifications={...this.notifications,...e.notifications};return Object.values(this.notifications)}}},22274:function(e,t,a){a.d(t,{EM:()=>r,NO:()=>c,Xt:()=>d,h:()=>i,jK:()=>s,lR:()=>l,r9:()=>n});class o{constructor(){this.routers=void 0,this.routers={}}processEvent(e){return"router_discovered"===e.type?this.routers[e.key]=e.data:"router_removed"===e.type&&delete this.routers[e.key],Object.values(this.routers)}}const i=(e,t)=>{const a=new o;return e.connection.subscribeMessage((e=>t(a.processEvent(e))),{type:"thread/discover_routers"})},n=e=>e.callWS({type:"thread/list_datasets"}),r=(e,t)=>e.callWS({type:"thread/get_dataset_tlv",dataset_id:t}),s=(e,t,a)=>e.callWS({type:"thread/add_dataset_tlv",source:t,tlv:a}),d=(e,t)=>e.callWS({type:"thread/delete_dataset",dataset_id:t}),l=(e,t)=>e.callWS({type:"thread/set_preferred_dataset",dataset_id:t}),c=(e,t,a,o)=>e.callWS({type:"thread/set_preferred_border_agent",dataset_id:t,border_agent_id:a,extended_address:o})},38572:function(e,t,a){a.d(t,{t:()=>s});var o=a(57243),i=a(15681),n=a(57816),r=a(7956);const s=(e,t)=>(0,r.w)(e,t,{flowType:"config_flow",showDevices:!0,createFlow:async(e,a)=>{const[o]=await Promise.all([(0,i.Ky)(e,a,t.entryId),e.loadFragmentTranslation("config"),e.loadBackendTranslation("config",a),e.loadBackendTranslation("selector",a),e.loadBackendTranslation("title",a)]);return o},fetchFlow:async(e,t)=>{const a=await(0,i.D4)(e,t);return await e.loadFragmentTranslation("config"),await e.loadBackendTranslation("config",a.handler),await e.loadBackendTranslation("selector",a.handler),a},handleFlowStep:i.XO,deleteFlow:i.oi,renderAbortDescription(e,t){const a=e.localize(`component.${t.translation_domain||t.handler}.config.abort.${t.reason}`,t.description_placeholders);return a?o.dy` <ha-markdown allow-svg breaks .content="${a}"></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 a=e.localize(`component.${t.translation_domain||t.handler}.config.step.${t.step_id}.description`,t.description_placeholders);return a?o.dy` <ha-markdown allow-svg breaks .content="${a}"></ha-markdown> `:""},renderShowFormStepFieldLabel(e,t,a,o){if("expandable"===a.type)return e.localize(`component.${t.handler}.config.step.${t.step_id}.sections.${a.name}.name`);const i=o?.path?.[0]?`sections.${o.path[0]}.`:"";return e.localize(`component.${t.handler}.config.step.${t.step_id}.${i}data.${a.name}`)||a.name},renderShowFormStepFieldHelper(e,t,a,i){if("expandable"===a.type)return e.localize(`component.${t.translation_domain||t.handler}.config.step.${t.step_id}.sections.${a.name}.description`);const n=i?.path?.[0]?`sections.${i.path[0]}.`:"",r=e.localize(`component.${t.translation_domain||t.handler}.config.step.${t.step_id}.${n}data_description.${a.name}`,t.description_placeholders);return r?o.dy`<ha-markdown breaks .content="${r}"></ha-markdown>`:""},renderShowFormStepFieldError:(e,t,a)=>e.localize(`component.${t.translation_domain||t.translation_domain||t.handler}.config.error.${a}`,t.description_placeholders)||a,renderShowFormStepFieldLocalizeValue:(e,t,a)=>e.localize(`component.${t.handler}.selector.${a}`),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 a=e.localize(`component.${t.translation_domain||t.handler}.config.${t.step_id}.description`,t.description_placeholders);return o.dy` <p> ${e.localize("ui.panel.config.integrations.config_flow.external_step.description")} </p> ${a?o.dy` <ha-markdown allow-svg breaks .content="${a}"></ha-markdown> `:""} `},renderCreateEntryDescription(e,t){const a=e.localize(`component.${t.translation_domain||t.handler}.config.create_entry.${t.description||"default"}`,t.description_placeholders);return o.dy` ${a?o.dy` <ha-markdown allow-svg breaks .content="${a}"></ha-markdown> `:""} <p> ${e.localize("ui.panel.config.integrations.config_flow.created_config",{name:t.title})} </p> `},renderShowFormProgressHeader:(e,t)=>e.localize(`component.${t.handler}.config.step.${t.step_id}.title`)||e.localize(`component.${t.handler}.title`),renderShowFormProgressDescription(e,t){const a=e.localize(`component.${t.translation_domain||t.handler}.config.progress.${t.progress_action}`,t.description_placeholders);return a?o.dy` <ha-markdown allow-svg breaks .content="${a}"></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 a=e.localize(`component.${t.translation_domain||t.handler}.config.step.${t.step_id}.description`,t.description_placeholders);return a?o.dy` <ha-markdown allow-svg breaks .content="${a}"></ha-markdown> `:""},renderMenuOption:(e,t,a)=>e.localize(`component.${t.translation_domain||t.handler}.config.step.${t.step_id}.menu_options.${a}`,t.description_placeholders),renderLoadingDescription(e,t,a,o){if("loading_flow"!==t&&"loading_step"!==t)return"";const i=o?.handler||a;return e.localize(`ui.panel.config.integrations.config_flow.loading.${t}`,{integration:i?(0,n.Lh)(e.localize,i):e.localize("ui.panel.config.integrations.config_flow.loading.fallback_title")})}})},7956:function(e,t,a){a.d(t,{w:()=>n});var o=a(36522);const i=()=>Promise.all([a.e("46379"),a.e("66031"),a.e("72206"),a.e("97983"),a.e("24199"),a.e("27506"),a.e("83895"),a.e("58640"),a.e("2981"),a.e("1562"),a.e("84503"),a.e("27090"),a.e("19882")]).then(a.bind(a,12656)),n=(e,t,a)=>{(0,o.B)(e,"show-dialog",{dialogTag:"dialog-data-entry-flow",dialogImport:i,dialogParams:{...t,flowConfig:a,dialogParentElement:e}})}},87979:function(e,t,a){var o=a(44249),i=a(57243),n=a(15093),r=a(31146),s=(a(54202),a(43344),a(28008));(0,o.Z)([(0,n.Mo)("hass-subpage")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,n.Cb)()],key:"header",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,attribute:"main-page"})],key:"mainPage",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:String,attribute:"back-path"})],key:"backPath",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"backCallback",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean,reflect:!0})],key:"narrow",value:()=>!1},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"supervisor",value:()=>!1},{kind:"field",decorators:[(0,r.i)(".content")],key:"_savedScrollPos",value:void 0},{kind:"method",key:"render",value:function(){return i.dy` <div class="toolbar"> ${this.mainPage||history.state?.root?i.dy` <ha-menu-button .hassio="${this.supervisor}" .hass="${this.hass}" .narrow="${this.narrow}"></ha-menu-button> `:this.backPath?i.dy` <a href="${this.backPath}"> <ha-icon-button-arrow-prev .hass="${this.hass}"></ha-icon-button-arrow-prev> </a> `:i.dy` <ha-icon-button-arrow-prev .hass="${this.hass}" @click="${this._backTapped}"></ha-icon-button-arrow-prev> `} <div class="main-title"><slot name="header">${this.header}</slot></div> <slot name="toolbar-icon"></slot> </div> <div class="content ha-scrollbar" @scroll="${this._saveScrollPos}"> <slot></slot> </div> <div id="fab"> <slot name="fab"></slot> </div> `}},{kind:"method",decorators:[(0,n.hO)({passive:!0})],key:"_saveScrollPos",value:function(e){this._savedScrollPos=e.target.scrollTop}},{kind:"method",key:"_backTapped",value:function(){this.backCallback?this.backCallback():history.back()}},{kind:"get",static:!0,key:"styles",value:function(){return[s.$c,i.iv`:host{display:block;height:100%;background-color:var(--primary-background-color);overflow:hidden;position:relative}:host([narrow]){width:100%;position:fixed}.toolbar{display:flex;align-items:center;font-size:20px;height:var(--header-height);padding:8px 12px;background-color:var(--app-header-background-color);font-weight:400;color:var(--app-header-text-color,#fff);border-bottom:var(--app-header-border-bottom,none);box-sizing:border-box}@media (max-width:599px){.toolbar{padding:4px}}.toolbar a{color:var(--sidebar-text-color);text-decoration:none}::slotted([slot=toolbar-icon]),ha-icon-button-arrow-prev,ha-menu-button{pointer-events:auto;color:var(--sidebar-icon-color)}.main-title{margin:var(--margin-title);line-height:20px;min-width:0;flex-grow:1;overflow-wrap:break-word;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;padding-bottom:1px}.content{position:relative;width:100%;height:calc(100% - 1px - var(--header-height));overflow-y:auto;overflow:auto;-webkit-overflow-scrolling:touch}#fab{position:absolute;right:calc(16px + env(safe-area-inset-right));inset-inline-end:calc(16px + env(safe-area-inset-right));inset-inline-start:initial;bottom:calc(16px + env(safe-area-inset-bottom));z-index:1;display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px}:host([narrow]) #fab.tabs{bottom:calc(84px + env(safe-area-inset-bottom))}#fab[is-wide]{bottom:24px;right:24px;inset-inline-end:24px;inset-inline-start:initial}`]}}]}}),i.oi)},6798:function(e,t,a){a.r(t),a.d(t,{ThreadConfigPanel:()=>z});var o=a(44249),i=a(72621),n=(a(92745),a(9359),a(1331),a(70104),a(31622),a(57243)),r=a(15093),s=a(27486),d=a(72344),l=a(1416),c=a(58776),h=(a(34273),a(7285),a(54977),a(43546)),p=a(6823);var u=a(22274),f=a(38572),m=a(76131),g=(a(87979),a(6736)),_=a(28008),v=a(88238),b=a(58014),y=a(73192),k=a(36522);const w="M3 6H21V4H3C1.9 4 1 4.9 1 6V18C1 19.1 1.9 20 3 20H7V18H3V6M13 12H9V13.78C8.39 14.33 8 15.11 8 16C8 16.89 8.39 17.67 9 18.22V20H13V18.22C13.61 17.67 14 16.88 14 16S13.61 14.33 13 13.78V12M11 17.5C10.17 17.5 9.5 16.83 9.5 16S10.17 14.5 11 14.5 12.5 15.17 12.5 16 11.83 17.5 11 17.5M22 8H16C15.5 8 15 8.5 15 9V19C15 19.5 15.5 20 16 20H22C22.5 20 23 19.5 23 19V9C23 8.5 22.5 8 22 8M21 18H17V10H21V18Z",x="M12,16A2,2 0 0,1 14,18A2,2 0 0,1 12,20A2,2 0 0,1 10,18A2,2 0 0,1 12,16M12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12A2,2 0 0,1 12,10M12,4A2,2 0 0,1 14,6A2,2 0 0,1 12,8A2,2 0 0,1 10,6A2,2 0 0,1 12,4Z",$="M7 1C5.9 1 5 1.9 5 3V7H7V4H17V20H7V17H5V21C5 22.1 5.9 23 7 23H17C18.1 23 19 22.1 19 21V3C19 1.9 18.1 1 17 1H7M6 9C4.3 9 3 10.3 3 12S4.3 15 6 15C7.3 15 8.4 14.2 8.8 13H11V15H13V13H15V11H8.8C8.4 9.8 7.3 9 6 9M6 11C6.6 11 7 11.4 7 12S6.6 13 6 13 5 12.6 5 12 5.4 11 6 11Z";let z=(0,o.Z)([(0,r.Mo)("thread-config-panel")],(function(e,t){class o extends t{constructor(...t){super(...t),e(this)}}return{F:o,d:[{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"narrow",value:()=>!1},{kind:"field",decorators:[(0,r.SB)()],key:"_configEntryId",value:()=>null},{kind:"field",decorators:[(0,r.SB)()],key:"_routers",value:()=>[]},{kind:"field",decorators:[(0,r.SB)()],key:"_datasets",value:()=>[]},{kind:"field",decorators:[(0,r.SB)()],key:"_otbrInfo",value:void 0},{kind:"method",key:"render",value:function(){const e=this._groupRoutersByNetwork(this._routers,this._datasets);return n.dy` <hass-subpage .narrow="${this.narrow}" .hass="${this.hass}" header="Thread"> <ha-button-menu slot="toolbar-icon"> <ha-icon-button .path="${x}" slot="trigger"></ha-icon-button> <a href="${(0,p.iP)(this._configEntryId||"")}" target="_blank" @click="${this._signUrl}"> <mwc-list-item> ${this.hass.localize("ui.panel.config.integrations.config_entry.download_diagnostics")} </mwc-list-item> </a> <mwc-list-item @click="${this._addTLV}">${this.hass.localize("ui.panel.config.thread.add_dataset_from_tlv")}</mwc-list-item> <mwc-list-item @click="${this._addOTBR}">${this.hass.localize("ui.panel.config.thread.add_open_thread_border_router")}</mwc-list-item> </ha-button-menu> <div class="content"> <h1>${this.hass.localize("ui.panel.config.thread.my_network")}</h1> ${e.preferred?this._renderNetwork(e.preferred):n.dy`<ha-card> <div class="card-content no-routers"> <h3> ${this.hass.localize("ui.panel.config.thread.no_preferred_network")} </h3> <ha-svg-icon .path="${w}"></ha-svg-icon> <a href="${(0,y.R)(this.hass,"/integrations/thread")}" target="_blank"> <mwc-button>${this.hass.localize("ui.panel.config.thread.more_info")}</mwc-button> </a> </div> </ha-card>`} ${e.networks.length?n.dy`<h3> ${this.hass.localize("ui.panel.config.thread.other_networks")} </h3> ${e.networks.map((e=>this._renderNetwork(e)))}`:""} </div> ${this.hass.auth.external?.config.canImportThreadCredentials?n.dy`<ha-fab slot="fab" @click="${this._importExternalThreadCredentials}" extended label="Send credentials to ioBroker"><ha-svg-icon slot="icon" .path="${$}"></ha-svg-icon></ha-fab>`:n.Ld} </hass-subpage> `}},{kind:"method",key:"_renderNetwork",value:function(e){const t=this._otbrInfo&&e.dataset&&(e.dataset.preferred_extended_address&&this._otbrInfo[e.dataset.preferred_extended_address]||Object.values(this._otbrInfo).find((t=>t.extended_pan_id===e.dataset.extended_pan_id))),a=this.hass.auth.external?.config.canTransferThreadCredentialsToKeychain;return n.dy`<ha-card> <div class="card-header"> ${e.name}${e.dataset?n.dy`<div> <ha-icon-button .label="${this.hass.localize("ui.panel.config.thread.thread_network_info")}" .otbr="${t}" .network="${e}" .path="${"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"}" @click="${this._showDatasetInfo}"></ha-icon-button>${e.dataset.preferred||e.routers?.length?"":n.dy`<ha-icon-button .label="${this.hass.localize("ui.panel.config.thread.thread_network_delete_credentials")}" .networkDataset="${e.dataset}" .path="${"M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19M8,9H16V19H8V9M15.5,4L14.5,3H9.5L8.5,4H5V6H19V4H15.5Z"}" @click="${this._removeDataset}"></ha-icon-button>`} </div>`:""} </div> ${e.routers?.length?n.dy`<div class="card-content routers"> <h4> ${this.hass.localize("ui.panel.config.thread.border_routers",{count:e.routers.length})} </h4> </div> ${e.routers.map((t=>{const a=this._otbrInfo&&this._otbrInfo[t.extended_address],o=!!e.dataset,i=o&&t.extended_address===e.dataset.preferred_extended_address,r=o||a;return n.dy`<ha-list-item class="router" twoline graphic="avatar" .hasMeta="${r}"> <img slot="graphic" .src="${(0,v.X1)({domain:t.brand,brand:!0,type:"icon",darkOptimized:this.hass.themes?.darkMode})}" alt="${t.brand}" crossorigin="anonymous" referrerpolicy="no-referrer" @error="${this._onImageError}" @load="${this._onImageLoad}"> ${t.instance_name||t.model_name||t.server?.replace(".local.","")||""} <span slot="secondary">${t.server}</span> ${r?n.dy`${i?n.dy`<ha-svg-icon .path="${$}" .title="${this.hass.localize("ui.panel.config.thread.default_router")}"></ha-svg-icon>`:""} <ha-button-menu slot="meta" .network="${e}" .router="${t}" .otbr="${a}" @action="${this._handleRouterAction}"> <ha-icon-button .label="${this.hass.localize("ui.common.overflow_menu")}" .path="${x}" slot="trigger"></ha-icon-button> ${o?n.dy`<ha-list-item .disabled="${i}"> ${i?this.hass.localize("ui.panel.config.thread.default_router"):this.hass.localize("ui.panel.config.thread.set_default_router")} </ha-list-item>`:""} ${a?n.dy`<ha-list-item> ${this.hass.localize("ui.panel.config.thread.reset_border_router")}</ha-list-item> <ha-list-item> ${this.hass.localize("ui.panel.config.thread.change_channel")}</ha-list-item> ${e.dataset?.preferred?"":n.dy`<ha-list-item> ${this.hass.localize("ui.panel.config.thread.add_to_my_network")} </ha-list-item>`}`:""} </ha-button-menu>`:""} </ha-list-item>`}))}`:n.dy`<div class="card-content no-routers"> <ha-svg-icon .path="${w}"></ha-svg-icon> ${t?n.dy`${this.hass.localize("ui.panel.config.thread.no_routers_otbr_network")} <mwc-button .otbr="${t}" @click="${this._resetBorderRouterEvent}">${this.hass.localize("ui.panel.config.thread.reset_border_router")}</mwc-button>`:this.hass.localize("ui.panel.config.thread.no_border_routers")} </div> `} ${e.dataset&&!e.dataset.preferred?n.dy`<div class="card-actions"> <mwc-button .datasetId="${e.dataset.dataset_id}" @click="${this._setPreferred}">Make preferred network</mwc-button> </div>`:""} ${a&&e.dataset?.preferred&&e.routers?.length?n.dy`<div class="card-actions"> <mwc-button .networkDataset="${e.dataset}" @click="${this._sendCredentials}">Send credentials to phone</mwc-button> </div>`:""} </ha-card>`}},{kind:"method",key:"_sendCredentials",value:async function(e){const t=e.currentTarget.networkDataset;t&&(t.preferred_extended_address||t.preferred_border_agent_id?this.hass.auth.external.fireMessage({type:"thread/store_in_platform_keychain",payload:{mac_extended_address:t.preferred_extended_address,border_agent_id:t.preferred_border_agent_id,active_operational_dataset:(await(0,u.EM)(this.hass,t.dataset_id)).tlv,extended_pan_id:t.extended_pan_id}}):(0,m.showAlertDialog)(this,{title:"Error",text:this.hass.localize("ui.panel.config.thread.no_preferred_router")}))}},{kind:"method",key:"_showDatasetInfo",value:async function(e){const t=e.currentTarget.network,o=e.currentTarget.otbr;var i,n;i=this,n={network:t,otbrInfo:o},(0,k.B)(i,"show-dialog",{dialogTag:"ha-dialog-thread-dataset",dialogImport:()=>Promise.all([a.e("97983"),a.e("14950")]).then(a.bind(a,34061)),dialogParams:n})}},{kind:"method",key:"_importExternalThreadCredentials",value:function(){this.hass.auth.external.fireMessage({type:"thread/import_credentials"})}},{kind:"method",key:"_onImageError",value:function(e){e.target.style.display="none"}},{kind:"method",key:"_onImageLoad",value:function(e){e.target.style.display=""}},{kind:"method",key:"hassSubscribe",value:function(){return[(0,u.h)(this.hass,(e=>{this._routers=e}))]}},{kind:"method",key:"firstUpdated",value:function(e){(0,i.Z)(o,"firstUpdated",this,3)([e]),this._refresh(),this._configEntryId=(0,c.io)("config_entry")}},{kind:"field",key:"_groupRoutersByNetwork",value(){return(0,s.Z)(((e,t)=>{let a;const o={};for(const t of e){const e=t.extended_pan_id;e in o?o[e].routers.push(t):o[e]={name:t.network_name||"",routers:[t]}}for(const e of t){const t=e.extended_pan_id;t&&(e.preferred?(a={name:e.network_name,dataset:e,routers:o[t]?.routers},delete o[t]):t in o?o[t].dataset=e:o[t]={name:e.network_name,dataset:e})}return{preferred:a,networks:Object.values(o).sort(((e,t)=>(0,l.$K)(e.name,t.name,this.hass.locale.language)))}}))}},{kind:"method",key:"_refresh",value:async function(){var e;if((0,u.r9)(this.hass).then((e=>{this._datasets=e.datasets})),(0,d.p)(this.hass,"otbr"))try{this._otbrInfo=await(e=this.hass,e.callWS({type:"otbr/info"}))}catch(e){this._otbrInfo=void 0}}},{kind:"method",key:"_signUrl",value:async function(e){const t=e.target.closest("a");e.preventDefault();const a=await(0,h.iI)(this.hass,t.getAttribute("href"));(0,b.N)(a.path)}},{kind:"method",key:"_addOTBR",value:function(){(0,f.t)(this,{dialogClosedCallback:()=>{this._refresh()},startFlowHandler:"otbr",showAdvanced:this.hass.userData?.showAdvanced})}},{kind:"method",key:"_handleRouterAction",value:function(e){const t=e.currentTarget.network,a=e.currentTarget.router,o=e.currentTarget.otbr;switch(t.dataset?Number(e.detail.index):Number(e.detail.index)+1){case 0:this._setPreferredBorderAgent(t.dataset,a);break;case 1:this._resetBorderRouter(o);break;case 2:this._changeChannel(o);break;case 3:this._setDataset(o)}}},{kind:"method",key:"_resetBorderRouterEvent",value:function(e){const t=e.currentTarget.otbr;this._resetBorderRouter(t)}},{kind:"method",key:"_resetBorderRouter",value:async function(e){if(await(0,m.showConfirmationDialog)(this,{title:this.hass.localize("ui.panel.config.thread.confirm_reset_border_router"),text:this.hass.localize("ui.panel.config.thread.confirm_reset_border_router_text")})){try{await(t=this.hass,a=e.extended_address,t.callWS({type:"otbr/create_network",extended_address:a}))}catch(e){(0,m.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.thread.otbr_config_failed"),text:e.message})}var t,a;this._refresh()}}},{kind:"method",key:"_setDataset",value:async function(e){const t=this._groupRoutersByNetwork(this._routers,this._datasets),a=t.preferred?.dataset?.dataset_id;if(!a)return;if(await(0,m.showConfirmationDialog)(this,{title:this.hass.localize("ui.panel.config.thread.confirm_set_dataset_border_router"),text:this.hass.localize("ui.panel.config.thread.confirm_set_dataset_border_router_text")})){try{await(o=this.hass,i=e.extended_address,n=a,o.callWS({type:"otbr/set_network",extended_address:i,dataset_id:n}))}catch(e){(0,m.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.thread.otbr_config_failed"),text:e.message})}var o,i,n;this._refresh()}}},{kind:"method",key:"_setPreferred",value:async function(e){const t=e.target.datasetId;await(0,u.lR)(this.hass,t),this._refresh()}},{kind:"method",key:"_setPreferredBorderAgent",value:async function(e,t){await(0,u.NO)(this.hass,e.dataset_id,t.border_agent_id,t.extended_address),this._refresh()}},{kind:"method",key:"_addTLV",value:async function(){const e=await(0,m.showPromptDialog)(this,{title:this.hass.localize("ui.panel.config.thread.add_dataset"),inputLabel:this.hass.localize("ui.panel.config.thread.add_dataset_label"),confirmText:this.hass.localize("ui.panel.config.thread.add_dataset_button")});if(e){try{await(0,u.jK)(this.hass,"manual",e)}catch(e){(0,m.showAlertDialog)(this,{title:"Error",text:e.message||e})}this._refresh()}}},{kind:"method",key:"_removeDataset",value:async function(e){const t=e.currentTarget.networkDataset;if(await(0,m.showConfirmationDialog)(this,{title:this.hass.localize("ui.panel.config.thread.confirm_delete_dataset",{name:t.network_name}),text:this.hass.localize("ui.panel.config.thread.confirm_delete_dataset_text"),destructive:!0,confirmText:this.hass.localize("ui.common.delete")})){try{await(0,u.Xt)(this.hass,t.dataset_id)}catch(e){(0,m.showAlertDialog)(this,{title:"Error",text:e.message||e})}this._refresh()}}},{kind:"method",key:"_changeChannel",value:async function(e){const t=e.channel,a=await(0,m.showPromptDialog)(this,{title:this.hass.localize("ui.panel.config.thread.change_channel"),text:this.hass.localize("ui.panel.config.thread.change_channel_text"),inputLabel:this.hass.localize("ui.panel.config.thread.change_channel_label"),confirmText:this.hass.localize("ui.panel.config.thread.change_channel"),inputType:"number",inputMin:"11",inputMax:"26",defaultValue:t?t.toString():void 0});if(!a)return;const o=parseInt(a);if(o<11||o>26)(0,m.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.thread.change_channel_invalid"),text:this.hass.localize("ui.panel.config.thread.change_channel_range")});else{try{const t=await((e,t,a)=>e.callWS({type:"otbr/set_channel",extended_address:t,channel:a}))(this.hass,e.extended_address,o);(0,m.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.thread.change_channel_initiated_title"),text:this.hass.localize("ui.panel.config.thread.change_channel_initiated_text",{delay:Math.floor(t.delay/60)})})}catch(e){if("multiprotocol_enabled"===e.code)return void(0,m.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.thread.change_channel_multiprotocol_enabled_title"),text:this.hass.localize("ui.panel.config.thread.change_channel_multiprotocol_enabled_text")});(0,m.showAlertDialog)(this,{title:"Error",text:e.message||e})}this._refresh()}}},{kind:"field",static:!0,key:"styles",value:()=>[_.Qx,n.iv`.content{padding:24px 8px 32px;max-width:600px;margin:0 auto;direction:ltr}ha-list-item.router{--mdc-list-item-meta-size:auto;--mdc-list-item-meta-display:flex;--mdc-list-side-padding:16px;cursor:default;overflow:visible}ha-list-item img{border-radius:0}ha-svg-icon[slot=meta]{width:24px}ha-button-menu a{text-decoration:none}.routers{padding-bottom:0}.no-routers{display:flex;flex-direction:column;align-items:center;text-align:center}.no-routers ha-svg-icon{background-color:var(--light-primary-color);color:var(--secondary-text-color);padding:16px;border-radius:50%;margin-bottom:8px}ha-card{margin-bottom:16px}h4{margin:0}.card-header{display:flex;justify-content:space-between}`]}]}}),(0,g.f)(n.oi))},28008:function(e,t,a){a.d(t,{$c:()=>s,Qx:()=>n,k1:()=>i,yu:()=>r});var o=a(57243);const i=o.iv`button.link{background:0 0;color:inherit;border:none;padding:0;font:inherit;text-align:left;text-decoration:underline;cursor:pointer;outline:0}`,n=o.iv`:host{font-family:var(--paper-font-body1_-_font-family);-webkit-font-smoothing:var(--paper-font-body1_-_-webkit-font-smoothing);font-size:var(--paper-font-body1_-_font-size);font-weight:var(--paper-font-body1_-_font-weight);line-height:var(--paper-font-body1_-_line-height)}app-header div[sticky]{height:48px}app-toolbar [main-title]{margin-left:20px;margin-inline-start:20px;margin-inline-end:initial}h1{font-family:var(--paper-font-headline_-_font-family);-webkit-font-smoothing:var(--paper-font-headline_-_-webkit-font-smoothing);white-space:var(--paper-font-headline_-_white-space);overflow:var(--paper-font-headline_-_overflow);text-overflow:var(--paper-font-headline_-_text-overflow);font-size:var(--paper-font-headline_-_font-size);font-weight:var(--paper-font-headline_-_font-weight);line-height:var(--paper-font-headline_-_line-height)}h2{font-family:var(--paper-font-title_-_font-family);-webkit-font-smoothing:var(--paper-font-title_-_-webkit-font-smoothing);white-space:var(--paper-font-title_-_white-space);overflow:var(--paper-font-title_-_overflow);text-overflow:var(--paper-font-title_-_text-overflow);font-size:var(--paper-font-title_-_font-size);font-weight:var(--paper-font-title_-_font-weight);line-height:var(--paper-font-title_-_line-height)}h3{font-family:var(--paper-font-subhead_-_font-family);-webkit-font-smoothing:var(--paper-font-subhead_-_-webkit-font-smoothing);white-space:var(--paper-font-subhead_-_white-space);overflow:var(--paper-font-subhead_-_overflow);text-overflow:var(--paper-font-subhead_-_text-overflow);font-size:var(--paper-font-subhead_-_font-size);font-weight:var(--paper-font-subhead_-_font-weight);line-height:var(--paper-font-subhead_-_line-height)}a{color:var(--primary-color)}.secondary{color:var(--secondary-text-color)}.error{color:var(--error-color)}.warning{color:var(--error-color)}ha-button.warning,mwc-button.warning{--mdc-theme-primary:var(--error-color)}${i} .card-actions a{text-decoration:none}.card-actions .warning{--mdc-theme-primary:var(--error-color)}.layout.horizontal,.layout.vertical{display:flex}.layout.inline{display:inline-flex}.layout.horizontal{flex-direction:row}.layout.vertical{flex-direction:column}.layout.wrap{flex-wrap:wrap}.layout.no-wrap{flex-wrap:nowrap}.layout.center,.layout.center-center{align-items:center}.layout.bottom{align-items:flex-end}.layout.center-center,.layout.center-justified{justify-content:center}.flex{flex:1;flex-basis:0.000000001px}.flex-auto{flex:1 1 auto}.flex-none{flex:none}.layout.justified{justify-content:space-between}`,r=o.iv`ha-dialog{--mdc-dialog-min-width:400px;--mdc-dialog-max-width:600px;--mdc-dialog-max-width:min(600px, 95vw);--justify-action-buttons:space-between}ha-dialog .form{color:var(--primary-text-color)}a{color:var(--primary-color)}@media all and (max-width:450px),all and (max-height:500px){ha-dialog{--mdc-dialog-min-width:calc( 100vw - env(safe-area-inset-right) - env(safe-area-inset-left) );--mdc-dialog-max-width:calc( 100vw - env(safe-area-inset-right) - env(safe-area-inset-left) );--mdc-dialog-min-height:100%;--mdc-dialog-max-height:100%;--vertical-align-dialog:flex-end;--ha-dialog-border-radius:0}}ha-button.warning,mwc-button.warning{--mdc-theme-primary:var(--error-color)}.error{color:var(--error-color)}`,s=o.iv`.ha-scrollbar::-webkit-scrollbar{width:.4rem;height:.4rem}.ha-scrollbar::-webkit-scrollbar-thumb{-webkit-border-radius:4px;border-radius:4px;background:var(--scrollbar-thumb-color)}.ha-scrollbar{overflow-y:auto;scrollbar-color:var(--scrollbar-thumb-color) transparent;scrollbar-width:thin}`;o.iv`body{background-color:var(--primary-background-color);color:var(--primary-text-color);height:calc(100vh - 32px);width:100vw}`},88238:function(e,t,a){a.d(t,{RU:()=>i,X1:()=>o,u4:()=>n,zC:()=>r});const o=e=>`https://brands.home-assistant.io/${e.brand?"brands/":""}${e.useFallback?"_/":""}${e.domain}/${e.darkOptimized?"dark_":""}${e.type}.png`,i=e=>`https://brands.home-assistant.io/hardware/${e.category}/${e.darkOptimized?"dark_":""}${e.manufacturer}${e.model?`_${e.model}`:""}.png`,n=e=>e.split("/")[4],r=e=>e.startsWith("https://brands.home-assistant.io/")},73192:function(e,t,a){a.d(t,{R:()=>o});const o=(e,t)=>`https://www.iobroker.net/#${e.language&&e.language.split("-")[0]||"en"}/adapters/adapterref/iobroker.lovelace/README.md#`},58014:function(e,t,a){a.d(t,{N:()=>i,G:()=>n});var o=a(18117);const i=(e,t="")=>{const a=document.createElement("a");a.target="_blank",a.href=e,a.download=t,a.style.display="none",document.body.appendChild(a),a.dispatchEvent(new MouseEvent("click")),document.body.removeChild(a)},n=e=>!(e=>!!e.auth.external&&o.G)(e)||!!e.auth.external?.config.downloadFileSupported},18117:function(e,t,a){a.d(t,{G:()=>o});const o=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}}; //# sourceMappingURL=62073.f3b75ea2961a1151.js.map