iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
2 lines • 16.1 kB
JavaScript
/*! For license information please see 57317.04c8d04c2b4076c4.js.LICENSE.txt */
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[57317],{35370:function(t,e,o){var a=o(26198);t.exports=function(t,e,o){for(var i=0,r=arguments.length>2?o:a(e),s=new t(r);r>i;)s[i]=e[i++];return s}},69479:function(t,e,o){var a=o(43724),i=o(62106),r=o(65213),s=o(67979);a&&!r.correct&&(i(RegExp.prototype,"flags",{configurable:!0,get:s}),r.correct=!0)},13611:function(t,e,o){var a=o(46518),i=o(44576),r=o(62106),s=o(43724),n=TypeError,l=Object.defineProperty,c=i.self!==i;try{if(s){var d=Object.getOwnPropertyDescriptor(i,"self");!c&&d&&d.get&&d.enumerable||r(i,"self",{get:function(){return i},set:function(t){if(this!==i)throw new n("Illegal invocation");l(i,"self",{value:t,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}else a({global:!0,simple:!0,forced:c},{self:i})}catch(h){}},31886:function(t,e,o){o.a(t,async function(t,a){try{o.d(e,{BB:function(){return i.B}});o(38744);var i=o(88775),r=o(49232),s=o(78713),n=o(53834),l=o(35204),c=o(5806),d=t([i,r,s,n,l,c]);[i,r,s,n,l,c]=d.then?(await d)():d,a()}catch(h){a(h)}})},1126:function(t,e,o){o.a(t,async function(t,e){try{o(3362),o(27495),o(62953);var a=o(5124),i=o(67576),r=o(6412),s=o(63672),n=o(17051),l=o(42462),c=o(28438),d=o(98779),h=o(27259),u=o(25877),w=o(31247),p=o(4444),f=o(92070),m=o(9395),v=o(717),b=o(17060),g=o(88496),y=o(57024),k=t([g,b]);[g,b]=k.then?(await k)():k;let C,D,E,L=t=>t;var x=Object.defineProperty,I=Object.getOwnPropertyDescriptor,A=(t,e,o,a)=>{for(var i,r=a>1?void 0:a?I(e,o):e,s=t.length-1;s>=0;s--)(i=t[s])&&(r=(a?i(e,o,r):i(r))||r);return a&&r&&x(e,o,r),r};let P=class extends v.A{firstUpdated(){a.S$||this.open&&(this.addOpenListeners(),this.drawer.showModal(),(0,p.JG)(this))}disconnectedCallback(){super.disconnectedCallback(),(0,p.I7)(this),this.removeOpenListeners()}async requestClose(t){const e=new c.L({source:t});if(this.dispatchEvent(e),e.defaultPrevented)return this.open=!0,void(0,h.Ud)(this.drawer,"pulse");this.removeOpenListeners(),await(0,h.Ud)(this.drawer,"hide"),this.open=!1,this.drawer.close(),(0,p.I7)(this);const o=this.originalTrigger;"function"==typeof(null==o?void 0:o.focus)&&setTimeout(()=>o.focus()),this.dispatchEvent(new n.Z)}addOpenListeners(){document.addEventListener("keydown",this.handleDocumentKeyDown),(0,u.AZ)(this)}removeOpenListeners(){document.removeEventListener("keydown",this.handleDocumentKeyDown),(0,u.Fw)(this)}handleDialogCancel(t){t.preventDefault(),!this.drawer.classList.contains("hide")&&t.target===this.drawer&&(0,u.a0)(this)&&this.requestClose(this.drawer)}handleDialogClick(t){const e=t.target.closest('[data-drawer="close"]');e&&(t.stopPropagation(),this.requestClose(e))}async handleDialogPointerDown(t){t.target===this.drawer&&(this.lightDismiss?this.requestClose(this.drawer):await(0,h.Ud)(this.drawer,"pulse"))}handleOpenChange(){this.open&&!this.drawer.open?this.show():this.drawer.open&&(this.open=!0,this.requestClose(this.drawer))}async show(){const t=new d.k;this.dispatchEvent(t),t.defaultPrevented?this.open=!1:(this.addOpenListeners(),this.originalTrigger=document.activeElement,this.open=!0,this.drawer.showModal(),(0,p.JG)(this),requestAnimationFrame(()=>{const t=this.querySelector("[autofocus]");t&&"function"==typeof t.focus?t.focus():this.drawer.focus()}),await(0,h.Ud)(this.drawer,"show"),this.dispatchEvent(new l.q))}render(){var t;const e=!this.withoutHeader,o=this.hasUpdated?this.hasSlotController.test("footer"):this.withFooter;return(0,a.qy)(C||(C=L` <dialog aria-labelledby="${0}" aria-describedby="${0}" part="dialog" class="${0}" ="${0}" ="${0}" ="${0}"> ${0} <div part="body" class="body"><slot></slot></div> ${0} </dialog> `),null!==(t=this.ariaLabelledby)&&void 0!==t?t:"title",(0,s.J)(this.ariaDescribedby),(0,r.H)({drawer:!0,open:this.open,top:"top"===this.placement,end:"end"===this.placement,bottom:"bottom"===this.placement,start:"start"===this.placement}),this.handleDialogCancel,this.handleDialogClick,this.handleDialogPointerDown,e?(0,a.qy)(D||(D=L` <header part="header" class="header"> <h2 part="title" class="title" id="title"> <slot name="label"> ${0} </slot> </h2> <div part="header-actions" class="header-actions"> <slot name="header-actions"></slot> <wa-button part="close-button" exportparts="base:close-button__base" class="close" appearance="plain" ="${0}"> <wa-icon name="xmark" label="${0}" library="system" variant="solid"></wa-icon> </wa-button> </div> </header> `),this.label.length>0?this.label:String.fromCharCode(8203),t=>this.requestClose(t.target),this.localize.term("close")):"",o?(0,a.qy)(E||(E=L` <footer part="footer" class="footer"> <slot name="footer"></slot> </footer> `)):"")}constructor(){super(...arguments),this.localize=new b.c(this),this.hasSlotController=new f.X(this,"footer","header-actions","label"),this.open=!1,this.label="",this.placement="end",this.withoutHeader=!1,this.lightDismiss=!0,this.withFooter=!1,this.handleDocumentKeyDown=t=>{"Escape"===t.key&&this.open&&(0,u.a0)(this)&&(t.preventDefault(),t.stopPropagation(),this.requestClose(this.drawer))}}};P.css=y.A,A([(0,i.P)(".drawer")],P.prototype,"drawer",2),A([(0,i.MZ)({type:Boolean,reflect:!0})],P.prototype,"open",2),A([(0,i.MZ)({reflect:!0})],P.prototype,"label",2),A([(0,i.MZ)({reflect:!0})],P.prototype,"placement",2),A([(0,i.MZ)({attribute:"without-header",type:Boolean,reflect:!0})],P.prototype,"withoutHeader",2),A([(0,i.MZ)({attribute:"light-dismiss",type:Boolean})],P.prototype,"lightDismiss",2),A([(0,i.MZ)({attribute:"aria-labelledby"})],P.prototype,"ariaLabelledby",2),A([(0,i.MZ)({attribute:"aria-describedby"})],P.prototype,"ariaDescribedby",2),A([(0,i.MZ)({attribute:"with-footer",type:Boolean})],P.prototype,"withFooter",2),A([(0,m.w)("open",{waitUntilFirstUpdate:!0})],P.prototype,"handleOpenChange",1),P=A([(0,i.EM)("wa-drawer")],P),a.S$||(document.addEventListener("click",t=>{const e=t.target.closest("[data-drawer]");if(e instanceof Element){const[t,o]=(0,w.v)(e.getAttribute("data-drawer")||"");if("open"===t&&null!=o&&o.length){const t=e.getRootNode().getElementById(o);"wa-drawer"===(null==t?void 0:t.localName)?t.open=!0:console.warn(`A drawer with an ID of "${o}" could not be found in this document.`)}}}),document.addEventListener("pointerdown",()=>{})),e()}catch(C){e(C)}})},57024:function(t,e,o){o.d(e,{A:function(){return i}});let a;var i=(0,o(5124).AH)(a||(a=(t=>t)`:host{--size:25rem;--spacing:var(--wa-space-l);--backdrop-filter:none;--show-duration:200ms;--hide-duration:200ms;display:none}:host([open]){display:block}.drawer{display:flex;flex-direction:column;top:0;inset-inline-start:0;width:100%;height:100%;max-width:100%;max-height:100%;overflow:hidden;color:inherit;background-color:var(--wa-color-surface-raised);border:none;box-shadow:var(--wa-shadow-l);overflow:auto;padding:0;margin:0;animation-duration:var(--show-duration);animation-timing-function:ease}.drawer.show::backdrop{animation:show-backdrop var(--show-duration,200ms) ease}.drawer.hide::backdrop{animation:show-backdrop var(--hide-duration,200ms) ease reverse}.drawer.show.top{animation:show-drawer-from-top var(--show-duration) ease}.drawer.hide.top{animation:show-drawer-from-top var(--hide-duration) ease reverse}.drawer.show.end{animation:show-drawer-from-end var(--show-duration) ease}.drawer.show.end:dir(rtl){animation-name:show-drawer-from-start}.drawer.hide.end{animation:show-drawer-from-end var(--hide-duration) ease reverse}.drawer.hide.end:dir(rtl){animation-name:show-drawer-from-start}.drawer.show.bottom{animation:show-drawer-from-bottom var(--show-duration) ease}.drawer.hide.bottom{animation:show-drawer-from-bottom var(--hide-duration) ease reverse}.drawer.show.start{animation:show-drawer-from-start var(--show-duration) ease}.drawer.show.start:dir(rtl){animation-name:show-drawer-from-end}.drawer.hide.start{animation:show-drawer-from-start var(--hide-duration) ease reverse}.drawer.hide.start:dir(rtl){animation-name:show-drawer-from-end}.drawer.pulse{animation:pulse 250ms ease}.drawer:focus{outline:0}.top{top:0;inset-inline-end:auto;bottom:auto;inset-inline-start:0;width:100%;height:var(--size)}.end{top:0;inset-inline-end:0;bottom:auto;inset-inline-start:auto;width:var(--size);height:100%}.bottom{top:auto;inset-inline-end:auto;bottom:0;inset-inline-start:0;width:100%;height:var(--size)}.start{top:0;inset-inline-end:auto;bottom:auto;inset-inline-start:0;width:var(--size);height:100%}.header{display:flex;flex-wrap:nowrap;padding-inline-start:var(--spacing);padding-block-end:0;padding-inline-end:calc(var(--spacing) - var(--wa-form-control-padding-block));padding-block-start:calc(var(--spacing) - var(--wa-form-control-padding-block))}.title{align-self:center;flex:1 1 auto;font:inherit;font-size:var(--wa-font-size-l);font-weight:var(--wa-font-weight-heading);line-height:var(--wa-line-height-condensed);margin:0}.header-actions{align-self:start;display:flex;flex-shrink:0;flex-wrap:wrap;justify-content:end;gap:var(--wa-space-2xs);padding-inline-start:var(--spacing)}.header-actions ::slotted(wa-button),.header-actions wa-button{flex:0 0 auto;display:flex;align-items:center}.body{flex:1 1 auto;display:block;padding:var(--spacing);overflow:auto;-webkit-overflow-scrolling:touch}.body:focus{outline:0}.body:focus-visible{outline:var(--wa-focus-ring);outline-offset:var(--wa-focus-ring-offset)}.footer{display:flex;flex-wrap:wrap;gap:var(--wa-space-xs);justify-content:end;padding:var(--spacing);padding-block-start:0}.footer ::slotted(wa-button:not(:last-of-type)){margin-inline-end:var(--wa-spacing-xs)}.drawer::backdrop{background-color:var(--wa-color-overlay-modal,rgb(0 0 0 / .25));-webkit-backdrop-filter:var(--backdrop-filter);backdrop-filter:var(--backdrop-filter)} pulse{0%{scale:1}50%{scale:1.01}100%{scale:1}} show-drawer{from{opacity:0;scale:0.8}to{opacity:1;scale:1}} show-drawer-from-top{from{opacity:0;translate:0 -100%}to{opacity:1;translate:0 0}} show-drawer-from-end{from{opacity:0;translate:100%}to{opacity:1;translate:0 0}} show-drawer-from-bottom{from{opacity:0;translate:0 100%}to{opacity:1;translate:0 0}} show-drawer-from-start{from{opacity:0;translate:-100% 0}to{opacity:1;translate:0 0}} show-backdrop{from{opacity:0}to{opacity:1}} (forced-colors:active){.drawer{border:solid 1px #fff}}`))},95010:function(t,e,o){o.d(e,{q:function(){return i},N:function(){return r}});o(54743),o(11745),o(16573),o(78100),o(77936),o(21489),o(48140),o(75044),o(21903),o(91134),o(28845),o(373),o(37467),o(44732),o(79577),o(16632),o(34226),o(9486),o(20456);let a=(t=21)=>{let e="",o=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&o[t]];return e};function i(t,e,o){const a=t=>Object.is(t,-0)?0:t;return a(t<e?e:t>o?o:t)}function r(t=""){return`${t}${a()}`}},4444:function(t,e,o){o.d(e,{JG:function(){return i},Rt:function(){return s},I7:function(){return r}});o(27495),o(17642),o(58004),o(33853),o(45876),o(32475),o(15024),o(31698),o(25440),o(62953);const a=new Set;function i(t){if(a.add(t),!document.documentElement.classList.contains("wa-scroll-lock")){const t=function(){const t=document.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}()+function(){const t=Number(getComputedStyle(document.body).paddingRight.replace(/px/,""));return isNaN(t)||!t?0:t}();let e=getComputedStyle(document.documentElement).scrollbarGutter;e&&"auto"!==e||(e="stable"),t<2&&(e=""),document.documentElement.style.setProperty("--wa-scroll-lock-gutter",e),document.documentElement.classList.add("wa-scroll-lock"),document.documentElement.style.setProperty("--wa-scroll-lock-size",`${t}px`)}}function r(t){a.delete(t),0===a.size&&(document.documentElement.classList.remove("wa-scroll-lock"),document.documentElement.style.removeProperty("--wa-scroll-lock-size"))}function s(t,e,o="vertical",a="smooth"){const i=function(t,e){return{top:Math.round(t.getBoundingClientRect().top-e.getBoundingClientRect().top),left:Math.round(t.getBoundingClientRect().left-e.getBoundingClientRect().left)}}(t,e),r=i.top+e.scrollTop,s=i.left+e.scrollLeft,n=e.scrollLeft,l=e.scrollLeft+e.offsetWidth,c=e.scrollTop,d=e.scrollTop+e.offsetHeight;"horizontal"!==o&&"both"!==o||(s<n?e.scrollTo({left:s,behavior:a}):s+t.clientWidth>l&&e.scrollTo({left:s-e.offsetWidth+t.clientWidth,behavior:a})),"vertical"!==o&&"both"!==o||(r<c?e.scrollTo({top:r,behavior:a}):r+t.clientHeight>d&&e.scrollTo({top:r-e.offsetHeight+t.clientHeight,behavior:a}))}},25423:function(t,e,o){o.d(e,{U:function(){return i},Z:function(){return r}});o(44114),o(62953);var a=o(27525);const i={ArrowDown:"ArrowDown",ArrowLeft:"ArrowLeft",ArrowUp:"ArrowUp",ArrowRight:"ArrowRight",Home:"Home",End:"End"};class r{get items(){const t=this.getPossibleItems(),e=[];for(const o of t){if(this.isItem(o)){e.push(o);continue}const t=o.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 o=this.items;if(!o.length)return;const r=(0,a.A6)(o,this.isActivatable);t.preventDefault();const s=this.isRtl(),n=s?i.ArrowRight:i.ArrowLeft,l=s?i.ArrowLeft:i.ArrowRight;let c=null;switch(e){case i.ArrowDown:case l:c=(0,a.wm)(o,r,this.isActivatable,this.wrapNavigation());break;case i.ArrowUp:case n:c=(0,a.u9)(o,r,this.isActivatable,this.wrapNavigation());break;case i.Home:c=(0,a.zT)(o,this.isActivatable);break;case i.End:c=(0,a.RZ)(o,this.isActivatable)}c&&r&&r.item!==c&&(r.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 a of t){!(!a.disabled&&a.tabIndex>-1)||e?a.tabIndex=-1:(e=!0,a.tabIndex=0)}if(e)return;const o=(0,a.c7)(t,this.isActivatable);o&&(o.tabIndex=0)};const{isItem:e,getPossibleItems:o,isRtl:r,deactivateItem:s,activateItem:n,isNavigableKey:l,isActivatable:c,wrapNavigation:d}=t;this.isItem=e,this.getPossibleItems=o,this.isRtl=r,this.deactivateItem=s,this.activateItem=n,this.isNavigableKey=l,this.isActivatable=c,this.wrapNavigation=null!=d?d:()=>!0}}},11245:function(t,e,o){o.d(e,{R:function(){return i}});let a;const i=(0,o(5124).AH)(a||(a=(t=>t)`: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:function(t,e,o){o.d(e,{B:function(){return d}});o(93775),o(17642),o(58004),o(33853),o(45876),o(32475),o(15024),o(31698),o(62953);var a=o(40445),i=o(5124),r=o(67576),s=o(25423);let n,l=t=>t;const c=new Set(Object.values(s.U));class d extends i.WF{get items(){return this.listController.items}render(){return(0,i.qy)(n||(n=l` <slot -items="${0}" -activation="${0}" ="${0}"> </slot> `),this.listController.onDeactivateItems,this.listController.onRequestActivation,this.listController.onSlotchange)}activateNextItem(){return this.listController.activateNextItem()}activatePreviousItem(){return this.listController.activatePreviousItem()}constructor(){super(),this.listController=new s.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=>c.has(t),isActivatable:t=>!t.disabled&&"text"!==t.type}),this.internals=this.attachInternals(),i.S$||(this.internals.role="list",this.addEventListener("keydown",this.listController.handleKeydown))}}(0,a.Cg)([(0,r.KN)({flatten:!0})],d.prototype,"slotItems",void 0)}}]);