UNPKG

iobroker.lovelace

Version:

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

5 lines 12.1 kB
/*! For license information please see 54192.68377e98d6bfa32e.js.LICENSE.txt */ export const __rspack_esm_id=54192;export const __rspack_esm_ids=[54192];export const __webpack_modules__={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}},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),l=o(28438),d=o(98779),p=o(27259),c=o(25877),u=o(984),f=o(95010),w=o(9395),v=o(717),b=o(40158),y=o(51920),g=t([b]);b=(g.then?(await g)():g)[0];var m=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&&m(e,o,n),n};let C=class extends v.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,f.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,p.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,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=y.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:()=>l,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 l(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),d(e)}};function h(t){void 0!==this._$AN?(s(this),this._$AM=t,a(this)):this._$AM=t}function l(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 d=t=>{t.type==r.OA.CHILD&&(t._$AP??=l,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}}},91335(t,e,o){o.d(e,{Tc:()=>d});o(74423),o(44114),o(18111),o(20116),o(61701),o(45367),o(92731);let i=["Shift","Meta","Alt","Control"],r="object"==typeof navigator?navigator.platform:"",n=/Mac|iPod|iPhone|iPad/.test(r)?"Meta":"Control",s="Win32"===r?["Control","Alt"]:["Alt"];function a(t){let e=t.target;return t.repeat||t.isComposing||e!==t.currentTarget&&e.matches("[contenteditable],input,select,textarea")}function h(t,e){return"function"==typeof t.getModifierState&&(t.getModifierState(e)||s.includes(e)&&t.getModifierState("AltGraph"))}function l(t,[e,o,r]){const n=e.includes("AltGraph");return!((r instanceof RegExp?!r.test(t.key)&&!r.test(t.code):r.toUpperCase()!==t.key.toUpperCase()&&r!==t.code)||e.find(e=>!h(t,e))||i.find(i=>!e.includes(i)&&!o.includes(i)&&r!==i&&h(t,i)&&!(n&&s.includes(i))))}function d(t,e,o={}){let i=o.event??"keydown",r=function(t,e={}){let o=e.timeout??1e3,i=e.ignore??a,r=Object.keys(t).map(e=>{return[e,(o=e,o.trim().split(" ").map(t=>{let e=function(t){let e=[],o=0;for(let i=0;i<t.length;i++)"+"===t[i]&&/[\w\]]/.test(t[i-1]||"")&&(e.push(t.slice(o,i)),o=i+1);return e.push(t.slice(o)),e}(t),o=e.pop(),i=o.match(/^\((.+)\)$/),r=i?new RegExp(`^(?:${i[1]})$`,"i"):o,s=[],a=[];for(const t of e){let e=t.match(/^\[(.*)\]$/),o=e?.[1]??t;o="$mod"===o?n:o,e?a.push(o):s.push(o)}return[s,a,r]})),t[e]];var o}),s=new Map,d=null;return t=>{if(!function(t){return!!(t.key&&t.code&&t.getModifierState)}(t)||i(t))return;let e=[];for(let[o,i,n]of r){let r=s.get(o),[a,...d]=r||i;if(l(t,a))if(d.length>0)s.set(o,d),e.push(o);else{if(s.delete(o),!e.length){n(t);break}console.warn(`tinykeys: Conflict found, "${o}" did not fire, waiting for:`,e)}else h(t,t.key)||s.delete(o)}d&&clearTimeout(d),d=setTimeout(()=>s.clear(),o)}}(e,o);return t.addEventListener(i,r,o.capture),()=>{t.removeEventListener(i,r,o.capture)}}}};