export const __rspack_esm_id="61854";export const __rspack_esm_ids=["61854"];export const __webpack_modules__={57150(e,t,i){i.d(t,{Q:()=>o});var s=i(1087);const a=()=>Promise.all([i.e("92769"),i.e("62453"),i.e("8477"),i.e("72130"),i.e("85010"),i.e("39607"),i.e("25582"),i.e("99788"),i.e("21543"),i.e("86909"),i.e("2217"),i.e("98153"),i.e("78398"),i.e("34310"),i.e("19112"),i.e("30002"),i.e("21519"),i.e("25322"),i.e("12009"),i.e("94860"),i.e("55076"),i.e("36332"),i.e("15862"),i.e("82529"),i.e("40069"),i.e("99023"),i.e("10395"),i.e("50319"),i.e("12057")]).then(i.bind(i,78305)),o=(e,t)=>{(0,s.r)(e,"show-dialog",{dialogTag:"hui-dialog-suggest-card",dialogImport:a,dialogParams:t})}},85633(e,t,i){i.d(t,{X:()=>a});var s=i(1087);const a=(e,t)=>{(0,s.r)(e,"show-dialog",{dialogTag:"hui-dialog-select-view",dialogImport:()=>Promise.all([i.e("4939"),i.e("30115"),i.e("40901")]).then(i.bind(i,54564)),dialogParams:t})}},39693(e,t,i){i.a(e,async function(e,s){try{i.r(t),i.d(t,{HuiUnusedEntities:()=>_});var a=i(62826),o=i(96196),n=i(97735),l=i(94333),c=(i(27661),i(67094),i(99939)),d=i(55212),h=i(83824),r=i(57150),g=i(85633),v=e([h]);h=(v.then?(await v)():v)[0];const u="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z";class _ extends o.WF{get _config(){return this.lovelace.config}updated(e){super.updated(e),e.has("lovelace")&&this._getUnusedEntities()}render(){return this.hass&&this.lovelace?"storage"===this.lovelace.mode&&!1===this.lovelace.editMode?o.s6:o.qy` <div class="container"> ${this.narrow?"":o.qy` <ha-card header="${this.hass.localize("ui.panel.lovelace.unused_entities.title")}"> <div class="card-content"> ${this.hass.localize("ui.panel.lovelace.unused_entities.available_entities")} ${"storage"===this.lovelace.mode?o.qy` <br>${this.hass.localize("ui.panel.lovelace.unused_entities.select_to_add")} `:""} </div> </ha-card> `} <hui-entity-picker-table .hass="${this.hass}" .narrow="${this.narrow}" .entities="${this._unusedEntities}" @selected-changed="${this._handleSelectedChanged}"></hui-entity-picker-table> </div> <div class="fab ${(0,l.H)({selected:this._selectedEntities.length})}"> <ha-fab .label="${this.hass.localize("ui.panel.lovelace.editor.edit_card.add")}" extended @click="${this._addToLovelaceView}"> <ha-svg-icon slot="icon" .path="${u}"></ha-svg-icon> </ha-fab> </div> `:o.s6}_getUnusedEntities(){if(!this.hass||!this.lovelace)return;this._selectedEntities=[];const e=(0,c.lZ)(this.hass,this._config);this._unusedEntities=[...e].sort()}_handleSelectedChanged(e){this._selectedEntities=e.detail.selectedEntities}_addToLovelaceView(){const e=(0,d.Bi)(this.hass,this._selectedEntities,{}),t=(0,d.ZI)(this._selectedEntities,{});1!==this.lovelace.config.views.length?(0,g.X)(this,{lovelaceConfig:this.lovelace.config,allowDashboardChange:!1,viewSelectedCallback:(i,s,a)=>{(0,r.Q)(this,{lovelaceConfig:this.lovelace.config,saveConfig:this.lovelace.saveConfig,path:[a],entities:this._selectedEntities,cardConfig:e,sectionConfig:t})}}):(0,r.Q)(this,{lovelaceConfig:this.lovelace.config,saveConfig:this.lovelace.saveConfig,path:[0],entities:this._selectedEntities,cardConfig:e,sectionConfig:t})}constructor(...e){super(...e),this.narrow=!1,this._unusedEntities=[],this._selectedEntities=[]}}_.styles=o.AH`:host{overflow:hidden}.container{display:flex;flex-direction:column;height:100%}ha-card{--ha-card-box-shadow:none;--ha-card-border-radius:var(--ha-border-radius-square)}hui-entity-picker-table{flex-grow:1}.fab{position:sticky;float:var(--float-end);right:calc(16px + var(--safe-area-inset-right));bottom:calc(16px + var(--safe-area-inset-bottom));inset-inline-end:calc(16px + var(--safe-area-inset-right));inset-inline-start:initial;z-index:1}ha-fab{position:relative;bottom:calc(-80px - var(--safe-area-inset-bottom));transition:bottom .3s}.fab.selected ha-fab{bottom:0}`,(0,a.Cg)([(0,n.MZ)({attribute:!1})],_.prototype,"lovelace",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],_.prototype,"hass",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean})],_.prototype,"narrow",void 0),(0,a.Cg)([(0,n.wk)()],_.prototype,"_unusedEntities",void 0),(0,a.Cg)([(0,n.wk)()],_.prototype,"_selectedEntities",void 0),_=(0,a.Cg)([(0,n.EM)("hui-unused-entities")],_),s()}catch(e){s(e)}})}};
//# sourceMappingURL=61854.556c9f84e4c603ad.js.map