UNPKG

iobroker.lovelace

Version:

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

5 lines 11.9 kB
/*! For license information please see 54066.a40e063ed87e328c.js.LICENSE.txt */ "use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[54066],{52630:function(t,e,o){o.a(t,async function(t,i){try{o.d(e,{A:function(){return T}});o(74423),o(44114),o(18111),o(22489),o(3362),o(27495),o(62953);var r=o(5124),n=o(67576),a=o(6412),s=o(17051),l=o(42462),h=o(28438),p=o(98779),d=o(27259),c=o(25877),u=o(984),f=o(95010),v=o(9395),w=o(717),m=o(40158),b=o(51920),g=t([m]);m=(g.then?(await g)():g)[0];let E,C=t=>t;var y=Object.defineProperty,A=Object.getOwnPropertyDescriptor,k=(t,e,o,i)=>{for(var r,n=i>1?void 0:i?A(e,o):e,a=t.length-1;a>=0;a--)(r=t[a])&&(n=(i?r(e,o,n):r(n))||n);return i&&n&&y(e,o,n),n};let T=class extends w.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 p.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,d.Ud)(this.popup.popup,"show-with-scale"),this.popup.reposition(),this.dispatchEvent(new l.q)}else{const t=new h.L;if(this.dispatchEvent(t),t.defaultPrevented)return void(this.open=!1);document.removeEventListener("keydown",this.handleDocumentKeyDown),(0,c.Fw)(this),await(0,d.Ud)(this.popup.popup,"hide-with-scale"),this.popup.active=!1,this.body.hidden=!0,this.dispatchEvent(new s.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(0,r.qy)(E||(E=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,a.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))}}}};T.css=b.A,T.dependencies={"wa-popup":m.A},k([(0,n.P)("slot:not([name])")],T.prototype,"defaultSlot",2),k([(0,n.P)(".body")],T.prototype,"body",2),k([(0,n.P)("wa-popup")],T.prototype,"popup",2),k([(0,n.MZ)()],T.prototype,"placement",2),k([(0,n.MZ)({type:Boolean,reflect:!0})],T.prototype,"disabled",2),k([(0,n.MZ)({type:Number})],T.prototype,"distance",2),k([(0,n.MZ)({type:Boolean,reflect:!0})],T.prototype,"open",2),k([(0,n.MZ)({type:Number})],T.prototype,"skidding",2),k([(0,n.MZ)({attribute:"show-delay",type:Number})],T.prototype,"showDelay",2),k([(0,n.MZ)({attribute:"hide-delay",type:Number})],T.prototype,"hideDelay",2),k([(0,n.MZ)()],T.prototype,"trigger",2),k([(0,n.MZ)({attribute:"without-arrow",type:Boolean,reflect:!0})],T.prototype,"withoutArrow",2),k([(0,n.MZ)()],T.prototype,"for",2),k([(0,n.wk)()],T.prototype,"anchor",2),k([(0,v.w)("open",{waitUntilFirstUpdate:!0})],T.prototype,"handleOpenChange",1),k([(0,v.w)("for")],T.prototype,"handleForChange",1),k([(0,v.w)(["distance","placement","skidding"])],T.prototype,"handleOptionsChange",1),k([(0,v.w)("disabled")],T.prototype,"handleDisabledChange",1),T=k([(0,n.EM)("wa-tooltip")],T),i()}catch(E){i(E)}})},51920:function(t,e,o){o.d(e,{A:function(){return r}});let i;var r=(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(r){r.target===t&&(t.removeEventListener(e,i),o())})})}},31247:function(t,e,o){o.d(e,{v:function(){return i}});o(18111),o(22489),o(61701),o(42762);function i(t){return t.split(" ").map(t=>t.trim()).filter(t=>""!==t)}},15477:function(t,e,o){o.d(e,{A:function(){return r}});let i;var r=(0,o(5124).AH)(i||(i=(t=>t)`:host{display:flex;flex-direction:column}[part~=form-control]{display:contents}:is([part~=form-control-label],[part~=label]).has-label,:is([part~=form-control-label],[part~=label]):has(:not(:empty)){display:inline-flex;color:var(--wa-form-control-label-color);font-weight:var(--wa-form-control-label-font-weight);line-height:var(--wa-form-control-label-line-height);margin-block-end:0.5em}:host([required]) :is([part~=form-control-label],[part~=label])::after{content:var(--wa-form-control-required-content);margin-inline-start:var(--wa-form-control-required-content-offset);color:var(--wa-form-control-required-content-color)}[part~=hint]{display:block;color:var(--wa-form-control-hint-color);font-weight:var(--wa-form-control-hint-font-weight);line-height:var(--wa-form-control-hint-line-height);margin-block-start:0.5em;font-size:var(--wa-font-size-smaller)}[part~=hint]:not(.has-slotted,.has-hint){display:none}`))},34514:function(t,e,o){o.d(e,{V:function(){return a}});o(16280),o(62953);var i=o(5055),r=o(42017),n=o(63937);const a=(0,r.u$)(class extends r.WL{render(t){return t}update(t,[e]){if(e===i.c0||e===i.s6)return e;const o=t.element,a=t.name;if(t.type===r.OA.PROPERTY){if(e===o[a])return i.c0}else if(t.type===r.OA.BOOLEAN_ATTRIBUTE){if(!!e===o.hasAttribute(a))return i.c0}else if(t.type===r.OA.ATTRIBUTE&&o.getAttribute(a)===e+"")return i.c0;return(0,n.mY)(t),e}constructor(t){if(super(t),t.type!==r.OA.PROPERTY&&t.type!==r.OA.ATTRIBUTE&&t.type!==r.OA.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!(0,n.Rt)(t))throw Error("`live` bindings can only contain a single expression")}})},91335:function(t,e,o){o.d(e,{Tc:function(){return c}});o(74423),o(44114),o(18111),o(20116),o(61701),o(45367),o(92731),o(84864),o(57465),o(27495),o(42762),o(62953);let i=["Shift","Meta","Alt","Control"],r=1e3,n="keydown",a="object"==typeof navigator?navigator.platform:"",s=/Mac|iPod|iPhone|iPad/.test(a)?"Meta":"Control",l="Win32"===a?["Control","Alt"]:["Alt"];function h(t){let e=t.target;return t.repeat||t.isComposing||e!==t.currentTarget&&e.matches("[contenteditable],input,select,textarea")}function p(t,e){return"function"==typeof t.getModifierState&&(t.getModifierState(e)||l.includes(e)&&t.getModifierState("AltGraph"))}function d(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=>!p(t,e))||i.find(i=>!e.includes(i)&&!o.includes(i)&&r!==i&&p(t,i)&&!(n&&l.includes(i))))}function c(t,e,o={}){var i;let a=null!==(i=o.event)&&void 0!==i?i:n,l=function(t,e={}){var o,i;let n=null!==(o=e.timeout)&&void 0!==o?o:r,a=null!==(i=e.ignore)&&void 0!==i?i:h,l=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,n=[],a=[];for(const h of e){var l;let t=h.match(/^\[(.*)\]$/),e=null!==(l=null==t?void 0:t[1])&&void 0!==l?l:h;e="$mod"===e?s:e,t?a.push(e):n.push(e)}return[n,a,r]})),t[e]];var o}),c=new Map,u=null;return t=>{if(!function(t){return!!(t.key&&t.code&&t.getModifierState)}(t)||a(t))return;let e=[];for(let[o,i,r]of l){let n=c.get(o),[a,...s]=n||i;if(d(t,a))if(s.length>0)c.set(o,s),e.push(o);else{if(c.delete(o),!e.length){r(t);break}console.warn(`tinykeys: Conflict found, "${o}" did not fire, waiting for:`,e)}else p(t,t.key)||c.delete(o)}u&&clearTimeout(u),u=setTimeout(()=>c.clear(),n)}}(e,o);return t.addEventListener(a,l,o.capture),()=>{t.removeEventListener(a,l,o.capture)}}}}]);