iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
5 lines • 14.8 kB
JavaScript
/*! For license information please see 58822.5619a3b5e6ce9279.js.LICENSE.txt */
;(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[58822],{54706:function(t,e,o){o.d(e,{E:function(){return n}});o(74423),o(18111),o(13579),o(3362),o(62953);var i=o(40445),s=o(67576);const n=t=>{class e extends t{connectedCallback(){super.connectedCallback(),this._checkSubscribed()}disconnectedCallback(){if(super.disconnectedCallback(),this.__unsubs){for(;this.__unsubs.length;){const t=this.__unsubs.pop();t instanceof Promise?t.then(t=>t()):t()}this.__unsubs=void 0}}updated(t){if(super.updated(t),t.has("hass"))this._checkSubscribed();else if(this.hassSubscribeRequiredHostProps)for(const e of t.keys())if(this.hassSubscribeRequiredHostProps.includes(e))return void this._checkSubscribed()}hassSubscribe(){return[]}_checkSubscribed(){var t;void 0!==this.__unsubs||!this.isConnected||void 0===this.hass||null!==(t=this.hassSubscribeRequiredHostProps)&&void 0!==t&&t.some(t=>void 0===this[t])||(this.__unsubs=this.hassSubscribe())}}return(0,i.Cg)([(0,s.MZ)({attribute:!1})],e.prototype,"hass",void 0),e}},35370:function(t,e,o){var i=o(26198);t.exports=function(t,e,o){for(var s=0,n=arguments.length>2?o:i(e),r=new t(n);n>s;)r[s]=e[s++];return r}},52630:function(t,e,o){o.a(t,async function(t,i){try{o.d(e,{A:function(){return $}});o(74423),o(44114),o(18111),o(22489),o(3362),o(27495),o(62953);var s=o(5124),n=o(67576),r=o(6412),a=o(17051),h=o(42462),l=o(28438),d=o(98779),u=o(27259),c=o(25877),p=o(984),v=o(95010),b=o(9395),f=o(717),w=o(40158),y=o(51920),g=t([w]);w=(g.then?(await g)():g)[0];let k,C=t=>t;var m=Object.defineProperty,A=Object.getOwnPropertyDescriptor,_=(t,e,o,i)=>{for(var s,n=i>1?void 0:i?A(e,o):e,r=t.length-1;r>=0;r--)(s=t[r])&&(n=(i?s(e,o,n):s(n))||n);return i&&n&&m(e,o,n),n};let $=class extends f.A{connectedCallback(){super.connectedCallback(),this.eventController.signal.aborted&&(this.eventController=new AbortController),this.addEventListener("mouseout",this.handleMouseOut),this.open&&(this.open=!1,this.updateComplete.then(()=>{this.open=!0})),this.id||(this.id=(0,v.N)("wa-tooltip-")),this.for&&this.anchor?(this.anchor=null,this.handleForChange()):this.for&&this.handleForChange()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("keydown",this.handleDocumentKeyDown),(0,c.Fw)(this),this.eventController.abort(),this.anchor&&this.removeFromAriaLabelledBy(this.anchor,this.id)}firstUpdated(){this.body.hidden=!this.open,this.open&&(this.popup.active=!0,this.popup.reposition())}hasTrigger(t){return this.trigger.split(" ").includes(t)}addToAriaLabelledBy(t,e){const o=(t.getAttribute("aria-labelledby")||"").split(/\s+/).filter(Boolean);o.includes(e)||(o.push(e),t.setAttribute("aria-labelledby",o.join(" ")))}removeFromAriaLabelledBy(t,e){const o=(t.getAttribute("aria-labelledby")||"").split(/\s+/).filter(Boolean).filter(t=>t!==e);o.length>0?t.setAttribute("aria-labelledby",o.join(" ")):t.removeAttribute("aria-labelledby")}async handleOpenChange(){if(this.open){if(this.disabled)return;const t=new d.k;if(this.dispatchEvent(t),t.defaultPrevented)return void(this.open=!1);document.addEventListener("keydown",this.handleDocumentKeyDown,{signal:this.eventController.signal}),(0,c.AZ)(this),this.body.hidden=!1,this.popup.active=!0,await(0,u.Ud)(this.popup.popup,"show-with-scale"),this.popup.reposition(),this.dispatchEvent(new h.q)}else{const t=new l.L;if(this.dispatchEvent(t),t.defaultPrevented)return void(this.open=!1);document.removeEventListener("keydown",this.handleDocumentKeyDown),(0,c.Fw)(this),await(0,u.Ud)(this.popup.popup,"hide-with-scale"),this.popup.active=!1,this.body.hidden=!0,this.dispatchEvent(new a.Z)}}handleForChange(){const t=this.getRootNode();if(!t)return;const e=this.for?t.getElementById(this.for):null,o=this.anchor;if(e===o)return;const{signal:i}=this.eventController;e&&(this.addToAriaLabelledBy(e,this.id),e.addEventListener("blur",this.handleBlur,{capture:!0,signal:i}),e.addEventListener("focus",this.handleFocus,{capture:!0,signal:i}),e.addEventListener("click",this.handleClick,{signal:i}),e.addEventListener("mouseover",this.handleMouseOver,{signal:i}),e.addEventListener("mouseout",this.handleMouseOut,{signal:i})),o&&(this.removeFromAriaLabelledBy(o,this.id),o.removeEventListener("blur",this.handleBlur,{capture:!0}),o.removeEventListener("focus",this.handleFocus,{capture:!0}),o.removeEventListener("click",this.handleClick),o.removeEventListener("mouseover",this.handleMouseOver),o.removeEventListener("mouseout",this.handleMouseOut)),this.anchor=e}async handleOptionsChange(){this.hasUpdated&&(await this.updateComplete,this.popup.reposition())}handleDisabledChange(){this.disabled&&this.open&&this.hide()}async show(){if(!this.open)return this.open=!0,(0,p.l)(this,"wa-after-show")}async hide(){if(this.open)return this.open=!1,(0,p.l)(this,"wa-after-hide")}render(){return(0,s.qy)(k||(k=C` <wa-popup part="base" exportparts="
popup:base__popup,
arrow:base__arrow
" class="${0}" placement="${0}" distance="${0}" skidding="${0}" flip shift ?arrow="${0}" hover-bridge .anchor="${0}"> <div part="body" class="body"> <slot></slot> </div> </wa-popup> `),(0,r.H)({tooltip:!0,"tooltip-open":this.open}),this.placement,this.distance,this.skidding,!this.withoutArrow,this.anchor)}constructor(){super(...arguments),this.placement="top",this.disabled=!1,this.distance=8,this.open=!1,this.skidding=0,this.showDelay=150,this.hideDelay=0,this.trigger="hover focus",this.withoutArrow=!1,this.for=null,this.anchor=null,this.eventController=new AbortController,this.handleBlur=()=>{this.hasTrigger("focus")&&this.hide()},this.handleClick=()=>{this.hasTrigger("click")&&(this.open?this.hide():this.show())},this.handleFocus=()=>{this.hasTrigger("focus")&&this.show()},this.handleDocumentKeyDown=t=>{"Escape"===t.key&&this.open&&(0,c.a0)(this)&&(t.preventDefault(),t.stopPropagation(),this.hide())},this.handleMouseOver=()=>{this.hasTrigger("hover")&&(clearTimeout(this.hoverTimeout),this.hoverTimeout=window.setTimeout(()=>this.show(),this.showDelay))},this.handleMouseOut=()=>{if(this.hasTrigger("hover")){var t;const e=Boolean(null===(t=this.anchor)||void 0===t?void 0:t.matches(":hover")),o=this.matches(":hover");if(e||o)return;clearTimeout(this.hoverTimeout),e||o||(this.hoverTimeout=window.setTimeout(()=>{this.hide()},this.hideDelay))}}}};$.css=y.A,$.dependencies={"wa-popup":w.A},_([(0,n.P)("slot:not([name])")],$.prototype,"defaultSlot",2),_([(0,n.P)(".body")],$.prototype,"body",2),_([(0,n.P)("wa-popup")],$.prototype,"popup",2),_([(0,n.MZ)()],$.prototype,"placement",2),_([(0,n.MZ)({type:Boolean,reflect:!0})],$.prototype,"disabled",2),_([(0,n.MZ)({type:Number})],$.prototype,"distance",2),_([(0,n.MZ)({type:Boolean,reflect:!0})],$.prototype,"open",2),_([(0,n.MZ)({type:Number})],$.prototype,"skidding",2),_([(0,n.MZ)({attribute:"show-delay",type:Number})],$.prototype,"showDelay",2),_([(0,n.MZ)({attribute:"hide-delay",type:Number})],$.prototype,"hideDelay",2),_([(0,n.MZ)()],$.prototype,"trigger",2),_([(0,n.MZ)({attribute:"without-arrow",type:Boolean,reflect:!0})],$.prototype,"withoutArrow",2),_([(0,n.MZ)()],$.prototype,"for",2),_([(0,n.wk)()],$.prototype,"anchor",2),_([(0,b.w)("open",{waitUntilFirstUpdate:!0})],$.prototype,"handleOpenChange",1),_([(0,b.w)("for")],$.prototype,"handleForChange",1),_([(0,b.w)(["distance","placement","skidding"])],$.prototype,"handleOptionsChange",1),_([(0,b.w)("disabled")],$.prototype,"handleDisabledChange",1),$=_([(0,n.EM)("wa-tooltip")],$),i()}catch(k){i(k)}})},51920:function(t,e,o){o.d(e,{A:function(){return s}});let i;var s=(0,o(5124).AH)(i||(i=(t=>t)`:host{--max-width:30ch;display:inline-block;position:absolute;color:var(--wa-tooltip-content-color);font-size:var(--wa-tooltip-font-size);line-height:var(--wa-tooltip-line-height);text-align:start;white-space:normal}.tooltip{--arrow-size:var(--wa-tooltip-arrow-size);--arrow-color:var(--wa-tooltip-background-color)}.tooltip::part(popup){z-index:1000}.tooltip[placement^=top]::part(popup){transform-origin:bottom}.tooltip[placement^=bottom]::part(popup){transform-origin:top}.tooltip[placement^=left]::part(popup){transform-origin:right}.tooltip[placement^=right]::part(popup){transform-origin:left}.body{display:block;width:max-content;max-width:var(--max-width);border-radius:var(--wa-tooltip-border-radius);background-color:var(--wa-tooltip-background-color);border:var(--wa-tooltip-border-width) var(--wa-tooltip-border-style) var(--wa-tooltip-border-color);padding:.25em .5em;user-select:none;-webkit-user-select:none}.tooltip{--popup-border-width:var(--wa-tooltip-border-width)}.tooltip::part(arrow){border-bottom:var(--wa-tooltip-border-width) var(--wa-tooltip-border-style) var(--wa-tooltip-border-color);border-right:var(--wa-tooltip-border-width) var(--wa-tooltip-border-style) var(--wa-tooltip-border-color)}`))},984:function(t,e,o){o.d(e,{l:function(){return i}});o(3362);function i(t,e){return new Promise(o=>{t.addEventListener(e,function i(s){s.target===t&&(t.removeEventListener(e,i),o())})})}},95010:function(t,e,o){o.d(e,{q:function(){return s},N:function(){return n}});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 i=(t=21)=>{let e="",o=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&o[t]];return e};function s(t,e,o){const i=t=>Object.is(t,-0)?0:t;return i(t<e?e:t>o?o:t)}function n(t=""){return`${t}${i()}`}},88696:function(t,e,o){o.a(t,async function(t,i){try{o.d(e,{P:function(){return h}});var s=o(69235),n=(o(3362),o(17642),o(58004),o(33853),o(45876),o(32475),o(15024),o(31698),o(62953),o(37540)),r=o(42017),a=t([s]);s=(a.then?(await a)():a)[0];class h{handleChanges(t){var e;this.value=null===(e=this.callback)||void 0===e?void 0:e.call(this,t,this.u)}hostConnected(){for(const t of this.t)this.observe(t)}hostDisconnected(){this.disconnect()}async hostUpdated(){!this.o&&this.i&&this.handleChanges([]),this.i=!1}observe(t){this.t.add(t),this.u.observe(t,this.l),this.i=!0,this.h.requestUpdate()}unobserve(t){this.t.delete(t),this.u.unobserve(t)}disconnect(){this.u.disconnect()}target(t){return l(this,t)}constructor(t,{target:e,config:o,callback:i,skipInitial:s}){this.t=new Set,this.o=!1,this.i=!1,this.h=t,null!==e&&this.t.add(null!=e?e:t),this.l=o,this.o=null!=s?s:this.o,this.callback=i,window.ResizeObserver?(this.u=new ResizeObserver(t=>{this.handleChanges(t),this.h.requestUpdate()}),t.addController(this)):console.warn("ResizeController error: browser does not support ResizeObserver.")}}const l=(0,r.u$)(class extends n.Kq{render(t,e){}update(t,[e,o]){this.controller=e,this.part=t,this.observe=o,!1===o?(e.unobserve(t.element),this.observing=!1):!1===this.observing&&(e.observe(t.element),this.observing=!0)}disconnected(){var t;null!==(t=this.controller)&&void 0!==t&&t.unobserve(this.part.element),this.observing=!1}reconnected(){var t;!1!==this.observe&&!1===this.observing&&(null!==(t=this.controller)&&void 0!==t&&t.observe(this.part.element),this.observing=!0)}constructor(){super(...arguments),this.observing=!1}});i()}catch(h){i(h)}})},95192:function(t,e,o){o.d(e,{IU:function(){return l},Jt:function(){return a},Yd:function(){return i},hZ:function(){return h},y$:function(){return s}});o(44114),o(18111),o(7588),o(61701),o(3362),o(62953);function i(t){return new Promise((e,o)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>o(t.error)})}function s(t,e){let o;return(s,n)=>(()=>{if(o)return o;const s=indexedDB.open(t);return s.onupgradeneeded=()=>s.result.createObjectStore(e),o=i(s),o.then(t=>{t.onclose=()=>o=void 0},()=>{}),o})().then(t=>n(t.transaction(e,s).objectStore(e)))}let n;function r(){return n||(n=s("keyval-store","keyval")),n}function a(t,e=r()){return e("readonly",e=>i(e.get(t)))}function h(t,e,o=r()){return o("readwrite",o=>(o.put(e,t),i(o.transaction)))}function l(t=r()){return t("readwrite",t=>(t.clear(),i(t.transaction)))}},37540:function(t,e,o){o.d(e,{Kq:function(){return u}});o(17642),o(58004),o(33853),o(45876),o(32475),o(15024),o(31698),o(62953);var i=o(63937),s=o(42017);const n=(t,e)=>{const o=t._$AN;if(void 0===o)return!1;for(const s of o){var i;null!==(i=s._$AO)&&void 0!==i&&i.call(s,e,!1),n(s,e)}return!0},r=t=>{let e,o;do{var i;if(void 0===(e=t._$AM))break;o=e._$AN,o.delete(t),t=e}while(0===(null===(i=o)||void 0===i?void 0:i.size))},a=t=>{for(let e;e=t._$AM;t=e){let o=e._$AN;if(void 0===o)e._$AN=o=new Set;else if(o.has(t))break;o.add(t),d(e)}};function h(t){void 0!==this._$AN?(r(this),this._$AM=t,a(this)):this._$AM=t}function l(t,e=!1,o=0){const i=this._$AH,s=this._$AN;if(void 0!==s&&0!==s.size)if(e)if(Array.isArray(i))for(let a=o;a<i.length;a++)n(i[a],!1),r(i[a]);else null!=i&&(n(i,!1),r(i));else n(this,t)}const d=t=>{var e,o;t.type==s.OA.CHILD&&(null!==(e=t._$AP)&&void 0!==e||(t._$AP=l),null!==(o=t._$AQ)&&void 0!==o||(t._$AQ=h))};class u extends s.WL{_$AT(t,e,o){super._$AT(t,e,o),a(this),this.isConnected=t._$AU}_$AO(t,e=!0){var o,i;t!==this.isConnected&&(this.isConnected=t,t?null===(o=this.reconnected)||void 0===o||o.call(this):null===(i=this.disconnected)||void 0===i||i.call(this)),e&&(n(this,t),r(this))}setValue(t){if((0,i.Rt)(this._$Ct))this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}constructor(){super(...arguments),this._$AN=void 0}}},54495:function(t,e,o){o.d(e,{OA:function(){return i.OA},WL:function(){return i.WL},u$:function(){return i.u$}});var i=o(42017)},89784:function(t,e,o){o.d(e,{W:function(){return a}});o(16280),o(74423),o(72712),o(18111),o(18237),o(27495),o(17642),o(58004),o(33853),o(45876),o(32475),o(15024),o(31698),o(25440),o(62953);var i=o(5055),s=o(42017);const n="important",r=" !"+n,a=(0,s.u$)(class extends s.WL{render(t){return Object.keys(t).reduce((e,o)=>{const i=t[o];return null==i?e:e+`${o=o.includes("-")?o:o.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`},"")}update(t,[e]){const{style:o}=t.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(e)),this.render(e);for(const i of this.ft)null==e[i]&&(this.ft.delete(i),i.includes("-")?o.removeProperty(i):o[i]=null);for(const i in e){const t=e[i];if(null!=t){this.ft.add(i);const e="string"==typeof t&&t.endsWith(r);i.includes("-")||e?o.setProperty(i,e?t.slice(0,-11):t,e?n:""):o[i]=t}}return i.c0}constructor(t){var e;if(super(t),t.type!==s.OA.ATTRIBUTE||"style"!==t.name||(null===(e=t.strings)||void 0===e?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}})}}]);