"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["19434"],{63130:function(t,i,s){s.d(i,{l:function(){return a}});s(3362);var e=s(50248);const a=async(t,i)=>{if(navigator.clipboard)try{return void(await navigator.clipboard.writeText(t))}catch(o){}const s=i||(()=>{const t=(0,e.n)();if(t instanceof HTMLElement){let i=t.getRootNode(),s=null;for(;i instanceof ShadowRoot&&i.host instanceof HTMLElement;)s=i.host,i=i.host.getRootNode();if(s)return s}return document.body})(),a=document.createElement("textarea");a.value=t,a.setAttribute("readonly",""),a.style.position="fixed",a.style.top="0",a.style.left="0",a.style.opacity="0",s.appendChild(a),a.select(),document.execCommand("copy"),s.removeChild(a)}},53073:function(t,i,s){s.a(t,async function(t,e){try{s.r(i);s(18111),s(61701),s(3362),s(62953);var a=s(40445),o=s(96196),n=s(77845),l=s(1087),c=s(63130),r=(s(8630),s(18350)),h=(s(93444),s(28732),s(65829)),d=s(72554),p=s(20559),g=s(14503),u=s(81619),_=t([r,h,d]);[r,h,d]=_.then?(await _)():_;let f,m,v,y,$,C,L,b,x,w=t=>t;const M="M13,13H11V7H13M13,17H11V15H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z",k="M12 2C6.5 2 2 6.5 2 12S6.5 22 12 22 22 17.5 22 12 17.5 2 12 2M10 17L5 12L6.41 10.59L10 14.17L17.59 6.58L19 8L10 17Z",E="M12,2C17.53,2 22,6.47 22,12C22,17.53 17.53,22 12,22C6.47,22 2,17.53 2,12C2,6.47 6.47,2 12,2M15.59,7L12,10.59L8.41,7L7,8.41L10.59,12L7,15.59L8.41,17L12,13.41L15.59,17L17,15.59L13.41,12L17,8.41L15.59,7Z";class R extends o.WF{async showDialog(t){this.device_id=t.device_id,this._open=!0}async _copyIpToClipboard(t){const i=t.currentTarget.ip;await(0,c.l)(i),(0,u.P)(this,{message:this.hass.localize("ui.common.copied_clipboard")})}render(){return this.device_id?(0,o.qy)(f||(f=w` <ha-dialog .hass="${0}" .open="${0}" header-title="${0}" @closed="${0}"> ${0} <ha-dialog-footer slot="footer"> ${0} </ha-dialog-footer> </ha-dialog> `),this.hass,this._open,this.hass.localize("ui.panel.config.matter.ping_node.title"),this._dialogClosed,"failed"===this._status?(0,o.qy)(m||(m=w` <div class="flex-container"> <ha-svg-icon .path="${0}" class="failed"></ha-svg-icon> <div class="status"> <p> ${0} </p> </div> </div> `),E,this.hass.localize(this._pingResultEntries?"ui.panel.config.matter.ping_node.no_ip_found":"ui.panel.config.matter.ping_node.ping_failed")):this._pingResultEntries?(0,o.qy)(v||(v=w` <h2> ${0} </h2> <ha-list> ${0} </ha-list> `),this.hass.localize("ui.panel.config.matter.ping_node.ping_complete"),this._pingResultEntries.map(([t,i])=>(0,o.qy)(y||(y=w`<ha-list-item hasMeta .ip="${0}" @click="${0}">${0} <ha-svg-icon slot="meta" .path="${0}" class="${0}"></ha-svg-icon> </ha-list-item>`),t,this._copyIpToClipboard,t,i?k:M,i?"success":"failed"))):"started"===this._status?(0,o.qy)($||($=w` <div class="flex-container"> <ha-spinner></ha-spinner> <div class="status"> <p> <b> ${0} </b> </p> </div> </div> `),this.hass.localize("ui.panel.config.matter.ping_node.in_progress")):(0,o.qy)(C||(C=w` <p> ${0} </p> <p> <em> ${0} </em> </p> `),this.hass.localize("ui.panel.config.matter.ping_node.introduction"),this.hass.localize("ui.panel.config.matter.ping_node.battery_device_warning")),"failed"===this._status||this._pingResultEntries||"started"===this._status?(0,o.qy)(L||(L=w` <ha-button slot="primaryAction" @click="${0}"> ${0} </ha-button> `),this.closeDialog,this.hass.localize("ui.common.close")):(0,o.qy)(b||(b=w` <ha-button slot="primaryAction" @click="${0}"> ${0} </ha-button> `),this._startPing,this.hass.localize("ui.panel.config.matter.ping_node.start_ping"))):o.s6}async _startPing(){if(this.hass){this._status="started";try{const t=await(0,p.OW)(this.hass,this.device_id),i=Object.entries(t);0===i.length&&(this._status="failed"),this._pingResultEntries=i}catch(t){this._status="failed"}}}closeDialog(){this._open=!1}_dialogClosed(){this.device_id=void 0,this._status=void 0,this._pingResultEntries=void 0,(0,l.r)(this,"dialog-closed",{dialog:this.localName})}static get styles(){return[g.RF,g.nA,(0,o.AH)(x||(x=w`.success{color:var(--success-color)}.failed{color:var(--error-color)}.flex-container{display:flex;align-items:center}.stages{margin-top:16px}.stage{padding:8px}ha-list{--mdc-list-side-padding:0}.flex-container ha-spinner,.flex-container ha-svg-icon{margin-right:20px}.flex-container ha-svg-icon{width:68px;height:48px}`))]}constructor(...t){super(...t),this._open=!1}}(0,a.Cg)([(0,n.MZ)({attribute:!1})],R.prototype,"hass",void 0),(0,a.Cg)([(0,n.wk)()],R.prototype,"device_id",void 0),(0,a.Cg)([(0,n.wk)()],R.prototype,"_status",void 0),(0,a.Cg)([(0,n.wk)()],R.prototype,"_pingResultEntries",void 0),(0,a.Cg)([(0,n.wk)()],R.prototype,"_open",void 0),R=(0,a.Cg)([(0,n.EM)("dialog-matter-ping-node")],R),e()}catch(f){e(f)}})}}]);
//# sourceMappingURL=19434.03de89f8c687b6dc.js.map