3 lines
13 KiB
JavaScript
3 lines
13 KiB
JavaScript
/*! For license information please see 6475.f51b3532155d8ff6.js.LICENSE.txt */
|
|
export const ids=["6475"];export const modules={20095:function(e,t,i){var a=i(44249),n=i(31622),o=i(57243),r=i(50778),s=i(22344);(0,a.Z)([(0,r.Mo)("ha-button")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",static:!0,key:"styles",value:()=>[s.W,o.iv`::slotted([slot=icon]){margin-inline-start:0px;margin-inline-end:8px;direction:var(--direction);display:block}.mdc-button{height:var(--button-height,36px)}.trailing-icon{display:flex}.slot-container{overflow:var(--button-slot-container-overflow,visible)}`]}]}}),n.z)},74064:function(e,t,i){var a=i(44249),n=i(72621),o=i(65703),r=i(46289),s=i(57243),d=i(50778);(0,a.Z)([(0,d.Mo)("ha-list-item")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"method",key:"renderRipple",value:function(){return this.noninteractive?"":(0,n.Z)(i,"renderRipple",this,3)([])}},{kind:"get",static:!0,key:"styles",value:function(){return[r.W,s.iv`:host{padding-left:var(--mdc-list-side-padding-left,var(--mdc-list-side-padding,20px));padding-inline-start:var(--mdc-list-side-padding-left,var(--mdc-list-side-padding,20px));padding-right:var(--mdc-list-side-padding-right,var(--mdc-list-side-padding,20px));padding-inline-end:var(--mdc-list-side-padding-right,var(--mdc-list-side-padding,20px))}:host([graphic=avatar]:not([twoLine])),:host([graphic=icon]:not([twoLine])){height:48px}span.material-icons:first-of-type{margin-inline-start:0px!important;margin-inline-end:var(--mdc-list-item-graphic-margin,16px)!important;direction:var(--direction)!important}span.material-icons:last-of-type{margin-inline-start:auto!important;margin-inline-end:0px!important;direction:var(--direction)!important}.mdc-deprecated-list-item__meta{display:var(--mdc-list-item-meta-display);align-items:center;flex-shrink:0}:host([graphic=icon]:not([twoline])) .mdc-deprecated-list-item__graphic{margin-inline-end:var(--mdc-list-item-graphic-margin,20px)!important}:host([multiline-secondary]){height:auto}:host([multiline-secondary]) .mdc-deprecated-list-item__text{padding:8px 0}:host([multiline-secondary]) .mdc-deprecated-list-item__secondary-text{text-overflow:initial;white-space:normal;overflow:auto;display:inline-block;margin-top:10px}:host([multiline-secondary]) .mdc-deprecated-list-item__primary-text{margin-top:10px}:host([multiline-secondary]) .mdc-deprecated-list-item__secondary-text::before{display:none}:host([multiline-secondary]) .mdc-deprecated-list-item__primary-text::before{display:none}:host([disabled]){color:var(--disabled-text-color)}:host([noninteractive]){pointer-events:unset}`,"rtl"===document.dir?s.iv`span.material-icons:first-of-type,span.material-icons:last-of-type{direction:rtl!important;--direction:rtl}`:s.iv``]}}]}}),o.K)},14002:function(e,t,i){var a=i(44249),n=i(72621),o=(i(22139),i(39527),i(99790),i(57243)),r=i(50778),s=i(11297);(0,a.Z)([(0,r.Mo)("ha-sortable")],(function(e,t){class a extends t{constructor(...t){super(...t),e(this)}}return{F:a,d:[{kind:"field",key:"_sortable",value:void 0},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,r.Cb)({type:Boolean,attribute:"no-style"})],key:"noStyle",value:()=>!1},{kind:"field",decorators:[(0,r.Cb)({type:String,attribute:"draggable-selector"})],key:"draggableSelector",value:void 0},{kind:"field",decorators:[(0,r.Cb)({type:String,attribute:"handle-selector"})],key:"handleSelector",value:void 0},{kind:"field",decorators:[(0,r.Cb)({type:String,attribute:"filter"})],key:"filter",value:void 0},{kind:"field",decorators:[(0,r.Cb)({type:String})],key:"group",value:void 0},{kind:"field",decorators:[(0,r.Cb)({type:Boolean,attribute:"invert-swap"})],key:"invertSwap",value:()=>!1},{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"options",value:void 0},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"rollback",value:()=>!0},{kind:"method",key:"updated",value:function(e){e.has("disabled")&&(this.disabled?this._destroySortable():this._createSortable())}},{kind:"field",key:"_shouldBeDestroy",value:()=>!1},{kind:"method",key:"disconnectedCallback",value:function(){(0,n.Z)(a,"disconnectedCallback",this,3)([]),this._shouldBeDestroy=!0,setTimeout((()=>{this._shouldBeDestroy&&(this._destroySortable(),this._shouldBeDestroy=!1)}),1)}},{kind:"method",key:"connectedCallback",value:function(){(0,n.Z)(a,"connectedCallback",this,3)([]),this._shouldBeDestroy=!1,this.hasUpdated&&!this.disabled&&this._createSortable()}},{kind:"method",key:"createRenderRoot",value:function(){return this}},{kind:"method",key:"render",value:function(){return this.noStyle?o.Ld:o.dy` <style>.sortable-fallback{display:none!important}.sortable-ghost{box-shadow:0 0 0 2px var(--primary-color);background:rgba(var(--rgb-primary-color),.25);border-radius:4px;opacity:.4}.sortable-drag{border-radius:4px;opacity:1;background:var(--card-background-color);box-shadow:0px 4px 8px 3px #00000026;cursor:grabbing}</style> `}},{kind:"method",key:"_createSortable",value:async function(){if(this._sortable)return;const e=this.children[0];if(!e)return;const t=(await Promise.all([i.e("4153"),i.e("9358")]).then(i.bind(i,97659))).default,a={scroll:!0,forceAutoScrollFallback:!0,scrollSpeed:20,animation:150,...this.options,onChoose:this._handleChoose,onStart:this._handleStart,onEnd:this._handleEnd,onUpdate:this._handleUpdate,onAdd:this._handleAdd,onRemove:this._handleRemove};this.draggableSelector&&(a.draggable=this.draggableSelector),this.handleSelector&&(a.handle=this.handleSelector),void 0!==this.invertSwap&&(a.invertSwap=this.invertSwap),this.group&&(a.group=this.group),this.filter&&(a.filter=this.filter),this._sortable=new t(e,a)}},{kind:"field",key:"_handleUpdate",value(){return e=>{(0,s.B)(this,"item-moved",{newIndex:e.newIndex,oldIndex:e.oldIndex})}}},{kind:"field",key:"_handleAdd",value(){return e=>{(0,s.B)(this,"item-added",{index:e.newIndex,data:e.item.sortableData})}}},{kind:"field",key:"_handleRemove",value(){return e=>{(0,s.B)(this,"item-removed",{index:e.oldIndex})}}},{kind:"field",key:"_handleEnd",value(){return async e=>{(0,s.B)(this,"drag-end"),this.rollback&&e.item.placeholder&&(e.item.placeholder.replaceWith(e.item),delete e.item.placeholder)}}},{kind:"field",key:"_handleStart",value(){return()=>{(0,s.B)(this,"drag-start")}}},{kind:"field",key:"_handleChoose",value(){return e=>{this.rollback&&(e.item.placeholder=document.createComment("sort-placeholder"),e.item.after(e.item.placeholder))}}},{kind:"method",key:"_destroySortable",value:function(){this._sortable&&(this._sortable.destroy(),this._sortable=void 0)}}]}}),o.oi)},71656:function(e,t,i){i.d(t,{IO:function(){return o},Lo:function(){return n},a:function(){return r}});i(92745);var a=i(32770);i(86912);const n=(e,t)=>e.callWS({type:"config/area_registry/create",...t}),o=(e,t,i)=>e.callWS({type:"config/area_registry/update",area_id:t,...i}),r=(e,t)=>(i,n)=>{const o=t?t.indexOf(i):-1,r=t?t.indexOf(n):-1;if(-1===o&&-1===r){const t=e?.[i]?.name??i,o=e?.[n]?.name??n;return(0,a.$)(t,o)}return-1===o?1:-1===r?-1:o-r}},86912:function(e,t,i){i(32770)},35959:function(e,t,i){i.r(t),i.d(t,{DialogAreaFilter:function(){return h}});var a=i(44249),n=(i(92745),i(39527),i(99790),i(2060),i(57243)),o=i(50778),r=i(35359),s=i(91583),d=i(11297),l=(i(20095),i(44118),i(59897),i(74064),i(14002),i(71656)),c=i(66193);let h=(0,a.Z)([(0,o.Mo)("dialog-area-filter")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_dialogParams",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_hidden",value:()=>[]},{kind:"field",decorators:[(0,o.SB)()],key:"_areas",value:()=>[]},{kind:"method",key:"showDialog",value:function(e){this._dialogParams=e,this._hidden=e.initialValue?.hidden??[];const t=e.initialValue?.order??[],i=Object.keys(this.hass.areas);this._areas=i.concat().sort((0,l.a)(this.hass.areas,t))}},{kind:"method",key:"closeDialog",value:function(){this._dialogParams=void 0,this._hidden=[],this._areas=[],(0,d.B)(this,"dialog-closed",{dialog:this.localName})}},{kind:"method",key:"_submit",value:function(){const e=this._areas.filter((e=>!this._hidden.includes(e))),t={hidden:this._hidden,order:e};this._dialogParams?.submit?.(t),this.closeDialog()}},{kind:"method",key:"_cancel",value:function(){this._dialogParams?.cancel?.(),this.closeDialog()}},{kind:"method",key:"_areaMoved",value:function(e){e.stopPropagation();const{oldIndex:t,newIndex:i}=e.detail,a=this._areas.concat(),n=a.splice(t,1)[0];a.splice(i,0,n),this._areas=a}},{kind:"method",key:"render",value:function(){if(!this._dialogParams||!this.hass)return n.Ld;const e=this._areas;return n.dy` <ha-dialog open @closed="${this._cancel}" .heading="${this._dialogParams.title??this.hass.localize("ui.components.area-filter.title")}"> <ha-sortable draggable-selector=".draggable" handle-selector=".handle" @item-moved="${this._areaMoved}"> <mwc-list class="areas"> ${(0,s.r)(e,(e=>e),((e,t)=>{const i=!this._hidden.includes(e),a=this.hass.areas[e]?.name||e;return n.dy` <ha-list-item class="${(0,r.$)({hidden:!i,draggable:i})}" hasMeta graphic="icon" noninteractive> ${i?n.dy`<ha-svg-icon class="handle" .path="${"M7,19V17H9V19H7M11,19V17H13V19H11M15,19V17H17V19H15M7,15V13H9V15H7M11,15V13H13V15H11M15,15V13H17V15H15M7,11V9H9V11H7M11,11V9H13V11H11M15,11V9H17V11H15M7,7V5H9V7H7M11,7V5H13V7H11M15,7V5H17V7H15Z"}" slot="graphic"></ha-svg-icon>`:n.Ld} ${a} <ha-icon-button tabindex="0" class="action" .path="${i?"M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17M12,4.5C7,4.5 2.73,7.61 1,12C2.73,16.39 7,19.5 12,19.5C17,19.5 21.27,16.39 23,12C21.27,7.61 17,4.5 12,4.5Z":"M11.83,9L15,12.16C15,12.11 15,12.05 15,12A3,3 0 0,0 12,9C11.94,9 11.89,9 11.83,9M7.53,9.8L9.08,11.35C9.03,11.56 9,11.77 9,12A3,3 0 0,0 12,15C12.22,15 12.44,14.97 12.65,14.92L14.2,16.47C13.53,16.8 12.79,17 12,17A5,5 0 0,1 7,12C7,11.21 7.2,10.47 7.53,9.8M2,4.27L4.28,6.55L4.73,7C3.08,8.3 1.78,10 1,12C2.73,16.39 7,19.5 12,19.5C13.55,19.5 15.03,19.2 16.38,18.66L16.81,19.08L19.73,22L21,20.73L3.27,3M12,7A5,5 0 0,1 17,12C17,12.64 16.87,13.26 16.64,13.82L19.57,16.75C21.07,15.5 22.27,13.86 23,12C21.27,7.61 17,4.5 12,4.5C10.6,4.5 9.26,4.75 8,5.2L10.17,7.35C10.74,7.13 11.35,7 12,7Z"}" slot="meta" .label="${this.hass.localize("ui.components.area-filter."+(i?"hide":"show"),{area:a})}" .area="${e}" @click="${this._toggle}"></ha-icon-button> </ha-list-item> `}))} </mwc-list> </ha-sortable> <ha-button slot="secondaryAction" dialogAction="cancel"> ${this.hass.localize("ui.common.cancel")} </ha-button> <ha-button @click="${this._submit}" slot="primaryAction"> ${this.hass.localize("ui.common.submit")} </ha-button> </ha-dialog> `}},{kind:"method",key:"_toggle",value:function(e){const t=e.target.area,i=[...this._hidden??[]];i.includes(t)?i.splice(i.indexOf(t),1):i.push(t),this._hidden=i;const a=this._areas.filter((e=>!this._hidden.includes(e))),n=this._areas.filter((e=>this._hidden.includes(e)));this._areas=[...a,...n]}},{kind:"get",static:!0,key:"styles",value:function(){return[c.yu,n.iv`ha-dialog{--dialog-z-index:104;--dialog-content-padding:0}ha-list-item{overflow:visible}.hidden{color:var(--disabled-text-color)}.handle{cursor:move;cursor:grab}.actions{display:flex;flex-direction:row}ha-icon-button{display:block;margin:-12px}`]}}]}}),n.oi)},87319:function(e,t,i){var a=i(9065),n=i(50778),o=i(65703),r=i(46289);let s=class extends o.K{};s.styles=[r.W],s=(0,a.gn)([(0,n.Mo)("mwc-list-item")],s)},91583:function(e,t,i){i.d(t,{r:()=>s});var a=i("2841"),n=i("45779"),o=i("53232");const r=(e,t,i)=>{const a=new Map;for(let n=t;n<=i;n++)a.set(e[n],n);return a},s=(0,n.XM)(class extends n.Xe{constructor(e){if(super(e),e.type!==n.pX.CHILD)throw Error("repeat() can only be used in text expressions")}ct(e,t,i){let a;void 0===i?i=t:void 0!==t&&(a=t);const n=[],o=[];let r=0;for(const t of e)n[r]=a?a(t,r):r,o[r]=i(t,r),r++;return{values:o,keys:n}}render(e,t,i){return this.ct(e,t,i).values}update(e,[t,i,n]){var s;const d=(0,o.i9)(e),{values:l,keys:c}=this.ct(t,i,n);if(!Array.isArray(d))return this.ut=c,l;const h=null!==(s=this.ut)&&void 0!==s?s:this.ut=[],u=[];let p,m,f=0,v=d.length-1,g=0,y=l.length-1;for(;f<=v&&g<=y;)if(null===d[f])f++;else if(null===d[v])v--;else if(h[f]===c[g])u[g]=(0,o.fk)(d[f],l[g]),f++,g++;else if(h[v]===c[y])u[y]=(0,o.fk)(d[v],l[y]),v--,y--;else if(h[f]===c[y])u[y]=(0,o.fk)(d[f],l[y]),(0,o._Y)(e,u[y+1],d[f]),f++,y--;else if(h[v]===c[g])u[g]=(0,o.fk)(d[v],l[g]),(0,o._Y)(e,d[f],d[v]),v--,g++;else if(void 0===p&&(p=r(c,g,y),m=r(h,f,v)),p.has(h[f]))if(p.has(h[v])){const t=m.get(c[g]),i=void 0!==t?d[t]:null;if(null===i){const t=(0,o._Y)(e,d[f]);(0,o.fk)(t,l[g]),u[g]=t}else u[g]=(0,o.fk)(i,l[g]),(0,o._Y)(e,d[f],i),d[t]=null;g++}else(0,o.ws)(d[v]),v--;else(0,o.ws)(d[f]),f++;for(;g<=y;){const t=(0,o._Y)(e,u[y+1]);(0,o.fk)(t,l[g]),u[g++]=t}for(;f<=v;){const e=d[f++];null!==e&&(0,o.ws)(e)}return this.ut=c,(0,o.hl)(e,u),a.Jb}})}};
|
|
//# sourceMappingURL=6475.f51b3532155d8ff6.js.map
|