export const __rspack_esm_id="19434";export const __rspack_esm_ids=["19434"];export const __webpack_modules__={63130(i,t,s){s.d(t,{l:()=>a});const a=async(i,t)=>{if(navigator.clipboard)try{return void await navigator.clipboard.writeText(i)}catch{}const s=t??document.body,a=document.createElement("textarea");a.value=i,s.appendChild(a),a.select(),document.execCommand("copy"),s.removeChild(a)}},53073(i,t,s){s.a(i,async function(i,a){try{s.r(t);s(18111),s(61701);var e=s(62826),o=s(96196),n=s(44457),c=s(1087),l=s(63130),h=s(72554),r=(s(8630),s(18350)),p=(s(28732),s(65829)),d=s(20559),g=s(14503),_=s(81619),u=i([r,p]);[r,p]=u.then?(await u)():u;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",v="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",y="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 f extends o.WF{async showDialog(i){this.device_id=i.device_id}async _copyIpToClipboard(i){const t=i.currentTarget.ip;await(0,l.l)(t),(0,_.P)(this,{message:this.hass.localize("ui.common.copied_clipboard")})}render(){return this.device_id?o.qy` <ha-dialog open @closed="${this.closeDialog}" .heading="${(0,h.l)(this.hass,this.hass.localize("ui.panel.config.matter.ping_node.title"))}"> ${"failed"===this._status?o.qy` <div class="flex-container"> <ha-svg-icon .path="${y}" class="failed"></ha-svg-icon> <div class="status"> <p> ${this.hass.localize(this._pingResultEntries?"ui.panel.config.matter.ping_node.no_ip_found":"ui.panel.config.matter.ping_node.ping_failed")} </p> </div> </div> <ha-button slot="primaryAction" @click="${this.closeDialog}"> ${this.hass.localize("ui.common.close")} </ha-button> `:this._pingResultEntries?o.qy` <h2> ${this.hass.localize("ui.panel.config.matter.ping_node.ping_complete")} </h2> <ha-list> ${this._pingResultEntries.map(([i,t])=>o.qy`<ha-list-item hasMeta .ip="${i}" @click="${this._copyIpToClipboard}">${i} <ha-svg-icon slot="meta" .path="${t?v:m}" class="${t?"success":"failed"}"></ha-svg-icon> </ha-list-item>`)} </ha-list> <ha-button slot="primaryAction" @click="${this.closeDialog}"> ${this.hass.localize("ui.common.close")} </ha-button> `:"started"===this._status?o.qy` <div class="flex-container"> <ha-spinner></ha-spinner> <div class="status"> <p> <b> ${this.hass.localize("ui.panel.config.matter.ping_node.in_progress")} </b> </p> </div> </div> <ha-button slot="primaryAction" @click="${this.closeDialog}"> ${this.hass.localize("ui.common.close")} </ha-button> `:o.qy` <p> ${this.hass.localize("ui.panel.config.matter.ping_node.introduction")} </p> <p> <em> ${this.hass.localize("ui.panel.config.matter.ping_node.battery_device_warning")} </em> </p> <ha-button slot="primaryAction" @click="${this._startPing}"> ${this.hass.localize("ui.panel.config.matter.ping_node.start_ping")} </ha-button> `} </ha-dialog> `:o.s6}async _startPing(){if(this.hass){this._status="started";try{const i=await(0,d.OW)(this.hass,this.device_id),t=Object.entries(i);0===t.length&&(this._status="failed"),this._pingResultEntries=t}catch(i){this._status="failed"}}}closeDialog(){this.device_id=void 0,this._status=void 0,this._pingResultEntries=void 0,(0,c.r)(this,"dialog-closed",{dialog:this.localName})}static get styles(){return[g.RF,g.nA,o.AH`.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}`]}}(0,e.Cg)([(0,n.MZ)({attribute:!1})],f.prototype,"hass",void 0),(0,e.Cg)([(0,n.wk)()],f.prototype,"device_id",void 0),(0,e.Cg)([(0,n.wk)()],f.prototype,"_status",void 0),(0,e.Cg)([(0,n.wk)()],f.prototype,"_pingResultEntries",void 0),f=(0,e.Cg)([(0,n.EM)("dialog-matter-ping-node")],f),a()}catch(i){a(i)}})}};
//# sourceMappingURL=19434.0edcad969c4e2260.js.map