UNPKG

iobroker.lovelace

Version:

With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI

2 lines 39.5 kB
/*! For license information please see 5590.90c61643f360d21b.js.LICENSE.txt */ export const __rspack_esm_id=5590;export const __rspack_esm_ids=[5590];export const __webpack_modules__={82474(t,e,i){i.a(t,async function(t,e){try{i(18111),i(20116),i(61701);var a=i(62826),s=i(5124),o=i(22441),n=i(22786),l=i(1087),r=i(74705),h=i(78649),c=i(53756),d=i(95350),p=i(24367),g=i(19711),u=(i(75064),i(38508)),m=(i(47680),i(67094),i(74281)),v=t([u,m]);[u,m]=v.then?(await v)():v;const _="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z",y="M11,13.5V21.5H3V13.5H11M12,2L17.5,11H6.5L12,2M17.5,13C20,13 22,15 22,17.5C22,20 20,22 17.5,22C15,22 13,20 13,17.5C13,15 15,13 17.5,13Z",b="___create-new-entity___";class f extends s.WF{willUpdate(t){this._pendingEntityId&&t.has("hass")&&this.hass.states!==t.get("hass")?.states&&this.hass.states[this._pendingEntityId]&&(this._setValue(this._pendingEntityId),this._pendingEntityId=void 0)}firstUpdated(t){super.firstUpdated(t),this.hass.loadBackendTranslation("title")}_findExtraOption(t){return t?this.extraOptions?.find(e=>e.id===t):void 0}_renderExtraOptionStart(t){const e=t.entity_id?this.hass.states[t.entity_id]:void 0;return e?s.qy` <state-badge slot="start" .stateObj="${e}" .hass="${this.hass}"></state-badge> `:t.icon_path?s.qy` <ha-svg-icon slot="start" .path="${t.icon_path}" style="margin:0 4px"></ha-svg-icon> `:t.icon?s.qy`<ha-icon slot="start" .icon="${t.icon}"></ha-icon>`:s.s6}get _showEntityId(){return this.showEntityId||this.hass.userData?.showEntityIdPicker}_shouldHideClearIcon(){return!!this._findExtraOption(this.value)?.hide_clear}render(){const t=this.placeholder??this.hass.localize("ui.components.entity.entity-picker.placeholder");return s.qy` <ha-generic-picker .hass="${this.hass}" .disabled="${this.disabled}" .autofocus="${this.autofocus}" .allowCustomValue="${this.allowCustomEntity}" .required="${this.required}" .label="${this.label}" .placeholder="${t}" .helper="${this.helper}" .value="${this.addButton?void 0:this.value}" .searchLabel="${this.searchLabel}" .notFoundLabel="${this._notFoundLabel}" .rowRenderer="${this._rowRenderer}" .getItems="${this._getItems}" .getAdditionalItems="${this._getAdditionalItems}" .hideClearIcon="${this.hideClearIcon||this._shouldHideClearIcon()}" .searchFn="${this._searchFn}" .valueRenderer="${this._valueRenderer}" .searchKeys="${c.t}" use-top-label .addButtonLabel="${this.addButton?this.addButtonLabel??this.hass.localize("ui.components.entity.entity-picker.add"):void 0}" .unknownItemText="${this.hass.localize("ui.components.entity.entity-picker.unknown")}" @value-changed="${this._valueChanged}"> </ha-generic-picker> `}async open(){await this.updateComplete,await(this._picker?.open())}_valueChanged(t){t.stopPropagation();const e=t.detail.value;if(e){if(e.startsWith(b)){const t=e.substring(b.length);return void(0,g.$)(this,{domain:t,dialogClosedCallback:t=>{t.entityId&&(this.hass.states[t.entityId]?this._setValue(t.entityId):this._pendingEntityId=t.entityId)}})}((0,h.n)(e)||this._findExtraOption(e))&&this._setValue(e)}else this._setValue(void 0)}_setValue(t){this.value=t,(0,l.r)(this,"value-changed",{value:t}),(0,l.r)(this,"change")}constructor(...t){super(...t),this.autofocus=!1,this.disabled=!1,this.required=!1,this.showEntityId=!1,this.hideClearIcon=!1,this.addButton=!1,this._valueRenderer=t=>{const e=t||"",i=this._findExtraOption(e);if(i)return s.qy` ${this._renderExtraOptionStart(i)} <span slot="headline">${i.primary}</span> ${i.secondary?s.qy`<span slot="supporting-text">${i.secondary}</span>`:s.s6} `;const a=this.hass.states[e];if(!a)return s.qy` <ha-svg-icon slot="start" .path="${y}" style="margin:0 4px"></ha-svg-icon> <span slot="headline">${e}</span> `;const{primary:o,secondary:n}=(0,r.Bj)(this.hass,a);return s.qy` <state-badge .hass="${this.hass}" .stateObj="${a}" slot="start"></state-badge> <span slot="headline">${o}</span> <span slot="supporting-text">${n}</span> `},this._rowRenderer=(t,e)=>{const i=this._showEntityId;return s.qy` <ha-combo-box-item type="button" compact="compact" .borderTop="${0!==e}"> ${t.icon_path?s.qy` <ha-svg-icon slot="start" style="margin:0 4px" .path="${t.icon_path}"></ha-svg-icon> `:s.qy` <state-badge slot="start" .stateObj="${t.stateObj}" .hass="${this.hass}"></state-badge> `} <span slot="headline">${t.primary}</span> ${t.secondary?s.qy`<span slot="supporting-text">${t.secondary}</span>`:s.s6} ${t.stateObj&&i?s.qy` <span slot="supporting-text" class="code"> ${t.stateObj.entity_id} </span> `:s.s6} ${t.domain_name&&!i?s.qy` <div slot="trailing-supporting-text" class="domain"> ${t.domain_name} </div> `:s.s6} </ha-combo-box-item> `},this._getAdditionalItems=()=>this._getCreateItems(this.hass.localize,this.createDomains),this._getCreateItems=(0,n.A)((t,e)=>e?.length?(this.hass.loadFragmentTranslation("config"),e.map(e=>{const i=t("ui.components.entity.entity-picker.create_helper",{domain:(0,p.z)(e)?t(`ui.panel.config.helpers.types.${e}`)||e:(0,d.p$)(t,e)});return{id:b+e,primary:i,secondary:t("ui.components.entity.entity-picker.new_entity"),icon_path:_}})):[]),this._getEntitiesMemoized=(0,n.A)(c.w),this._getItems=()=>{const t=this._getEntitiesMemoized(this.hass,this.includeDomains,this.excludeDomains,this.entityFilter,this.includeDeviceClasses,this.includeUnitOfMeasurement,this.includeEntities,this.excludeEntities,this.value);if(this.extraOptions?.length){return[...this.extraOptions.map(t=>({...t,stateObj:t.entity_id?this.hass.states[t.entity_id]:void 0})),...t]}return t},this._searchFn=(t,e)=>{const i=e.findIndex(e=>e.stateObj?.entity_id===t);if(-1===i)return e;const[a]=e.splice(i,1);return e.unshift(a),e},this._notFoundLabel=t=>this.hass.localize("ui.components.entity.entity-picker.no_match",{term:s.qy`<b>‘${t}’</b>`})}}(0,a.Cg)([(0,o.MZ)({attribute:!1})],f.prototype,"hass",void 0),(0,a.Cg)([(0,o.MZ)({type:Boolean})],f.prototype,"autofocus",void 0),(0,a.Cg)([(0,o.MZ)({type:Boolean})],f.prototype,"disabled",void 0),(0,a.Cg)([(0,o.MZ)({type:Boolean})],f.prototype,"required",void 0),(0,a.Cg)([(0,o.MZ)({type:Boolean,attribute:"allow-custom-entity"})],f.prototype,"allowCustomEntity",void 0),(0,a.Cg)([(0,o.MZ)({type:Boolean,attribute:"show-entity-id"})],f.prototype,"showEntityId",void 0),(0,a.Cg)([(0,o.MZ)()],f.prototype,"label",void 0),(0,a.Cg)([(0,o.MZ)()],f.prototype,"value",void 0),(0,a.Cg)([(0,o.MZ)()],f.prototype,"helper",void 0),(0,a.Cg)([(0,o.MZ)()],f.prototype,"placeholder",void 0),(0,a.Cg)([(0,o.MZ)({type:String,attribute:"search-label"})],f.prototype,"searchLabel",void 0),(0,a.Cg)([(0,o.MZ)({attribute:!1})],f.prototype,"createDomains",void 0),(0,a.Cg)([(0,o.MZ)({type:Array,attribute:"include-domains"})],f.prototype,"includeDomains",void 0),(0,a.Cg)([(0,o.MZ)({type:Array,attribute:"exclude-domains"})],f.prototype,"excludeDomains",void 0),(0,a.Cg)([(0,o.MZ)({type:Array,attribute:"include-device-classes"})],f.prototype,"includeDeviceClasses",void 0),(0,a.Cg)([(0,o.MZ)({type:Array,attribute:"include-unit-of-measurement"})],f.prototype,"includeUnitOfMeasurement",void 0),(0,a.Cg)([(0,o.MZ)({type:Array,attribute:"include-entities"})],f.prototype,"includeEntities",void 0),(0,a.Cg)([(0,o.MZ)({type:Array,attribute:"exclude-entities"})],f.prototype,"excludeEntities",void 0),(0,a.Cg)([(0,o.MZ)({attribute:!1})],f.prototype,"entityFilter",void 0),(0,a.Cg)([(0,o.MZ)({attribute:!1})],f.prototype,"extraOptions",void 0),(0,a.Cg)([(0,o.MZ)({attribute:"hide-clear-icon",type:Boolean})],f.prototype,"hideClearIcon",void 0),(0,a.Cg)([(0,o.MZ)({attribute:"add-button",type:Boolean})],f.prototype,"addButton",void 0),(0,a.Cg)([(0,o.MZ)({attribute:"add-button-label"})],f.prototype,"addButtonLabel",void 0),(0,a.Cg)([(0,o.P)("ha-generic-picker")],f.prototype,"_picker",void 0),(0,a.Cg)([(0,o.wk)()],f.prototype,"_pendingEntityId",void 0),f=(0,a.Cg)([(0,o.EM)("ha-entity-picker")],f),e()}catch(t){e(t)}})},17308(t,e,i){var a=i(62826),s=i(49838),o=i(11245),n=i(5124),l=i(22441);class r extends s.B{}r.styles=[o.R,n.AH`:host{--md-sys-color-surface:var(--card-background-color)}`],r=(0,a.Cg)([(0,l.EM)("ha-md-list")],r)},53756(t,e,i){i.d(e,{t:()=>r,w:()=>h});i(74423),i(18111),i(22489),i(61701);var a=i(71727),s=i(74705),o=i(28978),n=i(15638),l=i(95350);const r=[{name:"search_labels.entityName",weight:10},{name:"search_labels.friendlyName",weight:8},{name:"search_labels.deviceName",weight:7},{name:"search_labels.areaName",weight:6},{name:"search_labels.domainName",weight:6},{name:"search_labels.entityId",weight:3}],h=(t,e,i,r,h,c,d,p,g,u="")=>{let m,v=Object.keys(t.states);return d&&(v=v.filter(t=>d.includes(t))),p&&(v=v.filter(t=>!p.includes(t))),e&&(v=v.filter(t=>e.includes((0,a.m)(t)))),i&&(v=v.filter(t=>!i.includes((0,a.m)(t)))),m=v.map(e=>{const i=t.states[e],r=(0,o.u)(i),[h,c,d]=(0,s.Cf)(i,[{type:"entity"},{type:"device"},{type:"area"}],t.entities,t.devices,t.areas,t.floors),p=(0,l.p$)(t.localize,(0,a.m)(e)),g=(0,n.qC)(t.language,t.translationMetadata.translations),m=h||c||e,v=[d,h?c:void 0].filter(Boolean).join(g?" ◂ ":" ▸ ");return{id:`${u}${e}`,primary:m,secondary:v,domain_name:p,sorting_label:[m,v].filter(Boolean).join("_"),search_labels:{entityName:h||null,deviceName:c||null,areaName:d||null,domainName:p||null,friendlyName:r||null,entityId:e},stateObj:i}}),h&&(m=m.filter(t=>t.id===g||t.stateObj?.attributes.device_class&&h.includes(t.stateObj.attributes.device_class))),c&&(m=m.filter(t=>t.id===g||t.stateObj?.attributes.unit_of_measurement&&c.includes(t.stateObj.attributes.unit_of_measurement))),r&&(m=m.filter(t=>t.id===g||t.stateObj&&r(t.stateObj))),m}},19711(t,e,i){i.d(e,{$:()=>o});var a=i(1087);const s=()=>Promise.all([i.e(80131),i.e(70183),i.e(47677)]).then(i.bind(i,79029)),o=(t,e)=>{(0,a.r)(t,"show-dialog",{dialogTag:"dialog-helper-detail",dialogImport:s,dialogParams:e})}},30592(t,e,i){i.a(t,async function(t,e){try{i(18111),i(61701),i(88454),i(29452);var a=i(62826),s=i(5124),o=i(22441),n=i(75751),l=i(1087),r=i(81816),h=i(15638),c=i(82474),d=i(26300),p=(i(85938),t([c,d]));[c,d]=p.then?(await p)():p;const g="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",u="M21 11H3V9H21V11M21 13H3V15H21V13Z",m="M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z";class v extends s.WF{_getKey(t){return this._entityKeys.has(t)||this._entityKeys.set(t,Math.random().toString()),this._entityKeys.get(t)}_renderItem(t,e){const i=this.hass.states[t.entity],a=i&&(0,r.es)(i,this.hass.entities,this.hass.devices),o=(0,h.qC)(this.hass.language,this.hass.translationMetadata.translations),n=i&&this.hass.formatEntityName(i,a?{type:"device"}:{type:"entity"})||t.entity,l=i&&this.hass.formatEntityName(i,a?[{type:"area"}]:[{type:"area"},{type:"device"}],{separator:o?" ◂ ":" ▸ "});return s.qy` <ha-md-list-item class="item"> <ha-svg-icon class="handle" .path="${u}" slot="start"></ha-svg-icon> <div slot="headline" class="label">${n}</div> ${l?s.qy`<div slot="supporting-text" class="description"> ${l} </div>`:s.s6} <ha-icon-button slot="end" .item="${t}" .index="${e}" .label="${this.hass.localize("ui.common.edit")}" .path="${m}" @click="${this._editItem}"></ha-icon-button> <ha-icon-button slot="end" .index="${e}" .label="${this.hass.localize("ui.common.delete")}" .path="${g}" @click="${this._deleteItem}"></ha-icon-button> </ha-md-list-item> `}_editItem(t){const e=t.currentTarget.index;(0,l.r)(this,"edit-detail-element",{subElementConfig:{index:e,type:"row",elementConfig:this.entities[e]}})}_deleteItem(t){const e=t.target.index,i=this.entities.slice(0,e).concat(this.entities.slice(e+1));(0,l.r)(this,"entities-changed",{entities:i})}render(){return this.entities?s.qy` <h3> ${this.label||`${this.hass.localize("ui.panel.lovelace.editor.card.generic.entities")}${this.required?` (${this.hass.localize("ui.panel.lovelace.editor.card.config.required")})`:""}`} </h3> ${this.canEdit?s.qy` <div class="items-container"> <ha-sortable handle-selector=".handle" draggable-selector=".item" @item-moved="${this._entityMoved}"> <ha-md-list> ${this.entities.map((t,e)=>this._renderItem(t,e))} </ha-md-list> </ha-sortable> </div> `:s.qy`<ha-sortable handle-selector=".handle" @item-moved="${this._entityMoved}"> <div class="entities"> ${(0,n.u)(this.entities,t=>this._getKey(t),(t,e)=>s.qy` <div class="entity" data-entity-id="${t.entity}"> <div class="handle"> <ha-svg-icon .path="${u}"></ha-svg-icon> </div> <ha-entity-picker .hass="${this.hass}" .value="${t.entity}" .index="${e}" .entityFilter="${this.entityFilter}" @value-changed="${this._valueChanged}"></ha-entity-picker> </div> `)} </div> </ha-sortable>`} <ha-entity-picker .hass="${this.hass}" .entityFilter="${this.entityFilter}" @value-changed="${this._addEntity}" add-button></ha-entity-picker> `:s.s6}async _addEntity(t){const e=t.detail.value;if(""===e)return;const i=this.entities.concat({entity:e});t.target.value="",(0,l.r)(this,"entities-changed",{entities:i})}_entityMoved(t){t.stopPropagation();const{oldIndex:e,newIndex:i}=t.detail,a=this.entities.concat();a.splice(i,0,a.splice(e,1)[0]),(0,l.r)(this,"entities-changed",{entities:a})}_valueChanged(t){const e=t.detail.value,i=t.target.index,a=this.entities.concat();""===e||void 0===e?a.splice(i,1):a[i]={...a[i],entity:e},(0,l.r)(this,"entities-changed",{entities:a})}constructor(...t){super(...t),this.required=!0,this._entityKeys=new WeakMap}}v.styles=s.AH`.entity{display:flex;align-items:center}.entity .handle{padding-right:8px;cursor:move;cursor:grab;padding-inline-end:8px;padding-inline-start:initial;direction:var(--direction)}.entity .handle>*{pointer-events:none}.entity ha-entity-picker{flex-grow:1}ha-md-list{gap:8px;padding-top:0;display:flex;flex-direction:column}ha-md-list:has(> *){margin-bottom:var(--ha-space-2)}ha-md-list-item{border:1px solid var(--divider-color);border-radius:8px;--ha-md-list-item-gap:0;--md-list-item-top-space:0;--md-list-item-bottom-space:0;--md-list-item-leading-space:12px;--md-list-item-trailing-space:4px;--md-list-item-two-line-container-height:48px;--md-list-item-one-line-container-height:48px}.handle{cursor:move;padding:8px;margin-inline-start:-8px}label{margin-bottom:8px;display:block}ha-md-list-item .description,ha-md-list-item .label{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}`,(0,a.Cg)([(0,o.MZ)({attribute:!1})],v.prototype,"hass",void 0),(0,a.Cg)([(0,o.MZ)({attribute:!1})],v.prototype,"entities",void 0),(0,a.Cg)([(0,o.MZ)({attribute:!1})],v.prototype,"entityFilter",void 0),(0,a.Cg)([(0,o.MZ)()],v.prototype,"label",void 0),(0,a.Cg)([(0,o.MZ)({type:Boolean})],v.prototype,"required",void 0),(0,a.Cg)([(0,o.MZ)({attribute:"can-edit",type:Boolean})],v.prototype,"canEdit",void 0),v=(0,a.Cg)([(0,o.EM)("hui-entity-editor")],v),e()}catch(t){e(t)}})},68075(t,e,i){i.d(e,{C:()=>s});var a=i(1087);const s=(t,e)=>{(0,a.r)(t,"show-dialog",{dialogTag:"hui-dialog-select-dashboard",dialogImport:()=>i.e(35131).then(i.bind(i,72406)),dialogParams:e})}},70997(t,e,i){i.a(t,async function(t,a){try{i.r(e),i.d(e,{HuiDialogEditView:()=>T});i(33110);var s=i(62826),o=i(5124),n=i(22441),l=i(6412),r=i(1087),h=i(91926),c=i(19459),d=i(38962),p=i(18350),g=(i(76538),i(93444),i(72554)),u=i(29823),m=(i(70947),i(65829)),v=i(66289),_=(i(62647),i(10763)),y=i(35952),b=i(91984),f=i(65063),w=i(14503),$=i(30592),C=i(49365),x=i(31481),k=i(36751),I=i(82360),M=i(68075),A=i(53504),z=i(54953),L=i(55832),q=t([d,p,g,u,m,v,_,$,A,z,L]);[d,p,g,u,m,v,_,$,A,z,L]=q.then?(await q)():q;const H="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",E="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",V="M14 2H6C4.9 2 4 2.9 4 4V20C4 20.41 4.12 20.8 4.34 21.12C4.41 21.23 4.5 21.33 4.59 21.41C4.95 21.78 5.45 22 6 22H13.53C13 21.42 12.61 20.75 12.35 20H6V4H13V9H18V12C18.7 12 19.37 12.12 20 12.34V8L14 2M18 23L23 18.5L20 15.8L18 14V17H14V20H18V23Z",Z="M3 6V8H14V6H3M3 10V12H14V10H3M20 10.1C19.9 10.1 19.7 10.2 19.6 10.3L18.6 11.3L20.7 13.4L21.7 12.4C21.9 12.2 21.9 11.8 21.7 11.6L20.4 10.3C20.3 10.2 20.2 10.1 20 10.1M18.1 11.9L12 17.9V20H14.1L20.2 13.9L18.1 11.9M3 14V16H10V14H3Z",D=["tab-settings","tab-background","tab-visibility"];class T extends o.WF{get _type(){return(0,k.E)(this._config)}updated(t){if(this._yamlMode&&t.has("_yamlMode")){const t={...this._config};this._editor?.setValue(t)}}showDialog(t){if(this._params=t,this._open=!0,void 0===this._params.viewIndex)return this._config={type:C._H},void(this._dirty=!1);this._lovelace=this._params.lovelace;const e=this._lovelace.config.views[this._params.viewIndex];if((0,b.R6)(e)){const{strategy:t,...i}=e;return void(this._config=i)}this._config=e,this._currentType=this._type}closeDialog(){this._open=!1}_dialogClosed(){this._params=void 0,this._config={},this._yamlMode=!1,this._dirty=!1,this._currTab=D[0],(0,r.r)(this,"dialog-closed",{dialog:this.localName})}get _viewConfigTitle(){return this._config&&this._config.title?this.hass.localize("ui.panel.lovelace.editor.edit_view.header_name",{name:this._config.title}):this.hass.localize("ui.panel.lovelace.editor.edit_view.header")}render(){if(!this._params)return o.s6;let t;if(this._yamlMode)t=o.qy` <ha-yaml-editor autofocus in-dialog @value-changed="${this._viewYamlChanged}"></ha-yaml-editor> `;else switch(this._currTab){case"tab-settings":t=o.qy` <hui-view-editor .isNew="${void 0===this._params.viewIndex}" .hass="${this.hass}" .config="${this._config}" @view-config-changed="${this._viewConfigChanged}"></hui-view-editor> `;break;case"tab-background":t=o.qy` <hui-view-background-editor .hass="${this.hass}" .config="${this._config}" @view-config-changed="${this._viewConfigChanged}"></hui-view-background-editor> `;break;case"tab-visibility":t=o.qy` <hui-view-visibility-editor .hass="${this.hass}" .config="${this._config}" @view-visibility-changed="${this._viewVisibilityChanged}"></hui-view-visibility-editor> `}const e=this._type===C._H&&this._currentType!==C._H&&this._config?.cards?.length,i=this._type!==C._H&&this._currentType===C._H&&this._config?.sections?.length;return o.qy` <ha-dialog .open="${this._open}" width="large" prevent-scrim-close @closed="${this._dialogClosed}" class="${(0,l.H)({"yaml-mode":this._yamlMode})}"> <ha-dialog-header show-border slot="header"> <ha-icon-button slot="navigationIcon" @click="${this.closeDialog}" .label="${this.hass.localize("ui.common.close")}" .path="${H}"></ha-icon-button> <h2 slot="title">${this._viewConfigTitle}</h2> <ha-dropdown slot="actionItems" placement="bottom-end" @wa-select="${this._handleAction}"> <ha-icon-button slot="trigger" .label="${this.hass.localize("ui.common.menu")}" .path="${E}"></ha-icon-button> <ha-dropdown-item value="toggle-mode"> ${this.hass.localize("ui.panel.lovelace.editor.edit_view.edit_"+(this._yamlMode?"ui":"yaml"))} <ha-svg-icon slot="icon" .path="${Z}"></ha-svg-icon> </ha-dropdown-item> <ha-dropdown-item value="move-to-dashboard"> ${this.hass.localize("ui.panel.lovelace.editor.edit_view.move_to_dashboard")} <ha-svg-icon slot="icon" .path="${V}"></ha-svg-icon> </ha-dropdown-item> </ha-dropdown> ${e?o.qy` <ha-alert alert-type="info"> ${this.hass.localize("ui.panel.lovelace.editor.edit_view.card_to_section_convert")} <ha-button size="small" slot="action" @click="${this._convertToSection}"> ${this.hass.localize("ui.panel.lovelace.editor.edit_view.convert_view")} </ha-button> </ha-alert> `:o.s6} ${i?o.qy` <ha-alert alert-type="warning"> ${this.hass.localize("ui.panel.lovelace.editor.edit_view.section_to_card_not_supported")} </ha-alert> `:o.s6} ${this._yamlMode?o.s6:o.qy`<ha-tab-group @wa-tab-show="${this._handleTabChanged}"> ${D.map(t=>o.qy` <ha-tab-group-tab slot="nav" .panel="${t}" .active="${this._currTab===t}"> ${this.hass.localize(`ui.panel.lovelace.editor.edit_view.${t.replace("-","_")}`)} </ha-tab-group-tab> `)} </ha-tab-group>`} </ha-dialog-header> ${t} <ha-dialog-footer slot="footer"> ${void 0!==this._params.viewIndex?o.qy` <ha-button slot="secondaryAction" variant="danger" appearance="plain" @click="${this._deleteConfirm}"> ${this.hass.localize("ui.panel.lovelace.editor.edit_view.delete")} </ha-button> `:o.s6} <ha-button class="save" slot="primaryAction" ?disabled="${!this._config||this._saving||!this._dirty||!this._valid||e||i}" @click="${this._save}"> ${this._saving?o.qy`<ha-spinner size="small" aria-label="Saving"></ha-spinner>`:o.s6} ${this.hass.localize("ui.common.save")}</ha-button> </ha-dialog-footer> </ha-dialog> `}async _handleAction(t){const e=t.detail.item.value;if(e)switch(e){case"toggle-mode":this._yamlMode=!this._yamlMode;break;case"move-to-dashboard":this._openSelectDashboard()}}_openSelectDashboard(){(0,M.C)(this,{lovelaceConfig:this._lovelace.config,dashboardSelectedCallback:this._moveViewToDashboard,urlPath:this._lovelace.urlPath})}async _convertToSection(){if(!this._params||!this._config)return;if(!await(0,f.dk)(this,{title:this.hass.localize("ui.panel.lovelace.editor.edit_view.convert_view_title"),text:this.hass.localize("ui.panel.lovelace.editor.edit_view.convert_view_text"),confirmText:this.hass.localize("ui.panel.lovelace.editor.edit_view.convert_view_action"),dismissText:this.hass.localize("ui.common.cancel")}))return;const t={...this._config};t.type=C._H,t.sections=[(0,x.Y)(this.hass.localize)],t.path=void 0;const e=this._params.lovelace;try{await e.saveConfig((0,I.fJ)(this.hass,e.config,t)),this._params.saveCallback&&this._params.saveCallback(e.config.views.length,t),this.closeDialog()}catch(t){(0,f.showAlertDialog)(this,{text:`${this.hass.localize("ui.panel.lovelace.editor.edit_view.saving_failed")}: ${t.message}`})}finally{this._saving=!1}}async _delete(){if(this._params)try{await this._params.lovelace.saveConfig((0,I.lD)(this._params.lovelace.config,this._params.viewIndex)),this.closeDialog(),(0,h.oo)(`/${window.location.pathname.split("/")[1]}`)}catch(t){(0,f.showAlertDialog)(this,{text:`Deleting failed: ${t.message}`})}}async _deleteConfirm(){const t=this._config?.sections?.length?"sections":this._config?.cards?.length?"cards":"only",e=this._config?.title?"named":"unnamed";await(0,f.dk)(this,{title:this.hass.localize("ui.panel.lovelace.views.delete_title"),text:this.hass.localize(`ui.panel.lovelace.views.delete_${e}_view_${t}`,{name:this._config?.title}),confirmText:this.hass.localize("ui.common.delete"),destructive:!0})&&this._delete()}_handleTabChanged(t){const e=t.detail.name;e!==this._currTab&&(this._currTab=e)}async _save(){if(!this._params||!this._config)return;if(!this._isConfigChanged())return void this.closeDialog();this._saving=!0;const t={...this._config};t.type!==C._H||t.sections?.length?t.cards?.length||(t.cards=[]):t.sections=[(0,x.Y)(this.hass.localize)];const e=this._params.lovelace;try{await e.saveConfig(this._creatingView?(0,I.fJ)(this.hass,e.config,t):(0,I.Iq)(this.hass,e.config,this._params.viewIndex,t)),this._params.saveCallback&&this._creatingView&&this._params.saveCallback(this._params.viewIndex||e.config.views.length,t),this.closeDialog()}catch(t){(0,f.showAlertDialog)(this,{text:`${this.hass.localize("ui.panel.lovelace.editor.edit_view.saving_failed")}: ${t.message}`})}finally{this._saving=!1}}_viewConfigChanged(t){t.detail&&t.detail.config&&!(0,c.b)(this._config,t.detail.config)&&(void 0!==t.detail.valid&&(this._valid=t.detail.valid),this._config=t.detail.config,this._dirty=!0)}_viewVisibilityChanged(t){t.detail.visible&&this._config&&(this._config={...this._config,visible:t.detail.visible}),this._dirty=!0}_viewYamlChanged(t){t.stopPropagation(),t.detail.isValid&&(this._config=t.detail.value,this._dirty=!0)}_isConfigChanged(){return this._creatingView||JSON.stringify(this._config)!==JSON.stringify(this._params.lovelace.config.views[this._params.viewIndex])}get _creatingView(){return void 0===this._params.viewIndex}static get styles(){return[w.nA,w.kO,o.AH`ha-dialog{--dialog-content-padding:var(--ha-space-6)}ha-dialog.yaml-mode{--dialog-content-padding:0}h2{margin:0;font-size:inherit;font-weight:inherit}ha-tab-group-tab{flex:1}ha-tab-group-tab::part(base){width:100%;justify-content:center}ha-button[slot=secondaryAction]{margin-right:auto;margin-inline-end:auto;margin-inline-start:initial}.hidden{display:none}.error{color:var(--error-color);border-bottom:1px solid var(--error-color)}ha-alert{display:block}ha-alert ha-button{display:block}ha-button.save{position:relative}.save ha-spinner{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}`]}constructor(...t){super(...t),this._saving=!1,this._currTab=D[0],this._dirty=!1,this._valid=!0,this._yamlMode=!1,this._currentType=(0,k.E)(),this._open=!1,this._moveViewToDashboard=async t=>{let e,i,a;try{i=await(0,y.Dz)(this.hass.connection,t,!1)}catch(t){e=this.hass.localize("ui.panel.lovelace.editor.select_dashboard.get_config_failed"),console.error(t)}if(i&&(0,y.Wu)(i)&&(e=this.hass.localize("ui.panel.lovelace.editor.select_dashboard.cannot_move_to_strategy")),!e){const[s,o]=(0,I.Sg)(this.hass,this._lovelace.config,i,this._params.viewIndex),n=this._lovelace.config,l=i;a=async()=>{await(0,y.ql)(this.hass,t,l),await this._lovelace.saveConfig(n)};try{await this._lovelace.saveConfig(s),await(0,y.ql)(this.hass,t,o)}catch(t){console.error(t);try{await a(),e=this.hass.localize("ui.panel.lovelace.editor.select_dashboard.move_failed")}catch(t){console.error(t),e=this.hass.localize("ui.panel.lovelace.editor.select_dashboard.revert_failed")}}}e?(0,f.showAlertDialog)(this,{text:e}):(this._lovelace.showToast({message:this.hass.localize("ui.panel.lovelace.editor.select_dashboard.success"),duration:4e3,action:{action:a,text:this.hass.localize("ui.common.undo")}}),this.closeDialog(),(0,h.oo)(`/${window.location.pathname.split("/")[1]}`))}}}(0,s.Cg)([(0,n.MZ)({attribute:!1})],T.prototype,"hass",void 0),(0,s.Cg)([(0,n.wk)()],T.prototype,"_params",void 0),(0,s.Cg)([(0,n.wk)()],T.prototype,"_lovelace",void 0),(0,s.Cg)([(0,n.wk)()],T.prototype,"_config",void 0),(0,s.Cg)([(0,n.wk)()],T.prototype,"_saving",void 0),(0,s.Cg)([(0,n.wk)()],T.prototype,"_currTab",void 0),(0,s.Cg)([(0,n.wk)()],T.prototype,"_dirty",void 0),(0,s.Cg)([(0,n.wk)()],T.prototype,"_valid",void 0),(0,s.Cg)([(0,n.wk)()],T.prototype,"_yamlMode",void 0),(0,s.Cg)([(0,n.P)("ha-yaml-editor")],T.prototype,"_editor",void 0),(0,s.Cg)([(0,n.wk)()],T.prototype,"_currentType",void 0),(0,s.Cg)([(0,n.wk)()],T.prototype,"_open",void 0),T=(0,s.Cg)([(0,n.EM)("hui-dialog-edit-view")],T),a()}catch(t){a(t)}})},53504(t,e,i){i.a(t,async function(t,e){try{var a=i(62826),s=i(22786),o=i(5124),n=i(22441),l=i(1087),r=i(52763),h=i(17022),c=t([r]);r=(c.then?(await c)():c)[0];class d extends o.WF{set config(t){this._config=t}updated(t){if(this._config&&this.hass&&(t.has("_config")||t.has("hass")&&!t.get("hass"))){const t=this._backgroundData(this._config);this.style.setProperty("--picture-opacity",""+(t.opacity??100)/100);const e="object"==typeof t.image?t.image.media_content_id:t.image;e&&(0,h.St)(e)?(0,h.A1)(this.hass,e).then(t=>{this._resolvedImage=t.url}):this._resolvedImage=e}}render(){if(!this.hass)return o.s6;const t=this._backgroundData(this._config);return o.qy` ${this._resolvedImage?o.qy`<div class="previewContainer"> <img src="${this._resolvedImage}" alt="${this.hass.localize("ui.components.picture-upload.current_image_alt")}"> </div>`:o.s6} <ha-form .hass="${this.hass}" .data="${t}" .schema="${this._schema(this.hass.localize,!0)}" .computeLabel="${this._computeLabelCallback}" @value-changed="${this._valueChanged}" .localizeValue="${this._localizeValueCallback}"></ha-form> `}_valueChanged(t){const e={...this._config,background:t.detail.value};(0,l.r)(this,"view-config-changed",{config:e})}constructor(...t){super(...t),this._localizeValueCallback=t=>this.hass.localize(t),this._schema=(0,s.A)((t,e)=>[{name:"image",selector:{media:{accept:["image/*"],clearable:!0,image_upload:!0,hide_content_type:!0,content_id_helper:t("ui.panel.lovelace.editor.card.picture.content_id_helper")}}},...e?[{name:"settings",flatten:!0,expanded:!0,type:"expandable",schema:[{name:"opacity",selector:{number:{min:0,max:100,mode:"slider",step:10}}},{name:"attachment",selector:{button_toggle:{translation_key:"ui.panel.lovelace.editor.edit_view.background.attachment",options:["scroll","fixed"]}}},{name:"size",required:!0,selector:{select:{translation_key:"ui.panel.lovelace.editor.edit_view.background.size",options:["auto","cover","contain"],mode:"dropdown"}}},{name:"alignment",required:!0,selector:{select:{translation_key:"ui.panel.lovelace.editor.edit_view.background.alignment",options:["top left","top center","top right","center left","center","center right","bottom left","bottom center","bottom right"],mode:"dropdown"}}},{name:"repeat",required:!0,selector:{select:{translation_key:"ui.panel.lovelace.editor.edit_view.background.repeat",options:["repeat","no-repeat"],mode:"dropdown"}}}]}]:[]]),this._backgroundData=(0,s.A)(t=>{let e=t?.background;if("string"==typeof e){const t=e.match(/url\(['"]?([^'"]+)['"]?\)/)?.[1];e={image:t}}return e=e?{opacity:100,alignment:"center",size:"cover",repeat:"no-repeat",attachment:"scroll",...e,..."string"==typeof e.image?{image:{media_content_id:e.image}}:{}}:{opacity:33,alignment:"center",size:"cover",repeat:"repeat",attachment:"fixed"},e}),this._computeLabelCallback=t=>{switch(t.name){case"image":return this.hass.localize("ui.panel.lovelace.editor.edit_view.background.image");case"opacity":return this.hass.localize("ui.panel.lovelace.editor.edit_view.background.opacity");case"alignment":return this.hass.localize("ui.panel.lovelace.editor.edit_view.background.alignment.name");case"size":return this.hass.localize("ui.panel.lovelace.editor.edit_view.background.size.name");case"repeat":return this.hass.localize("ui.panel.lovelace.editor.edit_view.background.repeat.name");case"attachment":return this.hass.localize("ui.panel.lovelace.editor.edit_view.background.attachment.name");default:return this.hass.localize(`ui.panel.lovelace.editor.edit_view.background.${t.name}`)}}}}d.styles=o.AH`:host{display:block;--file-upload-image-border-radius:var(--ha-border-radius-sm)}.previewContainer{width:100%;display:flex;flex-direction:column;align-items:center}img{max-width:100%;max-height:200px;margin-bottom:4px;border-radius:var(--file-upload-image-border-radius);transition:opacity .3s;opacity:var(--picture-opacity, 1)}img:hover{opacity:1}`,(0,a.Cg)([(0,n.MZ)({attribute:!1})],d.prototype,"hass",void 0),(0,a.Cg)([(0,n.wk)()],d.prototype,"_config",void 0),(0,a.Cg)([(0,n.wk)({attribute:!1})],d.prototype,"_resolvedImage",void 0),d=(0,a.Cg)([(0,n.EM)("hui-view-background-editor")],d),e()}catch(t){e(t)}})},54953(t,e,i){i.a(t,async function(t,e){try{var a=i(62826),s=i(5124),o=i(22441),n=i(22786),l=i(1087),r=i(80880),h=i(52763),c=i(49365),d=i(36751),p=t([h]);h=(p.then?(await p)():p)[0];const g=/^[a-zA-Z0-9_-]+$/,u=/^[0-9]+$/;class m extends s.WF{set config(t){this._config=t}get _type(){return(0,d.E)(this._config)}render(){if(!this.hass)return s.s6;const t=this._schema(this.hass.localize,this._type),e={...this._config,type:this._type,theme:"backend-selected"===this._config.theme?.toLowerCase()?void 0:this._config.theme};return void 0===e.max_columns&&this._type===c._H&&(e.max_columns=4),s.qy` <ha-form .hass="${this.hass}" .data="${e}" .schema="${t}" .computeLabel="${this._computeLabel}" .computeHelper="${this._computeHelper}" .computeError="${this._computeError}" .error="${this._error}" @value-changed="${this._valueChanged}"></ha-form> `}_valueChanged(t){const e=t.detail.value;e.type!==c._H&&(delete e.max_columns,delete e.dense_section_placement,delete e.top_margin);const i=t=>{const e=(0,r.Y)(t||"","-");return u.test(e)?`view-${e}`:e};!this.isNew||this._suggestedPath||this._config.path!==e.path||this._config.path&&e.path!==i(this._config.title)||(e.path=i(e.title));let a=!0;this._error=void 0,e.path&&!g.test(e.path)?(a=!1,this._error={path:"error_invalid_path"}):e.path&&u.test(e.path)&&(a=!1,this._error={path:"error_number"}),(0,l.r)(this,"view-config-changed",{valid:a,config:e})}constructor(...t){super(...t),this.isNew=!1,this._suggestedPath=!1,this._schema=(0,n.A)((t,e)=>[{name:"type",selector:{select:{options:[c._H,c.NT,c.oH,"panel"].map(e=>({value:e,label:t(`ui.panel.lovelace.editor.edit_view.types.${e}`)}))}}},{name:"title",selector:{text:{}}},{name:"icon",selector:{icon:{}}},{name:"show_icon_and_title",selector:{boolean:{}}},{name:"path",selector:{text:{}}},{name:"theme",selector:{theme:{}}},{name:"subview",selector:{boolean:{}}},...e===c._H?[{name:"section_specifics",type:"expandable",flatten:!0,expanded:!0,schema:[{name:"max_columns",selector:{number:{min:1,max:10,mode:"slider",slider_ticks:!0}}},{name:"dense_section_placement",selector:{boolean:{}}},{name:"top_margin",selector:{boolean:{}}}]}]:[]]),this._computeError=t=>this.hass.localize(`ui.panel.lovelace.editor.edit_view.${t}`)||t,this._computeLabel=t=>{switch(t.name){case"path":return this.hass.localize("ui.panel.lovelace.editor.card.generic.url");case"type":case"show_icon_and_title":case"subview":case"max_columns":case"dense_section_placement":case"top_margin":case"section_specifics":return this.hass.localize(`ui.panel.lovelace.editor.edit_view.${t.name}`);default:return this.hass.localize(`ui.panel.lovelace.editor.card.generic.${t.name}`)}},this._computeHelper=t=>{switch(t.name){case"path":case"show_icon_and_title":case"subview":case"dense_section_placement":case"top_margin":return this.hass.localize(`ui.panel.lovelace.editor.edit_view.${t.name}_helper`);default:return}}}}(0,a.Cg)([(0,o.MZ)({attribute:!1})],m.prototype,"hass",void 0),(0,a.Cg)([(0,o.MZ)({attribute:!1})],m.prototype,"isNew",void 0),(0,a.Cg)([(0,o.wk)()],m.prototype,"_config",void 0),(0,a.Cg)([(0,o.wk)()],m.prototype,"_error",void 0),m=(0,a.Cg)([(0,o.EM)("hui-view-editor")],m),e()}catch(t){e(t)}})},55832(t,e,i){i.a(t,async function(t,e){try{i(44114),i(18111),i(22489),i(61701),i(13579);var a=i(62826),s=i(5124),o=i(22441),n=i(22786),l=i(1087),r=i(52220),h=(i(78673),i(17308),i(2846),i(59646)),c=i(28669),d=t([h]);h=(d.then?(await d)():d)[0];class p extends s.WF{set config(t){this._config=t,this._visible=void 0===this._config.visible||this._config.visible}firstUpdated(t){super.firstUpdated(t),(0,c.hU)(this.hass).then(t=>{this._users=t.filter(t=>!t.system_generated)})}render(){return this.hass&&this._users?s.qy` <p> ${this.hass.localize("ui.panel.lovelace.editor.edit_view.visibility.select_users")} </p> <ha-md-list> ${this._sortedUsers(this._users).map(t=>s.qy` <ha-md-list-item> <ha-user-badge slot="start" .hass="${this.hass}" .user="${t}"></ha-user-badge> <span slot="headline">${t.name}</span> <ha-switch slot="end" .userId="${t.id}" @change="${this._valChange}" .checked="${this.checkUser(t.id)}"></ha-switch> </ha-md-list-item> `)} </ha-md-list> `:s.s6}checkUser(t){return void 0===this._visible||("boolean"==typeof this._visible?this._visible:this._visible.some(e=>e.user===t))}_valChange(t){const e=t.currentTarget.userId,i=t.currentTarget.checked;let a=[];if("boolean"==typeof this._visible){this._visible&&(a=this._users.map(t=>({user:t.id})))}else a=[...this._visible];if(!0===i){const t={user:e};a.push(t)}else a=a.filter(t=>t.user!==e);this._visible=a.filter(t=>this._users.some(e=>e.id===t.user)),(0,l.r)(this,"view-visibility-changed",{visible:this._visible})}constructor(...t){super(...t),this._sortedUsers=(0,n.A)(t=>t.sort((t,e)=>(0,r.xL)(t.name,e.name,this.hass.locale.language)))}}p.styles=s.AH`:host{display:block}ha-md-list{padding:0}ha-md-list-item{--md-list-item-leading-space:0;--md-list-item-trailing-space:0;--md-list-item-top-space:var(--ha-space-1);--md-list-item-bottom-space:var(--ha-space-1);--md-list-item-one-line-container-height:48px}`,(0,a.Cg)([(0,o.MZ)({attribute:!1})],p.prototype,"hass",void 0),(0,a.Cg)([(0,o.wk)()],p.prototype,"_config",void 0),(0,a.Cg)([(0,o.wk)()],p.prototype,"_users",void 0),(0,a.Cg)([(0,o.wk)()],p.prototype,"_visible",void 0),p=(0,a.Cg)([(0,o.EM)("hui-view-visibility-editor")],p),e()}catch(t){e(t)}})},31481(t,e,i){i.d(e,{Y:()=>a});const a=(t,e)=>({type:"grid",cards:e?[{type:"heading",heading:t("ui.panel.lovelace.editor.section.default_section_title")}]:[]})},25423(t,e,i){i.d(e,{U:()=>s,Z:()=>o});i(44114);var a=i(27525);const s={ArrowDown:"ArrowDown",ArrowLeft:"ArrowLeft",ArrowUp:"ArrowUp",ArrowRight:"ArrowRight",Home:"Home",End:"End"};class o{get items(){const t=this.getPossibleItems(),e=[];for(const i of t){if(this.isItem(i)){e.push(i);continue}const t=i.item;t&&this.isItem(t)&&e.push(t)}return e}activateNextItem(){const t=this.items,e=(0,a.A6)(t,this.isActivatable);return e&&(e.item.tabIndex=-1),(0,a.wm)(t,e,this.isActivatable,this.wrapNavigation())}activatePreviousItem(){const t=this.items,e=(0,a.A6)(t,this.isActivatable);return e&&(e.item.tabIndex=-1),(0,a.u9)(t,e,this.isActivatable,this.wrapNavigation())}constructor(t){this.handleKeydown=t=>{const e=t.key;if(t.defaultPrevented||!this.isNavigableKey(e))return;const i=this.items;if(!i.length)return;const o=(0,a.A6)(i,this.isActivatable);t.preventDefault();const n=this.isRtl(),l=n?s.ArrowRight:s.ArrowLeft,r=n?s.ArrowLeft:s.ArrowRight;let h=null;switch(e){case s.ArrowDown:case r:h=(0,a.wm)(i,o,this.isActivatable,this.wrapNavigation());break;case s.ArrowUp:case l:h=(0,a.u9)(i,o,this.isActivatable,this.wrapNavigation());break;case s.Home:h=(0,a.zT)(i,this.isActivatable);break;case s.End:h=(0,a.RZ)(i,this.isActivatable)}h&&o&&o.item!==h&&(o.item.tabIndex=-1)},this.onDeactivateItems=()=>{const t=this.items;for(const e of t)this.deactivateItem(e)},this.onRequestActivation=t=>{this.onDeactivateItems();const e=t.target;this.activateItem(e),e.focus()},this.onSlotchange=()=>{const t=this.items;let e=!1;for(const i of t){!(!i.disabled&&i.tabIndex>-1)||e?i.tabIndex=-1:(e=!0,i.tabIndex=0)}if(e)return;const i=(0,a.c7)(t,this.isActivatable);i&&(i.tabIndex=0)};const{isItem:e,getPossibleItems:i,isRtl:o,deactivateItem:n,activateItem:l,isNavigableKey:r,isActivatable:h,wrapNavigation:c}=t;this.isItem=e,this.getPossibleItems=i,this.isRtl=o,this.deactivateItem=n,this.activateItem=l,this.isNavigableKey=r,this.isActivatable=h,this.wrapNavigation=c??(()=>!0)}}},11245(t,e,i){i.d(e,{R:()=>a});const a=i(5124).AH`:host{background:var(--md-list-container-color,var(--md-sys-color-surface,#fef7ff));color:unset;display:flex;flex-direction:column;outline:0;padding:8px 0;position:relative}`},49838(t,e,i){i.d(e,{B:()=>r});i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698);var a=i(62826),s=i(5124),o=i(22441),n=i(25423);const l=new Set(Object.values(n.U));class r extends s.WF{get items(){return this.listController.items}render(){return s.qy` <slot @deactivate-items="${this.listController.onDeactivateItems}" @request-activation="${this.listController.onRequestActivation}" @slotchange="${this.listController.onSlotchange}"> </slot> `}activateNextItem(){return this.listController.activateNextItem()}activatePreviousItem(){return this.listController.activatePreviousItem()}constructor(){super(),this.listController=new n.Z({isItem:t=>t.hasAttribute("md-list-item"),getPossibleItems:()=>this.slotItems,isRtl:()=>"rtl"===getComputedStyle(this).direction,deactivateItem:t=>{t.tabIndex=-1},activateItem:t=>{t.tabIndex=0},isNavigableKey:t=>l.has(t),isActivatable:t=>!t.disabled&&"text"!==t.type}),this.internals=this.attachInternals(),s.S$||(this.internals.role="list",this.addEventListener("keydown",this.listController.handleKeydown))}}(0,a.Cg)([(0,o.KN)({flatten:!0})],r.prototype,"slotItems",void 0)}};