iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
5 lines • 12 kB
JavaScript
/*! For license information please see 75208.d61ee8c62a17a79d.js.LICENSE.txt */
export const __rspack_esm_id=75208;export const __rspack_esm_ids=[75208];export const __webpack_modules__={12451(t,e,o){o.d(e,{O:()=>n,i:()=>r.is});var i=o(5124),r=o(12130);class n extends i.WF{click(){if(this.mdcRoot)return this.mdcRoot.focus(),void this.mdcRoot.click();super.click()}createFoundation(){void 0!==this.mdcFoundation&&this.mdcFoundation.destroy(),this.mdcFoundationClass&&(this.mdcFoundation=new this.mdcFoundationClass(this.createAdapter()),this.mdcFoundation.init())}firstUpdated(){this.createFoundation()}}},12130(t,e,o){o.d(e,{SE:()=>d,U9:()=>h,hP:()=>i,is:()=>r});o(44114);const i=t=>t.nodeType===Node.ELEMENT_NODE;function r(t){return{addClass:e=>{t.classList.add(e)},removeClass:e=>{t.classList.remove(e)},hasClass:e=>t.classList.contains(e)}}let n=!1;const s=()=>{},a={get passive(){return n=!0,!1}};document.addEventListener("x",s,a),document.removeEventListener("x",s);const h=(t=window.document)=>{let e=t.activeElement;const o=[];if(!e)return o;for(;e&&(o.push(e),e.shadowRoot);)e=e.shadowRoot.activeElement;return o},d=t=>{const e=h();if(!e.length)return!1;const o=e[e.length-1],i=new Event("check-if-focused",{bubbles:!0,composed:!0});let r=[];const n=t=>{r=t.composedPath()};return document.body.addEventListener("check-if-focused",n),o.dispatchEvent(i),document.body.removeEventListener("check-if-focused",n),-1!==r.indexOf(t)}},35370(t,e,o){var i=o(26198);t.exports=function(t,e,o){for(var r=0,n=arguments.length>2?o:i(e),s=new t(n);n>r;)s[r]=e[r++];return s}},77957(t,e,o){var i=o(76080),r=o(79504),n=o(47055),s=o(48981),a=o(56969),h=o(26198),d=o(2360),l=o(35370),p=Array,c=r([].push);t.exports=function(t,e,o,r){for(var u,v,w,m=s(t),b=n(m),f=i(e,o),y=d(null),g=h(b),A=0;g>A;A++)w=b[A],(v=a(f(w,A,m)))in y?c(y[v],w):y[v]=[w];if(r&&(u=r(m))!==p)for(v in y)y[v]=l(u,y[v]);return y}},46058(t,e,o){var i=o(46518),r=o(77957),n=o(6469);i({target:"Array",proto:!0},{group:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}}),n("group")},52630(t,e,o){o.a(t,async function(t,i){try{o.d(e,{A:()=>C});o(74423),o(44114),o(18111),o(22489);var r=o(5124),n=o(22441),s=o(6412),a=o(17051),h=o(42462),d=o(28438),l=o(98779),p=o(27259),c=o(25877),u=o(984),v=o(95010),w=o(9395),m=o(717),b=o(40158),f=o(51920),y=t([b]);b=(y.then?(await y)():y)[0];var g=Object.defineProperty,A=Object.getOwnPropertyDescriptor,_=(t,e,o,i)=>{for(var r,n=i>1?void 0:i?A(e,o):e,s=t.length-1;s>=0;s--)(r=t[s])&&(n=(i?r(e,o,n):r(n))||n);return i&&n&&g(e,o,n),n};let C=class extends m.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 l.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,p.Ud)(this.popup.popup,"show-with-scale"),this.popup.reposition(),this.dispatchEvent(new h.q)}else{const t=new d.L;if(this.dispatchEvent(t),t.defaultPrevented)return void(this.open=!1);document.removeEventListener("keydown",this.handleDocumentKeyDown),(0,c.Fw)(this),await(0,p.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,u.l)(this,"wa-after-show")}async hide(){if(this.open)return this.open=!1,(0,u.l)(this,"wa-after-hide")}render(){return r.qy` <wa-popup part="base" exportparts="
popup:base__popup,
arrow:base__arrow
" class="${(0,s.H)({tooltip:!0,"tooltip-open":this.open})}" placement="${this.placement}" distance="${this.distance}" skidding="${this.skidding}" flip shift ?arrow="${!this.withoutArrow}" hover-bridge .anchor="${this.anchor}"> <div part="body" class="body"> <slot></slot> </div> </wa-popup> `}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")){const t=Boolean(this.anchor?.matches(":hover")),e=this.matches(":hover");if(t||e)return;clearTimeout(this.hoverTimeout),t||e||(this.hoverTimeout=window.setTimeout(()=>{this.hide()},this.hideDelay))}}}};C.css=f.A,C.dependencies={"wa-popup":b.A},_([(0,n.P)("slot:not([name])")],C.prototype,"defaultSlot",2),_([(0,n.P)(".body")],C.prototype,"body",2),_([(0,n.P)("wa-popup")],C.prototype,"popup",2),_([(0,n.MZ)()],C.prototype,"placement",2),_([(0,n.MZ)({type:Boolean,reflect:!0})],C.prototype,"disabled",2),_([(0,n.MZ)({type:Number})],C.prototype,"distance",2),_([(0,n.MZ)({type:Boolean,reflect:!0})],C.prototype,"open",2),_([(0,n.MZ)({type:Number})],C.prototype,"skidding",2),_([(0,n.MZ)({attribute:"show-delay",type:Number})],C.prototype,"showDelay",2),_([(0,n.MZ)({attribute:"hide-delay",type:Number})],C.prototype,"hideDelay",2),_([(0,n.MZ)()],C.prototype,"trigger",2),_([(0,n.MZ)({attribute:"without-arrow",type:Boolean,reflect:!0})],C.prototype,"withoutArrow",2),_([(0,n.MZ)()],C.prototype,"for",2),_([(0,n.wk)()],C.prototype,"anchor",2),_([(0,w.w)("open",{waitUntilFirstUpdate:!0})],C.prototype,"handleOpenChange",1),_([(0,w.w)("for")],C.prototype,"handleForChange",1),_([(0,w.w)(["distance","placement","skidding"])],C.prototype,"handleOptionsChange",1),_([(0,w.w)("disabled")],C.prototype,"handleDisabledChange",1),C=_([(0,n.EM)("wa-tooltip")],C),i()}catch(t){i(t)}})},51920(t,e,o){o.d(e,{A:()=>i});var i=o(5124).AH`: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(t,e,o){function i(t,e){return new Promise(o=>{t.addEventListener(e,function i(r){r.target===t&&(t.removeEventListener(e,i),o())})})}o.d(e,{l:()=>i})},95010(t,e,o){o.d(e,{q:()=>i,N:()=>r});o(16573),o(78100),o(77936),o(37467),o(44732),o(79577),o(16632),o(34226),o(9486),o(20456);function i(t,e,o){const i=t=>Object.is(t,-0)?0:t;return i(t<e?e:t>o?o:t)}function r(t=""){return`${t}${((t=21)=>{let e="",o=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&o[t]];return e})()}`}},95192(t,e,o){o.d(e,{IU:()=>d,Jt:()=>a,Yd:()=>i,hZ:()=>h,y$:()=>r});o(44114),o(18111),o(7588),o(61701);function i(t){return new Promise((e,o)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>o(t.error)})}function r(t,e){let o;return(r,n)=>(()=>{if(o)return o;const r=indexedDB.open(t);return r.onupgradeneeded=()=>r.result.createObjectStore(e),o=i(r),o.then(t=>{t.onclose=()=>o=void 0},()=>{}),o})().then(t=>n(t.transaction(e,r).objectStore(e)))}let n;function s(){return n||(n=r("keyval-store","keyval")),n}function a(t,e=s()){return e("readonly",e=>i(e.get(t)))}function h(t,e,o=s()){return o("readwrite",o=>(o.put(e,t),i(o.transaction)))}function d(t=s()){return t("readwrite",t=>(t.clear(),i(t.transaction)))}},37540(t,e,o){o.d(e,{Kq:()=>p});o(17642),o(58004),o(33853),o(45876),o(32475),o(15024),o(31698);var i=o(63937),r=o(42017);const n=(t,e)=>{const o=t._$AN;if(void 0===o)return!1;for(const t of o)t._$AO?.(e,!1),n(t,e);return!0},s=t=>{let e,o;do{if(void 0===(e=t._$AM))break;o=e._$AN,o.delete(t),t=e}while(0===o?.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),l(e)}};function h(t){void 0!==this._$AN?(s(this),this._$AM=t,a(this)):this._$AM=t}function d(t,e=!1,o=0){const i=this._$AH,r=this._$AN;if(void 0!==r&&0!==r.size)if(e)if(Array.isArray(i))for(let t=o;t<i.length;t++)n(i[t],!1),s(i[t]);else null!=i&&(n(i,!1),s(i));else n(this,t)}const l=t=>{t.type==r.OA.CHILD&&(t._$AP??=d,t._$AQ??=h)};class p extends r.WL{_$AT(t,e,o){super._$AT(t,e,o),a(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(n(this,t),s(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}}}};