export const __rspack_esm_id="49372";export const __rspack_esm_ids=["49372"];export const __webpack_modules__={26218(e,t,a){a.d(t,{a:()=>r});const o=(0,a(77796).n)(e=>{history.replaceState({scrollPosition:e},"")},300);function r(e){return(t,a)=>{if("object"==typeof a)throw new Error("This decorator does not support this compilation type.");const r=t.connectedCallback;t.connectedCallback=function(){r.call(this);const t=this[a];t&&this.updateComplete.then(()=>{const a=this.renderRoot.querySelector(e);a&&setTimeout(()=>{a.scrollTop=t},0)})};const i=Object.getOwnPropertyDescriptor(t,a);let n;if(void 0===i)n={get(){return this[`__${String(a)}`]||history.state?.scrollPosition},set(e){o(e),this[`__${String(a)}`]=e},configurable:!0,enumerable:!0};else{const e=i.set;n={...i,set(t){o(t),this[`__${String(a)}`]=t,e?.call(this,t)}}}Object.defineProperty(t,a,n)}}},77796(e,t,a){a.d(t,{n:()=>o});const o=(e,t,a=!0,o=!0)=>{let r,i=0;const n=(...n)=>{const s=()=>{i=!1===a?0:Date.now(),r=void 0,e(...n)},l=Date.now();i||!1!==a||(i=l);const d=t-(l-i);d<=0||d>t?(r&&(clearTimeout(r),r=void 0),i=l,e(...n)):r||!1===o||(r=window.setTimeout(s,d))};return n.cancel=()=>{clearTimeout(r),r=void 0,i=0},n}},76776(e,t,a){var o=a(62826),r=a(96196),i=a(97735);class n extends r.WF{render(){return r.qy` ${this.header?r.qy`<h1 class="card-header">${this.header}</h1>`:r.s6} <slot></slot> `}constructor(...e){super(...e),this.raised=!1}}n.styles=r.AH`: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,var(--ha-border-radius-lg));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, var(--ha-font-size-2xl));letter-spacing:-.012em;line-height:var(--ha-line-height-expanded);padding:var(--ha-space-3) var(--ha-space-4) var(--ha-space-4);display:block;margin-block-start:0;margin-block-end:0;font-weight:var(--ha-font-weight-normal)}
    :host
      ::slotted(
        .card-content:not(:nth-child(1 of .card-content, .card-header))
      ),
    slot:not(:first-child)::slotted(.card-content) {
      padding-top: 0;
      margin-top: calc(var(--ha-space-2) * -1);
    }
    :host ::slotted(.card-content){padding:var(--ha-space-4)}:host ::slotted(.card-actions){border-top:1px solid var(--divider-color,#e8e8e8);padding:var(--ha-space-2)}`,(0,o.Cg)([(0,i.MZ)()],n.prototype,"header",void 0),(0,o.Cg)([(0,i.MZ)({type:Boolean,reflect:!0})],n.prototype,"raised",void 0),n=(0,o.Cg)([(0,i.EM)("ha-card")],n)},70947(e,t,a){var o=a(62826),r=a(90075),i=(a(43776),a(96196)),n=a(97735);a(67094);class s extends r.A{renderCheckboxIcon(){return i.qy` <ha-svg-icon id="check" part="checkmark" .path="${this.checked?"M10,17L5,12L6.41,10.58L10,14.17L17.59,6.58L19,8M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3Z":"M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3M19,5V19H5V5H19Z"}"></ha-svg-icon> `}static get styles(){return[r.A.styles,i.AH`:host{min-height:var(--ha-space-10)}#check{visibility:visible;flex-shrink:0}#icon ::slotted(*){color:var(--ha-color-on-neutral-normal)}:host([variant=danger]) #icon ::slotted(*){color:var(--ha-color-on-danger-quiet)}:host([selected]){font-weight:var(--ha-font-weight-medium);color:var(--primary-color);background-color:var(--ha-color-fill-primary-quiet-resting);--icon-primary-color:var(--primary-color)}:host([selected]:hover){background-color:var(--ha-color-fill-primary-quiet-hover)}`]}constructor(...e){super(...e),this.selected=!1}}(0,o.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],s.prototype,"selected",void 0),s=(0,o.Cg)([(0,n.EM)("ha-dropdown-item")],s)},29823(e,t,a){a.a(e,async function(e,t){try{var o=a(62826),r=a(52254),i=a(96196),n=a(97735),s=e([r]);r=(s.then?(await s)():s)[0];class l extends r.A{get anchorElement(){return this.popup?.anchor}set anchorElement(e){this.popup&&(this.popup.anchor&&"ha-icon-button"===this.popup.anchor.localName&&(this.popup.anchor.selected=!1),this.popup.anchor=e)}getTrigger(){return this.anchorElement?this.anchorElement:super.getTrigger()}async showMenu(){await super.showMenu();const e=this.getTrigger();e&&"ha-icon-button"===e.localName&&(e.selected=!0)}async hideMenu(){const e=this.getTrigger();e&&"ha-icon-button"===e.localName&&(e.selected=!1),await super.hideMenu()}static get styles(){return[r.A.styles,i.AH`:host{font-size:var(--ha-dropdown-font-size, var(--ha-font-size-m));--wa-color-surface-raised:var(
            --card-background-color,
            var(--ha-dialog-surface-background, var(--mdc-theme-surface, #fff)),
          )}#menu{padding:var(--ha-space-1)}`]}constructor(...e){super(...e),this.dropdownTag="ha-dropdown",this.dropdownItemTag="ha-dropdown-item"}}(0,o.Cg)([(0,n.MZ)({attribute:!1})],l.prototype,"dropdownTag",void 0),(0,o.Cg)([(0,n.MZ)({attribute:!1})],l.prototype,"dropdownItemTag",void 0),l=(0,o.Cg)([(0,n.EM)("ha-dropdown")],l),t()}catch(e){t(e)}})},90248(e,t,a){a.a(e,async function(e,o){try{a.r(t),a.d(t,{HaIconButtonArrowPrev:()=>p});var r=a(62826),i=a(96196),n=a(97735),s=a(63091),l=a(26300),d=e([l]);l=(d.then?(await d)():d)[0];const c="M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z",h="M4,11V13H16L10.5,18.5L11.92,19.92L19.84,12L11.92,4.08L10.5,5.5L16,11H4Z";class p extends i.WF{render(){return i.qy` <ha-icon-button .disabled="${this.disabled}" .label="${this.label||this.hass?.localize("ui.common.back")||"Back"}" .path="${this._icon}" .href="${this.href}" .target="${this.target}" .rel="${this.rel}" .download="${this.download}"></ha-icon-button> `}constructor(...e){super(...e),this.disabled=!1,this._icon="rtl"===s.G.document.dir?h:c}}(0,r.Cg)([(0,n.MZ)({attribute:!1})],p.prototype,"hass",void 0),(0,r.Cg)([(0,n.MZ)({type:Boolean})],p.prototype,"disabled",void 0),(0,r.Cg)([(0,n.MZ)()],p.prototype,"label",void 0),(0,r.Cg)([(0,n.MZ)()],p.prototype,"href",void 0),(0,r.Cg)([(0,n.MZ)()],p.prototype,"target",void 0),(0,r.Cg)([(0,n.MZ)()],p.prototype,"rel",void 0),(0,r.Cg)([(0,n.MZ)()],p.prototype,"download",void 0),(0,r.Cg)([(0,n.wk)()],p.prototype,"_icon",void 0),p=(0,r.Cg)([(0,n.EM)("ha-icon-button-arrow-prev")],p),o()}catch(e){o(e)}})},26300(e,t,a){a.a(e,async function(e,o){try{a.r(t),a.d(t,{HaIconButton:()=>c});var r=a(62826),i=a(96196),n=a(97735),s=a(32288),l=a(18350),d=(a(67094),e([l]));l=(d.then?(await d)():d)[0];class c extends i.WF{render(){return i.qy` <ha-button appearance="plain" variant="neutral" aria-label="${(0,s.J)(this.label)}" title="${(0,s.J)(this.hideTitle?void 0:this.label)}" aria-haspopup="${(0,s.J)(this.ariaHasPopup)}" .disabled="${this.disabled}" .iconTag="${this.path?"ha-svg-icon":"span"}" .href="${this.href}" .target="${this.target}" .rel="${this.rel}" .download="${this.download}"> ${this.path?i.qy`<ha-svg-icon .path="${this.path}"></ha-svg-icon>`:i.qy`<span><slot></slot></span>`} </ha-button> `}constructor(...e){super(...e),this.disabled=!1,this.hideTitle=!1,this.selected=!1}}c.shadowRootOptions={mode:"open",delegatesFocus:!0},c.styles=i.AH`:host{display:inline-block;outline:0;--ha-button-height:var(--ha-icon-button-size, 48px)}ha-button{position:relative;isolation:isolate;--wa-form-control-padding-inline:var(
        --ha-icon-button-padding-inline,
        --ha-space-2
      );--wa-color-on-normal:currentColor;--wa-color-fill-quiet:transparent;--ha-button-label-overflow:visible}ha-button::after{content:"";position:absolute;inset:0;z-index:-1;border-radius:50%;background-color:currentColor;opacity:0;pointer-events:none}ha-button::part(base){width:var(--wa-form-control-height);aspect-ratio:1;outline-offset:-4px}ha-button::part(label){display:flex}:host([selected]) ha-button::after{opacity:.1}@media (hover:hover){:host(:hover:not([disabled])) ha-button::after{opacity:.1}}`,(0,r.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],c.prototype,"disabled",void 0),(0,r.Cg)([(0,n.MZ)({type:String})],c.prototype,"path",void 0),(0,r.Cg)([(0,n.MZ)({type:String})],c.prototype,"label",void 0),(0,r.Cg)([(0,n.MZ)({type:String,attribute:"aria-haspopup"})],c.prototype,"ariaHasPopup",void 0),(0,r.Cg)([(0,n.MZ)({attribute:"hide-title",type:Boolean})],c.prototype,"hideTitle",void 0),(0,r.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],c.prototype,"selected",void 0),(0,r.Cg)([(0,n.MZ)()],c.prototype,"href",void 0),(0,r.Cg)([(0,n.MZ)()],c.prototype,"target",void 0),(0,r.Cg)([(0,n.MZ)()],c.prototype,"rel",void 0),(0,r.Cg)([(0,n.MZ)()],c.prototype,"download",void 0),c=(0,r.Cg)([(0,n.EM)("ha-icon-button")],c),o()}catch(e){o(e)}})},2054(e,t,a){a.a(e,async function(e,t){try{var o=a(62826),r=a(96196),i=a(97735),n=a(1087),s=a(44249),l=a(26300),d=e([l]);l=(d.then?(await d)():d)[0];const c="M3,6H21V8H3V6M3,11H21V13H3V11M3,16H21V18H3V16Z";class h extends r.WF{connectedCallback(){super.connectedCallback(),this._attachNotifOnConnect&&(this._attachNotifOnConnect=!1,this._subscribeNotifications())}disconnectedCallback(){super.disconnectedCallback(),this._unsubNotifications&&(this._attachNotifOnConnect=!0,this._unsubNotifications(),this._unsubNotifications=void 0)}render(){if(!this._show)return r.s6;const e=this._hasNotifications&&(this.narrow||"always_hidden"===this.hass.dockedSidebar);return r.qy` <ha-icon-button .label="${this.hass.localize("ui.sidebar.sidebar_toggle")}" .path="${c}" @click="${this._toggleMenu}"></ha-icon-button> ${e?r.qy`<div class="dot"></div>`:""} `}willUpdate(e){if(super.willUpdate(e),!e.has("narrow")&&!e.has("hass"))return;const t=e.has("hass")?e.get("hass"):this.hass,a=e.has("narrow")?e.get("narrow"):this.narrow,o=!1===t?.kioskMode&&(a||"always_hidden"===t?.dockedSidebar),r=!1===this.hass.kioskMode&&(this.narrow||"always_hidden"===this.hass.dockedSidebar);this.hasUpdated&&o===r||(this._show=r||this._alwaysVisible,r?this._subscribeNotifications():this._unsubNotifications&&(this._unsubNotifications(),this._unsubNotifications=void 0))}_subscribeNotifications(){if(this._unsubNotifications)throw new Error("Already subscribed");this._unsubNotifications=(0,s.V)(this.hass.connection,e=>{this._hasNotifications=e.length>0})}_toggleMenu(){(0,n.r)(this,"hass-toggle-menu")}constructor(...e){super(...e),this.narrow=!1,this._hasNotifications=!1,this._show=!1,this._alwaysVisible=!1,this._attachNotifOnConnect=!1}}h.styles=r.AH`: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:var(--ha-border-radius-circle);border:2px solid var(--app-header-background-color)}`,(0,o.Cg)([(0,i.MZ)({type:Boolean})],h.prototype,"narrow",void 0),(0,o.Cg)([(0,i.MZ)({attribute:!1})],h.prototype,"hass",void 0),(0,o.Cg)([(0,i.wk)()],h.prototype,"_hasNotifications",void 0),(0,o.Cg)([(0,i.wk)()],h.prototype,"_show",void 0),h=(0,o.Cg)([(0,i.EM)("ha-menu-button")],h),t()}catch(e){t(e)}})},67094(e,t,a){a.r(t),a.d(t,{HaSvgIcon:()=>n});var o=a(62826),r=a(96196),i=a(97735);class n extends r.WF{render(){return r.JW` <svg viewBox="${this.viewBox||"0 0 24 24"}" preserveAspectRatio="xMidYMid meet" focusable="false" role="img" aria-hidden="true"> <g> ${this.path?r.JW`<path class="primary-path" d="${this.path}"></path>`:r.s6} ${this.secondaryPath?r.JW`<path class="secondary-path" d="${this.secondaryPath}"></path>`:r.s6} </g> </svg>`}}n.styles=r.AH`: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)}`,(0,o.Cg)([(0,i.MZ)()],n.prototype,"path",void 0),(0,o.Cg)([(0,i.MZ)({attribute:!1})],n.prototype,"secondaryPath",void 0),(0,o.Cg)([(0,i.MZ)({attribute:!1})],n.prototype,"viewBox",void 0),n=(0,o.Cg)([(0,i.EM)("ha-svg-icon")],n)},82e3(e,t,a){a.d(t,{D5:()=>o,Fy:()=>h,Gk:()=>f,Hg:()=>r,TJ:()=>n,UQ:()=>c,Y_:()=>u,ds:()=>g,e0:()=>i,ec:()=>p,go:()=>l,n2:()=>d,sq:()=>s});a(18111),a(61701),a(33110);const o=14881==a.j?`${location.protocol}//${location.host}`:null,r=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=()=>fetch("/auth/providers",{credentials:"same-origin"}),s=(e,t,a)=>fetch("/auth/login_flow",{method:"POST",credentials:"same-origin",body:JSON.stringify({client_id:e,handler:a,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,a,o)=>{e.includes("?")?e.endsWith("&")||(e+="&"):e+="?",e+=`code=${encodeURIComponent(t)}`,a&&(e+=`&state=${encodeURIComponent(a)}`),o&&(e+="&storeToken=true"),document.location.assign(e)},h=async(e,t,a,o)=>e.callWS({type:"config/auth_provider/homeassistant/create",user_id:t,username:a,password:o}),p=(e,t,a)=>e.callWS({type:"config/auth_provider/homeassistant/change_password",current_password:t,new_password:a}),g=(e,t,a)=>e.callWS({type:"config/auth_provider/homeassistant/admin_change_password",user_id:t,password:a}),f=(e,t,a)=>e.callWS({type:"config/auth_provider/homeassistant/admin_change_username",user_id:t,username:a}),u=(e,t,a)=>e.callWS({type:"auth/delete_all_refresh_tokens",token_type:t,delete_current_token:a})},26571(e,t,a){a.d(t,{Al:()=>i,KY:()=>r,PN:()=>l,dG:()=>c,jm:()=>d,m7:()=>u,sR:()=>h,t1:()=>s,t2:()=>g,x:()=>f,yu:()=>p});var o=a(95350);const r=["bluetooth","dhcp","discovery","esphome","hardware","hassio","homekit","integration_discovery","mqtt","ssdp","unignore","usb","zeroconf"],i=["reauth"],n={"HA-Frontend-Base":`${location.protocol}//${location.host}`},s=(e,t,a)=>e.callApi("POST","config/config_entries/flow",{handler:t,show_advanced_options:Boolean(e.userData?.showAdvanced),entry_id:a},n),l=(e,t)=>e.callApi("GET",`config/config_entries/flow/${t}`,void 0,n),d=(e,t,a)=>e.callApi("POST",`config/config_entries/flow/${t}`,a,n),c=(e,t,a)=>e.callWS({type:"config_entries/ignore_flow",flow_id:t,title:a}),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}`:"")),g=e=>e.sendMessagePromise({type:"config_entries/flow/progress"}),f=(e,t)=>e.connection.subscribeMessage(e=>t(e),{type:"config_entries/flow/subscribe"}),u=(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,o.p$)(e,t.handler)):(0,o.p$)(e,t.handler)},96204(e,t,a){a.d(t,{Dh:()=>o,It:()=>n,WV:()=>i,g9:()=>r});const o=e=>e.callWS({type:"diagnostics/list"}),r=(e,t)=>e.callWS({type:"diagnostics/get",domain:t}),i=e=>`/api/diagnostics/config_entry/${e}`,n=(e,t)=>`/api/diagnostics/config_entry/${e}/device/${t}`},20505(e,t,a){a.d(t,{CE:()=>i,CW:()=>r,Er:()=>o,pW:()=>n});const o=e=>e.callWS({type:"otbr/info"}),r=(e,t)=>e.callWS({type:"otbr/create_network",extended_address:t}),i=(e,t,a)=>e.callWS({type:"otbr/set_network",extended_address:t,dataset_id:a}),n=(e,t,a)=>e.callWS({type:"otbr/set_channel",extended_address:t,channel:a})},44249(e,t,a){a.d(t,{V:()=>o});const o=(e,t)=>{const a=new r,o=e.subscribeMessage(e=>t(a.processMessage(e)),{type:"persistent_notification/subscribe"});return()=>{o.then(e=>e?.())}};class r{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)}constructor(){this.notifications={}}}},16790(e,t,a){a.d(t,{It:()=>s,W4:()=>d,dy:()=>n,l1:()=>c,rY:()=>l,sL:()=>i,wm:()=>r});class o{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)}constructor(){this.routers={}}}const r=(e,t)=>{const a=new o;return e.connection.subscribeMessage(e=>t(a.processEvent(e)),{type:"thread/discover_routers"})},i=e=>e.callWS({type:"thread/list_datasets"}),n=(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}),l=(e,t)=>e.callWS({type:"thread/delete_dataset",dataset_id:t}),d=(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})},77763(e,t,a){a.d(t,{W:()=>s});var o=a(96196),r=a(26571),i=a(95350),n=a(29094);const s=(e,t)=>(0,n.g)(e,t,{flowType:"config_flow",showDevices:!0,createFlow:async(e,a)=>{const[o]=await Promise.all([(0,r.t1)(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 Promise.all([(0,r.PN)(e,t),e.loadFragmentTranslation("config")]);return await Promise.all([e.loadBackendTranslation("config",a.handler),e.loadBackendTranslation("selector",a.handler),e.loadBackendTranslation("title",a.handler)]),a},handleFlowStep:r.jm,deleteFlow:r.sR,renderAbortDescription(e,t){const a=e.localize(`component.${t.translation_domain||t.handler}.config.abort.${t.reason}`,t.description_placeholders);return a?o.qy` <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.qy` <ha-markdown .allowDataUrl="${"zwave_js"===t.handler}" 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`,t.description_placeholders)||a.name;const r=o?.path?.[0]?`sections.${o.path[0]}.`:"";return e.localize(`component.${t.handler}.config.step.${t.step_id}.${r}data.${a.name}`,t.description_placeholders)||a.name},renderShowFormStepFieldHelper(e,t,a,r){if("expandable"===a.type)return e.localize(`component.${t.translation_domain||t.handler}.config.step.${t.step_id}.sections.${a.name}.description`,t.description_placeholders);const i=r?.path?.[0]?`sections.${r.path[0]}.`:"",n=e.localize(`component.${t.translation_domain||t.handler}.config.step.${t.step_id}.${i}data_description.${a.name}`,t.description_placeholders);return n?o.qy`<ha-markdown breaks .content="${n}"></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.qy` <p> ${e.localize("ui.panel.config.integrations.config_flow.external_step.description")} </p> ${a?o.qy` <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.qy` ${a?o.qy` <ha-markdown allow-svg breaks .content="${a}"></ha-markdown> `:o.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 a=e.localize(`component.${t.translation_domain||t.handler}.config.progress.${t.progress_action}`,t.description_placeholders);return a?o.qy` <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.qy` <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),renderMenuOptionDescription:(e,t,a)=>e.localize(`component.${t.translation_domain||t.handler}.config.step.${t.step_id}.menu_option_descriptions.${a}`,t.description_placeholders),renderLoadingDescription(e,t,a,o){if("loading_flow"!==t&&"loading_step"!==t)return"";const r=o?.handler||a;return e.localize(`ui.panel.config.integrations.config_flow.loading.${t}`,{integration:r?(0,i.p$)(e.localize,r):e.localize("ui.panel.config.integrations.config_flow.loading.fallback_title")})}})},29094(e,t,a){a.d(t,{g:()=>i});var o=a(1087);const r=()=>Promise.all([a.e("96261"),a.e("46095"),a.e("31065"),a.e("30628"),a.e("83431"),a.e("92769"),a.e("62453"),a.e("39607"),a.e("19942"),a.e("61153"),a.e("5522"),a.e("90215"),a.e("78398"),a.e("31693"),a.e("70289")]).then(a.bind(a,78314)),i=(e,t,a)=>{(0,o.r)(e,"show-dialog",{dialogTag:"dialog-data-entry-flow",dialogImport:r,dialogParams:{...t,flowConfig:a,dialogParentElement:e}})}},81310(e,t,a){a.a(e,async function(e,t){try{var o=a(62826),r=a(96196),i=a(97735),n=a(94333),s=a(26218),l=a(91926),d=a(90248),c=a(2054),h=a(14503),p=e([d,c]);[d,c]=p.then?(await p)():p;class g extends r.WF{render(){return r.qy` <div class="toolbar ${(0,n.H)({narrow:this.narrow})}"> <div class="toolbar-content"> ${this.mainPage||history.state?.root?r.qy` <ha-menu-button .hass="${this.hass}" .narrow="${this.narrow}"></ha-menu-button> `:this.backPath?r.qy` <ha-icon-button-arrow-prev href="${this.backPath}" .hass="${this.hass}"></ha-icon-button-arrow-prev> `:r.qy` <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> <div class="content ha-scrollbar" @scroll="${this._saveScrollPos}"> <slot></slot> </div> <div id="fab"> <slot name="fab"></slot> </div> `}_saveScrollPos(e){this._savedScrollPos=e.target.scrollTop}_backTapped(){this.backCallback?this.backCallback():(0,l.O)()}static get styles(){return[h.dp,r.AH`:host{display:block;height:100%;background-color:var(--primary-background-color);overflow:hidden;position:relative}:host([narrow]){width:100%;position:fixed}.toolbar{background-color:var(--app-header-background-color);padding-top:var(--safe-area-inset-top);padding-right:var(--safe-area-inset-right)}:host([narrow]) .toolbar{padding-left:var(--safe-area-inset-left)}.toolbar-content{display:flex;align-items:center;font-size:var(--ha-font-size-xl);height:var(--header-height);font-weight:var(--ha-font-weight-normal);color:var(--app-header-text-color,#fff);border-bottom:var(--app-header-border-bottom,none);box-sizing:border-box;padding:8px 12px}.toolbar a{color:var(--sidebar-text-color);text-decoration:none}::slotted([slot=toolbar-icon]),ha-icon-button-arrow-prev,ha-menu-button{display:flex;align-items:center;pointer-events:auto;color:var(--sidebar-icon-color)}.main-title{margin-inline-start:var(--ha-space-6);line-height:var(--ha-line-height-normal);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}.narrow .main-title{margin-inline-start:var(--ha-space-2)}.content{position:relative;width:calc(100% - var(--safe-area-inset-right,0px));height:calc(100% - 1px - var(--header-height,0px) - var(--safe-area-inset-top,0px) - var(--safe-area-inset-bottom,0px));padding-bottom:var(--safe-area-inset-bottom,0px);margin-right:var(--safe-area-inset-right);overflow-y:auto;overflow:auto;-webkit-overflow-scrolling:touch}:host([narrow]) .content{width:calc(100% - var(--safe-area-inset-left,0px) - var(--safe-area-inset-right,0px));margin-left:var(--safe-area-inset-left)}#fab{position:absolute;right:calc(16px + var(--safe-area-inset-right,0px));inset-inline-end:calc(16px + var(--safe-area-inset-right,0px));inset-inline-start:initial;bottom:calc(16px + var(--safe-area-inset-bottom,0px));z-index:1;display:flex;flex-wrap:wrap;justify-content:flex-end;gap:var(--ha-space-2)}:host([narrow]) #fab.tabs{bottom:calc(84px + var(--safe-area-inset-bottom,0px))}#fab[is-wide]{bottom:calc(24px + var(--safe-area-inset-bottom,0px));right:calc(24px + var(--safe-area-inset-right,0px));inset-inline-end:calc(24px + var(--safe-area-inset-right,0px));inset-inline-start:initial}`]}constructor(...e){super(...e),this.mainPage=!1,this.narrow=!1}}(0,o.Cg)([(0,i.MZ)({attribute:!1})],g.prototype,"hass",void 0),(0,o.Cg)([(0,i.MZ)()],g.prototype,"header",void 0),(0,o.Cg)([(0,i.MZ)({type:Boolean,attribute:"main-page"})],g.prototype,"mainPage",void 0),(0,o.Cg)([(0,i.MZ)({type:String,attribute:"back-path"})],g.prototype,"backPath",void 0),(0,o.Cg)([(0,i.MZ)({attribute:!1})],g.prototype,"backCallback",void 0),(0,o.Cg)([(0,i.MZ)({type:Boolean,reflect:!0})],g.prototype,"narrow",void 0),(0,o.Cg)([(0,s.a)(".content")],g.prototype,"_savedScrollPos",void 0),(0,o.Cg)([(0,i.Ls)({passive:!0})],g.prototype,"_saveScrollPos",null),g=(0,o.Cg)([(0,i.EM)("hass-subpage")],g),t()}catch(e){t(e)}})},81540(e,t,a){a.d(t,{s:()=>r});var o=a(1087);const r=(e,t)=>{(0,o.r)(e,"show-dialog",{dialogTag:"ha-dialog-thread-dataset",dialogImport:()=>a.e("2351").then(a.bind(a,64946)),dialogParams:t})}},99954(e,t,a){a.a(e,async function(e,o){try{a.r(t),a.d(t,{ThreadConfigPanel:()=>E});a(44114),a(18111),a(20116),a(61701);var r=a(62826),i=a(96196),n=a(97735),s=a(22786),l=a(36312),d=a(52220),c=a(6030),h=a(18350),p=(a(76776),a(29823)),g=(a(70947),a(82e3)),f=a(96204),u=a(20505),m=a(16790),v=a(77763),_=a(65063),b=a(81310),w=a(54706),y=a(14503),x=a(44144),$=a(36918),k=a(30039),C=a(81540),z=e([h,p,b]);[h,p,b]=z.then?(await z)():z;const M="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",A="M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19M8,9H16V19H8V9M15.5,4L14.5,3H9.5L8.5,4H5V6H19V4H15.5Z",H="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",S="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",T="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";class E extends((0,w.E)(i.WF)){render(){const e=this._groupRoutersByNetwork(this._routers,this._datasets);return i.qy` <hass-subpage .narrow="${this.narrow}" .hass="${this.hass}" header="Thread" back-path="/config"> <ha-dropdown slot="toolbar-icon"> <ha-icon-button .path="${S}" slot="trigger" .label="${this.hass.localize("ui.common.menu")}"></ha-icon-button> <a href="${(0,f.WV)(this._configEntryId||"")}" target="_blank" @click="${this._signUrl}"> <ha-dropdown-item> ${this.hass.localize("ui.panel.config.integrations.config_entry.download_diagnostics")} </ha-dropdown-item> </a> <ha-dropdown-item @click="${this._addTLV}">${this.hass.localize("ui.panel.config.thread.add_dataset_from_tlv")}</ha-dropdown-item> <ha-dropdown-item @click="${this._addOTBR}">${this.hass.localize("ui.panel.config.thread.add_open_thread_border_router")}</ha-dropdown-item> </ha-dropdown> <div class="content"> <h1>${this.hass.localize("ui.panel.config.thread.my_network")}</h1> ${e.preferred?this._renderNetwork(e.preferred):i.qy`<ha-card> <div class="card-content no-routers"> <h3> ${this.hass.localize("ui.panel.config.thread.no_preferred_network")} </h3> <ha-svg-icon .path="${H}"></ha-svg-icon> <ha-button appearance="plain" size="small" href="${(0,$.o)(this.hass,"/integrations/thread")}" target="_blank"> ${this.hass.localize("ui.panel.config.thread.more_info")}</ha-button> </div> </ha-card>`} ${e.networks.length?i.qy`<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?i.qy`<ha-fab slot="fab" @click="${this._importExternalThreadCredentials}" extended .label="${this.hass.localize("ui.panel.config.thread.thread_network_send_credentials_ha")}"><ha-svg-icon slot="icon" .path="${M}"></ha-svg-icon></ha-fab>`:i.s6} </hass-subpage> `}_renderNetwork(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 i.qy`<ha-card> <div class="card-header"> ${e.name}${e.dataset?i.qy`<div> <ha-icon-button .label="${this.hass.localize("ui.panel.config.thread.thread_network_info")}" .otbr="${t}" .network="${e}" .path="${T}" @click="${this._showDatasetInfo}"></ha-icon-button>${e.dataset.preferred||e.routers?.length?"":i.qy`<ha-icon-button .label="${this.hass.localize("ui.panel.config.thread.thread_network_delete_credentials")}" .networkDataset="${e.dataset}" .path="${A}" @click="${this._removeDataset}"></ha-icon-button>`} </div>`:""} </div> ${e.routers?.length?i.qy`<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,r=o&&t.extended_address===e.dataset.preferred_extended_address,n=o||a;return i.qy`<ha-list-item class="router" twoline graphic="avatar" .hasMeta="${n}"> <img slot="graphic" .src="${(0,x.MR)({domain:t.brand,type:"icon",darkOptimized:this.hass.themes?.darkMode},this.hass.auth.data.hassUrl)}" 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> ${n?i.qy`${r?i.qy`<ha-svg-icon .path="${M}" .title="${this.hass.localize("ui.panel.config.thread.default_router")}"></ha-svg-icon>`:""} <ha-dropdown slot="meta" .network="${e}" .router="${t}" .otbr="${a}" @wa-select="${this._handleRouterAction}"> <ha-icon-button .label="${this.hass.localize("ui.common.overflow_menu")}" .path="${S}" slot="trigger"></ha-icon-button> ${o?i.qy`<ha-dropdown-item value="set-default" .disabled="${r}"> ${r?this.hass.localize("ui.panel.config.thread.default_router"):this.hass.localize("ui.panel.config.thread.set_default_router")} </ha-dropdown-item>`:""} ${a?i.qy`<ha-dropdown-item value="reset-router"> ${this.hass.localize("ui.panel.config.thread.reset_border_router")}</ha-dropdown-item> <ha-dropdown-item value="change-channel"> ${this.hass.localize("ui.panel.config.thread.change_channel")}</ha-dropdown-item> ${e.dataset?.preferred?"":i.qy`<ha-dropdown-item value="add-to-network"> ${this.hass.localize("ui.panel.config.thread.add_to_my_network")} </ha-dropdown-item>`}`:""} </ha-dropdown>`:""} </ha-list-item>`})}`:i.qy`<div class="card-content no-routers"> <ha-svg-icon .path="${H}"></ha-svg-icon> ${t?i.qy`${this.hass.localize("ui.panel.config.thread.no_routers_otbr_network")} <ha-button appearance="plain" size="small" .otbr="${t}" @click="${this._resetBorderRouterEvent}">${this.hass.localize("ui.panel.config.thread.reset_border_router")}</ha-button>`:this.hass.localize("ui.panel.config.thread.no_border_routers")} </div> `} ${e.dataset&&!e.dataset.preferred?i.qy`<div class="card-actions"> <ha-button .datasetId="${e.dataset.dataset_id}" @click="${this._setPreferred}">${this.hass.localize("ui.panel.config.thread.thread_network_make_preferred")}</ha-button> </div>`:""} ${a&&e.dataset?.preferred&&e.routers?.length?i.qy`<div class="card-actions"> <ha-button size="small" .networkDataset="${e.dataset}" @click="${this._sendCredentials}">${this.hass.localize("ui.panel.config.thread.thread_network_send_credentials_phone")}</ha-button> </div>`:""} </ha-card>`}async _sendCredentials(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,m.dy)(this.hass,t.dataset_id)).tlv,extended_pan_id:t.extended_pan_id}}):(0,_.showAlertDialog)(this,{title:"Error",text:this.hass.localize("ui.panel.config.thread.no_preferred_router")}))}async _showDatasetInfo(e){const t=e.currentTarget.network,a=e.currentTarget.otbr;(0,C.s)(this,{network:t,otbrInfo:a})}_importExternalThreadCredentials(){this.hass.auth.external.fireMessage({type:"thread/import_credentials"})}_onImageError(e){e.target.style.display="none"}_onImageLoad(e){e.target.style.display=""}hassSubscribe(){return[(0,m.wm)(this.hass,e=>{this._routers=e})]}firstUpdated(e){super.firstUpdated(e),this._refresh(),this._configEntryId=(0,c.p9)("config_entry")}async _refresh(){if((0,m.sL)(this.hass).then(e=>{this._datasets=e.datasets}),(0,l.x)(this.hass,"otbr"))try{this._otbrInfo=await(0,u.Er)(this.hass)}catch(e){this._otbrInfo=void 0}}async _signUrl(e){const t=e.target.closest("a");e.preventDefault();const a=await(0,g.e0)(this.hass,t.getAttribute("href"));(0,k.R)(a.path)}_addOTBR(){(0,v.W)(this,{dialogClosedCallback:()=>{this._refresh()},startFlowHandler:"otbr",showAdvanced:this.hass.userData?.showAdvanced})}_handleRouterAction(e){const t=e.currentTarget.network,a=e.currentTarget.router,o=e.currentTarget.otbr;switch(e.detail.item.value){case"set-default":this._setPreferredBorderAgent(t.dataset,a);break;case"reset-router":this._resetBorderRouter(o);break;case"change-channel":this._changeChannel(o);break;case"add-to-network":this._setDataset(o)}}_resetBorderRouterEvent(e){const t=e.currentTarget.otbr;this._resetBorderRouter(t)}async _resetBorderRouter(e){if(await(0,_.dk)(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(0,u.CW)(this.hass,e.extended_address)}catch(e){(0,_.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.thread.otbr_config_failed"),text:e.message})}this._refresh()}}async _setDataset(e){const t=this._groupRoutersByNetwork(this._routers,this._datasets),a=t.preferred?.dataset?.dataset_id;if(!a)return;if(await(0,_.dk)(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(0,u.CE)(this.hass,e.extended_address,a)}catch(e){(0,_.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.thread.otbr_config_failed"),text:e.message})}this._refresh()}}async _setPreferred(e){const t=e.target.datasetId;await(0,m.W4)(this.hass,t),this._refresh()}async _setPreferredBorderAgent(e,t){await(0,m.l1)(this.hass,e.dataset_id,t.border_agent_id,t.extended_address),this._refresh()}async _addTLV(){const e=await(0,_.an)(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,m.It)(this.hass,"manual",e)}catch(e){(0,_.showAlertDialog)(this,{title:"Error",text:e.message||e})}this._refresh()}}async _removeDataset(e){const t=e.currentTarget.networkDataset;if(await(0,_.dk)(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,m.rY)(this.hass,t.dataset_id)}catch(e){(0,_.showAlertDialog)(this,{title:"Error",text:e.message||e})}this._refresh()}}async _changeChannel(e){const t=e.channel,a=await(0,_.an)(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,_.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(0,u.pW)(this.hass,e.extended_address,o);(0,_.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,_.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,_.showAlertDialog)(this,{title:"Error",text:e.message||e})}this._refresh()}}constructor(...e){super(...e),this.narrow=!1,this._configEntryId=null,this._routers=[],this._datasets=[],this._groupRoutersByNetwork=(0,s.A)((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,d.xL)(e.name,t.name,this.hass.locale.language))}})}}E.styles=[y.RF,i.AH`.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:var(--ha-border-radius-square)}ha-svg-icon[slot=meta]{width:24px}ha-dropdown 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:var(--ha-border-radius-circle);margin-bottom:8px}ha-card{margin-bottom:16px}h4{margin:0}.card-header{display:flex;justify-content:space-between}`],(0,r.Cg)([(0,n.MZ)({attribute:!1})],E.prototype,"hass",void 0),(0,r.Cg)([(0,n.MZ)({type:Boolean})],E.prototype,"narrow",void 0),(0,r.Cg)([(0,n.wk)()],E.prototype,"_configEntryId",void 0),(0,r.Cg)([(0,n.wk)()],E.prototype,"_routers",void 0),(0,r.Cg)([(0,n.wk)()],E.prototype,"_datasets",void 0),(0,r.Cg)([(0,n.wk)()],E.prototype,"_otbrInfo",void 0),E=(0,r.Cg)([(0,n.EM)("thread-config-panel")],E),o()}catch(e){o(e)}})},14503(e,t,a){a.d(t,{RF:()=>i,dp:()=>l,kO:()=>s,nA:()=>n,og:()=>r});var o=a(96196);const r=o.AH`button.link{background:0 0;color:inherit;border:none;padding:0;font:inherit;text-align:left;text-decoration:underline;cursor:pointer;outline:0}`,i=o.AH`:host{font-family:var(--ha-font-family-body);-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);font-size:var(--ha-font-size-m);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-normal)}app-header div[sticky]{height:48px}app-toolbar [main-title]{margin-left:20px;margin-inline-start:20px;margin-inline-end:initial}.header{transition:box-shadow .2s linear,width var(--ha-animation-duration-normal) ease,padding-left var(--ha-animation-duration-normal) ease,padding-right var(--ha-animation-duration-normal) ease}@media (prefers-reduced-motion:reduce){.header{transition:box-shadow .2s linear}}h1{font-family:var(--ha-font-family-heading);-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);font-size:var(--ha-font-size-2xl);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-condensed)}h2{font-family:var(--ha-font-family-body);-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:var(--ha-font-size-xl);font-weight:var(--ha-font-weight-medium);line-height:var(--ha-line-height-normal)}h3{font-family:var(--ha-font-family-body);-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);font-size:var(--ha-font-size-l);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-normal)}a{color:var(--primary-color)}.secondary{color:var(--secondary-text-color)}.error{color:var(--error-color)}.warning{color:var(--error-color)}${r} .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}`,n=o.AH`
  ha-dialog,
  ha-adaptive-dialog {
    --mdc-dialog-min-width: 400px;
    --mdc-dialog-max-width: 600px;
    --mdc-dialog-max-width: min(600px, 95vw);
    --justify-action-buttons: space-between;
    --dialog-container-padding: var(--safe-area-inset-top, 0)
      var(--safe-area-inset-right, 0) var(--safe-area-inset-bottom, 0)
      var(--safe-area-inset-left, 0);
    --dialog-surface-padding: 0px;
  }

  ha-dialog .form,
  ha-adaptive-dialog .form {
    color: var(--primary-text-color);
  }

  a {
    color: var(--primary-color);
  }

  /* make dialog fullscreen on small screens */
  @media all and (max-width: 450px), all and (max-height: 500px) {
    ha-dialog,
    ha-adaptive-dialog {
      --mdc-dialog-min-width: 100vw;
      --mdc-dialog-max-width: 100vw;
      --mdc-dialog-min-height: 100vh;
      --mdc-dialog-min-height: 100svh;
      --mdc-dialog-max-height: 100vh;
      --mdc-dialog-max-height: 100svh;
      --dialog-container-padding: 0px;
      --dialog-surface-padding: var(--safe-area-inset-top, 0)
        var(--safe-area-inset-right, 0) var(--safe-area-inset-bottom, 0)
        var(--safe-area-inset-left, 0);
      --vertical-align-dialog: flex-end;
      --ha-dialog-border-radius: var(--ha-border-radius-square);
    ha-dialog,
    ha-adaptive-dialog {
     --mdc-dialog-min-width: 100vw;
     --mdc-dialog-max-width: 100vw;
     --mdc-dialog-min-height: 100vh;
     --mdc-dialog-min-height: 100svh;
     --mdc-dialog-max-height: 100vh;
     --mdc-dialog-max-height: 100svh;
     --dialog-container-padding: 0px;
     --dialog-surface-padding: var(--safe-area-inset-top, 0)
       var(--safe-area-inset-right, 0) var(--safe-area-inset-bottom, 0)
       var(--safe-area-inset-left, 0);
     --vertical-align-dialog: flex-end;
   }
   ha-dialog {
      --ha-dialog-border-radius: var(--ha-border-radius-square);
   }
  }
  .error {
    color: var(--error-color);
  }
`,s=o.AH`ha-adaptive-dialog,ha-dialog{--vertical-align-dialog:flex-start;--dialog-surface-margin-top:var(--ha-space-10);--mdc-dialog-max-height:calc(
      100vh - var(--dialog-surface-margin-top) - var(--ha-space-2) - var(
          --safe-area-inset-y,
          0px
        )
    );--mdc-dialog-max-height:calc(
      100svh - var(--dialog-surface-margin-top) - var(--ha-space-2) - var(
          --safe-area-inset-y,
          0px
        )
    );--ha-dialog-max-height:calc(
      100vh - var(--dialog-surface-margin-top) - var(--ha-space-2) - var(
          --safe-area-inset-y,
          0px
        )
    );--ha-dialog-max-height:calc(
      100svh - var(--dialog-surface-margin-top) - var(--ha-space-2) - var(
          --safe-area-inset-y,
          0px
        )
    )}@media all and (max-width:450px),all and (max-height:500px){ha-adaptive-dialog,ha-dialog{--dialog-surface-margin-top:0px;--mdc-dialog-min-height:100vh;--mdc-dialog-min-height:100svh;--mdc-dialog-max-height:100vh;--mdc-dialog-max-height:100svh;--ha-dialog-max-height:100vh;--ha-dialog-max-height:100svh}}`,l=o.AH`.ha-scrollbar::-webkit-scrollbar{width:.4rem;height:.4rem}.ha-scrollbar::-webkit-scrollbar-thumb{border-radius:var(--ha-border-radius-sm);background:var(--scrollbar-thumb-color)}.ha-scrollbar{overflow-y:auto;scrollbar-color:var(--scrollbar-thumb-color) transparent;scrollbar-width:thin}`;o.AH`body{background-color:var(--primary-background-color);color:var(--primary-text-color);height:calc(100vh - 32px);width:100vw}`},36918(e,t,a){a.d(t,{o:()=>o});const o=(e,t)=>`https://${e.config.version.includes("b")?"rc":e.config.version.includes("dev")?"next":"www"}.home-assistant.io${t}`},30039(e,t,a){a.d(t,{R:()=>o});const o=(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)}},63463(e){var t=TypeError;e.exports=function(e){if("string"==typeof e)return e;throw new t("Argument is not a string")}},83972(e,t,a){var o=a(20034),r=String,i=TypeError;e.exports=function(e){if(void 0===e||o(e))return e;throw new i(r(e)+" is not an object or undefined")}},34154(e,t,a){var o=a(36955),r=TypeError;e.exports=function(e){if("Uint8Array"===o(e))return e;throw new r("Argument is not an Uint8Array")}},35370(e,t,a){var o=a(26198);e.exports=function(e,t,a){for(var r=0,i=arguments.length>2?a:o(t),n=new e(i);i>r;)n[r]=t[r++];return n}},92804(e){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",a=t+"+/",o=t+"-_",r=function(e){for(var t={},a=0;a<64;a++)t[e.charAt(a)]=a;return t};e.exports={i2c:a,c2i:r(a),i2cUrl:o,c2iUrl:r(o)}},944(e){var t=TypeError;e.exports=function(e){var a=e&&e.alphabet;if(void 0===a||"base64"===a||"base64url"===a)return a||"base64";throw new t("Incorrect `alphabet` option")}},59143(e,t,a){var o=a(44576),r=a(79504),i=a(83972),n=a(63463),s=a(39297),l=a(92804),d=a(944),c=a(55169),h=l.c2i,p=l.c2iUrl,g=o.SyntaxError,f=o.TypeError,u=r("".charAt),m=function(e,t){for(var a=e.length;t<a;t++){var o=u(e,t);if(" "!==o&&"\t"!==o&&"\n"!==o&&"\f"!==o&&"\r"!==o)break}return t},v=function(e,t,a){var o=e.length;o<4&&(e+=2===o?"AA":"A");var r=(t[u(e,0)]<<18)+(t[u(e,1)]<<12)+(t[u(e,2)]<<6)+t[u(e,3)],i=[r>>16&255,r>>8&255,255&r];if(2===o){if(a&&0!==i[1])throw new g("Extra bits");return[i[0]]}if(3===o){if(a&&0!==i[2])throw new g("Extra bits");return[i[0],i[1]]}return i},_=function(e,t,a){for(var o=t.length,r=0;r<o;r++)e[a+r]=t[r];return a+o};e.exports=function(e,t,a,o){n(e),i(t);var r="base64"===d(t)?h:p,l=t?t.lastChunkHandling:void 0;if(void 0===l&&(l="loose"),"loose"!==l&&"strict"!==l&&"stop-before-partial"!==l)throw new f("Incorrect `lastChunkHandling` option");a&&c(a.buffer);var b=e.length,w=a||[],y=0,x=0,$="",k=0;if(o)for(;;){if((k=m(e,k))===b){if($.length>0){if("stop-before-partial"===l)break;if("loose"!==l)throw new g("Missing padding");if(1===$.length)throw new g("Malformed padding: exactly one additional character");y=_(w,v($,r,!1),y)}x=b;break}var C=u(e,k);if(++k,"="===C){if($.length<2)throw new g("Padding is too early");if(k=m(e,k),2===$.length){if(k===b){if("stop-before-partial"===l)break;throw new g("Malformed padding: only one =")}"="===u(e,k)&&(++k,k=m(e,k))}if(k<b)throw new g("Unexpected character after padding");y=_(w,v($,r,"strict"===l),y),x=b;break}if(!s(r,C))throw new g("Unexpected character");var z=o-y;if(1===z&&2===$.length||2===z&&3===$.length)break;if(4===($+=C).length&&(y=_(w,v($,r,!1),y),$="",x=k,y===o))break}return{bytes:w,read:x,written:y}}},42303(e,t,a){var o=a(44576),r=a(79504),i=o.Uint8Array,n=o.SyntaxError,s=o.parseInt,l=Math.min,d=/[^\da-f]/i,c=r(d.exec),h=r("".slice);e.exports=function(e,t){var a=e.length;if(a%2!=0)throw new n("String should be an even number of characters");for(var o=t?l(t.length,a/2):a/2,r=t||new i(o),p=0,g=0;g<o;){var f=h(e,p,p+=2);if(c(d,f))throw new n("String should only contain hex characters");r[g++]=s(f,16)}return{bytes:r,read:p}}},16632(e,t,a){var o=a(46518),r=a(44576),i=a(59143),n=a(34154),s=r.Uint8Array,l=!s||!s.prototype.setFromBase64||!function(){var e=new s([255,255,255,255,255]);try{return void e.setFromBase64("",null)}catch(e){}try{return void e.setFromBase64("a")}catch(e){}try{e.setFromBase64("MjYyZg===")}catch(t){return 50===e[0]&&54===e[1]&&50===e[2]&&255===e[3]&&255===e[4]}}();s&&o({target:"Uint8Array",proto:!0,forced:l},{setFromBase64:function(e){n(this);var t=i(e,arguments.length>1?arguments[1]:void 0,this,this.length);return{read:t.read,written:t.written}}})},34226(e,t,a){var o=a(46518),r=a(44576),i=a(63463),n=a(34154),s=a(55169),l=a(42303);r.Uint8Array&&o({target:"Uint8Array",proto:!0,forced:function(){try{var e=new ArrayBuffer(16,{maxByteLength:1024});new Uint8Array(e).setFromHex("cafed00d")}catch(e){return!0}}()},{setFromHex:function(e){n(this),i(e),s(this.buffer);var t=l(e,this).read;return{read:t,written:t/2}}})},9486(e,t,a){var o=a(46518),r=a(44576),i=a(79504),n=a(83972),s=a(34154),l=a(55169),d=a(92804),c=a(944),h=d.i2c,p=d.i2cUrl,g=i("".charAt),f=r.Uint8Array,u=!f||!f.prototype.toBase64||!function(){try{(new f).toBase64(null)}catch(e){return!0}}();f&&o({target:"Uint8Array",proto:!0,forced:u},{toBase64:function(){var e=s(this),t=arguments.length?n(arguments[0]):void 0,a="base64"===c(t)?h:p,o=!!t&&!!t.omitPadding;l(this.buffer);for(var r,i="",d=0,f=e.length,u=function(e){return g(a,r>>6*e&63)};d+2<f;d+=3)r=(e[d]<<16)+(e[d+1]<<8)+e[d+2],i+=u(3)+u(2)+u(1)+u(0);return d+2===f?(r=(e[d]<<16)+(e[d+1]<<8),i+=u(3)+u(2)+u(1)+(o?"":"=")):d+1===f&&(r=e[d]<<16,i+=u(3)+u(2)+(o?"":"==")),i}})},20456(e,t,a){var o=a(46518),r=a(44576),i=a(79504),n=a(34154),s=a(55169),l=i(1.1.toString),d=r.Uint8Array,c=!d||!d.prototype.toHex||!function(){try{return"ffffffffffffffff"===new d([255,255,255,255,255,255,255,255]).toHex()}catch(e){return!1}}();d&&o({target:"Uint8Array",proto:!0,forced:c},{toHex:function(){n(this),s(this.buffer);for(var e="",t=0,a=this.length;t<a;t++){var o=l(this[t],16);e+=1===o.length?"0"+o:o}return e}})}};
//# sourceMappingURL=49372.d0f983cf8e23acd8.js.map