export const __rspack_esm_id=1989;export const __rspack_esm_ids=[1989];export const __webpack_modules__={16227(t,i,s){var e=s(50649);s.d(i,{},{l:async(t,i)=>{if(navigator.clipboard)try{return void await navigator.clipboard.writeText(t)}catch{}const s=i||(0,e.n)()?.getRootNode()||document.body,a=s.nodeType===Node.DOCUMENT_NODE?document.body:s,o=document.createElement("textarea");o.value=t,o.setAttribute("readonly",""),o.style.position="fixed",o.style.top="0",o.style.left="0",o.style.opacity="0",a.appendChild(o),o.select(),document.execCommand("copy"),a.removeChild(o)}})},93444(t,i,s){s.a(t,async function(t,e){try{s.r(i);s(18111),s(61701);var a=s(15697),o=s(57527),n=s(79224),l=s(148),c=s(16227),r=(s(25087),s(98747)),d=(s(90507),s(37955),s(15466)),p=s(73651),h=s(7064),g=s(76730),_=s(95678),u=t([r,d,p]);[r,d,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(t){this.device_id=t.device_id,this._open=!0}async _copyIpToClipboard(t){const i=t.currentTarget.ip;await(0,c.l)(i),(0,_.P)(this,{message:this.hass.localize("ui.common.copied_clipboard")})}render(){return this.device_id?o.qy` <ha-dialog .open=${this._open} header-title=${this.hass.localize("ui.panel.config.matter.ping_node.title")} @closed=${this._dialogClosed}> ${"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> `:this._pingResultEntries?o.qy` <h2> ${this.hass.localize("ui.panel.config.matter.ping_node.ping_complete")} </h2> <ha-list> ${this._pingResultEntries.map(([t,i])=>o.qy`<ha-list-item hasMeta .ip=${t} @click=${this._copyIpToClipboard}>${t} <ha-svg-icon slot="meta" .path=${i?v:m} class=${i?"success":"failed"}></ha-svg-icon> </ha-list-item>`)} </ha-list> `:"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> `: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-dialog-footer slot="footer"> ${"failed"===this._status||this._pingResultEntries||"started"===this._status?o.qy` <ha-button slot="primaryAction" @click=${this.closeDialog}> ${this.hass.localize("ui.common.close")} </ha-button> `:o.qy` <ha-button slot="primaryAction" @click=${this._startPing}> ${this.hass.localize("ui.panel.config.matter.ping_node.start_ping")} </ha-button> `} </ha-dialog-footer> </ha-dialog> `:o.s6}async _startPing(){if(this.hass){this._status="started";try{const t=await(0,h.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,o.AH`.success{color:var(--success-color)}.failed{color:var(--error-color)}.flex-container{align-items:center;display:flex}.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})],f.prototype,"hass",void 0),(0,a.Cg)([(0,n.wk)()],f.prototype,"device_id",void 0),(0,a.Cg)([(0,n.wk)()],f.prototype,"_status",void 0),(0,a.Cg)([(0,n.wk)()],f.prototype,"_pingResultEntries",void 0),(0,a.Cg)([(0,n.wk)()],f.prototype,"_open",void 0),f=(0,a.Cg)([(0,n.EM)("dialog-matter-ping-node")],f),e()}catch(t){e(t)}})}};
//# sourceMappingURL=1989.e1b5a77cad89c68f.js.map